@samanhappy/mcphub 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.js +9 -3
- package/dist/config/index.js.map +1 -1
- package/dist/controllers/authController.js +16 -11
- package/dist/controllers/authController.js.map +1 -1
- package/dist/controllers/dxtController.js +3 -7
- package/dist/controllers/dxtController.js.map +1 -1
- package/dist/controllers/groupController.js +4 -1
- package/dist/controllers/groupController.js.map +1 -1
- package/dist/controllers/serverController.js +14 -2
- package/dist/controllers/serverController.js.map +1 -1
- package/dist/controllers/userController.js +239 -0
- package/dist/controllers/userController.js.map +1 -0
- package/dist/middlewares/index.js +14 -2
- package/dist/middlewares/index.js.map +1 -1
- package/dist/middlewares/userContext.js +104 -0
- package/dist/middlewares/userContext.js.map +1 -0
- package/dist/routes/index.js +8 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/server.js +23 -14
- package/dist/server.js.map +1 -1
- package/dist/services/dataService.js +18 -0
- package/dist/services/dataService.js.map +1 -0
- package/dist/services/groupService.js +7 -2
- package/dist/services/groupService.js.map +1 -1
- package/dist/services/mcpService.js +220 -119
- package/dist/services/mcpService.js.map +1 -1
- package/dist/services/registry.js +34 -0
- package/dist/services/registry.js.map +1 -0
- package/dist/services/services.js +9 -0
- package/dist/services/services.js.map +1 -0
- package/dist/services/sseService.js +40 -10
- package/dist/services/sseService.js.map +1 -1
- package/dist/services/userContextService.js +49 -0
- package/dist/services/userContextService.js.map +1 -0
- package/dist/services/userService.js +100 -0
- package/dist/services/userService.js.map +1 -0
- package/dist/utils/path.js +3 -7
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/serialization.js +59 -0
- package/dist/utils/serialization.js.map +1 -0
- package/dist/utils/version.js +1 -5
- package/dist/utils/version.js.map +1 -1
- package/frontend/dist/assets/index-B2iLsxRr.css +1 -0
- package/frontend/dist/assets/index-BXCRwJIg.js +187 -0
- package/frontend/dist/assets/index-BXCRwJIg.js.map +1 -0
- package/frontend/dist/index.html +8 -2
- package/package.json +3 -1
- package/frontend/dist/assets/index-BS_54XZ9.js +0 -186
- package/frontend/dist/assets/index-BS_54XZ9.js.map +0 -1
- package/frontend/dist/assets/index-DVcFHJ6u.css +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function qh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ac={exports:{}},Cl={};/**
|
|
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 Jm;function ex(){if(Jm)return Cl;Jm=1;var s=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(c,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:s,type:c,key:m,ref:d!==void 0?d:null,props:f}}return Cl.Fragment=i,Cl.jsx=r,Cl.jsxs=r,Cl}var Im;function tx(){return Im||(Im=1,Ac.exports=ex()),Ac.exports}var l=tx(),Rc={exports:{}},Ce={};/**
|
|
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 Wm;function ax(){if(Wm)return Ce;Wm=1;var s=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=j&&N[j]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function O(N,G,te){this.props=N,this.context=G,this.refs=E,this.updater=te||T}O.prototype.isReactComponent={},O.prototype.setState=function(N,G){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,G,"setState")},O.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function R(){}R.prototype=O.prototype;function A(N,G,te){this.props=N,this.context=G,this.refs=E,this.updater=te||T}var $=A.prototype=new R;$.constructor=A,S($,O.prototype),$.isPureReactComponent=!0;var F=Array.isArray,B={H:null,A:null,T:null,S:null,V:null},oe=Object.prototype.hasOwnProperty;function Q(N,G,te,ae,de,we){return te=we.ref,{$$typeof:s,type:N,key:G,ref:te!==void 0?te:null,props:we}}function H(N,G){return Q(N.type,G,void 0,void 0,void 0,N.props)}function I(N){return typeof N=="object"&&N!==null&&N.$$typeof===s}function ne(N){var G={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(te){return G[te]})}var L=/\/+/g;function V(N,G){return typeof N=="object"&&N!==null&&N.key!=null?ne(""+N.key):G.toString(36)}function se(){}function X(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(se,se):(N.status="pending",N.then(function(G){N.status==="pending"&&(N.status="fulfilled",N.value=G)},function(G){N.status==="pending"&&(N.status="rejected",N.reason=G)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function Y(N,G,te,ae,de){var we=typeof N;(we==="undefined"||we==="boolean")&&(N=null);var ee=!1;if(N===null)ee=!0;else switch(we){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(N.$$typeof){case s:case i:ee=!0;break;case y:return ee=N._init,Y(ee(N._payload),G,te,ae,de)}}if(ee)return de=de(N),ee=ae===""?"."+V(N,0):ae,F(de)?(te="",ee!=null&&(te=ee.replace(L,"$&/")+"/"),Y(de,G,te,"",function(xe){return xe})):de!=null&&(I(de)&&(de=H(de,te+(de.key==null||N&&N.key===de.key?"":(""+de.key).replace(L,"$&/")+"/")+ee)),G.push(de)),1;ee=0;var le=ae===""?".":ae+":";if(F(N))for(var ce=0;ce<N.length;ce++)ae=N[ce],we=le+V(ae,ce),ee+=Y(ae,G,te,we,de);else if(ce=v(N),typeof ce=="function")for(N=ce.call(N),ce=0;!(ae=N.next()).done;)ae=ae.value,we=le+V(ae,ce++),ee+=Y(ae,G,te,we,de);else if(we==="object"){if(typeof N.then=="function")return Y(X(N),G,te,ae,de);throw G=String(N),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ee}function k(N,G,te){if(N==null)return N;var ae=[],de=0;return Y(N,ae,"","",function(we){return G.call(te,we,de++)}),ae}function q(N){if(N._status===-1){var G=N._result;G=G(),G.then(function(te){(N._status===0||N._status===-1)&&(N._status=1,N._result=te)},function(te){(N._status===0||N._status===-1)&&(N._status=2,N._result=te)}),N._status===-1&&(N._status=0,N._result=G)}if(N._status===1)return N._result.default;throw N._result}var z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function re(){}return Ce.Children={map:k,forEach:function(N,G,te){k(N,function(){G.apply(this,arguments)},te)},count:function(N){var G=0;return k(N,function(){G++}),G},toArray:function(N){return k(N,function(G){return G})||[]},only:function(N){if(!I(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},Ce.Component=O,Ce.Fragment=r,Ce.Profiler=d,Ce.PureComponent=A,Ce.StrictMode=c,Ce.Suspense=g,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(N){return B.H.useMemoCache(N)}},Ce.cache=function(N){return function(){return N.apply(null,arguments)}},Ce.cloneElement=function(N,G,te){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ae=S({},N.props),de=N.key,we=void 0;if(G!=null)for(ee in G.ref!==void 0&&(we=void 0),G.key!==void 0&&(de=""+G.key),G)!oe.call(G,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&G.ref===void 0||(ae[ee]=G[ee]);var ee=arguments.length-2;if(ee===1)ae.children=te;else if(1<ee){for(var le=Array(ee),ce=0;ce<ee;ce++)le[ce]=arguments[ce+2];ae.children=le}return Q(N.type,de,void 0,void 0,we,ae)},Ce.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},Ce.createElement=function(N,G,te){var ae,de={},we=null;if(G!=null)for(ae in G.key!==void 0&&(we=""+G.key),G)oe.call(G,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(de[ae]=G[ae]);var ee=arguments.length-2;if(ee===1)de.children=te;else if(1<ee){for(var le=Array(ee),ce=0;ce<ee;ce++)le[ce]=arguments[ce+2];de.children=le}if(N&&N.defaultProps)for(ae in ee=N.defaultProps,ee)de[ae]===void 0&&(de[ae]=ee[ae]);return Q(N,we,void 0,void 0,null,de)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(N){return{$$typeof:p,render:N}},Ce.isValidElement=I,Ce.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:q}},Ce.memo=function(N,G){return{$$typeof:h,type:N,compare:G===void 0?null:G}},Ce.startTransition=function(N){var G=B.T,te={};B.T=te;try{var ae=N(),de=B.S;de!==null&&de(te,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(re,z)}catch(we){z(we)}finally{B.T=G}},Ce.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Ce.use=function(N){return B.H.use(N)},Ce.useActionState=function(N,G,te){return B.H.useActionState(N,G,te)},Ce.useCallback=function(N,G){return B.H.useCallback(N,G)},Ce.useContext=function(N){return B.H.useContext(N)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(N,G){return B.H.useDeferredValue(N,G)},Ce.useEffect=function(N,G,te){var ae=B.H;if(typeof te=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ae.useEffect(N,G)},Ce.useId=function(){return B.H.useId()},Ce.useImperativeHandle=function(N,G,te){return B.H.useImperativeHandle(N,G,te)},Ce.useInsertionEffect=function(N,G){return B.H.useInsertionEffect(N,G)},Ce.useLayoutEffect=function(N,G){return B.H.useLayoutEffect(N,G)},Ce.useMemo=function(N,G){return B.H.useMemo(N,G)},Ce.useOptimistic=function(N,G){return B.H.useOptimistic(N,G)},Ce.useReducer=function(N,G,te){return B.H.useReducer(N,G,te)},Ce.useRef=function(N){return B.H.useRef(N)},Ce.useState=function(N){return B.H.useState(N)},Ce.useSyncExternalStore=function(N,G,te){return B.H.useSyncExternalStore(N,G,te)},Ce.useTransition=function(){return B.H.useTransition()},Ce.version="19.1.0",Ce}var eh;function Wc(){return eh||(eh=1,Rc.exports=ax()),Rc.exports}var w=Wc();const Gc=qh(w);var Oc={exports:{}},El={},Mc={exports:{}},zc={};/**
|
|
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 th;function nx(){return th||(th=1,function(s){function i(k,q){var z=k.length;k.push(q);e:for(;0<z;){var re=z-1>>>1,N=k[re];if(0<d(N,q))k[re]=q,k[z]=N,z=re;else break e}}function r(k){return k.length===0?null:k[0]}function c(k){if(k.length===0)return null;var q=k[0],z=k.pop();if(z!==q){k[0]=z;e:for(var re=0,N=k.length,G=N>>>1;re<G;){var te=2*(re+1)-1,ae=k[te],de=te+1,we=k[de];if(0>d(ae,z))de<N&&0>d(we,ae)?(k[re]=we,k[de]=z,re=de):(k[re]=ae,k[te]=z,re=te);else if(de<N&&0>d(we,z))k[re]=we,k[de]=z,re=de;else break e}}return q}function d(k,q){var z=k.sortIndex-q.sortIndex;return z!==0?z:k.id-q.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();s.unstable_now=function(){return m.now()-p}}var g=[],h=[],y=1,j=null,v=3,T=!1,S=!1,E=!1,O=!1,R=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function F(k){for(var q=r(h);q!==null;){if(q.callback===null)c(h);else if(q.startTime<=k)c(h),q.sortIndex=q.expirationTime,i(g,q);else break;q=r(h)}}function B(k){if(E=!1,F(k),!S)if(r(g)!==null)S=!0,oe||(oe=!0,V());else{var q=r(h);q!==null&&Y(B,q.startTime-k)}}var oe=!1,Q=-1,H=5,I=-1;function ne(){return O?!0:!(s.unstable_now()-I<H)}function L(){if(O=!1,oe){var k=s.unstable_now();I=k;var q=!0;try{e:{S=!1,E&&(E=!1,A(Q),Q=-1),T=!0;var z=v;try{t:{for(F(k),j=r(g);j!==null&&!(j.expirationTime>k&&ne());){var re=j.callback;if(typeof re=="function"){j.callback=null,v=j.priorityLevel;var N=re(j.expirationTime<=k);if(k=s.unstable_now(),typeof N=="function"){j.callback=N,F(k),q=!0;break t}j===r(g)&&c(g),F(k)}else c(g);j=r(g)}if(j!==null)q=!0;else{var G=r(h);G!==null&&Y(B,G.startTime-k),q=!1}}break e}finally{j=null,v=z,T=!1}q=void 0}}finally{q?V():oe=!1}}}var V;if(typeof $=="function")V=function(){$(L)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,X=se.port2;se.port1.onmessage=L,V=function(){X.postMessage(null)}}else V=function(){R(L,0)};function Y(k,q){Q=R(function(){k(s.unstable_now())},q)}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(k){k.callback=null},s.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<k?Math.floor(1e3/k):5},s.unstable_getCurrentPriorityLevel=function(){return v},s.unstable_next=function(k){switch(v){case 1:case 2:case 3:var q=3;break;default:q=v}var z=v;v=q;try{return k()}finally{v=z}},s.unstable_requestPaint=function(){O=!0},s.unstable_runWithPriority=function(k,q){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var z=v;v=k;try{return q()}finally{v=z}},s.unstable_scheduleCallback=function(k,q,z){var re=s.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?re+z:re):z=re,k){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=z+N,k={id:y++,callback:q,priorityLevel:k,startTime:z,expirationTime:N,sortIndex:-1},z>re?(k.sortIndex=z,i(h,k),r(g)===null&&k===r(h)&&(E?(A(Q),Q=-1):E=!0,Y(B,z-re))):(k.sortIndex=N,i(g,k),S||T||(S=!0,oe||(oe=!0,V()))),k},s.unstable_shouldYield=ne,s.unstable_wrapCallback=function(k){var q=v;return function(){var z=v;v=q;try{return k.apply(this,arguments)}finally{v=z}}}}(zc)),zc}var ah;function sx(){return ah||(ah=1,Mc.exports=nx()),Mc.exports}var Dc={exports:{}},pt={};/**
|
|
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 nh;function lx(){if(nh)return pt;nh=1;var s=Wc();function i(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}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 r(){}var c={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,h,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:g,containerInfo:h,implementation:y}}var m=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,pt.createPortal=function(g,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(i(299));return f(g,h,null,y)},pt.flushSync=function(g){var h=m.T,y=c.p;try{if(m.T=null,c.p=2,g)return g()}finally{m.T=h,c.p=y,c.d.f()}},pt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,c.d.C(g,h))},pt.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},pt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,j=p(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,T=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?c.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:T}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:T,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},pt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=p(h.as,h.crossOrigin);c.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&c.d.M(g)},pt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,j=p(y,h.crossOrigin);c.d.L(g,y,{crossOrigin:j,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})}},pt.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=p(h.as,h.crossOrigin);c.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else c.d.m(g)},pt.requestFormReset=function(g){c.d.r(g)},pt.unstable_batchedUpdates=function(g,h){return g(h)},pt.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},pt.useFormStatus=function(){return m.H.useHostTransitionStatus()},pt.version="19.1.0",pt}var sh;function rx(){if(sh)return Dc.exports;sh=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(i){console.error(i)}}return s(),Dc.exports=lx(),Dc.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 lh;function ix(){if(lh)return El;lh=1;var s=sx(),i=Wc(),r=rx();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(c(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var o=a.return;if(o===null)break;var u=o.alternate;if(u===null){if(n=o.return,n!==null){a=n;continue}break}if(o.child===u.child){for(u=o.child;u;){if(u===a)return p(o),e;if(u===n)return p(o),t;u=u.sibling}throw Error(c(188))}if(a.return!==n.return)a=o,n=u;else{for(var x=!1,b=o.child;b;){if(b===a){x=!0,a=o,n=u;break}if(b===n){x=!0,n=o,a=u;break}b=b.sibling}if(!x){for(b=u.child;b;){if(b===a){x=!0,a=u,n=o;break}if(b===n){x=!0,n=u,a=o;break}b=b.sibling}if(!x)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function h(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=h(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,j=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),$=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function V(e){return e===null||typeof e!="object"?null:(e=L&&e[L]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function X(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case O:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case oe:return"SuspenseList";case I:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case $:return(e.displayName||"Context")+".Provider";case A:return(e._context.displayName||"Context")+".Consumer";case F:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:X(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return X(e(t))}catch{}}return null}var Y=Array.isArray,k=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},re=[],N=-1;function G(e){return{current:e}}function te(e){0>N||(e.current=re[N],re[N]=null,N--)}function ae(e,t){N++,re[N]=e.current,e.current=t}var de=G(null),we=G(null),ee=G(null),le=G(null);function ce(e,t){switch(ae(ee,t),ae(we,e),ae(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cm(t),e=Em(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}te(de),ae(de,e)}function xe(){te(de),te(we),te(ee)}function Be(e){e.memoizedState!==null&&ae(le,e);var t=de.current,a=Em(t,e.type);t!==a&&(ae(we,e),ae(de,a))}function je(e){we.current===e&&(te(de),te(we)),le.current===e&&(te(le),vl._currentValue=z)}var De=Object.prototype.hasOwnProperty,Ze=s.unstable_scheduleCallback,Ct=s.unstable_cancelCallback,ua=s.unstable_shouldYield,rn=s.unstable_requestPaint,Le=s.unstable_now,vt=s.unstable_getCurrentPriorityLevel,Ra=s.unstable_ImmediatePriority,Oa=s.unstable_UserBlockingPriority,da=s.unstable_NormalPriority,Ma=s.unstable_LowPriority,As=s.unstable_IdlePriority,Vl=s.log,ql=s.unstable_setDisableYieldValue,za=null,mt=null;function Yt(e){if(typeof Vl=="function"&&ql(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(za,e)}catch{}}var ht=Math.clz32?Math.clz32:Kl,Gl=Math.log,$l=Math.LN2;function Kl(e){return e>>>=0,e===0?32:31-(Gl(e)/$l|0)|0}var on=256,cn=4194304;function ta(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;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 un(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var o=0,u=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var b=n&134217727;return b!==0?(n=b&~u,n!==0?o=ta(n):(x&=b,x!==0?o=ta(x):a||(a=b&~e,a!==0&&(o=ta(a))))):(b=n&~u,b!==0?o=ta(b):x!==0?o=ta(x):a||(a=n&~e,a!==0&&(o=ta(a)))),o===0?0:t!==0&&t!==o&&(t&u)===0&&(u=o&-o,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:o}function ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ie(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pe(){var e=on;return on<<=1,(on&4194048)===0&&(on=256),e}function Pt(){var e=cn;return cn<<=1,(cn&62914560)===0&&(cn=4194304),e}function Xt(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Qt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dn(e,t,a,n,o,u){var x=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 b=e.entanglements,C=e.expirationTimes,_=e.hiddenUpdates;for(a=x&~a;0<a;){var Z=31-ht(a),W=1<<Z;b[Z]=0,C[Z]=-1;var K=_[Z];if(K!==null)for(_[Z]=null,Z=0;Z<K.length;Z++){var P=K[Z];P!==null&&(P.lane&=-536870913)}a&=~W}n!==0&&Yl(e,n,0),u!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=u&~(x&~t))}function Yl(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-ht(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&4194090}function Et(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-ht(a),o=1<<n;o&t|e[n]&t&&(e[n]|=t),a&=~o}}function aa(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 Mn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rs(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Ym(e.type))}function Pl(e,t){var a=q.p;try{return q.p=e,t()}finally{q.p=a}}var Ft=Math.random().toString(36).slice(2),tt="__reactFiber$"+Ft,yt="__reactProps$"+Ft,zn="__reactContainer$"+Ft,vi="__reactEvents$"+Ft,Kg="__reactListeners$"+Ft,Yg="__reactHandles$"+Ft,fu="__reactResources$"+Ft,Os="__reactMarker$"+Ft;function wi(e){delete e[tt],delete e[yt],delete e[vi],delete e[Kg],delete e[Yg]}function Dn(e){var t=e[tt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[zn]||a[tt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Rm(e);e!==null;){if(a=e[tt])return a;e=Rm(e)}return t}e=a,a=e.parentNode}return null}function Un(e){if(e=e[tt]||e[zn]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Ms(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Ln(e){var t=e[fu];return t||(t=e[fu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function rt(e){e[Os]=!0}var mu=new Set,hu={};function fn(e,t){_n(e,t),_n(e+"Capture",t)}function _n(e,t){for(hu[e]=t,e=0;e<t.length;e++)mu.add(t[e])}var Pg=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]*$"),gu={},pu={};function Xg(e){return De.call(pu,e)?!0:De.call(gu,e)?!1:Pg.test(e)?pu[e]=!0:(gu[e]=!0,!1)}function Xl(e,t,a){if(Xg(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ql(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function fa(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}var ji,xu;function Hn(e){if(ji===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ji=t&&t[1]||"",xu=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ji+e+xu}var Si=!1;function Ni(e,t){if(!e||Si)return"";Si=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(P){var K=P}Reflect.construct(e,[],W)}else{try{W.call()}catch(P){K=P}e.call(W.prototype)}}else{try{throw Error()}catch(P){K=P}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(P){if(P&&K&&typeof P.stack=="string")return[P.stack,K.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=n.DetermineComponentFrameRoot(),x=u[0],b=u[1];if(x&&b){var C=x.split(`
|
|
44
|
+
`),_=b.split(`
|
|
45
|
+
`);for(o=n=0;n<C.length&&!C[n].includes("DetermineComponentFrameRoot");)n++;for(;o<_.length&&!_[o].includes("DetermineComponentFrameRoot");)o++;if(n===C.length||o===_.length)for(n=C.length-1,o=_.length-1;1<=n&&0<=o&&C[n]!==_[o];)o--;for(;1<=n&&0<=o;n--,o--)if(C[n]!==_[o]){if(n!==1||o!==1)do if(n--,o--,0>o||C[n]!==_[o]){var Z=`
|
|
46
|
+
`+C[n].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=n&&0<=o);break}}}finally{Si=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Hn(a):""}function Qg(e){switch(e.tag){case 26:case 27:case 5:return Hn(e.type);case 16:return Hn("Lazy");case 13:return Hn("Suspense");case 19:return Hn("SuspenseList");case 0:case 15:return Ni(e.type,!1);case 11:return Ni(e.type.render,!1);case 1:return Ni(e.type,!0);case 31:return Hn("Activity");default:return""}}function yu(e){try{var t="";do t+=Qg(e),e=e.return;while(e);return t}catch(a){return`
|
|
47
|
+
Error generating stack: `+a.message+`
|
|
48
|
+
`+a.stack}}function Ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fg(e){var t=bu(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(x){n=""+x,u.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(x){n=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fl(e){e._valueTracker||(e._valueTracker=Fg(e))}function vu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=bu(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Zl(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 Zg=/[\n"\\]/g;function Lt(e){return e.replace(Zg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ci(e,t,a,n,o,u,x,b){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ut(t)):e.value!==""+Ut(t)&&(e.value=""+Ut(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Ei(e,x,Ut(t)):a!=null?Ei(e,x,Ut(a)):n!=null&&e.removeAttribute("value"),o==null&&u!=null&&(e.defaultChecked=!!u),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Ut(b):e.removeAttribute("name")}function wu(e,t,a,n,o,u,x,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null))return;a=a!=null?""+Ut(a):"",t=t!=null?""+Ut(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}n=n??o,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=b?e.checked:!!n,e.defaultChecked=!!n,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x)}function Ei(e,t,a){t==="number"&&Zl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Bn(e,t,a,n){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Ut(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ju(e,t,a){if(t!=null&&(t=""+Ut(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ut(a):""}function Su(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(Y(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Ut(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n)}function Vn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Jg=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 Nu(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||Jg.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Cu(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var o in t)n=t[o],t.hasOwnProperty(o)&&a[o]!==n&&Nu(e,o,n)}else for(var u in t)t.hasOwnProperty(u)&&Nu(e,u,t[u])}function ki(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 Ig=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"]]),Wg=/^[\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 Jl(e){return Wg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ti=null;function Ai(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qn=null,Gn=null;function Eu(e){var t=Un(e);if(t&&(e=t.stateNode)){var a=e[yt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ci(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Lt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var o=n[yt]||null;if(!o)throw Error(c(90));Ci(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&vu(n)}break e;case"textarea":ju(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Bn(e,!!a.multiple,t,!1)}}}var Ri=!1;function ku(e,t,a){if(Ri)return e(t,a);Ri=!0;try{var n=e(t);return n}finally{if(Ri=!1,(qn!==null||Gn!==null)&&(Lr(),qn&&(t=qn,e=Gn,Gn=qn=null,Eu(t),e)))for(t=0;t<e.length;t++)Eu(e[t])}}function zs(e,t){var a=e.stateNode;if(a===null)return null;var n=a[yt]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oi=!1;if(ma)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){Oi=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{Oi=!1}var Da=null,Mi=null,Il=null;function Tu(){if(Il)return Il;var e,t=Mi,a=t.length,n,o="value"in Da?Da.value:Da.textContent,u=o.length;for(e=0;e<a&&t[e]===o[e];e++);var x=a-e;for(n=1;n<=x&&t[a-n]===o[u-n];n++);return Il=o.slice(e,1<n?1-n:void 0)}function Wl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function er(){return!0}function Au(){return!1}function wt(e){function t(a,n,o,u,x){this._reactName=a,this._targetInst=o,this.type=n,this.nativeEvent=u,this.target=x,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?er:Au,this.isPropagationStopped=Au,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=er)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=er)},persist:function(){},isPersistent:er}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tr=wt(mn),Us=y({},mn,{view:0,detail:0}),ep=wt(Us),zi,Di,Ls,ar=y({},Us,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Li,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!==Ls&&(Ls&&e.type==="mousemove"?(zi=e.screenX-Ls.screenX,Di=e.screenY-Ls.screenY):Di=zi=0,Ls=e),zi)},movementY:function(e){return"movementY"in e?e.movementY:Di}}),Ru=wt(ar),tp=y({},ar,{dataTransfer:0}),ap=wt(tp),np=y({},Us,{relatedTarget:0}),Ui=wt(np),sp=y({},mn,{animationName:0,elapsedTime:0,pseudoElement:0}),lp=wt(sp),rp=y({},mn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ip=wt(rp),op=y({},mn,{data:0}),Ou=wt(op),cp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},up={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"},dp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dp[e])?!!t[e]:!1}function Li(){return fp}var mp=y({},Us,{key:function(e){if(e.key){var t=cp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?up[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Li,charCode:function(e){return e.type==="keypress"?Wl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hp=wt(mp),gp=y({},ar,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mu=wt(gp),pp=y({},Us,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Li}),xp=wt(pp),yp=y({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0}),bp=wt(yp),vp=y({},ar,{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}),wp=wt(vp),jp=y({},mn,{newState:0,oldState:0}),Sp=wt(jp),Np=[9,13,27,32],_i=ma&&"CompositionEvent"in window,_s=null;ma&&"documentMode"in document&&(_s=document.documentMode);var Cp=ma&&"TextEvent"in window&&!_s,zu=ma&&(!_i||_s&&8<_s&&11>=_s),Du=" ",Uu=!1;function Lu(e,t){switch(e){case"keyup":return Np.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _u(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $n=!1;function Ep(e,t){switch(e){case"compositionend":return _u(t);case"keypress":return t.which!==32?null:(Uu=!0,Du);case"textInput":return e=t.data,e===Du&&Uu?null:e;default:return null}}function kp(e,t){if($n)return e==="compositionend"||!_i&&Lu(e,t)?(e=Tu(),Il=Mi=Da=null,$n=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zu&&t.locale!=="ko"?null:t.data;default:return null}}var Tp={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 Hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Tp[e.type]:t==="textarea"}function Bu(e,t,a,n){qn?Gn?Gn.push(n):Gn=[n]:qn=n,t=Gr(t,"onChange"),0<t.length&&(a=new tr("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Hs=null,Bs=null;function Ap(e){vm(e,0)}function nr(e){var t=Ms(e);if(vu(t))return e}function Vu(e,t){if(e==="change")return t}var qu=!1;if(ma){var Hi;if(ma){var Bi="oninput"in document;if(!Bi){var Gu=document.createElement("div");Gu.setAttribute("oninput","return;"),Bi=typeof Gu.oninput=="function"}Hi=Bi}else Hi=!1;qu=Hi&&(!document.documentMode||9<document.documentMode)}function $u(){Hs&&(Hs.detachEvent("onpropertychange",Ku),Bs=Hs=null)}function Ku(e){if(e.propertyName==="value"&&nr(Bs)){var t=[];Bu(t,Bs,e,Ai(e)),ku(Ap,t)}}function Rp(e,t,a){e==="focusin"?($u(),Hs=t,Bs=a,Hs.attachEvent("onpropertychange",Ku)):e==="focusout"&&$u()}function Op(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nr(Bs)}function Mp(e,t){if(e==="click")return nr(t)}function zp(e,t){if(e==="input"||e==="change")return nr(t)}function Dp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:Dp;function Vs(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var o=a[n];if(!De.call(t,o)||!kt(e[o],t[o]))return!1}return!0}function Yu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pu(e,t){var a=Yu(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Yu(a)}}function Xu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zl(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Zl(e.document)}return t}function Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Up=ma&&"documentMode"in document&&11>=document.documentMode,Kn=null,qi=null,qs=null,Gi=!1;function Fu(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Gi||Kn==null||Kn!==Zl(n)||(n=Kn,"selectionStart"in n&&Vi(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qs&&Vs(qs,n)||(qs=n,n=Gr(qi,"onSelect"),0<n.length&&(t=new tr("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Kn)))}function hn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Yn={animationend:hn("Animation","AnimationEnd"),animationiteration:hn("Animation","AnimationIteration"),animationstart:hn("Animation","AnimationStart"),transitionrun:hn("Transition","TransitionRun"),transitionstart:hn("Transition","TransitionStart"),transitioncancel:hn("Transition","TransitionCancel"),transitionend:hn("Transition","TransitionEnd")},$i={},Zu={};ma&&(Zu=document.createElement("div").style,"AnimationEvent"in window||(delete Yn.animationend.animation,delete Yn.animationiteration.animation,delete Yn.animationstart.animation),"TransitionEvent"in window||delete Yn.transitionend.transition);function gn(e){if($i[e])return $i[e];if(!Yn[e])return e;var t=Yn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Zu)return $i[e]=t[a];return e}var Ju=gn("animationend"),Iu=gn("animationiteration"),Wu=gn("animationstart"),Lp=gn("transitionrun"),_p=gn("transitionstart"),Hp=gn("transitioncancel"),ed=gn("transitionend"),td=new Map,Ki="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(" ");Ki.push("scrollEnd");function Zt(e,t){td.set(e,t),fn(t,[e])}var ad=new WeakMap;function _t(e,t){if(typeof e=="object"&&e!==null){var a=ad.get(e);return a!==void 0?a:(t={value:e,source:t,stack:yu(t)},ad.set(e,t),t)}return{value:e,source:t,stack:yu(t)}}var Ht=[],Pn=0,Yi=0;function sr(){for(var e=Pn,t=Yi=Pn=0;t<e;){var a=Ht[t];Ht[t++]=null;var n=Ht[t];Ht[t++]=null;var o=Ht[t];Ht[t++]=null;var u=Ht[t];if(Ht[t++]=null,n!==null&&o!==null){var x=n.pending;x===null?o.next=o:(o.next=x.next,x.next=o),n.pending=o}u!==0&&nd(a,o,u)}}function lr(e,t,a,n){Ht[Pn++]=e,Ht[Pn++]=t,Ht[Pn++]=a,Ht[Pn++]=n,Yi|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Pi(e,t,a,n){return lr(e,t,a,n),rr(e)}function Xn(e,t){return lr(e,null,null,t),rr(e)}function nd(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var o=!1,u=e.return;u!==null;)u.childLanes|=a,n=u.alternate,n!==null&&(n.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(o=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,o&&t!==null&&(o=31-ht(a),e=u.hiddenUpdates,n=e[o],n===null?e[o]=[t]:n.push(t),t.lane=a|536870912),u):null}function rr(e){if(50<fl)throw fl=0,Wo=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qn={};function Bp(e,t,a,n){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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,a,n){return new Bp(e,t,a,n)}function Xi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ha(e,t){var a=e.alternate;return a===null?(a=Tt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,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,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function sd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=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,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ir(e,t,a,n,o,u){var x=0;if(n=e,typeof e=="function")Xi(e)&&(x=1);else if(typeof e=="string")x=q0(e,a,de.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case I:return e=Tt(31,a,t,o),e.elementType=I,e.lanes=u,e;case S:return pn(a.children,o,u,t);case E:x=8,o|=24;break;case O:return e=Tt(12,a,t,o|2),e.elementType=O,e.lanes=u,e;case B:return e=Tt(13,a,t,o),e.elementType=B,e.lanes=u,e;case oe:return e=Tt(19,a,t,o),e.elementType=oe,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:case $:x=10;break e;case A:x=9;break e;case F:x=11;break e;case Q:x=14;break e;case H:x=16,n=null;break e}x=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=Tt(x,a,t,o),t.elementType=e,t.type=n,t.lanes=u,t}function pn(e,t,a,n){return e=Tt(7,e,n,t),e.lanes=a,e}function Qi(e,t,a){return e=Tt(6,e,null,t),e.lanes=a,e}function Fi(e,t,a){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fn=[],Zn=0,or=null,cr=0,Bt=[],Vt=0,xn=null,ga=1,pa="";function yn(e,t){Fn[Zn++]=cr,Fn[Zn++]=or,or=e,cr=t}function ld(e,t,a){Bt[Vt++]=ga,Bt[Vt++]=pa,Bt[Vt++]=xn,xn=e;var n=ga;e=pa;var o=32-ht(n)-1;n&=~(1<<o),a+=1;var u=32-ht(t)+o;if(30<u){var x=o-o%5;u=(n&(1<<x)-1).toString(32),n>>=x,o-=x,ga=1<<32-ht(t)+o|a<<o|n,pa=u+e}else ga=1<<u|a<<o|n,pa=e}function Zi(e){e.return!==null&&(yn(e,1),ld(e,1,0))}function Ji(e){for(;e===or;)or=Fn[--Zn],Fn[Zn]=null,cr=Fn[--Zn],Fn[Zn]=null;for(;e===xn;)xn=Bt[--Vt],Bt[Vt]=null,pa=Bt[--Vt],Bt[Vt]=null,ga=Bt[--Vt],Bt[Vt]=null}var bt=null,Qe=null,Ue=!1,bn=null,na=!1,Ii=Error(c(519));function vn(e){var t=Error(c(418,""));throw Ks(_t(t,e)),Ii}function rd(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[tt]=e,t[yt]=n,a){case"dialog":Re("cancel",t),Re("close",t);break;case"iframe":case"object":case"embed":Re("load",t);break;case"video":case"audio":for(a=0;a<hl.length;a++)Re(hl[a],t);break;case"source":Re("error",t);break;case"img":case"image":case"link":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"input":Re("invalid",t),wu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),Fl(t);break;case"select":Re("invalid",t);break;case"textarea":Re("invalid",t),Su(t,n.value,n.defaultValue,n.children),Fl(t)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Nm(t.textContent,a)?(n.popover!=null&&(Re("beforetoggle",t),Re("toggle",t)),n.onScroll!=null&&Re("scroll",t),n.onScrollEnd!=null&&Re("scrollend",t),n.onClick!=null&&(t.onclick=$r),t=!0):t=!1,t||vn(e)}function id(e){for(bt=e.return;bt;)switch(bt.tag){case 5:case 13:na=!1;return;case 27:case 3:na=!0;return;default:bt=bt.return}}function Gs(e){if(e!==bt)return!1;if(!Ue)return id(e),Ue=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||gc(e.type,e.memoizedProps)),a=!a),a&&Qe&&vn(e),id(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){Qe=It(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}Qe=null}}else t===27?(t=Qe,Za(e.type)?(e=bc,bc=null,Qe=e):Qe=t):Qe=bt?It(e.stateNode.nextSibling):null;return!0}function $s(){Qe=bt=null,Ue=!1}function od(){var e=bn;return e!==null&&(Nt===null?Nt=e:Nt.push.apply(Nt,e),bn=null),e}function Ks(e){bn===null?bn=[e]:bn.push(e)}var Wi=G(null),wn=null,xa=null;function Ua(e,t,a){ae(Wi,t._currentValue),t._currentValue=a}function ya(e){e._currentValue=Wi.current,te(Wi)}function eo(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function to(e,t,a,n){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){var x=o.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=o;for(var C=0;C<t.length;C++)if(b.context===t[C]){u.lanes|=a,b=u.alternate,b!==null&&(b.lanes|=a),eo(u.return,a,e),n||(x=null);break e}u=b.next}}else if(o.tag===18){if(x=o.return,x===null)throw Error(c(341));x.lanes|=a,u=x.alternate,u!==null&&(u.lanes|=a),eo(x,a,e),x=null}else x=o.child;if(x!==null)x.return=o;else for(x=o;x!==null;){if(x===e){x=null;break}if(o=x.sibling,o!==null){o.return=x.return,x=o;break}x=x.return}o=x}}function Ys(e,t,a,n){e=null;for(var o=t,u=!1;o!==null;){if(!u){if((o.flags&524288)!==0)u=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var x=o.alternate;if(x===null)throw Error(c(387));if(x=x.memoizedProps,x!==null){var b=o.type;kt(o.pendingProps.value,x.value)||(e!==null?e.push(b):e=[b])}}else if(o===le.current){if(x=o.alternate,x===null)throw Error(c(387));x.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(vl):e=[vl])}o=o.return}e!==null&&to(t,e,a,n),t.flags|=262144}function ur(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function jn(e){wn=e,xa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function gt(e){return cd(wn,e)}function dr(e,t){return wn===null&&jn(e),cd(e,t)}function cd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},xa===null){if(e===null)throw Error(c(308));xa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xa=xa.next=t;return a}var Vp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},qp=s.unstable_scheduleCallback,Gp=s.unstable_NormalPriority,at={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ao(){return{controller:new Vp,data:new Map,refCount:0}}function Ps(e){e.refCount--,e.refCount===0&&qp(Gp,function(){e.controller.abort()})}var Xs=null,no=0,Jn=0,In=null;function $p(e,t){if(Xs===null){var a=Xs=[];no=0,Jn=rc(),In={status:"pending",value:void 0,then:function(n){a.push(n)}}}return no++,t.then(ud,ud),t}function ud(){if(--no===0&&Xs!==null){In!==null&&(In.status="fulfilled");var e=Xs;Xs=null,Jn=0,In=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Kp(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(o){a.push(o)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var o=0;o<a.length;o++)(0,a[o])(t)},function(o){for(n.status="rejected",n.reason=o,o=0;o<a.length;o++)(0,a[o])(void 0)}),n}var dd=k.S;k.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&$p(e,t),dd!==null&&dd(e,t)};var Sn=G(null);function so(){var e=Sn.current;return e!==null?e:Ke.pooledCache}function fr(e,t){t===null?ae(Sn,Sn.current):ae(Sn,t.pool)}function fd(){var e=so();return e===null?null:{parent:at._currentValue,pool:e}}var Qs=Error(c(460)),md=Error(c(474)),mr=Error(c(542)),lo={then:function(){}};function hd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function hr(){}function gd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(hr,hr),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xd(e),e;default:if(typeof t.status=="string")t.then(hr,hr);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=n}},function(n){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xd(e),e}throw Fs=t,Qs}}var Fs=null;function pd(){if(Fs===null)throw Error(c(459));var e=Fs;return Fs=null,e}function xd(e){if(e===Qs||e===mr)throw Error(c(483))}var La=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function io(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _a(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(_e&2)!==0){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,t=rr(e),nd(e,null,a),t}return lr(e,n,t,a),rr(e)}function Zs(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Et(e,a)}}function oo(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var o=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?o=u=x:u=u.next=x,a=a.next}while(a!==null);u===null?o=u=t:u=u.next=t}else o=u=t;a={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:u,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var co=!1;function Js(){if(co){var e=In;if(e!==null)throw e}}function Is(e,t,a,n){co=!1;var o=e.updateQueue;La=!1;var u=o.firstBaseUpdate,x=o.lastBaseUpdate,b=o.shared.pending;if(b!==null){o.shared.pending=null;var C=b,_=C.next;C.next=null,x===null?u=_:x.next=_,x=C;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,b=Z.lastBaseUpdate,b!==x&&(b===null?Z.firstBaseUpdate=_:b.next=_,Z.lastBaseUpdate=C))}if(u!==null){var W=o.baseState;x=0,Z=_=C=null,b=u;do{var K=b.lane&-536870913,P=K!==b.lane;if(P?(Me&K)===K:(n&K)===K){K!==0&&K===Jn&&(co=!0),Z!==null&&(Z=Z.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ve=e,ye=b;K=t;var Ge=a;switch(ye.tag){case 1:if(ve=ye.payload,typeof ve=="function"){W=ve.call(Ge,W,K);break e}W=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ye.payload,K=typeof ve=="function"?ve.call(Ge,W,K):ve,K==null)break e;W=y({},W,K);break e;case 2:La=!0}}K=b.callback,K!==null&&(e.flags|=64,P&&(e.flags|=8192),P=o.callbacks,P===null?o.callbacks=[K]:P.push(K))}else P={lane:K,tag:b.tag,payload:b.payload,callback:b.callback,next:null},Z===null?(_=Z=P,C=W):Z=Z.next=P,x|=K;if(b=b.next,b===null){if(b=o.shared.pending,b===null)break;P=b,b=P.next,P.next=null,o.lastBaseUpdate=P,o.shared.pending=null}}while(!0);Z===null&&(C=W),o.baseState=C,o.firstBaseUpdate=_,o.lastBaseUpdate=Z,u===null&&(o.shared.lanes=0),Pa|=x,e.lanes=x,e.memoizedState=W}}function yd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function bd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)yd(a[e],t)}var Wn=G(null),gr=G(0);function vd(e,t){e=Ca,ae(gr,e),ae(Wn,t),Ca=e|t.baseLanes}function uo(){ae(gr,Ca),ae(Wn,Wn.current)}function fo(){Ca=gr.current,te(Wn),te(gr)}var Ba=0,Ee=null,Ve=null,We=null,pr=!1,es=!1,Nn=!1,xr=0,Ws=0,ts=null,Yp=0;function Je(){throw Error(c(321))}function mo(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!kt(e[a],t[a]))return!1;return!0}function ho(e,t,a,n,o,u){return Ba=u,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?nf:sf,Nn=!1,u=a(n,o),Nn=!1,es&&(u=jd(t,a,n,o)),wd(e),u}function wd(e){k.H=Sr;var t=Ve!==null&&Ve.next!==null;if(Ba=0,We=Ve=Ee=null,pr=!1,Ws=0,ts=null,t)throw Error(c(300));e===null||it||(e=e.dependencies,e!==null&&ur(e)&&(it=!0))}function jd(e,t,a,n){Ee=e;var o=0;do{if(es&&(ts=null),Ws=0,es=!1,25<=o)throw Error(c(301));if(o+=1,We=Ve=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}k.H=Ip,u=t(a,n)}while(es);return u}function Pp(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?el(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Ee.flags|=1024),t}function go(){var e=xr!==0;return xr=0,e}function po(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function xo(e){if(pr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}pr=!1}Ba=0,We=Ve=Ee=null,es=!1,Ws=xr=0,ts=null}function jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Ee.memoizedState=We=e:We=We.next=e,We}function et(){if(Ve===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=We===null?Ee.memoizedState:We.next;if(t!==null)We=t,Ve=e;else{if(e===null)throw Ee.alternate===null?Error(c(467)):Error(c(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},We===null?Ee.memoizedState=We=e:We=We.next=e}return We}function yo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function el(e){var t=Ws;return Ws+=1,ts===null&&(ts=[]),e=gd(ts,e,t),t=Ee,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?nf:sf),e}function yr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return el(e);if(e.$$typeof===$)return gt(e)}throw Error(c(438,String(e)))}function bo(e){var t=null,a=Ee.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Ee.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=yo(),Ee.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=ne;return t.index++,a}function ba(e,t){return typeof t=="function"?t(e):t}function br(e){var t=et();return vo(t,Ve,e)}function vo(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var o=e.baseQueue,u=n.pending;if(u!==null){if(o!==null){var x=o.next;o.next=u.next,u.next=x}t.baseQueue=o=u,n.pending=null}if(u=e.baseState,o===null)e.memoizedState=u;else{t=o.next;var b=x=null,C=null,_=t,Z=!1;do{var W=_.lane&-536870913;if(W!==_.lane?(Me&W)===W:(Ba&W)===W){var K=_.revertLane;if(K===0)C!==null&&(C=C.next={lane:0,revertLane:0,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),W===Jn&&(Z=!0);else if((Ba&K)===K){_=_.next,K===Jn&&(Z=!0);continue}else W={lane:0,revertLane:_.revertLane,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},C===null?(b=C=W,x=u):C=C.next=W,Ee.lanes|=K,Pa|=K;W=_.action,Nn&&a(u,W),u=_.hasEagerState?_.eagerState:a(u,W)}else K={lane:W,revertLane:_.revertLane,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},C===null?(b=C=K,x=u):C=C.next=K,Ee.lanes|=W,Pa|=W;_=_.next}while(_!==null&&_!==t);if(C===null?x=u:C.next=b,!kt(u,e.memoizedState)&&(it=!0,Z&&(a=In,a!==null)))throw a;e.memoizedState=u,e.baseState=x,e.baseQueue=C,n.lastRenderedState=u}return o===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function wo(e){var t=et(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,o=a.pending,u=t.memoizedState;if(o!==null){a.pending=null;var x=o=o.next;do u=e(u,x.action),x=x.next;while(x!==o);kt(u,t.memoizedState)||(it=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,n]}function Sd(e,t,a){var n=Ee,o=et(),u=Ue;if(u){if(a===void 0)throw Error(c(407));a=a()}else a=t();var x=!kt((Ve||o).memoizedState,a);x&&(o.memoizedState=a,it=!0),o=o.queue;var b=Ed.bind(null,n,o,e);if(tl(2048,8,b,[e]),o.getSnapshot!==t||x||We!==null&&We.memoizedState.tag&1){if(n.flags|=2048,as(9,vr(),Cd.bind(null,n,o,a,t),null),Ke===null)throw Error(c(349));u||(Ba&124)!==0||Nd(n,t,a)}return a}function Nd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ee.updateQueue,t===null?(t=yo(),Ee.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Cd(e,t,a,n){t.value=a,t.getSnapshot=n,kd(t)&&Td(e)}function Ed(e,t,a){return a(function(){kd(t)&&Td(e)})}function kd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!kt(e,a)}catch{return!0}}function Td(e){var t=Xn(e,2);t!==null&&zt(t,e,2)}function jo(e){var t=jt();if(typeof e=="function"){var a=e;if(e=a(),Nn){Yt(!0);try{a()}finally{Yt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:e},t}function Ad(e,t,a,n){return e.baseState=a,vo(e,Ve,typeof n=="function"?n:ba)}function Xp(e,t,a,n,o){if(jr(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){u.listeners.push(x)}};k.T!==null?a(!0):u.isTransition=!1,n(u),a=t.pending,a===null?(u.next=t.pending=u,Rd(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Rd(e,t){var a=t.action,n=t.payload,o=e.state;if(t.isTransition){var u=k.T,x={};k.T=x;try{var b=a(o,n),C=k.S;C!==null&&C(x,b),Od(e,t,b)}catch(_){So(e,t,_)}finally{k.T=u}}else try{u=a(o,n),Od(e,t,u)}catch(_){So(e,t,_)}}function Od(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Md(e,t,n)},function(n){return So(e,t,n)}):Md(e,t,a)}function Md(e,t,a){t.status="fulfilled",t.value=a,zd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Rd(e,a)))}function So(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,zd(t),t=t.next;while(t!==n)}e.action=null}function zd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Dd(e,t){return t}function Ud(e,t){if(Ue){var a=Ke.formState;if(a!==null){e:{var n=Ee;if(Ue){if(Qe){t:{for(var o=Qe,u=na;o.nodeType!==8;){if(!u){o=null;break t}if(o=It(o.nextSibling),o===null){o=null;break t}}u=o.data,o=u==="F!"||u==="F"?o:null}if(o){Qe=It(o.nextSibling),n=o.data==="F!";break e}}vn(n)}n=!1}n&&(t=a[0])}}return a=jt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dd,lastRenderedState:t},a.queue=n,a=ef.bind(null,Ee,n),n.dispatch=a,n=jo(!1),u=To.bind(null,Ee,!1,n.queue),n=jt(),o={state:t,dispatch:null,action:e,pending:null},n.queue=o,a=Xp.bind(null,Ee,o,u,a),o.dispatch=a,n.memoizedState=e,[t,a,!1]}function Ld(e){var t=et();return _d(t,Ve,e)}function _d(e,t,a){if(t=vo(e,t,Dd)[0],e=br(ba)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=el(t)}catch(x){throw x===Qs?mr:x}else n=t;t=et();var o=t.queue,u=o.dispatch;return a!==t.memoizedState&&(Ee.flags|=2048,as(9,vr(),Qp.bind(null,o,a),null)),[n,u,e]}function Qp(e,t){e.action=t}function Hd(e){var t=et(),a=Ve;if(a!==null)return _d(t,a,e);et(),t=t.memoizedState,a=et();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function as(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=yo(),Ee.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function vr(){return{destroy:void 0,resource:void 0}}function Bd(){return et().memoizedState}function wr(e,t,a,n){var o=jt();n=n===void 0?null:n,Ee.flags|=e,o.memoizedState=as(1|t,vr(),a,n)}function tl(e,t,a,n){var o=et();n=n===void 0?null:n;var u=o.memoizedState.inst;Ve!==null&&n!==null&&mo(n,Ve.memoizedState.deps)?o.memoizedState=as(t,u,a,n):(Ee.flags|=e,o.memoizedState=as(1|t,u,a,n))}function Vd(e,t){wr(8390656,8,e,t)}function qd(e,t){tl(2048,8,e,t)}function Gd(e,t){return tl(4,2,e,t)}function $d(e,t){return tl(4,4,e,t)}function Kd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Yd(e,t,a){a=a!=null?a.concat([e]):null,tl(4,4,Kd.bind(null,t,e),a)}function No(){}function Pd(e,t){var a=et();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&mo(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Xd(e,t){var a=et();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&mo(t,n[1]))return n[0];if(n=e(),Nn){Yt(!0);try{e()}finally{Yt(!1)}}return a.memoizedState=[n,t],n}function Co(e,t,a){return a===void 0||(Ba&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=Jf(),Ee.lanes|=e,Pa|=e,a)}function Qd(e,t,a,n){return kt(a,t)?a:Wn.current!==null?(e=Co(e,a,n),kt(e,t)||(it=!0),e):(Ba&42)===0?(it=!0,e.memoizedState=a):(e=Jf(),Ee.lanes|=e,Pa|=e,t)}function Fd(e,t,a,n,o){var u=q.p;q.p=u!==0&&8>u?u:8;var x=k.T,b={};k.T=b,To(e,!1,t,a);try{var C=o(),_=k.S;if(_!==null&&_(b,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var Z=Kp(C,n);al(e,t,Z,Mt(e))}else al(e,t,n,Mt(e))}catch(W){al(e,t,{then:function(){},status:"rejected",reason:W},Mt())}finally{q.p=u,k.T=x}}function Fp(){}function Eo(e,t,a,n){if(e.tag!==5)throw Error(c(476));var o=Zd(e).queue;Fd(e,o,t,z,a===null?Fp:function(){return Jd(e),a(n)})}function Zd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:z},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jd(e){var t=Zd(e).next.queue;al(e,t,{},Mt())}function ko(){return gt(vl)}function Id(){return et().memoizedState}function Wd(){return et().memoizedState}function Zp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Mt();e=_a(a);var n=Ha(t,e,a);n!==null&&(zt(n,t,a),Zs(n,t,a)),t={cache:ao()},e.payload=t;return}t=t.return}}function Jp(e,t,a){var n=Mt();a={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},jr(e)?tf(t,a):(a=Pi(e,t,a,n),a!==null&&(zt(a,e,n),af(a,t,n)))}function ef(e,t,a){var n=Mt();al(e,t,a,n)}function al(e,t,a,n){var o={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(jr(e))tf(t,o);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var x=t.lastRenderedState,b=u(x,a);if(o.hasEagerState=!0,o.eagerState=b,kt(b,x))return lr(e,t,o,0),Ke===null&&sr(),!1}catch{}finally{}if(a=Pi(e,t,o,n),a!==null)return zt(a,e,n),af(a,t,n),!0}return!1}function To(e,t,a,n){if(n={lane:2,revertLane:rc(),action:n,hasEagerState:!1,eagerState:null,next:null},jr(e)){if(t)throw Error(c(479))}else t=Pi(e,a,n,2),t!==null&&zt(t,e,2)}function jr(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function tf(e,t){es=pr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function af(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Et(e,a)}}var Sr={readContext:gt,use:yr,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je},nf={readContext:gt,use:yr,useCallback:function(e,t){return jt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Vd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,wr(4194308,4,Kd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return wr(4194308,4,e,t)},useInsertionEffect:function(e,t){wr(4,2,e,t)},useMemo:function(e,t){var a=jt();t=t===void 0?null:t;var n=e();if(Nn){Yt(!0);try{e()}finally{Yt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=jt();if(a!==void 0){var o=a(t);if(Nn){Yt(!0);try{a(t)}finally{Yt(!1)}}}else o=t;return n.memoizedState=n.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},n.queue=e,e=e.dispatch=Jp.bind(null,Ee,e),[n.memoizedState,e]},useRef:function(e){var t=jt();return e={current:e},t.memoizedState=e},useState:function(e){e=jo(e);var t=e.queue,a=ef.bind(null,Ee,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:No,useDeferredValue:function(e,t){var a=jt();return Co(a,e,t)},useTransition:function(){var e=jo(!1);return e=Fd.bind(null,Ee,e.queue,!0,!1),jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Ee,o=jt();if(Ue){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),Ke===null)throw Error(c(349));(Me&124)!==0||Nd(n,t,a)}o.memoizedState=a;var u={value:a,getSnapshot:t};return o.queue=u,Vd(Ed.bind(null,n,u,e),[e]),n.flags|=2048,as(9,vr(),Cd.bind(null,n,u,a,t),null),a},useId:function(){var e=jt(),t=Ke.identifierPrefix;if(Ue){var a=pa,n=ga;a=(n&~(1<<32-ht(n)-1)).toString(32)+a,t="«"+t+"R"+a,a=xr++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=Yp++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:ko,useFormState:Ud,useActionState:Ud,useOptimistic:function(e){var t=jt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=To.bind(null,Ee,!0,a),a.dispatch=t,[e,t]},useMemoCache:bo,useCacheRefresh:function(){return jt().memoizedState=Zp.bind(null,Ee)}},sf={readContext:gt,use:yr,useCallback:Pd,useContext:gt,useEffect:qd,useImperativeHandle:Yd,useInsertionEffect:Gd,useLayoutEffect:$d,useMemo:Xd,useReducer:br,useRef:Bd,useState:function(){return br(ba)},useDebugValue:No,useDeferredValue:function(e,t){var a=et();return Qd(a,Ve.memoizedState,e,t)},useTransition:function(){var e=br(ba)[0],t=et().memoizedState;return[typeof e=="boolean"?e:el(e),t]},useSyncExternalStore:Sd,useId:Id,useHostTransitionStatus:ko,useFormState:Ld,useActionState:Ld,useOptimistic:function(e,t){var a=et();return Ad(a,Ve,e,t)},useMemoCache:bo,useCacheRefresh:Wd},Ip={readContext:gt,use:yr,useCallback:Pd,useContext:gt,useEffect:qd,useImperativeHandle:Yd,useInsertionEffect:Gd,useLayoutEffect:$d,useMemo:Xd,useReducer:wo,useRef:Bd,useState:function(){return wo(ba)},useDebugValue:No,useDeferredValue:function(e,t){var a=et();return Ve===null?Co(a,e,t):Qd(a,Ve.memoizedState,e,t)},useTransition:function(){var e=wo(ba)[0],t=et().memoizedState;return[typeof e=="boolean"?e:el(e),t]},useSyncExternalStore:Sd,useId:Id,useHostTransitionStatus:ko,useFormState:Hd,useActionState:Hd,useOptimistic:function(e,t){var a=et();return Ve!==null?Ad(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:bo,useCacheRefresh:Wd},ns=null,nl=0;function Nr(e){var t=nl;return nl+=1,ns===null&&(ns=[]),gd(ns,e,t)}function sl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cr(e,t){throw t.$$typeof===j?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function lf(e){var t=e._init;return t(e._payload)}function rf(e){function t(D,M){if(e){var U=D.deletions;U===null?(D.deletions=[M],D.flags|=16):U.push(M)}}function a(D,M){if(!e)return null;for(;M!==null;)t(D,M),M=M.sibling;return null}function n(D){for(var M=new Map;D!==null;)D.key!==null?M.set(D.key,D):M.set(D.index,D),D=D.sibling;return M}function o(D,M){return D=ha(D,M),D.index=0,D.sibling=null,D}function u(D,M,U){return D.index=U,e?(U=D.alternate,U!==null?(U=U.index,U<M?(D.flags|=67108866,M):U):(D.flags|=67108866,M)):(D.flags|=1048576,M)}function x(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function b(D,M,U,J){return M===null||M.tag!==6?(M=Qi(U,D.mode,J),M.return=D,M):(M=o(M,U),M.return=D,M)}function C(D,M,U,J){var fe=U.type;return fe===S?Z(D,M,U.props.children,J,U.key):M!==null&&(M.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===H&&lf(fe)===M.type)?(M=o(M,U.props),sl(M,U),M.return=D,M):(M=ir(U.type,U.key,U.props,null,D.mode,J),sl(M,U),M.return=D,M)}function _(D,M,U,J){return M===null||M.tag!==4||M.stateNode.containerInfo!==U.containerInfo||M.stateNode.implementation!==U.implementation?(M=Fi(U,D.mode,J),M.return=D,M):(M=o(M,U.children||[]),M.return=D,M)}function Z(D,M,U,J,fe){return M===null||M.tag!==7?(M=pn(U,D.mode,J,fe),M.return=D,M):(M=o(M,U),M.return=D,M)}function W(D,M,U){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Qi(""+M,D.mode,U),M.return=D,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case v:return U=ir(M.type,M.key,M.props,null,D.mode,U),sl(U,M),U.return=D,U;case T:return M=Fi(M,D.mode,U),M.return=D,M;case H:var J=M._init;return M=J(M._payload),W(D,M,U)}if(Y(M)||V(M))return M=pn(M,D.mode,U,null),M.return=D,M;if(typeof M.then=="function")return W(D,Nr(M),U);if(M.$$typeof===$)return W(D,dr(D,M),U);Cr(D,M)}return null}function K(D,M,U,J){var fe=M!==null?M.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return fe!==null?null:b(D,M,""+U,J);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case v:return U.key===fe?C(D,M,U,J):null;case T:return U.key===fe?_(D,M,U,J):null;case H:return fe=U._init,U=fe(U._payload),K(D,M,U,J)}if(Y(U)||V(U))return fe!==null?null:Z(D,M,U,J,null);if(typeof U.then=="function")return K(D,M,Nr(U),J);if(U.$$typeof===$)return K(D,M,dr(D,U),J);Cr(D,U)}return null}function P(D,M,U,J,fe){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return D=D.get(U)||null,b(M,D,""+J,fe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return D=D.get(J.key===null?U:J.key)||null,C(M,D,J,fe);case T:return D=D.get(J.key===null?U:J.key)||null,_(M,D,J,fe);case H:var Te=J._init;return J=Te(J._payload),P(D,M,U,J,fe)}if(Y(J)||V(J))return D=D.get(U)||null,Z(M,D,J,fe,null);if(typeof J.then=="function")return P(D,M,U,Nr(J),fe);if(J.$$typeof===$)return P(D,M,U,dr(M,J),fe);Cr(M,J)}return null}function ve(D,M,U,J){for(var fe=null,Te=null,ge=M,be=M=0,ct=null;ge!==null&&be<U.length;be++){ge.index>be?(ct=ge,ge=null):ct=ge.sibling;var ze=K(D,ge,U[be],J);if(ze===null){ge===null&&(ge=ct);break}e&&ge&&ze.alternate===null&&t(D,ge),M=u(ze,M,be),Te===null?fe=ze:Te.sibling=ze,Te=ze,ge=ct}if(be===U.length)return a(D,ge),Ue&&yn(D,be),fe;if(ge===null){for(;be<U.length;be++)ge=W(D,U[be],J),ge!==null&&(M=u(ge,M,be),Te===null?fe=ge:Te.sibling=ge,Te=ge);return Ue&&yn(D,be),fe}for(ge=n(ge);be<U.length;be++)ct=P(ge,D,be,U[be],J),ct!==null&&(e&&ct.alternate!==null&&ge.delete(ct.key===null?be:ct.key),M=u(ct,M,be),Te===null?fe=ct:Te.sibling=ct,Te=ct);return e&&ge.forEach(function(tn){return t(D,tn)}),Ue&&yn(D,be),fe}function ye(D,M,U,J){if(U==null)throw Error(c(151));for(var fe=null,Te=null,ge=M,be=M=0,ct=null,ze=U.next();ge!==null&&!ze.done;be++,ze=U.next()){ge.index>be?(ct=ge,ge=null):ct=ge.sibling;var tn=K(D,ge,ze.value,J);if(tn===null){ge===null&&(ge=ct);break}e&&ge&&tn.alternate===null&&t(D,ge),M=u(tn,M,be),Te===null?fe=tn:Te.sibling=tn,Te=tn,ge=ct}if(ze.done)return a(D,ge),Ue&&yn(D,be),fe;if(ge===null){for(;!ze.done;be++,ze=U.next())ze=W(D,ze.value,J),ze!==null&&(M=u(ze,M,be),Te===null?fe=ze:Te.sibling=ze,Te=ze);return Ue&&yn(D,be),fe}for(ge=n(ge);!ze.done;be++,ze=U.next())ze=P(ge,D,be,ze.value,J),ze!==null&&(e&&ze.alternate!==null&&ge.delete(ze.key===null?be:ze.key),M=u(ze,M,be),Te===null?fe=ze:Te.sibling=ze,Te=ze);return e&&ge.forEach(function(W0){return t(D,W0)}),Ue&&yn(D,be),fe}function Ge(D,M,U,J){if(typeof U=="object"&&U!==null&&U.type===S&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case v:e:{for(var fe=U.key;M!==null;){if(M.key===fe){if(fe=U.type,fe===S){if(M.tag===7){a(D,M.sibling),J=o(M,U.props.children),J.return=D,D=J;break e}}else if(M.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===H&&lf(fe)===M.type){a(D,M.sibling),J=o(M,U.props),sl(J,U),J.return=D,D=J;break e}a(D,M);break}else t(D,M);M=M.sibling}U.type===S?(J=pn(U.props.children,D.mode,J,U.key),J.return=D,D=J):(J=ir(U.type,U.key,U.props,null,D.mode,J),sl(J,U),J.return=D,D=J)}return x(D);case T:e:{for(fe=U.key;M!==null;){if(M.key===fe)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){a(D,M.sibling),J=o(M,U.children||[]),J.return=D,D=J;break e}else{a(D,M);break}else t(D,M);M=M.sibling}J=Fi(U,D.mode,J),J.return=D,D=J}return x(D);case H:return fe=U._init,U=fe(U._payload),Ge(D,M,U,J)}if(Y(U))return ve(D,M,U,J);if(V(U)){if(fe=V(U),typeof fe!="function")throw Error(c(150));return U=fe.call(U),ye(D,M,U,J)}if(typeof U.then=="function")return Ge(D,M,Nr(U),J);if(U.$$typeof===$)return Ge(D,M,dr(D,U),J);Cr(D,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(a(D,M.sibling),J=o(M,U),J.return=D,D=J):(a(D,M),J=Qi(U,D.mode,J),J.return=D,D=J),x(D)):a(D,M)}return function(D,M,U,J){try{nl=0;var fe=Ge(D,M,U,J);return ns=null,fe}catch(ge){if(ge===Qs||ge===mr)throw ge;var Te=Tt(29,ge,null,D.mode);return Te.lanes=J,Te.return=D,Te}finally{}}}var ss=rf(!0),of=rf(!1),qt=G(null),sa=null;function Va(e){var t=e.alternate;ae(nt,nt.current&1),ae(qt,e),sa===null&&(t===null||Wn.current!==null||t.memoizedState!==null)&&(sa=e)}function cf(e){if(e.tag===22){if(ae(nt,nt.current),ae(qt,e),sa===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(sa=e)}}else qa()}function qa(){ae(nt,nt.current),ae(qt,qt.current)}function va(e){te(qt),sa===e&&(sa=null),te(nt)}var nt=G(0);function Er(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||yc(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Ao(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ro={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Mt(),o=_a(n);o.payload=t,a!=null&&(o.callback=a),t=Ha(e,o,n),t!==null&&(zt(t,e,n),Zs(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Mt(),o=_a(n);o.tag=1,o.payload=t,a!=null&&(o.callback=a),t=Ha(e,o,n),t!==null&&(zt(t,e,n),Zs(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Mt(),n=_a(a);n.tag=2,t!=null&&(n.callback=t),t=Ha(e,n,a),t!==null&&(zt(t,e,a),Zs(t,e,a))}};function uf(e,t,a,n,o,u,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,u,x):t.prototype&&t.prototype.isPureReactComponent?!Vs(a,n)||!Vs(o,u):!0}function df(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Ro.enqueueReplaceState(t,t.state,null)}function Cn(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var o in e)a[o]===void 0&&(a[o]=e[o])}return a}var kr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function ff(e){kr(e)}function mf(e){console.error(e)}function hf(e){kr(e)}function Tr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function gf(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Oo(e,t,a){return a=_a(a),a.tag=3,a.payload={element:null},a.callback=function(){Tr(e,t)},a}function pf(e){return e=_a(e),e.tag=3,e}function xf(e,t,a,n){var o=a.type.getDerivedStateFromError;if(typeof o=="function"){var u=n.value;e.payload=function(){return o(u)},e.callback=function(){gf(t,a,n)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){gf(t,a,n),typeof o!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var b=n.stack;this.componentDidCatch(n.value,{componentStack:b!==null?b:""})})}function Wp(e,t,a,n,o){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Ys(t,a,o,!0),a=qt.current,a!==null){switch(a.tag){case 13:return sa===null?tc():a.alternate===null&&Fe===0&&(Fe=3),a.flags&=-257,a.flags|=65536,a.lanes=o,n===lo?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),nc(e,n,o)),!1;case 22:return a.flags|=65536,n===lo?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),nc(e,n,o)),!1}throw Error(c(435,a.tag))}return nc(e,n,o),tc(),!1}if(Ue)return t=qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,n!==Ii&&(e=Error(c(422),{cause:n}),Ks(_t(e,a)))):(n!==Ii&&(t=Error(c(423),{cause:n}),Ks(_t(t,a))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,n=_t(n,a),o=Oo(e.stateNode,n,o),oo(e,o),Fe!==4&&(Fe=2)),!1;var u=Error(c(520),{cause:n});if(u=_t(u,a),dl===null?dl=[u]:dl.push(u),Fe!==4&&(Fe=2),t===null)return!0;n=_t(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=o&-o,a.lanes|=e,e=Oo(a.stateNode,n,e),oo(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Xa===null||!Xa.has(u))))return a.flags|=65536,o&=-o,a.lanes|=o,o=pf(o),xf(o,e,a,n),oo(a,o),!1}a=a.return}while(a!==null);return!1}var yf=Error(c(461)),it=!1;function ut(e,t,a,n){t.child=e===null?of(t,null,a,n):ss(t,e.child,a,n)}function bf(e,t,a,n,o){a=a.render;var u=t.ref;if("ref"in n){var x={};for(var b in n)b!=="ref"&&(x[b]=n[b])}else x=n;return jn(t),n=ho(e,t,a,x,u,o),b=go(),e!==null&&!it?(po(e,t,o),wa(e,t,o)):(Ue&&b&&Zi(t),t.flags|=1,ut(e,t,n,o),t.child)}function vf(e,t,a,n,o){if(e===null){var u=a.type;return typeof u=="function"&&!Xi(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,wf(e,t,u,n,o)):(e=ir(a.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Bo(e,o)){var x=u.memoizedProps;if(a=a.compare,a=a!==null?a:Vs,a(x,n)&&e.ref===t.ref)return wa(e,t,o)}return t.flags|=1,e=ha(u,n),e.ref=t.ref,e.return=t,t.child=e}function wf(e,t,a,n,o){if(e!==null){var u=e.memoizedProps;if(Vs(u,n)&&e.ref===t.ref)if(it=!1,t.pendingProps=n=u,Bo(e,o))(e.flags&131072)!==0&&(it=!0);else return t.lanes=e.lanes,wa(e,t,o)}return Mo(e,t,a,n,o)}function jf(e,t,a){var n=t.pendingProps,o=n.children,u=e!==null?e.memoizedState:null;if(n.mode==="hidden"){if((t.flags&128)!==0){if(n=u!==null?u.baseLanes|a:a,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;t.childLanes=u&~n}else t.childLanes=0,t.child=null;return Sf(e,t,n,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fr(t,u!==null?u.cachePool:null),u!==null?vd(t,u):uo(),cf(t);else return t.lanes=t.childLanes=536870912,Sf(e,t,u!==null?u.baseLanes|a:a,a)}else u!==null?(fr(t,u.cachePool),vd(t,u),qa(),t.memoizedState=null):(e!==null&&fr(t,null),uo(),qa());return ut(e,t,o,a),t.child}function Sf(e,t,a,n){var o=so();return o=o===null?null:{parent:at._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&fr(t,null),uo(),cf(t),e!==null&&Ys(e,t,n,!0),null}function Ar(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Mo(e,t,a,n,o){return jn(t),a=ho(e,t,a,n,void 0,o),n=go(),e!==null&&!it?(po(e,t,o),wa(e,t,o)):(Ue&&n&&Zi(t),t.flags|=1,ut(e,t,a,o),t.child)}function Nf(e,t,a,n,o,u){return jn(t),t.updateQueue=null,a=jd(t,n,a,o),wd(e),n=go(),e!==null&&!it?(po(e,t,u),wa(e,t,u)):(Ue&&n&&Zi(t),t.flags|=1,ut(e,t,a,u),t.child)}function Cf(e,t,a,n,o){if(jn(t),t.stateNode===null){var u=Qn,x=a.contextType;typeof x=="object"&&x!==null&&(u=gt(x)),u=new a(n,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Ro,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=n,u.state=t.memoizedState,u.refs={},ro(t),x=a.contextType,u.context=typeof x=="object"&&x!==null?gt(x):Qn,u.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Ao(t,a,x,n),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(x=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),x!==u.state&&Ro.enqueueReplaceState(u,u.state,null),Is(t,n,u,o),Js(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,C=Cn(a,b);u.props=C;var _=u.context,Z=a.contextType;x=Qn,typeof Z=="object"&&Z!==null&&(x=gt(Z));var W=a.getDerivedStateFromProps;Z=typeof W=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,Z||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||_!==x)&&df(t,u,n,x),La=!1;var K=t.memoizedState;u.state=K,Is(t,n,u,o),Js(),_=t.memoizedState,b||K!==_||La?(typeof W=="function"&&(Ao(t,a,W,n),_=t.memoizedState),(C=La||uf(t,a,C,n,K,_,x))?(Z||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=_),u.props=n,u.state=_,u.context=x,n=C):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{u=t.stateNode,io(e,t),x=t.memoizedProps,Z=Cn(a,x),u.props=Z,W=t.pendingProps,K=u.context,_=a.contextType,C=Qn,typeof _=="object"&&_!==null&&(C=gt(_)),b=a.getDerivedStateFromProps,(_=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(x!==W||K!==C)&&df(t,u,n,C),La=!1,K=t.memoizedState,u.state=K,Is(t,n,u,o),Js();var P=t.memoizedState;x!==W||K!==P||La||e!==null&&e.dependencies!==null&&ur(e.dependencies)?(typeof b=="function"&&(Ao(t,a,b,n),P=t.memoizedState),(Z=La||uf(t,a,Z,n,K,P,C)||e!==null&&e.dependencies!==null&&ur(e.dependencies))?(_||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,P,C),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,P,C)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=P),u.props=n,u.state=P,u.context=C,n=Z):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),n=!1)}return u=n,Ar(e,t),n=(t.flags&128)!==0,u||n?(u=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&n?(t.child=ss(t,e.child,null,o),t.child=ss(t,null,a,o)):ut(e,t,a,o),t.memoizedState=u.state,e=t.child):e=wa(e,t,o),e}function Ef(e,t,a,n){return $s(),t.flags|=256,ut(e,t,a,n),t.child}var zo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Do(e){return{baseLanes:e,cachePool:fd()}}function Uo(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Gt),e}function kf(e,t,a){var n=t.pendingProps,o=!1,u=(t.flags&128)!==0,x;if((x=u)||(x=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),x&&(o=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(o?Va(t):qa(),Ue){var b=Qe,C;if(C=b){e:{for(C=b,b=na;C.nodeType!==8;){if(!b){b=null;break e}if(C=It(C.nextSibling),C===null){b=null;break e}}b=C}b!==null?(t.memoizedState={dehydrated:b,treeContext:xn!==null?{id:ga,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},C=Tt(18,null,null,0),C.stateNode=b,C.return=t,t.child=C,bt=t,Qe=null,C=!0):C=!1}C||vn(t)}if(b=t.memoizedState,b!==null&&(b=b.dehydrated,b!==null))return yc(b)?t.lanes=32:t.lanes=536870912,null;va(t)}return b=n.children,n=n.fallback,o?(qa(),o=t.mode,b=Rr({mode:"hidden",children:b},o),n=pn(n,o,a,null),b.return=t,n.return=t,b.sibling=n,t.child=b,o=t.child,o.memoizedState=Do(a),o.childLanes=Uo(e,x,a),t.memoizedState=zo,n):(Va(t),Lo(t,b))}if(C=e.memoizedState,C!==null&&(b=C.dehydrated,b!==null)){if(u)t.flags&256?(Va(t),t.flags&=-257,t=_o(e,t,a)):t.memoizedState!==null?(qa(),t.child=e.child,t.flags|=128,t=null):(qa(),o=n.fallback,b=t.mode,n=Rr({mode:"visible",children:n.children},b),o=pn(o,b,a,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,ss(t,e.child,null,a),n=t.child,n.memoizedState=Do(a),n.childLanes=Uo(e,x,a),t.memoizedState=zo,t=o);else if(Va(t),yc(b)){if(x=b.nextSibling&&b.nextSibling.dataset,x)var _=x.dgst;x=_,n=Error(c(419)),n.stack="",n.digest=x,Ks({value:n,source:null,stack:null}),t=_o(e,t,a)}else if(it||Ys(e,t,a,!1),x=(a&e.childLanes)!==0,it||x){if(x=Ke,x!==null&&(n=a&-a,n=(n&42)!==0?1:aa(n),n=(n&(x.suspendedLanes|a))!==0?0:n,n!==0&&n!==C.retryLane))throw C.retryLane=n,Xn(e,n),zt(x,e,n),yf;b.data==="$?"||tc(),t=_o(e,t,a)}else b.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,Qe=It(b.nextSibling),bt=t,Ue=!0,bn=null,na=!1,e!==null&&(Bt[Vt++]=ga,Bt[Vt++]=pa,Bt[Vt++]=xn,ga=e.id,pa=e.overflow,xn=t),t=Lo(t,n.children),t.flags|=4096);return t}return o?(qa(),o=n.fallback,b=t.mode,C=e.child,_=C.sibling,n=ha(C,{mode:"hidden",children:n.children}),n.subtreeFlags=C.subtreeFlags&65011712,_!==null?o=ha(_,o):(o=pn(o,b,a,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,b=e.child.memoizedState,b===null?b=Do(a):(C=b.cachePool,C!==null?(_=at._currentValue,C=C.parent!==_?{parent:_,pool:_}:C):C=fd(),b={baseLanes:b.baseLanes|a,cachePool:C}),o.memoizedState=b,o.childLanes=Uo(e,x,a),t.memoizedState=zo,n):(Va(t),a=e.child,e=a.sibling,a=ha(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Lo(e,t){return t=Rr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Rr(e,t){return e=Tt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function _o(e,t,a){return ss(t,e.child,null,a),e=Lo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tf(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),eo(e.return,t,a)}function Ho(e,t,a,n,o){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:o}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=n,u.tail=a,u.tailMode=o)}function Af(e,t,a){var n=t.pendingProps,o=n.revealOrder,u=n.tail;if(ut(e,t,n.children,a),n=nt.current,(n&2)!==0)n=n&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tf(e,a,t);else if(e.tag===19)Tf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}switch(ae(nt,n),o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Er(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),Ho(t,!1,o,a,u);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Er(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}Ho(t,!0,a,null,u);break;case"together":Ho(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Pa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Ys(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=ha(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ha(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Bo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ur(e)))}function e0(e,t,a){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Ua(t,at,e.memoizedState.cache),$s();break;case 27:case 5:Be(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Ua(t,t.type,t.memoizedProps.value);break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Va(t),t.flags|=128,null):(a&t.child.childLanes)!==0?kf(e,t,a):(Va(t),e=wa(e,t,a),e!==null?e.sibling:null);Va(t);break;case 19:var o=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Ys(e,t,a,!1),n=(a&t.childLanes)!==0),o){if(n)return Af(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ae(nt,nt.current),n)break;return null;case 22:case 23:return t.lanes=0,jf(e,t,a);case 24:Ua(t,at,e.memoizedState.cache)}return wa(e,t,a)}function Rf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)it=!0;else{if(!Bo(e,a)&&(t.flags&128)===0)return it=!1,e0(e,t,a);it=(e.flags&131072)!==0}else it=!1,Ue&&(t.flags&1048576)!==0&&ld(t,cr,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var n=t.elementType,o=n._init;if(n=o(n._payload),t.type=n,typeof n=="function")Xi(n)?(e=Cn(n,e),t.tag=1,t=Cf(null,t,n,e,a)):(t.tag=0,t=Mo(null,t,n,e,a));else{if(n!=null){if(o=n.$$typeof,o===F){t.tag=11,t=bf(null,t,n,e,a);break e}else if(o===Q){t.tag=14,t=vf(null,t,n,e,a);break e}}throw t=X(n)||n,Error(c(306,t,""))}}return t;case 0:return Mo(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,o=Cn(n,t.pendingProps),Cf(e,t,n,o,a);case 3:e:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var u=t.memoizedState;o=u.element,io(e,t),Is(t,n,null,a);var x=t.memoizedState;if(n=x.cache,Ua(t,at,n),n!==u.cache&&to(t,[at],a,!0),Js(),n=x.element,u.isDehydrated)if(u={element:n,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Ef(e,t,n,a);break e}else if(n!==o){o=_t(Error(c(424)),t),Ks(o),t=Ef(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Qe=It(e.firstChild),bt=t,Ue=!0,bn=null,na=!0,a=of(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if($s(),n===o){t=wa(e,t,a);break e}ut(e,t,n,a)}t=t.child}return t;case 26:return Ar(e,t),e===null?(a=Dm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ue||(a=t.type,e=t.pendingProps,n=Kr(ee.current).createElement(a),n[tt]=t,n[yt]=e,ft(n,a,e),rt(n),t.stateNode=n):t.memoizedState=Dm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&Ue&&(n=t.stateNode=Om(t.type,t.pendingProps,ee.current),bt=t,na=!0,o=Qe,Za(t.type)?(bc=o,Qe=It(n.firstChild)):Qe=o),ut(e,t,t.pendingProps.children,a),Ar(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((o=n=Qe)&&(n=T0(n,t.type,t.pendingProps,na),n!==null?(t.stateNode=n,bt=t,Qe=It(n.firstChild),na=!1,o=!0):o=!1),o||vn(t)),Be(t),o=t.type,u=t.pendingProps,x=e!==null?e.memoizedProps:null,n=u.children,gc(o,u)?n=null:x!==null&&gc(o,x)&&(t.flags|=32),t.memoizedState!==null&&(o=ho(e,t,Pp,null,null,a),vl._currentValue=o),Ar(e,t),ut(e,t,n,a),t.child;case 6:return e===null&&Ue&&((e=a=Qe)&&(a=A0(a,t.pendingProps,na),a!==null?(t.stateNode=a,bt=t,Qe=null,e=!0):e=!1),e||vn(t)),null;case 13:return kf(e,t,a);case 4:return ce(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ss(t,null,n,a):ut(e,t,n,a),t.child;case 11:return bf(e,t,t.type,t.pendingProps,a);case 7:return ut(e,t,t.pendingProps,a),t.child;case 8:return ut(e,t,t.pendingProps.children,a),t.child;case 12:return ut(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Ua(t,t.type,n.value),ut(e,t,n.children,a),t.child;case 9:return o=t.type._context,n=t.pendingProps.children,jn(t),o=gt(o),n=n(o),t.flags|=1,ut(e,t,n,a),t.child;case 14:return vf(e,t,t.type,t.pendingProps,a);case 15:return wf(e,t,t.type,t.pendingProps,a);case 19:return Af(e,t,a);case 31:return n=t.pendingProps,a=t.mode,n={mode:n.mode,children:n.children},e===null?(a=Rr(n,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=ha(e.child,n),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return jf(e,t,a);case 24:return jn(t),n=gt(at),e===null?(o=so(),o===null&&(o=Ke,u=ao(),o.pooledCache=u,u.refCount++,u!==null&&(o.pooledCacheLanes|=a),o=u),t.memoizedState={parent:n,cache:o},ro(t),Ua(t,at,o)):((e.lanes&a)!==0&&(io(e,t),Is(t,null,null,a),Js()),o=e.memoizedState,u=t.memoizedState,o.parent!==n?(o={parent:n,cache:n},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Ua(t,at,n)):(n=u.cache,Ua(t,at,n),n!==o.cache&&to(t,[at],a,!0))),ut(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function ja(e){e.flags|=4}function Of(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bm(t)){if(t=qt.current,t!==null&&((Me&4194048)===Me?sa!==null:(Me&62914560)!==Me&&(Me&536870912)===0||t!==sa))throw Fs=lo,md;e.flags|=8192}}function Or(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pt():536870912,e.lanes|=t,os|=t)}function ll(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,n|=o.subtreeFlags&65011712,n|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function t0(e,t,a){var n=t.pendingProps;switch(Ji(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(at),xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Gs(t)?ja(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,od())),Xe(t),null;case 26:return a=t.memoizedState,e===null?(ja(t),a!==null?(Xe(t),Of(t,a)):(Xe(t),t.flags&=-16777217)):a?a!==e.memoizedState?(ja(t),Xe(t),Of(t,a)):(Xe(t),t.flags&=-16777217):(e.memoizedProps!==n&&ja(t),Xe(t),t.flags&=-16777217),null;case 27:je(t),a=ee.current;var o=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Xe(t),null}e=de.current,Gs(t)?rd(t):(e=Om(o,n,a),t.stateNode=e,ja(t))}return Xe(t),null;case 5:if(je(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Xe(t),null}if(e=de.current,Gs(t))rd(t);else{switch(o=Kr(ee.current),e){case 1:e=o.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=o.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof n.is=="string"?o.createElement("select",{is:n.is}):o.createElement("select"),n.multiple?e.multiple=!0:n.size&&(e.size=n.size);break;default:e=typeof n.is=="string"?o.createElement(a,{is:n.is}):o.createElement(a)}}e[tt]=t,e[yt]=n;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=e;e:switch(ft(e,a,n),a){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&ja(t)}}return Xe(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=ee.current,Gs(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,o=bt,o!==null)switch(o.tag){case 27:case 5:n=o.memoizedProps}e[tt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Nm(e.nodeValue,a)),e||vn(t)}else e=Kr(e).createTextNode(n),e[tt]=t,t.stateNode=e}return Xe(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Gs(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[tt]=t}else $s(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),o=!1}else o=od(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(va(t),t):(va(t),null)}if(va(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=n!==null,e=e!==null&&e.memoizedState!==null,a){n=t.child,o=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(o=n.alternate.memoizedState.cachePool.pool);var u=null;n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==o&&(n.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),Or(t,t.updateQueue),Xe(t),null;case 4:return xe(),e===null&&uc(t.stateNode.containerInfo),Xe(t),null;case 10:return ya(t.type),Xe(t),null;case 19:if(te(nt),o=t.memoizedState,o===null)return Xe(t),null;if(n=(t.flags&128)!==0,u=o.rendering,u===null)if(n)ll(o,!1);else{if(Fe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Er(e),u!==null){for(t.flags|=128,ll(o,!1),e=u.updateQueue,t.updateQueue=e,Or(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)sd(a,e),a=a.sibling;return ae(nt,nt.current&1|2),t.child}e=e.sibling}o.tail!==null&&Le()>Dr&&(t.flags|=128,n=!0,ll(o,!1),t.lanes=4194304)}else{if(!n)if(e=Er(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Or(t,e),ll(o,!0),o.tail===null&&o.tailMode==="hidden"&&!u.alternate&&!Ue)return Xe(t),null}else 2*Le()-o.renderingStartTime>Dr&&a!==536870912&&(t.flags|=128,n=!0,ll(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(e=o.last,e!==null?e.sibling=u:t.child=u,o.last=u)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Le(),t.sibling=null,e=nt.current,ae(nt,n?e&1|2:e&1),t):(Xe(t),null);case 22:case 23:return va(t),fo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),a=t.updateQueue,a!==null&&Or(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&te(Sn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ya(at),Xe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function a0(e,t){switch(Ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(at),xe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 13:if(va(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));$s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return te(nt),null;case 4:return xe(),null;case 10:return ya(t.type),null;case 22:case 23:return va(t),fo(),e!==null&&te(Sn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(at),null;case 25:return null;default:return null}}function Mf(e,t){switch(Ji(t),t.tag){case 3:ya(at),xe();break;case 26:case 27:case 5:je(t);break;case 4:xe();break;case 13:va(t);break;case 19:te(nt);break;case 10:ya(t.type);break;case 22:case 23:va(t),fo(),e!==null&&te(Sn);break;case 24:ya(at)}}function rl(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var o=n.next;a=o;do{if((a.tag&e)===e){n=void 0;var u=a.create,x=a.inst;n=u(),x.destroy=n}a=a.next}while(a!==o)}}catch(b){$e(t,t.return,b)}}function Ga(e,t,a){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var u=o.next;n=u;do{if((n.tag&e)===e){var x=n.inst,b=x.destroy;if(b!==void 0){x.destroy=void 0,o=t;var C=a,_=b;try{_()}catch(Z){$e(o,C,Z)}}}n=n.next}while(n!==u)}}catch(Z){$e(t,t.return,Z)}}function zf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{bd(t,a)}catch(n){$e(e,e.return,n)}}}function Df(e,t,a){a.props=Cn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){$e(e,t,n)}}function il(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(o){$e(e,t,o)}}function la(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(o){$e(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){$e(e,t,o)}else a.current=null}function Uf(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(o){$e(e,e.return,o)}}function Vo(e,t,a){try{var n=e.stateNode;S0(n,e.type,a,t),n[yt]=t}catch(o){$e(e,e.return,o)}}function Lf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Za(e.type)||e.tag===4}function qo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Za(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Go(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=$r));else if(n!==4&&(n===27&&Za(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Go(e,t,a),e=e.sibling;e!==null;)Go(e,t,a),e=e.sibling}function Mr(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Za(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Mr(e,t,a),e=e.sibling;e!==null;)Mr(e,t,a),e=e.sibling}function _f(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);ft(t,n,a),t[tt]=e,t[yt]=a}catch(u){$e(e,e.return,u)}}var Sa=!1,Ie=!1,$o=!1,Hf=typeof WeakSet=="function"?WeakSet:Set,ot=null;function n0(e,t){if(e=e.containerInfo,mc=Zr,e=Qu(e),Vi(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var o=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var x=0,b=-1,C=-1,_=0,Z=0,W=e,K=null;t:for(;;){for(var P;W!==a||o!==0&&W.nodeType!==3||(b=x+o),W!==u||n!==0&&W.nodeType!==3||(C=x+n),W.nodeType===3&&(x+=W.nodeValue.length),(P=W.firstChild)!==null;)K=W,W=P;for(;;){if(W===e)break t;if(K===a&&++_===o&&(b=x),K===u&&++Z===n&&(C=x),(P=W.nextSibling)!==null)break;W=K,K=W.parentNode}W=P}a=b===-1||C===-1?null:{start:b,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;for(hc={focusedElem:e,selectionRange:a},Zr=!1,ot=t;ot!==null;)if(t=ot,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,ot=e;else for(;ot!==null;){switch(t=ot,u=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,o=u.memoizedProps,u=u.memoizedState,n=a.stateNode;try{var ve=Cn(a.type,o,a.elementType===a.type);e=n.getSnapshotBeforeUpdate(ve,u),n.__reactInternalSnapshotBeforeUpdate=e}catch(ye){$e(a,a.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)xc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xc(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,ot=e;break}ot=t.return}}function Bf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:$a(e,a),n&4&&rl(5,a);break;case 1:if($a(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){$e(a,a.return,x)}else{var o=Cn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){$e(a,a.return,x)}}n&64&&zf(a),n&512&&il(a,a.return);break;case 3:if($a(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{bd(e,t)}catch(x){$e(a,a.return,x)}}break;case 27:t===null&&n&4&&_f(a);case 26:case 5:$a(e,a),t===null&&n&4&&Uf(a),n&512&&il(a,a.return);break;case 12:$a(e,a);break;case 13:$a(e,a),n&4&&Gf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=f0.bind(null,a),R0(e,a))));break;case 22:if(n=a.memoizedState!==null||Sa,!n){t=t!==null&&t.memoizedState!==null||Ie,o=Sa;var u=Ie;Sa=n,(Ie=t)&&!u?Ka(e,a,(a.subtreeFlags&8772)!==0):$a(e,a),Sa=o,Ie=u}break;case 30:break;default:$a(e,a)}}function Vf(e){var t=e.alternate;t!==null&&(e.alternate=null,Vf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wi(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ye=null,St=!1;function Na(e,t,a){for(a=a.child;a!==null;)qf(e,t,a),a=a.sibling}function qf(e,t,a){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(za,a)}catch{}switch(a.tag){case 26:Ie||la(a,t),Na(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ie||la(a,t);var n=Ye,o=St;Za(a.type)&&(Ye=a.stateNode,St=!1),Na(e,t,a),pl(a.stateNode),Ye=n,St=o;break;case 5:Ie||la(a,t);case 6:if(n=Ye,o=St,Ye=null,Na(e,t,a),Ye=n,St=o,Ye!==null)if(St)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(a.stateNode)}catch(u){$e(a,t,u)}else try{Ye.removeChild(a.stateNode)}catch(u){$e(a,t,u)}break;case 18:Ye!==null&&(St?(e=Ye,Am(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Nl(e)):Am(Ye,a.stateNode));break;case 4:n=Ye,o=St,Ye=a.stateNode.containerInfo,St=!0,Na(e,t,a),Ye=n,St=o;break;case 0:case 11:case 14:case 15:Ie||Ga(2,a,t),Ie||Ga(4,a,t),Na(e,t,a);break;case 1:Ie||(la(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&Df(a,t,n)),Na(e,t,a);break;case 21:Na(e,t,a);break;case 22:Ie=(n=Ie)||a.memoizedState!==null,Na(e,t,a),Ie=n;break;default:Na(e,t,a)}}function Gf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Nl(e)}catch(a){$e(t,t.return,a)}}function s0(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Hf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Hf),t;default:throw Error(c(435,e.tag))}}function Ko(e,t){var a=s0(e);t.forEach(function(n){var o=m0.bind(null,e,n);a.has(n)||(a.add(n),n.then(o,o))})}function At(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var o=a[n],u=e,x=t,b=x;e:for(;b!==null;){switch(b.tag){case 27:if(Za(b.type)){Ye=b.stateNode,St=!1;break e}break;case 5:Ye=b.stateNode,St=!1;break e;case 3:case 4:Ye=b.stateNode.containerInfo,St=!0;break e}b=b.return}if(Ye===null)throw Error(c(160));qf(u,x,o),Ye=null,St=!1,u=o.alternate,u!==null&&(u.return=null),o.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)$f(t,e),t=t.sibling}var Jt=null;function $f(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:At(t,e),Rt(e),n&4&&(Ga(3,e,e.return),rl(3,e),Ga(5,e,e.return));break;case 1:At(t,e),Rt(e),n&512&&(Ie||a===null||la(a,a.return)),n&64&&Sa&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var o=Jt;if(At(t,e),Rt(e),n&512&&(Ie||a===null||la(a,a.return)),n&4){var u=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,o=o.ownerDocument||o;t:switch(n){case"title":u=o.getElementsByTagName("title")[0],(!u||u[Os]||u[tt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=o.createElement(n),o.head.insertBefore(u,o.querySelector("head > title"))),ft(u,n,a),u[tt]=e,rt(u),n=u;break e;case"link":var x=_m("link","href",o).get(n+(a.href||""));if(x){for(var b=0;b<x.length;b++)if(u=x[b],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(b,1);break t}}u=o.createElement(n),ft(u,n,a),o.head.appendChild(u);break;case"meta":if(x=_m("meta","content",o).get(n+(a.content||""))){for(b=0;b<x.length;b++)if(u=x[b],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(b,1);break t}}u=o.createElement(n),ft(u,n,a),o.head.appendChild(u);break;default:throw Error(c(468,n))}u[tt]=e,rt(u),n=u}e.stateNode=n}else Hm(o,e.type,e.stateNode);else e.stateNode=Lm(o,n,e.memoizedProps);else u!==n?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,n===null?Hm(o,e.type,e.stateNode):Lm(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Vo(e,e.memoizedProps,a.memoizedProps)}break;case 27:At(t,e),Rt(e),n&512&&(Ie||a===null||la(a,a.return)),a!==null&&n&4&&Vo(e,e.memoizedProps,a.memoizedProps);break;case 5:if(At(t,e),Rt(e),n&512&&(Ie||a===null||la(a,a.return)),e.flags&32){o=e.stateNode;try{Vn(o,"")}catch(P){$e(e,e.return,P)}}n&4&&e.stateNode!=null&&(o=e.memoizedProps,Vo(e,o,a!==null?a.memoizedProps:o)),n&1024&&($o=!0);break;case 6:if(At(t,e),Rt(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(P){$e(e,e.return,P)}}break;case 3:if(Xr=null,o=Jt,Jt=Yr(t.containerInfo),At(t,e),Jt=o,Rt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Nl(t.containerInfo)}catch(P){$e(e,e.return,P)}$o&&($o=!1,Kf(e));break;case 4:n=Jt,Jt=Yr(e.stateNode.containerInfo),At(t,e),Rt(e),Jt=n;break;case 12:At(t,e),Rt(e);break;case 13:At(t,e),Rt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Zo=Le()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ko(e,n)));break;case 22:o=e.memoizedState!==null;var C=a!==null&&a.memoizedState!==null,_=Sa,Z=Ie;if(Sa=_||o,Ie=Z||C,At(t,e),Ie=Z,Sa=_,Rt(e),n&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(a===null||C||Sa||Ie||En(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){C=a=t;try{if(u=C.stateNode,o)x=u.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{b=C.stateNode;var W=C.memoizedProps.style,K=W!=null&&W.hasOwnProperty("display")?W.display:null;b.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(P){$e(C,C.return,P)}}}else if(t.tag===6){if(a===null){C=t;try{C.stateNode.nodeValue=o?"":C.memoizedProps}catch(P){$e(C,C.return,P)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Ko(e,a))));break;case 19:At(t,e),Rt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ko(e,n)));break;case 30:break;case 21:break;default:At(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(Lf(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var o=a.stateNode,u=qo(e);Mr(e,u,o);break;case 5:var x=a.stateNode;a.flags&32&&(Vn(x,""),a.flags&=-33);var b=qo(e);Mr(e,b,x);break;case 3:case 4:var C=a.stateNode.containerInfo,_=qo(e);Go(e,_,C);break;default:throw Error(c(161))}}catch(Z){$e(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Kf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function $a(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Bf(e,t.alternate,t),t=t.sibling}function En(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ga(4,t,t.return),En(t);break;case 1:la(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Df(t,t.return,a),En(t);break;case 27:pl(t.stateNode);case 26:case 5:la(t,t.return),En(t);break;case 22:t.memoizedState===null&&En(t);break;case 30:En(t);break;default:En(t)}e=e.sibling}}function Ka(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,o=e,u=t,x=u.flags;switch(u.tag){case 0:case 11:case 15:Ka(o,u,a),rl(4,u);break;case 1:if(Ka(o,u,a),n=u,o=n.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(_){$e(n,n.return,_)}if(n=u,o=n.updateQueue,o!==null){var b=n.stateNode;try{var C=o.shared.hiddenCallbacks;if(C!==null)for(o.shared.hiddenCallbacks=null,o=0;o<C.length;o++)yd(C[o],b)}catch(_){$e(n,n.return,_)}}a&&x&64&&zf(u),il(u,u.return);break;case 27:_f(u);case 26:case 5:Ka(o,u,a),a&&n===null&&x&4&&Uf(u),il(u,u.return);break;case 12:Ka(o,u,a);break;case 13:Ka(o,u,a),a&&x&4&&Gf(o,u);break;case 22:u.memoizedState===null&&Ka(o,u,a),il(u,u.return);break;case 30:break;default:Ka(o,u,a)}t=t.sibling}}function Yo(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ps(a))}function Po(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e))}function ra(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yf(e,t,a,n),t=t.sibling}function Yf(e,t,a,n){var o=t.flags;switch(t.tag){case 0:case 11:case 15:ra(e,t,a,n),o&2048&&rl(9,t);break;case 1:ra(e,t,a,n);break;case 3:ra(e,t,a,n),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e)));break;case 12:if(o&2048){ra(e,t,a,n),e=t.stateNode;try{var u=t.memoizedProps,x=u.id,b=u.onPostCommit;typeof b=="function"&&b(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){$e(t,t.return,C)}}else ra(e,t,a,n);break;case 13:ra(e,t,a,n);break;case 23:break;case 22:u=t.stateNode,x=t.alternate,t.memoizedState!==null?u._visibility&2?ra(e,t,a,n):ol(e,t):u._visibility&2?ra(e,t,a,n):(u._visibility|=2,ls(e,t,a,n,(t.subtreeFlags&10256)!==0)),o&2048&&Yo(x,t);break;case 24:ra(e,t,a,n),o&2048&&Po(t.alternate,t);break;default:ra(e,t,a,n)}}function ls(e,t,a,n,o){for(o=o&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var u=e,x=t,b=a,C=n,_=x.flags;switch(x.tag){case 0:case 11:case 15:ls(u,x,b,C,o),rl(8,x);break;case 23:break;case 22:var Z=x.stateNode;x.memoizedState!==null?Z._visibility&2?ls(u,x,b,C,o):ol(u,x):(Z._visibility|=2,ls(u,x,b,C,o)),o&&_&2048&&Yo(x.alternate,x);break;case 24:ls(u,x,b,C,o),o&&_&2048&&Po(x.alternate,x);break;default:ls(u,x,b,C,o)}t=t.sibling}}function ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,o=n.flags;switch(n.tag){case 22:ol(a,n),o&2048&&Yo(n.alternate,n);break;case 24:ol(a,n),o&2048&&Po(n.alternate,n);break;default:ol(a,n)}t=t.sibling}}var cl=8192;function rs(e){if(e.subtreeFlags&cl)for(e=e.child;e!==null;)Pf(e),e=e.sibling}function Pf(e){switch(e.tag){case 26:rs(e),e.flags&cl&&e.memoizedState!==null&&$0(Jt,e.memoizedState,e.memoizedProps);break;case 5:rs(e);break;case 3:case 4:var t=Jt;Jt=Yr(e.stateNode.containerInfo),rs(e),Jt=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=cl,cl=16777216,rs(e),cl=t):rs(e));break;default:rs(e)}}function Xf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ul(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];ot=n,Ff(n,e)}Xf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qf(e),e=e.sibling}function Qf(e){switch(e.tag){case 0:case 11:case 15:ul(e),e.flags&2048&&Ga(9,e,e.return);break;case 3:ul(e);break;case 12:ul(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zr(e)):ul(e);break;default:ul(e)}}function zr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];ot=n,Ff(n,e)}Xf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ga(8,t,t.return),zr(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,zr(t));break;default:zr(t)}e=e.sibling}}function Ff(e,t){for(;ot!==null;){var a=ot;switch(a.tag){case 0:case 11:case 15:Ga(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Ps(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,ot=n;else e:for(a=e;ot!==null;){n=ot;var o=n.sibling,u=n.return;if(Vf(n),n===a){ot=null;break e}if(o!==null){o.return=u,ot=o;break e}ot=u}}}var l0={getCacheForType:function(e){var t=gt(at),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},r0=typeof WeakMap=="function"?WeakMap:Map,_e=0,Ke=null,Ae=null,Me=0,He=0,Ot=null,Ya=!1,is=!1,Xo=!1,Ca=0,Fe=0,Pa=0,kn=0,Qo=0,Gt=0,os=0,dl=null,Nt=null,Fo=!1,Zo=0,Dr=1/0,Ur=null,Xa=null,dt=0,Qa=null,cs=null,us=0,Jo=0,Io=null,Zf=null,fl=0,Wo=null;function Mt(){if((_e&2)!==0&&Me!==0)return Me&-Me;if(k.T!==null){var e=Jn;return e!==0?e:rc()}return Rs()}function Jf(){Gt===0&&(Gt=(Me&536870912)===0||Ue?pe():536870912);var e=qt.current;return e!==null&&(e.flags|=32),Gt}function zt(e,t,a){(e===Ke&&(He===2||He===9)||e.cancelPendingCommit!==null)&&(ds(e,0),Fa(e,Me,Gt,!1)),Qt(e,a),((_e&2)===0||e!==Ke)&&(e===Ke&&((_e&2)===0&&(kn|=a),Fe===4&&Fa(e,Me,Gt,!1)),ia(e))}function If(e,t,a){if((_e&6)!==0)throw Error(c(327));var n=!a&&(t&124)===0&&(t&e.expiredLanes)===0||ue(e,t),o=n?c0(e,t):ac(e,t,!0),u=n;do{if(o===0){is&&!n&&Fa(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!i0(a)){o=ac(e,t,!1),u=!1;continue}if(o===2){if(u=t,e.errorRecoveryDisabledLanes&u)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var b=e;o=dl;var C=b.current.memoizedState.isDehydrated;if(C&&(ds(b,x).flags|=256),x=ac(b,x,!1),x!==2){if(Xo&&!C){b.errorRecoveryDisabledLanes|=u,kn|=u,o=4;break e}u=Nt,Nt=o,u!==null&&(Nt===null?Nt=u:Nt.push.apply(Nt,u))}o=x}if(u=!1,o!==2)continue}}if(o===1){ds(e,0),Fa(e,t,0,!0);break}e:{switch(n=e,u=o,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Fa(n,t,Gt,!Ya);break e;case 2:Nt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Zo+300-Le(),10<o)){if(Fa(n,t,Gt,!Ya),un(n,0,!0)!==0)break e;n.timeoutHandle=km(Wf.bind(null,n,a,Nt,Ur,Fo,t,Gt,kn,os,Ya,u,2,-0,0),o);break e}Wf(n,a,Nt,Ur,Fo,t,Gt,kn,os,Ya,u,0,-0,0)}}break}while(!0);ia(e)}function Wf(e,t,a,n,o,u,x,b,C,_,Z,W,K,P){if(e.timeoutHandle=-1,W=t.subtreeFlags,(W&8192||(W&16785408)===16785408)&&(bl={stylesheets:null,count:0,unsuspend:G0},Pf(t),W=K0(),W!==null)){e.cancelPendingCommit=W(rm.bind(null,e,t,u,a,n,o,x,b,C,Z,1,K,P)),Fa(e,u,x,!_);return}rm(e,t,u,a,n,o,x,b,C)}function i0(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var o=a[n],u=o.getSnapshot;o=o.value;try{if(!kt(u(),o))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fa(e,t,a,n){t&=~Qo,t&=~kn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var o=t;0<o;){var u=31-ht(o),x=1<<u;n[u]=-1,o&=~x}a!==0&&Yl(e,a,t)}function Lr(){return(_e&6)===0?(ml(0),!1):!0}function ec(){if(Ae!==null){if(He===0)var e=Ae.return;else e=Ae,xa=wn=null,xo(e),ns=null,nl=0,e=Ae;for(;e!==null;)Mf(e.alternate,e),e=e.return;Ae=null}}function ds(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,C0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ec(),Ke=e,Ae=a=ha(e.current,null),Me=t,He=0,Ot=null,Ya=!1,is=ue(e,t),Xo=!1,os=Gt=Qo=kn=Pa=Fe=0,Nt=dl=null,Fo=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var o=31-ht(n),u=1<<o;t|=e[o],n&=~u}return Ca=t,sr(),a}function em(e,t){Ee=null,k.H=Sr,t===Qs||t===mr?(t=pd(),He=3):t===md?(t=pd(),He=4):He=t===yf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ot=t,Ae===null&&(Fe=1,Tr(e,_t(t,e.current)))}function tm(){var e=k.H;return k.H=Sr,e===null?Sr:e}function am(){var e=k.A;return k.A=l0,e}function tc(){Fe=4,Ya||(Me&4194048)!==Me&&qt.current!==null||(is=!0),(Pa&134217727)===0&&(kn&134217727)===0||Ke===null||Fa(Ke,Me,Gt,!1)}function ac(e,t,a){var n=_e;_e|=2;var o=tm(),u=am();(Ke!==e||Me!==t)&&(Ur=null,ds(e,t)),t=!1;var x=Fe;e:do try{if(He!==0&&Ae!==null){var b=Ae,C=Ot;switch(He){case 8:ec(),x=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(t=!0);var _=He;if(He=0,Ot=null,fs(e,b,C,_),a&&is){x=0;break e}break;default:_=He,He=0,Ot=null,fs(e,b,C,_)}}o0(),x=Fe;break}catch(Z){em(e,Z)}while(!0);return t&&e.shellSuspendCounter++,xa=wn=null,_e=n,k.H=o,k.A=u,Ae===null&&(Ke=null,Me=0,sr()),x}function o0(){for(;Ae!==null;)nm(Ae)}function c0(e,t){var a=_e;_e|=2;var n=tm(),o=am();Ke!==e||Me!==t?(Ur=null,Dr=Le()+500,ds(e,t)):is=ue(e,t);e:do try{if(He!==0&&Ae!==null){t=Ae;var u=Ot;t:switch(He){case 1:He=0,Ot=null,fs(e,t,u,1);break;case 2:case 9:if(hd(u)){He=0,Ot=null,sm(t);break}t=function(){He!==2&&He!==9||Ke!==e||(He=7),ia(e)},u.then(t,t);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:hd(u)?(He=0,Ot=null,sm(t)):(He=0,Ot=null,fs(e,t,u,7));break;case 5:var x=null;switch(Ae.tag){case 26:x=Ae.memoizedState;case 5:case 27:var b=Ae;if(!x||Bm(x)){He=0,Ot=null;var C=b.sibling;if(C!==null)Ae=C;else{var _=b.return;_!==null?(Ae=_,_r(_)):Ae=null}break t}}He=0,Ot=null,fs(e,t,u,5);break;case 6:He=0,Ot=null,fs(e,t,u,6);break;case 8:ec(),Fe=6;break e;default:throw Error(c(462))}}u0();break}catch(Z){em(e,Z)}while(!0);return xa=wn=null,k.H=n,k.A=o,_e=a,Ae!==null?0:(Ke=null,Me=0,sr(),Fe)}function u0(){for(;Ae!==null&&!ua();)nm(Ae)}function nm(e){var t=Rf(e.alternate,e,Ca);e.memoizedProps=e.pendingProps,t===null?_r(e):Ae=t}function sm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Nf(a,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=Nf(a,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:xo(t);default:Mf(a,t),t=Ae=sd(t,Ca),t=Rf(a,t,Ca)}e.memoizedProps=e.pendingProps,t===null?_r(e):Ae=t}function fs(e,t,a,n){xa=wn=null,xo(t),ns=null,nl=0;var o=t.return;try{if(Wp(e,o,t,a,Me)){Fe=1,Tr(e,_t(a,e.current)),Ae=null;return}}catch(u){if(o!==null)throw Ae=o,u;Fe=1,Tr(e,_t(a,e.current)),Ae=null;return}t.flags&32768?(Ue||n===1?e=!0:is||(Me&536870912)!==0?e=!1:(Ya=e=!0,(n===2||n===9||n===3||n===6)&&(n=qt.current,n!==null&&n.tag===13&&(n.flags|=16384))),lm(t,e)):_r(t)}function _r(e){var t=e;do{if((t.flags&32768)!==0){lm(t,Ya);return}e=t.return;var a=t0(t.alternate,t,Ca);if(a!==null){Ae=a;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);Fe===0&&(Fe=5)}function lm(e,t){do{var a=a0(e.alternate,e);if(a!==null){a.flags&=32767,Ae=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=a}while(e!==null);Fe=6,Ae=null}function rm(e,t,a,n,o,u,x,b,C){e.cancelPendingCommit=null;do Hr();while(dt!==0);if((_e&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(u=t.lanes|t.childLanes,u|=Yi,dn(e,a,u,x,b,C),e===Ke&&(Ae=Ke=null,Me=0),cs=t,Qa=e,us=a,Jo=u,Io=o,Zf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,h0(da,function(){return dm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=k.T,k.T=null,o=q.p,q.p=2,x=_e,_e|=4;try{n0(e,t,a)}finally{_e=x,q.p=o,k.T=n}}dt=1,im(),om(),cm()}}function im(){if(dt===1){dt=0;var e=Qa,t=cs,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var n=q.p;q.p=2;var o=_e;_e|=4;try{$f(t,e);var u=hc,x=Qu(e.containerInfo),b=u.focusedElem,C=u.selectionRange;if(x!==b&&b&&b.ownerDocument&&Xu(b.ownerDocument.documentElement,b)){if(C!==null&&Vi(b)){var _=C.start,Z=C.end;if(Z===void 0&&(Z=_),"selectionStart"in b)b.selectionStart=_,b.selectionEnd=Math.min(Z,b.value.length);else{var W=b.ownerDocument||document,K=W&&W.defaultView||window;if(K.getSelection){var P=K.getSelection(),ve=b.textContent.length,ye=Math.min(C.start,ve),Ge=C.end===void 0?ye:Math.min(C.end,ve);!P.extend&&ye>Ge&&(x=Ge,Ge=ye,ye=x);var D=Pu(b,ye),M=Pu(b,Ge);if(D&&M&&(P.rangeCount!==1||P.anchorNode!==D.node||P.anchorOffset!==D.offset||P.focusNode!==M.node||P.focusOffset!==M.offset)){var U=W.createRange();U.setStart(D.node,D.offset),P.removeAllRanges(),ye>Ge?(P.addRange(U),P.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),P.addRange(U))}}}}for(W=[],P=b;P=P.parentNode;)P.nodeType===1&&W.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<W.length;b++){var J=W[b];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Zr=!!mc,hc=mc=null}finally{_e=o,q.p=n,k.T=a}}e.current=t,dt=2}}function om(){if(dt===2){dt=0;var e=Qa,t=cs,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var n=q.p;q.p=2;var o=_e;_e|=4;try{Bf(e,t.alternate,t)}finally{_e=o,q.p=n,k.T=a}}dt=3}}function cm(){if(dt===4||dt===3){dt=0,rn();var e=Qa,t=cs,a=us,n=Zf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,cs=Qa=null,um(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Xa=null),Mn(a),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(za,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=k.T,o=q.p,q.p=2,k.T=null;try{for(var u=e.onRecoverableError,x=0;x<n.length;x++){var b=n[x];u(b.value,{componentStack:b.stack})}}finally{k.T=t,q.p=o}}(us&3)!==0&&Hr(),ia(e),o=e.pendingLanes,(a&4194090)!==0&&(o&42)!==0?e===Wo?fl++:(fl=0,Wo=e):fl=0,ml(0)}}function um(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ps(t)))}function Hr(e){return im(),om(),cm(),dm()}function dm(){if(dt!==5)return!1;var e=Qa,t=Jo;Jo=0;var a=Mn(us),n=k.T,o=q.p;try{q.p=32>a?32:a,k.T=null,a=Io,Io=null;var u=Qa,x=us;if(dt=0,cs=Qa=null,us=0,(_e&6)!==0)throw Error(c(331));var b=_e;if(_e|=4,Qf(u.current),Yf(u,u.current,x,a),_e=b,ml(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(za,u)}catch{}return!0}finally{q.p=o,k.T=n,um(e,t)}}function fm(e,t,a){t=_t(a,t),t=Oo(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Qt(e,2),ia(e))}function $e(e,t,a){if(e.tag===3)fm(e,e,a);else for(;t!==null;){if(t.tag===3){fm(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Xa===null||!Xa.has(n))){e=_t(a,e),a=pf(2),n=Ha(t,a,2),n!==null&&(xf(a,n,t,e),Qt(n,2),ia(n));break}}t=t.return}}function nc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new r0;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(a)||(Xo=!0,o.add(a),e=d0.bind(null,e,t,a),t.then(e,e))}function d0(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ke===e&&(Me&a)===a&&(Fe===4||Fe===3&&(Me&62914560)===Me&&300>Le()-Zo?(_e&2)===0&&ds(e,0):Qo|=a,os===Me&&(os=0)),ia(e)}function mm(e,t){t===0&&(t=Pt()),e=Xn(e,t),e!==null&&(Qt(e,t),ia(e))}function f0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),mm(e,a)}function m0(e,t){var a=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(t),mm(e,a)}function h0(e,t){return Ze(e,t)}var Br=null,ms=null,sc=!1,Vr=!1,lc=!1,Tn=0;function ia(e){e!==ms&&e.next===null&&(ms===null?Br=ms=e:ms=ms.next=e),Vr=!0,sc||(sc=!0,p0())}function ml(e,t){if(!lc&&Vr){lc=!0;do for(var a=!1,n=Br;n!==null;){if(e!==0){var o=n.pendingLanes;if(o===0)var u=0;else{var x=n.suspendedLanes,b=n.pingedLanes;u=(1<<31-ht(42|e)+1)-1,u&=o&~(x&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,xm(n,u))}else u=Me,u=un(n,n===Ke?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||ue(n,u)||(a=!0,xm(n,u));n=n.next}while(a);lc=!1}}function g0(){hm()}function hm(){Vr=sc=!1;var e=0;Tn!==0&&(N0()&&(e=Tn),Tn=0);for(var t=Le(),a=null,n=Br;n!==null;){var o=n.next,u=gm(n,t);u===0?(n.next=null,a===null?Br=o:a.next=o,o===null&&(ms=a)):(a=n,(e!==0||(u&3)!==0)&&(Vr=!0)),n=o}ml(e)}function gm(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var x=31-ht(u),b=1<<x,C=o[x];C===-1?((b&a)===0||(b&n)!==0)&&(o[x]=ie(b,t)):C<=t&&(e.expiredLanes|=b),u&=~b}if(t=Ke,a=Me,a=un(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(He===2||He===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ct(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ue(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Ct(n),Mn(a)){case 2:case 8:a=Oa;break;case 32:a=da;break;case 268435456:a=As;break;default:a=da}return n=pm.bind(null,e),a=Ze(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Ct(n),e.callbackPriority=2,e.callbackNode=null,2}function pm(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Hr()&&e.callbackNode!==a)return null;var n=Me;return n=un(e,e===Ke?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(If(e,n,t),gm(e,Le()),e.callbackNode!=null&&e.callbackNode===a?pm.bind(null,e):null)}function xm(e,t){if(Hr())return null;If(e,t,!0)}function p0(){E0(function(){(_e&6)!==0?Ze(Ra,g0):hm()})}function rc(){return Tn===0&&(Tn=pe()),Tn}function ym(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jl(""+e)}function bm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function x0(e,t,a,n,o){if(t==="submit"&&a&&a.stateNode===o){var u=ym((o[yt]||null).action),x=n.submitter;x&&(t=(t=x[yt]||null)?ym(t.formAction):x.getAttribute("formAction"),t!==null&&(u=t,x=null));var b=new tr("action","action",null,n,o);e.push({event:b,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Tn!==0){var C=x?bm(o,x):new FormData(o);Eo(a,{pending:!0,data:C,method:o.method,action:u},null,C)}}else typeof u=="function"&&(b.preventDefault(),C=x?bm(o,x):new FormData(o),Eo(a,{pending:!0,data:C,method:o.method,action:u},u,C))},currentTarget:o}]})}}for(var ic=0;ic<Ki.length;ic++){var oc=Ki[ic],y0=oc.toLowerCase(),b0=oc[0].toUpperCase()+oc.slice(1);Zt(y0,"on"+b0)}Zt(Ju,"onAnimationEnd"),Zt(Iu,"onAnimationIteration"),Zt(Wu,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(Lp,"onTransitionRun"),Zt(_p,"onTransitionStart"),Zt(Hp,"onTransitionCancel"),Zt(ed,"onTransitionEnd"),_n("onMouseEnter",["mouseout","mouseover"]),_n("onMouseLeave",["mouseout","mouseover"]),_n("onPointerEnter",["pointerout","pointerover"]),_n("onPointerLeave",["pointerout","pointerover"]),fn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fn("onBeforeInput",["compositionend","keypress","textInput","paste"]),fn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="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(" "),v0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hl));function vm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],o=n.event;n=n.listeners;e:{var u=void 0;if(t)for(var x=n.length-1;0<=x;x--){var b=n[x],C=b.instance,_=b.currentTarget;if(b=b.listener,C!==u&&o.isPropagationStopped())break e;u=b,o.currentTarget=_;try{u(o)}catch(Z){kr(Z)}o.currentTarget=null,u=C}else for(x=0;x<n.length;x++){if(b=n[x],C=b.instance,_=b.currentTarget,b=b.listener,C!==u&&o.isPropagationStopped())break e;u=b,o.currentTarget=_;try{u(o)}catch(Z){kr(Z)}o.currentTarget=null,u=C}}}}function Re(e,t){var a=t[vi];a===void 0&&(a=t[vi]=new Set);var n=e+"__bubble";a.has(n)||(wm(t,e,2,!1),a.add(n))}function cc(e,t,a){var n=0;t&&(n|=4),wm(a,e,n,t)}var qr="_reactListening"+Math.random().toString(36).slice(2);function uc(e){if(!e[qr]){e[qr]=!0,mu.forEach(function(a){a!=="selectionchange"&&(v0.has(a)||cc(a,!1,e),cc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qr]||(t[qr]=!0,cc("selectionchange",!1,t))}}function wm(e,t,a,n){switch(Ym(t)){case 2:var o=X0;break;case 8:o=Q0;break;default:o=Nc}a=o.bind(null,t,a,e),o=void 0,!Oi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function dc(e,t,a,n,o){var u=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var x=n.tag;if(x===3||x===4){var b=n.stateNode.containerInfo;if(b===o)break;if(x===4)for(x=n.return;x!==null;){var C=x.tag;if((C===3||C===4)&&x.stateNode.containerInfo===o)return;x=x.return}for(;b!==null;){if(x=Dn(b),x===null)return;if(C=x.tag,C===5||C===6||C===26||C===27){n=u=x;continue e}b=b.parentNode}}n=n.return}ku(function(){var _=u,Z=Ai(a),W=[];e:{var K=td.get(e);if(K!==void 0){var P=tr,ve=e;switch(e){case"keypress":if(Wl(a)===0)break e;case"keydown":case"keyup":P=hp;break;case"focusin":ve="focus",P=Ui;break;case"focusout":ve="blur",P=Ui;break;case"beforeblur":case"afterblur":P=Ui;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":P=Ru;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=ap;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=xp;break;case Ju:case Iu:case Wu:P=lp;break;case ed:P=bp;break;case"scroll":case"scrollend":P=ep;break;case"wheel":P=wp;break;case"copy":case"cut":case"paste":P=ip;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=Mu;break;case"toggle":case"beforetoggle":P=Sp}var ye=(t&4)!==0,Ge=!ye&&(e==="scroll"||e==="scrollend"),D=ye?K!==null?K+"Capture":null:K;ye=[];for(var M=_,U;M!==null;){var J=M;if(U=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||U===null||D===null||(J=zs(M,D),J!=null&&ye.push(gl(M,J,U))),Ge)break;M=M.return}0<ye.length&&(K=new P(K,ve,null,a,Z),W.push({event:K,listeners:ye}))}}if((t&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",K&&a!==Ti&&(ve=a.relatedTarget||a.fromElement)&&(Dn(ve)||ve[zn]))break e;if((P||K)&&(K=Z.window===Z?Z:(K=Z.ownerDocument)?K.defaultView||K.parentWindow:window,P?(ve=a.relatedTarget||a.toElement,P=_,ve=ve?Dn(ve):null,ve!==null&&(Ge=f(ve),ye=ve.tag,ve!==Ge||ye!==5&&ye!==27&&ye!==6)&&(ve=null)):(P=null,ve=_),P!==ve)){if(ye=Ru,J="onMouseLeave",D="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ye=Mu,J="onPointerLeave",D="onPointerEnter",M="pointer"),Ge=P==null?K:Ms(P),U=ve==null?K:Ms(ve),K=new ye(J,M+"leave",P,a,Z),K.target=Ge,K.relatedTarget=U,J=null,Dn(Z)===_&&(ye=new ye(D,M+"enter",ve,a,Z),ye.target=U,ye.relatedTarget=Ge,J=ye),Ge=J,P&&ve)t:{for(ye=P,D=ve,M=0,U=ye;U;U=hs(U))M++;for(U=0,J=D;J;J=hs(J))U++;for(;0<M-U;)ye=hs(ye),M--;for(;0<U-M;)D=hs(D),U--;for(;M--;){if(ye===D||D!==null&&ye===D.alternate)break t;ye=hs(ye),D=hs(D)}ye=null}else ye=null;P!==null&&jm(W,K,P,ye,!1),ve!==null&&Ge!==null&&jm(W,Ge,ve,ye,!0)}}e:{if(K=_?Ms(_):window,P=K.nodeName&&K.nodeName.toLowerCase(),P==="select"||P==="input"&&K.type==="file")var fe=Vu;else if(Hu(K))if(qu)fe=zp;else{fe=Op;var Te=Rp}else P=K.nodeName,!P||P.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?_&&ki(_.elementType)&&(fe=Vu):fe=Mp;if(fe&&(fe=fe(e,_))){Bu(W,fe,a,Z);break e}Te&&Te(e,K,_),e==="focusout"&&_&&K.type==="number"&&_.memoizedProps.value!=null&&Ei(K,"number",K.value)}switch(Te=_?Ms(_):window,e){case"focusin":(Hu(Te)||Te.contentEditable==="true")&&(Kn=Te,qi=_,qs=null);break;case"focusout":qs=qi=Kn=null;break;case"mousedown":Gi=!0;break;case"contextmenu":case"mouseup":case"dragend":Gi=!1,Fu(W,a,Z);break;case"selectionchange":if(Up)break;case"keydown":case"keyup":Fu(W,a,Z)}var ge;if(_i)e:{switch(e){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else $n?Lu(e,a)&&(be="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(be="onCompositionStart");be&&(zu&&a.locale!=="ko"&&($n||be!=="onCompositionStart"?be==="onCompositionEnd"&&$n&&(ge=Tu()):(Da=Z,Mi="value"in Da?Da.value:Da.textContent,$n=!0)),Te=Gr(_,be),0<Te.length&&(be=new Ou(be,e,null,a,Z),W.push({event:be,listeners:Te}),ge?be.data=ge:(ge=_u(a),ge!==null&&(be.data=ge)))),(ge=Cp?Ep(e,a):kp(e,a))&&(be=Gr(_,"onBeforeInput"),0<be.length&&(Te=new Ou("onBeforeInput","beforeinput",null,a,Z),W.push({event:Te,listeners:be}),Te.data=ge)),x0(W,e,_,a,Z)}vm(W,t)})}function gl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Gr(e,t){for(var a=t+"Capture",n=[];e!==null;){var o=e,u=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||u===null||(o=zs(e,a),o!=null&&n.unshift(gl(e,o,u)),o=zs(e,t),o!=null&&n.push(gl(e,o,u))),e.tag===3)return n;e=e.return}return[]}function hs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jm(e,t,a,n,o){for(var u=t._reactName,x=[];a!==null&&a!==n;){var b=a,C=b.alternate,_=b.stateNode;if(b=b.tag,C!==null&&C===n)break;b!==5&&b!==26&&b!==27||_===null||(C=_,o?(_=zs(a,u),_!=null&&x.unshift(gl(a,_,C))):o||(_=zs(a,u),_!=null&&x.push(gl(a,_,C)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var w0=/\r\n?/g,j0=/\u0000|\uFFFD/g;function Sm(e){return(typeof e=="string"?e:""+e).replace(w0,`
|
|
49
|
+
`).replace(j0,"")}function Nm(e,t){return t=Sm(t),Sm(e)===t}function $r(){}function qe(e,t,a,n,o,u){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Vn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Vn(e,""+n);break;case"className":Ql(e,"class",n);break;case"tabIndex":Ql(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ql(e,a,n);break;case"style":Cu(e,n,u);break;case"data":if(t!=="object"){Ql(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Jl(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="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 u=="function"&&(a==="formAction"?(t!=="input"&&qe(e,t,"name",o.name,o,null),qe(e,t,"formEncType",o.formEncType,o,null),qe(e,t,"formMethod",o.formMethod,o,null),qe(e,t,"formTarget",o.formTarget,o,null)):(qe(e,t,"encType",o.encType,o,null),qe(e,t,"method",o.method,o,null),qe(e,t,"target",o.target,o,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Jl(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=$r);break;case"onScroll":n!=null&&Re("scroll",e);break;case"onScrollEnd":n!=null&&Re("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Jl(""+n),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":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Re("beforetoggle",e),Re("toggle",e),Xl(e,"popover",n);break;case"xlinkActuate":fa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":fa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":fa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":fa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":fa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":fa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":fa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":fa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":fa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Xl(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ig.get(a)||a,Xl(e,a,n))}}function fc(e,t,a,n,o,u){switch(a){case"style":Cu(e,n,u);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Vn(e,n):(typeof n=="number"||typeof n=="bigint")&&Vn(e,""+n);break;case"onScroll":n!=null&&Re("scroll",e);break;case"onScrollEnd":n!=null&&Re("scrollend",e);break;case"onClick":n!=null&&(e.onclick=$r);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hu.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(o=a.endsWith("Capture"),t=a.slice(2,o?a.length-7:void 0),u=e[yt]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,o),typeof n=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,o);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Xl(e,a,n)}}}function ft(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("load",e);var n=!1,o=!1,u;for(u in a)if(a.hasOwnProperty(u)){var x=a[u];if(x!=null)switch(u){case"src":n=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:qe(e,t,u,x,a,null)}}o&&qe(e,t,"srcSet",a.srcSet,a,null),n&&qe(e,t,"src",a.src,a,null);return;case"input":Re("invalid",e);var b=u=x=o=null,C=null,_=null;for(n in a)if(a.hasOwnProperty(n)){var Z=a[n];if(Z!=null)switch(n){case"name":o=Z;break;case"type":x=Z;break;case"checked":C=Z;break;case"defaultChecked":_=Z;break;case"value":u=Z;break;case"defaultValue":b=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(c(137,t));break;default:qe(e,t,n,Z,a,null)}}wu(e,u,b,C,_,x,o,!1),Fl(e);return;case"select":Re("invalid",e),n=x=u=null;for(o in a)if(a.hasOwnProperty(o)&&(b=a[o],b!=null))switch(o){case"value":u=b;break;case"defaultValue":x=b;break;case"multiple":n=b;default:qe(e,t,o,b,a,null)}t=u,a=x,e.multiple=!!n,t!=null?Bn(e,!!n,t,!1):a!=null&&Bn(e,!!n,a,!0);return;case"textarea":Re("invalid",e),u=o=n=null;for(x in a)if(a.hasOwnProperty(x)&&(b=a[x],b!=null))switch(x){case"value":n=b;break;case"defaultValue":o=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(c(91));break;default:qe(e,t,x,b,a,null)}Su(e,n,o,u),Fl(e);return;case"option":for(C in a)if(a.hasOwnProperty(C)&&(n=a[C],n!=null))switch(C){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:qe(e,t,C,n,a,null)}return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(n=0;n<hl.length;n++)Re(hl[n],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("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(_ in a)if(a.hasOwnProperty(_)&&(n=a[_],n!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:qe(e,t,_,n,a,null)}return;default:if(ki(t)){for(Z in a)a.hasOwnProperty(Z)&&(n=a[Z],n!==void 0&&fc(e,t,Z,n,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(n=a[b],n!=null&&qe(e,t,b,n,a,null))}function S0(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,u=null,x=null,b=null,C=null,_=null,Z=null;for(P in a){var W=a[P];if(a.hasOwnProperty(P)&&W!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":C=W;default:n.hasOwnProperty(P)||qe(e,t,P,null,n,W)}}for(var K in n){var P=n[K];if(W=a[K],n.hasOwnProperty(K)&&(P!=null||W!=null))switch(K){case"type":u=P;break;case"name":o=P;break;case"checked":_=P;break;case"defaultChecked":Z=P;break;case"value":x=P;break;case"defaultValue":b=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(c(137,t));break;default:P!==W&&qe(e,t,K,P,n,W)}}Ci(e,x,b,C,_,Z,u,o);return;case"select":P=x=b=K=null;for(u in a)if(C=a[u],a.hasOwnProperty(u)&&C!=null)switch(u){case"value":break;case"multiple":P=C;default:n.hasOwnProperty(u)||qe(e,t,u,null,n,C)}for(o in n)if(u=n[o],C=a[o],n.hasOwnProperty(o)&&(u!=null||C!=null))switch(o){case"value":K=u;break;case"defaultValue":b=u;break;case"multiple":x=u;default:u!==C&&qe(e,t,o,u,n,C)}t=b,a=x,n=P,K!=null?Bn(e,!!a,K,!1):!!n!=!!a&&(t!=null?Bn(e,!!a,t,!0):Bn(e,!!a,a?[]:"",!1));return;case"textarea":P=K=null;for(b in a)if(o=a[b],a.hasOwnProperty(b)&&o!=null&&!n.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:qe(e,t,b,null,n,o)}for(x in n)if(o=n[x],u=a[x],n.hasOwnProperty(x)&&(o!=null||u!=null))switch(x){case"value":K=o;break;case"defaultValue":P=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==u&&qe(e,t,x,o,n,u)}ju(e,K,P);return;case"option":for(var ve in a)if(K=a[ve],a.hasOwnProperty(ve)&&K!=null&&!n.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:qe(e,t,ve,null,n,K)}for(C in n)if(K=n[C],P=a[C],n.hasOwnProperty(C)&&K!==P&&(K!=null||P!=null))switch(C){case"selected":e.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:qe(e,t,C,K,n,P)}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 ye in a)K=a[ye],a.hasOwnProperty(ye)&&K!=null&&!n.hasOwnProperty(ye)&&qe(e,t,ye,null,n,K);for(_ in n)if(K=n[_],P=a[_],n.hasOwnProperty(_)&&K!==P&&(K!=null||P!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(c(137,t));break;default:qe(e,t,_,K,n,P)}return;default:if(ki(t)){for(var Ge in a)K=a[Ge],a.hasOwnProperty(Ge)&&K!==void 0&&!n.hasOwnProperty(Ge)&&fc(e,t,Ge,void 0,n,K);for(Z in n)K=n[Z],P=a[Z],!n.hasOwnProperty(Z)||K===P||K===void 0&&P===void 0||fc(e,t,Z,K,n,P);return}}for(var D in a)K=a[D],a.hasOwnProperty(D)&&K!=null&&!n.hasOwnProperty(D)&&qe(e,t,D,null,n,K);for(W in n)K=n[W],P=a[W],!n.hasOwnProperty(W)||K===P||K==null&&P==null||qe(e,t,W,K,n,P)}var mc=null,hc=null;function Kr(e){return e.nodeType===9?e:e.ownerDocument}function Cm(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 Em(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function gc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var pc=null;function N0(){var e=window.event;return e&&e.type==="popstate"?e===pc?!1:(pc=e,!0):(pc=null,!1)}var km=typeof setTimeout=="function"?setTimeout:void 0,C0=typeof clearTimeout=="function"?clearTimeout:void 0,Tm=typeof Promise=="function"?Promise:void 0,E0=typeof queueMicrotask=="function"?queueMicrotask:typeof Tm<"u"?function(e){return Tm.resolve(null).then(e).catch(k0)}:km;function k0(e){setTimeout(function(){throw e})}function Za(e){return e==="head"}function Am(e,t){var a=t,n=0,o=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(0<n&&8>n){a=n;var x=e.ownerDocument;if(a&1&&pl(x.documentElement),a&2&&pl(x.body),a&4)for(a=x.head,pl(a),x=a.firstChild;x;){var b=x.nextSibling,C=x.nodeName;x[Os]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&x.rel.toLowerCase()==="stylesheet"||a.removeChild(x),x=b}}if(o===0){e.removeChild(u),Nl(t);return}o--}else a==="$"||a==="$?"||a==="$!"?o++:n=a.charCodeAt(0)-48;else n=0;a=u}while(a);Nl(t)}function xc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":xc(a),wi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function T0(e,t,a,n){for(;e.nodeType===1;){var o=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Os])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=It(e.nextSibling),e===null)break}return null}function A0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=It(e.nextSibling),e===null))return null;return e}function yc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function R0(e,t){var a=e.ownerDocument;if(e.data!=="$?"||a.readyState==="complete")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function It(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var bc=null;function Rm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}function Om(e,t,a){switch(t=Kr(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function pl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wi(e)}var $t=new Map,Mm=new Set;function Yr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ea=q.d;q.d={f:O0,r:M0,D:z0,C:D0,L:U0,m:L0,X:H0,S:_0,M:B0};function O0(){var e=Ea.f(),t=Lr();return e||t}function M0(e){var t=Un(e);t!==null&&t.tag===5&&t.type==="form"?Jd(t):Ea.r(e)}var gs=typeof document>"u"?null:document;function zm(e,t,a){var n=gs;if(n&&typeof t=="string"&&t){var o=Lt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Mm.has(o)||(Mm.add(o),e={rel:e,crossOrigin:a,href:t},n.querySelector(o)===null&&(t=n.createElement("link"),ft(t,"link",e),rt(t),n.head.appendChild(t)))}}function z0(e){Ea.D(e),zm("dns-prefetch",e,null)}function D0(e,t){Ea.C(e,t),zm("preconnect",e,t)}function U0(e,t,a){Ea.L(e,t,a);var n=gs;if(n&&e&&t){var o='link[rel="preload"][as="'+Lt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+Lt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+Lt(a.imageSizes)+'"]')):o+='[href="'+Lt(e)+'"]';var u=o;switch(t){case"style":u=ps(e);break;case"script":u=xs(e)}$t.has(u)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),$t.set(u,e),n.querySelector(o)!==null||t==="style"&&n.querySelector(xl(u))||t==="script"&&n.querySelector(yl(u))||(t=n.createElement("link"),ft(t,"link",e),rt(t),n.head.appendChild(t)))}}function L0(e,t){Ea.m(e,t);var a=gs;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Lt(n)+'"][href="'+Lt(e)+'"]',u=o;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=xs(e)}if(!$t.has(u)&&(e=y({rel:"modulepreload",href:e},t),$t.set(u,e),a.querySelector(o)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(yl(u)))return}n=a.createElement("link"),ft(n,"link",e),rt(n),a.head.appendChild(n)}}}function _0(e,t,a){Ea.S(e,t,a);var n=gs;if(n&&e){var o=Ln(n).hoistableStyles,u=ps(e);t=t||"default";var x=o.get(u);if(!x){var b={loading:0,preload:null};if(x=n.querySelector(xl(u)))b.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=$t.get(u))&&vc(e,a);var C=x=n.createElement("link");rt(C),ft(C,"link",e),C._p=new Promise(function(_,Z){C.onload=_,C.onerror=Z}),C.addEventListener("load",function(){b.loading|=1}),C.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Pr(x,t,n)}x={type:"stylesheet",instance:x,count:1,state:b},o.set(u,x)}}}function H0(e,t){Ea.X(e,t);var a=gs;if(a&&e){var n=Ln(a).hoistableScripts,o=xs(e),u=n.get(o);u||(u=a.querySelector(yl(o)),u||(e=y({src:e,async:!0},t),(t=$t.get(o))&&wc(e,t),u=a.createElement("script"),rt(u),ft(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(o,u))}}function B0(e,t){Ea.M(e,t);var a=gs;if(a&&e){var n=Ln(a).hoistableScripts,o=xs(e),u=n.get(o);u||(u=a.querySelector(yl(o)),u||(e=y({src:e,async:!0,type:"module"},t),(t=$t.get(o))&&wc(e,t),u=a.createElement("script"),rt(u),ft(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(o,u))}}function Dm(e,t,a,n){var o=(o=ee.current)?Yr(o):null;if(!o)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ps(a.href),a=Ln(o).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ps(a.href);var u=Ln(o).hoistableStyles,x=u.get(e);if(x||(o=o.ownerDocument||o,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,x),(u=o.querySelector(xl(e)))&&!u._p&&(x.instance=u,x.state.loading=5),$t.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},$t.set(e,a),u||V0(o,e,a,x.state))),t&&n===null)throw Error(c(528,""));return x}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xs(a),a=Ln(o).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function ps(e){return'href="'+Lt(e)+'"'}function xl(e){return'link[rel="stylesheet"]['+e+"]"}function Um(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function V0(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),ft(t,"link",a),rt(t),e.head.appendChild(t))}function xs(e){return'[src="'+Lt(e)+'"]'}function yl(e){return"script[async]"+e}function Lm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Lt(a.href)+'"]');if(n)return t.instance=n,rt(n),n;var o=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),rt(n),ft(n,"style",o),Pr(n,a.precedence,e),t.instance=n;case"stylesheet":o=ps(a.href);var u=e.querySelector(xl(o));if(u)return t.state.loading|=4,t.instance=u,rt(u),u;n=Um(a),(o=$t.get(o))&&vc(n,o),u=(e.ownerDocument||e).createElement("link"),rt(u);var x=u;return x._p=new Promise(function(b,C){x.onload=b,x.onerror=C}),ft(u,"link",n),t.state.loading|=4,Pr(u,a.precedence,e),t.instance=u;case"script":return u=xs(a.src),(o=e.querySelector(yl(u)))?(t.instance=o,rt(o),o):(n=a,(o=$t.get(u))&&(n=y({},a),wc(n,o)),e=e.ownerDocument||e,o=e.createElement("script"),rt(o),ft(o,"link",n),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Pr(n,a.precedence,e));return t.instance}function Pr(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=n.length?n[n.length-1]:null,u=o,x=0;x<n.length;x++){var b=n[x];if(b.dataset.precedence===t)u=b;else if(u!==o)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function vc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xr=null;function _m(e,t,a){if(Xr===null){var n=new Map,o=Xr=new Map;o.set(a,n)}else o=Xr,n=o.get(a),n||(n=new Map,o.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),o=0;o<a.length;o++){var u=a[o];if(!(u[Os]||u[tt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var x=u.getAttribute(t)||"";x=e+x;var b=n.get(x);b?b.push(u):n.set(x,[u])}}return n}function Hm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function q0(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Bm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var bl=null;function G0(){}function $0(e,t,a){if(bl===null)throw Error(c(475));var n=bl;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var o=ps(a.href),u=e.querySelector(xl(o));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=Qr.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=u,rt(u);return}u=e.ownerDocument||e,a=Um(a),(o=$t.get(o))&&vc(a,o),u=u.createElement("link"),rt(u);var x=u;x._p=new Promise(function(b,C){x.onload=b,x.onerror=C}),ft(u,"link",a),t.instance=u}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(n.count++,t=Qr.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}function K0(){if(bl===null)throw Error(c(475));var e=bl;return e.stylesheets&&e.count===0&&jc(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function Qr(){if(this.count--,this.count===0){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fr=null;function jc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fr=new Map,t.forEach(Y0,e),Fr=null,Qr.call(e))}function Y0(e,t){if(!(t.state.loading&4)){var a=Fr.get(e);if(a)var n=a.get(null);else{a=new Map,Fr.set(e,a);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<o.length;u++){var x=o[u];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),n=x)}n&&a.set(null,n)}o=t.instance,x=o.getAttribute("data-precedence"),u=a.get(x)||n,u===n&&a.set(null,o),a.set(x,o),this.count++,n=Qr.bind(this),o.addEventListener("load",n),o.addEventListener("error",n),u?u.parentNode.insertBefore(o,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var vl={$$typeof:$,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function P0(e,t,a,n,o,u,x,b){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xt(0),this.hiddenUpdates=Xt(null),this.identifierPrefix=n,this.onUncaughtError=o,this.onCaughtError=u,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function Vm(e,t,a,n,o,u,x,b,C,_,Z,W){return e=new P0(e,t,a,x,b,C,_,W),t=1,u===!0&&(t|=24),u=Tt(3,null,null,t),e.current=u,u.stateNode=e,t=ao(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:n,isDehydrated:a,cache:t},ro(u),e}function qm(e){return e?(e=Qn,e):Qn}function Gm(e,t,a,n,o,u){o=qm(o),n.context===null?n.context=o:n.pendingContext=o,n=_a(t),n.payload={element:a},u=u===void 0?null:u,u!==null&&(n.callback=u),a=Ha(e,n,t),a!==null&&(zt(a,e,t),Zs(a,e,t))}function $m(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Sc(e,t){$m(e,t),(e=e.alternate)&&$m(e,t)}function Km(e){if(e.tag===13){var t=Xn(e,67108864);t!==null&&zt(t,e,67108864),Sc(e,67108864)}}var Zr=!0;function X0(e,t,a,n){var o=k.T;k.T=null;var u=q.p;try{q.p=2,Nc(e,t,a,n)}finally{q.p=u,k.T=o}}function Q0(e,t,a,n){var o=k.T;k.T=null;var u=q.p;try{q.p=8,Nc(e,t,a,n)}finally{q.p=u,k.T=o}}function Nc(e,t,a,n){if(Zr){var o=Cc(n);if(o===null)dc(e,t,n,Jr,a),Pm(e,n);else if(Z0(o,e,t,a,n))n.stopPropagation();else if(Pm(e,n),t&4&&-1<F0.indexOf(e)){for(;o!==null;){var u=Un(o);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var x=ta(u.pendingLanes);if(x!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;x;){var C=1<<31-ht(x);b.entanglements[1]|=C,x&=~C}ia(u),(_e&6)===0&&(Dr=Le()+500,ml(0))}}break;case 13:b=Xn(u,2),b!==null&&zt(b,u,2),Lr(),Sc(u,2)}if(u=Cc(n),u===null&&dc(e,t,n,Jr,a),u===o)break;o=u}o!==null&&n.stopPropagation()}else dc(e,t,n,null,a)}}function Cc(e){return e=Ai(e),Ec(e)}var Jr=null;function Ec(e){if(Jr=null,e=Dn(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Jr=e,null}function Ym(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(vt()){case Ra:return 2;case Oa:return 8;case da:case Ma:return 32;case As:return 268435456;default:return 32}default:return 32}}var kc=!1,Ja=null,Ia=null,Wa=null,wl=new Map,jl=new Map,en=[],F0="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 Pm(e,t){switch(e){case"focusin":case"focusout":Ja=null;break;case"dragenter":case"dragleave":Ia=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":wl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.delete(t.pointerId)}}function Sl(e,t,a,n,o,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:u,targetContainers:[o]},t!==null&&(t=Un(t),t!==null&&Km(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Z0(e,t,a,n,o){switch(t){case"focusin":return Ja=Sl(Ja,e,t,a,n,o),!0;case"dragenter":return Ia=Sl(Ia,e,t,a,n,o),!0;case"mouseover":return Wa=Sl(Wa,e,t,a,n,o),!0;case"pointerover":var u=o.pointerId;return wl.set(u,Sl(wl.get(u)||null,e,t,a,n,o)),!0;case"gotpointercapture":return u=o.pointerId,jl.set(u,Sl(jl.get(u)||null,e,t,a,n,o)),!0}return!1}function Xm(e){var t=Dn(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,Pl(e.priority,function(){if(a.tag===13){var n=Mt();n=aa(n);var o=Xn(a,n);o!==null&&zt(o,a,n),Sc(a,n)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ir(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Cc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Ti=n,a.target.dispatchEvent(n),Ti=null}else return t=Un(a),t!==null&&Km(t),e.blockedOn=a,!1;t.shift()}return!0}function Qm(e,t,a){Ir(e)&&a.delete(t)}function J0(){kc=!1,Ja!==null&&Ir(Ja)&&(Ja=null),Ia!==null&&Ir(Ia)&&(Ia=null),Wa!==null&&Ir(Wa)&&(Wa=null),wl.forEach(Qm),jl.forEach(Qm)}function Wr(e,t){e.blockedOn===t&&(e.blockedOn=null,kc||(kc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,J0)))}var ei=null;function Fm(e){ei!==e&&(ei=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){ei===e&&(ei=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],o=e[t+2];if(typeof n!="function"){if(Ec(n||a)===null)continue;break}var u=Un(a);u!==null&&(e.splice(t,3),t-=3,Eo(u,{pending:!0,data:o,method:a.method,action:n},n,o))}}))}function Nl(e){function t(C){return Wr(C,e)}Ja!==null&&Wr(Ja,e),Ia!==null&&Wr(Ia,e),Wa!==null&&Wr(Wa,e),wl.forEach(t),jl.forEach(t);for(var a=0;a<en.length;a++){var n=en[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<en.length&&(a=en[0],a.blockedOn===null);)Xm(a),a.blockedOn===null&&en.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var o=a[n],u=a[n+1],x=o[yt]||null;if(typeof u=="function")x||Fm(a);else if(x){var b=null;if(u&&u.hasAttribute("formAction")){if(o=u,x=u[yt]||null)b=x.formAction;else if(Ec(o)!==null)continue}else b=x.action;typeof b=="function"?a[n+1]=b:(a.splice(n,3),n-=3),Fm(a)}}}function Tc(e){this._internalRoot=e}ti.prototype.render=Tc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=Mt();Gm(a,n,e,t,null,null)},ti.prototype.unmount=Tc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Gm(e.current,2,null,e,null,null),Lr(),t[zn]=null}};function ti(e){this._internalRoot=e}ti.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rs();e={blockedOn:null,target:e,priority:t};for(var a=0;a<en.length&&t!==0&&t<en[a].priority;a++);en.splice(a,0,e),a===0&&Xm(e)}};var Zm=i.version;if(Zm!=="19.1.0")throw Error(c(527,Zm,"19.1.0"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=g(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var I0={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ai=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ai.isDisabled&&ai.supportsFiber)try{za=ai.inject(I0),mt=ai}catch{}}return El.createRoot=function(e,t){if(!d(e))throw Error(c(299));var a=!1,n="",o=ff,u=mf,x=hf,b=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(b=t.unstable_transitionCallbacks)),t=Vm(e,1,!1,null,null,a,n,o,u,x,b,null),e[zn]=t.current,uc(e),new Tc(t)},El.hydrateRoot=function(e,t,a){if(!d(e))throw Error(c(299));var n=!1,o="",u=ff,x=mf,b=hf,C=null,_=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(C=a.unstable_transitionCallbacks),a.formState!==void 0&&(_=a.formState)),t=Vm(e,1,!0,t,a??null,n,o,u,x,b,C,_),t.context=qm(null),a=t.current,n=Mt(),n=aa(n),o=_a(n),o.callback=null,Ha(a,o,n),a=n,t.current.lanes=a,Qt(t,a),ia(t),e[zn]=t.current,uc(e),new ti(t)},El.version="19.1.0",El}var rh;function ox(){if(rh)return Oc.exports;rh=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(i){console.error(i)}}return s(),Oc.exports=ix(),Oc.exports}var cx=ox();const ih=qh(cx);var kl={},oh;function ux(){if(oh)return kl;oh=1,Object.defineProperty(kl,"__esModule",{value:!0}),kl.parse=m,kl.serialize=h;const s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,c=/^[\u0020-\u003A\u003D-\u007E]*$/,d=Object.prototype.toString,f=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function m(v,T){const S=new f,E=v.length;if(E<2)return S;const O=(T==null?void 0:T.decode)||y;let R=0;do{const A=v.indexOf("=",R);if(A===-1)break;const $=v.indexOf(";",R),F=$===-1?E:$;if(A>F){R=v.lastIndexOf(";",A-1)+1;continue}const B=p(v,R,A),oe=g(v,A,B),Q=v.slice(B,oe);if(S[Q]===void 0){let H=p(v,A+1,F),I=g(v,F,H);const ne=O(v.slice(H,I));S[Q]=ne}R=F+1}while(R<E);return S}function p(v,T,S){do{const E=v.charCodeAt(T);if(E!==32&&E!==9)return T}while(++T<S);return S}function g(v,T,S){for(;T>S;){const E=v.charCodeAt(--T);if(E!==32&&E!==9)return T+1}return S}function h(v,T,S){const E=(S==null?void 0:S.encode)||encodeURIComponent;if(!s.test(v))throw new TypeError(`argument name is invalid: ${v}`);const O=E(T);if(!i.test(O))throw new TypeError(`argument val is invalid: ${T}`);let R=v+"="+O;if(!S)return R;if(S.maxAge!==void 0){if(!Number.isInteger(S.maxAge))throw new TypeError(`option maxAge is invalid: ${S.maxAge}`);R+="; Max-Age="+S.maxAge}if(S.domain){if(!r.test(S.domain))throw new TypeError(`option domain is invalid: ${S.domain}`);R+="; Domain="+S.domain}if(S.path){if(!c.test(S.path))throw new TypeError(`option path is invalid: ${S.path}`);R+="; Path="+S.path}if(S.expires){if(!j(S.expires)||!Number.isFinite(S.expires.valueOf()))throw new TypeError(`option expires is invalid: ${S.expires}`);R+="; Expires="+S.expires.toUTCString()}if(S.httpOnly&&(R+="; HttpOnly"),S.secure&&(R+="; Secure"),S.partitioned&&(R+="; Partitioned"),S.priority)switch(typeof S.priority=="string"?S.priority.toLowerCase():void 0){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${S.priority}`)}if(S.sameSite)switch(typeof S.sameSite=="string"?S.sameSite.toLowerCase():S.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${S.sameSite}`)}return R}function y(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function j(v){return d.call(v)==="[object Date]"}return kl}ux();var ch="popstate";function dx(s={}){function i(c,d){let{pathname:f,search:m,hash:p}=c.location;return $c("",{pathname:f,search:m,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function r(c,d){return typeof d=="string"?d:Ml(d)}return mx(i,r,null,s)}function Pe(s,i){if(s===!1||s===null||typeof s>"u")throw new Error(i)}function Wt(s,i){if(!s){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function fx(){return Math.random().toString(36).substring(2,10)}function uh(s,i){return{usr:s.state,key:s.key,idx:i}}function $c(s,i,r=null,c){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof i=="string"?Ns(i):i,state:r,key:i&&i.key||c||fx()}}function Ml({pathname:s="/",search:i="",hash:r=""}){return i&&i!=="?"&&(s+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(s+=r.charAt(0)==="#"?r:"#"+r),s}function Ns(s){let i={};if(s){let r=s.indexOf("#");r>=0&&(i.hash=s.substring(r),s=s.substring(0,r));let c=s.indexOf("?");c>=0&&(i.search=s.substring(c),s=s.substring(0,c)),s&&(i.pathname=s)}return i}function mx(s,i,r,c={}){let{window:d=document.defaultView,v5Compat:f=!1}=c,m=d.history,p="POP",g=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function j(){p="POP";let O=y(),R=O==null?null:O-h;h=O,g&&g({action:p,location:E.location,delta:R})}function v(O,R){p="PUSH";let A=$c(E.location,O,R);h=y()+1;let $=uh(A,h),F=E.createHref(A);try{m.pushState($,"",F)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;d.location.assign(F)}f&&g&&g({action:p,location:E.location,delta:1})}function T(O,R){p="REPLACE";let A=$c(E.location,O,R);h=y();let $=uh(A,h),F=E.createHref(A);m.replaceState($,"",F),f&&g&&g({action:p,location:E.location,delta:0})}function S(O){return hx(O)}let E={get action(){return p},get location(){return s(d,m)},listen(O){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(ch,j),g=O,()=>{d.removeEventListener(ch,j),g=null}},createHref(O){return i(d,O)},createURL:S,encodeLocation(O){let R=S(O);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:v,replace:T,go(O){return m.go(O)}};return E}function hx(s,i=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Pe(r,"No window.location.(origin|href) available to create URL");let c=typeof s=="string"?s:Ml(s);return c=c.replace(/ $/,"%20"),!i&&c.startsWith("//")&&(c=r+c),new URL(c,r)}function Gh(s,i,r="/"){return gx(s,i,r,!1)}function gx(s,i,r,c){let d=typeof i=="string"?Ns(i):i,f=Aa(d.pathname||"/",r);if(f==null)return null;let m=$h(s);px(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=kx(f);p=Cx(m[g],h,c)}return p}function $h(s,i=[],r=[],c=""){let d=(f,m,p)=>{let g={relativePath:p===void 0?f.path||"":p,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};g.relativePath.startsWith("/")&&(Pe(g.relativePath.startsWith(c),`Absolute route path "${g.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(c.length));let h=Ta([c,g.relativePath]),y=r.concat(g);f.children&&f.children.length>0&&(Pe(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),$h(f.children,i,y,h)),!(f.path==null&&!f.index)&&i.push({path:h,score:Sx(h,f.index),routesMeta:y})};return s.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))d(f,m);else for(let g of Kh(f.path))d(f,m,g)}),i}function Kh(s){let i=s.split("/");if(i.length===0)return[];let[r,...c]=i,d=r.endsWith("?"),f=r.replace(/\?$/,"");if(c.length===0)return d?[f,""]:[f];let m=Kh(c.join("/")),p=[];return p.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&p.push(...m),p.map(g=>s.startsWith("/")&&g===""?"/":g)}function px(s){s.sort((i,r)=>i.score!==r.score?r.score-i.score:Nx(i.routesMeta.map(c=>c.childrenIndex),r.routesMeta.map(c=>c.childrenIndex)))}var xx=/^:[\w-]+$/,yx=3,bx=2,vx=1,wx=10,jx=-2,dh=s=>s==="*";function Sx(s,i){let r=s.split("/"),c=r.length;return r.some(dh)&&(c+=jx),i&&(c+=bx),r.filter(d=>!dh(d)).reduce((d,f)=>d+(xx.test(f)?yx:f===""?vx:wx),c)}function Nx(s,i){return s.length===i.length&&s.slice(0,-1).every((c,d)=>c===i[d])?s[s.length-1]-i[i.length-1]:0}function Cx(s,i,r=!1){let{routesMeta:c}=s,d={},f="/",m=[];for(let p=0;p<c.length;++p){let g=c[p],h=p===c.length-1,y=f==="/"?i:i.slice(f.length)||"/",j=di({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),v=g.route;if(!j&&h&&r&&!c[c.length-1].route.index&&(j=di({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!j)return null;Object.assign(d,j.params),m.push({params:d,pathname:Ta([f,j.pathname]),pathnameBase:Ox(Ta([f,j.pathnameBase])),route:v}),j.pathnameBase!=="/"&&(f=Ta([f,j.pathnameBase]))}return m}function di(s,i){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[r,c]=Ex(s.path,s.caseSensitive,s.end),d=i.match(r);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),p=d.slice(1);return{params:c.reduce((h,{paramName:y,isOptional:j},v)=>{if(y==="*"){let S=p[v]||"";m=f.slice(0,f.length-S.length).replace(/(.)\/+$/,"$1")}const T=p[v];return j&&!T?h[y]=void 0:h[y]=(T||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:s}}function Ex(s,i=!1,r=!0){Wt(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 c=[],d="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g)=>(c.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(c.push({paramName:"*"}),d+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?d+="\\/*$":s!==""&&s!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),c]}function kx(s){try{return s.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Wt(!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 (${i}).`),s}}function Aa(s,i){if(i==="/")return s;if(!s.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,c=s.charAt(r);return c&&c!=="/"?null:s.slice(r)||"/"}function Tx(s,i="/"){let{pathname:r,search:c="",hash:d=""}=typeof s=="string"?Ns(s):s;return{pathname:r?r.startsWith("/")?r:Ax(r,i):i,search:Mx(c),hash:zx(d)}}function Ax(s,i){let r=i.replace(/\/+$/,"").split("/");return s.split("/").forEach(d=>{d===".."?r.length>1&&r.pop():d!=="."&&r.push(d)}),r.length>1?r.join("/"):"/"}function Uc(s,i,r,c){return`Cannot include a '${s}' character in a manually specified \`to.${i}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Rx(s){return s.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function eu(s){let i=Rx(s);return i.map((r,c)=>c===i.length-1?r.pathname:r.pathnameBase)}function tu(s,i,r,c=!1){let d;typeof s=="string"?d=Ns(s):(d={...s},Pe(!d.pathname||!d.pathname.includes("?"),Uc("?","pathname","search",d)),Pe(!d.pathname||!d.pathname.includes("#"),Uc("#","pathname","hash",d)),Pe(!d.search||!d.search.includes("#"),Uc("#","search","hash",d)));let f=s===""||d.pathname==="",m=f?"/":d.pathname,p;if(m==null)p=r;else{let j=i.length-1;if(!c&&m.startsWith("..")){let v=m.split("/");for(;v[0]==="..";)v.shift(),j-=1;d.pathname=v.join("/")}p=j>=0?i[j]:"/"}let g=Tx(d,p),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var Ta=s=>s.join("/").replace(/\/\/+/g,"/"),Ox=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Mx=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,zx=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function Dx(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}var Yh=["POST","PUT","PATCH","DELETE"];new Set(Yh);var Ux=["GET",...Yh];new Set(Ux);var Cs=w.createContext(null);Cs.displayName="DataRouter";var pi=w.createContext(null);pi.displayName="DataRouterState";var Ph=w.createContext({isTransitioning:!1});Ph.displayName="ViewTransition";var Lx=w.createContext(new Map);Lx.displayName="Fetchers";var _x=w.createContext(null);_x.displayName="Await";var ea=w.createContext(null);ea.displayName="Navigation";var Ul=w.createContext(null);Ul.displayName="Location";var Kt=w.createContext({outlet:null,matches:[],isDataRoute:!1});Kt.displayName="Route";var au=w.createContext(null);au.displayName="RouteError";function Hx(s,{relative:i}={}){Pe(Es(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:c}=w.useContext(ea),{hash:d,pathname:f,search:m}=Ll(s,{relative:i}),p=f;return r!=="/"&&(p=f==="/"?r:Ta([r,f])),c.createHref({pathname:p,search:m,hash:d})}function Es(){return w.useContext(Ul)!=null}function sn(){return Pe(Es(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Ul).location}var Xh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Qh(s){w.useContext(ea).static||w.useLayoutEffect(s)}function On(){let{isDataRoute:s}=w.useContext(Kt);return s?ey():Bx()}function Bx(){Pe(Es(),"useNavigate() may be used only in the context of a <Router> component.");let s=w.useContext(Cs),{basename:i,navigator:r}=w.useContext(ea),{matches:c}=w.useContext(Kt),{pathname:d}=sn(),f=JSON.stringify(eu(c)),m=w.useRef(!1);return Qh(()=>{m.current=!0}),w.useCallback((g,h={})=>{if(Wt(m.current,Xh),!m.current)return;if(typeof g=="number"){r.go(g);return}let y=tu(g,JSON.parse(f),d,h.relative==="path");s==null&&i!=="/"&&(y.pathname=y.pathname==="/"?i:Ta([i,y.pathname])),(h.replace?r.replace:r.push)(y,h.state,h)},[i,r,f,d,s])}var Vx=w.createContext(null);function qx(s){let i=w.useContext(Kt).outlet;return i&&w.createElement(Vx.Provider,{value:s},i)}function Gx(){let{matches:s}=w.useContext(Kt),i=s[s.length-1];return i?i.params:{}}function Ll(s,{relative:i}={}){let{matches:r}=w.useContext(Kt),{pathname:c}=sn(),d=JSON.stringify(eu(r));return w.useMemo(()=>tu(s,JSON.parse(d),c,i==="path"),[s,d,c,i])}function $x(s,i){return Fh(s,i)}function Fh(s,i,r,c){var R;Pe(Es(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=w.useContext(ea),{matches:f}=w.useContext(Kt),m=f[f.length-1],p=m?m.params:{},g=m?m.pathname:"/",h=m?m.pathnameBase:"/",y=m&&m.route;{let A=y&&y.path||"";Zh(g,!y||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${A}">) 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.
|
|
50
|
+
|
|
51
|
+
Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let j=sn(),v;if(i){let A=typeof i=="string"?Ns(i):i;Pe(h==="/"||((R=A.pathname)==null?void 0:R.startsWith(h)),`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 "${h}" but pathname "${A.pathname}" was given in the \`location\` prop.`),v=A}else v=j;let T=v.pathname||"/",S=T;if(h!=="/"){let A=h.replace(/^\//,"").split("/");S="/"+T.replace(/^\//,"").split("/").slice(A.length).join("/")}let E=Gh(s,{pathname:S});Wt(y||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Wt(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 O=Qx(E&&E.map(A=>Object.assign({},A,{params:Object.assign({},p,A.params),pathname:Ta([h,d.encodeLocation?d.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?h:Ta([h,d.encodeLocation?d.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),f,r,c);return i&&O?w.createElement(Ul.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},O):O}function Kx(){let s=Wx(),i=Dx(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),r=s instanceof Error?s.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},f={padding:"2px 4px",backgroundColor:c},m=null;return console.error("Error handled by React Router default ErrorBoundary:",s),m=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:f},"ErrorBoundary")," or"," ",w.createElement("code",{style:f},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},i),r?w.createElement("pre",{style:d},r):null,m)}var Yx=w.createElement(Kx,null),Px=class extends w.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,i){return i.location!==s.location||i.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:i.error,location:i.location,revalidation:s.revalidation||i.revalidation}}componentDidCatch(s,i){console.error("React Router caught the following error during render",s,i)}render(){return this.state.error!==void 0?w.createElement(Kt.Provider,{value:this.props.routeContext},w.createElement(au.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Xx({routeContext:s,match:i,children:r}){let c=w.useContext(Cs);return c&&c.static&&c.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=i.route.id),w.createElement(Kt.Provider,{value:s},r)}function Qx(s,i=[],r=null,c=null){if(s==null){if(!r)return null;if(r.errors)s=r.matches;else if(i.length===0&&!r.initialized&&r.matches.length>0)s=r.matches;else return null}let d=s,f=r==null?void 0:r.errors;if(f!=null){let g=d.findIndex(h=>h.route.id&&(f==null?void 0:f[h.route.id])!==void 0);Pe(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,g+1))}let m=!1,p=-1;if(r)for(let g=0;g<d.length;g++){let h=d[g];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(p=g),h.route.id){let{loaderData:y,errors:j}=r,v=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!j||j[h.route.id]===void 0);if(h.route.lazy||v){m=!0,p>=0?d=d.slice(0,p+1):d=[d[0]];break}}}return d.reduceRight((g,h,y)=>{let j,v=!1,T=null,S=null;r&&(j=f&&h.route.id?f[h.route.id]:void 0,T=h.route.errorElement||Yx,m&&(p<0&&y===0?(Zh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,S=null):p===y&&(v=!0,S=h.route.hydrateFallbackElement||null)));let E=i.concat(d.slice(0,y+1)),O=()=>{let R;return j?R=T:v?R=S:h.route.Component?R=w.createElement(h.route.Component,null):h.route.element?R=h.route.element:R=g,w.createElement(Xx,{match:h,routeContext:{outlet:g,matches:E,isDataRoute:r!=null},children:R})};return r&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?w.createElement(Px,{location:r.location,revalidation:r.revalidation,component:T,error:j,children:O(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):O()},null)}function nu(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fx(s){let i=w.useContext(Cs);return Pe(i,nu(s)),i}function Zx(s){let i=w.useContext(pi);return Pe(i,nu(s)),i}function Jx(s){let i=w.useContext(Kt);return Pe(i,nu(s)),i}function su(s){let i=Jx(s),r=i.matches[i.matches.length-1];return Pe(r.route.id,`${s} can only be used on routes that contain a unique "id"`),r.route.id}function Ix(){return su("useRouteId")}function Wx(){var c;let s=w.useContext(au),i=Zx("useRouteError"),r=su("useRouteError");return s!==void 0?s:(c=i.errors)==null?void 0:c[r]}function ey(){let{router:s}=Fx("useNavigate"),i=su("useNavigate"),r=w.useRef(!1);return Qh(()=>{r.current=!0}),w.useCallback(async(d,f={})=>{Wt(r.current,Xh),r.current&&(typeof d=="number"?s.navigate(d):await s.navigate(d,{fromRouteId:i,...f}))},[s,i])}var fh={};function Zh(s,i,r){!i&&!fh[s]&&(fh[s]=!0,Wt(!1,r))}w.memo(ty);function ty({routes:s,future:i,state:r}){return Fh(s,void 0,r,i)}function Jh({to:s,replace:i,state:r,relative:c}){Pe(Es(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=w.useContext(ea);Wt(!d,"<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:f}=w.useContext(Kt),{pathname:m}=sn(),p=On(),g=tu(s,eu(f),m,c==="path"),h=JSON.stringify(g);return w.useEffect(()=>{p(JSON.parse(h),{replace:i,state:r,relative:c})},[p,h,c,i,r]),null}function Ih(s){return qx(s.context)}function Dt(s){Pe(!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 ay({basename:s="/",children:i=null,location:r,navigationType:c="POP",navigator:d,static:f=!1}){Pe(!Es(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=s.replace(/^\/*/,"/"),p=w.useMemo(()=>({basename:m,navigator:d,static:f,future:{}}),[m,d,f]);typeof r=="string"&&(r=Ns(r));let{pathname:g="/",search:h="",hash:y="",state:j=null,key:v="default"}=r,T=w.useMemo(()=>{let S=Aa(g,m);return S==null?null:{location:{pathname:S,search:h,hash:y,state:j,key:v},navigationType:c}},[m,g,h,y,j,v,c]);return Wt(T!=null,`<Router basename="${m}"> is not able to match the URL "${g}${h}${y}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:w.createElement(ea.Provider,{value:p},w.createElement(Ul.Provider,{children:i,value:T}))}function ny({children:s,location:i}){return $x(Kc(s),i)}function Kc(s,i=[]){let r=[];return w.Children.forEach(s,(c,d)=>{if(!w.isValidElement(c))return;let f=[...i,d];if(c.type===w.Fragment){r.push.apply(r,Kc(c.props.children,f));return}Pe(c.type===Dt,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pe(!c.props.index||!c.props.children,"An index route cannot have child routes.");let m={id:c.props.id||f.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(m.children=Kc(c.props.children,f)),r.push(m)}),r}var ci="get",ui="application/x-www-form-urlencoded";function xi(s){return s!=null&&typeof s.tagName=="string"}function sy(s){return xi(s)&&s.tagName.toLowerCase()==="button"}function ly(s){return xi(s)&&s.tagName.toLowerCase()==="form"}function ry(s){return xi(s)&&s.tagName.toLowerCase()==="input"}function iy(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function oy(s,i){return s.button===0&&(!i||i==="_self")&&!iy(s)}var ni=null;function cy(){if(ni===null)try{new FormData(document.createElement("form"),0),ni=!1}catch{ni=!0}return ni}var uy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Lc(s){return s!=null&&!uy.has(s)?(Wt(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ui}"`),null):s}function dy(s,i){let r,c,d,f,m;if(ly(s)){let p=s.getAttribute("action");c=p?Aa(p,i):null,r=s.getAttribute("method")||ci,d=Lc(s.getAttribute("enctype"))||ui,f=new FormData(s)}else if(sy(s)||ry(s)&&(s.type==="submit"||s.type==="image")){let p=s.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=s.getAttribute("formaction")||p.getAttribute("action");if(c=g?Aa(g,i):null,r=s.getAttribute("formmethod")||p.getAttribute("method")||ci,d=Lc(s.getAttribute("formenctype"))||Lc(p.getAttribute("enctype"))||ui,f=new FormData(p,s),!cy()){let{name:h,type:y,value:j}=s;if(y==="image"){let v=h?`${h}.`:"";f.append(`${v}x`,"0"),f.append(`${v}y`,"0")}else h&&f.append(h,j)}}else{if(xi(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ci,c=null,d=ui,m=s}return f&&d==="text/plain"&&(m=f,f=void 0),{action:c,method:r.toLowerCase(),encType:d,formData:f,body:m}}function lu(s,i){if(s===!1||s===null||typeof s>"u")throw new Error(i)}async function fy(s,i){if(s.id in i)return i[s.id];try{let r=await import(s.module);return i[s.id]=r,r}catch(r){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function my(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 hy(s,i,r){let c=await Promise.all(s.map(async d=>{let f=i.routes[d.route.id];if(f){let m=await fy(f,r);return m.links?m.links():[]}return[]}));return yy(c.flat(1).filter(my).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function mh(s,i,r,c,d,f){let m=(g,h)=>r[h]?g.route.id!==r[h].route.id:!0,p=(g,h)=>{var y;return r[h].pathname!==g.pathname||((y=r[h].route.path)==null?void 0:y.endsWith("*"))&&r[h].params["*"]!==g.params["*"]};return f==="assets"?i.filter((g,h)=>m(g,h)||p(g,h)):f==="data"?i.filter((g,h)=>{var j;let y=c.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let v=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((j=r[0])==null?void 0:j.params)||{},nextUrl:new URL(s,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function gy(s,i,{includeHydrateFallback:r}={}){return py(s.map(c=>{let d=i.routes[c.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),r&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function py(s){return[...new Set(s)]}function xy(s){let i={},r=Object.keys(s).sort();for(let c of r)i[c]=s[c];return i}function yy(s,i){let r=new Set;return new Set(i),s.reduce((c,d)=>{let f=JSON.stringify(xy(d));return r.has(f)||(r.add(f),c.push({key:f,link:d})),c},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var by=new Set([100,101,204,205]);function vy(s,i){let r=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return r.pathname==="/"?r.pathname="_root.data":i&&Aa(r.pathname,i)==="/"?r.pathname=`${i.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function Wh(){let s=w.useContext(Cs);return lu(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function wy(){let s=w.useContext(pi);return lu(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var ru=w.createContext(void 0);ru.displayName="FrameworkContext";function eg(){let s=w.useContext(ru);return lu(s,"You must render this element inside a <HydratedRouter> element"),s}function jy(s,i){let r=w.useContext(ru),[c,d]=w.useState(!1),[f,m]=w.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:j}=i,v=w.useRef(null);w.useEffect(()=>{if(s==="render"&&m(!0),s==="viewport"){let E=R=>{R.forEach(A=>{m(A.isIntersecting)})},O=new IntersectionObserver(E,{threshold:.5});return v.current&&O.observe(v.current),()=>{O.disconnect()}}},[s]),w.useEffect(()=>{if(c){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[c]);let T=()=>{d(!0)},S=()=>{d(!1),m(!1)};return r?s!=="intent"?[f,v,{}]:[f,v,{onFocus:Tl(p,T),onBlur:Tl(g,S),onMouseEnter:Tl(h,T),onMouseLeave:Tl(y,S),onTouchStart:Tl(j,T)}]:[!1,v,{}]}function Tl(s,i){return r=>{s&&s(r),r.defaultPrevented||i(r)}}function Sy({page:s,...i}){let{router:r}=Wh(),c=w.useMemo(()=>Gh(r.routes,s,r.basename),[r.routes,s,r.basename]);return c?w.createElement(Cy,{page:s,matches:c,...i}):null}function Ny(s){let{manifest:i,routeModules:r}=eg(),[c,d]=w.useState([]);return w.useEffect(()=>{let f=!1;return hy(s,i,r).then(m=>{f||d(m)}),()=>{f=!0}},[s,i,r]),c}function Cy({page:s,matches:i,...r}){let c=sn(),{manifest:d,routeModules:f}=eg(),{basename:m}=Wh(),{loaderData:p,matches:g}=wy(),h=w.useMemo(()=>mh(s,i,g,d,c,"data"),[s,i,g,d,c]),y=w.useMemo(()=>mh(s,i,g,d,c,"assets"),[s,i,g,d,c]),j=w.useMemo(()=>{if(s===c.pathname+c.search+c.hash)return[];let S=new Set,E=!1;if(i.forEach(R=>{var $;let A=d.routes[R.route.id];!A||!A.hasLoader||(!h.some(F=>F.route.id===R.route.id)&&R.route.id in p&&(($=f[R.route.id])!=null&&$.shouldRevalidate)||A.hasClientLoader?E=!0:S.add(R.route.id))}),S.size===0)return[];let O=vy(s,m);return E&&S.size>0&&O.searchParams.set("_routes",i.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[O.pathname+O.search]},[m,p,c,d,h,i,s,f]),v=w.useMemo(()=>gy(y,d),[y,d]),T=Ny(y);return w.createElement(w.Fragment,null,j.map(S=>w.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),v.map(S=>w.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),T.map(({key:S,link:E})=>w.createElement("link",{key:S,...E})))}function Ey(...s){return i=>{s.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var tg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tg&&(window.__reactRouterVersion="7.6.3")}catch{}function ky({basename:s,children:i,window:r}){let c=w.useRef();c.current==null&&(c.current=dx({window:r,v5Compat:!0}));let d=c.current,[f,m]=w.useState({action:d.action,location:d.location}),p=w.useCallback(g=>{w.startTransition(()=>m(g))},[m]);return w.useLayoutEffect(()=>d.listen(p),[d,p]),w.createElement(ay,{basename:s,children:i,location:f.location,navigationType:f.action,navigator:d})}var ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ng=w.forwardRef(function({onClick:i,discover:r="render",prefetch:c="none",relative:d,reloadDocument:f,replace:m,state:p,target:g,to:h,preventScrollReset:y,viewTransition:j,...v},T){let{basename:S}=w.useContext(ea),E=typeof h=="string"&&ag.test(h),O,R=!1;if(typeof h=="string"&&E&&(O=h,tg))try{let I=new URL(window.location.href),ne=h.startsWith("//")?new URL(I.protocol+h):new URL(h),L=Aa(ne.pathname,S);ne.origin===I.origin&&L!=null?h=L+ne.search+ne.hash:R=!0}catch{Wt(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let A=Hx(h,{relative:d}),[$,F,B]=jy(c,v),oe=Ry(h,{replace:m,state:p,target:g,preventScrollReset:y,relative:d,viewTransition:j});function Q(I){i&&i(I),I.defaultPrevented||oe(I)}let H=w.createElement("a",{...v,...B,href:O||A,onClick:R||f?i:Q,ref:Ey(T,F),target:g,"data-discover":!E&&r==="render"?"true":void 0});return $&&!E?w.createElement(w.Fragment,null,H,w.createElement(Sy,{page:A})):H});ng.displayName="Link";var sg=w.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:c="",end:d=!1,style:f,to:m,viewTransition:p,children:g,...h},y){let j=Ll(m,{relative:h.relative}),v=sn(),T=w.useContext(pi),{navigator:S,basename:E}=w.useContext(ea),O=T!=null&&Uy(j)&&p===!0,R=S.encodeLocation?S.encodeLocation(j).pathname:j.pathname,A=v.pathname,$=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;r||(A=A.toLowerCase(),$=$?$.toLowerCase():null,R=R.toLowerCase()),$&&E&&($=Aa($,E)||$);const F=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let B=A===R||!d&&A.startsWith(R)&&A.charAt(F)==="/",oe=$!=null&&($===R||!d&&$.startsWith(R)&&$.charAt(R.length)==="/"),Q={isActive:B,isPending:oe,isTransitioning:O},H=B?i:void 0,I;typeof c=="function"?I=c(Q):I=[c,B?"active":null,oe?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let ne=typeof f=="function"?f(Q):f;return w.createElement(ng,{...h,"aria-current":H,className:I,ref:y,style:ne,to:m,viewTransition:p},typeof g=="function"?g(Q):g)});sg.displayName="NavLink";var Ty=w.forwardRef(({discover:s="render",fetcherKey:i,navigate:r,reloadDocument:c,replace:d,state:f,method:m=ci,action:p,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:j,...v},T)=>{let S=zy(),E=Dy(p,{relative:h}),O=m.toLowerCase()==="get"?"get":"post",R=typeof p=="string"&&ag.test(p),A=$=>{if(g&&g($),$.defaultPrevented)return;$.preventDefault();let F=$.nativeEvent.submitter,B=(F==null?void 0:F.getAttribute("formmethod"))||m;S(F||$.currentTarget,{fetcherKey:i,method:B,navigate:r,replace:d,state:f,relative:h,preventScrollReset:y,viewTransition:j})};return w.createElement("form",{ref:T,method:O,action:E,onSubmit:c?g:A,...v,"data-discover":!R&&s==="render"?"true":void 0})});Ty.displayName="Form";function Ay(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lg(s){let i=w.useContext(Cs);return Pe(i,Ay(s)),i}function Ry(s,{target:i,replace:r,state:c,preventScrollReset:d,relative:f,viewTransition:m}={}){let p=On(),g=sn(),h=Ll(s,{relative:f});return w.useCallback(y=>{if(oy(y,i)){y.preventDefault();let j=r!==void 0?r:Ml(g)===Ml(h);p(s,{replace:j,state:c,preventScrollReset:d,relative:f,viewTransition:m})}},[g,p,h,r,c,i,s,d,f,m])}var Oy=0,My=()=>`__${String(++Oy)}__`;function zy(){let{router:s}=lg("useSubmit"),{basename:i}=w.useContext(ea),r=Ix();return w.useCallback(async(c,d={})=>{let{action:f,method:m,encType:p,formData:g,body:h}=dy(c,i);if(d.navigate===!1){let y=d.fetcherKey||My();await s.fetch(y,r,d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,flushSync:d.flushSync})}else await s.navigate(d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,replace:d.replace,state:d.state,fromRouteId:r,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,i,r])}function Dy(s,{relative:i}={}){let{basename:r}=w.useContext(ea),c=w.useContext(Kt);Pe(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),f={...Ll(s||".",{relative:i})},m=sn();if(s==null){f.search=m.search;let p=new URLSearchParams(f.search),g=p.getAll("index");if(g.some(y=>y==="")){p.delete("index"),g.filter(j=>j).forEach(j=>p.append("index",j));let y=p.toString();f.search=y?`?${y}`:""}}return(!s||s===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:Ta([r,f.pathname])),Ml(f)}function Uy(s,i={}){let r=w.useContext(Ph);Pe(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=lg("useViewTransitionState"),d=Ll(s,{relative:i.relative});if(!r.isTransitioning)return!1;let f=Aa(r.currentLocation.pathname,c)||r.currentLocation.pathname,m=Aa(r.nextLocation.pathname,c)||r.nextLocation.pathname;return di(d.pathname,m)!=null||di(d.pathname,f)!=null}[...by];const Ly=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},iu=()=>{const i=Ly().basePath||"";return i&&!i.startsWith("/")?"/"+i:i},_y=()=>iu()+"/api",Ne=s=>{const i=_y(),r=s.startsWith("/")?s:"/"+s;return i+r},Hy=async()=>{try{const s=window.location.pathname,i=[s.replace(/\/[^/]*$/,"")+"/config","/config",...s.includes("/")?[s.split("/")[1]?`/${s.split("/")[1]}/config`:"/config"]:["/config"]];for(const r of i)try{const c=await fetch(r,{method:"GET",headers:{Accept:"application/json","Cache-Control":"no-cache"}});if(c.ok){const d=await c.json();if(d.success&&d.data)return d.data}}catch(c){console.debug(`Failed to load config from ${r}:`,c)}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"}}},ou="mcphub_token",ln=()=>localStorage.getItem(ou),rg=s=>{localStorage.setItem(ou,s)},Yc=()=>{localStorage.removeItem(ou)},By=async s=>{try{console.log(Ne("/auth/login"));const r=await(await fetch(Ne("/auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();return r.success&&r.token&&rg(r.token),r}catch(i){return console.error("Login error:",i),{success:!1,message:"An error occurred during login"}}},Vy=async s=>{try{const r=await(await fetch(Ne("/auth/register"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();return r.success&&r.token&&rg(r.token),r}catch(i){return console.error("Register error:",i),{success:!1,message:"An error occurred during registration"}}},qy=async()=>{const s=ln();if(!s)return{success:!1,message:"No authentication token"};try{return await(await fetch(Ne("/auth/user"),{method:"GET",headers:{"x-auth-token":s}})).json()}catch(i){return console.error("Get current user error:",i),{success:!1,message:"An error occurred while fetching user data"}}},Gy=async s=>{const i=ln();if(!i)return{success:!1,message:"No authentication token"};try{return await(await fetch(Ne("/auth/change-password"),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":i},body:JSON.stringify(s)})).json()}catch(r){return console.error("Change password error:",r),{success:!1,message:"An error occurred while changing password"}}},$y=()=>{Yc()},Ky=async()=>{var s;try{const i=iu(),r=await fetch(`${i}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});return r.ok?{skipAuth:((s=(await r.json()).data)==null?void 0:s.skipAuth)===!0}:{skipAuth:!1}}catch(i){return console.debug("Failed to get public config:",i),{skipAuth:!1}}},Yy=async()=>{try{return(await Ky()).skipAuth}catch(s){return console.debug("Failed to check skipAuth setting:",s),!1}},oa={isAuthenticated:!1,loading:!0,user:null,error:null},ig=w.createContext({auth:oa,login:async()=>!1,register:async()=>!1,logout:()=>{}}),Py=({children:s})=>{const[i,r]=w.useState(oa);w.useEffect(()=>{(async()=>{if(await Yy()){r({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0},error:null});return}if(!ln()){r({...oa,loading:!1});return}try{const h=await qy();h.success&&h.user?r({isAuthenticated:!0,loading:!1,user:h.user,error:null}):(Yc(),r({...oa,loading:!1}))}catch{Yc(),r({...oa,loading:!1})}})()},[]);const c=async(m,p)=>{try{const g=await By({username:m,password:p});return g.success&&g.token&&g.user?(r({isAuthenticated:!0,loading:!1,user:g.user,error:null}),!0):(r({...oa,loading:!1,error:g.message||"Authentication failed"}),!1)}catch{return r({...oa,loading:!1,error:"Authentication failed"}),!1}},d=async(m,p,g=!1)=>{try{const h=await Vy({username:m,password:p,isAdmin:g});return h.success&&h.token&&h.user?(r({isAuthenticated:!0,loading:!1,user:h.user,error:null}),!0):(r({...oa,loading:!1,error:h.message||"Registration failed"}),!1)}catch{return r({...oa,loading:!1,error:"Registration failed"}),!1}},f=()=>{$y(),r({...oa,loading:!1})};return l.jsx(ig.Provider,{value:{auth:i,login:c,register:d,logout:f},children:s})},_l=()=>w.useContext(ig);/**
|
|
52
|
+
* @license lucide-react v0.486.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const Xy=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qy=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,c)=>c?c.toUpperCase():r.toLowerCase()),hh=s=>{const i=Qy(s);return i.charAt(0).toUpperCase()+i.slice(1)},og=(...s)=>s.filter((i,r,c)=>!!i&&i.trim()!==""&&c.indexOf(i)===r).join(" ").trim();/**
|
|
57
|
+
* @license lucide-react v0.486.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/var Fy={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"};/**
|
|
62
|
+
* @license lucide-react v0.486.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Zy=w.forwardRef(({color:s="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:d="",children:f,iconNode:m,...p},g)=>w.createElement("svg",{ref:g,...Fy,width:i,height:i,stroke:s,strokeWidth:c?Number(r)*24/Number(i):r,className:og("lucide",d),...p},[...m.map(([h,y])=>w.createElement(h,y)),...Array.isArray(f)?f:[f]]));/**
|
|
67
|
+
* @license lucide-react v0.486.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const lt=(s,i)=>{const r=w.forwardRef(({className:c,...d},f)=>w.createElement(Zy,{ref:f,iconNode:i,className:og(`lucide-${Xy(hh(s))}`,`lucide-${s}`,c),...d}));return r.displayName=hh(s),r};/**
|
|
72
|
+
* @license lucide-react v0.486.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Jy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yi=lt("check",Jy);/**
|
|
77
|
+
* @license lucide-react v0.486.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const Iy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cg=lt("chevron-down",Iy);/**
|
|
82
|
+
* @license lucide-react v0.486.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const Wy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ug=lt("chevron-right",Wy);/**
|
|
87
|
+
* @license lucide-react v0.486.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const eb=[["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"}]],dg=lt("circle-alert",eb);/**
|
|
92
|
+
* @license lucide-react v0.486.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const tb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ab=lt("circle-check-big",tb);/**
|
|
97
|
+
* @license lucide-react v0.486.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const nb=[["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"}]],sb=lt("circle-x",nb);/**
|
|
102
|
+
* @license lucide-react v0.486.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const lb=[["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"}]],fg=lt("copy",lb);/**
|
|
107
|
+
* @license lucide-react v0.486.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const rb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ib=lt("info",rb);/**
|
|
112
|
+
* @license lucide-react v0.486.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const ob=[["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"}]],cb=lt("loader",ob);/**
|
|
117
|
+
* @license lucide-react v0.486.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const ub=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],db=lt("log-out",ub);/**
|
|
122
|
+
* @license lucide-react v0.486.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const fb=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],mb=lt("moon",fb);/**
|
|
127
|
+
* @license lucide-react v0.486.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const hb=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],gb=lt("play",hb);/**
|
|
132
|
+
* @license lucide-react v0.486.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const pb=[["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"}]],xb=lt("refresh-cw",pb);/**
|
|
137
|
+
* @license lucide-react v0.486.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const yb=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],bb=lt("settings",yb);/**
|
|
142
|
+
* @license lucide-react v0.486.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const vb=[["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"}]],mg=lt("square-pen",vb);/**
|
|
147
|
+
* @license lucide-react v0.486.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const wb=[["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"}]],jb=lt("sun",wb);/**
|
|
152
|
+
* @license lucide-react v0.486.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const Sb=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],Nb=lt("trash",Sb);/**
|
|
157
|
+
* @license lucide-react v0.486.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const Cb=[["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"}]],Eb=lt("user",Cb);/**
|
|
162
|
+
* @license lucide-react v0.486.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const kb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zl=lt("x",kb);function hg(s){var i,r,c="";if(typeof s=="string"||typeof s=="number")c+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(i=0;i<d;i++)s[i]&&(r=hg(s[i]))&&(c&&(c+=" "),c+=r)}else for(r in s)s[r]&&(c&&(c+=" "),c+=r);return c}function Tb(){for(var s,i,r=0,c="",d=arguments.length;r<d;r++)(s=arguments[r])&&(i=hg(s))&&(c&&(c+=" "),c+=i);return c}const cu="-",Ab=s=>{const i=Ob(s),{conflictingClassGroups:r,conflictingClassGroupModifiers:c}=s;return{getClassGroupId:m=>{const p=m.split(cu);return p[0]===""&&p.length!==1&&p.shift(),gg(p,i)||Rb(m)},getConflictingClassGroupIds:(m,p)=>{const g=r[m]||[];return p&&c[m]?[...g,...c[m]]:g}}},gg=(s,i)=>{var m;if(s.length===0)return i.classGroupId;const r=s[0],c=i.nextPart.get(r),d=c?gg(s.slice(1),c):void 0;if(d)return d;if(i.validators.length===0)return;const f=s.join(cu);return(m=i.validators.find(({validator:p})=>p(f)))==null?void 0:m.classGroupId},gh=/^\[(.+)\]$/,Rb=s=>{if(gh.test(s)){const i=gh.exec(s)[1],r=i==null?void 0:i.substring(0,i.indexOf(":"));if(r)return"arbitrary.."+r}},Ob=s=>{const{theme:i,classGroups:r}=s,c={nextPart:new Map,validators:[]};for(const d in r)Pc(r[d],c,d,i);return c},Pc=(s,i,r,c)=>{s.forEach(d=>{if(typeof d=="string"){const f=d===""?i:ph(i,d);f.classGroupId=r;return}if(typeof d=="function"){if(Mb(d)){Pc(d(c),i,r,c);return}i.validators.push({validator:d,classGroupId:r});return}Object.entries(d).forEach(([f,m])=>{Pc(m,ph(i,f),r,c)})})},ph=(s,i)=>{let r=s;return i.split(cu).forEach(c=>{r.nextPart.has(c)||r.nextPart.set(c,{nextPart:new Map,validators:[]}),r=r.nextPart.get(c)}),r},Mb=s=>s.isThemeGetter,zb=s=>{if(s<1)return{get:()=>{},set:()=>{}};let i=0,r=new Map,c=new Map;const d=(f,m)=>{r.set(f,m),i++,i>s&&(i=0,c=r,r=new Map)};return{get(f){let m=r.get(f);if(m!==void 0)return m;if((m=c.get(f))!==void 0)return d(f,m),m},set(f,m){r.has(f)?r.set(f,m):d(f,m)}}},Xc="!",Qc=":",Db=Qc.length,Ub=s=>{const{prefix:i,experimentalParseClassName:r}=s;let c=d=>{const f=[];let m=0,p=0,g=0,h;for(let S=0;S<d.length;S++){let E=d[S];if(m===0&&p===0){if(E===Qc){f.push(d.slice(g,S)),g=S+Db;continue}if(E==="/"){h=S;continue}}E==="["?m++:E==="]"?m--:E==="("?p++:E===")"&&p--}const y=f.length===0?d:d.substring(g),j=Lb(y),v=j!==y,T=h&&h>g?h-g:void 0;return{modifiers:f,hasImportantModifier:v,baseClassName:j,maybePostfixModifierPosition:T}};if(i){const d=i+Qc,f=c;c=m=>m.startsWith(d)?f(m.substring(d.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(r){const d=c;c=f=>r({className:f,parseClassName:d})}return c},Lb=s=>s.endsWith(Xc)?s.substring(0,s.length-1):s.startsWith(Xc)?s.substring(1):s,_b=s=>{const i=Object.fromEntries(s.orderSensitiveModifiers.map(c=>[c,!0]));return c=>{if(c.length<=1)return c;const d=[];let f=[];return c.forEach(m=>{m[0]==="["||i[m]?(d.push(...f.sort(),m),f=[]):f.push(m)}),d.push(...f.sort()),d}},Hb=s=>({cache:zb(s.cacheSize),parseClassName:Ub(s),sortModifiers:_b(s),...Ab(s)}),Bb=/\s+/,Vb=(s,i)=>{const{parseClassName:r,getClassGroupId:c,getConflictingClassGroupIds:d,sortModifiers:f}=i,m=[],p=s.trim().split(Bb);let g="";for(let h=p.length-1;h>=0;h-=1){const y=p[h],{isExternal:j,modifiers:v,hasImportantModifier:T,baseClassName:S,maybePostfixModifierPosition:E}=r(y);if(j){g=y+(g.length>0?" "+g:g);continue}let O=!!E,R=c(O?S.substring(0,E):S);if(!R){if(!O){g=y+(g.length>0?" "+g:g);continue}if(R=c(S),!R){g=y+(g.length>0?" "+g:g);continue}O=!1}const A=f(v).join(":"),$=T?A+Xc:A,F=$+R;if(m.includes(F))continue;m.push(F);const B=d(R,O);for(let oe=0;oe<B.length;++oe){const Q=B[oe];m.push($+Q)}g=y+(g.length>0?" "+g:g)}return g};function qb(){let s=0,i,r,c="";for(;s<arguments.length;)(i=arguments[s++])&&(r=pg(i))&&(c&&(c+=" "),c+=r);return c}const pg=s=>{if(typeof s=="string")return s;let i,r="";for(let c=0;c<s.length;c++)s[c]&&(i=pg(s[c]))&&(r&&(r+=" "),r+=i);return r};function Gb(s,...i){let r,c,d,f=m;function m(g){const h=i.reduce((y,j)=>j(y),s());return r=Hb(h),c=r.cache.get,d=r.cache.set,f=p,p(g)}function p(g){const h=c(g);if(h)return h;const y=Vb(g,r);return d(g,y),y}return function(){return f(qb.apply(null,arguments))}}const st=s=>{const i=r=>r[s]||[];return i.isThemeGetter=!0,i},xg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$b=/^\d+\/\d+$/,Kb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yb=/\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$/,Pb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ys=s=>$b.test(s),ke=s=>!!s&&!Number.isNaN(Number(s)),an=s=>!!s&&Number.isInteger(Number(s)),_c=s=>s.endsWith("%")&&ke(s.slice(0,-1)),ka=s=>Kb.test(s),Fb=()=>!0,Zb=s=>Yb.test(s)&&!Pb.test(s),bg=()=>!1,Jb=s=>Xb.test(s),Ib=s=>Qb.test(s),Wb=s=>!me(s)&&!he(s),ev=s=>ks(s,jg,bg),me=s=>xg.test(s),An=s=>ks(s,Sg,Zb),Hc=s=>ks(s,lv,ke),xh=s=>ks(s,vg,bg),tv=s=>ks(s,wg,Ib),si=s=>ks(s,Ng,Jb),he=s=>yg.test(s),Al=s=>Ts(s,Sg),av=s=>Ts(s,rv),yh=s=>Ts(s,vg),nv=s=>Ts(s,jg),sv=s=>Ts(s,wg),li=s=>Ts(s,Ng,!0),ks=(s,i,r)=>{const c=xg.exec(s);return c?c[1]?i(c[1]):r(c[2]):!1},Ts=(s,i,r=!1)=>{const c=yg.exec(s);return c?c[1]?i(c[1]):r:!1},vg=s=>s==="position"||s==="percentage",wg=s=>s==="image"||s==="url",jg=s=>s==="length"||s==="size"||s==="bg-size",Sg=s=>s==="length",lv=s=>s==="number",rv=s=>s==="family-name",Ng=s=>s==="shadow",iv=()=>{const s=st("color"),i=st("font"),r=st("text"),c=st("font-weight"),d=st("tracking"),f=st("leading"),m=st("breakpoint"),p=st("container"),g=st("spacing"),h=st("radius"),y=st("shadow"),j=st("inset-shadow"),v=st("text-shadow"),T=st("drop-shadow"),S=st("blur"),E=st("perspective"),O=st("aspect"),R=st("ease"),A=st("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...F(),he,me],oe=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],H=()=>[he,me,g],I=()=>[ys,"full","auto",...H()],ne=()=>[an,"none","subgrid",he,me],L=()=>["auto",{span:["full",an,he,me]},an,he,me],V=()=>[an,"auto",he,me],se=()=>["auto","min","max","fr",he,me],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...H()],q=()=>[ys,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],z=()=>[s,he,me],re=()=>[...F(),yh,xh,{position:[he,me]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",nv,ev,{size:[he,me]}],te=()=>[_c,Al,An],ae=()=>["","none","full",h,he,me],de=()=>["",ke,Al,An],we=()=>["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"],le=()=>[ke,_c,yh,xh],ce=()=>["","none",S,he,me],xe=()=>["none",ke,he,me],Be=()=>["none",ke,he,me],je=()=>[ke,he,me],De=()=>[ys,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ka],breakpoint:[ka],color:[Fb],container:[ka],"drop-shadow":[ka],ease:["in","out","in-out"],font:[Wb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ka],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ka],shadow:[ka],spacing:["px",ke],text:[ka],"text-shadow":[ka],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ys,me,he,O]}],container:["container"],columns:[{columns:[ke,me,he,p]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:B()}],overflow:[{overflow:oe()}],"overflow-x":[{"overflow-x":oe()}],"overflow-y":[{"overflow-y":oe()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[an,"auto",he,me]}],basis:[{basis:[ys,"full","auto",p,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,ys,"auto","initial","none",me]}],grow:[{grow:["",ke,he,me]}],shrink:[{shrink:["",ke,he,me]}],order:[{order:[an,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[p,"screen",...q()]}],"min-w":[{"min-w":[p,"screen","none",...q()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",r,Al,An]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,he,Hc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_c,me]}],"font-family":[{font:[av,me,i]}],"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:[d,he,me]}],"line-clamp":[{"line-clamp":[ke,"none",he,Hc]}],leading:[{leading:[f,...H()]}],"list-image":[{"list-image":["none",he,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",he,An]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[ke,"auto",he,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,me]}],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",he,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},an,he,me],radial:["",he,me],conic:[an,he,me]},sv,tv]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,he,me]}],"outline-w":[{outline:["",ke,Al,An]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",y,li,si]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",j,li,si]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[ke,An]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",v,li,si]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[ke,he,me]}],"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":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[he,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":F()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,me]}],filter:[{filter:["","none",he,me]}],blur:[{blur:ce()}],brightness:[{brightness:[ke,he,me]}],contrast:[{contrast:[ke,he,me]}],"drop-shadow":[{"drop-shadow":["","none",T,li,si]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",ke,he,me]}],"hue-rotate":[{"hue-rotate":[ke,he,me]}],invert:[{invert:["",ke,he,me]}],saturate:[{saturate:[ke,he,me]}],sepia:[{sepia:["",ke,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[ke,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[ke,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,he,me]}],"backdrop-invert":[{"backdrop-invert":["",ke,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[ke,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[ke,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",he,me]}],ease:[{ease:["linear","initial",R,he,me]}],delay:[{delay:[ke,he,me]}],animate:[{animate:["none",A,he,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,he,me]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:Be()}],"scale-x":[{"scale-x":Be()}],"scale-y":[{"scale-y":Be()}],"scale-z":[{"scale-z":Be()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[he,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",he,me]}],"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":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",he,me]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[ke,Al,An,Hc]}],stroke:[{stroke:["none",...z()]}],"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"]}},ov=Gb(iv);function nn(...s){return ov(Tb(s))}const cv=({message:s,type:i="info",duration:r=3e3,onClose:c,visible:d})=>{w.useEffect(()=>{if(d){const g=setTimeout(()=>{c()},r);return()=>clearTimeout(g)}},[d,r,c]);const f={success:l.jsx(yi,{className:"w-5 h-5 text-green-500"}),error:l.jsx(zl,{className:"w-5 h-5 text-red-500"}),info:l.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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:l.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})},m={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"},p={success:"text-green-800",error:"text-red-800",info:"text-blue-800",warning:"text-yellow-800"};return l.jsx("div",{className:nn("fixed top-4 right-4 z-50 max-w-sm p-4 rounded-md shadow-lg border",m[i],"transform transition-all duration-300 ease-in-out",d?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"flex-shrink-0",children:f[i]}),l.jsx("div",{className:"ml-3",children:l.jsx("p",{className:nn("text-sm font-medium",p[i]),children:s})}),l.jsx("div",{className:"ml-auto pl-3",children:l.jsx("div",{className:"-mx-1.5 -my-1.5",children:l.jsxs("button",{onClick:c,className:nn("inline-flex rounded-md p-1.5",`hover:bg-${i}-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${i}-500`),children:[l.jsx("span",{className:"sr-only",children:"Dismiss"}),l.jsx(zl,{className:"h-5 w-5"})]})})})]})})},Cg=w.createContext(void 0),Hl=()=>{const s=w.useContext(Cg);if(!s)throw new Error("useToast must be used within a ToastProvider");return s},uv=({children:s})=>{const[i,r]=w.useState({message:"",type:"info",visible:!1,duration:3e3}),c=w.useCallback((f,m="info",p=3e3)=>{r({message:f,type:m,visible:!0,duration:p})},[]),d=w.useCallback(()=>{r(f=>({...f,visible:!1}))},[]);return l.jsxs(Cg.Provider,{value:{showToast:c},children:[s,l.jsx(cv,{message:i.message,type:i.type,duration:i.duration,onClose:d,visible:i.visible})]})},Eg=w.createContext(void 0),dv=()=>{const s=w.useContext(Eg);if(!s)throw new Error("useTheme must be used within a ThemeProvider");return s},fv=({children:s})=>{const[i,r]=w.useState(()=>localStorage.getItem("theme")||"system"),[c,d]=w.useState("light"),f=m=>{r(m),localStorage.setItem("theme",m)};return w.useEffect(()=>{const m=()=>{const g=window.document.documentElement,h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",y=i==="system"?h:i;d(y),y==="dark"?(console.log("Applying dark mode to HTML root element"),g.classList.add("dark"),document.body.style.backgroundColor="#111827"):(console.log("Removing dark mode from HTML root element"),g.classList.remove("dark"),document.body.style.backgroundColor="")},p=window.matchMedia("(prefers-color-scheme: dark)");return p.addEventListener("change",m),m(),()=>{p.removeEventListener("change",m)}},[i]),l.jsx(Eg.Provider,{value:{theme:i,setTheme:f,resolvedTheme:c},children:s})},mv=(s,i,r,c)=>{var f,m,p,g;const d=[r,{code:i,...c||{}}];if((m=(f=s==null?void 0:s.services)==null?void 0:f.logger)!=null&&m.forward)return s.services.logger.forward(d,"warn","react-i18next::",!0);Rn(d[0])&&(d[0]=`react-i18next:: ${d[0]}`),(g=(p=s==null?void 0:s.services)==null?void 0:p.logger)!=null&&g.warn?s.services.logger.warn(...d):console!=null&&console.warn&&console.warn(...d)},bh={},Fc=(s,i,r,c)=>{Rn(r)&&bh[r]||(Rn(r)&&(bh[r]=new Date),mv(s,i,r,c))},kg=(s,i)=>()=>{if(s.isInitialized)i();else{const r=()=>{setTimeout(()=>{s.off("initialized",r)},0),i()};s.on("initialized",r)}},Zc=(s,i,r)=>{s.loadNamespaces(i,kg(s,r))},vh=(s,i,r,c)=>{if(Rn(r)&&(r=[r]),s.options.preload&&s.options.preload.indexOf(i)>-1)return Zc(s,r,c);r.forEach(d=>{s.options.ns.indexOf(d)<0&&s.options.ns.push(d)}),s.loadLanguages(i,kg(s,c))},hv=(s,i,r={})=>!i.languages||!i.languages.length?(Fc(i,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:i.languages}),!0):i.hasLoadedNamespace(s,{lng:r.lng,precheck:(c,d)=>{var f;if(((f=r.bindI18n)==null?void 0:f.indexOf("languageChanging"))>-1&&c.services.backendConnector.backend&&c.isLanguageChangingTo&&!d(c.isLanguageChangingTo,s))return!1}}),Rn=s=>typeof s=="string",gv=s=>typeof s=="object"&&s!==null,pv=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,xv={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},yv=s=>xv[s],bv=s=>s.replace(pv,yv);let Jc={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:bv};const vv=(s={})=>{Jc={...Jc,...s}},wv=()=>Jc;let Tg;const jv=s=>{Tg=s},Sv=()=>Tg,Nv={type:"3rdParty",init(s){vv(s.options.react),jv(s)}},Cv=w.createContext();class Ev{constructor(){this.usedNamespaces={}}addUsedNamespaces(i){i.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const kv=(s,i)=>{const r=w.useRef();return w.useEffect(()=>{r.current=s},[s,i]),r.current},Ag=(s,i,r,c)=>s.getFixedT(i,r,c),Tv=(s,i,r,c)=>w.useCallback(Ag(s,i,r,c),[s,i,r,c]),Oe=(s,i={})=>{var F,B,oe,Q;const{i18n:r}=i,{i18n:c,defaultNS:d}=w.useContext(Cv)||{},f=r||c||Sv();if(f&&!f.reportNamespaces&&(f.reportNamespaces=new Ev),!f){Fc(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const H=(ne,L)=>Rn(L)?L:gv(L)&&Rn(L.defaultValue)?L.defaultValue:Array.isArray(ne)?ne[ne.length-1]:ne,I=[H,{},!1];return I.t=H,I.i18n={},I.ready=!1,I}(F=f.options.react)!=null&&F.wait&&Fc(f,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...wv(),...f.options.react,...i},{useSuspense:p,keyPrefix:g}=m;let h=d||((B=f.options)==null?void 0:B.defaultNS);h=Rn(h)?[h]:h||["translation"],(Q=(oe=f.reportNamespaces).addUsedNamespaces)==null||Q.call(oe,h);const y=(f.isInitialized||f.initializedStoreOnce)&&h.every(H=>hv(H,f,m)),j=Tv(f,i.lng||null,m.nsMode==="fallback"?h:h[0],g),v=()=>j,T=()=>Ag(f,i.lng||null,m.nsMode==="fallback"?h:h[0],g),[S,E]=w.useState(v);let O=h.join();i.lng&&(O=`${i.lng}${O}`);const R=kv(O),A=w.useRef(!0);w.useEffect(()=>{const{bindI18n:H,bindI18nStore:I}=m;A.current=!0,!y&&!p&&(i.lng?vh(f,i.lng,h,()=>{A.current&&E(T)}):Zc(f,h,()=>{A.current&&E(T)})),y&&R&&R!==O&&A.current&&E(T);const ne=()=>{A.current&&E(T)};return H&&(f==null||f.on(H,ne)),I&&(f==null||f.store.on(I,ne)),()=>{A.current=!1,f&&(H==null||H.split(" ").forEach(L=>f.off(L,ne))),I&&f&&I.split(" ").forEach(L=>f.store.off(L,ne))}},[f,O]),w.useEffect(()=>{A.current&&y&&E(v)},[f,g,y]);const $=[S,f,y];if($.t=S,$.i18n=f,$.ready=y,y||!y&&!p)return $;throw new Promise(H=>{i.lng?vh(f,i.lng,h,()=>H()):Zc(f,h,()=>H())})},Rg=()=>{const{t:s}=Oe(),{theme:i,setTheme:r}=dv();return l.jsx("div",{className:"flex items-center space-x-2",children:l.jsxs("div",{className:"flex bg-gray-100 dark:bg-gray-700 rounded-lg p-1",children:[l.jsx("button",{onClick:()=>r("light"),className:`flex items-center justify-center rounded-md p-1.5 ${i==="light"?"bg-white text-yellow-600 shadow":"text-black dark:text-gray-300 hover:text-yellow-600 dark:hover:text-yellow-500"}`,title:s("theme.light"),"aria-label":s("theme.light"),children:l.jsx(jb,{size:18})}),l.jsx("button",{onClick:()=>r("dark"),className:`flex items-center justify-center rounded-md p-1.5 ${i==="dark"?"bg-gray-800 text-blue-400 shadow":"text-gray-600 dark:text-gray-300 hover:text-blue-500 dark:hover:text-blue-400"}`,title:s("theme.dark"),"aria-label":s("theme.dark"),children:l.jsx(mb,{size:18})})]})})},Av=s=>l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[l.jsx("title",{children:"GitHub"}),l.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"})]}),Rv=s=>l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[l.jsx("title",{children:"Sponsor"}),l.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"})]}),Ov=s=>l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[l.jsx("title",{children:"WeChat"}),l.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"})]}),Mv=s=>l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[l.jsx("title",{children:"Discord"}),l.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"})]}),zv=({open:s,onOpenChange:i})=>{const{i18n:r,t:c}=Oe();return s?l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6 relative",children:[l.jsx("button",{onClick:()=>i(!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":c("common.close"),children:l.jsx(zl,{className:"h-5 w-5"})}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("sponsor.title")}),l.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:r.language==="zh"?l.jsx("img",{src:"./assets/reward.png",alt:c("sponsor.rewardAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}):l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:c("sponsor.supportMessage")}),l.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:c("sponsor.supportButton")})]})})]})})}):null},Dv=({open:s,onOpenChange:i})=>{const{t:r}=Oe();return s?l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6 relative",children:[l.jsx("button",{onClick:()=>i(!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":r("common.close"),children:l.jsx(zl,{className:"h-5 w-5"})}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:r("wechat.title")}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[l.jsx("img",{src:"./assets/wexin.png",alt:r("wechat.qrCodeAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}),l.jsx("p",{className:"mt-4 text-center text-gray-700 dark:text-gray-300",children:r("wechat.scanMessage")})]})]})})}):null},Uv=({onToggleSidebar:s})=>{const{t:i,i18n:r}=Oe(),[c,d]=w.useState(!1),[f,m]=w.useState(!1);return l.jsxs("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-10",children:[l.jsxs("div",{className:"flex justify-between items-center px-3 py-3",children:[l.jsxs("div",{className:"flex items-center",children:[l.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":i("app.toggleSidebar"),children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),l.jsx("h1",{className:"ml-4 text-xl font-bold text-gray-900 dark:text-white",children:i("app.title")})]}),l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"v0.8.4"}),l.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200","aria-label":"GitHub Repository",children:l.jsx(Av,{className:"h-5 w-5"})}),r.language==="zh"?l.jsx("button",{onClick:()=>m(!0),className:"text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 focus:outline-none","aria-label":i("wechat.label"),children:l.jsx(Ov,{className:"h-5 w-5"})}):l.jsx("a",{href:"https://discord.gg/qMKNsn5Q",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200","aria-label":i("discord.label"),children:l.jsx(Mv,{className:"h-5 w-5"})}),l.jsx("button",{onClick:()=>d(!0),className:"text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 focus:outline-none","aria-label":i("sponsor.label"),children:l.jsx(Rv,{className:"h-5 w-5"})}),l.jsx(Rg,{})]})]}),l.jsx(zv,{open:c,onOpenChange:d}),l.jsx(Dv,{open:f,onOpenChange:m})]})},Bc=({permissions:s,fallback:i=null,children:r})=>Og(s)?l.jsx(l.Fragment,{children:r}):l.jsx(l.Fragment,{children:i}),Og=s=>{const{auth:i}=_l();if(!i.isAuthenticated||!i.user)return!1;const r=i.user.permissions||[];return s==="x"&&!r.includes("x")?!1:r.includes("*")||i.user.isAdmin?!0:(Array.isArray(s)?s:[s]).some(d=>r.includes(d))},Lv="https://registry.npmjs.org",_v="@samanhappy/mcphub",Mg=async()=>{try{const s=await fetch(`${Lv}/${_v}/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}},zg=(s,i)=>{if(s==="dev")return-1;const r=s.split(".").map(Number),c=i.split(".").map(Number);for(let d=0;d<3;d++){const f=r[d]||0,m=c[d]||0;if(f>m)return-1;if(f<m)return 1}return 0},Hv=({isOpen:s,onClose:i,version:r})=>{const{t:c}=Oe(),[d,f]=w.useState(!1),[m,p]=w.useState(""),[g,h]=w.useState(!1),y=async()=>{h(!0);try{const j=await Mg();j&&(p(j),f(zg(r,j)>0))}catch(j){console.error("Failed to check for updates:",j)}finally{h(!1)}};return w.useEffect(()=>{s&&y()},[s,r]),s?l.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6 relative",children:[l.jsx("button",{onClick:i,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":c("common.close"),children:l.jsx(zl,{className:"h-5 w-5"})}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("about.title")}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[c("about.currentVersion"),":"]}),l.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:r})]}),d&&m&&l.jsx("div",{className:"bg-blue-50 dark:bg-blue-900 p-3 rounded",children:l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-3 flex-1 text-sm text-blue-700 dark:text-blue-300",children:[l.jsx("p",{children:c("about.newVersionAvailable",{version:m})}),l.jsx("p",{className:"mt-1",children:l.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:underline",children:c("about.viewOnGitHub")})})]})]})}),l.jsxs("button",{onClick:y,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
|
|
167
|
+
${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:[l.jsx(xb,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),c(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},Bv=({collapsed:s,version:i})=>{var O;const{t:r}=Oe(),c=On(),{auth:d,logout:f}=_l(),[m,p]=w.useState(!1),[g,h]=w.useState(!1),[y,j]=w.useState(!1),v=w.useRef(null);w.useEffect(()=>{(async()=>{try{const A=await Mg();A&&h(zg(i,A)>0)}catch(A){console.error("Error checking for new version:",A)}})()},[i]),w.useEffect(()=>{const R=A=>{v.current&&!v.current.contains(A.target)&&p(!1)};return document.addEventListener("mousedown",R),()=>{document.removeEventListener("mousedown",R)}},[]);const T=()=>{c("/settings"),p(!1)},S=()=>{f(),c("/login")},E=()=>{j(!0),p(!1)};return l.jsxs("div",{ref:v,className:"relative",children:[l.jsxs("button",{onClick:()=>p(!m),className:`flex ${s?"justify-center":"items-center"} w-full p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors rounded-md ${m?"bg-gray-100 dark:bg-gray-700":""}`,children:[l.jsxs("div",{className:"flex-shrink-0 relative",children:[l.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:l.jsx(Eb,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),g&&l.jsx("span",{className:"absolute -top-1 -right-1 block w-2 h-2 bg-red-500 rounded-full"})]}),!s&&l.jsx("div",{className:"ml-3 flex flex-col items-start",children:l.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:((O=d.user)==null?void 0:O.username)||r("auth.user")})})]}),m&&l.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 py-1 z-50",children:[l.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:[l.jsx(bb,{className:"h-4 w-4 mr-2"}),r("nav.settings")]}),l.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 relative",children:[l.jsx(ib,{className:"h-4 w-4 mr-2"}),r("about.title"),g&&l.jsx("span",{className:"absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"})]}),l.jsxs("button",{onClick:S,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[l.jsx(db,{className:"h-4 w-4 mr-2"}),r("app.logout")]})]}),l.jsx(Hv,{isOpen:y,onClose:()=>j(!1),version:i})]})},Vv=({collapsed:s})=>{var f;const{t:i}=Oe(),{auth:r}=_l(),c="0.8.4",d=[{path:"/",label:i("nav.dashboard"),icon:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[l.jsx("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),l.jsx("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})]})},{path:"/servers",label:i("nav.servers"),icon:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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:i("nav.groups"),icon:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})},...(f=r.user)!=null&&f.isAdmin&&Og("x")?[{path:"/users",label:i("nav.users"),icon:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})}]:[],{path:"/market",label:i("nav.market"),icon:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})},{path:"/logs",label:i("nav.logs"),icon:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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 l.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:[l.jsx("div",{className:"overflow-y-auto flex-grow",children:l.jsx("nav",{className:"p-3 space-y-1",children:d.map(m=>l.jsxs(sg,{to:m.path,className:({isActive:p})=>`flex items-center px-2.5 py-2 rounded-lg transition-colors duration-200
|
|
168
|
+
${p?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,end:m.path==="/",children:[l.jsx("span",{className:"flex-shrink-0",children:m.icon}),!s&&l.jsx("span",{className:"ml-3",children:m.label})]},m.path))})}),l.jsx("div",{className:"p-3 bg-white dark:bg-gray-800",children:l.jsx(Bv,{collapsed:s,version:c})})]})},qv=({children:s})=>l.jsx("main",{className:"flex-1 overflow-auto p-6 bg-gray-100 dark:bg-gray-900",children:l.jsx("div",{className:"container mx-auto",children:s})}),Gv=()=>{const[s,i]=Gc.useState(!1),r=()=>{i(!s)};return l.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[l.jsx(Uv,{onToggleSidebar:r}),l.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[l.jsx(Vv,{collapsed:s}),l.jsx(qv,{children:l.jsx(Ih,{})})]})]})},$v=({redirectPath:s="/login"})=>{const{t:i}=Oe(),{auth:r}=_l();return r.loading?l.jsx("div",{className:"flex items-center justify-center h-screen",children:i("app.loading")}):r.isAuthenticated?l.jsx(Ih,{}):l.jsx(Jh,{to:s,replace:!0})},Kv=()=>{const{t:s}=Oe(),[i,r]=w.useState(""),[c,d]=w.useState(""),[f,m]=w.useState(null),[p,g]=w.useState(!1),{login:h}=_l(),y=On(),j=async v=>{v.preventDefault(),m(null),g(!0);try{if(!i||!c){m(s("auth.emptyFields")),g(!1);return}await h(i,c)?y("/"):m(s("auth.loginFailed"))}catch{m(s("auth.loginError"))}finally{g(!1)}};return l.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8 login-container",children:[l.jsx("div",{className:"absolute top-4 right-4",children:l.jsx(Rg,{})}),l.jsxs("div",{className:"max-w-md w-full space-y-8 login-card p-8",children:[l.jsx("div",{children:l.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white",children:s("auth.loginTitle")})}),l.jsxs("form",{className:"mt-8 space-y-6",onSubmit:j,children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"username",className:"sr-only",children:s("auth.username")}),l.jsx("input",{id:"username",name:"username",type:"text",autoComplete:"username",required:!0,className:"appearance-none relative block w-full px-3 py-3 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white dark:bg-gray-800 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm transition-all duration-200 form-input shadow-sm",placeholder:s("auth.username"),value:i,onChange:v=>r(v.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"sr-only",children:s("auth.password")}),l.jsx("input",{id:"password",name:"password",type:"password",autoComplete:"current-password",required:!0,className:"appearance-none relative block w-full px-3 py-3 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white dark:bg-gray-800 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm login-input transition-all duration-200 form-input shadow-sm",placeholder:s("auth.password"),value:c,onChange:v=>d(v.target.value)})]})]}),f&&l.jsx("div",{className:"text-red-500 dark:text-red-400 text-sm text-center error-box p-2 rounded",children:f}),l.jsx("div",{children:l.jsx("button",{type:"submit",disabled:p,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 login-button transition-all duration-200 btn-primary",children:s(p?"auth.loggingIn":"auth.login")})})]})]})]})},ri={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},Bl=()=>{const{t:s}=Oe(),[i,r]=w.useState([]),[c,d]=w.useState(null),[f,m]=w.useState(0),[p,g]=w.useState(!0),[h,y]=w.useState(0),j=w.useRef(null),v=w.useRef(0),T=()=>{j.current&&(clearInterval(j.current),j.current=null)},S=w.useCallback(()=>{T();const F=async()=>{try{const B=localStorage.getItem("mcphub_token"),Q=await(await fetch(Ne("/servers"),{headers:{"x-auth-token":B||""}})).json();Q&&Q.success&&Array.isArray(Q.data)?r(Q.data):Q&&Array.isArray(Q)?r(Q):(console.error("Invalid server data format:",Q),r([])),d(null)}catch(B){console.error("Error fetching servers during normal polling:",B),navigator.onLine?B instanceof TypeError&&(B.message.includes("NetworkError")||B.message.includes("Failed to fetch"))?d(s("errors.serverConnection")):d(s("errors.serverFetch")):d(s("errors.network"))}};F(),j.current=setInterval(F,ri.normal.pollingInterval)},[s]);return w.useEffect(()=>{f>0&&(v.current=0,y(0));const F=async()=>{try{const B=localStorage.getItem("mcphub_token"),Q=await(await fetch(Ne("/servers"),{headers:{"x-auth-token":B||""}})).json();return Q&&Q.success&&Array.isArray(Q.data)?(r(Q.data),g(!1),S(),!0):Q&&Array.isArray(Q)?(r(Q),g(!1),S(),!0):(console.error("Invalid server data format:",Q),r([]),g(!1),S(),!0)}catch(B){return v.current+=1,console.error(`Initial loading attempt ${v.current} failed:`,B),y(v.current),navigator.onLine?d(s("errors.initialStartup")):d(s("errors.network")),v.current>=ri.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),g(!1),T(),S()),!1}};return p?(T(),F(),j.current=setInterval(F,ri.startup.pollingInterval),console.log(`Started initial polling with interval: ${ri.startup.pollingInterval}ms`)):S(),()=>{T()}},[f,s,p,S]),{servers:i,error:c,setError:d,isLoading:p,fetchAttempts:h,triggerRefresh:()=>{T(),p&&(g(!0),v.current=0,y(0)),m(F=>F+1)},handleServerAdd:()=>{m(F=>F+1)},handleServerEdit:async F=>{try{const B=localStorage.getItem("mcphub_token"),Q=await(await fetch(Ne("/settings"),{headers:{"x-auth-token":B||""}})).json();if(Q&&Q.success&&Q.data&&Q.data.mcpServers&&Q.data.mcpServers[F.name]){const H=Q.data.mcpServers[F.name];return{name:F.name,status:F.status,tools:F.tools||[],config:H}}else return console.error("Failed to get server config from settings:",Q),d(s("server.invalidConfig",{serverName:F.name})),null}catch(B){return console.error("Error fetching server settings:",B),d(B instanceof Error?B.message:String(B)),null}},handleServerRemove:async F=>{try{const B=localStorage.getItem("mcphub_token"),oe=await fetch(Ne(`/servers/${F}`),{method:"DELETE",headers:{"x-auth-token":B||""}}),Q=await oe.json();return oe.ok?(m(H=>H+1),!0):(d(Q.message||s("server.deleteError",{serverName:F})),!1)}catch(B){return d(s("errors.general")+": "+(B instanceof Error?B.message:String(B))),!1}},handleServerToggle:async(F,B)=>{try{const oe=localStorage.getItem("mcphub_token"),Q=await fetch(Ne(`/servers/${F.name}/toggle`),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":oe||""},body:JSON.stringify({enabled:B})}),H=await Q.json();return Q.ok?(m(I=>I+1),!0):(console.error("Failed to toggle server:",H),d(s("server.toggleError",{serverName:F.name})),!1)}catch(oe){return console.error("Error toggling server:",oe),d(oe instanceof Error?oe.message:String(oe)),!1}}}},Yv=()=>{const{t:s}=Oe(),{servers:i,error:r,setError:c,isLoading:d}=Bl(),f={total:i.length,online:i.filter(p=>p.status==="connected").length,offline:i.filter(p=>p.status==="disconnected").length,connecting:i.filter(p=>p.status==="connecting").length},m={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.dashboard.title")}),r&&l.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-status-red text-lg font-medium",children:s("app.error")}),l.jsx("p",{className:"text-gray-600 mt-1",children:r})]}),l.jsx("button",{onClick:()=>c(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":s("app.closeButton"),children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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&&l.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:l.jsxs("div",{className:"flex flex-col items-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}),!d&&l.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4",children:[l.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.totalServers")}),l.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.total})]})]})}),l.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.onlineServers")}),l.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.online})]})]})}),l.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.offlineServers")}),l.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.offline})]})]})}),l.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsxs("div",{className:"ml-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.connectingServers")}),l.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.connecting})]})]})})]}),i.length>0&&!d&&l.jsxs("div",{className:"mt-8",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:s("pages.dashboard.recentServers")}),l.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:l.jsxs("table",{className:"min-w-full",children:[l.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:l.jsxs("tr",{children:[l.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")}),l.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")}),l.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")}),l.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")})]})}),l.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:i.slice(0,5).map((p,g)=>{var h;return l.jsxs("tr",{children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:p.name}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:l.jsx("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${p.status==="connected"?"status-badge-online":p.status==="disconnected"?"status-badge-offline":"status-badge-connecting"}`,children:s(m[p.status]||p.status)})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((h=p.tools)==null?void 0:h.length)||0}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:p.enabled!==!1?l.jsx("span",{className:"text-green-600",children:"✓"}):l.jsx("span",{className:"text-status-red",children:"✗"})})]},g)})})]})})]})]})},Pv="modulepreload",Xv=function(s,i){return new URL(s,i).href},wh={},Qv=function(i,r,c){let d=Promise.resolve();if(r&&r.length>0){let m=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),h=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));d=m(r.map(y=>{if(y=Xv(y,c),y in wh)return;wh[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let E=p.length-1;E>=0;E--){const O=p[E];if(O.href===y&&(!j||O.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const S=document.createElement("link");if(S.rel=j?"stylesheet":Pv,j||(S.as="script"),S.crossOrigin="",S.href=y,h&&S.setAttribute("nonce",h),document.head.appendChild(S),j)return new Promise((E,O)=>{S.addEventListener("load",E),S.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return d.then(m=>{for(const p of m||[])p.status==="rejected"&&f(p.reason);return i().catch(f)})},Fv={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 ii({children:s,variant:i="default",className:r,onClick:c}){return l.jsx("span",{className:nn("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",Fv[i],c?"cursor-pointer":"",r),onClick:c,children:s})}const Zv=({status:s})=>{const{t:i}=Oe(),r={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline"},c={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return l.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${r[s]}`,children:i(c[s]||s)})},Dg=async(s,i)=>{try{const r=ln(),c=i?`/tools/call/${i}`:"/tools/call",d=await fetch(Ne(c),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":r||"",Authorization:`Bearer ${r}`},body:JSON.stringify({toolName:s.toolName,arguments:s.arguments})});if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const f=await d.json();return f.success?{success:!0,content:f.data.content||[]}:{success:!1,error:f.message||"Tool call failed"}}catch(r){return console.error("Error calling tool:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}},Jv=async(s,i,r)=>{try{const c=ln(),d=await fetch(Ne(`/servers/${s}/tools/${i}/toggle`),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":c||"",Authorization:`Bearer ${c}`},body:JSON.stringify({enabled:r})});if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const f=await d.json();return{success:f.success,error:f.success?void 0:f.message}}catch(c){return console.error("Error toggling tool:",c),{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}},Ug=async(s,i,r)=>{try{const c=ln(),d=await fetch(Ne(`/servers/${s}/tools/${i}/description`),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":c||"",Authorization:`Bearer ${c||""}`},body:JSON.stringify({description:r})});if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const f=await d.json();return{success:f.success,error:f.success?void 0:f.message}}catch(c){return console.error("Error updating tool description:",c),{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}},Iv=Object.freeze(Object.defineProperty({__proto__:null,callTool:Dg,toggleTool:Jv,updateToolDescription:Ug},Symbol.toStringTag,{value:"Module"})),Wv=({isSelected:s,onClick:i,children:r})=>l.jsxs("button",{type:"button",role:"checkbox","aria-checked":s,className:nn("flex w-full items-center justify-between p-2 rounded transition-colors cursor-pointer",s?"bg-blue-50 text-blue-700 hover:bg-blue-100 border-l-4 border-blue-500":"hover:bg-gray-50 text-gray-700"),onClick:i,children:[l.jsx("span",{className:"flex items-center",children:r}),s&&l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"w-5 h-5 text-blue-500",children:l.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]}),Lg=({label:s,helpText:i,noOptionsText:r="No options available",values:c,options:d,onChange:f,className:m})=>{const p=g=>{const h=c.includes(g);f(h?c.filter(y=>y!==g):[...c,g])};return l.jsxs("div",{className:m,children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:s}),l.jsx("div",{className:"border border-gray-200 rounded shadow max-h-60 overflow-y-auto",children:d.length===0?l.jsx("p",{className:"text-gray-500 text-sm p-3",children:r}):l.jsx("div",{className:"space-y-1 p-1",children:d.map(g=>l.jsx(Wv,{value:g.value,isSelected:c.includes(g.value),onClick:()=>p(g.value),children:g.label},g.value))})}),i&&l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:i})]})},Ss=({checked:s,onCheckedChange:i,disabled:r=!1})=>l.jsx("button",{type:"button",role:"switch","aria-checked":s,disabled:r,className:nn("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",r?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!r&&i(!s),children:l.jsx("span",{className:nn("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",s?"translate-x-6":"translate-x-1")})}),e1=({schema:s,onSubmit:i,onCancel:r,loading:c=!1,storageKey:d,title:f})=>{const{t:m}=Oe(),[p,g]=w.useState({}),[h,y]=w.useState({}),[j,v]=w.useState(!1),[T,S]=w.useState(""),[E,O]=w.useState(""),R=w.useMemo(()=>(V=>{const se=X=>{if(typeof X=="object"&&X!==null){const Y=X;return{type:Y.type||"string",description:Y.description,enum:Y.enum,default:Y.default,properties:Y.properties?Object.fromEntries(Object.entries(Y.properties).map(([k,q])=>[k,se(q)])):void 0,required:Y.required,items:Y.items?se(Y.items):void 0}}return{type:"string"}};return{type:V.type,properties:V.properties?Object.fromEntries(Object.entries(V.properties).map(([X,Y])=>[X,se(Y)])):void 0,required:V.required}})(s),[s]);w.useEffect(()=>{const L=(se,X="")=>{const Y={};return se.type==="object"&&se.properties&&Object.entries(se.properties).forEach(([k,q])=>{const z=X?`${X}.${k}`:k;q.default!==void 0?Y[k]=q.default:q.type==="string"?Y[k]="":q.type==="number"||q.type==="integer"?Y[k]=0:q.type==="boolean"?Y[k]=!1:q.type==="array"?Y[k]=[]:q.type==="object"&&(q.properties?Y[k]=L(q,z):Y[k]={})}),Y};let V=L(R);if(d)try{const se=localStorage.getItem(d);if(se){const X=JSON.parse(se);V={...V,...X}}}catch(se){console.warn("Failed to load saved form data:",se)}g(V)},[R,d]),w.useEffect(()=>{j&&Object.keys(p).length>0&&(S(JSON.stringify(p,null,2)),O(""))},[j,p]);const A=L=>{S(L),O("");try{const V=JSON.parse(L);if(g(V),d)try{localStorage.setItem(d,JSON.stringify(V))}catch(se){console.warn("Failed to save form data to localStorage:",se)}}catch{O(m("tool.invalidJsonFormat"))}},$=()=>{S(JSON.stringify(p,null,2)),O(""),v(!0)},F=()=>{if(T.trim())try{const L=JSON.parse(T);g(L),O(""),v(!1)}catch{O(m("tool.fixJsonBeforeSwitching"));return}else v(!1)},B=(L,V)=>{g(se=>{const X={...se},Y=L.split(".");let k=X;for(let q=0;q<Y.length-1;q++)k[Y[q]]||(k[Y[q]]={}),k=k[Y[q]];if(k[Y[Y.length-1]]=V,d)try{localStorage.setItem(d,JSON.stringify(X))}catch(q){console.warn("Failed to save form data to localStorage:",q)}return X}),h[L]&&y(se=>{const X={...se};return delete X[L],X})},oe=()=>{const L={},V=(se,X,Y="")=>{se.type==="object"&&se.properties&&Object.entries(se.properties).forEach(([k,q])=>{var N;const z=Y?`${Y}.${k}`:k,re=H(X,z);if((N=se.required)!=null&&N.includes(k)&&(re==null||re==="")){L[z]=`${k} is required`;return}re!=null&&re!==""&&(q.type==="string"&&typeof re!="string"?L[z]=`${k} must be a string`:q.type==="number"&&typeof re!="number"?L[z]=`${k} must be a number`:q.type==="integer"&&(!Number.isInteger(re)||typeof re!="number")?L[z]=`${k} must be an integer`:q.type==="boolean"&&typeof re!="boolean"?L[z]=`${k} must be a boolean`:q.type==="array"&&Array.isArray(re)?q.items&&re.forEach((G,te)=>{var ae;((ae=q.items)==null?void 0:ae.type)==="object"&&q.items.properties&&V(q.items,G,`${z}.${te}`)}):q.type==="object"&&typeof re=="object"&&V(q,re,z))})};return V(R,p),y(L),Object.keys(L).length===0},Q=L=>{L.preventDefault(),oe()&&i(p)},H=(L,V)=>V.split(".").reduce((se,X)=>se==null?void 0:se[X],L),I=(L,V,se,X)=>{const Y=se==null?void 0:se[L];return V.type==="string"?V.enum?l.jsxs("select",{value:Y||"",onChange:k=>X(k.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:[l.jsx("option",{value:"",children:m("tool.selectOption")}),V.enum.map((k,q)=>l.jsx("option",{value:k,children:k},q))]}):l.jsx("input",{type:"text",value:Y||"",onChange:k=>X(k.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:V.description||m("tool.enterKey",{key:L})}):V.type==="number"||V.type==="integer"?l.jsx("input",{type:"number",step:V.type==="integer"?"1":"any",value:Y||"",onChange:k=>{const q=k.target.value===""?"":V.type==="integer"?parseInt(k.target.value):parseFloat(k.target.value);X(q)},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"}):V.type==="boolean"?l.jsx("input",{type:"checkbox",checked:Y||!1,onChange:k=>X(k.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):l.jsx("input",{type:"text",value:Y||"",onChange:k=>X(k.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:V.description||m("tool.enterKey",{key:L})})},ne=(L,V,se="")=>{var q,z,re,N,G,te,ae,de,we,ee,le,ce,xe,Be;const X=se?`${se}.${L}`:L,Y=H(p,X),k=h[X];if(V.type==="array"){const je=H(p,X)||[];return l.jsxs("div",{className:"mb-6",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[L,(se?(z=(q=H(R,se))==null?void 0:q.required)==null?void 0:z.includes(L):(re=R.required)==null?void 0:re.includes(L))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),V.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:V.description}),l.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[je.map((De,Ze)=>{var Ct,ua,rn;return l.jsxs("div",{className:"mb-3 p-3 bg-white border rounded-md",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("span",{className:"text-sm font-medium text-gray-600",children:m("tool.item",{index:Ze+1})}),l.jsx("button",{type:"button",onClick:()=>{const Le=[...je];Le.splice(Ze,1),B(X,Le)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((Ct=V.items)==null?void 0:Ct.type)==="string"&&V.items.enum?l.jsxs("select",{value:De||"",onChange:Le=>{const vt=[...je];vt[Ze]=Le.target.value,B(X,vt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[l.jsx("option",{value:"",children:m("tool.selectOption")}),V.items.enum.map((Le,vt)=>l.jsx("option",{value:Le,children:Le},vt))]}):((ua=V.items)==null?void 0:ua.type)==="object"&&V.items.properties?l.jsx("div",{className:"space-y-3",children:Object.entries(V.items.properties).map(([Le,vt])=>{var Ra,Oa;return l.jsxs("div",{children:[l.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Le,((Oa=(Ra=V.items)==null?void 0:Ra.required)==null?void 0:Oa.includes(Le))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),I(Le,vt,De,da=>{const Ma=[...je];Ma[Ze]={...Ma[Ze],[Le]:da},B(X,Ma)})]},Le)})}):l.jsx("input",{type:"text",value:De||"",onChange:Le=>{const vt=[...je];vt[Ze]=Le.target.value,B(X,vt)},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:((rn=V.items)==null?void 0:rn.type)||"value"})})]},Ze)}),l.jsx("button",{type:"button",onClick:()=>{var Ze;const De=((Ze=V.items)==null?void 0:Ze.type)==="object"?{}:"";B(X,[...je,De])},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:L})})]}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},X)}return V.type==="object"?V.properties?l.jsxs("div",{className:"mb-6",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[L,(se?(G=(N=H(R,se))==null?void 0:N.required)==null?void 0:G.includes(L):(te=R.required)==null?void 0:te.includes(L))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),V.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:V.description}),l.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(V.properties).map(([je,De])=>ne(je,De,X))}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},X):l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[L,(se?(de=(ae=H(R,se))==null?void 0:ae.required)==null?void 0:de.includes(L):(we=R.required)==null?void 0:we.includes(L))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"}),l.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),V.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:V.description}),l.jsx("textarea",{value:typeof Y=="object"?JSON.stringify(Y,null,2):Y||"{}",onChange:je=>{try{const De=JSON.parse(je.target.value);B(X,De)}catch{B(X,je.target.value)}},placeholder:`{
|
|
169
|
+
"key": "value"
|
|
170
|
+
}`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},X):V.type==="string"?V.enum?l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[L,(se?!1:(ee=R.required)==null?void 0:ee.includes(L))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),V.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:V.description}),l.jsxs("select",{value:Y||"",onChange:je=>B(X,je.target.value),className:`w-full border rounded-md px-3 py-2 ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[l.jsx("option",{value:"",children:m("tool.selectOption")}),V.enum.map((je,De)=>l.jsx("option",{value:je,children:je},De))]}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},X):l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[L,(se?!1:(le=R.required)==null?void 0:le.includes(L))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),V.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:V.description}),l.jsx("input",{type:"text",value:Y||"",onChange:je=>B(X,je.target.value),className:`w-full border rounded-md px-3 py-2 ${k?"border-red":"border-gray-200"} focus:outline-none form-input`}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},X):V.type==="number"||V.type==="integer"?l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[L,(se?!1:(ce=R.required)==null?void 0:ce.includes(L))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),V.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:V.description}),l.jsx("input",{type:"number",step:V.type==="integer"?"1":"any",value:Y||"",onChange:je=>{const De=je.target.value===""?"":V.type==="integer"?parseInt(je.target.value):parseFloat(je.target.value);B(X,De)},className:`w-full border rounded-md px-3 py-2 form-input ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},X):V.type==="boolean"?l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("input",{type:"checkbox",checked:Y||!1,onChange:je=>B(X,je.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),l.jsxs("label",{className:"ml-2 block text-sm text-gray-700",children:[L,(se?!1:(xe=R.required)==null?void 0:xe.includes(L))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),V.description&&l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:V.description}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},X):l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[L,(se?!1:(Be=R.required)==null?void 0:Be.includes(L))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"}),l.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",V.type,")"]})]}),V.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:V.description}),l.jsx("input",{type:"text",value:Y||"",onChange:je=>B(X,je.target.value),placeholder:m("tool.enterValue",{type:V.type}),className:`w-full border rounded-md px-3 py-2 ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},X)};return R.properties?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex justify-between items-center pb-3",children:[l.jsx("h6",{className:"text-md font-medium text-gray-900",children:f}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx("button",{type:"button",onClick:F,className:`px-3 py-1 text-sm rounded-md transition-colors ${j?"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")}),l.jsx("button",{type:"button",onClick:$,className:`px-3 py-1 text-sm rounded-md transition-colors ${j?"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")})]})]}),j?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("tool.jsonConfiguration")}),l.jsx("textarea",{value:T,onChange:L=>A(L.target.value),placeholder:`{
|
|
171
|
+
"key": "value"
|
|
172
|
+
}`,className:`w-full h-64 border rounded-md px-3 py-2 font-mono text-sm resize-y form-input ${E?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),E&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:E})]}),l.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[l.jsx("button",{type:"button",onClick:r,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),l.jsx("button",{onClick:()=>{try{const L=JSON.parse(T);i(L)}catch{O(m("tool.invalidJsonFormat"))}},disabled:c||!!E,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(c?"tool.running":"tool.runTool")})]})]}):l.jsxs("form",{onSubmit:Q,className:"space-y-4",children:[Object.entries(R.properties||{}).map(([L,V])=>ne(L,V)),l.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[l.jsx("button",{type:"button",onClick:r,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),l.jsx("button",{type:"submit",disabled:c,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(c?"tool.running":"tool.runTool")})]})]})]}):l.jsxs("div",{className:"p-4 bg-gray-50 rounded-md",children:[l.jsx("p",{className:"text-sm text-gray-600",children:m("tool.noParameters")}),l.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[l.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-sm text-gray-600 bg-gray-100 rounded-md hover:bg-gray-200",children:m("tool.cancel")}),l.jsx("button",{onClick:()=>i({}),disabled:c,className:"px-4 py-2 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:m(c?"tool.running":"tool.runTool")})]})]})},t1=({result:s,onClose:i})=>{const{t:r}=Oe(),c=s.content,d=m=>Array.isArray(m)?m.map((p,g)=>l.jsx("div",{className:"mb-3 last:mb-0",children:f(p)},g)):f(m),f=m=>{if(typeof m=="string")return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m})});if(typeof m=="object"&&m!==null){if(m.type==="text"&&m.text)return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m.text})});if(m.type==="image"&&m.data)return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("img",{src:`data:${m.mimeType||"image/png"};base64,${m.data}`,alt:r("tool.toolResult"),className:"max-w-full h-auto rounded-md"})});try{const p=typeof m=="string"?JSON.parse(m):m;return l.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[l.jsx("div",{className:"text-xs text-gray-500 mb-2",children:r("tool.jsonResponse")}),l.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(p,null,2)})]})}catch{return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})}}return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})};return l.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[l.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[s.success?l.jsx(ab,{size:20,className:"text-status-green"}):l.jsx(sb,{size:20,className:"text-status-red"}),l.jsx("div",{children:l.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[r("tool.execution")," ",s.success?r("tool.successful"):r("tool.failed")]})})]}),l.jsx("button",{onClick:i,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),l.jsx("div",{className:"p-4",children:s.success?l.jsx("div",{children:s.content&&s.content.length>0?l.jsxs("div",{children:[l.jsx("div",{className:"text-sm text-gray-600 mb-3",children:r("tool.result")}),d(s.content)]}):l.jsx("div",{className:"text-sm text-gray-500 italic",children:r("tool.noContent")})}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[l.jsx(dg,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-sm font-medium text-red-700",children:r("tool.error")})]}),c&&c.length>0?l.jsxs("div",{children:[l.jsx("div",{className:"text-sm text-gray-600 mb-3",children:r("tool.errorDetails")}),d(c)]}):l.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:l.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:s.error||s.message||r("tool.unknownError")})})]})})]})},a1=({tool:s,server:i,onToggle:r,onDescriptionUpdate:c})=>{const{t:d}=Oe(),[f,m]=w.useState(!1),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[j,v]=w.useState(null),[T,S]=w.useState(!1),[E,O]=w.useState(s.description||""),R=w.useRef(null),A=w.useRef(null),[$,F]=w.useState(0);w.useEffect(()=>{T&&R.current&&(R.current.focus(),$>0&&(R.current.style.width=`${$+20}px`))},[T,$]),w.useEffect(()=>{!T&&A.current&&F(A.current.offsetWidth)},[T,E]);const B=w.useCallback(()=>`mcphub_tool_form_${i?`${i}_`:""}${s.name}`,[s.name,i]),oe=w.useCallback(()=>{localStorage.removeItem(B())},[B]),Q=Y=>{r&&r(s.name,Y)},H=()=>{S(!0)},I=async()=>{try{const Y=await Ug(i,s.name,E);Y.success?(S(!1),c&&c(s.name,E)):(O(s.description||""),console.error("Failed to update tool description:",Y.error))}catch(Y){console.error("Error updating tool description:",Y),O(s.description||""),S(!1)}},ne=Y=>{O(Y.target.value)},L=Y=>{Y.key==="Enter"?I():Y.key==="Escape"&&(O(s.description||""),S(!1))},V=async Y=>{y(!0);try{const k=await Dg({toolName:s.name,arguments:Y},i);v(k)}catch(k){v({success:!1,error:k instanceof Error?k.message:"Unknown error occurred"})}finally{y(!1)}},se=()=>{g(!1),oe(),v(null)},X=()=>{v(null)};return l.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg p-4 mb-4",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>m(!f),children:[l.jsx("div",{className:"flex-1",children:l.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[s.name.replace(i+"-",""),l.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:T?l.jsxs(l.Fragment,{children:[l.jsx("input",{ref:R,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:E,onChange:ne,onKeyDown:L,onClick:Y=>Y.stopPropagation(),style:{minWidth:"100px",width:$>0?`${$+20}px`:"auto"}}),l.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:Y=>{Y.stopPropagation(),I()},children:l.jsx(yi,{size:16})})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{ref:A,children:E||d("tool.noDescription")}),l.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:Y=>{Y.stopPropagation(),H()},children:l.jsx(mg,{size:14})})]})})]})}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("div",{className:"flex items-center space-x-2",onClick:Y=>Y.stopPropagation(),children:l.jsx(Ss,{checked:s.enabled??!0,onCheckedChange:Q,disabled:h})}),l.jsxs("button",{onClick:Y=>{Y.stopPropagation(),m(!0),g(!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:h||!s.enabled,children:[h?l.jsx(cb,{size:14,className:"animate-spin"}):l.jsx(gb,{size:14}),l.jsx("span",{children:d(h?"tool.running":"tool.run")})]}),l.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:f?l.jsx(cg,{size:18}):l.jsx(ug,{size:18})})]})]}),f&&l.jsxs("div",{className:"mt-4 space-y-4",children:[!p&&l.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:d("tool.inputSchema")}),l.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(s.inputSchema,null,2)})]}),p&&l.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[l.jsx(e1,{schema:s.inputSchema||{type:"object"},onSubmit:V,onCancel:se,loading:h,storageKey:B(),title:d("tool.runToolWithName",{name:s.name.replace(i+"-","")})}),j&&l.jsx("div",{className:"mt-4",children:l.jsx(t1,{result:j,onClose:X})})]})]})]})},_g=({isOpen:s,onClose:i,onConfirm:r,serverName:c,isGroup:d=!1,isUser:f=!1})=>{const{t:m}=Oe();return s?l.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6",children:[l.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:m(f?"users.confirmDelete":d?"groups.confirmDelete":"server.confirmDelete")}),l.jsx("p",{className:"text-gray-500 mb-6",children:f?m("users.deleteWarning",{username:c}):d?m("groups.deleteWarning",{name:c}):m("server.deleteWarning",{name:c})}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{onClick:i,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),l.jsx("button",{onClick:r,className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger",children:m("common.delete")})]})]})})}):null},n1=({server:s,onRemove:i,onEdit:r,onToggle:c,onRefresh:d})=>{var I;const{t:f}=Oe(),{showToast:m}=Hl(),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[j,v]=w.useState(!1),[T,S]=w.useState(!1),[E,O]=w.useState(!1),R=w.useRef(null);w.useEffect(()=>{const ne=L=>{R.current&&!R.current.contains(L.target)&&S(!1)};return document.addEventListener("mousedown",ne),()=>{document.removeEventListener("mousedown",ne)}},[]);const A=ne=>{ne.stopPropagation(),y(!0)},$=ne=>{ne.stopPropagation(),r(s)},F=async ne=>{if(ne.stopPropagation(),!(j||!c)){v(!0);try{await c(s,s.enabled===!1)}finally{v(!1)}}},B=ne=>{ne.stopPropagation(),S(!T)},oe=ne=>{if(ne.stopPropagation(),!!s.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(s.error).then(()=>{O(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>O(!1),2e3)});else{const L=document.createElement("textarea");L.value=s.error,L.style.position="fixed",L.style.left="-9999px",document.body.appendChild(L),L.focus(),L.select();try{document.execCommand("copy"),O(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>O(!1),2e3)}catch(V){m(f("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",V)}document.body.removeChild(L)}},Q=()=>{i(s.name),y(!1)},H=async(ne,L)=>{try{const{toggleTool:V}=await Qv(async()=>{const{toggleTool:X}=await Promise.resolve().then(()=>Iv);return{toggleTool:X}},[],import.meta.url),se=await V(s.name,ne,L);se.success?(m(f(L?"tool.enableSuccess":"tool.disableSuccess",{name:ne}),"success"),d&&d()):m(se.error||f("tool.toggleFailed"),"error")}catch(V){console.error("Error toggling tool:",V),m(f("tool.toggleFailed"),"error")}};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`bg-white shadow rounded-lg p-6 mb-6 page-card transition-all duration-200 ${s.enabled===!1?"opacity-60":""}`,children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>g(!p),children:[l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("h2",{className:`text-xl font-semibold ${s.enabled===!1?"text-gray-600":"text-gray-900"}`,children:s.name}),l.jsx(Zv,{status:s.status}),l.jsxs("div",{className:"flex items-center px-2 py-1 bg-blue-50 text-blue-700 rounded-full text-sm btn-primary",children:[l.jsx("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),l.jsxs("span",{children:[((I=s.tools)==null?void 0:I.length)||0," ",f("server.tools")]})]}),s.error&&l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"cursor-pointer",onClick:B,"aria-label":f("server.viewErrorDetails"),children:l.jsx(dg,{className:"text-red-500 hover:text-red-600",size:18})}),T&&l.jsxs("div",{ref:R,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:ne=>ne.stopPropagation(),children:[l.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:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("h4",{className:"text-sm font-medium text-red-600",children:f("server.errorDetails")}),l.jsx("button",{onClick:oe,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:f("common.copy"),children:E?l.jsx(yi,{size:14,className:"text-green-500"}):l.jsx(fg,{size:14})})]}),l.jsx("button",{onClick:ne=>{ne.stopPropagation(),S(!1)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),l.jsx("div",{className:"p-4 pt-2",children:l.jsx("pre",{className:"text-sm text-gray-700 break-words whitespace-pre-wrap",children:s.error})})]})]})]}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx("button",{onClick:$,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:f("server.edit")}),l.jsx("div",{className:"flex items-center",children:l.jsx("button",{onClick:F,className:`px-3 py-1 text-sm rounded transition-colors ${j?"bg-gray-200 text-gray-500":s.enabled!==!1?"bg-green-100 text-green-800 hover:bg-green-200 btn-secondary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-primary"}`,disabled:j,children:j?f("common.processing"):s.enabled!==!1?f("server.disable"):f("server.enable")})}),l.jsx("button",{onClick:A,className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 text-sm btn-danger",children:f("server.delete")}),l.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:p?l.jsx(cg,{size:18}):l.jsx(ug,{size:18})})]})]}),p&&s.tools&&l.jsxs("div",{className:"mt-6",children:[l.jsx("h6",{className:`font-medium ${s.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:f("server.tools")}),l.jsx("div",{className:"space-y-4",children:s.tools.map((ne,L)=>l.jsx(a1,{server:s.name,tool:ne,onToggle:H},L))})]})]}),l.jsx(_g,{isOpen:h,onClose:()=>y(!1),onConfirm:Q,serverName:s.name})]})},uu=({onSubmit:s,onCancel:i,initialData:r=null,modalTitle:c,formError:d=null})=>{var Y,k,q,z,re,N,G,te,ae,de,we,ee,le,ce,xe,Be,je,De,Ze,Ct,ua,rn,Le,vt,Ra,Oa,da,Ma,As,Vl,ql,za,mt,Yt,ht,Gl,$l,Kl,on,cn,ta,un;const{t:f}=Oe(),m=()=>!r||!r.config?"stdio":r.config.type?r.config.type:r.config.url?"sse":"stdio",[p,g]=w.useState(m()),[h,y]=w.useState({name:r&&r.name||"",url:r&&r.config&&r.config.url||"",command:r&&r.config&&r.config.command||"",arguments:r&&r.config&&r.config.args?Array.isArray(r.config.args)?r.config.args.join(" "):String(r.config.args):"",args:r&&r.config&&r.config.args||[],type:m(),env:[],headers:[],options:{timeout:r&&r.config&&r.config.options&&r.config.options.timeout||6e4,resetTimeoutOnProgress:r&&r.config&&r.config.options&&r.config.options.resetTimeoutOnProgress||!1,maxTotalTimeout:r&&r.config&&r.config.options&&r.config.options.maxTotalTimeout||void 0},openapi:r&&r.config&&r.config.openapi?{url:r.config.openapi.url||"",schema:r.config.openapi.schema?JSON.stringify(r.config.openapi.schema,null,2):"",inputMode:r.config.openapi.url?"url":r.config.openapi.schema?"schema":"url",version:r.config.openapi.version||"3.1.0",securityType:((Y=r.config.openapi.security)==null?void 0:Y.type)||"none",apiKeyName:((q=(k=r.config.openapi.security)==null?void 0:k.apiKey)==null?void 0:q.name)||"",apiKeyIn:((re=(z=r.config.openapi.security)==null?void 0:z.apiKey)==null?void 0:re.in)||"header",apiKeyValue:((G=(N=r.config.openapi.security)==null?void 0:N.apiKey)==null?void 0:G.value)||"",httpScheme:((ae=(te=r.config.openapi.security)==null?void 0:te.http)==null?void 0:ae.scheme)||"bearer",httpCredentials:((we=(de=r.config.openapi.security)==null?void 0:de.http)==null?void 0:we.credentials)||"",oauth2Token:((le=(ee=r.config.openapi.security)==null?void 0:ee.oauth2)==null?void 0:le.token)||"",openIdConnectUrl:((xe=(ce=r.config.openapi.security)==null?void 0:ce.openIdConnect)==null?void 0:xe.url)||"",openIdConnectToken:((je=(Be=r.config.openapi.security)==null?void 0:Be.openIdConnect)==null?void 0:je.token)||""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none"}}),[j,v]=w.useState(r&&r.config&&r.config.env?Object.entries(r.config.env).map(([ue,ie])=>({key:ue,value:ie})):[]),[T,S]=w.useState(r&&r.config&&r.config.headers?Object.entries(r.config.headers).map(([ue,ie])=>({key:ue,value:ie})):[]),[E,O]=w.useState(!1),[R,A]=w.useState(null),$=!!r,F=ue=>{const{name:ie,value:pe}=ue.target;y({...h,[ie]:pe})},B=ue=>{const ie=ue.split(" ").filter(pe=>pe.trim()!=="");y({...h,arguments:ue,args:ie})},oe=ue=>{g(ue),y(ie=>({...ie,type:ue}))},Q=(ue,ie,pe)=>{const Pt=[...j];Pt[ue][ie]=pe,v(Pt)},H=()=>{v([...j,{key:"",value:""}])},I=ue=>{const ie=[...j];ie.splice(ue,1),v(ie)},ne=(ue,ie,pe)=>{const Pt=[...T];Pt[ue][ie]=pe,S(Pt)},L=()=>{S([...T,{key:"",value:""}])},V=ue=>{const ie=[...T];ie.splice(ue,1),S(ie)},se=(ue,ie)=>{y(pe=>({...pe,options:{...pe.options,[ue]:ie}}))},X=async ue=>{var ie,pe,Pt;ue.preventDefault(),A(null);try{const Xt={};j.forEach(({key:Et,value:aa})=>{Et.trim()&&(Xt[Et.trim()]=aa)});const Qt={};T.forEach(({key:Et,value:aa})=>{Et.trim()&&(Qt[Et.trim()]=aa)});const dn={};(ie=h.options)!=null&&ie.timeout&&h.options.timeout!==6e4&&(dn.timeout=h.options.timeout),(pe=h.options)!=null&&pe.resetTimeoutOnProgress&&(dn.resetTimeoutOnProgress=h.options.resetTimeoutOnProgress),(Pt=h.options)!=null&&Pt.maxTotalTimeout&&(dn.maxTotalTimeout=h.options.maxTotalTimeout);const Yl={name:h.name,config:{type:p,...p==="openapi"?{openapi:(()=>{var aa,Mn,Rs,Pl,Ft,tt;const Et={version:((aa=h.openapi)==null?void 0:aa.version)||"3.1.0"};if(((Mn=h.openapi)==null?void 0:Mn.inputMode)==="url")Et.url=((Rs=h.openapi)==null?void 0:Rs.url)||"";else if(((Pl=h.openapi)==null?void 0:Pl.inputMode)==="schema"&&((Ft=h.openapi)!=null&&Ft.schema))try{Et.schema=JSON.parse(h.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(tt=h.openapi)!=null&&tt.securityType&&h.openapi.securityType!=="none"&&(Et.security={type:h.openapi.securityType,...h.openapi.securityType==="apiKey"&&{apiKey:{name:h.openapi.apiKeyName||"",in:h.openapi.apiKeyIn||"header",value:h.openapi.apiKeyValue||""}},...h.openapi.securityType==="http"&&{http:{scheme:h.openapi.httpScheme||"bearer",credentials:h.openapi.httpCredentials||""}},...h.openapi.securityType==="oauth2"&&{oauth2:{token:h.openapi.oauth2Token||""}},...h.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:h.openapi.openIdConnectUrl||"",token:h.openapi.openIdConnectToken||""}}}),Et})(),...Object.keys(Qt).length>0?{headers:Qt}:{}}:p==="sse"||p==="streamable-http"?{url:h.url,...Object.keys(Qt).length>0?{headers:Qt}:{}}:{command:h.command,args:h.args,env:Object.keys(Xt).length>0?Xt:void 0},...Object.keys(dn).length>0?{options:dn}:{}}};s(Yl)}catch(Xt){A(`Error: ${Xt instanceof Error?Xt.message:String(Xt)}`)}};return l.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-xl max-h-screen overflow-y-auto",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:c}),l.jsx("button",{onClick:i,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(R||d)&&l.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:d||R}),l.jsxs("form",{onSubmit:X,children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:f("server.name")}),l.jsx("input",{type:"text",name:"name",id:"name",value:h.name,onChange:F,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,disabled:$})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.type")}),l.jsxs("div",{className:"flex space-x-4",children:[l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:p==="stdio",onChange:()=>oe("stdio"),className:"mr-1"}),l.jsx("label",{htmlFor:"command",children:"STDIO"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>oe("sse"),className:"mr-1"}),l.jsx("label",{htmlFor:"url",children:"SSE"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>oe("streamable-http"),className:"mr-1"}),l.jsx("label",{htmlFor:"streamable-http",children:"Streamable HTTP"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>oe("openapi"),className:"mr-1"}),l.jsx("label",{htmlFor:"openapi",children:"OpenAPI"})]})]})]}),p==="openapi"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.inputMode")}),l.jsxs("div",{className:"flex space-x-4",children:[l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((De=h.openapi)==null?void 0:De.inputMode)==="url",onChange:()=>y(ue=>({...ue,openapi:{...ue.openapi,inputMode:"url"}})),className:"mr-1"}),l.jsx("label",{htmlFor:"input-mode-url",children:f("server.openapi.inputModeUrl")})]}),l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((Ze=h.openapi)==null?void 0:Ze.inputMode)==="schema",onChange:()=>y(ue=>({...ue,openapi:{...ue.openapi,inputMode:"schema"}})),className:"mr-1"}),l.jsx("label",{htmlFor:"input-mode-schema",children:f("server.openapi.inputModeSchema")})]})]})]}),((Ct=h.openapi)==null?void 0:Ct.inputMode)==="url"&&l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-url",children:f("server.openapi.specUrl")}),l.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((ua=h.openapi)==null?void 0:ua.url)||"",onChange:ue=>y(ie=>({...ie,openapi:{...ie.openapi,url:ue.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:p==="openapi"&&((rn=h.openapi)==null?void 0:rn.inputMode)==="url"})]}),((Le=h.openapi)==null?void 0:Le.inputMode)==="schema"&&l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-schema",children:f("server.openapi.schema")}),l.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((vt=h.openapi)==null?void 0:vt.schema)||"",onChange:ue=>y(ie=>({...ie,openapi:{...ie.openapi,schema:ue.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:`{
|
|
173
|
+
"openapi": "3.1.0",
|
|
174
|
+
"info": {
|
|
175
|
+
"title": "API",
|
|
176
|
+
"version": "1.0.0"
|
|
177
|
+
},
|
|
178
|
+
"servers": [
|
|
179
|
+
{
|
|
180
|
+
"url": "https://api.example.com"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"paths": {
|
|
184
|
+
...
|
|
185
|
+
}
|
|
186
|
+
}`,required:p==="openapi"&&((Ra=h.openapi)==null?void 0:Ra.inputMode)==="schema"}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.openapi.schemaHelp")})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.security")}),l.jsxs("select",{value:((Oa=h.openapi)==null?void 0:Oa.securityType)||"none",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,securityType:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.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:[l.jsx("option",{value:"none",children:f("server.openapi.securityNone")}),l.jsx("option",{value:"apiKey",children:f("server.openapi.securityApiKey")}),l.jsx("option",{value:"http",children:f("server.openapi.securityHttp")}),l.jsx("option",{value:"oauth2",children:f("server.openapi.securityOAuth2")}),l.jsx("option",{value:"openIdConnect",children:f("server.openapi.securityOpenIdConnect")})]})]}),((da=h.openapi)==null?void 0:da.securityType)==="apiKey"&&l.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.apiKeyConfig")}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyName")}),l.jsx("input",{type:"text",value:((Ma=h.openapi)==null?void 0:Ma.apiKeyName)||"",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,apiKeyName:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyIn")}),l.jsxs("select",{value:((As=h.openapi)==null?void 0:As.apiKeyIn)||"header",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,apiKeyIn:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[l.jsx("option",{value:"header",children:"Header"}),l.jsx("option",{value:"query",children:"Query"}),l.jsx("option",{value:"cookie",children:"Cookie"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyValue")}),l.jsx("input",{type:"password",value:((Vl=h.openapi)==null?void 0:Vl.apiKeyValue)||"",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,apiKeyValue:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),((ql=h.openapi)==null?void 0:ql.securityType)==="http"&&l.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.httpAuthConfig")}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpScheme")}),l.jsxs("select",{value:((za=h.openapi)==null?void 0:za.httpScheme)||"bearer",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,httpScheme:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[l.jsx("option",{value:"basic",children:"Basic"}),l.jsx("option",{value:"bearer",children:"Bearer"}),l.jsx("option",{value:"digest",children:"Digest"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpCredentials")}),l.jsx("input",{type:"password",value:((mt=h.openapi)==null?void 0:mt.httpCredentials)||"",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,httpCredentials:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((Yt=h.openapi)==null?void 0:Yt.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((ht=h.openapi)==null?void 0:ht.securityType)==="oauth2"&&l.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.oauth2Config")}),l.jsx("div",{className:"grid grid-cols-1 gap-3",children:l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.oauth2Token")}),l.jsx("input",{type:"password",value:((Gl=h.openapi)==null?void 0:Gl.oauth2Token)||"",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,oauth2Token:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})})]}),(($l=h.openapi)==null?void 0:$l.securityType)==="openIdConnect"&&l.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.openIdConnectConfig")}),l.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectUrl")}),l.jsx("input",{type:"url",value:((Kl=h.openapi)==null?void 0:Kl.openIdConnectUrl)||"",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,openIdConnectUrl:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.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"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectToken")}),l.jsx("input",{type:"password",value:((on=h.openapi)==null?void 0:on.openIdConnectToken)||"",onChange:ue=>y(ie=>{var pe;return{...ie,openapi:{...ie.openapi,openIdConnectToken:ue.target.value,url:((pe=ie.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"id-token"})]})]})]}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),l.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:"+"})]}),T.map((ue,ie)=>l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[l.jsx("input",{type:"text",value:ue.key,onChange:pe=>ne(ie,"key",pe.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"}),l.jsx("span",{className:"flex items-center",children:":"}),l.jsx("input",{type:"text",value:ue.value,onChange:pe=>ne(ie,"value",pe.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..."})]}),l.jsx("button",{type:"button",onClick:()=>V(ie),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},ie))]})]}):p==="sse"||p==="streamable-http"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"url",children:f("server.url")}),l.jsx("input",{type:"url",name:"url",id:"url",value:h.url,onChange:F,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:p==="streamable-http"?"e.g.: http://localhost:3000/mcp":"e.g.: http://localhost:3000/sse",required:p==="sse"||p==="streamable-http"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),l.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:"+"})]}),T.map((ue,ie)=>l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[l.jsx("input",{type:"text",value:ue.key,onChange:pe=>ne(ie,"key",pe.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"}),l.jsx("span",{className:"flex items-center",children:":"}),l.jsx("input",{type:"text",value:ue.value,onChange:pe=>ne(ie,"value",pe.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..."})]}),l.jsx("button",{type:"button",onClick:()=>V(ie),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},ie))]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"command",children:f("server.command")}),l.jsx("input",{type:"text",name:"command",id:"command",value:h.command,onChange:F,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:p==="stdio"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"arguments",children:f("server.arguments")}),l.jsx("input",{type:"text",name:"arguments",id:"arguments",value:h.arguments,onChange:ue=>B(ue.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:p==="stdio"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.envVars")}),l.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((ue,ie)=>l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[l.jsx("input",{type:"text",value:ue.key,onChange:pe=>Q(ie,"key",pe.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:f("server.key")}),l.jsx("span",{className:"flex items-center",children:":"}),l.jsx("input",{type:"text",value:ue.value,onChange:pe=>Q(ie,"value",pe.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:f("server.value")})]}),l.jsx("button",{type:"button",onClick:()=>I(ie),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},ie))]})]}),p!=="openapi"&&l.jsxs("div",{className:"mb-4",children:[l.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:()=>O(!E),children:[l.jsx("label",{className:"text-gray-700 text-sm font-bold",children:f("server.requestOptions")}),l.jsx("span",{className:"text-gray-500 text-sm",children:E?"▼":"▶"})]}),E&&l.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:f("server.timeout")}),l.jsx("input",{type:"number",id:"timeout",value:((cn=h.options)==null?void 0:cn.timeout)||6e4,onChange:ue=>se("timeout",parseInt(ue.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"}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.timeoutDescription")})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:f("server.maxTotalTimeout")}),l.jsx("input",{type:"number",id:"maxTotalTimeout",value:((ta=h.options)==null?void 0:ta.maxTotalTimeout)||"",onChange:ue=>se("maxTotalTimeout",ue.target.value?parseInt(ue.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"}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.maxTotalTimeoutDescription")})]})]}),l.jsxs("div",{className:"mt-3",children:[l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"checkbox",checked:((un=h.options)==null?void 0:un.resetTimeoutOnProgress)||!1,onChange:ue=>se("resetTimeoutOnProgress",ue.target.checked),className:"mr-2"}),l.jsx("span",{className:"text-gray-600 text-sm",children:f("server.resetTimeoutOnProgress")})]}),l.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:f("server.resetTimeoutOnProgressDescription")})]})]})]}),l.jsxs("div",{className:"flex justify-end mt-6",children:[l.jsx("button",{type:"button",onClick:i,className:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-medium py-2 px-4 rounded mr-2 btn-secondary",children:f("server.cancel")}),l.jsx("button",{type:"submit",className:"bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded btn-primary",children:f($?"server.save":"server.add")})]})]})]})},Hg=s=>{const i=new Set,r=/\$\{([^}]+)\}/g,c=f=>{let m;for(;(m=r.exec(f))!==null;)i.add(m[1])},d=(f,m="")=>{typeof f=="string"?c(f):Array.isArray(f)?f.forEach((p,g)=>d(p,`${m}[${g}]`)):f&&typeof f=="object"&&Object.entries(f).forEach(([p,g])=>{d(g,m?`${m}.${p}`:p)})};return d(s),Array.from(i)},s1=({onAdd:s})=>{const{t:i}=Oe(),[r,c]=w.useState(!1),[d,f]=w.useState(null),[m,p]=w.useState(!1),[g,h]=w.useState(null),[y,j]=w.useState([]),v=()=>{c(!r),f(null),p(!1),h(null)},T=async()=>{g&&(await S(g),p(!1),h(null))},S=async O=>{try{f(null);const R=localStorage.getItem("mcphub_token"),A=await fetch(Ne("/servers"),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":R||""},body:JSON.stringify(O)}),$=await A.json();if(!A.ok){$&&$.message?f($.message):A.status===400?f(i("server.invalidData")):A.status===409?f(i("server.alreadyExists",{serverName:O.name})):f(i("server.addError"));return}c(!1),s()}catch(R){console.error("Error adding server:",R),navigator.onLine?R instanceof TypeError&&(R.message.includes("NetworkError")||R.message.includes("Failed to fetch"))?f(i("errors.serverConnection")):f(i("errors.serverAdd")):f(i("errors.network"))}},E=async O=>{try{const R=Hg(O);R.length>0?(j(R),h(O),p(!0)):await S(O)}catch(R){console.error("Error processing server submission:",R),f(i("errors.serverAdd"))}};return l.jsxs("div",{children:[l.jsxs("button",{onClick:v,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:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})}),i("server.add")]}),r&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx(uu,{onSubmit:E,onCancel:v,modalTitle:i("server.addServer"),formError:d})}),m&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:l.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:i("server.confirmVariables")}),l.jsx("p",{className:"text-gray-600 mb-4",children:i("server.variablesDetected")}),l.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-3",children:[l.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[i("server.detectedVariables"),":"]}),l.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:y.map((O,R)=>l.jsxs("li",{className:"font-mono",children:["$",`{${O}}`]},R))})]})]})}),l.jsx("p",{className:"text-gray-600 text-sm mb-6",children:i("server.confirmVariablesMessage")}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{onClick:()=>{p(!1),h(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:i("common.cancel")}),l.jsx("button",{onClick:T,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:i("server.confirmAndAdd")})]})]})})]})},l1=({server:s,onEdit:i,onCancel:r})=>{const{t:c}=Oe(),[d,f]=w.useState(null),m=async p=>{try{f(null);const g=localStorage.getItem("mcphub_token"),h=await fetch(Ne(`/servers/${s.name}`),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":g||""},body:JSON.stringify(p)}),y=await h.json();if(!h.ok){y&&y.message?f(y.message):h.status===404?f(c("server.notFound",{serverName:s.name})):h.status===400?f(c("server.invalidData")):f(c("server.updateError",{serverName:s.name}));return}i()}catch(g){console.error("Error updating server:",g),navigator.onLine?g instanceof TypeError&&(g.message.includes("NetworkError")||g.message.includes("Failed to fetch"))?f(c("errors.serverConnection")):f(c("errors.serverUpdate",{serverName:s.name})):f(c("errors.network"))}};return l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx(uu,{onSubmit:m,onCancel:r,initialData:s,modalTitle:c("server.editTitle",{serverName:s.name}),formError:d})})},r1=({isOpen:s,onClose:i,onConfirm:r,title:c,message:d,confirmText:f,cancelText:m,variant:p="warning"})=>{const{t:g}=Oe();if(!s)return null;const h=()=>{switch(p){case"danger":return{icon:l.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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:l.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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:l.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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:y,confirmClass:j}=h(),v=S=>{S.target===S.currentTarget&&i()},T=S=>{S.key==="Escape"?i():S.key==="Enter"&&r()};return l.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:v,onKeyDown:T,tabIndex:-1,children:l.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:l.jsxs("div",{className:"p-6",children:[l.jsxs("div",{className:"flex items-start space-x-3",children:[y&&l.jsx("div",{className:"flex-shrink-0",children:y}),l.jsxs("div",{className:"flex-1",children:[c&&l.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:c}),l.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:d})]})]}),l.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[l.jsx("button",{onClick:i,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")}),l.jsx("button",{onClick:r,className:`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${j} ${p==="danger"?"btn-danger":p==="warning"?"btn-warning":"btn-primary"}`,children:f||g("common.confirm")})]})]})})})},i1=({onSuccess:s,onCancel:i})=>{const{t:r}=Oe(),[c,d]=w.useState(!1),[f,m]=w.useState(!1),[p,g]=w.useState(null),[h,y]=w.useState(null),[j,v]=w.useState(!1),[T,S]=w.useState(null),[E,O]=w.useState(""),[R,A]=w.useState(!1),[$,F]=w.useState(""),B=X=>{X.preventDefault(),d(!0)},oe=X=>{X.preventDefault(),d(!1)},Q=X=>{X.preventDefault(),d(!1);const Y=X.dataTransfer.files;if(Y.length>0){const k=Y[0];k.name.endsWith(".dxt")?(y(k),g(null)):g(r("dxt.invalidFileType"))}},H=X=>{const Y=X.target.files;if(Y&&Y.length>0){const k=Y[0];k.name.endsWith(".dxt")?(y(k),g(null)):g(r("dxt.invalidFileType"))}},I=async()=>{if(!h){g(r("dxt.noFileSelected"));return}m(!0),g(null);try{const X=new FormData;X.append("dxtFile",h);const Y=localStorage.getItem("mcphub_token"),k=await fetch(Ne("/dxt/upload"),{method:"POST",headers:{"x-auth-token":Y||""},body:X}),q=await k.json();if(!k.ok)throw new Error(q.message||`HTTP error! Status: ${k.status}`);if(q.success&&q.data)S(q.data.manifest),O(q.data.extractDir),v(!0);else throw new Error(q.message||r("dxt.uploadFailed"))}catch(X){console.error("DXT upload error:",X),g(X instanceof Error?X.message:r("dxt.uploadFailed"))}finally{m(!1)}},ne=async(X,Y=!1)=>{var k;m(!0),g(null);try{const q=se(T,E,X),z=localStorage.getItem("mcphub_token");if(!Y){const ae=await fetch(Ne("/servers"),{method:"GET",headers:{"x-auth-token":z||""}});if(ae.ok&&((k=(await ae.json()).data)==null?void 0:k.find(ee=>ee.name===X))){F(X),A(!0),m(!1);return}}const re=Y?"PUT":"POST",N=Ne(Y?`/servers/${encodeURIComponent(X)}`:"/servers"),G=await fetch(N,{method:re,headers:{"Content-Type":"application/json","x-auth-token":z||""},body:JSON.stringify({name:X,config:q})}),te=await G.json();if(!G.ok)throw new Error(te.message||`HTTP error! Status: ${G.status}`);if(te.success)s(q);else throw new Error(te.message||r("dxt.installFailed"))}catch(q){console.error("DXT install error:",q),g(q instanceof Error?q.message:r("dxt.installFailed")),m(!1)}},L=()=>{A(!1),$&&ne($,!0)},V=()=>{A(!1),F(""),m(!1)},se=(X,Y,k)=>{var re;const q=((re=X.server)==null?void 0:re.mcp_config)||{},z={type:"stdio",command:q.command||"node",args:(q.args||[]).map(N=>N.replace("${__dirname}",Y))};return q.env&&Object.keys(q.env).length>0&&(z.env={...q.env},Object.keys(z.env).forEach(N=>{typeof z.env[N]=="string"&&(z.env[N]=z.env[N].replace("${__dirname}",Y))})),z};return j&&T?l.jsxs(l.Fragment,{children:[l.jsx(r1,{isOpen:R,onClose:V,onConfirm:L,title:r("dxt.serverExistsTitle"),message:r("dxt.serverExistsConfirm",{serverName:$}),confirmText:r("dxt.override"),cancelText:r("common.cancel"),variant:"warning"}),l.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${R?"opacity-50 pointer-events-none":""}`,children:l.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[l.jsxs("div",{className:"flex justify-between items-center mb-6",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:r("dxt.installServer")}),l.jsx("button",{onClick:i,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&l.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:l.jsx("p",{className:"text-red-700",children:p})}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[l.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:r("dxt.extensionInfo")}),l.jsxs("div",{className:"space-y-2 text-sm",children:[l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.name"),":"]})," ",T.display_name||T.name]}),l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.version"),":"]})," ",T.version]}),l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.description"),":"]})," ",T.description]}),T.author&&l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.author"),":"]})," ",T.author.name]}),T.tools&&T.tools.length>0&&l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.tools"),":"]}),l.jsx("ul",{className:"list-disc list-inside ml-4",children:T.tools.map((X,Y)=>l.jsxs("li",{children:[X.name," - ",X.description]},Y))})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:r("dxt.serverName")}),l.jsx("input",{type:"text",id:"serverName",defaultValue:T.name,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:r("dxt.serverNamePlaceholder")})]}),l.jsxs("div",{className:"flex justify-end space-x-4",children:[l.jsx("button",{onClick:i,disabled:f,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:r("common.cancel")}),l.jsx("button",{onClick:()=>{const X=document.getElementById("serverName"),Y=(X==null?void 0:X.value.trim())||T.name;ne(Y)},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?l.jsxs(l.Fragment,{children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r("dxt.installing")]}):r("dxt.install")})]})]})]})})]}):l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-lg",children:[l.jsxs("div",{className:"flex justify-between items-center mb-6",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:r("dxt.uploadTitle")}),l.jsx("button",{onClick:i,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&l.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:l.jsx("p",{className:"text-red-700",children:p})}),l.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center transition-colors ${c?"border-blue-500 bg-blue-50":h?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:B,onDragLeave:oe,onDrop:Q,children:[h?l.jsxs("div",{className:"space-y-2",children:[l.jsx("svg",{className:"mx-auto h-12 w-12 text-green-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})}),l.jsx("p",{className:"text-sm text-gray-900 font-medium",children:h.name}),l.jsxs("p",{className:"text-xs text-gray-500",children:[(h.size/1024/1024).toFixed(2)," MB"]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-900",children:r("dxt.dropFileHere")}),l.jsx("p",{className:"text-xs text-gray-500",children:r("dxt.orClickToSelect")})]})]}),l.jsx("input",{type:"file",accept:".dxt",onChange:H,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),l.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[l.jsx("button",{onClick:i,disabled:f,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:r("common.cancel")}),l.jsx("button",{onClick:I,disabled:!h||f,className:"px-4 py-2 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:f?l.jsxs(l.Fragment,{children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r("dxt.uploading")]}):r("dxt.upload")})]})]})})},o1=()=>{const{t:s}=Oe(),i=On(),{servers:r,error:c,setError:d,isLoading:f,handleServerAdd:m,handleServerEdit:p,handleServerRemove:g,handleServerToggle:h,triggerRefresh:y}=Bl(),[j,v]=w.useState(null),[T,S]=w.useState(!1),[E,O]=w.useState(!1),R=async B=>{const oe=await p(B);oe&&v(oe)},A=()=>{v(null),y()},$=async()=>{S(!0);try{y(),await new Promise(B=>setTimeout(B,500))}finally{S(!1)}},F=B=>{O(!1),y()};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.servers.title")}),l.jsxs("div",{className:"flex space-x-4",children:[l.jsxs("button",{onClick:()=>i("/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:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.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")]}),l.jsx(s1,{onAdd:m}),l.jsxs("button",{onClick:()=>O(!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:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.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("dxt.upload")]}),l.jsxs("button",{onClick:$,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?l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.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")]})]})]}),c&&l.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-red-600 text-lg font-medium",children:s("app.error")}),l.jsx("p",{className:"text-gray-600 mt-1",children:c})]}),l.jsx("button",{onClick:()=>d(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":s("app.closeButton"),children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})})]})}),f?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:l.jsxs("div",{className:"flex flex-col items-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):r.length===0?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:l.jsx("p",{className:"text-gray-600",children:s("app.noServers")})}):l.jsx("div",{className:"space-y-6",children:r.map((B,oe)=>l.jsx(n1,{server:B,onRemove:g,onEdit:R,onToggle:h,onRefresh:y},oe))}),j&&l.jsx(l1,{server:j,onEdit:A,onCancel:()=>v(null)}),E&&l.jsx(i1,{onSuccess:F,onCancel:()=>O(!1)})]})},du=()=>{const{t:s}=Oe(),[i,r]=w.useState([]),[c,d]=w.useState(!0),[f,m]=w.useState(null),[p,g]=w.useState(0),h=w.useCallback(async()=>{try{d(!0);const R=localStorage.getItem("mcphub_token"),A=await fetch(Ne("/groups"),{headers:{"x-auth-token":R||""}});if(!A.ok)throw new Error(`Status: ${A.status}`);const $=await A.json();$&&$.success&&Array.isArray($.data)?r($.data):(console.error("Invalid group data format:",$),r([])),m(null)}catch(R){console.error("Error fetching groups:",R),m(R instanceof Error?R.message:"Failed to fetch groups"),r([])}finally{d(!1)}},[]),y=w.useCallback(()=>{g(R=>R+1)},[]),j=async(R,A,$=[])=>{try{const F=localStorage.getItem("mcphub_token"),B=await fetch(Ne("/groups"),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":F||""},body:JSON.stringify({name:R,description:A,servers:$})}),oe=await B.json();return B.ok?(y(),oe.data||null):(m(oe.message||s("groups.createError")),null)}catch(F){return m(F instanceof Error?F.message:"Failed to create group"),null}},v=async(R,A)=>{try{const $=localStorage.getItem("mcphub_token"),F=await fetch(Ne(`/groups/${R}`),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":$||""},body:JSON.stringify(A)}),B=await F.json();return F.ok?(y(),B.data||null):(m(B.message||s("groups.updateError")),null)}catch($){return m($ instanceof Error?$.message:"Failed to update group"),null}},T=async(R,A)=>{try{const $=localStorage.getItem("mcphub_token"),F=await fetch(Ne(`/groups/${R}/servers/batch`),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":$||""},body:JSON.stringify({servers:A})}),B=await F.json();return F.ok?(y(),B.data||null):(m(B.message||s("groups.updateError")),null)}catch($){return m($ instanceof Error?$.message:"Failed to update group servers"),null}},S=async R=>{try{const A=localStorage.getItem("mcphub_token"),$=await fetch(Ne(`/groups/${R}`),{method:"DELETE",headers:{"x-auth-token":A||""}}),F=await $.json();return $.ok?(y(),!0):(m(F.message||s("groups.deleteError")),!1)}catch(A){return m(A instanceof Error?A.message:"Failed to delete group"),!1}},E=async(R,A)=>{try{const $=localStorage.getItem("mcphub_token"),F=await fetch(Ne(`/groups/${R}/servers`),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":$||""},body:JSON.stringify({serverName:A})}),B=await F.json();return F.ok?(y(),B.data||null):(m(B.message||s("groups.serverAddError")),null)}catch($){return m($ instanceof Error?$.message:"Failed to add server to group"),null}},O=async(R,A)=>{try{const $=localStorage.getItem("mcphub_token"),F=await fetch(Ne(`/groups/${R}/servers/${A}`),{method:"DELETE",headers:{"x-auth-token":$||""}}),B=await F.json();return F.ok?(y(),B.data||null):(m(B.message||s("groups.serverRemoveError")),null)}catch($){return m($ instanceof Error?$.message:"Failed to remove server from group"),null}};return w.useEffect(()=>{h()},[h,p]),{groups:i,loading:c,error:f,setError:m,triggerRefresh:y,createGroup:j,updateGroup:v,updateGroupServers:T,deleteGroup:S,addServerToGroup:E,removeServerFromGroup:O}},c1=({onAdd:s,onCancel:i})=>{const{t:r}=Oe(),{createGroup:c}=du(),{servers:d}=Bl(),[f,m]=w.useState([]),[p,g]=w.useState(null),[h,y]=w.useState(!1),[j,v]=w.useState({name:"",description:"",servers:[]});w.useEffect(()=>{m(d.filter(E=>E.enabled!==!1))},[d]);const T=E=>{const{name:O,value:R}=E.target;v(A=>({...A,[O]:R}))},S=async E=>{E.preventDefault(),y(!0),g(null);try{if(!j.name.trim()){g(r("groups.nameRequired")),y(!1);return}if(!await c(j.name,j.description,j.servers)){g(r("groups.createError")),y(!1);return}s()}catch(O){g(O instanceof Error?O.message:String(O)),y(!1)}};return l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:r("groups.addNew")}),p&&l.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded",children:p}),l.jsxs("form",{onSubmit:S,children:[l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[r("groups.name")," *"]}),l.jsx("input",{type:"text",id:"name",name:"name",value:j.name,onChange:T,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:r("groups.namePlaceholder"),required:!0})]}),l.jsx(Lg,{className:"mb-6",label:r("groups.servers"),noOptionsText:r("groups.noServerOptions"),values:j.servers,options:f.map(E=>({value:E.name,label:E.name})),onChange:E=>v(O=>({...O,servers:E}))}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",disabled:h,children:r("common.cancel")}),l.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50 btn-primary",disabled:h,children:r(h?"common.submitting":"common.create")})]})]})]})})})},u1=({group:s,onEdit:i,onCancel:r})=>{const{t:c}=Oe(),{updateGroup:d}=du(),{servers:f}=Bl(),[m,p]=w.useState([]),[g,h]=w.useState(null),[y,j]=w.useState(!1),[v,T]=w.useState({name:s.name,description:s.description||"",servers:s.servers||[]});w.useEffect(()=>{p(f.filter(O=>O.enabled!==!1))},[f]);const S=O=>{const{name:R,value:A}=O.target;T($=>({...$,[R]:A}))},E=async O=>{O.preventDefault(),j(!0),h(null);try{if(!v.name.trim()){h(c("groups.nameRequired")),j(!1);return}if(!await d(s.id,{name:v.name,description:v.description,servers:v.servers})){h(c("groups.updateError")),j(!1);return}i()}catch(R){h(R instanceof Error?R.message:String(R)),j(!1)}};return l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:c("groups.edit")}),g&&l.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded",children:g}),l.jsxs("form",{onSubmit:E,children:[l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[c("groups.name")," *"]}),l.jsx("input",{type:"text",id:"name",name:"name",value:v.name,onChange:S,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:c("groups.namePlaceholder"),required:!0})]}),l.jsx(Lg,{className:"mb-6",label:c("groups.servers"),noOptionsText:c("groups.noServerOptions"),values:v.servers,options:m.map(O=>({value:O.name,label:O.name})),onChange:O=>T(R=>({...R,servers:O}))}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",disabled:y,children:c("common.cancel")}),l.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50 btn-primary",disabled:y,children:c(y?"common.submitting":"common.save")})]})]})]})})})},d1=({group:s,servers:i,onEdit:r,onDelete:c})=>{const{t:d}=Oe(),{showToast:f}=Hl(),[m,p]=w.useState(!1),[g,h]=w.useState(!1),y=()=>{r(s)},j=()=>{p(!0)},v=()=>{c(s.id),p(!1)},T=()=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(s.id).then(()=>{h(!0),setTimeout(()=>h(!1),2e3)});else{const E=document.createElement("textarea");E.value=s.id,E.style.position="fixed",E.style.left="-9999px",document.body.appendChild(E),E.focus(),E.select();try{document.execCommand("copy"),h(!0),setTimeout(()=>h(!1),2e3)}catch(O){f(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",O)}document.body.removeChild(E)}},S=i.filter(E=>s.servers.includes(E.name));return l.jsxs("div",{className:"bg-white shadow rounded-lg p-6 ",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:s.name}),l.jsxs("div",{className:"flex items-center ml-3",children:[l.jsx("span",{className:"text-xs text-gray-500 mr-1",children:s.id}),l.jsx("button",{onClick:T,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",title:d("common.copy"),children:g?l.jsx(yi,{size:14,className:"text-green-500"}):l.jsx(fg,{size:14})})]})]}),s.description&&l.jsx("p",{className:"text-gray-600 text-sm mt-1",children:s.description})]}),l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("div",{className:"bg-blue-50 text-blue-700 px-3 py-1 rounded-full text-sm btn-secondary",children:d("groups.serverCount",{count:s.servers.length})}),l.jsx("button",{onClick:y,className:"text-gray-500 hover:text-gray-700",title:d("groups.edit"),children:l.jsx(mg,{size:18})}),l.jsx("button",{onClick:j,className:"text-gray-500 hover:text-red-600",title:d("groups.delete"),children:l.jsx(Nb,{size:18})})]})]}),l.jsx("div",{className:"mt-4",children:S.length===0?l.jsx("p",{className:"text-gray-500 italic",children:d("groups.noServers")}):l.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:S.map(E=>l.jsxs("div",{className:"inline-flex items-center px-3 py-1 bg-gray-50 rounded",children:[l.jsx("span",{className:"font-medium text-gray-700 text-sm",children:E.name}),l.jsx("span",{className:`ml-2 inline-block h-2 w-2 rounded-full ${E.status==="connected"?"bg-green-500":E.status==="connecting"?"bg-yellow-500":"bg-red-500"}`})]},E.name))})}),l.jsx(_g,{isOpen:m,onClose:()=>p(!1),onConfirm:v,serverName:s.name,isGroup:!0})]})},f1=()=>{const{t:s}=Oe(),{groups:i,loading:r,error:c,setError:d,deleteGroup:f,triggerRefresh:m}=du(),{servers:p}=Bl(),[g,h]=w.useState(null),[y,j]=w.useState(!1),v=R=>{h(R)},T=()=>{h(null),m()},S=async R=>{await f(R)||d(s("groups.deleteError"))},E=()=>{j(!0)},O=()=>{j(!1),m()};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.groups.title")}),l.jsx("div",{className:"flex space-x-4",children:l.jsxs("button",{onClick:E,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:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.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")]})})]}),c&&l.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:l.jsx("p",{children:c})}),r?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:l.jsxs("div",{className:"flex flex-col items-center justify-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):i.length===0?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:l.jsx("p",{className:"text-gray-600",children:s("groups.noGroups")})}):l.jsx("div",{className:"space-y-6",children:i.map(R=>l.jsx(d1,{group:R,servers:p,onEdit:v,onDelete:S},R.id))}),y&&l.jsx(c1,{onAdd:O,onCancel:O}),g&&l.jsx(u1,{group:g,onEdit:T,onCancel:()=>h(null)})]})},m1=()=>l.jsx("div",{}),h1=({onSuccess:s,onCancel:i})=>{const{t:r}=Oe(),[c,d]=w.useState({currentPassword:"",newPassword:""}),[f,m]=w.useState(""),[p,g]=w.useState(!1),[h,y]=w.useState(null),[j,v]=w.useState(!1),T=E=>{const{name:O,value:R}=E.target;O==="confirmPassword"?m(R):d(A=>({...A,[O]:R}))},S=async E=>{if(E.preventDefault(),y(null),c.newPassword!==f){y(r("auth.passwordsNotMatch"));return}g(!0);try{const O=await Gy(c);O.success?(v(!0),s&&s()):y(O.message||r("auth.changePasswordError"))}catch{y(r("auth.changePasswordError"))}finally{g(!1)}};return l.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-md",children:[l.jsx("h2",{className:"text-xl font-bold mb-4",children:r("auth.changePassword")}),j?l.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:r("auth.changePasswordSuccess")}):l.jsxs("form",{onSubmit:S,children:[h&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:h}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"currentPassword",children:r("auth.currentPassword")}),l.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:c.currentPassword,onChange:T,required:!0})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"newPassword",children:r("auth.newPassword")}),l.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:c.newPassword,onChange:T,required:!0,minLength:6})]}),l.jsxs("div",{className:"mb-6",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"confirmPassword",children:r("auth.confirmPassword")}),l.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:f,onChange:T,required:!0,minLength:6})]}),l.jsxs("div",{className:"flex justify-end space-x-2",children:[i&&l.jsx("button",{type:"button",onClick:i,disabled:p,className:"py-2 px-4 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:r("common.cancel")}),l.jsx("button",{type:"submit",disabled:p,className:"py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 btn-primary",children:p?l.jsxs("span",{className:"flex items-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r("common.save")]}):r("common.save")})]})]})]})},g1=()=>{const{t:s}=Oe(),{showToast:i}=Hl(),[r,c]=w.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!1,bearerAuthKey:"",skipAuth:!1}),[d,f]=w.useState({bearerAuthKey:""}),[m,p]=w.useState({pythonIndexUrl:"",npmRegistry:""}),[g,h]=w.useState({enabled:!1,dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[y,j]=w.useState(!1),[v,T]=w.useState(null),[S,E]=w.useState(0),O=w.useCallback(()=>{E(Q=>Q+1)},[]),R=w.useCallback(async()=>{var Q,H,I,ne,L,V;j(!0),T(null);try{const se=localStorage.getItem("mcphub_token"),X=await fetch(Ne("/settings"),{headers:{"x-auth-token":se||""}});if(!X.ok)throw new Error(`HTTP error! Status: ${X.status}`);const Y=await X.json();Y.success&&((H=(Q=Y.data)==null?void 0:Q.systemConfig)!=null&&H.routing)&&c({enableGlobalRoute:Y.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:Y.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:Y.data.systemConfig.routing.enableBearerAuth??!1,bearerAuthKey:Y.data.systemConfig.routing.bearerAuthKey||"",skipAuth:Y.data.systemConfig.routing.skipAuth??!1}),Y.success&&((ne=(I=Y.data)==null?void 0:I.systemConfig)!=null&&ne.install)&&p({pythonIndexUrl:Y.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:Y.data.systemConfig.install.npmRegistry||""}),Y.success&&((V=(L=Y.data)==null?void 0:L.systemConfig)!=null&&V.smartRouting)&&h({enabled:Y.data.systemConfig.smartRouting.enabled??!1,dbUrl:Y.data.systemConfig.smartRouting.dbUrl||"",openaiApiBaseUrl:Y.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:Y.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:Y.data.systemConfig.smartRouting.openaiApiEmbeddingModel||""})}catch(se){console.error("Failed to fetch settings:",se),T(se instanceof Error?se.message:"Failed to fetch settings"),i(s("errors.failedToFetchSettings"))}finally{j(!1)}},[s]),A=async(Q,H)=>{j(!0),T(null);try{const I=localStorage.getItem("mcphub_token"),ne=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":I||""},body:JSON.stringify({routing:{[Q]:H}})});if(!ne.ok)throw new Error(`HTTP error! Status: ${ne.status}`);return(await ne.json()).success?(c({...r,[Q]:H}),i(s("settings.systemConfigUpdated")),!0):(i(s("errors.failedToUpdateRouteConfig")),!1)}catch(I){return console.error("Failed to update routing config:",I),T(I instanceof Error?I.message:"Failed to update routing config"),i(s("errors.failedToUpdateRouteConfig")),!1}finally{j(!1)}},$=async(Q,H)=>{j(!0),T(null);try{const I=localStorage.getItem("mcphub_token"),ne=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":I||""},body:JSON.stringify({install:{[Q]:H}})});if(!ne.ok)throw new Error(`HTTP error! Status: ${ne.status}`);return(await ne.json()).success?(p({...m,[Q]:H}),i(s("settings.systemConfigUpdated")),!0):(i(s("errors.failedToUpdateSystemConfig")),!1)}catch(I){return console.error("Failed to update system config:",I),T(I instanceof Error?I.message:"Failed to update system config"),i(s("errors.failedToUpdateSystemConfig")),!1}finally{j(!1)}},F=async(Q,H)=>{j(!0),T(null);try{const I=localStorage.getItem("mcphub_token"),ne=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":I||""},body:JSON.stringify({smartRouting:{[Q]:H}})});if(!ne.ok){const V=await ne.json();throw new Error(V.message||`HTTP error! Status: ${ne.status}`)}const L=await ne.json();return L.success?(h({...g,[Q]:H}),i(s("settings.systemConfigUpdated")),!0):(i(L.message||s("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(I){console.error("Failed to update smart routing config:",I);const ne=I instanceof Error?I.message:"Failed to update smart routing config";return T(ne),i(ne),!1}finally{j(!1)}},B=async Q=>{j(!0),T(null);try{const H=localStorage.getItem("mcphub_token"),I=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":H||""},body:JSON.stringify({smartRouting:Q})});if(!I.ok){const L=await I.json();throw new Error(L.message||`HTTP error! Status: ${I.status}`)}const ne=await I.json();return ne.success?(h({...g,...Q}),i(s("settings.systemConfigUpdated")),!0):(i(ne.message||s("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(H){console.error("Failed to update smart routing config:",H);const I=H instanceof Error?H.message:"Failed to update smart routing config";return T(I),i(I),!1}finally{j(!1)}},oe=async Q=>{j(!0),T(null);try{const H=localStorage.getItem("mcphub_token"),I=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":H||""},body:JSON.stringify({routing:Q})});if(!I.ok)throw new Error(`HTTP error! Status: ${I.status}`);return(await I.json()).success?(c({...r,...Q}),i(s("settings.systemConfigUpdated")),!0):(i(s("errors.failedToUpdateRouteConfig")),!1)}catch(H){return console.error("Failed to update routing config:",H),T(H instanceof Error?H.message:"Failed to update routing config"),i(s("errors.failedToUpdateRouteConfig")),!1}finally{j(!1)}};return w.useEffect(()=>{R()},[R,S]),w.useEffect(()=>{r&&f({bearerAuthKey:r.bearerAuthKey})},[r]),{routingConfig:r,tempRoutingConfig:d,setTempRoutingConfig:f,installConfig:m,smartRoutingConfig:g,loading:y,error:v,setError:T,triggerRefresh:O,fetchSettings:R,updateRoutingConfig:A,updateInstallConfig:$,updateSmartRoutingConfig:F,updateSmartRoutingConfigBatch:B,updateRoutingConfigBatch:oe}};function p1(s=32){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=new Uint8Array(s);return crypto.getRandomValues(r),Array.from(r).map(c=>i.charAt(c%i.length)).join("")}const Vc={SETTINGS_SMART_ROUTING:"settings:smart_routing",SETTINGS_SKIP_AUTH:"settings:skip_auth",SETTINGS_INSTALL_CONFIG:"settings:install_config"},x1=()=>{const{t:s,i18n:i}=Oe(),r=On(),{showToast:c}=Hl(),[d,f]=w.useState(i.language);w.useEffect(()=>{f(i.language)},[i.language]);const[m,p]=w.useState({pythonIndexUrl:"",npmRegistry:""}),[g,h]=w.useState({dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),{routingConfig:y,tempRoutingConfig:j,setTempRoutingConfig:v,installConfig:T,smartRoutingConfig:S,loading:E,updateRoutingConfig:O,updateRoutingConfigBatch:R,updateInstallConfig:A,updateSmartRoutingConfig:$,updateSmartRoutingConfigBatch:F}=g1();w.useEffect(()=>{T&&p(T)},[T]),w.useEffect(()=>{S&&h({dbUrl:S.dbUrl||"",openaiApiBaseUrl:S.openaiApiBaseUrl||"",openaiApiKey:S.openaiApiKey||"",openaiApiEmbeddingModel:S.openaiApiEmbeddingModel||""})},[S]);const[B,oe]=w.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,password:!1}),Q=z=>{oe(re=>({...re,[z]:!re[z]}))},H=async(z,re)=>{if(z==="enableBearerAuth"&&re===!0&&!j.bearerAuthKey&&!y.bearerAuthKey){const N=p1();I(N),await R({enableBearerAuth:!0,bearerAuthKey:N})&&v(te=>({...te,bearerAuthKey:N}));return}await O(z,re)},I=z=>{v(re=>({...re,bearerAuthKey:z}))},ne=async()=>{await O("bearerAuthKey",j.bearerAuthKey)},L=(z,re)=>{p({...m,[z]:re})},V=async z=>{await A(z,m[z])},se=(z,re)=>{h({...g,[z]:re})},X=async z=>{await $(z,g[z])},Y=async z=>{if(z){const re=g.dbUrl||S.dbUrl,N=g.openaiApiKey||S.openaiApiKey;if(!re||!N){const te=[];re||te.push(s("settings.dbUrl")),N||te.push(s("settings.openaiApiKey")),c(s("settings.smartRoutingValidationError",{fields:te.join(", ")}));return}const G={enabled:z};g.dbUrl!==S.dbUrl&&(G.dbUrl=g.dbUrl),g.openaiApiBaseUrl!==S.openaiApiBaseUrl&&(G.openaiApiBaseUrl=g.openaiApiBaseUrl),g.openaiApiKey!==S.openaiApiKey&&(G.openaiApiKey=g.openaiApiKey),g.openaiApiEmbeddingModel!==S.openaiApiEmbeddingModel&&(G.openaiApiEmbeddingModel=g.openaiApiEmbeddingModel),await F(G)}else await $("enabled",z)},k=()=>{setTimeout(()=>{r("/")},2e3)},q=z=>{localStorage.setItem("i18nextLng",z),window.location.reload()};return l.jsxs("div",{className:"container mx-auto",children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.settings.title")}),l.jsx("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.language")}),l.jsxs("div",{className:"flex space-x-3",children:[l.jsx("button",{className:`px-3 py-1.5 rounded-md transition-all duration-200 text-sm ${d.startsWith("en")?"bg-blue-500 text-white btn-primary":"bg-blue-100 text-blue-800 hover:bg-blue-200 btn-secondary"}`,onClick:()=>q("en"),children:"English"}),l.jsx("button",{className:`px-3 py-1.5 rounded-md transition-all duration-200 text-sm ${d.startsWith("zh")?"bg-blue-500 text-white btn-primary":"bg-blue-100 text-blue-800 hover:bg-blue-200 btn-secondary"}`,onClick:()=>q("zh"),children:"中文"})]})]})}),l.jsx(Bc,{permissions:Vc.SETTINGS_SMART_ROUTING,children:l.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>Q("smartRoutingConfig"),children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.smartRouting")}),l.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:B.smartRoutingConfig?"▼":"►"})]}),B.smartRoutingConfig&&l.jsxs("div",{className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableSmartRouting")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableSmartRoutingDescription")})]}),l.jsx(Ss,{disabled:E,checked:S.enabled,onCheckedChange:z=>Y(z)})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsx("div",{className:"mb-2",children:l.jsxs("h3",{className:"font-medium text-gray-700",children:[l.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.dbUrl")]})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:g.dbUrl,onChange:z=>se("dbUrl",z.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:E}),l.jsx("button",{onClick:()=>X("dbUrl"),disabled:E,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")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsx("div",{className:"mb-2",children:l.jsxs("h3",{className:"font-medium text-gray-700",children:[l.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.openaiApiKey")]})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"password",value:g.openaiApiKey,onChange:z=>se("openaiApiKey",z.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:E}),l.jsx("button",{onClick:()=>X("openaiApiKey"),disabled:E,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")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsx("div",{className:"mb-2",children:l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.openaiApiBaseUrl")})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:g.openaiApiBaseUrl,onChange:z=>se("openaiApiBaseUrl",z.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:E}),l.jsx("button",{onClick:()=>X("openaiApiBaseUrl"),disabled:E,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")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsx("div",{className:"mb-2",children:l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.openaiApiEmbeddingModel")})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:g.openaiApiEmbeddingModel,onChange:z=>se("openaiApiEmbeddingModel",z.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:E}),l.jsx("button",{onClick:()=>X("openaiApiEmbeddingModel"),disabled:E,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")})]})]})]})]})}),l.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>Q("routingConfig"),children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.routeConfig")}),l.jsx("span",{className:"text-gray-500",children:B.routingConfig?"▼":"►"})]}),B.routingConfig&&l.jsxs("div",{className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableBearerAuth")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableBearerAuthDescription")})]}),l.jsx(Ss,{disabled:E,checked:y.enableBearerAuth,onCheckedChange:z=>H("enableBearerAuth",z)})]}),y.enableBearerAuth&&l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{className:"mb-2",children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.bearerAuthKey")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.bearerAuthKeyDescription")})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:j.bearerAuthKey,onChange:z=>I(z.target.value),placeholder:s("settings.bearerAuthKeyPlaceholder"),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:E||!y.enableBearerAuth}),l.jsx("button",{onClick:ne,disabled:E||!y.enableBearerAuth,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")})]})]}),l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGlobalRoute")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGlobalRouteDescription")})]}),l.jsx(Ss,{disabled:E,checked:y.enableGlobalRoute,onCheckedChange:z=>H("enableGlobalRoute",z)})]}),l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGroupNameRoute")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGroupNameRouteDescription")})]}),l.jsx(Ss,{disabled:E,checked:y.enableGroupNameRoute,onCheckedChange:z=>H("enableGroupNameRoute",z)})]}),l.jsx(Bc,{permissions:Vc.SETTINGS_SKIP_AUTH,children:l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.skipAuth")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.skipAuthDescription")})]}),l.jsx(Ss,{disabled:E,checked:y.skipAuth,onCheckedChange:z=>H("skipAuth",z)})]})})]})]}),l.jsx(Bc,{permissions:Vc.SETTINGS_INSTALL_CONFIG,children:l.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>Q("installConfig"),children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.installConfig")}),l.jsx("span",{className:"text-gray-500",children:B.installConfig?"▼":"►"})]}),B.installConfig&&l.jsxs("div",{className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{className:"mb-2",children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.pythonIndexUrl")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.pythonIndexUrlDescription")})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:m.pythonIndexUrl,onChange:z=>L("pythonIndexUrl",z.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:E}),l.jsx("button",{onClick:()=>V("pythonIndexUrl"),disabled:E,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")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{className:"mb-2",children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.npmRegistry")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.npmRegistryDescription")})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:m.npmRegistry,onChange:z=>L("npmRegistry",z.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:E}),l.jsx("button",{onClick:()=>V("npmRegistry"),disabled:E,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")})]})]})]})]})}),l.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>Q("password"),children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("auth.changePassword")}),l.jsx("span",{className:"text-gray-500",children:B.password?"▼":"►"})]}),B.password&&l.jsx("div",{className:"max-w-lg mt-4",children:l.jsx(h1,{onSuccess:k})})]})]})},y1=()=>{const{t:s}=Oe(),[i,r]=w.useState([]),[c,d]=w.useState([]),[f,m]=w.useState([]),[p,g]=w.useState([]),[h,y]=w.useState(""),[j,v]=w.useState(""),[T,S]=w.useState(""),[E,O]=w.useState(!0),[R,A]=w.useState(null),[$,F]=w.useState(null),[B,oe]=w.useState([]),[Q,H]=w.useState(1),[I,ne]=w.useState(9),[L,V]=w.useState(1),se=w.useCallback(async()=>{try{O(!0);const ee=localStorage.getItem("mcphub_token"),le=await fetch(Ne("/market/servers"),{headers:{"x-auth-token":ee||""}});if(!le.ok)throw new Error(`Status: ${le.status}`);const ce=await le.json();ce&&ce.success&&Array.isArray(ce.data)?(d(ce.data),X(ce.data,Q)):(console.error("Invalid market servers data format:",ce),A(s("market.fetchError")))}catch(ee){console.error("Error fetching market servers:",ee),A(ee instanceof Error?ee.message:String(ee))}finally{O(!1)}},[s]),X=w.useCallback((ee,le,ce=I)=>{const xe=ee.length,Be=Math.ceil(xe/ce);V(Be);const je=Math.max(1,Math.min(le,Be));je!==le&&H(je);const De=(je-1)*ce,Ze=ee.slice(De,De+ce);r(Ze)},[I]),Y=w.useCallback(ee=>{H(ee),X(c,ee,I)},[c,X,I]),k=w.useCallback(async()=>{try{const ee=localStorage.getItem("mcphub_token"),le=await fetch(Ne("/market/categories"),{headers:{"x-auth-token":ee||""}});if(!le.ok)throw new Error(`Status: ${le.status}`);const ce=await le.json();ce&&ce.success&&Array.isArray(ce.data)?m(ce.data):console.error("Invalid categories data format:",ce)}catch(ee){console.error("Error fetching categories:",ee)}},[]),q=w.useCallback(async()=>{try{const ee=localStorage.getItem("mcphub_token"),le=await fetch(Ne("/market/tags"),{headers:{"x-auth-token":ee||""}});if(!le.ok)throw new Error(`Status: ${le.status}`);const ce=await le.json();ce&&ce.success&&Array.isArray(ce.data)?g(ce.data):console.error("Invalid tags data format:",ce)}catch(ee){console.error("Error fetching tags:",ee)}},[]),z=w.useCallback(async ee=>{try{O(!0);const le=localStorage.getItem("mcphub_token"),ce=await fetch(Ne(`/market/servers/${ee}`),{headers:{"x-auth-token":le||""}});if(!ce.ok)throw new Error(`Status: ${ce.status}`);const xe=await ce.json();return xe&&xe.success&&xe.data?(F(xe.data),xe.data):(console.error("Invalid server data format:",xe),A(s("market.serverNotFound")),null)}catch(le){return console.error(`Error fetching server ${ee}:`,le),A(le instanceof Error?le.message:String(le)),null}finally{O(!1)}},[s]),re=w.useCallback(async ee=>{try{if(O(!0),S(ee),!ee.trim()){se();return}const le=localStorage.getItem("mcphub_token"),ce=await fetch(Ne(`/market/servers/search?query=${encodeURIComponent(ee)}`),{headers:{"x-auth-token":le||""}});if(!ce.ok)throw new Error(`Status: ${ce.status}`);const xe=await ce.json();xe&&xe.success&&Array.isArray(xe.data)?(d(xe.data),H(1),X(xe.data,1)):(console.error("Invalid search results format:",xe),A(s("market.searchError")))}catch(le){console.error("Error searching servers:",le),A(le instanceof Error?le.message:String(le))}finally{O(!1)}},[s,c,X,se]),N=w.useCallback(async ee=>{try{if(O(!0),y(ee),v(""),!ee){se();return}const le=localStorage.getItem("mcphub_token"),ce=await fetch(Ne(`/market/categories/${encodeURIComponent(ee)}`),{headers:{"x-auth-token":le||""}});if(!ce.ok)throw new Error(`Status: ${ce.status}`);const xe=await ce.json();xe&&xe.success&&Array.isArray(xe.data)?(d(xe.data),H(1),X(xe.data,1)):(console.error("Invalid category filter results format:",xe),A(s("market.filterError")))}catch(le){console.error("Error filtering servers by category:",le),A(le instanceof Error?le.message:String(le))}finally{O(!1)}},[s,se,X]),G=w.useCallback(async ee=>{try{if(O(!0),v(ee),y(""),!ee){se();return}const le=localStorage.getItem("mcphub_token"),ce=await fetch(Ne(`/market/tags/${encodeURIComponent(ee)}`),{headers:{"x-auth-token":le||""}});if(!ce.ok)throw new Error(`Status: ${ce.status}`);const xe=await ce.json();xe&&xe.success&&Array.isArray(xe.data)?(d(xe.data),H(1),X(xe.data,1)):(console.error("Invalid tag filter results format:",xe),A(s("market.tagFilterError")))}catch(le){console.error("Error filtering servers by tag:",le),A(le instanceof Error?le.message:String(le))}finally{O(!1)}},[s,se,X]),te=w.useCallback(async()=>{try{const ee=localStorage.getItem("mcphub_token"),le=await fetch(Ne("/servers"),{headers:{"x-auth-token":ee||""}});if(!le.ok)throw new Error(`Status: ${le.status}`);const ce=await le.json();if(ce&&ce.success&&Array.isArray(ce.data)){const xe=ce.data.map(Be=>Be.name);oe(xe)}}catch(ee){console.error("Error fetching installed servers:",ee)}},[]),ae=w.useCallback(ee=>B.includes(ee),[B]),de=w.useCallback(async(ee,le)=>{var ce,xe;try{const Be=(ce=ee.installations)!=null&&ce.npm?"npm":Object.keys(ee.installations||{}).length>0?Object.keys(ee.installations)[0]:null;if(!Be||!((xe=ee.installations)!=null&&xe[Be]))return A(s("market.noInstallationMethod")),!1;const je=ee.installations[Be],De={name:ee.name,config:le.type==="stdio"?{command:le.command||je.command||"",args:le.args||je.args||[],env:{...je.env,...le.env}}:le},Ze=localStorage.getItem("mcphub_token"),Ct=await fetch(Ne("/servers"),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":Ze||""},body:JSON.stringify(De)});if(!Ct.ok){const ua=await Ct.json();throw new Error(ua.message||`Status: ${Ct.status}`)}return await te(),!0}catch(Be){return console.error("Error installing server:",Be),A(Be instanceof Error?Be.message:String(Be)),!1}},[s,te]),we=w.useCallback(ee=>{ne(ee),H(1),X(c,1,ee)},[c,X]);return w.useEffect(()=>{se(),k(),q(),te()},[se,k,q,te]),{servers:i,allServers:c,categories:f,tags:p,selectedCategory:h,selectedTag:j,searchQuery:T,loading:E,error:R,setError:A,currentServer:$,fetchMarketServers:se,fetchServerByName:z,searchServers:re,filterByCategory:N,filterByTag:G,installServer:de,currentPage:Q,totalPages:L,serversPerPage:I,changePage:Y,changeServersPerPage:we,isServerInstalled:ae}},b1=({server:s,onClick:i})=>{var p,g,h,y;const{t:r}=Oe(),c=()=>{if(!s.tags||s.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const j=28,v=A=>A.length+3;let T=0,S=0;const E=[...s.tags].sort((A,$)=>A.length-$.length);for(S=0;S<E.length;S++){const A=v(E[S]);if(T+A>j)break;if(T+=A,S===E.length-1)return{tagsToShow:E,hasMore:!1,moreCount:0}}S===0&&E.length>0&&(S=1);const O=E.length-S,R=3+String(O).length+r("market.moreTags").length;return T+R<=j||S<1?{tagsToShow:E.slice(0,S),hasMore:!0,moreCount:O}:{tagsToShow:E.slice(0,Math.max(1,S-1)),hasMore:!0,moreCount:O+1}},{tagsToShow:d,hasMore:f,moreCount:m}=c();return l.jsxs("div",{className:"bg-white rounded-lg shadow-md p-5 hover:shadow-lg transition-all duration-200 cursor-pointer flex flex-col h-full page-card",onClick:()=>i(s),children:[l.jsxs("div",{className:"flex justify-between items-start mb-3",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 line-clamp-1 mr-2",children:s.display_name}),s.is_official&&l.jsx("span",{className:"text-xs font-medium px-2.5 py-0.5 rounded flex-shrink-0 label-primary",children:r("market.official")})]}),l.jsx("p",{className:"text-gray-600 text-sm mb-4 line-clamp-2 min-h-[40px]",children:s.description}),l.jsx("div",{className:"flex flex-wrap gap-1 mb-2 min-h-[28px]",children:((p=s.categories)==null?void 0:p.length)>0?s.categories.map((j,v)=>l.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1.5 rounded whitespace-nowrap",children:j},v)):l.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})}),l.jsx("div",{className:"relative mb-3 min-h-[28px] overflow-x-auto",children:((g=s.tags)==null?void 0:g.length)>0?l.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[d.map((j,v)=>l.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0 label-secondary",children:["#",j]},v)),f&&l.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",m," ",r("market.moreTags")]})]}):l.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})}),l.jsxs("div",{className:"flex justify-between items-center mt-auto pt-2 text-xs text-gray-500",children:[l.jsxs("div",{className:"overflow-hidden",children:[l.jsxs("span",{className:"whitespace-nowrap",children:[r("market.by")," "]}),l.jsx("span",{className:"font-medium whitespace-nowrap overflow-hidden text-ellipsis max-w-[120px] inline-block align-bottom",children:((h=s.author)==null?void 0:h.name)||r("market.unknown")})]}),l.jsxs("div",{className:"flex items-center flex-shrink-0",children:[l.jsx("svg",{className:"h-4 w-4 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),l.jsxs("span",{children:[((y=s.tools)==null?void 0:y.length)||0," ",r("market.tools")]})]})]})]})},v1=({server:s,onBack:i,onInstall:r,installing:c=!1,isInstalled:d=!1})=>{var I,ne;const{t:f}=Oe(),[m,p]=w.useState(!1),[g,h]=w.useState(null),[y,j]=w.useState(!1),[v,T]=w.useState(null),[S,E]=w.useState([]),O=()=>d?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installed")}:c?{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 btn-primary",disabled:!1,text:f("market.install")},R=()=>{p(!m),h(null),j(!1),T(null)},A=async()=>{v&&(await $(v),j(!1),T(null))},$=async L=>{try{h(null),r(s,L.config),p(!1)}catch(V){console.error("Error installing server:",V),h(f("errors.serverInstall"))}},F=()=>{d||R()},B=()=>{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 L=Object.keys(s.installations);if(L.length>0)return s.installations[L[0]]},oe=async L=>{try{const V=Hg(L);V.length>0?(E(V),T(L),j(!0)):await $(L)}catch(V){console.error("Error processing server installation:",V),h(f("errors.serverInstall"))}},Q=O(),H=B();return l.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[l.jsx("div",{className:"mb-4",children:l.jsxs("button",{onClick:i,className:"text-gray-600 hover:text-gray-900 flex items-center",children:[l.jsx("svg",{className:"h-5 w-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:l.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("market.backToList")]})}),l.jsxs("div",{className:"flex justify-between items-start mb-4",children:[l.jsx("div",{children:l.jsxs("h2",{className:"text-2xl font-bold text-gray-900 flex items-center flex-wrap",children:[s.display_name,l.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",s.name,")"]}),l.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[f("market.author"),": ",s.author.name," • ",f("market.license"),": ",s.license," •",l.jsx("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:f("market.repository")})]})]})}),l.jsxs("div",{className:"flex items-center",children:[s.is_official&&l.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:f("market.official")}),l.jsx("button",{onClick:F,disabled:Q.disabled,className:Q.className,children:Q.text})]})]}),l.jsx("p",{className:"text-gray-700 mb-6",children:s.description}),l.jsxs("div",{className:"mb-6",children:[l.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[f("market.categories")," & ",f("market.tags")]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[(I=s.categories)==null?void 0:I.map((L,V)=>l.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:L},`cat-${V}`)),s.tags&&s.tags.map((L,V)=>l.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",L]},`tag-${V}`))]})]}),s.arguments&&Object.keys(s.arguments).length>0&&l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.arguments")}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[l.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.argumentName")}),l.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.description")}),l.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.required")}),l.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.example")})]})}),l.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(s.arguments).map(([L,V],se)=>l.jsxs("tr",{children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:L}),l.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:V.description}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:V.required?l.jsx("span",{className:"text-green-600",children:"✓"}):l.jsx("span",{className:"text-gray-600",children:"✗"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:l.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:V.example})})]},se))})]})})]}),l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.tools")}),l.jsx("div",{className:"space-y-4",children:(ne=s.tools)==null?void 0:ne.map((L,V)=>l.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[l.jsxs("h4",{className:"font-medium mb-2",children:[L.name,l.jsx("button",{type:"button",onClick:()=>{const se=document.getElementById(`schema-${V}`);se&&se.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:f("market.viewSchema")})]}),l.jsx("p",{className:"text-gray-600 mb-2",children:L.description}),l.jsx("div",{className:"mt-2",children:l.jsx("pre",{id:`schema-${V}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(L.inputSchema,null,2)})})]},V))})]}),s.examples&&s.examples.length>0&&l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.examples")}),l.jsx("div",{className:"space-y-4",children:s.examples.map((L,V)=>l.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[l.jsx("h4",{className:"font-medium mb-2",children:L.title}),l.jsx("p",{className:"text-gray-600 mb-2",children:L.description}),l.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:L.prompt})]},V))})]}),l.jsx("div",{className:"mt-6 flex justify-end",children:l.jsx("button",{onClick:F,disabled:Q.disabled,className:Q.className,children:Q.text})}),m&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx(uu,{onSubmit:oe,onCancel:R,modalTitle:f("market.installServer",{name:s.display_name}),formError:g,initialData:{name:s.name,status:"disconnected",config:H?{command:H.command||"",args:H.args||[],env:H.env||{}}:void 0}})}),y&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:l.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:f("server.confirmVariables")}),l.jsx("p",{className:"text-gray-600 mb-4",children:f("server.variablesDetected")}),l.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-3",children:[l.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[f("server.detectedVariables"),":"]}),l.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:S.map((L,V)=>l.jsxs("li",{className:"font-mono",children:["$",`{${L}}`]},V))})]})]})}),l.jsx("p",{className:"text-gray-600 text-sm mb-6",children:f("market.confirmVariablesMessage")}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{onClick:()=>{j(!1),T(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:f("common.cancel")}),l.jsx("button",{onClick:A,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:f("market.confirmAndInstall")})]})]})})]})},w1=({currentPage:s,totalPages:i,onPageChange:r})=>{const c=()=>{const d=[];d.push(l.jsx("button",{onClick:()=>r(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 m=Math.max(2,s-Math.floor(5/2));m>2&&d.push(l.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let p=m;p<=Math.min(i-1,m+5-3);p++)d.push(l.jsx("button",{onClick:()=>r(p),className:`px-3 py-1 mx-1 rounded ${s===p?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:p},p));return m+5-3<i-1&&d.push(l.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),i>1&&d.push(l.jsx("button",{onClick:()=>r(i),className:`px-3 py-1 mx-1 rounded ${s===i?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:i},"last")),d};return i<=1?null:l.jsxs("div",{className:"flex justify-center items-center my-6",children:[l.jsx("button",{onClick:()=>r(Math.max(1,s-1)),disabled:s===1,className:`px-3 py-1 rounded mr-2 ${s===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"« Prev"}),l.jsx("div",{className:"flex",children:c()}),l.jsx("button",{onClick:()=>r(Math.min(i,s+1)),disabled:s===i,className:`px-3 py-1 rounded ml-2 ${s===i?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"Next »"})]})},jh=()=>{const{t:s}=Oe(),i=On(),{serverName:r}=Gx(),{showToast:c}=Hl(),{servers:d,allServers:f,categories:m,loading:p,error:g,setError:h,searchServers:y,filterByCategory:j,filterByTag:v,selectedCategory:T,selectedTag:S,installServer:E,fetchServerByName:O,isServerInstalled:R,currentPage:A,totalPages:$,changePage:F,serversPerPage:B,changeServersPerPage:oe}=y1(),[Q,H]=w.useState(null),[I,ne]=w.useState(""),[L,V]=w.useState(!1);w.useEffect(()=>{(async()=>{if(r){const te=await O(r);te?H(te):i("/market")}else H(null)})()},[r,O,i]);const se=G=>{G.preventDefault(),y(I)},X=G=>{j(G)},Y=()=>{ne(""),j(""),v("")},k=G=>{i(`/market/${G.name}`)},q=()=>{i("/market")},z=async(G,te)=>{try{V(!0),await E(G,te)&&c(s("market.installSuccess",{serverName:G.display_name}),"success")}finally{V(!1)}},re=G=>{F(G),window.scrollTo({top:0,behavior:"smooth"})},N=G=>{const te=parseInt(G.target.value,10);oe(te)};return Q?l.jsx(v1,{server:Q,onBack:q,onInstall:z,installing:L,isInstalled:R(Q.name)}):l.jsxs("div",{children:[l.jsx("div",{className:"flex justify-between items-center mb-8",children:l.jsx("div",{children:l.jsxs("h1",{className:"text-2xl font-bold text-gray-900 flex items-center",children:[s("market.title"),l.jsx("span",{className:"text-sm text-gray-500 font-normal ml-2",children:s("pages.market.title").split(" - ")[1]})]})})}),g&&l.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{children:g}),l.jsx("button",{onClick:()=>h(null),className:"text-red-700 hover:text-red-900 transition-colors duration-200",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})})]})}),l.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:l.jsxs("form",{onSubmit:se,className:"flex space-x-4 mb-0",children:[l.jsx("div",{className:"flex-grow",children:l.jsx("input",{type:"text",value:I,onChange:G=>ne(G.target.value),placeholder:s("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"})}),l.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("market.search")}),(I||T||S)&&l.jsx("button",{type:"button",onClick:Y,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("market.clearFilters")})]})}),l.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[l.jsx("div",{className:"md:w-48 flex-shrink-0",children:l.jsx("div",{className:"bg-white shadow rounded-lg p-4 mb-6 sticky top-4 page-card",children:m.length>0?l.jsxs("div",{className:"mb-6",children:[l.jsxs("div",{className:"flex justify-between items-center mb-3",children:[l.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")}),T&&l.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>j(""),children:s("market.clearCategoryFilter")})]}),l.jsx("div",{className:"flex flex-col gap-2",children:m.map(G=>l.jsx("button",{onClick:()=>X(G),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${T===G?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:G},G))})]}):p?l.jsxs("div",{className:"mb-6",children:[l.jsx("div",{className:"mb-3",children:l.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),l.jsxs("div",{className:"flex flex-col gap-2 items-center py-4 loading-container",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-sm text-gray-600",children:s("app.loading")})]})]}):l.jsxs("div",{className:"mb-6",children:[l.jsx("div",{className:"mb-3",children:l.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),l.jsx("p",{className:"text-sm text-gray-600 py-2",children:s("market.noCategories")})]})})}),l.jsx("div",{className:"flex-grow",children:p?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center",children:l.jsxs("div",{className:"flex flex-col items-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):d.length===0?l.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:l.jsx("p",{className:"text-gray-600",children:s("market.noServers")})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:d.map((G,te)=>l.jsx(b1,{server:G,onClick:k},te))}),l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("div",{className:"text-sm text-gray-500",children:s("market.showing",{from:(A-1)*B+1,to:Math.min(A*B,f.length),total:f.length})}),l.jsx(w1,{currentPage:A,totalPages:$,onPageChange:re}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[s("market.perPage"),":"]}),l.jsxs("select",{id:"perPage",value:B,onChange:N,className:"border rounded p-1 text-sm btn-secondary outline-none",children:[l.jsx("option",{value:"6",children:"6"}),l.jsx("option",{value:"9",children:"9"}),l.jsx("option",{value:"12",children:"12"}),l.jsx("option",{value:"24",children:"24"})]})]})]}),l.jsx("div",{className:"mt-6"})]})})]})]})},j1={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"},S1={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 N1({variant:s="default",size:i="default",className:r,disabled:c,children:d,...f}){return l.jsx("button",{className:nn("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",j1[s],S1[i],r),disabled:c,...f,children:d})}const C1=({logs:s,isLoading:i=!1,error:r=null,onClear:c})=>{const{t:d}=Oe(),f=w.useRef(null),[m,p]=w.useState(!0),[g,h]=w.useState(""),[y,j]=w.useState(["info","error","warn","debug"]),[v,T]=w.useState(["main","child"]);w.useEffect(()=>{m&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[s,m]);const S=s.filter(A=>{const $=g?A.message.toLowerCase().includes(g.toLowerCase()):!0,F=y.includes(A.type),B=v.includes(A.source);return $&&F&&B}),E=A=>new Date(A).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),O=A=>{switch(A){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"}},R=A=>{switch(A){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 l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"bg-card p-3 rounded-t-md flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:"font-semibold text-sm",children:[d("logs.filters"),":"]}),l.jsx("input",{type:"text",placeholder:d("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:A=>h(A.target.value)}),l.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(A=>l.jsx(ii,{variant:y.includes(A)?"default":"outline",className:`cursor-pointer ${y.includes(A)?O(A):""}`,onClick:()=>{y.includes(A)?j($=>$.filter(F=>F!==A)):j($=>[...$,A])},children:A},A))}),l.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(A=>l.jsx(ii,{variant:v.includes(A)?"default":"outline",className:`cursor-pointer ${v.includes(A)?R(A):""}`,onClick:()=>{v.includes(A)?T($=>$.filter(F=>F!==A)):T($=>[...$,A])},children:d(A==="main"?"logs.mainProcess":"logs.childProcess")},A))})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("label",{className:"flex items-center gap-1 text-sm",children:[l.jsx("input",{type:"checkbox",checked:m,onChange:()=>p(!m),className:"form-checkbox h-4 w-4"}),d("logs.autoScroll")]}),l.jsx(N1,{variant:"outline",size:"sm",onClick:c,className:"btn-secondary",disabled:i||s.length===0,children:d("logs.clearLogs")})]})]}),l.jsx("div",{ref:f,className:"flex-grow p-2 overflow-auto bg-card rounded-b-md font-mono text-sm",style:{maxHeight:"calc(100vh - 300px)"},children:i?l.jsx("div",{className:"flex justify-center items-center h-full",children:l.jsx("span",{children:d("logs.loading")})}):r?l.jsx("div",{className:"text-red-500 p-2",children:r.message}):S.length===0?l.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||y.length<4||v.length<2?d("logs.noMatch"):d("logs.noLogs")}):S.map((A,$)=>l.jsxs("div",{className:`py-1 ${A.type==="error"?"text-red-500":A.type==="warn"?"text-yellow-500":""}`,children:[l.jsxs("span",{className:"text-gray-400",children:["[",E(A.timestamp),"]"]}),l.jsx(ii,{className:`ml-2 mr-1 ${O(A.type)}`,children:A.type}),l.jsxs(ii,{variant:"default",className:`mr-2 ${R(A.source)}`,children:[A.source==="main"?d("logs.main"):d("logs.child"),A.processId?` (${A.processId})`:""]}),l.jsx("span",{className:"whitespace-pre-wrap",children:A.message})]},`${A.timestamp}-${$}`))})]})},E1=async()=>{try{const s=ln(),r=await(await fetch(Ne("/logs"),{method:"DELETE",headers:{"x-auth-token":s||""}})).json();if(!r.success)throw new Error(r.error||"Failed to clear logs")}catch(s){throw console.error("Error clearing logs:",s),s}},k1=()=>{const[s,i]=w.useState([]),[r,c]=w.useState(!0),[d,f]=w.useState(null);return w.useEffect(()=>{let p=null,g=!0;const h=()=>{try{p&&p.close();const y=ln();p=new EventSource(Ne(`/logs/stream?token=${y}`)),p.onmessage=j=>{if(g)try{const v=JSON.parse(j.data);v.type==="initial"?(i(v.logs),c(!1)):v.type==="log"&&i(T=>[...T,v.log])}catch(v){console.error("Error parsing SSE message:",v)}},p.onerror=()=>{g&&(p&&(p.close(),setTimeout(h,5e3)),f(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(y){if(!g)return;f(y instanceof Error?y:new Error("Failed to connect to log stream")),c(!1)}};return h(),()=>{g=!1,p&&p.close()}},[]),{logs:s,loading:r,error:d,clearLogs:async()=>{try{await E1(),i([])}catch(p){f(p instanceof Error?p:new Error("Failed to clear logs"))}}}},T1=()=>{const{t:s}=Oe(),{logs:i,loading:r,error:c,clearLogs:d}=k1();return l.jsxs("div",{className:"container mx-auto p-4",children:[l.jsx("div",{className:"flex justify-between items-center mb-4",children:l.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.logs.title")})}),l.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:l.jsx(C1,{logs:i,isLoading:r,error:c,onClear:d})})]})};function Sh(){const s=iu();return l.jsx(fv,{children:l.jsx(Py,{children:l.jsx(uv,{children:l.jsx(ky,{basename:s,children:l.jsxs(ny,{children:[l.jsx(Dt,{path:"/login",element:l.jsx(Kv,{})}),l.jsx(Dt,{element:l.jsx($v,{}),children:l.jsxs(Dt,{element:l.jsx(Gv,{}),children:[l.jsx(Dt,{path:"/",element:l.jsx(Yv,{})}),l.jsx(Dt,{path:"/servers",element:l.jsx(o1,{})}),l.jsx(Dt,{path:"/groups",element:l.jsx(f1,{})}),l.jsx(Dt,{path:"/users",element:l.jsx(m1,{})}),l.jsx(Dt,{path:"/market",element:l.jsx(jh,{})}),l.jsx(Dt,{path:"/market/:serverName",element:l.jsx(jh,{})}),l.jsx(Dt,{path:"/logs",element:l.jsx(T1,{})}),l.jsx(Dt,{path:"/settings",element:l.jsx(x1,{})})]})}),l.jsx(Dt,{path:"*",element:l.jsx(Jh,{to:"/"})})]})})})})})}const Se=s=>typeof s=="string",Rl=()=>{let s,i;const r=new Promise((c,d)=>{s=c,i=d});return r.resolve=s,r.reject=i,r},Nh=s=>s==null?"":""+s,A1=(s,i,r)=>{s.forEach(c=>{i[c]&&(r[c]=i[c])})},R1=/###/g,Ch=s=>s&&s.indexOf("###")>-1?s.replace(R1,"."):s,Eh=s=>!s||Se(s),Ol=(s,i,r)=>{const c=Se(i)?i.split("."):i;let d=0;for(;d<c.length-1;){if(Eh(s))return{};const f=Ch(c[d]);!s[f]&&r&&(s[f]=new r),Object.prototype.hasOwnProperty.call(s,f)?s=s[f]:s={},++d}return Eh(s)?{}:{obj:s,k:Ch(c[d])}},kh=(s,i,r)=>{const{obj:c,k:d}=Ol(s,i,Object);if(c!==void 0||i.length===1){c[d]=r;return}let f=i[i.length-1],m=i.slice(0,i.length-1),p=Ol(s,m,Object);for(;p.obj===void 0&&m.length;)f=`${m[m.length-1]}.${f}`,m=m.slice(0,m.length-1),p=Ol(s,m,Object),p!=null&&p.obj&&typeof p.obj[`${p.k}.${f}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${f}`]=r},O1=(s,i,r,c)=>{const{obj:d,k:f}=Ol(s,i,Object);d[f]=d[f]||[],d[f].push(r)},fi=(s,i)=>{const{obj:r,k:c}=Ol(s,i);if(r&&Object.prototype.hasOwnProperty.call(r,c))return r[c]},M1=(s,i,r)=>{const c=fi(s,r);return c!==void 0?c:fi(i,r)},Bg=(s,i,r)=>{for(const c in i)c!=="__proto__"&&c!=="constructor"&&(c in s?Se(s[c])||s[c]instanceof String||Se(i[c])||i[c]instanceof String?r&&(s[c]=i[c]):Bg(s[c],i[c],r):s[c]=i[c]);return s},bs=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var z1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const D1=s=>Se(s)?s.replace(/[&<>"'\/]/g,i=>z1[i]):s;class U1{constructor(i){this.capacity=i,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(i){const r=this.regExpMap.get(i);if(r!==void 0)return r;const c=new RegExp(i);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(i,c),this.regExpQueue.push(i),c}}const L1=[" ",",","?","!",";"],_1=new U1(20),H1=(s,i,r)=>{i=i||"",r=r||"";const c=L1.filter(m=>i.indexOf(m)<0&&r.indexOf(m)<0);if(c.length===0)return!0;const d=_1.getRegExp(`(${c.map(m=>m==="?"?"\\?":m).join("|")})`);let f=!d.test(s);if(!f){const m=s.indexOf(r);m>0&&!d.test(s.substring(0,m))&&(f=!0)}return f},Ic=function(s,i){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!s)return;if(s[i])return Object.prototype.hasOwnProperty.call(s,i)?s[i]:void 0;const c=i.split(r);let d=s;for(let f=0;f<c.length;){if(!d||typeof d!="object")return;let m,p="";for(let g=f;g<c.length;++g)if(g!==f&&(p+=r),p+=c[g],m=d[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<c.length-1)continue;f+=g-f+1;break}d=m}return d},mi=s=>s==null?void 0:s.replace("_","-"),B1={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,i){var r,c;(c=(r=console==null?void 0:console[s])==null?void 0:r.apply)==null||c.call(r,console,i)}};class hi{constructor(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(i,r)}init(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=i||B1,this.options=r,this.debug=r.debug}log(){for(var i=arguments.length,r=new Array(i),c=0;c<i;c++)r[c]=arguments[c];return this.forward(r,"log","",!0)}warn(){for(var i=arguments.length,r=new Array(i),c=0;c<i;c++)r[c]=arguments[c];return this.forward(r,"warn","",!0)}error(){for(var i=arguments.length,r=new Array(i),c=0;c<i;c++)r[c]=arguments[c];return this.forward(r,"error","")}deprecate(){for(var i=arguments.length,r=new Array(i),c=0;c<i;c++)r[c]=arguments[c];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(i,r,c,d){return d&&!this.debug?null:(Se(i[0])&&(i[0]=`${c}${this.prefix} ${i[0]}`),this.logger[r](i))}create(i){return new hi(this.logger,{prefix:`${this.prefix}:${i}:`,...this.options})}clone(i){return i=i||this.options,i.prefix=i.prefix||this.prefix,new hi(this.logger,i)}}var ca=new hi;class bi{constructor(){this.observers={}}on(i,r){return i.split(" ").forEach(c=>{this.observers[c]||(this.observers[c]=new Map);const d=this.observers[c].get(r)||0;this.observers[c].set(r,d+1)}),this}off(i,r){if(this.observers[i]){if(!r){delete this.observers[i];return}this.observers[i].delete(r)}}emit(i){for(var r=arguments.length,c=new Array(r>1?r-1:0),d=1;d<r;d++)c[d-1]=arguments[d];this.observers[i]&&Array.from(this.observers[i].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p(...c)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p.apply(p,[i,...c])})}}class Th extends bi{constructor(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=i||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}removeNamespaces(i){const r=this.options.ns.indexOf(i);r>-1&&this.options.ns.splice(r,1)}getResource(i,r,c){var h,y;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator,m=d.ignoreJSONStructure!==void 0?d.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;i.indexOf(".")>-1?p=i.split("."):(p=[i,r],c&&(Array.isArray(c)?p.push(...c):Se(c)&&f?p.push(...c.split(f)):p.push(c)));const g=fi(this.data,p);return!g&&!r&&!c&&i.indexOf(".")>-1&&(i=p[0],r=p[1],c=p.slice(2).join(".")),g||!m||!Se(c)?g:Ic((y=(h=this.data)==null?void 0:h[i])==null?void 0:y[r],c,f)}addResource(i,r,c,d){let f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const m=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let p=[i,r];c&&(p=p.concat(m?c.split(m):c)),i.indexOf(".")>-1&&(p=i.split("."),d=r,r=p[1]),this.addNamespaces(r),kh(this.data,p,d),f.silent||this.emit("added",i,r,c,d)}addResources(i,r,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const f in c)(Se(c[f])||Array.isArray(c[f]))&&this.addResource(i,r,f,c[f],{silent:!0});d.silent||this.emit("added",i,r,c)}addResourceBundle(i,r,c,d,f){let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},p=[i,r];i.indexOf(".")>-1&&(p=i.split("."),d=c,c=r,r=p[1]),this.addNamespaces(r);let g=fi(this.data,p)||{};m.skipCopy||(c=JSON.parse(JSON.stringify(c))),d?Bg(g,c,f):g={...g,...c},kh(this.data,p,g),m.silent||this.emit("added",i,r,c)}removeResourceBundle(i,r){this.hasResourceBundle(i,r)&&delete this.data[i][r],this.removeNamespaces(r),this.emit("removed",i,r)}hasResourceBundle(i,r){return this.getResource(i,r)!==void 0}getResourceBundle(i,r){return r||(r=this.options.defaultNS),this.getResource(i,r)}getDataByLanguage(i){return this.data[i]}hasLanguageSomeTranslations(i){const r=this.getDataByLanguage(i);return!!(r&&Object.keys(r)||[]).find(d=>r[d]&&Object.keys(r[d]).length>0)}toJSON(){return this.data}}var Vg={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,i,r,c,d){return s.forEach(f=>{var m;i=((m=this.processors[f])==null?void 0:m.process(i,r,c,d))??i}),i}};const Ah={},Rh=s=>!Se(s)&&typeof s!="boolean"&&typeof s!="number";class gi extends bi{constructor(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),A1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ca.create("translator")}changeLanguage(i){i&&(this.language=i)}exists(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;const c=this.resolve(i,r);return(c==null?void 0:c.res)!==void 0}extractFromKey(i,r){let c=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const d=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let f=r.ns||this.options.defaultNS||[];const m=c&&i.indexOf(c)>-1,p=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!H1(i,c,d);if(m&&!p){const g=i.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:i,namespaces:Se(f)?[f]:f};const h=i.split(c);(c!==d||c===d&&this.options.ns.indexOf(h[0])>-1)&&(f=h.shift()),i=h.join(d)}return{key:i,namespaces:Se(f)?[f]:f}}translate(i,r,c){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);const d=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,f=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:m,namespaces:p}=this.extractFromKey(i[i.length-1],r),g=p[p.length-1],h=r.lng||this.language,y=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode"){if(y){const L=r.nsSeparator||this.options.nsSeparator;return d?{res:`${g}${L}${m}`,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(r)}:`${g}${L}${m}`}return d?{res:m,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(r)}:m}const j=this.resolve(i,r);let v=j==null?void 0:j.res;const T=(j==null?void 0:j.usedKey)||m,S=(j==null?void 0:j.exactUsedKey)||m,E=["[object Number]","[object Function]","[object RegExp]"],O=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,A=r.count!==void 0&&!Se(r.count),$=gi.hasDefaultValue(r),F=A?this.pluralResolver.getSuffix(h,r.count,r):"",B=r.ordinal&&A?this.pluralResolver.getSuffix(h,r.count,{ordinal:!1}):"",oe=A&&!r.ordinal&&r.count===0,Q=oe&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${F}`]||r[`defaultValue${B}`]||r.defaultValue;let H=v;R&&!v&&$&&(H=Q);const I=Rh(H),ne=Object.prototype.toString.apply(H);if(R&&H&&I&&E.indexOf(ne)<0&&!(Se(O)&&Array.isArray(H))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,H,{...r,ns:p}):`key '${m} (${this.language})' returned an object instead of string.`;return d?(j.res=L,j.usedParams=this.getUsedParamsDetails(r),j):L}if(f){const L=Array.isArray(H),V=L?[]:{},se=L?S:T;for(const X in H)if(Object.prototype.hasOwnProperty.call(H,X)){const Y=`${se}${f}${X}`;$&&!v?V[X]=this.translate(Y,{...r,defaultValue:Rh(Q)?Q[X]:void 0,joinArrays:!1,ns:p}):V[X]=this.translate(Y,{...r,joinArrays:!1,ns:p}),V[X]===Y&&(V[X]=H[X])}v=V}}else if(R&&Se(O)&&Array.isArray(v))v=v.join(O),v&&(v=this.extendTranslation(v,i,r,c));else{let L=!1,V=!1;!this.isValidLookup(v)&&$&&(L=!0,v=Q),this.isValidLookup(v)||(V=!0,v=m);const X=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&V?void 0:v,Y=$&&Q!==v&&this.options.updateMissing;if(V||L||Y){if(this.logger.log(Y?"updateKey":"missingKey",h,g,m,Y?Q:v),f){const re=this.resolve(m,{...r,keySeparator:!1});re&&re.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 k=[];const q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&q&&q[0])for(let re=0;re<q.length;re++)k.push(q[re]);else this.options.saveMissingTo==="all"?k=this.languageUtils.toResolveHierarchy(r.lng||this.language):k.push(r.lng||this.language);const z=(re,N,G)=>{var ae;const te=$&&G!==v?G:X;this.options.missingKeyHandler?this.options.missingKeyHandler(re,g,N,te,Y,r):(ae=this.backendConnector)!=null&&ae.saveMissing&&this.backendConnector.saveMissing(re,g,N,te,Y,r),this.emit("missingKey",re,g,N,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?k.forEach(re=>{const N=this.pluralResolver.getSuffixes(re,r);oe&&r[`defaultValue${this.options.pluralSeparator}zero`]&&N.indexOf(`${this.options.pluralSeparator}zero`)<0&&N.push(`${this.options.pluralSeparator}zero`),N.forEach(G=>{z([re],m+G,r[`defaultValue${G}`]||Q)})}):z(k,m,Q))}v=this.extendTranslation(v,i,r,j,c),V&&v===m&&this.options.appendNamespaceToMissingKey&&(v=`${g}:${m}`),(V||L)&&this.options.parseMissingKeyHandler&&(v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}:${m}`:m,L?v:void 0))}return d?(j.res=v,j.usedParams=this.getUsedParamsDetails(r),j):v}extendTranslation(i,r,c,d,f){var h,y;var m=this;if((h=this.i18nFormat)!=null&&h.parse)i=this.i18nFormat.parse(i,{...this.options.interpolation.defaultVariables,...c},c.lng||this.language||d.usedLng,d.usedNS,d.usedKey,{resolved:d});else if(!c.skipInterpolation){c.interpolation&&this.interpolator.init({...c,interpolation:{...this.options.interpolation,...c.interpolation}});const j=Se(i)&&(((y=c==null?void 0:c.interpolation)==null?void 0:y.skipOnVariables)!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(j){const S=i.match(this.interpolator.nestingRegexp);v=S&&S.length}let T=c.replace&&!Se(c.replace)?c.replace:c;if(this.options.interpolation.defaultVariables&&(T={...this.options.interpolation.defaultVariables,...T}),i=this.interpolator.interpolate(i,T,c.lng||this.language||d.usedLng,c),j){const S=i.match(this.interpolator.nestingRegexp),E=S&&S.length;v<E&&(c.nest=!1)}!c.lng&&d&&d.res&&(c.lng=this.language||d.usedLng),c.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var S=arguments.length,E=new Array(S),O=0;O<S;O++)E[O]=arguments[O];return(f==null?void 0:f[0])===E[0]&&!c.context?(m.logger.warn(`It seems you are nesting recursively key: ${E[0]} in key: ${r[0]}`),null):m.translate(...E,r)},c)),c.interpolation&&this.interpolator.reset()}const p=c.postProcess||this.options.postProcess,g=Se(p)?[p]:p;return i!=null&&(g!=null&&g.length)&&c.applyPostProcessor!==!1&&(i=Vg.handle(g,i,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...d,usedParams:this.getUsedParamsDetails(c)},...c}:c,this)),i}resolve(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c,d,f,m,p;return Se(i)&&(i=[i]),i.forEach(g=>{if(this.isValidLookup(c))return;const h=this.extractFromKey(g,r),y=h.key;d=y;let j=h.namespaces;this.options.fallbackNS&&(j=j.concat(this.options.fallbackNS));const v=r.count!==void 0&&!Se(r.count),T=v&&!r.ordinal&&r.count===0,S=r.context!==void 0&&(Se(r.context)||typeof r.context=="number")&&r.context!=="",E=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);j.forEach(O=>{var R,A;this.isValidLookup(c)||(p=O,!Ah[`${E[0]}-${O}`]&&((R=this.utils)!=null&&R.hasLoadedNamespace)&&!((A=this.utils)!=null&&A.hasLoadedNamespace(p))&&(Ah[`${E[0]}-${O}`]=!0,this.logger.warn(`key "${d}" for languages "${E.join(", ")}" won't get resolved as namespace "${p}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach($=>{var oe;if(this.isValidLookup(c))return;m=$;const F=[y];if((oe=this.i18nFormat)!=null&&oe.addLookupKeys)this.i18nFormat.addLookupKeys(F,y,$,O,r);else{let Q;v&&(Q=this.pluralResolver.getSuffix($,r.count,r));const H=`${this.options.pluralSeparator}zero`,I=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(F.push(y+Q),r.ordinal&&Q.indexOf(I)===0&&F.push(y+Q.replace(I,this.options.pluralSeparator)),T&&F.push(y+H)),S){const ne=`${y}${this.options.contextSeparator}${r.context}`;F.push(ne),v&&(F.push(ne+Q),r.ordinal&&Q.indexOf(I)===0&&F.push(ne+Q.replace(I,this.options.pluralSeparator)),T&&F.push(ne+H))}}let B;for(;B=F.pop();)this.isValidLookup(c)||(f=B,c=this.getResource($,O,B,r))}))})}),{res:c,usedKey:d,exactUsedKey:f,usedLng:m,usedNS:p}}isValidLookup(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}getResource(i,r,c){var f;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(i,r,c,d):this.resourceStore.getResource(i,r,c,d)}getUsedParamsDetails(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],c=i.replace&&!Se(i.replace);let d=c?i.replace:i;if(c&&typeof i.count<"u"&&(d.count=i.count),this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),!c){d={...d};for(const f of r)delete d[f]}return d}static hasDefaultValue(i){const r="defaultValue";for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)&&r===c.substring(0,r.length)&&i[c]!==void 0)return!0;return!1}}class Oh{constructor(i){this.options=i,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ca.create("languageUtils")}getScriptPartFromCode(i){if(i=mi(i),!i||i.indexOf("-")<0)return null;const r=i.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(i){if(i=mi(i),!i||i.indexOf("-")<0)return i;const r=i.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(i){if(Se(i)&&i.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(i)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?i.toLowerCase():i)}return this.options.cleanCode||this.options.lowerCaseLng?i.toLowerCase():i}isSupportedCode(i){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(i=this.getLanguagePartFromCode(i)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(i)>-1}getBestMatchFromCodes(i){if(!i)return null;let r;return i.forEach(c=>{if(r)return;const d=this.formatLanguageCode(c);(!this.options.supportedLngs||this.isSupportedCode(d))&&(r=d)}),!r&&this.options.supportedLngs&&i.forEach(c=>{if(r)return;const d=this.getLanguagePartFromCode(c);if(this.isSupportedCode(d))return r=d;r=this.options.supportedLngs.find(f=>{if(f===d)return f;if(!(f.indexOf("-")<0&&d.indexOf("-")<0)&&(f.indexOf("-")>0&&d.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===d||f.indexOf(d)===0&&d.length>1))return f})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(i,r){if(!i)return[];if(typeof i=="function"&&(i=i(r)),Se(i)&&(i=[i]),Array.isArray(i))return i;if(!r)return i.default||[];let c=i[r];return c||(c=i[this.getScriptPartFromCode(r)]),c||(c=i[this.formatLanguageCode(r)]),c||(c=i[this.getLanguagePartFromCode(r)]),c||(c=i.default),c||[]}toResolveHierarchy(i,r){const c=this.getFallbackCodes(r||this.options.fallbackLng||[],i),d=[],f=m=>{m&&(this.isSupportedCode(m)?d.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return Se(i)&&(i.indexOf("-")>-1||i.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(i)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(i)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(i))):Se(i)&&f(this.formatLanguageCode(i)),c.forEach(m=>{d.indexOf(m)<0&&f(this.formatLanguageCode(m))}),d}}const Mh={zero:0,one:1,two:2,few:3,many:4,other:5},zh={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class V1{constructor(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=i,this.options=r,this.logger=ca.create("pluralResolver"),this.pluralRulesCache={}}addRule(i,r){this.rules[i]=r}clearCache(){this.pluralRulesCache={}}getRule(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const c=mi(i==="dev"?"en":i),d=r.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:c,type:d});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let m;try{m=new Intl.PluralRules(c,{type:d})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),zh;if(!i.match(/-|_/))return zh;const g=this.languageUtils.getLanguagePartFromCode(i);m=this.getRule(g,r)}return this.pluralRulesCache[f]=m,m}needsPlural(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=this.getRule(i,r);return c||(c=this.getRule("dev",r)),(c==null?void 0:c.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(i,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(i,c).map(d=>`${r}${d}`)}getSuffixes(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=this.getRule(i,r);return c||(c=this.getRule("dev",r)),c?c.resolvedOptions().pluralCategories.sort((d,f)=>Mh[d]-Mh[f]).map(d=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${d}`):[]}getSuffix(i,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const d=this.getRule(i,c);return d?`${this.options.prepend}${c.ordinal?`ordinal${this.options.prepend}`:""}${d.select(r)}`:(this.logger.warn(`no plural rule found for: ${i}`),this.getSuffix("dev",r,c))}}const Dh=function(s,i,r){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,f=M1(s,i,r);return!f&&d&&Se(r)&&(f=Ic(s,r,c),f===void 0&&(f=Ic(i,r,c))),f},qc=s=>s.replace(/\$/g,"$$$$");class q1{constructor(){var r;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ca.create("interpolator"),this.options=i,this.format=((r=i==null?void 0:i.interpolation)==null?void 0:r.format)||(c=>c),this.init(i)}init(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i.interpolation||(i.interpolation={escapeValue:!0});const{escape:r,escapeValue:c,useRawValueToEscape:d,prefix:f,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:y,unescapePrefix:j,nestingPrefix:v,nestingPrefixEscaped:T,nestingSuffix:S,nestingSuffixEscaped:E,nestingOptionsSeparator:O,maxReplaces:R,alwaysFormat:A}=i.interpolation;this.escape=r!==void 0?r:D1,this.escapeValue=c!==void 0?c:!0,this.useRawValueToEscape=d!==void 0?d:!1,this.prefix=f?bs(f):m||"{{",this.suffix=p?bs(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=y?"":j||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=v?bs(v):T||bs("$t("),this.nestingSuffix=S?bs(S):E||bs(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=R||1e3,this.alwaysFormat=A!==void 0?A:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const i=(r,c)=>(r==null?void 0:r.source)===c?(r.lastIndex=0,r):new RegExp(c,"g");this.regexp=i(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=i(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=i(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(i,r,c,d){var T;let f,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=S=>{if(S.indexOf(this.formatSeparator)<0){const A=Dh(r,g,S,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(A,void 0,c,{...d,...r,interpolationkey:S}):A}const E=S.split(this.formatSeparator),O=E.shift().trim(),R=E.join(this.formatSeparator).trim();return this.format(Dh(r,g,O,this.options.keySeparator,this.options.ignoreJSONStructure),R,c,{...d,...r,interpolationkey:O})};this.resetRegExp();const y=(d==null?void 0:d.missingInterpolationHandler)||this.options.missingInterpolationHandler,j=((T=d==null?void 0:d.interpolation)==null?void 0:T.skipOnVariables)!==void 0?d.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:S=>qc(S)},{regex:this.regexp,safeValue:S=>this.escapeValue?qc(this.escape(S)):qc(S)}].forEach(S=>{for(p=0;f=S.regex.exec(i);){const E=f[1].trim();if(m=h(E),m===void 0)if(typeof y=="function"){const R=y(i,f,d);m=Se(R)?R:""}else if(d&&Object.prototype.hasOwnProperty.call(d,E))m="";else if(j){m=f[0];continue}else this.logger.warn(`missed to pass in variable ${E} for interpolating ${i}`),m="";else!Se(m)&&!this.useRawValueToEscape&&(m=Nh(m));const O=S.safeValue(m);if(i=i.replace(f[0],O),j?(S.regex.lastIndex+=m.length,S.regex.lastIndex-=f[0].length):S.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),i}nest(i,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,f,m;const p=(g,h)=>{const y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;const j=g.split(new RegExp(`${y}[ ]*{`));let v=`{${j[1]}`;g=j[0],v=this.interpolate(v,m);const T=v.match(/'/g),S=v.match(/"/g);(((T==null?void 0:T.length)??0)%2===0&&!S||S.length%2!==0)&&(v=v.replace(/'/g,'"'));try{m=JSON.parse(v),h&&(m={...h,...m})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,E),`${g}${y}${v}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;d=this.nestingRegexp.exec(i);){let g=[];m={...c},m=m.replace&&!Se(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;let h=!1;if(d[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(d[1])){const y=d[1].split(this.formatSeparator).map(j=>j.trim());d[1]=y.shift(),g=y,h=!0}if(f=r(p.call(this,d[1].trim(),m),m),f&&d[0]===i&&!Se(f))return f;Se(f)||(f=Nh(f)),f||(this.logger.warn(`missed to resolve ${d[1]} for nesting ${i}`),f=""),h&&(f=g.reduce((y,j)=>this.format(y,j,c.lng,{...c,interpolationkey:d[1].trim()}),f.trim())),i=i.replace(d[0],f),this.regexp.lastIndex=0}return i}}const G1=s=>{let i=s.toLowerCase().trim();const r={};if(s.indexOf("(")>-1){const c=s.split("(");i=c[0].toLowerCase().trim();const d=c[1].substring(0,c[1].length-1);i==="currency"&&d.indexOf(":")<0?r.currency||(r.currency=d.trim()):i==="relativetime"&&d.indexOf(":")<0?r.range||(r.range=d.trim()):d.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),y=p.trim();r[y]||(r[y]=h),h==="false"&&(r[y]=!1),h==="true"&&(r[y]=!0),isNaN(h)||(r[y]=parseInt(h,10))}})}return{formatName:i,formatOptions:r}},vs=s=>{const i={};return(r,c,d)=>{let f=d;d&&d.interpolationkey&&d.formatParams&&d.formatParams[d.interpolationkey]&&d[d.interpolationkey]&&(f={...f,[d.interpolationkey]:void 0});const m=c+JSON.stringify(f);let p=i[m];return p||(p=s(mi(c),d),i[m]=p),p(r)}};class $1{constructor(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ca.create("formatter"),this.options=i,this.formats={number:vs((r,c)=>{const d=new Intl.NumberFormat(r,{...c});return f=>d.format(f)}),currency:vs((r,c)=>{const d=new Intl.NumberFormat(r,{...c,style:"currency"});return f=>d.format(f)}),datetime:vs((r,c)=>{const d=new Intl.DateTimeFormat(r,{...c});return f=>d.format(f)}),relativetime:vs((r,c)=>{const d=new Intl.RelativeTimeFormat(r,{...c});return f=>d.format(f,c.range||"day")}),list:vs((r,c)=>{const d=new Intl.ListFormat(r,{...c});return f=>d.format(f)})},this.init(i)}init(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(i,r){this.formats[i.toLowerCase().trim()]=r}addCached(i,r){this.formats[i.toLowerCase().trim()]=vs(r)}format(i,r,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=r.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(p=>p.indexOf(")")>-1)){const p=f.findIndex(g=>g.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,p)].join(this.formatSeparator)}return f.reduce((p,g)=>{var j;const{formatName:h,formatOptions:y}=G1(g);if(this.formats[h]){let v=p;try{const T=((j=d==null?void 0:d.formatParams)==null?void 0:j[d.interpolationkey])||{},S=T.locale||T.lng||d.locale||d.lng||c;v=this.formats[h](p,S,{...y,...d,...T})}catch(T){this.logger.warn(T)}return v}else this.logger.warn(`there was no format function for ${h}`);return p},i)}}const K1=(s,i)=>{s.pending[i]!==void 0&&(delete s.pending[i],s.pendingCount--)};class Y1 extends bi{constructor(i,r,c){var f,m;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=i,this.store=r,this.services=c,this.languageUtils=c.languageUtils,this.options=d,this.logger=ca.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=d.maxParallelReads||10,this.readingCalls=0,this.maxRetries=d.maxRetries>=0?d.maxRetries:5,this.retryTimeout=d.retryTimeout>=1?d.retryTimeout:350,this.state={},this.queue=[],(m=(f=this.backend)==null?void 0:f.init)==null||m.call(f,c,d.backend,d)}queueLoad(i,r,c,d){const f={},m={},p={},g={};return i.forEach(h=>{let y=!0;r.forEach(j=>{const v=`${h}|${j}`;!c.reload&&this.store.hasResourceBundle(h,j)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?m[v]===void 0&&(m[v]=!0):(this.state[v]=1,y=!1,m[v]===void 0&&(m[v]=!0),f[v]===void 0&&(f[v]=!0),g[j]===void 0&&(g[j]=!0)))}),y||(p[h]=!0)}),(Object.keys(f).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:d}),{toLoad:Object.keys(f),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(i,r,c){const d=i.split("|"),f=d[0],m=d[1];r&&this.emit("failedLoading",f,m,r),!r&&c&&this.store.addResourceBundle(f,m,c,void 0,void 0,{skipCopy:!0}),this.state[i]=r?-1:2,r&&c&&(this.state[i]=0);const p={};this.queue.forEach(g=>{O1(g.loaded,[f],m),K1(g,i),r&&g.errors.push(r),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const y=g.loaded[h];y.length&&y.forEach(j=>{p[h][j]===void 0&&(p[h][j]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(i,r,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,m=arguments.length>5?arguments[5]:void 0;if(!i.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:r,fcName:c,tried:d,wait:f,callback:m});return}this.readingCalls++;const p=(h,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const j=this.waitingReads.shift();this.read(j.lng,j.ns,j.fcName,j.tried,j.wait,j.callback)}if(h&&y&&d<this.maxRetries){setTimeout(()=>{this.read.call(this,i,r,c,d+1,f*2,m)},f);return}m(h,y)},g=this.backend[c].bind(this.backend);if(g.length===2){try{const h=g(i,r);h&&typeof h.then=="function"?h.then(y=>p(null,y)).catch(p):p(null,h)}catch(h){p(h)}return}return g(i,r,p)}prepareLoading(i,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),d&&d();Se(i)&&(i=this.languageUtils.toResolveHierarchy(i)),Se(r)&&(r=[r]);const f=this.queueLoad(i,r,c,d);if(!f.toLoad.length)return f.pending.length||d(),null;f.toLoad.forEach(m=>{this.loadOne(m)})}load(i,r,c){this.prepareLoading(i,r,{},c)}reload(i,r,c){this.prepareLoading(i,r,{reload:!0},c)}loadOne(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const c=i.split("|"),d=c[0],f=c[1];this.read(d,f,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${r}loading namespace ${f} for language ${d} failed`,m),!m&&p&&this.logger.log(`${r}loaded namespace ${f} for language ${d}`,p),this.loaded(i,m,p)})}saveMissing(i,r,c,d,f){var g,h,y,j,v;let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},p=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((h=(g=this.services)==null?void 0:g.utils)!=null&&h.hasLoadedNamespace&&!((j=(y=this.services)==null?void 0:y.utils)!=null&&j.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${c}" as the namespace "${r}" 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(!(c==null||c==="")){if((v=this.backend)!=null&&v.create){const T={...m,isUpdate:f},S=this.backend.create.bind(this.backend);if(S.length<6)try{let E;S.length===5?E=S(i,r,c,d,T):E=S(i,r,c,d),E&&typeof E.then=="function"?E.then(O=>p(null,O)).catch(p):p(null,E)}catch(E){p(E)}else S(i,r,c,d,p,T)}!i||!i[0]||this.store.addResource(i[0],r,c,d)}}}const Uh=()=>({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 i={};if(typeof s[1]=="object"&&(i=s[1]),Se(s[1])&&(i.defaultValue=s[1]),Se(s[2])&&(i.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){const r=s[3]||s[2];Object.keys(r).forEach(c=>{i[c]=r[c]})}return i},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Lh=s=>{var i,r;return Se(s.ns)&&(s.ns=[s.ns]),Se(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),Se(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),((r=(i=s.supportedLngs)==null?void 0:i.indexOf)==null?void 0:r.call(i,"cimode"))<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s},oi=()=>{},P1=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(r=>{typeof s[r]=="function"&&(s[r]=s[r].bind(s))})};class Dl extends bi{constructor(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Lh(i),this.services={},this.logger=ca,this.modules={external:[]},P1(this),r&&!this.isInitialized&&!i.isClone){if(!this.options.initAsync)return this.init(i,r),this;setTimeout(()=>{this.init(i,r)},0)}}init(){var i=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(c=r,r={}),r.defaultNS==null&&r.ns&&(Se(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const d=Uh();this.options={...d,...this.options,...Lh(r)},this.options.interpolation={...d.interpolation,...this.options.interpolation},r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const f=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?ca.init(f(this.modules.logger),this.options):ca.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=$1;const j=new Oh(this.options);this.store=new Th(this.options.resources,this.options);const v=this.services;v.logger=ca,v.resourceStore=this.store,v.languageUtils=j,v.pluralResolver=new V1(j,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),y&&(!this.options.interpolation.format||this.options.interpolation.format===d.interpolation.format)&&(v.formatter=f(y),v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new q1(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new Y1(f(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",function(T){for(var S=arguments.length,E=new Array(S>1?S-1:0),O=1;O<S;O++)E[O-1]=arguments[O];i.emit(T,...E)}),this.modules.languageDetector&&(v.languageDetector=f(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=f(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new gi(this.services,this.options),this.translator.on("*",function(T){for(var S=arguments.length,E=new Array(S>1?S-1:0),O=1;O<S;O++)E[O-1]=arguments[O];i.emit(T,...E)}),this.modules.external.forEach(T=>{T.init&&T.init(this)})}if(this.format=this.options.interpolation.format,c||(c=oi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[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(y=>{this[y]=function(){return i.store[y](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=function(){return i.store[y](...arguments),i}});const g=Rl(),h=()=>{const y=(j,v)=>{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),g.resolve(v),c(j,v)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),g}loadResources(i){var f,m;let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oi;const d=Se(i)?i:this.language;if(typeof i=="function"&&(c=i),!this.options.resources||this.options.partialBundledLanguages){if((d==null?void 0:d.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return c();const p=[],g=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(j=>{j!=="cimode"&&p.indexOf(j)<0&&p.push(j)})};d?g(d):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>g(y)),(m=(f=this.options.preload)==null?void 0:f.forEach)==null||m.call(f,h=>g(h)),this.services.backendConnector.load(p,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),c(h)})}else c(null)}reloadResources(i,r,c){const d=Rl();return typeof i=="function"&&(c=i,i=void 0),typeof r=="function"&&(c=r,r=void 0),i||(i=this.languages),r||(r=this.options.ns),c||(c=oi),this.services.backendConnector.reload(i,r,f=>{d.resolve(),c(f)}),d}use(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&Vg.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}setResolvedLanguage(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(let r=0;r<this.languages.length;r++){const c=this.languages[r];if(!(["cimode","dev"].indexOf(c)>-1)&&this.store.hasLanguageSomeTranslations(c)){this.resolvedLanguage=c;break}}}changeLanguage(i,r){var c=this;this.isLanguageChangingTo=i;const d=Rl();this.emit("languageChanging",i);const f=g=>{this.language=g,this.languages=this.services.languageUtils.toResolveHierarchy(g),this.resolvedLanguage=void 0,this.setResolvedLanguage(g)},m=(g,h)=>{h?(f(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,d.resolve(function(){return c.t(...arguments)}),r&&r(g,function(){return c.t(...arguments)})},p=g=>{var y,j;!i&&!g&&this.services.languageDetector&&(g=[]);const h=Se(g)?g:this.services.languageUtils.getBestMatchFromCodes(g);h&&(this.language||f(h),this.translator.language||this.translator.changeLanguage(h),(j=(y=this.services.languageDetector)==null?void 0:y.cacheUserLanguage)==null||j.call(y,h)),this.loadResources(h,v=>{m(v,h)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?p(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(p):this.services.languageDetector.detect(p):p(i),d}getFixedT(i,r,c){var d=this;const f=function(m,p){let g;if(typeof p!="object"){for(var h=arguments.length,y=new Array(h>2?h-2:0),j=2;j<h;j++)y[j-2]=arguments[j];g=d.options.overloadTranslationOptionHandler([m,p].concat(y))}else g={...p};g.lng=g.lng||f.lng,g.lngs=g.lngs||f.lngs,g.ns=g.ns||f.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||c||f.keyPrefix);const v=d.options.keySeparator||".";let T;return g.keyPrefix&&Array.isArray(m)?T=m.map(S=>`${g.keyPrefix}${v}${S}`):T=g.keyPrefix?`${g.keyPrefix}${v}${m}`:m,d.t(T,g)};return Se(i)?f.lng=i:f.lngs=i,f.ns=r,f.keyPrefix=c,f}t(){var d;for(var i=arguments.length,r=new Array(i),c=0;c<i;c++)r[c]=arguments[c];return(d=this.translator)==null?void 0:d.translate(...r)}exists(){var d;for(var i=arguments.length,r=new Array(i),c=0;c<i;c++)r[c]=arguments[c];return(d=this.translator)==null?void 0:d.exists(...r)}setDefaultNamespace(i){this.options.defaultNS=i}hasLoadedNamespace(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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 c=r.lng||this.resolvedLanguage||this.languages[0],d=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(c.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(r.precheck){const p=r.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(c,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(c,i)&&(!d||m(f,i)))}loadNamespaces(i,r){const c=Rl();return this.options.ns?(Se(i)&&(i=[i]),i.forEach(d=>{this.options.ns.indexOf(d)<0&&this.options.ns.push(d)}),this.loadResources(d=>{c.resolve(),r&&r(d)}),c):(r&&r(),Promise.resolve())}loadLanguages(i,r){const c=Rl();Se(i)&&(i=[i]);const d=this.options.preload||[],f=i.filter(m=>d.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return f.length?(this.options.preload=d.concat(f),this.loadResources(m=>{c.resolve(),r&&r(m)}),c):(r&&r(),Promise.resolve())}dir(i){var d,f;if(i||(i=this.resolvedLanguage||(((d=this.languages)==null?void 0:d.length)>0?this.languages[0]:this.language)),!i)return"rtl";const r=["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"],c=((f=this.services)==null?void 0:f.languageUtils)||new Oh(Uh());return r.indexOf(c.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Dl(i,r)}cloneInstance(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oi;const c=i.forkResourceStore;c&&delete i.forkResourceStore;const d={...this.options,...i,isClone:!0},f=new Dl(d);if((i.debug!==void 0||i.prefix!==void 0)&&(f.logger=f.logger.clone(i)),["store","services","language"].forEach(p=>{f[p]=this[p]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},c){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},Object.keys(g[h]).reduce((y,j)=>(y[j]={...g[h][j]},y),{})),{});f.store=new Th(p,d),f.services.resourceStore=f.store}return f.translator=new gi(f.services,d),f.translator.on("*",function(p){for(var g=arguments.length,h=new Array(g>1?g-1:0),y=1;y<g;y++)h[y-1]=arguments[y];f.emit(p,...h)}),f.init(d,r),f.translator.options=d,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const xt=Dl.createInstance();xt.createInstance=Dl.createInstance;xt.createInstance;xt.dir;xt.init;xt.loadResources;xt.reloadResources;xt.use;xt.changeLanguage;xt.getFixedT;xt.t;xt.exists;xt.setDefaultNamespace;xt.hasLoadedNamespace;xt.loadNamespaces;xt.loadLanguages;const{slice:X1,forEach:Q1}=[];function F1(s){return Q1.call(X1.call(arguments,1),i=>{if(i)for(const r in i)s[r]===void 0&&(s[r]=i[r])}),s}function Z1(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(r=>r.test(s))}const _h=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,J1=function(s,i){const c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},d=encodeURIComponent(i);let f=`${s}=${d}`;if(c.maxAge>0){const m=c.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");f+=`; Max-Age=${Math.floor(m)}`}if(c.domain){if(!_h.test(c.domain))throw new TypeError("option domain is invalid");f+=`; Domain=${c.domain}`}if(c.path){if(!_h.test(c.path))throw new TypeError("option path is invalid");f+=`; Path=${c.path}`}if(c.expires){if(typeof c.expires.toUTCString!="function")throw new TypeError("option expires is invalid");f+=`; Expires=${c.expires.toUTCString()}`}if(c.httpOnly&&(f+="; HttpOnly"),c.secure&&(f+="; Secure"),c.sameSite)switch(typeof c.sameSite=="string"?c.sameSite.toLowerCase():c.sameSite){case!0:f+="; SameSite=Strict";break;case"lax":f+="; SameSite=Lax";break;case"strict":f+="; SameSite=Strict";break;case"none":f+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return c.partitioned&&(f+="; Partitioned"),f},Hh={create(s,i,r,c){let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(d.expires=new Date,d.expires.setTime(d.expires.getTime()+r*60*1e3)),c&&(d.domain=c),document.cookie=J1(s,i,d)},read(s){const i=`${s}=`,r=document.cookie.split(";");for(let c=0;c<r.length;c++){let d=r[c];for(;d.charAt(0)===" ";)d=d.substring(1,d.length);if(d.indexOf(i)===0)return d.substring(i.length,d.length)}return null},remove(s,i){this.create(s,"",-1,i)}};var I1={name:"cookie",lookup(s){let{lookupCookie:i}=s;if(i&&typeof document<"u")return Hh.read(i)||void 0},cacheUserLanguage(s,i){let{lookupCookie:r,cookieMinutes:c,cookieDomain:d,cookieOptions:f}=i;r&&typeof document<"u"&&Hh.create(r,s,c,d,f)}},W1={name:"querystring",lookup(s){var c;let{lookupQuerystring:i}=s,r;if(typeof window<"u"){let{search:d}=window.location;!window.location.search&&((c=window.location.hash)==null?void 0:c.indexOf("?"))>-1&&(d=window.location.hash.substring(window.location.hash.indexOf("?")));const m=d.substring(1).split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===i&&(r=m[p].substring(g+1))}}return r}},e2={name:"hash",lookup(s){var d;let{lookupHash:i,lookupFromHashIndex:r}=s,c;if(typeof window<"u"){const{hash:f}=window.location;if(f&&f.length>2){const m=f.substring(1);if(i){const p=m.split("&");for(let g=0;g<p.length;g++){const h=p[g].indexOf("=");h>0&&p[g].substring(0,h)===i&&(c=p[g].substring(h+1))}}if(c)return c;if(!c&&r>-1){const p=f.match(/\/([a-zA-Z-]*)/g);return Array.isArray(p)?(d=p[typeof r=="number"?r:0])==null?void 0:d.replace("/",""):void 0}}}return c}};let ws=null;const Bh=()=>{if(ws!==null)return ws;try{if(ws=typeof window<"u"&&window.localStorage!==null,!ws)return!1;const s="i18next.translate.boo";window.localStorage.setItem(s,"foo"),window.localStorage.removeItem(s)}catch{ws=!1}return ws};var t2={name:"localStorage",lookup(s){let{lookupLocalStorage:i}=s;if(i&&Bh())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(s,i){let{lookupLocalStorage:r}=i;r&&Bh()&&window.localStorage.setItem(r,s)}};let js=null;const Vh=()=>{if(js!==null)return js;try{if(js=typeof window<"u"&&window.sessionStorage!==null,!js)return!1;const s="i18next.translate.boo";window.sessionStorage.setItem(s,"foo"),window.sessionStorage.removeItem(s)}catch{js=!1}return js};var a2={name:"sessionStorage",lookup(s){let{lookupSessionStorage:i}=s;if(i&&Vh())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(s,i){let{lookupSessionStorage:r}=i;r&&Vh()&&window.sessionStorage.setItem(r,s)}},n2={name:"navigator",lookup(s){const i=[];if(typeof navigator<"u"){const{languages:r,userLanguage:c,language:d}=navigator;if(r)for(let f=0;f<r.length;f++)i.push(r[f]);c&&i.push(c),d&&i.push(d)}return i.length>0?i:void 0}},s2={name:"htmlTag",lookup(s){let{htmlTag:i}=s,r;const c=i||(typeof document<"u"?document.documentElement:null);return c&&typeof c.getAttribute=="function"&&(r=c.getAttribute("lang")),r}},l2={name:"path",lookup(s){var d;let{lookupFromPathIndex:i}=s;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(d=r[typeof i=="number"?i:0])==null?void 0:d.replace("/",""):void 0}},r2={name:"subdomain",lookup(s){var d,f;let{lookupFromSubdomainIndex:i}=s;const r=typeof i=="number"?i+1:1,c=typeof window<"u"&&((f=(d=window.location)==null?void 0:d.hostname)==null?void 0:f.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(c)return c[r]}};let qg=!1;try{document.cookie,qg=!0}catch{}const Gg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];qg||Gg.splice(1,1);const i2=()=>({order:Gg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:s=>s});class $g{constructor(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(i,r)}init(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=i,this.options=F1(r,this.options||{},i2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=d=>d.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=c,this.addDetector(I1),this.addDetector(W1),this.addDetector(t2),this.addDetector(a2),this.addDetector(n2),this.addDetector(s2),this.addDetector(l2),this.addDetector(r2),this.addDetector(e2)}addDetector(i){return this.detectors[i.name]=i,this}detect(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return i.forEach(c=>{if(this.detectors[c]){let d=this.detectors[c].lookup(this.options);d&&typeof d=="string"&&(d=[d]),d&&(r=r.concat(d))}}),r=r.filter(c=>c!=null&&!Z1(c)).map(c=>this.options.convertDetectedLanguage(c)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(i)>-1||r.forEach(c=>{this.detectors[c]&&this.detectors[c].cacheUserLanguage(i,this.options)}))}}$g.type="languageDetector";const o2={title:"MCP Hub 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:"MCP Hub"},c2={title:"About",versionInfo:"MCP Hub 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..."},u2={viewProfile:"View profile",userCenter:"User Center"},d2={label:"Sponsor",title:"Support the Project",rewardAlt:"Reward QR Code",supportMessage:"Support the development of MCP Hub by buying me a coffee!",supportButton:"Support on Ko-fi"},f2={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},m2={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},h2={title:"Theme",light:"Light",dark:"Dark",system:"System"},g2={login:"Login",loginTitle:"Login to MCP Hub",username:"Username",password:"Password",loggingIn:"Logging in...",emptyFields:"Username and password cannot be empty",loginFailed:"Login failed, please check your username and password",loginError:"An error occurred during login",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"},p2={addServer:"Add Server",add:"Add",edit:"Edit",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",name:"Server Name",url:"Server URL",apiKey:"API Key",save:"Save",cancel:"Cancel",invalidConfig:"Could not find configuration data for {{serverName}}",addError:"Failed to add server",editError:"Failed to edit server {{serverName}}",deleteError:"Failed to delete server {{serverName}}",updateError:"Failed to update server",editTitle:"Edit Server: {{serverName}}",type:"Server Type",command:"Command",arguments:"Arguments",envVars:"Environment Variables",headers:"HTTP Headers",key:"key",value:"value",enabled:"Enabled",enable:"Enable",disable:"Disable",requestOptions:"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",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",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",oauth2Config:"OAuth 2.0 Configuration",oauth2Token:"Access Token",openIdConnectConfig:"OpenID Connect Configuration",openIdConnectUrl:"Discovery URL",openIdConnectToken:"ID Token"}},x2={online:"Online",offline:"Offline",connecting:"Connecting"},y2={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"},b2={processing:"Processing...",save:"Save",cancel:"Cancel",refresh:"Refresh",create:"Create",creating:"Creating...",update:"Update",updating:"Updating...",submitting:"Submitting...",delete:"Delete",remove:"Remove",copy:"Copy",copySuccess:"Copied to clipboard",copyFailed:"Copy failed",close:"Close",confirm:"Confirm"},v2={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",logs:"Logs"},w2={dashboard:{title:"Dashboard",totalServers:"Total",onlineServers:"Online",offlineServers:"Offline",connectingServers:"Connecting",recentServers:"Recent Servers"},servers:{title:"Servers Management"},groups:{title:"Group Management"},users:{title:"User Management"},settings:{title:"Settings",language:"Language",account:"Account Settings",password:"Change Password",appearance:"Appearance",routeConfig:"Security",installConfig:"Installation",smartRouting:"Smart Routing"},market:{title:"Server Market - (Data from mcpm.sh)"},logs:{title:"System Logs"}},j2={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"},S2={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"},N2={title:"Server Market",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"},C2={run:"Run",running:"Running...",runTool:"Run Tool",cancel:"Cancel",noDescription:"No description available",inputSchema:"Input Schema:",runToolWithName:"Run Tool: {{name}}",execution:"Tool Execution",successful:"Successful",failed:"Failed",result:"Result:",error:"Error",errorDetails:"Error Details:",noContent:"Tool executed successfully but returned no content.",unknownError:"Unknown error occurred",jsonResponse:"JSON Response:",toolResult:"Tool result",noParameters:"This tool does not require any parameters.",selectOption:"Select an option",enterValue:"Enter {{type}} value",enabled:"Enabled",enableSuccess:"Tool {{name}} enabled successfully",disableSuccess:"Tool {{name}} disabled successfully",toggleFailed:"Failed to toggle tool status",parameters:"Tool Parameters",formMode:"Form Mode",jsonMode:"JSON Mode",jsonConfiguration:"JSON Configuration",invalidJsonFormat:"Invalid JSON format",fixJsonBeforeSwitching:"Please fix JSON format before switching to form mode",item:"Item {{index}}",addItem:"Add {{key}} item",enterKey:"Enter {{key}}"},E2={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 requests",bearerAuthKey:"Bearer Authentication Key",bearerAuthKeyDescription:"The authentication key that will be required in the Bearer token",bearerAuthKeyPlaceholder:"Enter bearer authentication key",skipAuth:"Skip Authentication",skipAuthDescription:"Bypass login requirement for frontend and API access (DEFAULT OFF for security)",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/",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",openaiApiBaseUrl:"OpenAI API Base URL",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API Key",openaiApiKeyPlaceholder:"Enter OpenAI API key",openaiApiEmbeddingModel:"OpenAI Embedding Model",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"Smart routing configuration updated successfully",smartRoutingRequiredFields:"Database URL and OpenAI API Key are required to enable smart routing",smartRoutingValidationError:"Please fill in the required fields before enabling Smart Routing: {{fields}}"},k2={upload:"Upload",uploadTitle:"Upload DXT Extension",dropFileHere:"Drop your .dxt file here",orClickToSelect:"or click to select from your computer",invalidFileType:"Please select a valid .dxt file",noFileSelected:"Please select a .dxt file to upload",uploading:"Uploading...",uploadFailed:"Failed to upload DXT file",installServer:"Install MCP Server from DXT",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 DXT",serverExistsTitle:"Server Already Exists",serverExistsConfirm:"Server '{{serverName}}' already exists. Do you want to override it with the new version?",override:"Override"},T2={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",adminRole:"Administrator",admin:"Admin",user:"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."},A2={app:o2,about:c2,profile:u2,sponsor:d2,wechat:f2,discord:m2,theme:h2,auth:g2,server:p2,status:x2,errors:y2,common:b2,nav:v2,pages:w2,logs:j2,groups:S2,market:N2,tool:C2,settings:E2,dxt:k2,users:T2},R2={title:"MCP Hub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCP Hub"},O2={title:"关于",versionInfo:"MCP Hub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},M2={viewProfile:"查看个人中心",userCenter:"个人中心"},z2={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCP Hub 的开发!",supportButton:"在 Ko-fi 上支持"},D2={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},U2={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},L2={title:"主题",light:"浅色",dark:"深色",system:"系统"},_2={login:"登录",loginTitle:"登录 MCP Hub",username:"用户名",password:"密码",loggingIn:"登录中...",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败"},H2={addServer:"添加服务器",add:"添加",edit:"编辑",delete:"删除",confirmDelete:"您确定要删除此服务器吗?",deleteWarning:"删除服务器 '{{name}}' 将会移除该服务器及其所有数据。此操作无法撤销。",status:"状态",tools:"工具",name:"服务器名称",url:"服务器 URL",apiKey:"API 密钥",save:"保存",cancel:"取消",addError:"添加服务器失败",editError:"编辑服务器 {{serverName}} 失败",invalidConfig:"无法找到 {{serverName}} 的配置数据",deleteError:"删除服务器 {{serverName}} 失败",updateError:"更新服务器失败",editTitle:"编辑服务器: {{serverName}}",type:"服务器类型",command:"命令",arguments:"参数",envVars:"环境变量",headers:"HTTP 请求头",key:"键",value:"值",enabled:"已启用",enable:"启用",disable:"禁用",requestOptions:"配置",timeout:"请求超时",timeoutDescription:"请求超时时间(毫秒)",maxTotalTimeout:"最大总超时",maxTotalTimeoutDescription:"无论是否有进度通知的最大总超时时间(毫秒)",resetTimeoutOnProgress:"收到进度通知时重置超时",resetTimeoutOnProgressDescription:"适用于发送周期性进度更新的长时间运行操作",remove:"移除",toggleError:"切换服务器 {{serverName}} 状态失败",alreadyExists:"服务器 {{serverName}} 已经存在",invalidData:"提供的服务器数据无效",notFound:"找不到服务器 {{serverName}}",namePlaceholder:"请输入服务器名称",urlPlaceholder:"请输入服务器URL",commandPlaceholder:"请输入命令",argumentsPlaceholder:"请输入参数",errorDetails:"错误详情",viewErrorDetails:"查看错误详情",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:"凭据",oauth2Config:"OAuth 2.0 配置",oauth2Token:"访问令牌",openIdConnectConfig:"OpenID Connect 配置",openIdConnectUrl:"发现 URL",openIdConnectToken:"ID 令牌"}},B2={online:"在线",offline:"离线",connecting:"连接中"},V2={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},q2={processing:"处理中...",save:"保存",cancel:"取消",refresh:"刷新",create:"创建",creating:"创建中...",update:"更新",updating:"更新中...",submitting:"提交中...",delete:"删除",remove:"移除",copy:"复制",copySuccess:"已复制到剪贴板",copyFailed:"复制失败",close:"关闭",confirm:"确认"},G2={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",logs:"日志"},$2={dashboard:{title:"仪表盘",totalServers:"总数",onlineServers:"在线",offlineServers:"离线",connectingServers:"连接中",recentServers:"最近的服务器"},servers:{title:"服务器管理"},settings:{title:"设置",language:"语言",account:"账户设置",password:"修改密码",appearance:"外观",routeConfig:"安全配置",installConfig:"安装",smartRouting:"智能路由"},groups:{title:"分组管理"},users:{title:"用户管理"},market:{title:"服务器市场 - (数据来源于 mcpm.sh)"},logs:{title:"系统日志"}},K2={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},Y2={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}} 台服务器"},P2={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:"确认并安装"},X2={run:"运行",running:"运行中...",runTool:"运行",cancel:"取消",noDescription:"无描述信息",inputSchema:"输入模式:",runToolWithName:"运行工具:{{name}}",execution:"工具执行",successful:"成功",failed:"失败",result:"结果:",error:"错误",errorDetails:"错误详情:",noContent:"工具执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",toolResult:"工具结果",noParameters:"此工具不需要任何参数。",selectOption:"选择一个选项",enterValue:"输入{{type}}值",enabled:"已启用",enableSuccess:"工具 {{name}} 启用成功",disableSuccess:"工具 {{name}} 禁用成功",toggleFailed:"切换工具状态失败",parameters:"工具参数",formMode:"表单模式",jsonMode:"JSON 模式",jsonConfiguration:"JSON 配置",invalidJsonFormat:"无效的 JSON 格式",fixJsonBeforeSwitching:"请修复 JSON 格式后再切换到表单模式",item:"项目 {{index}}",addItem:"添加 {{key}} 项目",enterKey:"输入 {{key}}"},Q2={enableGlobalRoute:"启用全局路由",enableGlobalRouteDescription:"允许不指定组 ID 就连接到 /sse 端点",enableGroupNameRoute:"启用组名路由",enableGroupNameRouteDescription:"允许使用组名而不仅仅是组 ID 连接到 /sse 端点",enableBearerAuth:"启用 Bearer 认证",enableBearerAuthDescription:"对 MCP 请求启用 Bearer 令牌认证",bearerAuthKey:"Bearer 认证密钥",bearerAuthKeyDescription:"Bearer 令牌中需要携带的认证密钥",bearerAuthKeyPlaceholder:"请输入 Bearer 认证密钥",skipAuth:"免登录开关",skipAuthDescription:"跳过前端和 API 访问的登录要求(默认关闭确保安全性)",pythonIndexUrl:"Python 包仓库地址",pythonIndexUrlDescription:"设置 UV_DEFAULT_INDEX 环境变量,用于 Python 包安装",pythonIndexUrlPlaceholder:"例如: https://mirrors.aliyun.com/pypi/simple",npmRegistry:"NPM 仓库地址",npmRegistryDescription:"设置 npm_config_registry 环境变量,用于 NPM 包安装",npmRegistryPlaceholder:"例如: https://registry.npmmirror.com/",installConfig:"安装配置",systemConfigUpdated:"系统配置更新成功",enableSmartRouting:"启用智能路由",enableSmartRoutingDescription:"开启智能路由功能,根据输入自动搜索最合适的工具(使用 $smart 分组)",dbUrl:"PostgreSQL 连接地址(必须支持 pgvector)",dbUrlPlaceholder:"例如: postgresql://user:password@localhost:5432/dbname",openaiApiBaseUrl:"OpenAI API 基础地址",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API 密钥",openaiApiKeyDescription:"用于访问 OpenAI API 的密钥",openaiApiKeyPlaceholder:"请输入 OpenAI API 密钥",openaiApiEmbeddingModel:"OpenAI 嵌入模型",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"智能路由配置更新成功",smartRoutingRequiredFields:"启用智能路由需要填写数据库连接地址和 OpenAI API 密钥",smartRoutingValidationError:"启用智能路由前请先填写必要字段:{{fields}}"},F2={upload:"上传",uploadTitle:"上传 DXT 扩展",dropFileHere:"将 .dxt 文件拖拽到此处",orClickToSelect:"或点击从计算机选择",invalidFileType:"请选择有效的 .dxt 文件",noFileSelected:"请选择要上传的 .dxt 文件",uploading:"上传中...",uploadFailed:"上传 DXT 文件失败",installServer:"从 DXT 安装 MCP 服务器",extensionInfo:"扩展信息",name:"名称",version:"版本",description:"描述",author:"作者",tools:"工具",serverName:"服务器名称",serverNamePlaceholder:"为此服务器输入名称",install:"安装",installing:"安装中...",installFailed:"从 DXT 安装服务器失败",serverExistsTitle:"服务器已存在",serverExistsConfirm:"服务器 '{{serverName}}' 已存在。是否要用新版本覆盖它?",override:"覆盖"},Z2={add:"添加",addNew:"添加新用户",edit:"编辑用户",delete:"删除用户",create:"创建",update:"用户",username:"用户名",password:"密码",newPassword:"新密码",confirmPassword:"确认密码",adminRole:"管理员",admin:"管理员",user:"用户",permissions:"权限",adminPermissions:"完全系统访问权限",userPermissions:"受限访问权限",currentUser:"当前用户",noUsers:"没有找到用户",adminRequired:"需要管理员权限才能管理用户",usernameRequired:"用户名是必需的",passwordRequired:"密码是必需的",passwordTooShort:"密码至少需要6个字符",passwordMismatch:"密码不匹配",usernamePlaceholder:"输入用户名",passwordPlaceholder:"输入密码",newPasswordPlaceholder:"留空保持当前密码",confirmPasswordPlaceholder:"确认新密码",createError:"创建用户失败",updateError:"更新用户失败",deleteError:"删除用户失败",statsError:"获取用户统计失败",deleteConfirmation:"您确定要删除用户 '{{username}}' 吗?此操作无法撤消。",confirmDelete:"删除用户",deleteWarning:"您确定要删除用户 '{{username}}' 吗?此操作无法撤消。"},J2={app:R2,about:O2,profile:M2,sponsor:z2,wechat:D2,discord:U2,theme:L2,auth:_2,server:H2,status:B2,errors:V2,common:q2,nav:G2,pages:$2,logs:K2,groups:Y2,market:P2,tool:X2,settings:Q2,dxt:F2,users:Z2};xt.use($g).use(Nv).init({resources:{en:{translation:A2},zh:{translation:J2}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});async function I2(){try{console.log("Loading runtime configuration...");const s=await Hy();console.log("Runtime configuration loaded:",s),window.__MCPHUB_CONFIG__=s,ih.createRoot(document.getElementById("root")).render(l.jsx(Gc.StrictMode,{children:l.jsx(Sh,{})}))}catch(s){console.error("Failed to initialize app:",s),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},ih.createRoot(document.getElementById("root")).render(l.jsx(Gc.StrictMode,{children:l.jsx(Sh,{})}))}}I2();
|
|
187
|
+
//# sourceMappingURL=index-BXCRwJIg.js.map
|