Files
mission-control-v2/frontend/dist/assets/index-CJm59bcL.js
T

381 lines
405 KiB
JavaScript

function Km(o,d){for(var a=0;a<d.length;a++){const c=d[a];if(typeof c!="string"&&!Array.isArray(c)){for(const f in c)if(f!=="default"&&!(f in o)){const m=Object.getOwnPropertyDescriptor(c,f);m&&Object.defineProperty(o,f,m.get?m:{enumerable:!0,get:()=>c[f]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}(function(){const d=document.createElement("link").relList;if(d&&d.supports&&d.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function a(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(f){if(f.ep)return;f.ep=!0;const m=a(f);fetch(f.href,m)}})();function tf(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Ya={exports:{}},ws={},Ja={exports:{}},je={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var yu;function Qm(){if(yu)return je;yu=1;var o=Symbol.for("react.element"),d=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),h=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),M=Symbol.iterator;function A(j){return j===null||typeof j!="object"?null:(j=M&&j[M]||j["@@iterator"],typeof j=="function"?j:null)}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,S={};function C(j,v,B){this.props=j,this.context=v,this.refs=S,this.updater=B||I}C.prototype.isReactComponent={},C.prototype.setState=function(j,v){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,v,"setState")},C.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function _(){}_.prototype=C.prototype;function L(j,v,B){this.props=j,this.context=v,this.refs=S,this.updater=B||I}var Z=L.prototype=new _;Z.constructor=L,O(Z,C.prototype),Z.isPureReactComponent=!0;var Y=Array.isArray,H=Object.prototype.hasOwnProperty,T={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function ne(j,v,B){var J,K={},oe=null,pe=null;if(v!=null)for(J in v.ref!==void 0&&(pe=v.ref),v.key!==void 0&&(oe=""+v.key),v)H.call(v,J)&&!F.hasOwnProperty(J)&&(K[J]=v[J]);var me=arguments.length-2;if(me===1)K.children=B;else if(1<me){for(var w=Array(me),Q=0;Q<me;Q++)w[Q]=arguments[Q+2];K.children=w}if(j&&j.defaultProps)for(J in me=j.defaultProps,me)K[J]===void 0&&(K[J]=me[J]);return{$$typeof:o,type:j,key:oe,ref:pe,props:K,_owner:T.current}}function se(j,v){return{$$typeof:o,type:j.type,key:v,ref:j.ref,props:j.props,_owner:j._owner}}function X(j){return typeof j=="object"&&j!==null&&j.$$typeof===o}function ye(j){var v={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(B){return v[B]})}var ce=/\/+/g;function Pe(j,v){return typeof j=="object"&&j!==null&&j.key!=null?ye(""+j.key):v.toString(36)}function _e(j,v,B,J,K){var oe=typeof j;(oe==="undefined"||oe==="boolean")&&(j=null);var pe=!1;if(j===null)pe=!0;else switch(oe){case"string":case"number":pe=!0;break;case"object":switch(j.$$typeof){case o:case d:pe=!0}}if(pe)return pe=j,K=K(pe),j=J===""?"."+Pe(pe,0):J,Y(K)?(B="",j!=null&&(B=j.replace(ce,"$&/")+"/"),_e(K,v,B,"",function(Q){return Q})):K!=null&&(X(K)&&(K=se(K,B+(!K.key||pe&&pe.key===K.key?"":(""+K.key).replace(ce,"$&/")+"/")+j)),v.push(K)),1;if(pe=0,J=J===""?".":J+":",Y(j))for(var me=0;me<j.length;me++){oe=j[me];var w=J+Pe(oe,me);pe+=_e(oe,v,B,w,K)}else if(w=A(j),typeof w=="function")for(j=w.call(j),me=0;!(oe=j.next()).done;)oe=oe.value,w=J+Pe(oe,me++),pe+=_e(oe,v,B,w,K);else if(oe==="object")throw v=String(j),Error("Objects are not valid as a React child (found: "+(v==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":v)+"). If you meant to render a collection of children, use an array instead.");return pe}function Me(j,v,B){if(j==null)return j;var J=[],K=0;return _e(j,J,"","",function(oe){return v.call(B,oe,K++)}),J}function Ne(j){if(j._status===-1){var v=j._result;v=v(),v.then(function(B){(j._status===0||j._status===-1)&&(j._status=1,j._result=B)},function(B){(j._status===0||j._status===-1)&&(j._status=2,j._result=B)}),j._status===-1&&(j._status=0,j._result=v)}if(j._status===1)return j._result.default;throw j._result}var ke={current:null},W={transition:null},ae={ReactCurrentDispatcher:ke,ReactCurrentBatchConfig:W,ReactCurrentOwner:T};function G(){throw Error("act(...) is not supported in production builds of React.")}return je.Children={map:Me,forEach:function(j,v,B){Me(j,function(){v.apply(this,arguments)},B)},count:function(j){var v=0;return Me(j,function(){v++}),v},toArray:function(j){return Me(j,function(v){return v})||[]},only:function(j){if(!X(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},je.Component=C,je.Fragment=a,je.Profiler=f,je.PureComponent=L,je.StrictMode=c,je.Suspense=E,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ae,je.act=G,je.cloneElement=function(j,v,B){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var J=O({},j.props),K=j.key,oe=j.ref,pe=j._owner;if(v!=null){if(v.ref!==void 0&&(oe=v.ref,pe=T.current),v.key!==void 0&&(K=""+v.key),j.type&&j.type.defaultProps)var me=j.type.defaultProps;for(w in v)H.call(v,w)&&!F.hasOwnProperty(w)&&(J[w]=v[w]===void 0&&me!==void 0?me[w]:v[w])}var w=arguments.length-2;if(w===1)J.children=B;else if(1<w){me=Array(w);for(var Q=0;Q<w;Q++)me[Q]=arguments[Q+2];J.children=me}return{$$typeof:o,type:j.type,key:K,ref:oe,props:J,_owner:pe}},je.createContext=function(j){return j={$$typeof:h,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:m,_context:j},j.Consumer=j},je.createElement=ne,je.createFactory=function(j){var v=ne.bind(null,j);return v.type=j,v},je.createRef=function(){return{current:null}},je.forwardRef=function(j){return{$$typeof:x,render:j}},je.isValidElement=X,je.lazy=function(j){return{$$typeof:k,_payload:{_status:-1,_result:j},_init:Ne}},je.memo=function(j,v){return{$$typeof:b,type:j,compare:v===void 0?null:v}},je.startTransition=function(j){var v=W.transition;W.transition={};try{j()}finally{W.transition=v}},je.unstable_act=G,je.useCallback=function(j,v){return ke.current.useCallback(j,v)},je.useContext=function(j){return ke.current.useContext(j)},je.useDebugValue=function(){},je.useDeferredValue=function(j){return ke.current.useDeferredValue(j)},je.useEffect=function(j,v){return ke.current.useEffect(j,v)},je.useId=function(){return ke.current.useId()},je.useImperativeHandle=function(j,v,B){return ke.current.useImperativeHandle(j,v,B)},je.useInsertionEffect=function(j,v){return ke.current.useInsertionEffect(j,v)},je.useLayoutEffect=function(j,v){return ke.current.useLayoutEffect(j,v)},je.useMemo=function(j,v){return ke.current.useMemo(j,v)},je.useReducer=function(j,v,B){return ke.current.useReducer(j,v,B)},je.useRef=function(j){return ke.current.useRef(j)},je.useState=function(j){return ke.current.useState(j)},je.useSyncExternalStore=function(j,v,B){return ke.current.useSyncExternalStore(j,v,B)},je.useTransition=function(){return ke.current.useTransition()},je.version="18.3.1",je}var bu;function Ci(){return bu||(bu=1,Ja.exports=Qm()),Ja.exports}/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var wu;function qm(){if(wu)return ws;wu=1;var o=Ci(),d=Symbol.for("react.element"),a=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,f=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function h(x,E,b){var k,M={},A=null,I=null;b!==void 0&&(A=""+b),E.key!==void 0&&(A=""+E.key),E.ref!==void 0&&(I=E.ref);for(k in E)c.call(E,k)&&!m.hasOwnProperty(k)&&(M[k]=E[k]);if(x&&x.defaultProps)for(k in E=x.defaultProps,E)M[k]===void 0&&(M[k]=E[k]);return{$$typeof:d,type:x,key:A,ref:I,props:M,_owner:f.current}}return ws.Fragment=a,ws.jsx=h,ws.jsxs=h,ws}var ju;function Zm(){return ju||(ju=1,Ya.exports=qm()),Ya.exports}var n=Zm(),p=Ci();const rf=tf(p),Ei=Km({__proto__:null,default:rf},[p]);var $o={},Xa={exports:{}},ft={},ei={exports:{}},ti={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ku;function Ym(){return ku||(ku=1,(function(o){function d(W,ae){var G=W.length;W.push(ae);e:for(;0<G;){var j=G-1>>>1,v=W[j];if(0<f(v,ae))W[j]=ae,W[G]=v,G=j;else break e}}function a(W){return W.length===0?null:W[0]}function c(W){if(W.length===0)return null;var ae=W[0],G=W.pop();if(G!==ae){W[0]=G;e:for(var j=0,v=W.length,B=v>>>1;j<B;){var J=2*(j+1)-1,K=W[J],oe=J+1,pe=W[oe];if(0>f(K,G))oe<v&&0>f(pe,K)?(W[j]=pe,W[oe]=G,j=oe):(W[j]=K,W[J]=G,j=J);else if(oe<v&&0>f(pe,G))W[j]=pe,W[oe]=G,j=oe;else break e}}return ae}function f(W,ae){var G=W.sortIndex-ae.sortIndex;return G!==0?G:W.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;o.unstable_now=function(){return m.now()}}else{var h=Date,x=h.now();o.unstable_now=function(){return h.now()-x}}var E=[],b=[],k=1,M=null,A=3,I=!1,O=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Z(W){for(var ae=a(b);ae!==null;){if(ae.callback===null)c(b);else if(ae.startTime<=W)c(b),ae.sortIndex=ae.expirationTime,d(E,ae);else break;ae=a(b)}}function Y(W){if(S=!1,Z(W),!O)if(a(E)!==null)O=!0,Ne(H);else{var ae=a(b);ae!==null&&ke(Y,ae.startTime-W)}}function H(W,ae){O=!1,S&&(S=!1,_(ne),ne=-1),I=!0;var G=A;try{for(Z(ae),M=a(E);M!==null&&(!(M.expirationTime>ae)||W&&!ye());){var j=M.callback;if(typeof j=="function"){M.callback=null,A=M.priorityLevel;var v=j(M.expirationTime<=ae);ae=o.unstable_now(),typeof v=="function"?M.callback=v:M===a(E)&&c(E),Z(ae)}else c(E);M=a(E)}if(M!==null)var B=!0;else{var J=a(b);J!==null&&ke(Y,J.startTime-ae),B=!1}return B}finally{M=null,A=G,I=!1}}var T=!1,F=null,ne=-1,se=5,X=-1;function ye(){return!(o.unstable_now()-X<se)}function ce(){if(F!==null){var W=o.unstable_now();X=W;var ae=!0;try{ae=F(!0,W)}finally{ae?Pe():(T=!1,F=null)}}else T=!1}var Pe;if(typeof L=="function")Pe=function(){L(ce)};else if(typeof MessageChannel<"u"){var _e=new MessageChannel,Me=_e.port2;_e.port1.onmessage=ce,Pe=function(){Me.postMessage(null)}}else Pe=function(){C(ce,0)};function Ne(W){F=W,T||(T=!0,Pe())}function ke(W,ae){ne=C(function(){W(o.unstable_now())},ae)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(W){W.callback=null},o.unstable_continueExecution=function(){O||I||(O=!0,Ne(H))},o.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<W?Math.floor(1e3/W):5},o.unstable_getCurrentPriorityLevel=function(){return A},o.unstable_getFirstCallbackNode=function(){return a(E)},o.unstable_next=function(W){switch(A){case 1:case 2:case 3:var ae=3;break;default:ae=A}var G=A;A=ae;try{return W()}finally{A=G}},o.unstable_pauseExecution=function(){},o.unstable_requestPaint=function(){},o.unstable_runWithPriority=function(W,ae){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var G=A;A=W;try{return ae()}finally{A=G}},o.unstable_scheduleCallback=function(W,ae,G){var j=o.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?j+G:j):G=j,W){case 1:var v=-1;break;case 2:v=250;break;case 5:v=1073741823;break;case 4:v=1e4;break;default:v=5e3}return v=G+v,W={id:k++,callback:ae,priorityLevel:W,startTime:G,expirationTime:v,sortIndex:-1},G>j?(W.sortIndex=G,d(b,W),a(E)===null&&W===a(b)&&(S?(_(ne),ne=-1):S=!0,ke(Y,G-j))):(W.sortIndex=v,d(E,W),O||I||(O=!0,Ne(H))),W},o.unstable_shouldYield=ye,o.unstable_wrapCallback=function(W){var ae=A;return function(){var G=A;A=ae;try{return W.apply(this,arguments)}finally{A=G}}}})(ti)),ti}var Nu;function Jm(){return Nu||(Nu=1,ei.exports=Ym()),ei.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Su;function Xm(){if(Su)return ft;Su=1;var o=Ci(),d=Jm();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var c=new Set,f={};function m(e,t){h(e,t),h(e+"Capture",t)}function h(e,t){for(f[e]=t,e=0;e<t.length;e++)c.add(t[e])}var x=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),E=Object.prototype.hasOwnProperty,b=/^[: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]*$/,k={},M={};function A(e){return E.call(M,e)?!0:E.call(k,e)?!1:b.test(e)?M[e]=!0:(k[e]=!0,!1)}function I(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O(e,t,r,s){if(t===null||typeof t>"u"||I(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function S(e,t,r,s,l,i,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=u}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){C[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];C[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){C[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){C[e]=new S(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){C[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){C[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){C[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){C[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){C[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function L(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_,L);C[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_,L);C[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_,L);C[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){C[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){C[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function Z(e,t,r,s){var l=C.hasOwnProperty(t)?C[t]:null;(l!==null?l.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(O(t,r,l,s)&&(r=null),s||l===null?A(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):l.mustUseProperty?e[l.propertyName]=r===null?l.type===3?!1:"":r:(t=l.attributeName,s=l.attributeNamespace,r===null?e.removeAttribute(t):(l=l.type,r=l===3||l===4&&r===!0?"":""+r,s?e.setAttributeNS(s,t,r):e.setAttribute(t,r))))}var Y=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,H=Symbol.for("react.element"),T=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),ye=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),Pe=Symbol.for("react.suspense"),_e=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),Ne=Symbol.for("react.lazy"),ke=Symbol.for("react.offscreen"),W=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var G=Object.assign,j;function v(e){if(j===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return`
`+j+e}var B=!1;function J(e,t){if(!e||B)return"";B=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(D){var s=D}Reflect.construct(e,[],t)}else{try{t.call()}catch(D){s=D}e.call(t.prototype)}else{try{throw Error()}catch(D){s=D}e()}}catch(D){if(D&&s&&typeof D.stack=="string"){for(var l=D.stack.split(`
`),i=s.stack.split(`
`),u=l.length-1,g=i.length-1;1<=u&&0<=g&&l[u]!==i[g];)g--;for(;1<=u&&0<=g;u--,g--)if(l[u]!==i[g]){if(u!==1||g!==1)do if(u--,g--,0>g||l[u]!==i[g]){var y=`
`+l[u].replace(" at new "," at ");return e.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",e.displayName)),y}while(1<=u&&0<=g);break}}}finally{B=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?v(e):""}function K(e){switch(e.tag){case 5:return v(e.type);case 16:return v("Lazy");case 13:return v("Suspense");case 19:return v("SuspenseList");case 0:case 2:case 15:return e=J(e.type,!1),e;case 11:return e=J(e.type.render,!1),e;case 1:return e=J(e.type,!0),e;default:return""}}function oe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case F:return"Fragment";case T:return"Portal";case se:return"Profiler";case ne:return"StrictMode";case Pe:return"Suspense";case _e:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ye:return(e.displayName||"Context")+".Consumer";case X:return(e._context.displayName||"Context")+".Provider";case ce:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Me:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case Ne:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function pe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oe(t);case 8:return t===ne?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function me(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function w(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Q(e){var t=w(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var l=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){s=""+u,i.call(this,u)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(u){s=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Le(e){e._valueTracker||(e._valueTracker=Q(e))}function $t(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=w(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function lt(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}}function nt(e,t){var r=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function On(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=me(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Tn(e,t){t=t.checked,t!=null&&Z(e,"checked",t,!1)}function qr(e,t){Tn(e,t);var r=me(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Zr(e,t.type,r):t.hasOwnProperty("defaultValue")&&Zr(e,t.type,me(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function er(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Zr(e,t,r){(t!=="number"||lt(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var tr=Array.isArray;function Ut(e,t,r,s){if(e=e.options,t){t={};for(var l=0;l<r.length;l++)t["$"+r[l]]=!0;for(r=0;r<e.length;r++)l=t.hasOwnProperty("$"+e[r].value),e[r].selected!==l&&(e[r].selected=l),l&&s&&(e[r].defaultSelected=!0)}else{for(r=""+me(r),t=null,l=0;l<e.length;l++){if(e[l].value===r){e[l].selected=!0,s&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Yr(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(a(91));return G({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function In(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(a(92));if(tr(r)){if(1<r.length)throw Error(a(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:me(r)}}function z(e,t){var r=me(t.value),s=me(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),s!=null&&(e.defaultValue=""+s)}function re(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ve(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Se(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ve(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ze,Nt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,s,l){MSApp.execUnsafeLocalFunction(function(){return e(t,r,s,l)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ze=ze||document.createElement("div"),ze.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ze.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bt(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Vt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},il=["Webkit","ms","Moz","O"];Object.keys(Vt).forEach(function(e){il.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vt[t]=Vt[e]})});function Li(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Vt.hasOwnProperty(e)&&Vt[e]?(""+t).trim():t+"px"}function Ai(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,l=Li(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,l):e[r]=l}}var Jf=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dl(e,t){if(t){if(Jf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function cl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 ul=null;function fl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pl=null,Jr=null,Xr=null;function Oi(e){if(e=ls(e)){if(typeof pl!="function")throw Error(a(280));var t=e.stateNode;t&&(t=eo(t),pl(e.stateNode,e.type,t))}}function Ti(e){Jr?Xr?Xr.push(e):Xr=[e]:Jr=e}function Ii(){if(Jr){var e=Jr,t=Xr;if(Xr=Jr=null,Oi(e),t)for(e=0;e<t.length;e++)Oi(t[e])}}function Fi(e,t){return e(t)}function $i(){}var ml=!1;function Ui(e,t,r){if(ml)return e(t,r);ml=!0;try{return Fi(e,t,r)}finally{ml=!1,(Jr!==null||Xr!==null)&&($i(),Ii())}}function Fn(e,t){var r=e.stateNode;if(r===null)return null;var s=eo(r);if(s===null)return null;r=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(a(231,t,typeof r));return r}var hl=!1;if(x)try{var $n={};Object.defineProperty($n,"passive",{get:function(){hl=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{hl=!1}function Xf(e,t,r,s,l,i,u,g,y){var D=Array.prototype.slice.call(arguments,3);try{t.apply(r,D)}catch(U){this.onError(U)}}var Un=!1,zs=null,Ds=!1,xl=null,ep={onError:function(e){Un=!0,zs=e}};function tp(e,t,r,s,l,i,u,g,y){Un=!1,zs=null,Xf.apply(ep,arguments)}function rp(e,t,r,s,l,i,u,g,y){if(tp.apply(this,arguments),Un){if(Un){var D=zs;Un=!1,zs=null}else throw Error(a(198));Ds||(Ds=!0,xl=D)}}function Er(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Bi(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 Vi(e){if(Er(e)!==e)throw Error(a(188))}function np(e){var t=e.alternate;if(!t){if(t=Er(e),t===null)throw Error(a(188));return t!==e?null:e}for(var r=e,s=t;;){var l=r.return;if(l===null)break;var i=l.alternate;if(i===null){if(s=l.return,s!==null){r=s;continue}break}if(l.child===i.child){for(i=l.child;i;){if(i===r)return Vi(l),e;if(i===s)return Vi(l),t;i=i.sibling}throw Error(a(188))}if(r.return!==s.return)r=l,s=i;else{for(var u=!1,g=l.child;g;){if(g===r){u=!0,r=l,s=i;break}if(g===s){u=!0,s=l,r=i;break}g=g.sibling}if(!u){for(g=i.child;g;){if(g===r){u=!0,r=i,s=l;break}if(g===s){u=!0,s=i,r=l;break}g=g.sibling}if(!u)throw Error(a(189))}}if(r.alternate!==s)throw Error(a(190))}if(r.tag!==3)throw Error(a(188));return r.stateNode.current===r?e:t}function Wi(e){return e=np(e),e!==null?Hi(e):null}function Hi(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Hi(e);if(t!==null)return t;e=e.sibling}return null}var Gi=d.unstable_scheduleCallback,Ki=d.unstable_cancelCallback,sp=d.unstable_shouldYield,op=d.unstable_requestPaint,Be=d.unstable_now,lp=d.unstable_getCurrentPriorityLevel,gl=d.unstable_ImmediatePriority,Qi=d.unstable_UserBlockingPriority,Ls=d.unstable_NormalPriority,ap=d.unstable_LowPriority,qi=d.unstable_IdlePriority,As=null,Dt=null;function ip(e){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(As,e,void 0,(e.current.flags&128)===128)}catch{}}var St=Math.clz32?Math.clz32:up,dp=Math.log,cp=Math.LN2;function up(e){return e>>>=0,e===0?32:31-(dp(e)/cp|0)|0}var Os=64,Ts=4194304;function Bn(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Is(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,l=e.suspendedLanes,i=e.pingedLanes,u=r&268435455;if(u!==0){var g=u&~l;g!==0?s=Bn(g):(i&=u,i!==0&&(s=Bn(i)))}else u=r&~l,u!==0?s=Bn(u):i!==0&&(s=Bn(i));if(s===0)return 0;if(t!==0&&t!==s&&(t&l)===0&&(l=s&-s,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if((s&4)!==0&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-St(t),l=1<<r,s|=e[r],t&=~l;return s}function fp(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pp(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes;0<i;){var u=31-St(i),g=1<<u,y=l[u];y===-1?((g&r)===0||(g&s)!==0)&&(l[u]=fp(g,t)):y<=t&&(e.expiredLanes|=g),i&=~g}}function vl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Zi(){var e=Os;return Os<<=1,(Os&4194240)===0&&(Os=64),e}function yl(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Vn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=r}function mp(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<r;){var l=31-St(r),i=1<<l;t[l]=0,s[l]=-1,e[l]=-1,r&=~i}}function bl(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-St(r),l=1<<s;l&t|e[s]&t&&(e[s]|=t),r&=~l}}var Re=0;function Yi(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ji,wl,Xi,ed,td,jl=!1,Fs=[],rr=null,nr=null,sr=null,Wn=new Map,Hn=new Map,or=[],hp="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 submit".split(" ");function rd(e,t){switch(e){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":nr=null;break;case"mouseover":case"mouseout":sr=null;break;case"pointerover":case"pointerout":Wn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hn.delete(t.pointerId)}}function Gn(e,t,r,s,l,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:i,targetContainers:[l]},t!==null&&(t=ls(t),t!==null&&wl(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function xp(e,t,r,s,l){switch(t){case"focusin":return rr=Gn(rr,e,t,r,s,l),!0;case"dragenter":return nr=Gn(nr,e,t,r,s,l),!0;case"mouseover":return sr=Gn(sr,e,t,r,s,l),!0;case"pointerover":var i=l.pointerId;return Wn.set(i,Gn(Wn.get(i)||null,e,t,r,s,l)),!0;case"gotpointercapture":return i=l.pointerId,Hn.set(i,Gn(Hn.get(i)||null,e,t,r,s,l)),!0}return!1}function nd(e){var t=_r(e.target);if(t!==null){var r=Er(t);if(r!==null){if(t=r.tag,t===13){if(t=Bi(r),t!==null){e.blockedOn=t,td(e.priority,function(){Xi(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $s(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Nl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);ul=s,r.target.dispatchEvent(s),ul=null}else return t=ls(r),t!==null&&wl(t),e.blockedOn=r,!1;t.shift()}return!0}function sd(e,t,r){$s(e)&&r.delete(t)}function gp(){jl=!1,rr!==null&&$s(rr)&&(rr=null),nr!==null&&$s(nr)&&(nr=null),sr!==null&&$s(sr)&&(sr=null),Wn.forEach(sd),Hn.forEach(sd)}function Kn(e,t){e.blockedOn===t&&(e.blockedOn=null,jl||(jl=!0,d.unstable_scheduleCallback(d.unstable_NormalPriority,gp)))}function Qn(e){function t(l){return Kn(l,e)}if(0<Fs.length){Kn(Fs[0],e);for(var r=1;r<Fs.length;r++){var s=Fs[r];s.blockedOn===e&&(s.blockedOn=null)}}for(rr!==null&&Kn(rr,e),nr!==null&&Kn(nr,e),sr!==null&&Kn(sr,e),Wn.forEach(t),Hn.forEach(t),r=0;r<or.length;r++)s=or[r],s.blockedOn===e&&(s.blockedOn=null);for(;0<or.length&&(r=or[0],r.blockedOn===null);)nd(r),r.blockedOn===null&&or.shift()}var en=Y.ReactCurrentBatchConfig,Us=!0;function vp(e,t,r,s){var l=Re,i=en.transition;en.transition=null;try{Re=1,kl(e,t,r,s)}finally{Re=l,en.transition=i}}function yp(e,t,r,s){var l=Re,i=en.transition;en.transition=null;try{Re=4,kl(e,t,r,s)}finally{Re=l,en.transition=i}}function kl(e,t,r,s){if(Us){var l=Nl(e,t,r,s);if(l===null)Ul(e,t,s,Bs,r),rd(e,s);else if(xp(l,e,t,r,s))s.stopPropagation();else if(rd(e,s),t&4&&-1<hp.indexOf(e)){for(;l!==null;){var i=ls(l);if(i!==null&&Ji(i),i=Nl(e,t,r,s),i===null&&Ul(e,t,s,Bs,r),i===l)break;l=i}l!==null&&s.stopPropagation()}else Ul(e,t,s,null,r)}}var Bs=null;function Nl(e,t,r,s){if(Bs=null,e=fl(s),e=_r(e),e!==null)if(t=Er(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Bi(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Bs=e,null}function od(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(lp()){case gl:return 1;case Qi:return 4;case Ls:case ap:return 16;case qi:return 536870912;default:return 16}default:return 16}}var lr=null,Sl=null,Vs=null;function ld(){if(Vs)return Vs;var e,t=Sl,r=t.length,s,l="value"in lr?lr.value:lr.textContent,i=l.length;for(e=0;e<r&&t[e]===l[e];e++);var u=r-e;for(s=1;s<=u&&t[r-s]===l[i-s];s++);return Vs=l.slice(e,1<s?1-s:void 0)}function Ws(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 Hs(){return!0}function ad(){return!1}function pt(e){function t(r,s,l,i,u){this._reactName=r,this._targetInst=l,this.type=s,this.nativeEvent=i,this.target=u,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(r=e[g],this[g]=r?r(i):i[g]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Hs:ad,this.isPropagationStopped=ad,this}return G(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Hs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Hs)},persist:function(){},isPersistent:Hs}),t}var tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cl=pt(tn),qn=G({},tn,{view:0,detail:0}),bp=pt(qn),El,_l,Zn,Gs=G({},qn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ml,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Zn&&(Zn&&e.type==="mousemove"?(El=e.screenX-Zn.screenX,_l=e.screenY-Zn.screenY):_l=El=0,Zn=e),El)},movementY:function(e){return"movementY"in e?e.movementY:_l}}),id=pt(Gs),wp=G({},Gs,{dataTransfer:0}),jp=pt(wp),kp=G({},qn,{relatedTarget:0}),Pl=pt(kp),Np=G({},tn,{animationName:0,elapsedTime:0,pseudoElement:0}),Sp=pt(Np),Cp=G({},tn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ep=pt(Cp),_p=G({},tn,{data:0}),dd=pt(_p),Pp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mp={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"},Rp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rp[e])?!!t[e]:!1}function Ml(){return zp}var Dp=G({},qn,{key:function(e){if(e.key){var t=Pp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ws(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ml,charCode:function(e){return e.type==="keypress"?Ws(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ws(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Lp=pt(Dp),Ap=G({},Gs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cd=pt(Ap),Op=G({},qn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ml}),Tp=pt(Op),Ip=G({},tn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fp=pt(Ip),$p=G({},Gs,{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}),Up=pt($p),Bp=[9,13,27,32],Rl=x&&"CompositionEvent"in window,Yn=null;x&&"documentMode"in document&&(Yn=document.documentMode);var Vp=x&&"TextEvent"in window&&!Yn,ud=x&&(!Rl||Yn&&8<Yn&&11>=Yn),fd=" ",pd=!1;function md(e,t){switch(e){case"keyup":return Bp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rn=!1;function Wp(e,t){switch(e){case"compositionend":return hd(t);case"keypress":return t.which!==32?null:(pd=!0,fd);case"textInput":return e=t.data,e===fd&&pd?null:e;default:return null}}function Hp(e,t){if(rn)return e==="compositionend"||!Rl&&md(e,t)?(e=ld(),Vs=Sl=lr=null,rn=!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 ud&&t.locale!=="ko"?null:t.data;default:return null}}var Gp={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 xd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gp[e.type]:t==="textarea"}function gd(e,t,r,s){Ti(s),t=Ys(t,"onChange"),0<t.length&&(r=new Cl("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var Jn=null,Xn=null;function Kp(e){Ad(e,0)}function Ks(e){var t=an(e);if($t(t))return e}function Qp(e,t){if(e==="change")return t}var vd=!1;if(x){var zl;if(x){var Dl="oninput"in document;if(!Dl){var yd=document.createElement("div");yd.setAttribute("oninput","return;"),Dl=typeof yd.oninput=="function"}zl=Dl}else zl=!1;vd=zl&&(!document.documentMode||9<document.documentMode)}function bd(){Jn&&(Jn.detachEvent("onpropertychange",wd),Xn=Jn=null)}function wd(e){if(e.propertyName==="value"&&Ks(Xn)){var t=[];gd(t,Xn,e,fl(e)),Ui(Kp,t)}}function qp(e,t,r){e==="focusin"?(bd(),Jn=t,Xn=r,Jn.attachEvent("onpropertychange",wd)):e==="focusout"&&bd()}function Zp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ks(Xn)}function Yp(e,t){if(e==="click")return Ks(t)}function Jp(e,t){if(e==="input"||e==="change")return Ks(t)}function Xp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ct=typeof Object.is=="function"?Object.is:Xp;function es(e,t){if(Ct(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var l=r[s];if(!E.call(t,l)||!Ct(e[l],t[l]))return!1}return!0}function jd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kd(e,t){var r=jd(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=jd(r)}}function Nd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sd(){for(var e=window,t=lt();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=lt(e.document)}return t}function Ll(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")}function em(e){var t=Sd(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Nd(r.ownerDocument.documentElement,r)){if(s!==null&&Ll(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=r.textContent.length,i=Math.min(s.start,l);s=s.end===void 0?i:Math.min(s.end,l),!e.extend&&i>s&&(l=s,s=i,i=l),l=kd(r,i);var u=kd(r,s);l&&u&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>s?(e.addRange(t),e.extend(u.node,u.offset)):(t.setEnd(u.node,u.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var tm=x&&"documentMode"in document&&11>=document.documentMode,nn=null,Al=null,ts=null,Ol=!1;function Cd(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ol||nn==null||nn!==lt(s)||(s=nn,"selectionStart"in s&&Ll(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ts&&es(ts,s)||(ts=s,s=Ys(Al,"onSelect"),0<s.length&&(t=new Cl("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=nn)))}function Qs(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var sn={animationend:Qs("Animation","AnimationEnd"),animationiteration:Qs("Animation","AnimationIteration"),animationstart:Qs("Animation","AnimationStart"),transitionend:Qs("Transition","TransitionEnd")},Tl={},Ed={};x&&(Ed=document.createElement("div").style,"AnimationEvent"in window||(delete sn.animationend.animation,delete sn.animationiteration.animation,delete sn.animationstart.animation),"TransitionEvent"in window||delete sn.transitionend.transition);function qs(e){if(Tl[e])return Tl[e];if(!sn[e])return e;var t=sn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Ed)return Tl[e]=t[r];return e}var _d=qs("animationend"),Pd=qs("animationiteration"),Md=qs("animationstart"),Rd=qs("transitionend"),zd=new Map,Dd="abort auxClick 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(" ");function ar(e,t){zd.set(e,t),m(t,[e])}for(var Il=0;Il<Dd.length;Il++){var Fl=Dd[Il],rm=Fl.toLowerCase(),nm=Fl[0].toUpperCase()+Fl.slice(1);ar(rm,"on"+nm)}ar(_d,"onAnimationEnd"),ar(Pd,"onAnimationIteration"),ar(Md,"onAnimationStart"),ar("dblclick","onDoubleClick"),ar("focusin","onFocus"),ar("focusout","onBlur"),ar(Rd,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),m("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),m("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),m("onBeforeInput",["compositionend","keypress","textInput","paste"]),m("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rs="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(" "),sm=new Set("cancel close invalid load scroll toggle".split(" ").concat(rs));function Ld(e,t,r){var s=e.type||"unknown-event";e.currentTarget=r,rp(s,t,void 0,e),e.currentTarget=null}function Ad(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],l=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var u=s.length-1;0<=u;u--){var g=s[u],y=g.instance,D=g.currentTarget;if(g=g.listener,y!==i&&l.isPropagationStopped())break e;Ld(l,g,D),i=y}else for(u=0;u<s.length;u++){if(g=s[u],y=g.instance,D=g.currentTarget,g=g.listener,y!==i&&l.isPropagationStopped())break e;Ld(l,g,D),i=y}}}if(Ds)throw e=xl,Ds=!1,xl=null,e}function Ae(e,t){var r=t[Kl];r===void 0&&(r=t[Kl]=new Set);var s=e+"__bubble";r.has(s)||(Od(t,e,2,!1),r.add(s))}function $l(e,t,r){var s=0;t&&(s|=4),Od(r,e,s,t)}var Zs="_reactListening"+Math.random().toString(36).slice(2);function ns(e){if(!e[Zs]){e[Zs]=!0,c.forEach(function(r){r!=="selectionchange"&&(sm.has(r)||$l(r,!1,e),$l(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zs]||(t[Zs]=!0,$l("selectionchange",!1,t))}}function Od(e,t,r,s){switch(od(t)){case 1:var l=vp;break;case 4:l=yp;break;default:l=kl}r=l.bind(null,t,r,e),l=void 0,!hl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),s?l!==void 0?e.addEventListener(t,r,{capture:!0,passive:l}):e.addEventListener(t,r,!0):l!==void 0?e.addEventListener(t,r,{passive:l}):e.addEventListener(t,r,!1)}function Ul(e,t,r,s,l){var i=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var u=s.tag;if(u===3||u===4){var g=s.stateNode.containerInfo;if(g===l||g.nodeType===8&&g.parentNode===l)break;if(u===4)for(u=s.return;u!==null;){var y=u.tag;if((y===3||y===4)&&(y=u.stateNode.containerInfo,y===l||y.nodeType===8&&y.parentNode===l))return;u=u.return}for(;g!==null;){if(u=_r(g),u===null)return;if(y=u.tag,y===5||y===6){s=i=u;continue e}g=g.parentNode}}s=s.return}Ui(function(){var D=i,U=fl(r),V=[];e:{var $=zd.get(e);if($!==void 0){var te=Cl,ie=e;switch(e){case"keypress":if(Ws(r)===0)break e;case"keydown":case"keyup":te=Lp;break;case"focusin":ie="focus",te=Pl;break;case"focusout":ie="blur",te=Pl;break;case"beforeblur":case"afterblur":te=Pl;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=id;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=jp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Tp;break;case _d:case Pd:case Md:te=Sp;break;case Rd:te=Fp;break;case"scroll":te=bp;break;case"wheel":te=Up;break;case"copy":case"cut":case"paste":te=Ep;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=cd}var de=(t&4)!==0,Ve=!de&&e==="scroll",P=de?$!==null?$+"Capture":null:$;de=[];for(var N=D,R;N!==null;){R=N;var q=R.stateNode;if(R.tag===5&&q!==null&&(R=q,P!==null&&(q=Fn(N,P),q!=null&&de.push(ss(N,q,R)))),Ve)break;N=N.return}0<de.length&&($=new te($,ie,null,r,U),V.push({event:$,listeners:de}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",$&&r!==ul&&(ie=r.relatedTarget||r.fromElement)&&(_r(ie)||ie[Wt]))break e;if((te||$)&&($=U.window===U?U:($=U.ownerDocument)?$.defaultView||$.parentWindow:window,te?(ie=r.relatedTarget||r.toElement,te=D,ie=ie?_r(ie):null,ie!==null&&(Ve=Er(ie),ie!==Ve||ie.tag!==5&&ie.tag!==6)&&(ie=null)):(te=null,ie=D),te!==ie)){if(de=id,q="onMouseLeave",P="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(de=cd,q="onPointerLeave",P="onPointerEnter",N="pointer"),Ve=te==null?$:an(te),R=ie==null?$:an(ie),$=new de(q,N+"leave",te,r,U),$.target=Ve,$.relatedTarget=R,q=null,_r(U)===D&&(de=new de(P,N+"enter",ie,r,U),de.target=R,de.relatedTarget=Ve,q=de),Ve=q,te&&ie)t:{for(de=te,P=ie,N=0,R=de;R;R=on(R))N++;for(R=0,q=P;q;q=on(q))R++;for(;0<N-R;)de=on(de),N--;for(;0<R-N;)P=on(P),R--;for(;N--;){if(de===P||P!==null&&de===P.alternate)break t;de=on(de),P=on(P)}de=null}else de=null;te!==null&&Td(V,$,te,de,!1),ie!==null&&Ve!==null&&Td(V,Ve,ie,de,!0)}}e:{if($=D?an(D):window,te=$.nodeName&&$.nodeName.toLowerCase(),te==="select"||te==="input"&&$.type==="file")var ue=Qp;else if(xd($))if(vd)ue=Jp;else{ue=Zp;var he=qp}else(te=$.nodeName)&&te.toLowerCase()==="input"&&($.type==="checkbox"||$.type==="radio")&&(ue=Yp);if(ue&&(ue=ue(e,D))){gd(V,ue,r,U);break e}he&&he(e,$,D),e==="focusout"&&(he=$._wrapperState)&&he.controlled&&$.type==="number"&&Zr($,"number",$.value)}switch(he=D?an(D):window,e){case"focusin":(xd(he)||he.contentEditable==="true")&&(nn=he,Al=D,ts=null);break;case"focusout":ts=Al=nn=null;break;case"mousedown":Ol=!0;break;case"contextmenu":case"mouseup":case"dragend":Ol=!1,Cd(V,r,U);break;case"selectionchange":if(tm)break;case"keydown":case"keyup":Cd(V,r,U)}var xe;if(Rl)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 rn?md(e,r)&&(be="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(be="onCompositionStart");be&&(ud&&r.locale!=="ko"&&(rn||be!=="onCompositionStart"?be==="onCompositionEnd"&&rn&&(xe=ld()):(lr=U,Sl="value"in lr?lr.value:lr.textContent,rn=!0)),he=Ys(D,be),0<he.length&&(be=new dd(be,e,null,r,U),V.push({event:be,listeners:he}),xe?be.data=xe:(xe=hd(r),xe!==null&&(be.data=xe)))),(xe=Vp?Wp(e,r):Hp(e,r))&&(D=Ys(D,"onBeforeInput"),0<D.length&&(U=new dd("onBeforeInput","beforeinput",null,r,U),V.push({event:U,listeners:D}),U.data=xe))}Ad(V,t)})}function ss(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ys(e,t){for(var r=t+"Capture",s=[];e!==null;){var l=e,i=l.stateNode;l.tag===5&&i!==null&&(l=i,i=Fn(e,r),i!=null&&s.unshift(ss(e,i,l)),i=Fn(e,t),i!=null&&s.push(ss(e,i,l))),e=e.return}return s}function on(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Td(e,t,r,s,l){for(var i=t._reactName,u=[];r!==null&&r!==s;){var g=r,y=g.alternate,D=g.stateNode;if(y!==null&&y===s)break;g.tag===5&&D!==null&&(g=D,l?(y=Fn(r,i),y!=null&&u.unshift(ss(r,y,g))):l||(y=Fn(r,i),y!=null&&u.push(ss(r,y,g)))),r=r.return}u.length!==0&&e.push({event:t,listeners:u})}var om=/\r\n?/g,lm=/\u0000|\uFFFD/g;function Id(e){return(typeof e=="string"?e:""+e).replace(om,`
`).replace(lm,"")}function Js(e,t,r){if(t=Id(t),Id(e)!==t&&r)throw Error(a(425))}function Xs(){}var Bl=null,Vl=null;function Wl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Hl=typeof setTimeout=="function"?setTimeout:void 0,am=typeof clearTimeout=="function"?clearTimeout:void 0,Fd=typeof Promise=="function"?Promise:void 0,im=typeof queueMicrotask=="function"?queueMicrotask:typeof Fd<"u"?function(e){return Fd.resolve(null).then(e).catch(dm)}:Hl;function dm(e){setTimeout(function(){throw e})}function Gl(e,t){var r=t,s=0;do{var l=r.nextSibling;if(e.removeChild(r),l&&l.nodeType===8)if(r=l.data,r==="/$"){if(s===0){e.removeChild(l),Qn(t);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=l}while(r);Qn(t)}function ir(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==="$?")break;if(t==="/$")return null}}return e}function $d(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ln=Math.random().toString(36).slice(2),Lt="__reactFiber$"+ln,os="__reactProps$"+ln,Wt="__reactContainer$"+ln,Kl="__reactEvents$"+ln,cm="__reactListeners$"+ln,um="__reactHandles$"+ln;function _r(e){var t=e[Lt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Wt]||r[Lt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=$d(e);e!==null;){if(r=e[Lt])return r;e=$d(e)}return t}e=r,r=e.parentNode}return null}function ls(e){return e=e[Lt]||e[Wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function an(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(a(33))}function eo(e){return e[os]||null}var Ql=[],dn=-1;function dr(e){return{current:e}}function Oe(e){0>dn||(e.current=Ql[dn],Ql[dn]=null,dn--)}function De(e,t){dn++,Ql[dn]=e.current,e.current=t}var cr={},Xe=dr(cr),at=dr(!1),Pr=cr;function cn(e,t){var r=e.type.contextTypes;if(!r)return cr;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in r)l[i]=t[i];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function it(e){return e=e.childContextTypes,e!=null}function to(){Oe(at),Oe(Xe)}function Ud(e,t,r){if(Xe.current!==cr)throw Error(a(168));De(Xe,t),De(at,r)}function Bd(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var l in s)if(!(l in t))throw Error(a(108,pe(e)||"Unknown",l));return G({},r,s)}function ro(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cr,Pr=Xe.current,De(Xe,e),De(at,at.current),!0}function Vd(e,t,r){var s=e.stateNode;if(!s)throw Error(a(169));r?(e=Bd(e,t,Pr),s.__reactInternalMemoizedMergedChildContext=e,Oe(at),Oe(Xe),De(Xe,e)):Oe(at),De(at,r)}var Ht=null,no=!1,ql=!1;function Wd(e){Ht===null?Ht=[e]:Ht.push(e)}function fm(e){no=!0,Wd(e)}function ur(){if(!ql&&Ht!==null){ql=!0;var e=0,t=Re;try{var r=Ht;for(Re=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}Ht=null,no=!1}catch(l){throw Ht!==null&&(Ht=Ht.slice(e+1)),Gi(gl,ur),l}finally{Re=t,ql=!1}}return null}var un=[],fn=0,so=null,oo=0,vt=[],yt=0,Mr=null,Gt=1,Kt="";function Rr(e,t){un[fn++]=oo,un[fn++]=so,so=e,oo=t}function Hd(e,t,r){vt[yt++]=Gt,vt[yt++]=Kt,vt[yt++]=Mr,Mr=e;var s=Gt;e=Kt;var l=32-St(s)-1;s&=~(1<<l),r+=1;var i=32-St(t)+l;if(30<i){var u=l-l%5;i=(s&(1<<u)-1).toString(32),s>>=u,l-=u,Gt=1<<32-St(t)+l|r<<l|s,Kt=i+e}else Gt=1<<i|r<<l|s,Kt=e}function Zl(e){e.return!==null&&(Rr(e,1),Hd(e,1,0))}function Yl(e){for(;e===so;)so=un[--fn],un[fn]=null,oo=un[--fn],un[fn]=null;for(;e===Mr;)Mr=vt[--yt],vt[yt]=null,Kt=vt[--yt],vt[yt]=null,Gt=vt[--yt],vt[yt]=null}var mt=null,ht=null,Ie=!1,Et=null;function Gd(e,t){var r=kt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Kd(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,mt=e,ht=ir(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,mt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Mr!==null?{id:Gt,overflow:Kt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=kt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,mt=e,ht=null,!0):!1;default:return!1}}function Jl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xl(e){if(Ie){var t=ht;if(t){var r=t;if(!Kd(e,t)){if(Jl(e))throw Error(a(418));t=ir(r.nextSibling);var s=mt;t&&Kd(e,t)?Gd(s,r):(e.flags=e.flags&-4097|2,Ie=!1,mt=e)}}else{if(Jl(e))throw Error(a(418));e.flags=e.flags&-4097|2,Ie=!1,mt=e}}}function Qd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;mt=e}function lo(e){if(e!==mt)return!1;if(!Ie)return Qd(e),Ie=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Wl(e.type,e.memoizedProps)),t&&(t=ht)){if(Jl(e))throw qd(),Error(a(418));for(;t;)Gd(e,t),t=ir(t.nextSibling)}if(Qd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){ht=ir(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=mt?ir(e.stateNode.nextSibling):null;return!0}function qd(){for(var e=ht;e;)e=ir(e.nextSibling)}function pn(){ht=mt=null,Ie=!1}function ea(e){Et===null?Et=[e]:Et.push(e)}var pm=Y.ReactCurrentBatchConfig;function as(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(a(309));var s=r.stateNode}if(!s)throw Error(a(147,e));var l=s,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(u){var g=l.refs;u===null?delete g[i]:g[i]=u},t._stringRef=i,t)}if(typeof e!="string")throw Error(a(284));if(!r._owner)throw Error(a(290,e))}return e}function ao(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Zd(e){var t=e._init;return t(e._payload)}function Yd(e){function t(P,N){if(e){var R=P.deletions;R===null?(P.deletions=[N],P.flags|=16):R.push(N)}}function r(P,N){if(!e)return null;for(;N!==null;)t(P,N),N=N.sibling;return null}function s(P,N){for(P=new Map;N!==null;)N.key!==null?P.set(N.key,N):P.set(N.index,N),N=N.sibling;return P}function l(P,N){return P=yr(P,N),P.index=0,P.sibling=null,P}function i(P,N,R){return P.index=R,e?(R=P.alternate,R!==null?(R=R.index,R<N?(P.flags|=2,N):R):(P.flags|=2,N)):(P.flags|=1048576,N)}function u(P){return e&&P.alternate===null&&(P.flags|=2),P}function g(P,N,R,q){return N===null||N.tag!==6?(N=Ha(R,P.mode,q),N.return=P,N):(N=l(N,R),N.return=P,N)}function y(P,N,R,q){var ue=R.type;return ue===F?U(P,N,R.props.children,q,R.key):N!==null&&(N.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===Ne&&Zd(ue)===N.type)?(q=l(N,R.props),q.ref=as(P,N,R),q.return=P,q):(q=zo(R.type,R.key,R.props,null,P.mode,q),q.ref=as(P,N,R),q.return=P,q)}function D(P,N,R,q){return N===null||N.tag!==4||N.stateNode.containerInfo!==R.containerInfo||N.stateNode.implementation!==R.implementation?(N=Ga(R,P.mode,q),N.return=P,N):(N=l(N,R.children||[]),N.return=P,N)}function U(P,N,R,q,ue){return N===null||N.tag!==7?(N=Fr(R,P.mode,q,ue),N.return=P,N):(N=l(N,R),N.return=P,N)}function V(P,N,R){if(typeof N=="string"&&N!==""||typeof N=="number")return N=Ha(""+N,P.mode,R),N.return=P,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case H:return R=zo(N.type,N.key,N.props,null,P.mode,R),R.ref=as(P,null,N),R.return=P,R;case T:return N=Ga(N,P.mode,R),N.return=P,N;case Ne:var q=N._init;return V(P,q(N._payload),R)}if(tr(N)||ae(N))return N=Fr(N,P.mode,R,null),N.return=P,N;ao(P,N)}return null}function $(P,N,R,q){var ue=N!==null?N.key:null;if(typeof R=="string"&&R!==""||typeof R=="number")return ue!==null?null:g(P,N,""+R,q);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case H:return R.key===ue?y(P,N,R,q):null;case T:return R.key===ue?D(P,N,R,q):null;case Ne:return ue=R._init,$(P,N,ue(R._payload),q)}if(tr(R)||ae(R))return ue!==null?null:U(P,N,R,q,null);ao(P,R)}return null}function te(P,N,R,q,ue){if(typeof q=="string"&&q!==""||typeof q=="number")return P=P.get(R)||null,g(N,P,""+q,ue);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case H:return P=P.get(q.key===null?R:q.key)||null,y(N,P,q,ue);case T:return P=P.get(q.key===null?R:q.key)||null,D(N,P,q,ue);case Ne:var he=q._init;return te(P,N,R,he(q._payload),ue)}if(tr(q)||ae(q))return P=P.get(R)||null,U(N,P,q,ue,null);ao(N,q)}return null}function ie(P,N,R,q){for(var ue=null,he=null,xe=N,be=N=0,qe=null;xe!==null&&be<R.length;be++){xe.index>be?(qe=xe,xe=null):qe=xe.sibling;var Ee=$(P,xe,R[be],q);if(Ee===null){xe===null&&(xe=qe);break}e&&xe&&Ee.alternate===null&&t(P,xe),N=i(Ee,N,be),he===null?ue=Ee:he.sibling=Ee,he=Ee,xe=qe}if(be===R.length)return r(P,xe),Ie&&Rr(P,be),ue;if(xe===null){for(;be<R.length;be++)xe=V(P,R[be],q),xe!==null&&(N=i(xe,N,be),he===null?ue=xe:he.sibling=xe,he=xe);return Ie&&Rr(P,be),ue}for(xe=s(P,xe);be<R.length;be++)qe=te(xe,P,be,R[be],q),qe!==null&&(e&&qe.alternate!==null&&xe.delete(qe.key===null?be:qe.key),N=i(qe,N,be),he===null?ue=qe:he.sibling=qe,he=qe);return e&&xe.forEach(function(br){return t(P,br)}),Ie&&Rr(P,be),ue}function de(P,N,R,q){var ue=ae(R);if(typeof ue!="function")throw Error(a(150));if(R=ue.call(R),R==null)throw Error(a(151));for(var he=ue=null,xe=N,be=N=0,qe=null,Ee=R.next();xe!==null&&!Ee.done;be++,Ee=R.next()){xe.index>be?(qe=xe,xe=null):qe=xe.sibling;var br=$(P,xe,Ee.value,q);if(br===null){xe===null&&(xe=qe);break}e&&xe&&br.alternate===null&&t(P,xe),N=i(br,N,be),he===null?ue=br:he.sibling=br,he=br,xe=qe}if(Ee.done)return r(P,xe),Ie&&Rr(P,be),ue;if(xe===null){for(;!Ee.done;be++,Ee=R.next())Ee=V(P,Ee.value,q),Ee!==null&&(N=i(Ee,N,be),he===null?ue=Ee:he.sibling=Ee,he=Ee);return Ie&&Rr(P,be),ue}for(xe=s(P,xe);!Ee.done;be++,Ee=R.next())Ee=te(xe,P,be,Ee.value,q),Ee!==null&&(e&&Ee.alternate!==null&&xe.delete(Ee.key===null?be:Ee.key),N=i(Ee,N,be),he===null?ue=Ee:he.sibling=Ee,he=Ee);return e&&xe.forEach(function(Gm){return t(P,Gm)}),Ie&&Rr(P,be),ue}function Ve(P,N,R,q){if(typeof R=="object"&&R!==null&&R.type===F&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case H:e:{for(var ue=R.key,he=N;he!==null;){if(he.key===ue){if(ue=R.type,ue===F){if(he.tag===7){r(P,he.sibling),N=l(he,R.props.children),N.return=P,P=N;break e}}else if(he.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===Ne&&Zd(ue)===he.type){r(P,he.sibling),N=l(he,R.props),N.ref=as(P,he,R),N.return=P,P=N;break e}r(P,he);break}else t(P,he);he=he.sibling}R.type===F?(N=Fr(R.props.children,P.mode,q,R.key),N.return=P,P=N):(q=zo(R.type,R.key,R.props,null,P.mode,q),q.ref=as(P,N,R),q.return=P,P=q)}return u(P);case T:e:{for(he=R.key;N!==null;){if(N.key===he)if(N.tag===4&&N.stateNode.containerInfo===R.containerInfo&&N.stateNode.implementation===R.implementation){r(P,N.sibling),N=l(N,R.children||[]),N.return=P,P=N;break e}else{r(P,N);break}else t(P,N);N=N.sibling}N=Ga(R,P.mode,q),N.return=P,P=N}return u(P);case Ne:return he=R._init,Ve(P,N,he(R._payload),q)}if(tr(R))return ie(P,N,R,q);if(ae(R))return de(P,N,R,q);ao(P,R)}return typeof R=="string"&&R!==""||typeof R=="number"?(R=""+R,N!==null&&N.tag===6?(r(P,N.sibling),N=l(N,R),N.return=P,P=N):(r(P,N),N=Ha(R,P.mode,q),N.return=P,P=N),u(P)):r(P,N)}return Ve}var mn=Yd(!0),Jd=Yd(!1),io=dr(null),co=null,hn=null,ta=null;function ra(){ta=hn=co=null}function na(e){var t=io.current;Oe(io),e._currentValue=t}function sa(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function xn(e,t){co=e,ta=hn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(dt=!0),e.firstContext=null)}function bt(e){var t=e._currentValue;if(ta!==e)if(e={context:e,memoizedValue:t,next:null},hn===null){if(co===null)throw Error(a(308));hn=e,co.dependencies={lanes:0,firstContext:e}}else hn=hn.next=e;return t}var zr=null;function oa(e){zr===null?zr=[e]:zr.push(e)}function Xd(e,t,r,s){var l=t.interleaved;return l===null?(r.next=r,oa(t)):(r.next=l.next,l.next=r),t.interleaved=r,Qt(e,s)}function Qt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var fr=!1;function la(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ec(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ce&2)!==0){var l=s.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),s.pending=t,Qt(e,r)}return l=s.interleaved,l===null?(t.next=t,oa(s)):(t.next=l.next,l.next=t),s.interleaved=t,Qt(e,r)}function uo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,bl(e,r)}}function tc(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var l=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var u={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?l=i=u:i=i.next=u,r=r.next}while(r!==null);i===null?l=i=t:i=i.next=t}else l=i=t;r={baseState:s.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function fo(e,t,r,s){var l=e.updateQueue;fr=!1;var i=l.firstBaseUpdate,u=l.lastBaseUpdate,g=l.shared.pending;if(g!==null){l.shared.pending=null;var y=g,D=y.next;y.next=null,u===null?i=D:u.next=D,u=y;var U=e.alternate;U!==null&&(U=U.updateQueue,g=U.lastBaseUpdate,g!==u&&(g===null?U.firstBaseUpdate=D:g.next=D,U.lastBaseUpdate=y))}if(i!==null){var V=l.baseState;u=0,U=D=y=null,g=i;do{var $=g.lane,te=g.eventTime;if((s&$)===$){U!==null&&(U=U.next={eventTime:te,lane:0,tag:g.tag,payload:g.payload,callback:g.callback,next:null});e:{var ie=e,de=g;switch($=t,te=r,de.tag){case 1:if(ie=de.payload,typeof ie=="function"){V=ie.call(te,V,$);break e}V=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=de.payload,$=typeof ie=="function"?ie.call(te,V,$):ie,$==null)break e;V=G({},V,$);break e;case 2:fr=!0}}g.callback!==null&&g.lane!==0&&(e.flags|=64,$=l.effects,$===null?l.effects=[g]:$.push(g))}else te={eventTime:te,lane:$,tag:g.tag,payload:g.payload,callback:g.callback,next:null},U===null?(D=U=te,y=V):U=U.next=te,u|=$;if(g=g.next,g===null){if(g=l.shared.pending,g===null)break;$=g,g=$.next,$.next=null,l.lastBaseUpdate=$,l.shared.pending=null}}while(!0);if(U===null&&(y=V),l.baseState=y,l.firstBaseUpdate=D,l.lastBaseUpdate=U,t=l.shared.interleaved,t!==null){l=t;do u|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Ar|=u,e.lanes=u,e.memoizedState=V}}function rc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],l=s.callback;if(l!==null){if(s.callback=null,s=r,typeof l!="function")throw Error(a(191,l));l.call(s)}}}var is={},At=dr(is),ds=dr(is),cs=dr(is);function Dr(e){if(e===is)throw Error(a(174));return e}function aa(e,t){switch(De(cs,t),De(ds,e),De(At,is),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Se(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Se(t,e)}Oe(At),De(At,t)}function gn(){Oe(At),Oe(ds),Oe(cs)}function nc(e){Dr(cs.current);var t=Dr(At.current),r=Se(t,e.type);t!==r&&(De(ds,e),De(At,r))}function ia(e){ds.current===e&&(Oe(At),Oe(ds))}var Fe=dr(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))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}var da=[];function ca(){for(var e=0;e<da.length;e++)da[e]._workInProgressVersionPrimary=null;da.length=0}var mo=Y.ReactCurrentDispatcher,ua=Y.ReactCurrentBatchConfig,Lr=0,$e=null,He=null,Ke=null,ho=!1,us=!1,fs=0,mm=0;function et(){throw Error(a(321))}function fa(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ct(e[r],t[r]))return!1;return!0}function pa(e,t,r,s,l,i){if(Lr=i,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,mo.current=e===null||e.memoizedState===null?vm:ym,e=r(s,l),us){i=0;do{if(us=!1,fs=0,25<=i)throw Error(a(301));i+=1,Ke=He=null,t.updateQueue=null,mo.current=bm,e=r(s,l)}while(us)}if(mo.current=vo,t=He!==null&&He.next!==null,Lr=0,Ke=He=$e=null,ho=!1,t)throw Error(a(300));return e}function ma(){var e=fs!==0;return fs=0,e}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?$e.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function wt(){if(He===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=Ke===null?$e.memoizedState:Ke.next;if(t!==null)Ke=t,He=e;else{if(e===null)throw Error(a(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},Ke===null?$e.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function ps(e,t){return typeof t=="function"?t(e):t}function ha(e){var t=wt(),r=t.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=e;var s=He,l=s.baseQueue,i=r.pending;if(i!==null){if(l!==null){var u=l.next;l.next=i.next,i.next=u}s.baseQueue=l=i,r.pending=null}if(l!==null){i=l.next,s=s.baseState;var g=u=null,y=null,D=i;do{var U=D.lane;if((Lr&U)===U)y!==null&&(y=y.next={lane:0,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),s=D.hasEagerState?D.eagerState:e(s,D.action);else{var V={lane:U,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null};y===null?(g=y=V,u=s):y=y.next=V,$e.lanes|=U,Ar|=U}D=D.next}while(D!==null&&D!==i);y===null?u=s:y.next=g,Ct(s,t.memoizedState)||(dt=!0),t.memoizedState=s,t.baseState=u,t.baseQueue=y,r.lastRenderedState=s}if(e=r.interleaved,e!==null){l=e;do i=l.lane,$e.lanes|=i,Ar|=i,l=l.next;while(l!==e)}else l===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function xa(e){var t=wt(),r=t.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=e;var s=r.dispatch,l=r.pending,i=t.memoizedState;if(l!==null){r.pending=null;var u=l=l.next;do i=e(i,u.action),u=u.next;while(u!==l);Ct(i,t.memoizedState)||(dt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,s]}function sc(){}function oc(e,t){var r=$e,s=wt(),l=t(),i=!Ct(s.memoizedState,l);if(i&&(s.memoizedState=l,dt=!0),s=s.queue,ga(ic.bind(null,r,s,e),[e]),s.getSnapshot!==t||i||Ke!==null&&Ke.memoizedState.tag&1){if(r.flags|=2048,ms(9,ac.bind(null,r,s,l,t),void 0,null),Qe===null)throw Error(a(349));(Lr&30)!==0||lc(r,t,l)}return l}function lc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function ac(e,t,r,s){t.value=r,t.getSnapshot=s,dc(t)&&cc(e)}function ic(e,t,r){return r(function(){dc(t)&&cc(e)})}function dc(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ct(e,r)}catch{return!0}}function cc(e){var t=Qt(e,1);t!==null&&Rt(t,e,1,-1)}function uc(e){var t=Ot();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t.queue=e,e=e.dispatch=gm.bind(null,$e,e),[t.memoizedState,e]}function ms(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e)),e}function fc(){return wt().memoizedState}function xo(e,t,r,s){var l=Ot();$e.flags|=e,l.memoizedState=ms(1|t,r,void 0,s===void 0?null:s)}function go(e,t,r,s){var l=wt();s=s===void 0?null:s;var i=void 0;if(He!==null){var u=He.memoizedState;if(i=u.destroy,s!==null&&fa(s,u.deps)){l.memoizedState=ms(t,r,i,s);return}}$e.flags|=e,l.memoizedState=ms(1|t,r,i,s)}function pc(e,t){return xo(8390656,8,e,t)}function ga(e,t){return go(2048,8,e,t)}function mc(e,t){return go(4,2,e,t)}function hc(e,t){return go(4,4,e,t)}function xc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gc(e,t,r){return r=r!=null?r.concat([e]):null,go(4,4,xc.bind(null,t,e),r)}function va(){}function vc(e,t){var r=wt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&fa(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function yc(e,t){var r=wt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&fa(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function bc(e,t,r){return(Lr&21)===0?(e.baseState&&(e.baseState=!1,dt=!0),e.memoizedState=r):(Ct(r,t)||(r=Zi(),$e.lanes|=r,Ar|=r,e.baseState=!0),t)}function hm(e,t){var r=Re;Re=r!==0&&4>r?r:4,e(!0);var s=ua.transition;ua.transition={};try{e(!1),t()}finally{Re=r,ua.transition=s}}function wc(){return wt().memoizedState}function xm(e,t,r){var s=gr(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},jc(e))kc(t,r);else if(r=Xd(e,t,r,s),r!==null){var l=ot();Rt(r,e,s,l),Nc(r,t,s)}}function gm(e,t,r){var s=gr(e),l={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(jc(e))kc(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var u=t.lastRenderedState,g=i(u,r);if(l.hasEagerState=!0,l.eagerState=g,Ct(g,u)){var y=t.interleaved;y===null?(l.next=l,oa(t)):(l.next=y.next,y.next=l),t.interleaved=l;return}}catch{}finally{}r=Xd(e,t,l,s),r!==null&&(l=ot(),Rt(r,e,s,l),Nc(r,t,s))}}function jc(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function kc(e,t){us=ho=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Nc(e,t,r){if((r&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,bl(e,r)}}var vo={readContext:bt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},vm={readContext:bt,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:pc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,xo(4194308,4,xc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return xo(4194308,4,e,t)},useInsertionEffect:function(e,t){return xo(4,2,e,t)},useMemo:function(e,t){var r=Ot();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=Ot();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=xm.bind(null,$e,e),[s.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:uc,useDebugValue:va,useDeferredValue:function(e){return Ot().memoizedState=e},useTransition:function(){var e=uc(!1),t=e[0];return e=hm.bind(null,e[1]),Ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=$e,l=Ot();if(Ie){if(r===void 0)throw Error(a(407));r=r()}else{if(r=t(),Qe===null)throw Error(a(349));(Lr&30)!==0||lc(s,t,r)}l.memoizedState=r;var i={value:r,getSnapshot:t};return l.queue=i,pc(ic.bind(null,s,i,e),[e]),s.flags|=2048,ms(9,ac.bind(null,s,i,r,t),void 0,null),r},useId:function(){var e=Ot(),t=Qe.identifierPrefix;if(Ie){var r=Kt,s=Gt;r=(s&~(1<<32-St(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=fs++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=mm++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ym={readContext:bt,useCallback:vc,useContext:bt,useEffect:ga,useImperativeHandle:gc,useInsertionEffect:mc,useLayoutEffect:hc,useMemo:yc,useReducer:ha,useRef:fc,useState:function(){return ha(ps)},useDebugValue:va,useDeferredValue:function(e){var t=wt();return bc(t,He.memoizedState,e)},useTransition:function(){var e=ha(ps)[0],t=wt().memoizedState;return[e,t]},useMutableSource:sc,useSyncExternalStore:oc,useId:wc,unstable_isNewReconciler:!1},bm={readContext:bt,useCallback:vc,useContext:bt,useEffect:ga,useImperativeHandle:gc,useInsertionEffect:mc,useLayoutEffect:hc,useMemo:yc,useReducer:xa,useRef:fc,useState:function(){return xa(ps)},useDebugValue:va,useDeferredValue:function(e){var t=wt();return He===null?t.memoizedState=e:bc(t,He.memoizedState,e)},useTransition:function(){var e=xa(ps)[0],t=wt().memoizedState;return[e,t]},useMutableSource:sc,useSyncExternalStore:oc,useId:wc,unstable_isNewReconciler:!1};function _t(e,t){if(e&&e.defaultProps){t=G({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function ya(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:G({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var yo={isMounted:function(e){return(e=e._reactInternals)?Er(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=ot(),l=gr(e),i=qt(s,l);i.payload=t,r!=null&&(i.callback=r),t=pr(e,i,l),t!==null&&(Rt(t,e,l,s),uo(t,e,l))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=ot(),l=gr(e),i=qt(s,l);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=pr(e,i,l),t!==null&&(Rt(t,e,l,s),uo(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=ot(),s=gr(e),l=qt(r,s);l.tag=2,t!=null&&(l.callback=t),t=pr(e,l,s),t!==null&&(Rt(t,e,s,r),uo(t,e,s))}};function Sc(e,t,r,s,l,i,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,u):t.prototype&&t.prototype.isPureReactComponent?!es(r,s)||!es(l,i):!0}function Cc(e,t,r){var s=!1,l=cr,i=t.contextType;return typeof i=="object"&&i!==null?i=bt(i):(l=it(t)?Pr:Xe.current,s=t.contextTypes,i=(s=s!=null)?cn(e,l):cr),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=yo,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=i),t}function Ec(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&yo.enqueueReplaceState(t,t.state,null)}function ba(e,t,r,s){var l=e.stateNode;l.props=r,l.state=e.memoizedState,l.refs={},la(e);var i=t.contextType;typeof i=="object"&&i!==null?l.context=bt(i):(i=it(t)?Pr:Xe.current,l.context=cn(e,i)),l.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ya(e,t,i,r),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&yo.enqueueReplaceState(l,l.state,null),fo(e,r,l,s),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function vn(e,t){try{var r="",s=t;do r+=K(s),s=s.return;while(s);var l=r}catch(i){l=`
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:l,digest:null}}function wa(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function ja(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var wm=typeof WeakMap=="function"?WeakMap:Map;function _c(e,t,r){r=qt(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){Co||(Co=!0,Ta=s),ja(e,t)},r}function Pc(e,t,r){r=qt(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var l=t.value;r.payload=function(){return s(l)},r.callback=function(){ja(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){ja(e,t),typeof s!="function"&&(hr===null?hr=new Set([this]):hr.add(this));var u=t.stack;this.componentDidCatch(t.value,{componentStack:u!==null?u:""})}),r}function Mc(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new wm;var l=new Set;s.set(t,l)}else l=s.get(t),l===void 0&&(l=new Set,s.set(t,l));l.has(r)||(l.add(r),e=Am.bind(null,e,t,r),t.then(e,e))}function Rc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function zc(e,t,r,s,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=qt(-1,1),t.tag=2,pr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var jm=Y.ReactCurrentOwner,dt=!1;function st(e,t,r,s){t.child=e===null?Jd(t,null,r,s):mn(t,e.child,r,s)}function Dc(e,t,r,s,l){r=r.render;var i=t.ref;return xn(t,l),s=pa(e,t,r,s,i,l),r=ma(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Zt(e,t,l)):(Ie&&r&&Zl(t),t.flags|=1,st(e,t,s,l),t.child)}function Lc(e,t,r,s,l){if(e===null){var i=r.type;return typeof i=="function"&&!Wa(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,Ac(e,t,i,s,l)):(e=zo(r.type,null,s,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&l)===0){var u=i.memoizedProps;if(r=r.compare,r=r!==null?r:es,r(u,s)&&e.ref===t.ref)return Zt(e,t,l)}return t.flags|=1,e=yr(i,s),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,r,s,l){if(e!==null){var i=e.memoizedProps;if(es(i,s)&&e.ref===t.ref)if(dt=!1,t.pendingProps=s=i,(e.lanes&l)!==0)(e.flags&131072)!==0&&(dt=!0);else return t.lanes=e.lanes,Zt(e,t,l)}return ka(e,t,r,s,l)}function Oc(e,t,r){var s=t.pendingProps,l=s.children,i=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},De(bn,xt),xt|=r;else{if((r&1073741824)===0)return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,De(bn,xt),xt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:r,De(bn,xt),xt|=s}else i!==null?(s=i.baseLanes|r,t.memoizedState=null):s=r,De(bn,xt),xt|=s;return st(e,t,l,r),t.child}function Tc(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ka(e,t,r,s,l){var i=it(r)?Pr:Xe.current;return i=cn(t,i),xn(t,l),r=pa(e,t,r,s,i,l),s=ma(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Zt(e,t,l)):(Ie&&s&&Zl(t),t.flags|=1,st(e,t,r,l),t.child)}function Ic(e,t,r,s,l){if(it(r)){var i=!0;ro(t)}else i=!1;if(xn(t,l),t.stateNode===null)wo(e,t),Cc(t,r,s),ba(t,r,s,l),s=!0;else if(e===null){var u=t.stateNode,g=t.memoizedProps;u.props=g;var y=u.context,D=r.contextType;typeof D=="object"&&D!==null?D=bt(D):(D=it(r)?Pr:Xe.current,D=cn(t,D));var U=r.getDerivedStateFromProps,V=typeof U=="function"||typeof u.getSnapshotBeforeUpdate=="function";V||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==s||y!==D)&&Ec(t,u,s,D),fr=!1;var $=t.memoizedState;u.state=$,fo(t,s,u,l),y=t.memoizedState,g!==s||$!==y||at.current||fr?(typeof U=="function"&&(ya(t,r,U,s),y=t.memoizedState),(g=fr||Sc(t,r,g,s,$,y,D))?(V||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=s,t.memoizedState=y),u.props=s,u.state=y,u.context=D,s=g):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{u=t.stateNode,ec(e,t),g=t.memoizedProps,D=t.type===t.elementType?g:_t(t.type,g),u.props=D,V=t.pendingProps,$=u.context,y=r.contextType,typeof y=="object"&&y!==null?y=bt(y):(y=it(r)?Pr:Xe.current,y=cn(t,y));var te=r.getDerivedStateFromProps;(U=typeof te=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==V||$!==y)&&Ec(t,u,s,y),fr=!1,$=t.memoizedState,u.state=$,fo(t,s,u,l);var ie=t.memoizedState;g!==V||$!==ie||at.current||fr?(typeof te=="function"&&(ya(t,r,te,s),ie=t.memoizedState),(D=fr||Sc(t,r,D,s,$,ie,y)||!1)?(U||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(s,ie,y),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(s,ie,y)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ie),u.props=s,u.state=ie,u.context=y,s=D):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),s=!1)}return Na(e,t,r,s,i,l)}function Na(e,t,r,s,l,i){Tc(e,t);var u=(t.flags&128)!==0;if(!s&&!u)return l&&Vd(t,r,!1),Zt(e,t,i);s=t.stateNode,jm.current=t;var g=u&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&u?(t.child=mn(t,e.child,null,i),t.child=mn(t,null,g,i)):st(e,t,g,i),t.memoizedState=s.state,l&&Vd(t,r,!0),t.child}function Fc(e){var t=e.stateNode;t.pendingContext?Ud(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ud(e,t.context,!1),aa(e,t.containerInfo)}function $c(e,t,r,s,l){return pn(),ea(l),t.flags|=256,st(e,t,r,s),t.child}var Sa={dehydrated:null,treeContext:null,retryLane:0};function Ca(e){return{baseLanes:e,cachePool:null,transitions:null}}function Uc(e,t,r){var s=t.pendingProps,l=Fe.current,i=!1,u=(t.flags&128)!==0,g;if((g=u)||(g=e!==null&&e.memoizedState===null?!1:(l&2)!==0),g?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),De(Fe,l&1),e===null)return Xl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(u=s.children,e=s.fallback,i?(s=t.mode,i=t.child,u={mode:"hidden",children:u},(s&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=u):i=Do(u,s,0,null),e=Fr(e,s,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Ca(r),t.memoizedState=Sa,e):Ea(t,u));if(l=e.memoizedState,l!==null&&(g=l.dehydrated,g!==null))return km(e,t,u,s,g,l,r);if(i){i=s.fallback,u=t.mode,l=e.child,g=l.sibling;var y={mode:"hidden",children:s.children};return(u&1)===0&&t.child!==l?(s=t.child,s.childLanes=0,s.pendingProps=y,t.deletions=null):(s=yr(l,y),s.subtreeFlags=l.subtreeFlags&14680064),g!==null?i=yr(g,i):(i=Fr(i,u,r,null),i.flags|=2),i.return=t,s.return=t,s.sibling=i,t.child=s,s=i,i=t.child,u=e.child.memoizedState,u=u===null?Ca(r):{baseLanes:u.baseLanes|r,cachePool:null,transitions:u.transitions},i.memoizedState=u,i.childLanes=e.childLanes&~r,t.memoizedState=Sa,s}return i=e.child,e=i.sibling,s=yr(i,{mode:"visible",children:s.children}),(t.mode&1)===0&&(s.lanes=r),s.return=t,s.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=s,t.memoizedState=null,s}function Ea(e,t){return t=Do({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function bo(e,t,r,s){return s!==null&&ea(s),mn(t,e.child,null,r),e=Ea(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function km(e,t,r,s,l,i,u){if(r)return t.flags&256?(t.flags&=-257,s=wa(Error(a(422))),bo(e,t,u,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=s.fallback,l=t.mode,s=Do({mode:"visible",children:s.children},l,0,null),i=Fr(i,l,u,null),i.flags|=2,s.return=t,i.return=t,s.sibling=i,t.child=s,(t.mode&1)!==0&&mn(t,e.child,null,u),t.child.memoizedState=Ca(u),t.memoizedState=Sa,i);if((t.mode&1)===0)return bo(e,t,u,null);if(l.data==="$!"){if(s=l.nextSibling&&l.nextSibling.dataset,s)var g=s.dgst;return s=g,i=Error(a(419)),s=wa(i,s,void 0),bo(e,t,u,s)}if(g=(u&e.childLanes)!==0,dt||g){if(s=Qe,s!==null){switch(u&-u){case 4:l=2;break;case 16:l=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=(l&(s.suspendedLanes|u))!==0?0:l,l!==0&&l!==i.retryLane&&(i.retryLane=l,Qt(e,l),Rt(s,e,l,-1))}return Va(),s=wa(Error(a(421))),bo(e,t,u,s)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Om.bind(null,e),l._reactRetry=t,null):(e=i.treeContext,ht=ir(l.nextSibling),mt=t,Ie=!0,Et=null,e!==null&&(vt[yt++]=Gt,vt[yt++]=Kt,vt[yt++]=Mr,Gt=e.id,Kt=e.overflow,Mr=t),t=Ea(t,s.children),t.flags|=4096,t)}function Bc(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),sa(e.return,t,r)}function _a(e,t,r,s,l){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:l}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=r,i.tailMode=l)}function Vc(e,t,r){var s=t.pendingProps,l=s.revealOrder,i=s.tail;if(st(e,t,s.children,r),s=Fe.current,(s&2)!==0)s=s&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&&Bc(e,r,t);else if(e.tag===19)Bc(e,r,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}s&=1}if(De(Fe,s),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(r=t.child,l=null;r!==null;)e=r.alternate,e!==null&&po(e)===null&&(l=r),r=r.sibling;r=l,r===null?(l=t.child,t.child=null):(l=r.sibling,r.sibling=null),_a(t,!1,l,r,i);break;case"backwards":for(r=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&po(e)===null){t.child=l;break}e=l.sibling,l.sibling=r,r=l,l=e}_a(t,!0,r,null,i);break;case"together":_a(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ar|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,r=yr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=yr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Nm(e,t,r){switch(t.tag){case 3:Fc(t),pn();break;case 5:nc(t);break;case 1:it(t.type)&&ro(t);break;case 4:aa(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,l=t.memoizedProps.value;De(io,s._currentValue),s._currentValue=l;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(De(Fe,Fe.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Uc(e,t,r):(De(Fe,Fe.current&1),e=Zt(e,t,r),e!==null?e.sibling:null);De(Fe,Fe.current&1);break;case 19:if(s=(r&t.childLanes)!==0,(e.flags&128)!==0){if(s)return Vc(e,t,r);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),De(Fe,Fe.current),s)break;return null;case 22:case 23:return t.lanes=0,Oc(e,t,r)}return Zt(e,t,r)}var Wc,Pa,Hc,Gc;Wc=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Pa=function(){},Hc=function(e,t,r,s){var l=e.memoizedProps;if(l!==s){e=t.stateNode,Dr(At.current);var i=null;switch(r){case"input":l=nt(e,l),s=nt(e,s),i=[];break;case"select":l=G({},l,{value:void 0}),s=G({},s,{value:void 0}),i=[];break;case"textarea":l=Yr(e,l),s=Yr(e,s),i=[];break;default:typeof l.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Xs)}dl(r,s);var u;r=null;for(D in l)if(!s.hasOwnProperty(D)&&l.hasOwnProperty(D)&&l[D]!=null)if(D==="style"){var g=l[D];for(u in g)g.hasOwnProperty(u)&&(r||(r={}),r[u]="")}else D!=="dangerouslySetInnerHTML"&&D!=="children"&&D!=="suppressContentEditableWarning"&&D!=="suppressHydrationWarning"&&D!=="autoFocus"&&(f.hasOwnProperty(D)?i||(i=[]):(i=i||[]).push(D,null));for(D in s){var y=s[D];if(g=l!=null?l[D]:void 0,s.hasOwnProperty(D)&&y!==g&&(y!=null||g!=null))if(D==="style")if(g){for(u in g)!g.hasOwnProperty(u)||y&&y.hasOwnProperty(u)||(r||(r={}),r[u]="");for(u in y)y.hasOwnProperty(u)&&g[u]!==y[u]&&(r||(r={}),r[u]=y[u])}else r||(i||(i=[]),i.push(D,r)),r=y;else D==="dangerouslySetInnerHTML"?(y=y?y.__html:void 0,g=g?g.__html:void 0,y!=null&&g!==y&&(i=i||[]).push(D,y)):D==="children"?typeof y!="string"&&typeof y!="number"||(i=i||[]).push(D,""+y):D!=="suppressContentEditableWarning"&&D!=="suppressHydrationWarning"&&(f.hasOwnProperty(D)?(y!=null&&D==="onScroll"&&Ae("scroll",e),i||g===y||(i=[])):(i=i||[]).push(D,y))}r&&(i=i||[]).push("style",r);var D=i;(t.updateQueue=D)&&(t.flags|=4)}},Gc=function(e,t,r,s){r!==s&&(t.flags|=4)};function hs(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var l=e.child;l!==null;)r|=l.lanes|l.childLanes,s|=l.subtreeFlags&14680064,s|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)r|=l.lanes|l.childLanes,s|=l.subtreeFlags,s|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function Sm(e,t,r){var s=t.pendingProps;switch(Yl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return it(t.type)&&to(),tt(t),null;case 3:return s=t.stateNode,gn(),Oe(at),Oe(Xe),ca(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(lo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Et!==null&&($a(Et),Et=null))),Pa(e,t),tt(t),null;case 5:ia(t);var l=Dr(cs.current);if(r=t.type,e!==null&&t.stateNode!=null)Hc(e,t,r,s,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(a(166));return tt(t),null}if(e=Dr(At.current),lo(t)){s=t.stateNode,r=t.type;var i=t.memoizedProps;switch(s[Lt]=t,s[os]=i,e=(t.mode&1)!==0,r){case"dialog":Ae("cancel",s),Ae("close",s);break;case"iframe":case"object":case"embed":Ae("load",s);break;case"video":case"audio":for(l=0;l<rs.length;l++)Ae(rs[l],s);break;case"source":Ae("error",s);break;case"img":case"image":case"link":Ae("error",s),Ae("load",s);break;case"details":Ae("toggle",s);break;case"input":On(s,i),Ae("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},Ae("invalid",s);break;case"textarea":In(s,i),Ae("invalid",s)}dl(r,i),l=null;for(var u in i)if(i.hasOwnProperty(u)){var g=i[u];u==="children"?typeof g=="string"?s.textContent!==g&&(i.suppressHydrationWarning!==!0&&Js(s.textContent,g,e),l=["children",g]):typeof g=="number"&&s.textContent!==""+g&&(i.suppressHydrationWarning!==!0&&Js(s.textContent,g,e),l=["children",""+g]):f.hasOwnProperty(u)&&g!=null&&u==="onScroll"&&Ae("scroll",s)}switch(r){case"input":Le(s),er(s,i,!0);break;case"textarea":Le(s),re(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=Xs)}s=l,t.updateQueue=s,s!==null&&(t.flags|=4)}else{u=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ve(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=u.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=u.createElement(r,{is:s.is}):(e=u.createElement(r),r==="select"&&(u=e,s.multiple?u.multiple=!0:s.size&&(u.size=s.size))):e=u.createElementNS(e,r),e[Lt]=t,e[os]=s,Wc(e,t,!1,!1),t.stateNode=e;e:{switch(u=cl(r,s),r){case"dialog":Ae("cancel",e),Ae("close",e),l=s;break;case"iframe":case"object":case"embed":Ae("load",e),l=s;break;case"video":case"audio":for(l=0;l<rs.length;l++)Ae(rs[l],e);l=s;break;case"source":Ae("error",e),l=s;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),l=s;break;case"details":Ae("toggle",e),l=s;break;case"input":On(e,s),l=nt(e,s),Ae("invalid",e);break;case"option":l=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},l=G({},s,{value:void 0}),Ae("invalid",e);break;case"textarea":In(e,s),l=Yr(e,s),Ae("invalid",e);break;default:l=s}dl(r,l),g=l;for(i in g)if(g.hasOwnProperty(i)){var y=g[i];i==="style"?Ai(e,y):i==="dangerouslySetInnerHTML"?(y=y?y.__html:void 0,y!=null&&Nt(e,y)):i==="children"?typeof y=="string"?(r!=="textarea"||y!=="")&&Bt(e,y):typeof y=="number"&&Bt(e,""+y):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(f.hasOwnProperty(i)?y!=null&&i==="onScroll"&&Ae("scroll",e):y!=null&&Z(e,i,y,u))}switch(r){case"input":Le(e),er(e,s,!1);break;case"textarea":Le(e),re(e);break;case"option":s.value!=null&&e.setAttribute("value",""+me(s.value));break;case"select":e.multiple=!!s.multiple,i=s.value,i!=null?Ut(e,!!s.multiple,i,!1):s.defaultValue!=null&&Ut(e,!!s.multiple,s.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Xs)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tt(t),null;case 6:if(e&&t.stateNode!=null)Gc(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(a(166));if(r=Dr(cs.current),Dr(At.current),lo(t)){if(s=t.stateNode,r=t.memoizedProps,s[Lt]=t,(i=s.nodeValue!==r)&&(e=mt,e!==null))switch(e.tag){case 3:Js(s.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Js(s.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[Lt]=t,t.stateNode=s}return tt(t),null;case 13:if(Oe(Fe),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ie&&ht!==null&&(t.mode&1)!==0&&(t.flags&128)===0)qd(),pn(),t.flags|=98560,i=!1;else if(i=lo(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));i[Lt]=t}else pn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else Et!==null&&($a(Et),Et=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Fe.current&1)!==0?Ge===0&&(Ge=3):Va())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return gn(),Pa(e,t),e===null&&ns(t.stateNode.containerInfo),tt(t),null;case 10:return na(t.type._context),tt(t),null;case 17:return it(t.type)&&to(),tt(t),null;case 19:if(Oe(Fe),i=t.memoizedState,i===null)return tt(t),null;if(s=(t.flags&128)!==0,u=i.rendering,u===null)if(s)hs(i,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=po(e),u!==null){for(t.flags|=128,hs(i,!1),s=u.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=r,r=t.child;r!==null;)i=r,e=s,i.flags&=14680066,u=i.alternate,u===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,e=u.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return De(Fe,Fe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Be()>wn&&(t.flags|=128,s=!0,hs(i,!1),t.lanes=4194304)}else{if(!s)if(e=po(u),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),hs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!u.alternate&&!Ie)return tt(t),null}else 2*Be()-i.renderingStartTime>wn&&r!==1073741824&&(t.flags|=128,s=!0,hs(i,!1),t.lanes=4194304);i.isBackwards?(u.sibling=t.child,t.child=u):(r=i.last,r!==null?r.sibling=u:t.child=u,i.last=u)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Be(),t.sibling=null,r=Fe.current,De(Fe,s?r&1|2:r&1),t):(tt(t),null);case 22:case 23:return Ba(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(xt&1073741824)!==0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function Cm(e,t){switch(Yl(t),t.tag){case 1:return it(t.type)&&to(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gn(),Oe(at),Oe(Xe),ca(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ia(t),null;case 13:if(Oe(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Fe),null;case 4:return gn(),null;case 10:return na(t.type._context),null;case 22:case 23:return Ba(),null;case 24:return null;default:return null}}var jo=!1,rt=!1,Em=typeof WeakSet=="function"?WeakSet:Set,le=null;function yn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){Ue(e,t,s)}else r.current=null}function Ma(e,t,r){try{r()}catch(s){Ue(e,t,s)}}var Kc=!1;function _m(e,t){if(Bl=Us,e=Sd(),Ll(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var l=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var u=0,g=-1,y=-1,D=0,U=0,V=e,$=null;t:for(;;){for(var te;V!==r||l!==0&&V.nodeType!==3||(g=u+l),V!==i||s!==0&&V.nodeType!==3||(y=u+s),V.nodeType===3&&(u+=V.nodeValue.length),(te=V.firstChild)!==null;)$=V,V=te;for(;;){if(V===e)break t;if($===r&&++D===l&&(g=u),$===i&&++U===s&&(y=u),(te=V.nextSibling)!==null)break;V=$,$=V.parentNode}V=te}r=g===-1||y===-1?null:{start:g,end:y}}else r=null}r=r||{start:0,end:0}}else r=null;for(Vl={focusedElem:e,selectionRange:r},Us=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var ie=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ie!==null){var de=ie.memoizedProps,Ve=ie.memoizedState,P=t.stateNode,N=P.getSnapshotBeforeUpdate(t.elementType===t.type?de:_t(t.type,de),Ve);P.__reactInternalSnapshotBeforeUpdate=N}break;case 3:var R=t.stateNode.containerInfo;R.nodeType===1?R.textContent="":R.nodeType===9&&R.documentElement&&R.removeChild(R.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(q){Ue(t,t.return,q)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return ie=Kc,Kc=!1,ie}function xs(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var l=s=s.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Ma(t,r,i)}l=l.next}while(l!==s)}}function ko(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function Ra(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Qc(e){var t=e.alternate;t!==null&&(e.alternate=null,Qc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lt],delete t[os],delete t[Kl],delete t[cm],delete t[um])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qc(e){return e.tag===5||e.tag===3||e.tag===4}function Zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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.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 za(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Xs));else if(s!==4&&(e=e.child,e!==null))for(za(e,t,r),e=e.sibling;e!==null;)za(e,t,r),e=e.sibling}function Da(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Da(e,t,r),e=e.sibling;e!==null;)Da(e,t,r),e=e.sibling}var Ze=null,Pt=!1;function mr(e,t,r){for(r=r.child;r!==null;)Yc(e,t,r),r=r.sibling}function Yc(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(As,r)}catch{}switch(r.tag){case 5:rt||yn(r,t);case 6:var s=Ze,l=Pt;Ze=null,mr(e,t,r),Ze=s,Pt=l,Ze!==null&&(Pt?(e=Ze,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ze.removeChild(r.stateNode));break;case 18:Ze!==null&&(Pt?(e=Ze,r=r.stateNode,e.nodeType===8?Gl(e.parentNode,r):e.nodeType===1&&Gl(e,r),Qn(e)):Gl(Ze,r.stateNode));break;case 4:s=Ze,l=Pt,Ze=r.stateNode.containerInfo,Pt=!0,mr(e,t,r),Ze=s,Pt=l;break;case 0:case 11:case 14:case 15:if(!rt&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){l=s=s.next;do{var i=l,u=i.destroy;i=i.tag,u!==void 0&&((i&2)!==0||(i&4)!==0)&&Ma(r,t,u),l=l.next}while(l!==s)}mr(e,t,r);break;case 1:if(!rt&&(yn(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(g){Ue(r,t,g)}mr(e,t,r);break;case 21:mr(e,t,r);break;case 22:r.mode&1?(rt=(s=rt)||r.memoizedState!==null,mr(e,t,r),rt=s):mr(e,t,r);break;default:mr(e,t,r)}}function Jc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Em),t.forEach(function(s){var l=Tm.bind(null,e,s);r.has(s)||(r.add(s),s.then(l,l))})}}function Mt(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var l=r[s];try{var i=e,u=t,g=u;e:for(;g!==null;){switch(g.tag){case 5:Ze=g.stateNode,Pt=!1;break e;case 3:Ze=g.stateNode.containerInfo,Pt=!0;break e;case 4:Ze=g.stateNode.containerInfo,Pt=!0;break e}g=g.return}if(Ze===null)throw Error(a(160));Yc(i,u,l),Ze=null,Pt=!1;var y=l.alternate;y!==null&&(y.return=null),l.return=null}catch(D){Ue(l,t,D)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Xc(t,e),t=t.sibling}function Xc(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mt(t,e),Tt(e),s&4){try{xs(3,e,e.return),ko(3,e)}catch(de){Ue(e,e.return,de)}try{xs(5,e,e.return)}catch(de){Ue(e,e.return,de)}}break;case 1:Mt(t,e),Tt(e),s&512&&r!==null&&yn(r,r.return);break;case 5:if(Mt(t,e),Tt(e),s&512&&r!==null&&yn(r,r.return),e.flags&32){var l=e.stateNode;try{Bt(l,"")}catch(de){Ue(e,e.return,de)}}if(s&4&&(l=e.stateNode,l!=null)){var i=e.memoizedProps,u=r!==null?r.memoizedProps:i,g=e.type,y=e.updateQueue;if(e.updateQueue=null,y!==null)try{g==="input"&&i.type==="radio"&&i.name!=null&&Tn(l,i),cl(g,u);var D=cl(g,i);for(u=0;u<y.length;u+=2){var U=y[u],V=y[u+1];U==="style"?Ai(l,V):U==="dangerouslySetInnerHTML"?Nt(l,V):U==="children"?Bt(l,V):Z(l,U,V,D)}switch(g){case"input":qr(l,i);break;case"textarea":z(l,i);break;case"select":var $=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!i.multiple;var te=i.value;te!=null?Ut(l,!!i.multiple,te,!1):$!==!!i.multiple&&(i.defaultValue!=null?Ut(l,!!i.multiple,i.defaultValue,!0):Ut(l,!!i.multiple,i.multiple?[]:"",!1))}l[os]=i}catch(de){Ue(e,e.return,de)}}break;case 6:if(Mt(t,e),Tt(e),s&4){if(e.stateNode===null)throw Error(a(162));l=e.stateNode,i=e.memoizedProps;try{l.nodeValue=i}catch(de){Ue(e,e.return,de)}}break;case 3:if(Mt(t,e),Tt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Qn(t.containerInfo)}catch(de){Ue(e,e.return,de)}break;case 4:Mt(t,e),Tt(e);break;case 13:Mt(t,e),Tt(e),l=e.child,l.flags&8192&&(i=l.memoizedState!==null,l.stateNode.isHidden=i,!i||l.alternate!==null&&l.alternate.memoizedState!==null||(Oa=Be())),s&4&&Jc(e);break;case 22:if(U=r!==null&&r.memoizedState!==null,e.mode&1?(rt=(D=rt)||U,Mt(t,e),rt=D):Mt(t,e),Tt(e),s&8192){if(D=e.memoizedState!==null,(e.stateNode.isHidden=D)&&!U&&(e.mode&1)!==0)for(le=e,U=e.child;U!==null;){for(V=le=U;le!==null;){switch($=le,te=$.child,$.tag){case 0:case 11:case 14:case 15:xs(4,$,$.return);break;case 1:yn($,$.return);var ie=$.stateNode;if(typeof ie.componentWillUnmount=="function"){s=$,r=$.return;try{t=s,ie.props=t.memoizedProps,ie.state=t.memoizedState,ie.componentWillUnmount()}catch(de){Ue(s,r,de)}}break;case 5:yn($,$.return);break;case 22:if($.memoizedState!==null){ru(V);continue}}te!==null?(te.return=$,le=te):ru(V)}U=U.sibling}e:for(U=null,V=e;;){if(V.tag===5){if(U===null){U=V;try{l=V.stateNode,D?(i=l.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(g=V.stateNode,y=V.memoizedProps.style,u=y!=null&&y.hasOwnProperty("display")?y.display:null,g.style.display=Li("display",u))}catch(de){Ue(e,e.return,de)}}}else if(V.tag===6){if(U===null)try{V.stateNode.nodeValue=D?"":V.memoizedProps}catch(de){Ue(e,e.return,de)}}else if((V.tag!==22&&V.tag!==23||V.memoizedState===null||V===e)&&V.child!==null){V.child.return=V,V=V.child;continue}if(V===e)break e;for(;V.sibling===null;){if(V.return===null||V.return===e)break e;U===V&&(U=null),V=V.return}U===V&&(U=null),V.sibling.return=V.return,V=V.sibling}}break;case 19:Mt(t,e),Tt(e),s&4&&Jc(e);break;case 21:break;default:Mt(t,e),Tt(e)}}function Tt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(qc(r)){var s=r;break e}r=r.return}throw Error(a(160))}switch(s.tag){case 5:var l=s.stateNode;s.flags&32&&(Bt(l,""),s.flags&=-33);var i=Zc(e);Da(e,i,l);break;case 3:case 4:var u=s.stateNode.containerInfo,g=Zc(e);za(e,g,u);break;default:throw Error(a(161))}}catch(y){Ue(e,e.return,y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pm(e,t,r){le=e,eu(e)}function eu(e,t,r){for(var s=(e.mode&1)!==0;le!==null;){var l=le,i=l.child;if(l.tag===22&&s){var u=l.memoizedState!==null||jo;if(!u){var g=l.alternate,y=g!==null&&g.memoizedState!==null||rt;g=jo;var D=rt;if(jo=u,(rt=y)&&!D)for(le=l;le!==null;)u=le,y=u.child,u.tag===22&&u.memoizedState!==null?nu(l):y!==null?(y.return=u,le=y):nu(l);for(;i!==null;)le=i,eu(i),i=i.sibling;le=l,jo=g,rt=D}tu(e)}else(l.subtreeFlags&8772)!==0&&i!==null?(i.return=l,le=i):tu(e)}}function tu(e){for(;le!==null;){var t=le;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:rt||ko(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!rt)if(r===null)s.componentDidMount();else{var l=t.elementType===t.type?r.memoizedProps:_t(t.type,r.memoizedProps);s.componentDidUpdate(l,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&rc(t,i,s);break;case 3:var u=t.updateQueue;if(u!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}rc(t,u,r)}break;case 5:var g=t.stateNode;if(r===null&&t.flags&4){r=g;var y=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":y.autoFocus&&r.focus();break;case"img":y.src&&(r.src=y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var D=t.alternate;if(D!==null){var U=D.memoizedState;if(U!==null){var V=U.dehydrated;V!==null&&Qn(V)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}rt||t.flags&512&&Ra(t)}catch($){Ue(t,t.return,$)}}if(t===e){le=null;break}if(r=t.sibling,r!==null){r.return=t.return,le=r;break}le=t.return}}function ru(e){for(;le!==null;){var t=le;if(t===e){le=null;break}var r=t.sibling;if(r!==null){r.return=t.return,le=r;break}le=t.return}}function nu(e){for(;le!==null;){var t=le;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ko(4,t)}catch(y){Ue(t,r,y)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var l=t.return;try{s.componentDidMount()}catch(y){Ue(t,l,y)}}var i=t.return;try{Ra(t)}catch(y){Ue(t,i,y)}break;case 5:var u=t.return;try{Ra(t)}catch(y){Ue(t,u,y)}}}catch(y){Ue(t,t.return,y)}if(t===e){le=null;break}var g=t.sibling;if(g!==null){g.return=t.return,le=g;break}le=t.return}}var Mm=Math.ceil,No=Y.ReactCurrentDispatcher,La=Y.ReactCurrentOwner,jt=Y.ReactCurrentBatchConfig,Ce=0,Qe=null,We=null,Ye=0,xt=0,bn=dr(0),Ge=0,gs=null,Ar=0,So=0,Aa=0,vs=null,ct=null,Oa=0,wn=1/0,Yt=null,Co=!1,Ta=null,hr=null,Eo=!1,xr=null,_o=0,ys=0,Ia=null,Po=-1,Mo=0;function ot(){return(Ce&6)!==0?Be():Po!==-1?Po:Po=Be()}function gr(e){return(e.mode&1)===0?1:(Ce&2)!==0&&Ye!==0?Ye&-Ye:pm.transition!==null?(Mo===0&&(Mo=Zi()),Mo):(e=Re,e!==0||(e=window.event,e=e===void 0?16:od(e.type)),e)}function Rt(e,t,r,s){if(50<ys)throw ys=0,Ia=null,Error(a(185));Vn(e,r,s),((Ce&2)===0||e!==Qe)&&(e===Qe&&((Ce&2)===0&&(So|=r),Ge===4&&vr(e,Ye)),ut(e,s),r===1&&Ce===0&&(t.mode&1)===0&&(wn=Be()+500,no&&ur()))}function ut(e,t){var r=e.callbackNode;pp(e,t);var s=Is(e,e===Qe?Ye:0);if(s===0)r!==null&&Ki(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&Ki(r),t===1)e.tag===0?fm(ou.bind(null,e)):Wd(ou.bind(null,e)),im(function(){(Ce&6)===0&&ur()}),r=null;else{switch(Yi(s)){case 1:r=gl;break;case 4:r=Qi;break;case 16:r=Ls;break;case 536870912:r=qi;break;default:r=Ls}r=pu(r,su.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function su(e,t){if(Po=-1,Mo=0,(Ce&6)!==0)throw Error(a(327));var r=e.callbackNode;if(jn()&&e.callbackNode!==r)return null;var s=Is(e,e===Qe?Ye:0);if(s===0)return null;if((s&30)!==0||(s&e.expiredLanes)!==0||t)t=Ro(e,s);else{t=s;var l=Ce;Ce|=2;var i=au();(Qe!==e||Ye!==t)&&(Yt=null,wn=Be()+500,Tr(e,t));do try{Dm();break}catch(g){lu(e,g)}while(!0);ra(),No.current=i,Ce=l,We!==null?t=0:(Qe=null,Ye=0,t=Ge)}if(t!==0){if(t===2&&(l=vl(e),l!==0&&(s=l,t=Fa(e,l))),t===1)throw r=gs,Tr(e,0),vr(e,s),ut(e,Be()),r;if(t===6)vr(e,s);else{if(l=e.current.alternate,(s&30)===0&&!Rm(l)&&(t=Ro(e,s),t===2&&(i=vl(e),i!==0&&(s=i,t=Fa(e,i))),t===1))throw r=gs,Tr(e,0),vr(e,s),ut(e,Be()),r;switch(e.finishedWork=l,e.finishedLanes=s,t){case 0:case 1:throw Error(a(345));case 2:Ir(e,ct,Yt);break;case 3:if(vr(e,s),(s&130023424)===s&&(t=Oa+500-Be(),10<t)){if(Is(e,0)!==0)break;if(l=e.suspendedLanes,(l&s)!==s){ot(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=Hl(Ir.bind(null,e,ct,Yt),t);break}Ir(e,ct,Yt);break;case 4:if(vr(e,s),(s&4194240)===s)break;for(t=e.eventTimes,l=-1;0<s;){var u=31-St(s);i=1<<u,u=t[u],u>l&&(l=u),s&=~i}if(s=l,s=Be()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Mm(s/1960))-s,10<s){e.timeoutHandle=Hl(Ir.bind(null,e,ct,Yt),s);break}Ir(e,ct,Yt);break;case 5:Ir(e,ct,Yt);break;default:throw Error(a(329))}}}return ut(e,Be()),e.callbackNode===r?su.bind(null,e):null}function Fa(e,t){var r=vs;return e.current.memoizedState.isDehydrated&&(Tr(e,t).flags|=256),e=Ro(e,t),e!==2&&(t=ct,ct=r,t!==null&&$a(t)),e}function $a(e){ct===null?ct=e:ct.push.apply(ct,e)}function Rm(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var l=r[s],i=l.getSnapshot;l=l.value;try{if(!Ct(i(),l))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 vr(e,t){for(t&=~Aa,t&=~So,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-St(t),s=1<<r;e[r]=-1,t&=~s}}function ou(e){if((Ce&6)!==0)throw Error(a(327));jn();var t=Is(e,0);if((t&1)===0)return ut(e,Be()),null;var r=Ro(e,t);if(e.tag!==0&&r===2){var s=vl(e);s!==0&&(t=s,r=Fa(e,s))}if(r===1)throw r=gs,Tr(e,0),vr(e,t),ut(e,Be()),r;if(r===6)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ir(e,ct,Yt),ut(e,Be()),null}function Ua(e,t){var r=Ce;Ce|=1;try{return e(t)}finally{Ce=r,Ce===0&&(wn=Be()+500,no&&ur())}}function Or(e){xr!==null&&xr.tag===0&&(Ce&6)===0&&jn();var t=Ce;Ce|=1;var r=jt.transition,s=Re;try{if(jt.transition=null,Re=1,e)return e()}finally{Re=s,jt.transition=r,Ce=t,(Ce&6)===0&&ur()}}function Ba(){xt=bn.current,Oe(bn)}function Tr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,am(r)),We!==null)for(r=We.return;r!==null;){var s=r;switch(Yl(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&to();break;case 3:gn(),Oe(at),Oe(Xe),ca();break;case 5:ia(s);break;case 4:gn();break;case 13:Oe(Fe);break;case 19:Oe(Fe);break;case 10:na(s.type._context);break;case 22:case 23:Ba()}r=r.return}if(Qe=e,We=e=yr(e.current,null),Ye=xt=t,Ge=0,gs=null,Aa=So=Ar=0,ct=vs=null,zr!==null){for(t=0;t<zr.length;t++)if(r=zr[t],s=r.interleaved,s!==null){r.interleaved=null;var l=s.next,i=r.pending;if(i!==null){var u=i.next;i.next=l,s.next=u}r.pending=s}zr=null}return e}function lu(e,t){do{var r=We;try{if(ra(),mo.current=vo,ho){for(var s=$e.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}ho=!1}if(Lr=0,Ke=He=$e=null,us=!1,fs=0,La.current=null,r===null||r.return===null){Ge=1,gs=t,We=null;break}e:{var i=e,u=r.return,g=r,y=t;if(t=Ye,g.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){var D=y,U=g,V=U.tag;if((U.mode&1)===0&&(V===0||V===11||V===15)){var $=U.alternate;$?(U.updateQueue=$.updateQueue,U.memoizedState=$.memoizedState,U.lanes=$.lanes):(U.updateQueue=null,U.memoizedState=null)}var te=Rc(u);if(te!==null){te.flags&=-257,zc(te,u,g,i,t),te.mode&1&&Mc(i,D,t),t=te,y=D;var ie=t.updateQueue;if(ie===null){var de=new Set;de.add(y),t.updateQueue=de}else ie.add(y);break e}else{if((t&1)===0){Mc(i,D,t),Va();break e}y=Error(a(426))}}else if(Ie&&g.mode&1){var Ve=Rc(u);if(Ve!==null){(Ve.flags&65536)===0&&(Ve.flags|=256),zc(Ve,u,g,i,t),ea(vn(y,g));break e}}i=y=vn(y,g),Ge!==4&&(Ge=2),vs===null?vs=[i]:vs.push(i),i=u;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var P=_c(i,y,t);tc(i,P);break e;case 1:g=y;var N=i.type,R=i.stateNode;if((i.flags&128)===0&&(typeof N.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(hr===null||!hr.has(R)))){i.flags|=65536,t&=-t,i.lanes|=t;var q=Pc(i,g,t);tc(i,q);break e}}i=i.return}while(i!==null)}du(r)}catch(ue){t=ue,We===r&&r!==null&&(We=r=r.return);continue}break}while(!0)}function au(){var e=No.current;return No.current=vo,e===null?vo:e}function Va(){(Ge===0||Ge===3||Ge===2)&&(Ge=4),Qe===null||(Ar&268435455)===0&&(So&268435455)===0||vr(Qe,Ye)}function Ro(e,t){var r=Ce;Ce|=2;var s=au();(Qe!==e||Ye!==t)&&(Yt=null,Tr(e,t));do try{zm();break}catch(l){lu(e,l)}while(!0);if(ra(),Ce=r,No.current=s,We!==null)throw Error(a(261));return Qe=null,Ye=0,Ge}function zm(){for(;We!==null;)iu(We)}function Dm(){for(;We!==null&&!sp();)iu(We)}function iu(e){var t=fu(e.alternate,e,xt);e.memoizedProps=e.pendingProps,t===null?du(e):We=t,La.current=null}function du(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Sm(r,t,xt),r!==null){We=r;return}}else{if(r=Cm(r,t),r!==null){r.flags&=32767,We=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ge=6,We=null;return}}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Ge===0&&(Ge=5)}function Ir(e,t,r){var s=Re,l=jt.transition;try{jt.transition=null,Re=1,Lm(e,t,r,s)}finally{jt.transition=l,Re=s}return null}function Lm(e,t,r,s){do jn();while(xr!==null);if((Ce&6)!==0)throw Error(a(327));r=e.finishedWork;var l=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(mp(e,i),e===Qe&&(We=Qe=null,Ye=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Eo||(Eo=!0,pu(Ls,function(){return jn(),null})),i=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||i){i=jt.transition,jt.transition=null;var u=Re;Re=1;var g=Ce;Ce|=4,La.current=null,_m(e,r),Xc(r,e),em(Vl),Us=!!Bl,Vl=Bl=null,e.current=r,Pm(r),op(),Ce=g,Re=u,jt.transition=i}else e.current=r;if(Eo&&(Eo=!1,xr=e,_o=l),i=e.pendingLanes,i===0&&(hr=null),ip(r.stateNode),ut(e,Be()),t!==null)for(s=e.onRecoverableError,r=0;r<t.length;r++)l=t[r],s(l.value,{componentStack:l.stack,digest:l.digest});if(Co)throw Co=!1,e=Ta,Ta=null,e;return(_o&1)!==0&&e.tag!==0&&jn(),i=e.pendingLanes,(i&1)!==0?e===Ia?ys++:(ys=0,Ia=e):ys=0,ur(),null}function jn(){if(xr!==null){var e=Yi(_o),t=jt.transition,r=Re;try{if(jt.transition=null,Re=16>e?16:e,xr===null)var s=!1;else{if(e=xr,xr=null,_o=0,(Ce&6)!==0)throw Error(a(331));var l=Ce;for(Ce|=4,le=e.current;le!==null;){var i=le,u=i.child;if((le.flags&16)!==0){var g=i.deletions;if(g!==null){for(var y=0;y<g.length;y++){var D=g[y];for(le=D;le!==null;){var U=le;switch(U.tag){case 0:case 11:case 15:xs(8,U,i)}var V=U.child;if(V!==null)V.return=U,le=V;else for(;le!==null;){U=le;var $=U.sibling,te=U.return;if(Qc(U),U===D){le=null;break}if($!==null){$.return=te,le=$;break}le=te}}}var ie=i.alternate;if(ie!==null){var de=ie.child;if(de!==null){ie.child=null;do{var Ve=de.sibling;de.sibling=null,de=Ve}while(de!==null)}}le=i}}if((i.subtreeFlags&2064)!==0&&u!==null)u.return=i,le=u;else e:for(;le!==null;){if(i=le,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:xs(9,i,i.return)}var P=i.sibling;if(P!==null){P.return=i.return,le=P;break e}le=i.return}}var N=e.current;for(le=N;le!==null;){u=le;var R=u.child;if((u.subtreeFlags&2064)!==0&&R!==null)R.return=u,le=R;else e:for(u=N;le!==null;){if(g=le,(g.flags&2048)!==0)try{switch(g.tag){case 0:case 11:case 15:ko(9,g)}}catch(ue){Ue(g,g.return,ue)}if(g===u){le=null;break e}var q=g.sibling;if(q!==null){q.return=g.return,le=q;break e}le=g.return}}if(Ce=l,ur(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(As,e)}catch{}s=!0}return s}finally{Re=r,jt.transition=t}}return!1}function cu(e,t,r){t=vn(r,t),t=_c(e,t,1),e=pr(e,t,1),t=ot(),e!==null&&(Vn(e,1,t),ut(e,t))}function Ue(e,t,r){if(e.tag===3)cu(e,e,r);else for(;t!==null;){if(t.tag===3){cu(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(hr===null||!hr.has(s))){e=vn(r,e),e=Pc(t,e,1),t=pr(t,e,1),e=ot(),t!==null&&(Vn(t,1,e),ut(t,e));break}}t=t.return}}function Am(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=ot(),e.pingedLanes|=e.suspendedLanes&r,Qe===e&&(Ye&r)===r&&(Ge===4||Ge===3&&(Ye&130023424)===Ye&&500>Be()-Oa?Tr(e,0):Aa|=r),ut(e,t)}function uu(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ts,Ts<<=1,(Ts&130023424)===0&&(Ts=4194304)));var r=ot();e=Qt(e,t),e!==null&&(Vn(e,t,r),ut(e,r))}function Om(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),uu(e,r)}function Tm(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,l=e.memoizedState;l!==null&&(r=l.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(a(314))}s!==null&&s.delete(t),uu(e,r)}var fu;fu=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)dt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return dt=!1,Nm(e,t,r);dt=(e.flags&131072)!==0}else dt=!1,Ie&&(t.flags&1048576)!==0&&Hd(t,oo,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;wo(e,t),e=t.pendingProps;var l=cn(t,Xe.current);xn(t,r),l=pa(null,t,s,e,l,r);var i=ma();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,it(s)?(i=!0,ro(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,la(t),l.updater=yo,t.stateNode=l,l._reactInternals=t,ba(t,s,e,r),t=Na(null,t,s,!0,i,r)):(t.tag=0,Ie&&i&&Zl(t),st(null,t,l,r),t=t.child),t;case 16:s=t.elementType;e:{switch(wo(e,t),e=t.pendingProps,l=s._init,s=l(s._payload),t.type=s,l=t.tag=Fm(s),e=_t(s,e),l){case 0:t=ka(null,t,s,e,r);break e;case 1:t=Ic(null,t,s,e,r);break e;case 11:t=Dc(null,t,s,e,r);break e;case 14:t=Lc(null,t,s,_t(s.type,e),r);break e}throw Error(a(306,s,""))}return t;case 0:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:_t(s,l),ka(e,t,s,l,r);case 1:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:_t(s,l),Ic(e,t,s,l,r);case 3:e:{if(Fc(t),e===null)throw Error(a(387));s=t.pendingProps,i=t.memoizedState,l=i.element,ec(e,t),fo(t,s,null,r);var u=t.memoizedState;if(s=u.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=vn(Error(a(423)),t),t=$c(e,t,s,r,l);break e}else if(s!==l){l=vn(Error(a(424)),t),t=$c(e,t,s,r,l);break e}else for(ht=ir(t.stateNode.containerInfo.firstChild),mt=t,Ie=!0,Et=null,r=Jd(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(pn(),s===l){t=Zt(e,t,r);break e}st(e,t,s,r)}t=t.child}return t;case 5:return nc(t),e===null&&Xl(t),s=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,u=l.children,Wl(s,l)?u=null:i!==null&&Wl(s,i)&&(t.flags|=32),Tc(e,t),st(e,t,u,r),t.child;case 6:return e===null&&Xl(t),null;case 13:return Uc(e,t,r);case 4:return aa(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=mn(t,null,s,r):st(e,t,s,r),t.child;case 11:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:_t(s,l),Dc(e,t,s,l,r);case 7:return st(e,t,t.pendingProps,r),t.child;case 8:return st(e,t,t.pendingProps.children,r),t.child;case 12:return st(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,l=t.pendingProps,i=t.memoizedProps,u=l.value,De(io,s._currentValue),s._currentValue=u,i!==null)if(Ct(i.value,u)){if(i.children===l.children&&!at.current){t=Zt(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var g=i.dependencies;if(g!==null){u=i.child;for(var y=g.firstContext;y!==null;){if(y.context===s){if(i.tag===1){y=qt(-1,r&-r),y.tag=2;var D=i.updateQueue;if(D!==null){D=D.shared;var U=D.pending;U===null?y.next=y:(y.next=U.next,U.next=y),D.pending=y}}i.lanes|=r,y=i.alternate,y!==null&&(y.lanes|=r),sa(i.return,r,t),g.lanes|=r;break}y=y.next}}else if(i.tag===10)u=i.type===t.type?null:i.child;else if(i.tag===18){if(u=i.return,u===null)throw Error(a(341));u.lanes|=r,g=u.alternate,g!==null&&(g.lanes|=r),sa(u,r,t),u=i.sibling}else u=i.child;if(u!==null)u.return=i;else for(u=i;u!==null;){if(u===t){u=null;break}if(i=u.sibling,i!==null){i.return=u.return,u=i;break}u=u.return}i=u}st(e,t,l.children,r),t=t.child}return t;case 9:return l=t.type,s=t.pendingProps.children,xn(t,r),l=bt(l),s=s(l),t.flags|=1,st(e,t,s,r),t.child;case 14:return s=t.type,l=_t(s,t.pendingProps),l=_t(s.type,l),Lc(e,t,s,l,r);case 15:return Ac(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:_t(s,l),wo(e,t),t.tag=1,it(s)?(e=!0,ro(t)):e=!1,xn(t,r),Cc(t,s,l),ba(t,s,l,r),Na(null,t,s,!0,e,r);case 19:return Vc(e,t,r);case 22:return Oc(e,t,r)}throw Error(a(156,t.tag))};function pu(e,t){return Gi(e,t)}function Im(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,r,s){return new Im(e,t,r,s)}function Wa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fm(e){if(typeof e=="function")return Wa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ce)return 11;if(e===Me)return 14}return 2}function yr(e,t){var r=e.alternate;return r===null?(r=kt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function zo(e,t,r,s,l,i){var u=2;if(s=e,typeof e=="function")Wa(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case F:return Fr(r.children,l,i,t);case ne:u=8,l|=8;break;case se:return e=kt(12,r,t,l|2),e.elementType=se,e.lanes=i,e;case Pe:return e=kt(13,r,t,l),e.elementType=Pe,e.lanes=i,e;case _e:return e=kt(19,r,t,l),e.elementType=_e,e.lanes=i,e;case ke:return Do(r,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:u=10;break e;case ye:u=9;break e;case ce:u=11;break e;case Me:u=14;break e;case Ne:u=16,s=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=kt(u,r,t,l),t.elementType=e,t.type=s,t.lanes=i,t}function Fr(e,t,r,s){return e=kt(7,e,s,t),e.lanes=r,e}function Do(e,t,r,s){return e=kt(22,e,s,t),e.elementType=ke,e.lanes=r,e.stateNode={isHidden:!1},e}function Ha(e,t,r){return e=kt(6,e,null,t),e.lanes=r,e}function Ga(e,t,r){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $m(e,t,r,s,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yl(0),this.expirationTimes=yl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yl(0),this.identifierPrefix=s,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ka(e,t,r,s,l,i,u,g,y){return e=new $m(e,t,r,g,y),t===1?(t=1,i===!0&&(t|=8)):t=0,i=kt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},la(i),e}function Um(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}}function mu(e){if(!e)return cr;e=e._reactInternals;e:{if(Er(e)!==e||e.tag!==1)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(it(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(a(171))}if(e.tag===1){var r=e.type;if(it(r))return Bd(e,r,t)}return t}function hu(e,t,r,s,l,i,u,g,y){return e=Ka(r,s,!0,e,l,i,u,g,y),e.context=mu(null),r=e.current,s=ot(),l=gr(r),i=qt(s,l),i.callback=t??null,pr(r,i,l),e.current.lanes=l,Vn(e,l,s),ut(e,s),e}function Lo(e,t,r,s){var l=t.current,i=ot(),u=gr(l);return r=mu(r),t.context===null?t.context=r:t.pendingContext=r,t=qt(i,u),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=pr(l,t,u),e!==null&&(Rt(e,l,u,i),uo(e,l,u)),u}function Ao(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Qa(e,t){xu(e,t),(e=e.alternate)&&xu(e,t)}function Bm(){return null}var gu=typeof reportError=="function"?reportError:function(e){console.error(e)};function qa(e){this._internalRoot=e}Oo.prototype.render=qa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));Lo(e,t,null,null)},Oo.prototype.unmount=qa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Or(function(){Lo(null,e,null,null)}),t[Wt]=null}};function Oo(e){this._internalRoot=e}Oo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ed();e={blockedOn:null,target:e,priority:t};for(var r=0;r<or.length&&t!==0&&t<or[r].priority;r++);or.splice(r,0,e),r===0&&nd(e)}};function Za(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function To(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function vu(){}function Vm(e,t,r,s,l){if(l){if(typeof s=="function"){var i=s;s=function(){var D=Ao(u);i.call(D)}}var u=hu(t,s,e,0,null,!1,!1,"",vu);return e._reactRootContainer=u,e[Wt]=u.current,ns(e.nodeType===8?e.parentNode:e),Or(),u}for(;l=e.lastChild;)e.removeChild(l);if(typeof s=="function"){var g=s;s=function(){var D=Ao(y);g.call(D)}}var y=Ka(e,0,!1,null,null,!1,!1,"",vu);return e._reactRootContainer=y,e[Wt]=y.current,ns(e.nodeType===8?e.parentNode:e),Or(function(){Lo(t,y,r,s)}),y}function Io(e,t,r,s,l){var i=r._reactRootContainer;if(i){var u=i;if(typeof l=="function"){var g=l;l=function(){var y=Ao(u);g.call(y)}}Lo(t,u,e,l)}else u=Vm(r,t,e,l,s);return Ao(u)}Ji=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Bn(t.pendingLanes);r!==0&&(bl(t,r|1),ut(t,Be()),(Ce&6)===0&&(wn=Be()+500,ur()))}break;case 13:Or(function(){var s=Qt(e,1);if(s!==null){var l=ot();Rt(s,e,1,l)}}),Qa(e,1)}},wl=function(e){if(e.tag===13){var t=Qt(e,134217728);if(t!==null){var r=ot();Rt(t,e,134217728,r)}Qa(e,134217728)}},Xi=function(e){if(e.tag===13){var t=gr(e),r=Qt(e,t);if(r!==null){var s=ot();Rt(r,e,t,s)}Qa(e,t)}},ed=function(){return Re},td=function(e,t){var r=Re;try{return Re=e,t()}finally{Re=r}},pl=function(e,t,r){switch(t){case"input":if(qr(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var s=r[t];if(s!==e&&s.form===e.form){var l=eo(s);if(!l)throw Error(a(90));$t(s),qr(s,l)}}}break;case"textarea":z(e,r);break;case"select":t=r.value,t!=null&&Ut(e,!!r.multiple,t,!1)}},Fi=Ua,$i=Or;var Wm={usingClientEntryPoint:!1,Events:[ls,an,eo,Ti,Ii,Ua]},bs={findFiberByHostInstance:_r,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Hm={bundleType:bs.bundleType,version:bs.version,rendererPackageName:bs.rendererPackageName,rendererConfig:bs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Wi(e),e===null?null:e.stateNode},findFiberByHostInstance:bs.findFiberByHostInstance||Bm,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fo.isDisabled&&Fo.supportsFiber)try{As=Fo.inject(Hm),Dt=Fo}catch{}}return ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wm,ft.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Za(t))throw Error(a(200));return Um(e,t,null,r)},ft.createRoot=function(e,t){if(!Za(e))throw Error(a(299));var r=!1,s="",l=gu;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=Ka(e,1,!1,null,null,r,!1,s,l),e[Wt]=t.current,ns(e.nodeType===8?e.parentNode:e),new qa(t)},ft.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=Wi(t),e=e===null?null:e.stateNode,e},ft.flushSync=function(e){return Or(e)},ft.hydrate=function(e,t,r){if(!To(t))throw Error(a(200));return Io(null,e,t,!0,r)},ft.hydrateRoot=function(e,t,r){if(!Za(e))throw Error(a(405));var s=r!=null&&r.hydratedSources||null,l=!1,i="",u=gu;if(r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(u=r.onRecoverableError)),t=hu(t,null,e,1,r??null,l,!1,i,u),e[Wt]=t.current,ns(e),s)for(e=0;e<s.length;e++)r=s[e],l=r._getVersion,l=l(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,l]:t.mutableSourceEagerHydrationData.push(r,l);return new Oo(t)},ft.render=function(e,t,r){if(!To(t))throw Error(a(200));return Io(null,e,t,!1,r)},ft.unmountComponentAtNode=function(e){if(!To(e))throw Error(a(40));return e._reactRootContainer?(Or(function(){Io(null,null,e,!1,function(){e._reactRootContainer=null,e[Wt]=null})}),!0):!1},ft.unstable_batchedUpdates=Ua,ft.unstable_renderSubtreeIntoContainer=function(e,t,r,s){if(!To(r))throw Error(a(200));if(e==null||e._reactInternals===void 0)throw Error(a(38));return Io(e,t,r,!1,s)},ft.version="18.3.1-next-f1338f8080-20240426",ft}var Cu;function nf(){if(Cu)return Xa.exports;Cu=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(d){console.error(d)}}return o(),Xa.exports=Xm(),Xa.exports}var Eu;function eh(){if(Eu)return $o;Eu=1;var o=nf();return $o.createRoot=o.createRoot,$o.hydrateRoot=o.hydrateRoot,$o}var th=eh();const rh=tf(th);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nh=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sf=(...o)=>o.filter((d,a,c)=>!!d&&d.trim()!==""&&c.indexOf(d)===a).join(" ").trim();/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var sh={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"};/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oh=p.forwardRef(({color:o="currentColor",size:d=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:f="",children:m,iconNode:h,...x},E)=>p.createElement("svg",{ref:E,...sh,width:d,height:d,stroke:o,strokeWidth:c?Number(a)*24/Number(d):a,className:sf("lucide",f),...x},[...h.map(([b,k])=>p.createElement(b,k)),...Array.isArray(m)?m:[m]]));/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ge=(o,d)=>{const a=p.forwardRef(({className:c,...f},m)=>p.createElement(oh,{ref:m,iconNode:d,className:sf(`lucide-${nh(o)}`,c),...f}));return a.displayName=`${o}`,a};/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xo=ge("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _u=ge("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const of=ge("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ss=ge("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lh=ge("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Cs=ge("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zn=ge("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ah=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ih=ge("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dh=ge("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ch=ge("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uh=ge("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fh=ge("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mi=ge("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ph=ge("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mh=ge("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hi=ge("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hh=ge("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lf=ge("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gt=ge("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vr=ge("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const el=ge("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pu=ge("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xi=ge("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xh=ge("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gh=ge("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gi=ge("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vh=ge("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yh=ge("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Es=ge("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bh=ge("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wh=ge("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jh=ge("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const af=ge("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const df=ge("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Br=ge("RefreshCw",[["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"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kh=ge("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Nh=ge("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _i=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sh=ge("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ch=ge("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wr=ge("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Eh=ge("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cf=ge("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _h=ge("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tl=ge("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vi=ge("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ph=ge("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mh=ge("User",[["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"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rl=ge("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hr=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),yi=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:bh},{id:"models",label:"Modell-Manager",hint:"Verwalten, laden & Gateway-Routing",icon:lh},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:gt},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:Cs},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:jh},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:Ss},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:uh}];var Mu=1,Rh=.9,zh=.8,Dh=.17,ri=.1,ni=.999,Lh=.9999,Ah=.99,Oh=/[\\\/_+.#"@\[\(\{&]/,Th=/[\\\/_+.#"@\[\(\{&]/g,Ih=/[\s-]/,uf=/[\s-]/g;function bi(o,d,a,c,f,m,h){if(m===d.length)return f===o.length?Mu:Ah;var x=`${f},${m}`;if(h[x]!==void 0)return h[x];for(var E=c.charAt(m),b=a.indexOf(E,f),k=0,M,A,I,O;b>=0;)M=bi(o,d,a,c,b+1,m+1,h),M>k&&(b===f?M*=Mu:Oh.test(o.charAt(b-1))?(M*=zh,I=o.slice(f,b-1).match(Th),I&&f>0&&(M*=Math.pow(ni,I.length))):Ih.test(o.charAt(b-1))?(M*=Rh,O=o.slice(f,b-1).match(uf),O&&f>0&&(M*=Math.pow(ni,O.length))):(M*=Dh,f>0&&(M*=Math.pow(ni,b-f))),o.charAt(b)!==d.charAt(m)&&(M*=Lh)),(M<ri&&a.charAt(b-1)===c.charAt(m+1)||c.charAt(m+1)===c.charAt(m)&&a.charAt(b-1)!==c.charAt(m))&&(A=bi(o,d,a,c,b+1,m+2,h),A*ri>M&&(M=A*ri)),M>k&&(k=M),b=a.indexOf(E,b+1);return h[x]=k,k}function Ru(o){return o.toLowerCase().replace(uf," ")}function Fh(o,d,a){return o=a&&a.length>0?`${o+" "+a.join(" ")}`:o,bi(o,d,Ru(o),Ru(d),0,0,{})}function Sr(o,d,{checkForDefaultPrevented:a=!0}={}){return function(f){if(o==null||o(f),a===!1||!f.defaultPrevented)return d==null?void 0:d(f)}}function zu(o,d){if(typeof o=="function")return o(d);o!=null&&(o.current=d)}function Dn(...o){return d=>{let a=!1;const c=o.map(f=>{const m=zu(f,d);return!a&&typeof m=="function"&&(a=!0),m});if(a)return()=>{for(let f=0;f<c.length;f++){const m=c[f];typeof m=="function"?m():zu(o[f],null)}}}}function Kr(...o){return p.useCallback(Dn(...o),o)}function $h(o,d=[]){let a=[];function c(m,h){const x=p.createContext(h);x.displayName=m+"Context";const E=a.length;a=[...a,h];const b=M=>{var _;const{scope:A,children:I,...O}=M,S=((_=A==null?void 0:A[o])==null?void 0:_[E])||x,C=p.useMemo(()=>O,Object.values(O));return n.jsx(S.Provider,{value:C,children:I})};b.displayName=m+"Provider";function k(M,A){var S;const I=((S=A==null?void 0:A[o])==null?void 0:S[E])||x,O=p.useContext(I);if(O)return O;if(h!==void 0)return h;throw new Error(`\`${M}\` must be used within \`${m}\``)}return[b,k]}const f=()=>{const m=a.map(h=>p.createContext(h));return function(x){const E=(x==null?void 0:x[o])||m;return p.useMemo(()=>({[`__scope${o}`]:{...x,[o]:E}}),[x,E])}};return f.scopeName=o,[c,Uh(f,...d)]}function Uh(...o){const d=o[0];if(o.length===1)return d;const a=()=>{const c=o.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(m){const h=c.reduce((x,{useScope:E,scopeName:b})=>{const M=E(m)[`__scope${b}`];return{...x,...M}},{});return p.useMemo(()=>({[`__scope${d.scopeName}`]:h}),[h])}};return a.scopeName=d.scopeName,a}var _s=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},Bh=Ei[" useId ".trim().toString()]||(()=>{}),Vh=0;function Xt(o){const[d,a]=p.useState(Bh());return _s(()=>{a(c=>c??String(Vh++))},[o]),d?`radix-${d}`:""}var Wh=Ei[" useInsertionEffect ".trim().toString()]||_s;function Hh({prop:o,defaultProp:d,onChange:a=()=>{},caller:c}){const[f,m,h]=Gh({defaultProp:d,onChange:a}),x=o!==void 0,E=x?o:f;{const k=p.useRef(o!==void 0);p.useEffect(()=>{const M=k.current;M!==x&&console.warn(`${c} is changing from ${M?"controlled":"uncontrolled"} to ${x?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),k.current=x},[x,c])}const b=p.useCallback(k=>{var M;if(x){const A=Kh(k)?k(o):k;A!==o&&((M=h.current)==null||M.call(h,A))}else m(k)},[x,o,m,h]);return[E,b]}function Gh({defaultProp:o,onChange:d}){const[a,c]=p.useState(o),f=p.useRef(a),m=p.useRef(d);return Wh(()=>{m.current=d},[d]),p.useEffect(()=>{var h;f.current!==a&&((h=m.current)==null||h.call(m,a),f.current=a)},[a,f]),[a,c,m]}function Kh(o){return typeof o=="function"}var ff=nf();function pf(o){const d=p.forwardRef((a,c)=>{let{children:f,...m}=a,h=null,x=!1;const E=[];Du(f)&&typeof Uo=="function"&&(f=Uo(f._payload)),p.Children.forEach(f,A=>{var I;if(Jh(A)){x=!0;const O=A;let S="child"in O.props?O.props.child:O.props.children;Du(S)&&typeof Uo=="function"&&(S=Uo(S._payload)),h=qh(O,S),E.push((I=h==null?void 0:h.props)==null?void 0:I.children)}else E.push(A)}),h?h=p.cloneElement(h,void 0,E):!x&&p.Children.count(f)===1&&p.isValidElement(f)&&(h=f);const b=h?Yh(h):void 0,k=Kr(c,b);if(!h){if(f||f===0)throw new Error(x?rx(o):tx(o));return f}const M=Zh(m,h.props??{});return h.type!==p.Fragment&&(M.ref=c?k:b),p.cloneElement(h,M)});return d.displayName=`${o}.Slot`,d}var Qh=Symbol.for("radix.slottable"),qh=(o,d)=>{if("child"in o.props){const a=o.props.child;return p.isValidElement(a)?p.cloneElement(a,void 0,o.props.children(a.props.children)):null}return p.isValidElement(d)?d:null};function Zh(o,d){const a={...d};for(const c in d){const f=o[c],m=d[c];/^on[A-Z]/.test(c)?f&&m?a[c]=(...x)=>{const E=m(...x);return f(...x),E}:f&&(a[c]=f):c==="style"?a[c]={...f,...m}:c==="className"&&(a[c]=[f,m].filter(Boolean).join(" "))}return{...o,...a}}function Yh(o){var c,f;let d=(c=Object.getOwnPropertyDescriptor(o.props,"ref"))==null?void 0:c.get,a=d&&"isReactWarning"in d&&d.isReactWarning;return a?o.ref:(d=(f=Object.getOwnPropertyDescriptor(o,"ref"))==null?void 0:f.get,a=d&&"isReactWarning"in d&&d.isReactWarning,a?o.props.ref:o.props.ref||o.ref)}function Jh(o){return p.isValidElement(o)&&typeof o.type=="function"&&"__radixId"in o.type&&o.type.__radixId===Qh}var Xh=Symbol.for("react.lazy");function Du(o){return o!=null&&typeof o=="object"&&"$$typeof"in o&&o.$$typeof===Xh&&"_payload"in o&&ex(o._payload)}function ex(o){return typeof o=="object"&&o!==null&&"then"in o}var tx=o=>`${o} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,rx=o=>`${o} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Uo=Ei[" use ".trim().toString()],nx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=nx.reduce((o,d)=>{const a=pf(`Primitive.${d}`),c=p.forwardRef((f,m)=>{const{asChild:h,...x}=f,E=h?a:d;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(E,{...x,ref:m})});return c.displayName=`Primitive.${d}`,{...o,[d]:c}},{});function sx(o,d){o&&ff.flushSync(()=>o.dispatchEvent(d))}function Ps(o){const d=p.useRef(o);return p.useEffect(()=>{d.current=o}),p.useMemo(()=>((...a)=>{var c;return(c=d.current)==null?void 0:c.call(d,...a)}),[])}function ox(o,d=globalThis==null?void 0:globalThis.document){const a=Ps(o);p.useEffect(()=>{const c=f=>{f.key==="Escape"&&a(f)};return d.addEventListener("keydown",c,{capture:!0}),()=>d.removeEventListener("keydown",c,{capture:!0})},[a,d])}var lx="DismissableLayer",wi="dismissableLayer.update",ax="dismissableLayer.pointerDownOutside",ix="dismissableLayer.focusOutside",Lu,Pi=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),mf=p.forwardRef((o,d)=>{const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:x,onDismiss:E,...b}=o,k=p.useContext(Pi),[M,A]=p.useState(null),I=(M==null?void 0:M.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,O]=p.useState({}),S=Kr(d,se=>A(se)),C=Array.from(k.layers),[_]=[...k.layersWithOutsidePointerEventsDisabled].slice(-1),L=C.indexOf(_),Z=M?C.indexOf(M):-1,Y=k.layersWithOutsidePointerEventsDisabled.size>0,H=Z>=L,T=p.useRef(!1),F=fx(se=>{const X=se.target;if(!(X instanceof Node))return;const ye=[...k.branches].some(ce=>ce.contains(X));!H||ye||(m==null||m(se),x==null||x(se),se.defaultPrevented||E==null||E())},{ownerDocument:I,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:k.dismissableSurfaces}),ne=px(se=>{if(c&&T.current)return;const X=se.target;[...k.branches].some(ce=>ce.contains(X))||(h==null||h(se),x==null||x(se),se.defaultPrevented||E==null||E())},I);return ox(se=>{Z===k.layers.size-1&&(f==null||f(se),!se.defaultPrevented&&E&&(se.preventDefault(),E()))},I),p.useEffect(()=>{if(M)return a&&(k.layersWithOutsidePointerEventsDisabled.size===0&&(Lu=I.body.style.pointerEvents,I.body.style.pointerEvents="none"),k.layersWithOutsidePointerEventsDisabled.add(M)),k.layers.add(M),Au(),()=>{a&&(k.layersWithOutsidePointerEventsDisabled.delete(M),k.layersWithOutsidePointerEventsDisabled.size===0&&(I.body.style.pointerEvents=Lu))}},[M,I,a,k]),p.useEffect(()=>()=>{M&&(k.layers.delete(M),k.layersWithOutsidePointerEventsDisabled.delete(M),Au())},[M,k]),p.useEffect(()=>{const se=()=>O({});return document.addEventListener(wi,se),()=>document.removeEventListener(wi,se)},[]),n.jsx(Je.div,{...b,ref:S,style:{pointerEvents:Y?H?"auto":"none":void 0,...o.style},onFocusCapture:Sr(o.onFocusCapture,ne.onFocusCapture),onBlurCapture:Sr(o.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:Sr(o.onPointerDownCapture,F.onPointerDownCapture)})});mf.displayName=lx;var dx="DismissableLayerBranch",cx=p.forwardRef((o,d)=>{const a=p.useContext(Pi),c=p.useRef(null),f=Kr(d,c);return p.useEffect(()=>{const m=c.current;if(m)return a.branches.add(m),()=>{a.branches.delete(m)}},[a.branches]),n.jsx(Je.div,{...o,ref:f})});cx.displayName=dx;function ux(){const o=p.useContext(Pi),[d,a]=p.useState(null);return p.useEffect(()=>{if(d)return o.dismissableSurfaces.add(d),()=>{o.dismissableSurfaces.delete(d)}},[d,o.dismissableSurfaces]),a}function fx(o,d){const{ownerDocument:a=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:f,dismissableSurfaces:m}=d,h=Ps(o),x=p.useRef(!1),E=p.useRef(!1),b=p.useRef(new Map),k=p.useRef(()=>{});return p.useEffect(()=>{function M(){E.current=!1,f.current=!1,b.current.clear()}function A(){return Array.from(b.current.values()).some(Boolean)}function I(L){if(!E.current)return;const Z=L.target;Z instanceof Node&&[...m].some(H=>H.contains(Z))||b.current.set(L.type,!0),L.type==="click"&&window.setTimeout(()=>{E.current&&k.current()},0)}function O(L){E.current&&b.current.set(L.type,!1)}const S=L=>{if(L.target&&!x.current){let Z=function(){a.removeEventListener("click",k.current);const H=A();M(),H||hf(ax,h,Y,{discrete:!0})};const Y={originalEvent:L};E.current=!0,f.current=c&&L.button===0,b.current.clear(),!c||L.button!==0?Z():(a.removeEventListener("click",k.current),k.current=Z,a.addEventListener("click",k.current,{once:!0}))}else a.removeEventListener("click",k.current),M();x.current=!1},C=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const L of C)a.addEventListener(L,I,!0),a.addEventListener(L,O);const _=window.setTimeout(()=>{a.addEventListener("pointerdown",S)},0);return()=>{window.clearTimeout(_),a.removeEventListener("pointerdown",S),a.removeEventListener("click",k.current);for(const L of C)a.removeEventListener(L,I,!0),a.removeEventListener(L,O)}},[a,h,c,f,m]),{onPointerDownCapture:()=>x.current=!0}}function px(o,d=globalThis==null?void 0:globalThis.document){const a=Ps(o),c=p.useRef(!1);return p.useEffect(()=>{const f=m=>{m.target&&!c.current&&hf(ix,a,{originalEvent:m},{discrete:!1})};return d.addEventListener("focusin",f),()=>d.removeEventListener("focusin",f)},[d,a]),{onFocusCapture:()=>c.current=!0,onBlurCapture:()=>c.current=!1}}function Au(){const o=new CustomEvent(wi);document.dispatchEvent(o)}function hf(o,d,a,{discrete:c}){const f=a.originalEvent.target,m=new CustomEvent(o,{bubbles:!1,cancelable:!0,detail:a});d&&f.addEventListener(o,d,{once:!0}),c?sx(f,m):f.dispatchEvent(m)}var si="focusScope.autoFocusOnMount",oi="focusScope.autoFocusOnUnmount",Ou={bubbles:!1,cancelable:!0},mx="FocusScope",xf=p.forwardRef((o,d)=>{const{loop:a=!1,trapped:c=!1,onMountAutoFocus:f,onUnmountAutoFocus:m,...h}=o,[x,E]=p.useState(null),b=Ps(f),k=Ps(m),M=p.useRef(null),A=Kr(d,S=>E(S)),I=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(c){let S=function(Z){if(I.paused||!x)return;const Y=Z.target;x.contains(Y)?M.current=Y:Nr(M.current,{select:!0})},C=function(Z){if(I.paused||!x)return;const Y=Z.relatedTarget;Y!==null&&(x.contains(Y)||Nr(M.current,{select:!0}))},_=function(Z){if(document.activeElement===document.body)for(const H of Z)H.removedNodes.length>0&&Nr(x)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const L=new MutationObserver(_);return x&&L.observe(x,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),L.disconnect()}}},[c,x,I.paused]),p.useEffect(()=>{if(x){Iu.add(I);const S=document.activeElement;if(!x.contains(S)){const _=new CustomEvent(si,Ou);x.addEventListener(si,b),x.dispatchEvent(_),_.defaultPrevented||(hx(bx(gf(x)),{select:!0}),document.activeElement===S&&Nr(x))}return()=>{x.removeEventListener(si,b),setTimeout(()=>{const _=new CustomEvent(oi,Ou);x.addEventListener(oi,k),x.dispatchEvent(_),_.defaultPrevented||Nr(S??document.body,{select:!0}),x.removeEventListener(oi,k),Iu.remove(I)},0)}}},[x,b,k,I]);const O=p.useCallback(S=>{if(!a&&!c||I.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,_=document.activeElement;if(C&&_){const L=S.currentTarget,[Z,Y]=xx(L);Z&&Y?!S.shiftKey&&_===Y?(S.preventDefault(),a&&Nr(Z,{select:!0})):S.shiftKey&&_===Z&&(S.preventDefault(),a&&Nr(Y,{select:!0})):_===L&&S.preventDefault()}},[a,c,I.paused]);return n.jsx(Je.div,{tabIndex:-1,...h,ref:A,onKeyDown:O})});xf.displayName=mx;function hx(o,{select:d=!1}={}){const a=document.activeElement;for(const c of o)if(Nr(c,{select:d}),document.activeElement!==a)return}function xx(o){const d=gf(o),a=Tu(d,o),c=Tu(d.reverse(),o);return[a,c]}function gf(o){const d=[],a=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:c=>{const f=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||f?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)d.push(a.currentNode);return d}function Tu(o,d){for(const a of o)if(!gx(a,{upTo:d}))return a}function gx(o,{upTo:d}){if(getComputedStyle(o).visibility==="hidden")return!0;for(;o;){if(d!==void 0&&o===d)return!1;if(getComputedStyle(o).display==="none")return!0;o=o.parentElement}return!1}function vx(o){return o instanceof HTMLInputElement&&"select"in o}function Nr(o,{select:d=!1}={}){if(o&&o.focus){const a=document.activeElement;o.focus({preventScroll:!0}),o!==a&&vx(o)&&d&&o.select()}}var Iu=yx();function yx(){let o=[];return{add(d){const a=o[0];d!==a&&(a==null||a.pause()),o=Fu(o,d),o.unshift(d)},remove(d){var a;o=Fu(o,d),(a=o[0])==null||a.resume()}}}function Fu(o,d){const a=[...o],c=a.indexOf(d);return c!==-1&&a.splice(c,1),a}function bx(o){return o.filter(d=>d.tagName!=="A")}var wx="Portal",vf=p.forwardRef((o,d)=>{var x;const{container:a,...c}=o,[f,m]=p.useState(!1);_s(()=>m(!0),[]);const h=a||f&&((x=globalThis==null?void 0:globalThis.document)==null?void 0:x.body);return h?ff.createPortal(n.jsx(Je.div,{...c,ref:d}),h):null});vf.displayName=wx;function jx(o,d){return p.useReducer((a,c)=>d[a][c]??a,o)}var sl=o=>{const{present:d,children:a}=o,c=kx(d),f=typeof a=="function"?a({present:c.isPresent}):p.Children.only(a),m=Nx(c.ref,Sx(f));return typeof a=="function"||c.isPresent?p.cloneElement(f,{ref:m}):null};sl.displayName="Presence";function kx(o){const[d,a]=p.useState(),c=p.useRef(null),f=p.useRef(o),m=p.useRef("none"),h=o?"mounted":"unmounted",[x,E]=jx(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const b=Bo(c.current);m.current=x==="mounted"?b:"none"},[x]),_s(()=>{const b=c.current,k=f.current;if(k!==o){const A=m.current,I=Bo(b);o?E("MOUNT"):I==="none"||(b==null?void 0:b.display)==="none"?E("UNMOUNT"):E(k&&A!==I?"ANIMATION_OUT":"UNMOUNT"),f.current=o}},[o,E]),_s(()=>{if(d){let b;const k=d.ownerDocument.defaultView??window,M=I=>{const S=Bo(c.current).includes(CSS.escape(I.animationName));if(I.target===d&&S&&(E("ANIMATION_END"),!f.current)){const C=d.style.animationFillMode;d.style.animationFillMode="forwards",b=k.setTimeout(()=>{d.style.animationFillMode==="forwards"&&(d.style.animationFillMode=C)})}},A=I=>{I.target===d&&(m.current=Bo(c.current))};return d.addEventListener("animationstart",A),d.addEventListener("animationcancel",M),d.addEventListener("animationend",M),()=>{k.clearTimeout(b),d.removeEventListener("animationstart",A),d.removeEventListener("animationcancel",M),d.removeEventListener("animationend",M)}}else E("ANIMATION_END")},[d,E]),{isPresent:["mounted","unmountSuspended"].includes(x),ref:p.useCallback(b=>{c.current=b?getComputedStyle(b):null,a(b)},[])}}function $u(o,d){if(typeof o=="function")return o(d);o!=null&&(o.current=d)}function Nx(...o){const d=p.useRef(o);return d.current=o,p.useCallback(a=>{const c=d.current;let f=!1;const m=c.map(h=>{const x=$u(h,a);return!f&&typeof x=="function"&&(f=!0),x});if(f)return()=>{for(let h=0;h<m.length;h++){const x=m[h];typeof x=="function"?x():$u(c[h],null)}}},[])}function Bo(o){return(o==null?void 0:o.animationName)||"none"}function Sx(o){var c,f;let d=(c=Object.getOwnPropertyDescriptor(o.props,"ref"))==null?void 0:c.get,a=d&&"isReactWarning"in d&&d.isReactWarning;return a?o.ref:(d=(f=Object.getOwnPropertyDescriptor(o,"ref"))==null?void 0:f.get,a=d&&"isReactWarning"in d&&d.isReactWarning,a?o.props.ref:o.props.ref||o.ref)}var Vo=0,It=null;function Cx(){p.useEffect(()=>{It||(It={start:Uu(),end:Uu()});const{start:o,end:d}=It;return document.body.firstElementChild!==o&&document.body.insertAdjacentElement("afterbegin",o),document.body.lastElementChild!==d&&document.body.insertAdjacentElement("beforeend",d),Vo++,()=>{Vo===1&&(It==null||It.start.remove(),It==null||It.end.remove(),It=null),Vo=Math.max(0,Vo-1)}},[])}function Uu(){const o=document.createElement("span");return o.setAttribute("data-radix-focus-guard",""),o.tabIndex=0,o.style.outline="none",o.style.opacity="0",o.style.position="fixed",o.style.pointerEvents="none",o}var Ft=function(){return Ft=Object.assign||function(d){for(var a,c=1,f=arguments.length;c<f;c++){a=arguments[c];for(var m in a)Object.prototype.hasOwnProperty.call(a,m)&&(d[m]=a[m])}return d},Ft.apply(this,arguments)};function yf(o,d){var a={};for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&d.indexOf(c)<0&&(a[c]=o[c]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,c=Object.getOwnPropertySymbols(o);f<c.length;f++)d.indexOf(c[f])<0&&Object.prototype.propertyIsEnumerable.call(o,c[f])&&(a[c[f]]=o[c[f]]);return a}function Ex(o,d,a){if(a||arguments.length===2)for(var c=0,f=d.length,m;c<f;c++)(m||!(c in d))&&(m||(m=Array.prototype.slice.call(d,0,c)),m[c]=d[c]);return o.concat(m||Array.prototype.slice.call(d))}var Yo="right-scroll-bar-position",Jo="width-before-scroll-bar",_x="with-scroll-bars-hidden",Px="--removed-body-scroll-bar-size";function li(o,d){return typeof o=="function"?o(d):o&&(o.current=d),o}function Mx(o,d){var a=p.useState(function(){return{value:o,callback:d,facade:{get current(){return a.value},set current(c){var f=a.value;f!==c&&(a.value=c,a.callback(c,f))}}}})[0];return a.callback=d,a.facade}var Rx=typeof window<"u"?p.useLayoutEffect:p.useEffect,Bu=new WeakMap;function zx(o,d){var a=Mx(null,function(c){return o.forEach(function(f){return li(f,c)})});return Rx(function(){var c=Bu.get(a);if(c){var f=new Set(c),m=new Set(o),h=a.current;f.forEach(function(x){m.has(x)||li(x,null)}),m.forEach(function(x){f.has(x)||li(x,h)})}Bu.set(a,o)},[o]),a}function Dx(o){return o}function Lx(o,d){d===void 0&&(d=Dx);var a=[],c=!1,f={read:function(){if(c)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:o},useMedium:function(m){var h=d(m,c);return a.push(h),function(){a=a.filter(function(x){return x!==h})}},assignSyncMedium:function(m){for(c=!0;a.length;){var h=a;a=[],h.forEach(m)}a={push:function(x){return m(x)},filter:function(){return a}}},assignMedium:function(m){c=!0;var h=[];if(a.length){var x=a;a=[],x.forEach(m),h=a}var E=function(){var k=h;h=[],k.forEach(m)},b=function(){return Promise.resolve().then(E)};b(),a={push:function(k){h.push(k),b()},filter:function(k){return h=h.filter(k),a}}}};return f}function Ax(o){o===void 0&&(o={});var d=Lx(null);return d.options=Ft({async:!0,ssr:!1},o),d}var bf=function(o){var d=o.sideCar,a=yf(o,["sideCar"]);if(!d)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var c=d.read();if(!c)throw new Error("Sidecar medium not found");return p.createElement(c,Ft({},a))};bf.isSideCarExport=!0;function Ox(o,d){return o.useMedium(d),bf}var wf=Ax(),ai=function(){},ol=p.forwardRef(function(o,d){var a=p.useRef(null),c=p.useState({onScrollCapture:ai,onWheelCapture:ai,onTouchMoveCapture:ai}),f=c[0],m=c[1],h=o.forwardProps,x=o.children,E=o.className,b=o.removeScrollBar,k=o.enabled,M=o.shards,A=o.sideCar,I=o.noRelative,O=o.noIsolation,S=o.inert,C=o.allowPinchZoom,_=o.as,L=_===void 0?"div":_,Z=o.gapMode,Y=yf(o,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),H=A,T=zx([a,d]),F=Ft(Ft({},Y),f);return p.createElement(p.Fragment,null,k&&p.createElement(H,{sideCar:wf,removeScrollBar:b,shards:M,noRelative:I,noIsolation:O,inert:S,setCallbacks:m,allowPinchZoom:!!C,lockRef:a,gapMode:Z}),h?p.cloneElement(p.Children.only(x),Ft(Ft({},F),{ref:T})):p.createElement(L,Ft({},F,{className:E,ref:T}),x))});ol.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ol.classNames={fullWidth:Jo,zeroRight:Yo};var Tx=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ix(){if(!document)return null;var o=document.createElement("style");o.type="text/css";var d=Tx();return d&&o.setAttribute("nonce",d),o}function Fx(o,d){o.styleSheet?o.styleSheet.cssText=d:o.appendChild(document.createTextNode(d))}function $x(o){var d=document.head||document.getElementsByTagName("head")[0];d.appendChild(o)}var Ux=function(){var o=0,d=null;return{add:function(a){o==0&&(d=Ix())&&(Fx(d,a),$x(d)),o++},remove:function(){o--,!o&&d&&(d.parentNode&&d.parentNode.removeChild(d),d=null)}}},Bx=function(){var o=Ux();return function(d,a){p.useEffect(function(){return o.add(d),function(){o.remove()}},[d&&a])}},jf=function(){var o=Bx(),d=function(a){var c=a.styles,f=a.dynamic;return o(c,f),null};return d},Vx={left:0,top:0,right:0,gap:0},ii=function(o){return parseInt(o||"",10)||0},Wx=function(o){var d=window.getComputedStyle(document.body),a=d[o==="padding"?"paddingLeft":"marginLeft"],c=d[o==="padding"?"paddingTop":"marginTop"],f=d[o==="padding"?"paddingRight":"marginRight"];return[ii(a),ii(c),ii(f)]},Hx=function(o){if(o===void 0&&(o="margin"),typeof window>"u")return Vx;var d=Wx(o),a=document.documentElement.clientWidth,c=window.innerWidth;return{left:d[0],top:d[1],right:d[2],gap:Math.max(0,c-a+d[2]-d[0])}},Gx=jf(),Mn="data-scroll-locked",Kx=function(o,d,a,c){var f=o.left,m=o.top,h=o.right,x=o.gap;return a===void 0&&(a="margin"),`
.`.concat(_x,` {
overflow: hidden `).concat(c,`;
padding-right: `).concat(x,"px ").concat(c,`;
}
body[`).concat(Mn,`] {
overflow: hidden `).concat(c,`;
overscroll-behavior: contain;
`).concat([d&&"position: relative ".concat(c,";"),a==="margin"&&`
padding-left: `.concat(f,`px;
padding-top: `).concat(m,`px;
padding-right: `).concat(h,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(x,"px ").concat(c,`;
`),a==="padding"&&"padding-right: ".concat(x,"px ").concat(c,";")].filter(Boolean).join(""),`
}
.`).concat(Yo,` {
right: `).concat(x,"px ").concat(c,`;
}
.`).concat(Jo,` {
margin-right: `).concat(x,"px ").concat(c,`;
}
.`).concat(Yo," .").concat(Yo,` {
right: 0 `).concat(c,`;
}
.`).concat(Jo," .").concat(Jo,` {
margin-right: 0 `).concat(c,`;
}
body[`).concat(Mn,`] {
`).concat(Px,": ").concat(x,`px;
}
`)},Vu=function(){var o=parseInt(document.body.getAttribute(Mn)||"0",10);return isFinite(o)?o:0},Qx=function(){p.useEffect(function(){return document.body.setAttribute(Mn,(Vu()+1).toString()),function(){var o=Vu()-1;o<=0?document.body.removeAttribute(Mn):document.body.setAttribute(Mn,o.toString())}},[])},qx=function(o){var d=o.noRelative,a=o.noImportant,c=o.gapMode,f=c===void 0?"margin":c;Qx();var m=p.useMemo(function(){return Hx(f)},[f]);return p.createElement(Gx,{styles:Kx(m,!d,f,a?"":"!important")})},ji=!1;if(typeof window<"u")try{var Wo=Object.defineProperty({},"passive",{get:function(){return ji=!0,!0}});window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{ji=!1}var kn=ji?{passive:!1}:!1,Zx=function(o){return o.tagName==="TEXTAREA"},kf=function(o,d){if(!(o instanceof Element))return!1;var a=window.getComputedStyle(o);return a[d]!=="hidden"&&!(a.overflowY===a.overflowX&&!Zx(o)&&a[d]==="visible")},Yx=function(o){return kf(o,"overflowY")},Jx=function(o){return kf(o,"overflowX")},Wu=function(o,d){var a=d.ownerDocument,c=d;do{typeof ShadowRoot<"u"&&c instanceof ShadowRoot&&(c=c.host);var f=Nf(o,c);if(f){var m=Sf(o,c),h=m[1],x=m[2];if(h>x)return!0}c=c.parentNode}while(c&&c!==a.body);return!1},Xx=function(o){var d=o.scrollTop,a=o.scrollHeight,c=o.clientHeight;return[d,a,c]},eg=function(o){var d=o.scrollLeft,a=o.scrollWidth,c=o.clientWidth;return[d,a,c]},Nf=function(o,d){return o==="v"?Yx(d):Jx(d)},Sf=function(o,d){return o==="v"?Xx(d):eg(d)},tg=function(o,d){return o==="h"&&d==="rtl"?-1:1},rg=function(o,d,a,c,f){var m=tg(o,window.getComputedStyle(d).direction),h=m*c,x=a.target,E=d.contains(x),b=!1,k=h>0,M=0,A=0;do{if(!x)break;var I=Sf(o,x),O=I[0],S=I[1],C=I[2],_=S-C-m*O;(O||_)&&Nf(o,x)&&(M+=_,A+=O);var L=x.parentNode;x=L&&L.nodeType===Node.DOCUMENT_FRAGMENT_NODE?L.host:L}while(!E&&x!==document.body||E&&(d.contains(x)||d===x));return(k&&Math.abs(M)<1||!k&&Math.abs(A)<1)&&(b=!0),b},Ho=function(o){return"changedTouches"in o?[o.changedTouches[0].clientX,o.changedTouches[0].clientY]:[0,0]},Hu=function(o){return[o.deltaX,o.deltaY]},Gu=function(o){return o&&"current"in o?o.current:o},ng=function(o,d){return o[0]===d[0]&&o[1]===d[1]},sg=function(o){return`
.block-interactivity-`.concat(o,` {pointer-events: none;}
.allow-interactivity-`).concat(o,` {pointer-events: all;}
`)},og=0,Nn=[];function lg(o){var d=p.useRef([]),a=p.useRef([0,0]),c=p.useRef(),f=p.useState(og++)[0],m=p.useState(jf)[0],h=p.useRef(o);p.useEffect(function(){h.current=o},[o]),p.useEffect(function(){if(o.inert){document.body.classList.add("block-interactivity-".concat(f));var S=Ex([o.lockRef.current],(o.shards||[]).map(Gu),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(f))})}}},[o.inert,o.lockRef.current,o.shards]);var x=p.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!h.current.allowPinchZoom;var _=Ho(S),L=a.current,Z="deltaX"in S?S.deltaX:L[0]-_[0],Y="deltaY"in S?S.deltaY:L[1]-_[1],H,T=S.target,F=Math.abs(Z)>Math.abs(Y)?"h":"v";if("touches"in S&&F==="h"&&T.type==="range")return!1;var ne=window.getSelection(),se=ne&&ne.anchorNode,X=se?se===T||se.contains(T):!1;if(X)return!1;var ye=Wu(F,T);if(!ye)return!0;if(ye?H=F:(H=F==="v"?"h":"v",ye=Wu(F,T)),!ye)return!1;if(!c.current&&"changedTouches"in S&&(Z||Y)&&(c.current=H),!H)return!0;var ce=c.current||H;return rg(ce,C,S,ce==="h"?Z:Y)},[]),E=p.useCallback(function(S){var C=S;if(!(!Nn.length||Nn[Nn.length-1]!==m)){var _="deltaY"in C?Hu(C):Ho(C),L=d.current.filter(function(H){return H.name===C.type&&(H.target===C.target||C.target===H.shadowParent)&&ng(H.delta,_)})[0];if(L&&L.should){C.cancelable&&C.preventDefault();return}if(!L){var Z=(h.current.shards||[]).map(Gu).filter(Boolean).filter(function(H){return H.contains(C.target)}),Y=Z.length>0?x(C,Z[0]):!h.current.noIsolation;Y&&C.cancelable&&C.preventDefault()}}},[]),b=p.useCallback(function(S,C,_,L){var Z={name:S,delta:C,target:_,should:L,shadowParent:ag(_)};d.current.push(Z),setTimeout(function(){d.current=d.current.filter(function(Y){return Y!==Z})},1)},[]),k=p.useCallback(function(S){a.current=Ho(S),c.current=void 0},[]),M=p.useCallback(function(S){b(S.type,Hu(S),S.target,x(S,o.lockRef.current))},[]),A=p.useCallback(function(S){b(S.type,Ho(S),S.target,x(S,o.lockRef.current))},[]);p.useEffect(function(){return Nn.push(m),o.setCallbacks({onScrollCapture:M,onWheelCapture:M,onTouchMoveCapture:A}),document.addEventListener("wheel",E,kn),document.addEventListener("touchmove",E,kn),document.addEventListener("touchstart",k,kn),function(){Nn=Nn.filter(function(S){return S!==m}),document.removeEventListener("wheel",E,kn),document.removeEventListener("touchmove",E,kn),document.removeEventListener("touchstart",k,kn)}},[]);var I=o.removeScrollBar,O=o.inert;return p.createElement(p.Fragment,null,O?p.createElement(m,{styles:sg(f)}):null,I?p.createElement(qx,{noRelative:o.noRelative,gapMode:o.gapMode}):null)}function ag(o){for(var d=null;o!==null;)o instanceof ShadowRoot&&(d=o.host,o=o.host),o=o.parentNode;return d}const ig=Ox(wf,lg);var Cf=p.forwardRef(function(o,d){return p.createElement(ol,Ft({},o,{ref:d,sideCar:ig}))});Cf.classNames=ol.classNames;var dg=function(o){if(typeof document>"u")return null;var d=Array.isArray(o)?o[0]:o;return d.ownerDocument.body},Sn=new WeakMap,Go=new WeakMap,Ko={},di=0,Ef=function(o){return o&&(o.host||Ef(o.parentNode))},cg=function(o,d){return d.map(function(a){if(o.contains(a))return a;var c=Ef(a);return c&&o.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",o,". Doing nothing"),null)}).filter(function(a){return!!a})},ug=function(o,d,a,c){var f=cg(d,Array.isArray(o)?o:[o]);Ko[a]||(Ko[a]=new WeakMap);var m=Ko[a],h=[],x=new Set,E=new Set(f),b=function(M){!M||x.has(M)||(x.add(M),b(M.parentNode))};f.forEach(b);var k=function(M){!M||E.has(M)||Array.prototype.forEach.call(M.children,function(A){if(x.has(A))k(A);else try{var I=A.getAttribute(c),O=I!==null&&I!=="false",S=(Sn.get(A)||0)+1,C=(m.get(A)||0)+1;Sn.set(A,S),m.set(A,C),h.push(A),S===1&&O&&Go.set(A,!0),C===1&&A.setAttribute(a,"true"),O||A.setAttribute(c,"true")}catch(_){console.error("aria-hidden: cannot operate on ",A,_)}})};return k(d),x.clear(),di++,function(){h.forEach(function(M){var A=Sn.get(M)-1,I=m.get(M)-1;Sn.set(M,A),m.set(M,I),A||(Go.has(M)||M.removeAttribute(c),Go.delete(M)),I||M.removeAttribute(a)}),di--,di||(Sn=new WeakMap,Sn=new WeakMap,Go=new WeakMap,Ko={})}},fg=function(o,d,a){a===void 0&&(a="data-aria-hidden");var c=Array.from(Array.isArray(o)?o:[o]),f=dg(o);return f?(c.push.apply(c,Array.from(f.querySelectorAll("[aria-live], script"))),ug(c,f,a,"aria-hidden")):function(){return null}},ll="Dialog",[_f]=$h(ll),[pg,zt]=_f(ll),Pf=o=>{const{__scopeDialog:d,children:a,open:c,defaultOpen:f,onOpenChange:m,modal:h=!0}=o,x=p.useRef(null),E=p.useRef(null),[b,k]=Hh({prop:c,defaultProp:f??!1,onChange:m,caller:ll});return n.jsx(pg,{scope:d,triggerRef:x,contentRef:E,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),open:b,onOpenChange:k,onOpenToggle:p.useCallback(()=>k(M=>!M),[k]),modal:h,children:a})};Pf.displayName=ll;var Mf="DialogTrigger",mg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Mf,a),m=Kr(d,f.triggerRef);return n.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":Ri(f.open),...c,ref:m,onClick:Sr(o.onClick,f.onOpenToggle)})});mg.displayName=Mf;var Mi="DialogPortal",[hg,Rf]=_f(Mi,{forceMount:void 0}),zf=o=>{const{__scopeDialog:d,forceMount:a,children:c,container:f}=o,m=zt(Mi,d);return n.jsx(hg,{scope:d,forceMount:a,children:p.Children.map(c,h=>n.jsx(sl,{present:a||m.open,children:n.jsx(vf,{asChild:!0,container:f,children:h})}))})};zf.displayName=Mi;var nl="DialogOverlay",Df=p.forwardRef((o,d)=>{const a=Rf(nl,o.__scopeDialog),{forceMount:c=a.forceMount,...f}=o,m=zt(nl,o.__scopeDialog);return m.modal?n.jsx(sl,{present:c||m.open,children:n.jsx(gg,{...f,ref:d})}):null});Df.displayName=nl;var xg=pf("DialogOverlay.RemoveScroll"),gg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(nl,a),m=ux(),h=Kr(d,m);return n.jsx(Cf,{as:xg,allowPinchZoom:!0,shards:[f.contentRef],children:n.jsx(Je.div,{"data-state":Ri(f.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})}),Ln="DialogContent",Lf=p.forwardRef((o,d)=>{const a=Rf(Ln,o.__scopeDialog),{forceMount:c=a.forceMount,...f}=o,m=zt(Ln,o.__scopeDialog);return n.jsx(sl,{present:c||m.open,children:m.modal?n.jsx(vg,{...f,ref:d}):n.jsx(yg,{...f,ref:d})})});Lf.displayName=Ln;var vg=p.forwardRef((o,d)=>{const a=zt(Ln,o.__scopeDialog),c=p.useRef(null),f=Kr(d,a.contentRef,c);return p.useEffect(()=>{const m=c.current;if(m)return fg(m)},[]),n.jsx(Af,{...o,ref:f,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Sr(o.onCloseAutoFocus,m=>{var h;m.preventDefault(),(h=a.triggerRef.current)==null||h.focus()}),onPointerDownOutside:Sr(o.onPointerDownOutside,m=>{const h=m.detail.originalEvent,x=h.button===0&&h.ctrlKey===!0;(h.button===2||x)&&m.preventDefault()}),onFocusOutside:Sr(o.onFocusOutside,m=>m.preventDefault())})}),yg=p.forwardRef((o,d)=>{const a=zt(Ln,o.__scopeDialog),c=p.useRef(!1),f=p.useRef(!1);return n.jsx(Af,{...o,ref:d,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{var h,x;(h=o.onCloseAutoFocus)==null||h.call(o,m),m.defaultPrevented||(c.current||(x=a.triggerRef.current)==null||x.focus(),m.preventDefault()),c.current=!1,f.current=!1},onInteractOutside:m=>{var E,b;(E=o.onInteractOutside)==null||E.call(o,m),m.defaultPrevented||(c.current=!0,m.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const h=m.target;((b=a.triggerRef.current)==null?void 0:b.contains(h))&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&f.current&&m.preventDefault()}})}),Af=p.forwardRef((o,d)=>{const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:f,onCloseAutoFocus:m,...h}=o,x=zt(Ln,a);return Cx(),n.jsx(n.Fragment,{children:n.jsx(xf,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:f,onUnmountAutoFocus:m,children:n.jsx(mf,{role:"dialog",id:x.contentId,"aria-describedby":x.descriptionId,"aria-labelledby":x.titleId,"data-state":Ri(x.open),...h,ref:d,deferPointerDownOutside:!0,onDismiss:()=>x.onOpenChange(!1)})})})}),Of="DialogTitle",bg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Of,a);return n.jsx(Je.h2,{id:f.titleId,...c,ref:d})});bg.displayName=Of;var Tf="DialogDescription",wg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Tf,a);return n.jsx(Je.p,{id:f.descriptionId,...c,ref:d})});wg.displayName=Tf;var If="DialogClose",jg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(If,a);return n.jsx(Je.button,{type:"button",...c,ref:d,onClick:Sr(o.onClick,()=>f.onOpenChange(!1))})});jg.displayName=If;function Ri(o){return o?"open":"closed"}var js='[cmdk-group=""]',ci='[cmdk-group-items=""]',kg='[cmdk-group-heading=""]',Ff='[cmdk-item=""]',Ku=`${Ff}:not([aria-disabled="true"])`,ki="cmdk-item-select",_n="data-value",Ng=(o,d,a)=>Fh(o,d,a),$f=p.createContext(void 0),Rs=()=>p.useContext($f),Uf=p.createContext(void 0),zi=()=>p.useContext(Uf),Bf=p.createContext(void 0),Vf=p.forwardRef((o,d)=>{let a=Pn(()=>{var v,B;return{search:"",value:(B=(v=o.value)!=null?v:o.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=Pn(()=>new Set),f=Pn(()=>new Map),m=Pn(()=>new Map),h=Pn(()=>new Set),x=Wf(o),{label:E,children:b,value:k,onValueChange:M,filter:A,shouldFilter:I,loop:O,disablePointerSelection:S=!1,vimBindings:C=!0,..._}=o,L=Xt(),Z=Xt(),Y=Xt(),H=p.useRef(null),T=Ag();Gr(()=>{if(k!==void 0){let v=k.trim();a.current.value=v,F.emit()}},[k]),Gr(()=>{T(6,Pe)},[]);let F=p.useMemo(()=>({subscribe:v=>(h.current.add(v),()=>h.current.delete(v)),snapshot:()=>a.current,setState:(v,B,J)=>{var K,oe,pe,me;if(!Object.is(a.current[v],B)){if(a.current[v]=B,v==="search")ce(),X(),T(1,ye);else if(v==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let w=document.getElementById(Y);w?w.focus():(K=document.getElementById(L))==null||K.focus()}if(T(7,()=>{var w;a.current.selectedItemId=(w=_e())==null?void 0:w.id,F.emit()}),J||T(5,Pe),((oe=x.current)==null?void 0:oe.value)!==void 0){let w=B??"";(me=(pe=x.current).onValueChange)==null||me.call(pe,w);return}}F.emit()}},emit:()=>{h.current.forEach(v=>v())}}),[]),ne=p.useMemo(()=>({value:(v,B,J)=>{var K;B!==((K=m.current.get(v))==null?void 0:K.value)&&(m.current.set(v,{value:B,keywords:J}),a.current.filtered.items.set(v,se(B,J)),T(2,()=>{X(),F.emit()}))},item:(v,B)=>(c.current.add(v),B&&(f.current.has(B)?f.current.get(B).add(v):f.current.set(B,new Set([v]))),T(3,()=>{ce(),X(),a.current.value||ye(),F.emit()}),()=>{m.current.delete(v),c.current.delete(v),a.current.filtered.items.delete(v);let J=_e();T(4,()=>{ce(),(J==null?void 0:J.getAttribute("id"))===v&&ye(),F.emit()})}),group:v=>(f.current.has(v)||f.current.set(v,new Set),()=>{m.current.delete(v),f.current.delete(v)}),filter:()=>x.current.shouldFilter,label:E||o["aria-label"],getDisablePointerSelection:()=>x.current.disablePointerSelection,listId:L,inputId:Y,labelId:Z,listInnerRef:H}),[]);function se(v,B){var J,K;let oe=(K=(J=x.current)==null?void 0:J.filter)!=null?K:Ng;return v?oe(v,a.current.search,B):0}function X(){if(!a.current.search||x.current.shouldFilter===!1)return;let v=a.current.filtered.items,B=[];a.current.filtered.groups.forEach(K=>{let oe=f.current.get(K),pe=0;oe.forEach(me=>{let w=v.get(me);pe=Math.max(w,pe)}),B.push([K,pe])});let J=H.current;Me().sort((K,oe)=>{var pe,me;let w=K.getAttribute("id"),Q=oe.getAttribute("id");return((pe=v.get(Q))!=null?pe:0)-((me=v.get(w))!=null?me:0)}).forEach(K=>{let oe=K.closest(ci);oe?oe.appendChild(K.parentElement===oe?K:K.closest(`${ci} > *`)):J.appendChild(K.parentElement===J?K:K.closest(`${ci} > *`))}),B.sort((K,oe)=>oe[1]-K[1]).forEach(K=>{var oe;let pe=(oe=H.current)==null?void 0:oe.querySelector(`${js}[${_n}="${encodeURIComponent(K[0])}"]`);pe==null||pe.parentElement.appendChild(pe)})}function ye(){let v=Me().find(J=>J.getAttribute("aria-disabled")!=="true"),B=v==null?void 0:v.getAttribute(_n);F.setState("value",B||void 0)}function ce(){var v,B,J,K;if(!a.current.search||x.current.shouldFilter===!1){a.current.filtered.count=c.current.size;return}a.current.filtered.groups=new Set;let oe=0;for(let pe of c.current){let me=(B=(v=m.current.get(pe))==null?void 0:v.value)!=null?B:"",w=(K=(J=m.current.get(pe))==null?void 0:J.keywords)!=null?K:[],Q=se(me,w);a.current.filtered.items.set(pe,Q),Q>0&&oe++}for(let[pe,me]of f.current)for(let w of me)if(a.current.filtered.items.get(w)>0){a.current.filtered.groups.add(pe);break}a.current.filtered.count=oe}function Pe(){var v,B,J;let K=_e();K&&(((v=K.parentElement)==null?void 0:v.firstChild)===K&&((J=(B=K.closest(js))==null?void 0:B.querySelector(kg))==null||J.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function _e(){var v;return(v=H.current)==null?void 0:v.querySelector(`${Ff}[aria-selected="true"]`)}function Me(){var v;return Array.from(((v=H.current)==null?void 0:v.querySelectorAll(Ku))||[])}function Ne(v){let B=Me()[v];B&&F.setState("value",B.getAttribute(_n))}function ke(v){var B;let J=_e(),K=Me(),oe=K.findIndex(me=>me===J),pe=K[oe+v];(B=x.current)!=null&&B.loop&&(pe=oe+v<0?K[K.length-1]:oe+v===K.length?K[0]:K[oe+v]),pe&&F.setState("value",pe.getAttribute(_n))}function W(v){let B=_e(),J=B==null?void 0:B.closest(js),K;for(;J&&!K;)J=v>0?Dg(J,js):Lg(J,js),K=J==null?void 0:J.querySelector(Ku);K?F.setState("value",K.getAttribute(_n)):ke(v)}let ae=()=>Ne(Me().length-1),G=v=>{v.preventDefault(),v.metaKey?ae():v.altKey?W(1):ke(1)},j=v=>{v.preventDefault(),v.metaKey?Ne(0):v.altKey?W(-1):ke(-1)};return p.createElement(Je.div,{ref:d,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:v=>{var B;(B=_.onKeyDown)==null||B.call(_,v);let J=v.nativeEvent.isComposing||v.keyCode===229;if(!(v.defaultPrevented||J))switch(v.key){case"n":case"j":{C&&v.ctrlKey&&G(v);break}case"ArrowDown":{G(v);break}case"p":case"k":{C&&v.ctrlKey&&j(v);break}case"ArrowUp":{j(v);break}case"Home":{v.preventDefault(),Ne(0);break}case"End":{v.preventDefault(),ae();break}case"Enter":{v.preventDefault();let K=_e();if(K){let oe=new Event(ki);K.dispatchEvent(oe)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:ne.inputId,id:ne.labelId,style:Tg},E),al(o,v=>p.createElement(Uf.Provider,{value:F},p.createElement($f.Provider,{value:ne},v))))}),Sg=p.forwardRef((o,d)=>{var a,c;let f=Xt(),m=p.useRef(null),h=p.useContext(Bf),x=Rs(),E=Wf(o),b=(c=(a=E.current)==null?void 0:a.forceMount)!=null?c:h==null?void 0:h.forceMount;Gr(()=>{if(!b)return x.item(f,h==null?void 0:h.id)},[b]);let k=Hf(f,m,[o.value,o.children,m],o.keywords),M=zi(),A=Cr(T=>T.value&&T.value===k.current),I=Cr(T=>b||x.filter()===!1?!0:T.search?T.filtered.items.get(f)>0:!0);p.useEffect(()=>{let T=m.current;if(!(!T||o.disabled))return T.addEventListener(ki,O),()=>T.removeEventListener(ki,O)},[I,o.onSelect,o.disabled]);function O(){var T,F;S(),(F=(T=E.current).onSelect)==null||F.call(T,k.current)}function S(){M.setState("value",k.current,!0)}if(!I)return null;let{disabled:C,value:_,onSelect:L,forceMount:Z,keywords:Y,...H}=o;return p.createElement(Je.div,{ref:Dn(m,d),...H,id:f,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!A,"data-disabled":!!C,"data-selected":!!A,onPointerMove:C||x.getDisablePointerSelection()?void 0:S,onClick:C?void 0:O},o.children)}),Cg=p.forwardRef((o,d)=>{let{heading:a,children:c,forceMount:f,...m}=o,h=Xt(),x=p.useRef(null),E=p.useRef(null),b=Xt(),k=Rs(),M=Cr(I=>f||k.filter()===!1?!0:I.search?I.filtered.groups.has(h):!0);Gr(()=>k.group(h),[]),Hf(h,x,[o.value,o.heading,E]);let A=p.useMemo(()=>({id:h,forceMount:f}),[f]);return p.createElement(Je.div,{ref:Dn(x,d),...m,"cmdk-group":"",role:"presentation",hidden:M?void 0:!0},a&&p.createElement("div",{ref:E,"cmdk-group-heading":"","aria-hidden":!0,id:b},a),al(o,I=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?b:void 0},p.createElement(Bf.Provider,{value:A},I))))}),Eg=p.forwardRef((o,d)=>{let{alwaysRender:a,...c}=o,f=p.useRef(null),m=Cr(h=>!h.search);return!a&&!m?null:p.createElement(Je.div,{ref:Dn(f,d),...c,"cmdk-separator":"",role:"separator"})}),_g=p.forwardRef((o,d)=>{let{onValueChange:a,...c}=o,f=o.value!=null,m=zi(),h=Cr(b=>b.search),x=Cr(b=>b.selectedItemId),E=Rs();return p.useEffect(()=>{o.value!=null&&m.setState("search",o.value)},[o.value]),p.createElement(Je.input,{ref:d,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":E.listId,"aria-labelledby":E.labelId,"aria-activedescendant":x,id:E.inputId,type:"text",value:f?o.value:h,onChange:b=>{f||m.setState("search",b.target.value),a==null||a(b.target.value)}})}),Pg=p.forwardRef((o,d)=>{let{children:a,label:c="Suggestions",...f}=o,m=p.useRef(null),h=p.useRef(null),x=Cr(b=>b.selectedItemId),E=Rs();return p.useEffect(()=>{if(h.current&&m.current){let b=h.current,k=m.current,M,A=new ResizeObserver(()=>{M=requestAnimationFrame(()=>{let I=b.offsetHeight;k.style.setProperty("--cmdk-list-height",I.toFixed(1)+"px")})});return A.observe(b),()=>{cancelAnimationFrame(M),A.unobserve(b)}}},[]),p.createElement(Je.div,{ref:Dn(m,d),...f,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":x,"aria-label":c,id:E.listId},al(o,b=>p.createElement("div",{ref:Dn(h,E.listInnerRef),"cmdk-list-sizer":""},b)))}),Mg=p.forwardRef((o,d)=>{let{open:a,onOpenChange:c,overlayClassName:f,contentClassName:m,container:h,...x}=o;return p.createElement(Pf,{open:a,onOpenChange:c},p.createElement(zf,{container:h},p.createElement(Df,{"cmdk-overlay":"",className:f}),p.createElement(Lf,{"aria-label":o.label,"cmdk-dialog":"",className:m},p.createElement(Vf,{ref:d,...x}))))}),Rg=p.forwardRef((o,d)=>Cr(a=>a.filtered.count===0)?p.createElement(Je.div,{ref:d,...o,"cmdk-empty":"",role:"presentation"}):null),zg=p.forwardRef((o,d)=>{let{progress:a,children:c,label:f="Loading...",...m}=o;return p.createElement(Je.div,{ref:d,...m,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f},al(o,h=>p.createElement("div",{"aria-hidden":!0},h)))}),Cn=Object.assign(Vf,{List:Pg,Item:Sg,Input:_g,Group:Cg,Separator:Eg,Dialog:Mg,Empty:Rg,Loading:zg});function Dg(o,d){let a=o.nextElementSibling;for(;a;){if(a.matches(d))return a;a=a.nextElementSibling}}function Lg(o,d){let a=o.previousElementSibling;for(;a;){if(a.matches(d))return a;a=a.previousElementSibling}}function Wf(o){let d=p.useRef(o);return Gr(()=>{d.current=o}),d}var Gr=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Pn(o){let d=p.useRef();return d.current===void 0&&(d.current=o()),d}function Cr(o){let d=zi(),a=()=>o(d.snapshot());return p.useSyncExternalStore(d.subscribe,a,a)}function Hf(o,d,a,c=[]){let f=p.useRef(),m=Rs();return Gr(()=>{var h;let x=(()=>{var b;for(let k of a){if(typeof k=="string")return k.trim();if(typeof k=="object"&&"current"in k)return k.current?(b=k.current.textContent)==null?void 0:b.trim():f.current}})(),E=c.map(b=>b.trim());m.value(o,x,E),(h=d.current)==null||h.setAttribute(_n,x),f.current=x}),f}var Ag=()=>{let[o,d]=p.useState(),a=Pn(()=>new Map);return Gr(()=>{a.current.forEach(c=>c()),a.current=new Map},[o]),(c,f)=>{a.current.set(c,f),d({})}};function Og(o){let d=o.type;return typeof d=="function"?d(o.props):"render"in d?d.render(o.props):o}function al({asChild:o,children:d},a){return o&&p.isValidElement(d)?p.cloneElement(Og(d),{ref:d.ref},a(d.props.children)):a(d)}var Tg={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Ig({onNavigate:o}){const[d,a]=p.useState(!1);return p.useEffect(()=>{const c=f=>{(f.metaKey||f.ctrlKey)&&f.key.toLowerCase()==="k"&&(f.preventDefault(),a(m=>!m))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),n.jsx(Cn.Dialog,{open:d,onOpenChange:a,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh]",onClick:()=>a(!1),children:n.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:c=>c.stopPropagation(),children:[n.jsx(Cn.Input,{autoFocus:!0,placeholder:"Springe zu… (Modelle, Routing, System …)",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),n.jsxs(Cn.List,{className:"max-h-80 overflow-y-auto p-2",children:[n.jsx(Cn.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),n.jsx(Cn.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:yi.map(c=>n.jsxs(Cn.Item,{value:`${c.label} ${c.hint}`,onSelect:()=>{o(c.id),a(!1)},className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[n.jsx(c.icon,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:c.label}),n.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:c.hint})]},c.id))})]})]})})}async function fe(o,d){var E;const a={"Content-Type":"application/json",...d==null?void 0:d.headers},c=localStorage.getItem("mc_sudo_password"),f=localStorage.getItem("mc_hf_token");c&&(a["X-Sudo-Password"]=c);let m=d==null?void 0:d.body;if((((E=d==null?void 0:d.method)==null?void 0:E.toUpperCase())||"GET")==="POST"){if(typeof m=="string")try{const b=JSON.parse(m);let k=!1;c&&!("sudo_password"in b)&&(b.sudo_password=c,k=!0),f&&!("hf_token"in b)&&(b.hf_token=f,k=!0),k&&(m=JSON.stringify(b))}catch{}else if(!m){const b={};c&&(b.sudo_password=c),f&&(b.hf_token=f),Object.keys(b).length>0&&(m=JSON.stringify(b))}}const x=await fetch(o,{...d,headers:a,body:m});if(!x.ok)throw new Error(`${x.status} ${x.statusText}`);return x.json()}function Gf(o){var d,a,c="";if(typeof o=="string"||typeof o=="number")c+=o;else if(typeof o=="object")if(Array.isArray(o)){var f=o.length;for(d=0;d<f;d++)o[d]&&(a=Gf(o[d]))&&(c&&(c+=" "),c+=a)}else for(a in o)o[a]&&(c&&(c+=" "),c+=a);return c}function Fg(){for(var o,d,a=0,c="",f=arguments.length;a<f;a++)(o=arguments[a])&&(d=Gf(o))&&(c&&(c+=" "),c+=d);return c}const Di="-",$g=o=>{const d=Bg(o),{conflictingClassGroups:a,conflictingClassGroupModifiers:c}=o;return{getClassGroupId:h=>{const x=h.split(Di);return x[0]===""&&x.length!==1&&x.shift(),Kf(x,d)||Ug(h)},getConflictingClassGroupIds:(h,x)=>{const E=a[h]||[];return x&&c[h]?[...E,...c[h]]:E}}},Kf=(o,d)=>{var h;if(o.length===0)return d.classGroupId;const a=o[0],c=d.nextPart.get(a),f=c?Kf(o.slice(1),c):void 0;if(f)return f;if(d.validators.length===0)return;const m=o.join(Di);return(h=d.validators.find(({validator:x})=>x(m)))==null?void 0:h.classGroupId},Qu=/^\[(.+)\]$/,Ug=o=>{if(Qu.test(o)){const d=Qu.exec(o)[1],a=d==null?void 0:d.substring(0,d.indexOf(":"));if(a)return"arbitrary.."+a}},Bg=o=>{const{theme:d,prefix:a}=o,c={nextPart:new Map,validators:[]};return Wg(Object.entries(o.classGroups),a).forEach(([m,h])=>{Ni(h,c,m,d)}),c},Ni=(o,d,a,c)=>{o.forEach(f=>{if(typeof f=="string"){const m=f===""?d:qu(d,f);m.classGroupId=a;return}if(typeof f=="function"){if(Vg(f)){Ni(f(c),d,a,c);return}d.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([m,h])=>{Ni(h,qu(d,m),a,c)})})},qu=(o,d)=>{let a=o;return d.split(Di).forEach(c=>{a.nextPart.has(c)||a.nextPart.set(c,{nextPart:new Map,validators:[]}),a=a.nextPart.get(c)}),a},Vg=o=>o.isThemeGetter,Wg=(o,d)=>d?o.map(([a,c])=>{const f=c.map(m=>typeof m=="string"?d+m:typeof m=="object"?Object.fromEntries(Object.entries(m).map(([h,x])=>[d+h,x])):m);return[a,f]}):o,Hg=o=>{if(o<1)return{get:()=>{},set:()=>{}};let d=0,a=new Map,c=new Map;const f=(m,h)=>{a.set(m,h),d++,d>o&&(d=0,c=a,a=new Map)};return{get(m){let h=a.get(m);if(h!==void 0)return h;if((h=c.get(m))!==void 0)return f(m,h),h},set(m,h){a.has(m)?a.set(m,h):f(m,h)}}},Qf="!",Gg=o=>{const{separator:d,experimentalParseClassName:a}=o,c=d.length===1,f=d[0],m=d.length,h=x=>{const E=[];let b=0,k=0,M;for(let C=0;C<x.length;C++){let _=x[C];if(b===0){if(_===f&&(c||x.slice(C,C+m)===d)){E.push(x.slice(k,C)),k=C+m;continue}if(_==="/"){M=C;continue}}_==="["?b++:_==="]"&&b--}const A=E.length===0?x:x.substring(k),I=A.startsWith(Qf),O=I?A.substring(1):A,S=M&&M>k?M-k:void 0;return{modifiers:E,hasImportantModifier:I,baseClassName:O,maybePostfixModifierPosition:S}};return a?x=>a({className:x,parseClassName:h}):h},Kg=o=>{if(o.length<=1)return o;const d=[];let a=[];return o.forEach(c=>{c[0]==="["?(d.push(...a.sort(),c),a=[]):a.push(c)}),d.push(...a.sort()),d},Qg=o=>({cache:Hg(o.cacheSize),parseClassName:Gg(o),...$g(o)}),qg=/\s+/,Zg=(o,d)=>{const{parseClassName:a,getClassGroupId:c,getConflictingClassGroupIds:f}=d,m=[],h=o.trim().split(qg);let x="";for(let E=h.length-1;E>=0;E-=1){const b=h[E],{modifiers:k,hasImportantModifier:M,baseClassName:A,maybePostfixModifierPosition:I}=a(b);let O=!!I,S=c(O?A.substring(0,I):A);if(!S){if(!O){x=b+(x.length>0?" "+x:x);continue}if(S=c(A),!S){x=b+(x.length>0?" "+x:x);continue}O=!1}const C=Kg(k).join(":"),_=M?C+Qf:C,L=_+S;if(m.includes(L))continue;m.push(L);const Z=f(S,O);for(let Y=0;Y<Z.length;++Y){const H=Z[Y];m.push(_+H)}x=b+(x.length>0?" "+x:x)}return x};function Yg(){let o=0,d,a,c="";for(;o<arguments.length;)(d=arguments[o++])&&(a=qf(d))&&(c&&(c+=" "),c+=a);return c}const qf=o=>{if(typeof o=="string")return o;let d,a="";for(let c=0;c<o.length;c++)o[c]&&(d=qf(o[c]))&&(a&&(a+=" "),a+=d);return a};function Jg(o,...d){let a,c,f,m=h;function h(E){const b=d.reduce((k,M)=>M(k),o());return a=Qg(b),c=a.cache.get,f=a.cache.set,m=x,x(E)}function x(E){const b=c(E);if(b)return b;const k=Zg(E,a);return f(E,k),k}return function(){return m(Yg.apply(null,arguments))}}const Te=o=>{const d=a=>a[o]||[];return d.isThemeGetter=!0,d},Zf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Xg=/^\d+\/\d+$/,e0=new Set(["px","full","screen"]),t0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,r0=/\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$/,n0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,s0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,o0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jt=o=>Rn(o)||e0.has(o)||Xg.test(o),wr=o=>An(o,"length",p0),Rn=o=>!!o&&!Number.isNaN(Number(o)),ui=o=>An(o,"number",Rn),ks=o=>!!o&&Number.isInteger(Number(o)),l0=o=>o.endsWith("%")&&Rn(o.slice(0,-1)),we=o=>Zf.test(o),jr=o=>t0.test(o),a0=new Set(["length","size","percentage"]),i0=o=>An(o,a0,Yf),d0=o=>An(o,"position",Yf),c0=new Set(["image","url"]),u0=o=>An(o,c0,h0),f0=o=>An(o,"",m0),Ns=()=>!0,An=(o,d,a)=>{const c=Zf.exec(o);return c?c[1]?typeof d=="string"?c[1]===d:d.has(c[1]):a(c[2]):!1},p0=o=>r0.test(o)&&!n0.test(o),Yf=()=>!1,m0=o=>s0.test(o),h0=o=>o0.test(o),x0=()=>{const o=Te("colors"),d=Te("spacing"),a=Te("blur"),c=Te("brightness"),f=Te("borderColor"),m=Te("borderRadius"),h=Te("borderSpacing"),x=Te("borderWidth"),E=Te("contrast"),b=Te("grayscale"),k=Te("hueRotate"),M=Te("invert"),A=Te("gap"),I=Te("gradientColorStops"),O=Te("gradientColorStopPositions"),S=Te("inset"),C=Te("margin"),_=Te("opacity"),L=Te("padding"),Z=Te("saturate"),Y=Te("scale"),H=Te("sepia"),T=Te("skew"),F=Te("space"),ne=Te("translate"),se=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],ye=()=>["auto",we,d],ce=()=>[we,d],Pe=()=>["",Jt,wr],_e=()=>["auto",Rn,we],Me=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ne=()=>["solid","dashed","dotted","double","none"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",we],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Rn,we];return{cacheSize:500,separator:":",theme:{colors:[Ns],spacing:[Jt,wr],blur:["none","",jr,we],brightness:j(),borderColor:[o],borderRadius:["none","","full",jr,we],borderSpacing:ce(),borderWidth:Pe(),contrast:j(),grayscale:ae(),hueRotate:j(),invert:ae(),gap:ce(),gradientColorStops:[o],gradientColorStopPositions:[l0,wr],inset:ye(),margin:ye(),opacity:j(),padding:ce(),saturate:j(),scale:j(),sepia:ae(),skew:j(),space:ce(),translate:ce()},classGroups:{aspect:[{aspect:["auto","square","video",we]}],container:["container"],columns:[{columns:[jr]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Me(),we]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:se()}],"overscroll-x":[{"overscroll-x":se()}],"overscroll-y":[{"overscroll-y":se()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ks,we]}],basis:[{basis:ye()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",we]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",ks,we]}],"grid-cols":[{"grid-cols":[Ns]}],"col-start-end":[{col:["auto",{span:["full",ks,we]},we]}],"col-start":[{"col-start":_e()}],"col-end":[{"col-end":_e()}],"grid-rows":[{"grid-rows":[Ns]}],"row-start-end":[{row:["auto",{span:[ks,we]},we]}],"row-start":[{"row-start":_e()}],"row-end":[{"row-end":_e()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",we]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",we]}],gap:[{gap:[A]}],"gap-x":[{"gap-x":[A]}],"gap-y":[{"gap-y":[A]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[L]}],px:[{px:[L]}],py:[{py:[L]}],ps:[{ps:[L]}],pe:[{pe:[L]}],pt:[{pt:[L]}],pr:[{pr:[L]}],pb:[{pb:[L]}],pl:[{pl:[L]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",we,d]}],"min-w":[{"min-w":[we,d,"min","max","fit"]}],"max-w":[{"max-w":[we,d,"none","full","min","max","fit","prose",{screen:[jr]},jr]}],h:[{h:[we,d,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[we,d,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[we,d,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[we,d,"auto","min","max","fit"]}],"font-size":[{text:["base",jr,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ui]}],"font-family":[{font:[Ns]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",we]}],"line-clamp":[{"line-clamp":["none",Rn,ui]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jt,we]}],"list-image":[{"list-image":["none",we]}],"list-style-type":[{list:["none","disc","decimal",we]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[o]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[o]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jt,wr]}],"underline-offset":[{"underline-offset":["auto",Jt,we]}],"text-decoration-color":[{decoration:[o]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ce()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Me(),d0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",i0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},u0]}],"bg-color":[{bg:[o]}],"gradient-from-pos":[{from:[O]}],"gradient-via-pos":[{via:[O]}],"gradient-to-pos":[{to:[O]}],"gradient-from":[{from:[I]}],"gradient-via":[{via:[I]}],"gradient-to":[{to:[I]}],rounded:[{rounded:[m]}],"rounded-s":[{"rounded-s":[m]}],"rounded-e":[{"rounded-e":[m]}],"rounded-t":[{"rounded-t":[m]}],"rounded-r":[{"rounded-r":[m]}],"rounded-b":[{"rounded-b":[m]}],"rounded-l":[{"rounded-l":[m]}],"rounded-ss":[{"rounded-ss":[m]}],"rounded-se":[{"rounded-se":[m]}],"rounded-ee":[{"rounded-ee":[m]}],"rounded-es":[{"rounded-es":[m]}],"rounded-tl":[{"rounded-tl":[m]}],"rounded-tr":[{"rounded-tr":[m]}],"rounded-br":[{"rounded-br":[m]}],"rounded-bl":[{"rounded-bl":[m]}],"border-w":[{border:[x]}],"border-w-x":[{"border-x":[x]}],"border-w-y":[{"border-y":[x]}],"border-w-s":[{"border-s":[x]}],"border-w-e":[{"border-e":[x]}],"border-w-t":[{"border-t":[x]}],"border-w-r":[{"border-r":[x]}],"border-w-b":[{"border-b":[x]}],"border-w-l":[{"border-l":[x]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...Ne(),"hidden"]}],"divide-x":[{"divide-x":[x]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[x]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:Ne()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...Ne()]}],"outline-offset":[{"outline-offset":[Jt,we]}],"outline-w":[{outline:[Jt,wr]}],"outline-color":[{outline:[o]}],"ring-w":[{ring:Pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[o]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Jt,wr]}],"ring-offset-color":[{"ring-offset":[o]}],shadow:[{shadow:["","inner","none",jr,f0]}],"shadow-color":[{shadow:[Ns]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[c]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",jr,we]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[k]}],invert:[{invert:[M]}],saturate:[{saturate:[Z]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[k]}],"backdrop-invert":[{"backdrop-invert":[M]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[Z]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",we]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",we]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",we]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Y]}],"scale-x":[{"scale-x":[Y]}],"scale-y":[{"scale-y":[Y]}],rotate:[{rotate:[ks,we]}],"translate-x":[{"translate-x":[ne]}],"translate-y":[{"translate-y":[ne]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",we]}],accent:[{accent:["auto",o]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we]}],"caret-color":[{caret:[o]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ce()}],"scroll-mx":[{"scroll-mx":ce()}],"scroll-my":[{"scroll-my":ce()}],"scroll-ms":[{"scroll-ms":ce()}],"scroll-me":[{"scroll-me":ce()}],"scroll-mt":[{"scroll-mt":ce()}],"scroll-mr":[{"scroll-mr":ce()}],"scroll-mb":[{"scroll-mb":ce()}],"scroll-ml":[{"scroll-ml":ce()}],"scroll-p":[{"scroll-p":ce()}],"scroll-px":[{"scroll-px":ce()}],"scroll-py":[{"scroll-py":ce()}],"scroll-ps":[{"scroll-ps":ce()}],"scroll-pe":[{"scroll-pe":ce()}],"scroll-pt":[{"scroll-pt":ce()}],"scroll-pr":[{"scroll-pr":ce()}],"scroll-pb":[{"scroll-pb":ce()}],"scroll-pl":[{"scroll-pl":ce()}],"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",we]}],fill:[{fill:[o,"none"]}],"stroke-w":[{stroke:[Jt,wr,ui]}],stroke:[{stroke:[o,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},g0=Jg(x0);function ee(...o){return g0(Fg(o))}function Ms(o){return o?o.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function Qr({type:o,title:d,message:a,defaultValue:c,onConfirm:f,onCancel:m}){return n.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:d}),n.jsx("button",{onClick:m||(()=>f()),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:a}),o==="prompt"&&n.jsx("input",{type:"text",id:"custom-dialog-input",defaultValue:c,className:"w-full h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var x;if(h.key==="Enter"){const E=(x=document.getElementById("custom-dialog-input"))==null?void 0:x.value;f(E)}}}),n.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(o==="confirm"||o==="prompt")&&n.jsx("button",{onClick:m,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:()=>{var x;const h=o==="prompt"?(x=document.getElementById("custom-dialog-input"))==null?void 0:x.value:void 0;f(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:o==="confirm"?"Ja, fortfahren":o==="prompt"?"Übernehmen":"OK"})]})]})})}function En(o){return(o/1024**3).toFixed(1)}function Qo({value:o,label:d,detail:a}){const f=2*Math.PI*24,m=f-Math.min(o,100)/100*f,h=o>90?"stroke-red-500":o>75?"stroke-amber-500":"stroke-primary";return n.jsxs("div",{className:"flex flex-col items-center gap-1.5 p-2 bg-background/20 rounded-xl border border-border/40",children:[n.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[n.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90",children:[n.jsx("circle",{cx:"32",cy:"32",r:24,className:"stroke-muted fill-none",strokeWidth:"4.5"}),n.jsx("circle",{cx:"32",cy:"32",r:24,className:ee("fill-none transition-all duration-700 ease-out",h),strokeWidth:"4.5",strokeDasharray:f,strokeDashoffset:m,strokeLinecap:"round"})]}),n.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(o),"%"]})]}),n.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:d}),a&&n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function v0(){const[o,d]=p.useState(null),[a,c]=p.useState(null),[f,m]=p.useState([]),[h,x]=p.useState([]),[E,b]=p.useState([]),[k,M]=p.useState(null),[A,I]=p.useState([]),[O,S]=p.useState(null),[C,_]=p.useState(""),[L,Z]=p.useState(!1),[Y,H]=p.useState(""),[T,F]=p.useState(!1),[ne,se]=p.useState({open:!1,actionPath:"",actionLabel:""}),[X,ye]=p.useState(null),[ce,Pe]=p.useState(!1);async function _e(w){try{await fe("/api/agent/brain",{method:"POST",body:JSON.stringify({model:w})}),ye({type:"alert",title:"Erfolgreich",message:`Hermes-Gehirn wurde auf '${w}' geändert. Der Gateway-Dienst wurde neu gestartet.`,onConfirm:()=>ye(null)}),v(),Pe(!1)}catch(Q){ye({type:"alert",title:"Fehler",message:`Fehler beim Wechseln des Gehirns: ${Q.message}`,onConfirm:()=>ye(null)})}}function Me(w,Q,Le){ye({type:"confirm",title:w,message:Q,onConfirm:()=>{ye(null),Le()},onCancel:()=>ye(null)})}const[Ne,ke]=p.useState(""),[W,ae]=p.useState("stable"),[G,j]=p.useState(!1);function v(){fe("/api/system/status").then(d).catch(()=>{}),fe("/api/agent/status").then(c).catch(()=>{}),fe("/api/models").then(w=>{m(w.models||[]),x(w.running||[])}).catch(()=>{}),fe("/api/memory?category=").then(w=>b(w.slice(0,3))).catch(()=>{}),fe("/api/maintenance/updates").then(M).catch(()=>{}),fe("/api/jobs").then(w=>I(w.jobs||[])).catch(()=>{}),fe("/api/system/token-stats").then(S).catch(()=>{})}p.useEffect(()=>{v();const w=setInterval(v,3e3);return()=>clearInterval(w)},[]);async function B(w,Q,Le,$t){_(`${Q} wird ausgeführt...`),Z(!0);try{const lt={...Le},nt=await fe(w,{method:"POST",body:JSON.stringify(lt)});if(nt.status==="password_required"||nt.status==="incorrect_password"){se({open:!0,actionPath:w,actionLabel:Q,payload:Le,error:nt.status==="incorrect_password"?"Falsches Sudo-Passwort. Bitte erneut versuchen.":void 0}),_("");return}nt.job_id?_(`${Q} gestartet (Job-ID: ${nt.job_id})`):nt.ok?_(`${Q} erfolgreich ausgeführt.`):_(`Fehler: ${nt.err||"Unbekannter Fehler"}`),v()}catch(lt){_(`Fehler bei ${Q}: ${lt.message}`)}finally{Z(!1)}}async function J(){F(!0);try{const w={...ne.payload,sudo_password:Y},Q=await fe(ne.actionPath,{method:"POST",body:JSON.stringify(w)});if(Q.status==="password_required"||Q.status==="incorrect_password"){se(Le=>({...Le,error:"Falsches Sudo-Passwort. Bitte erneut versuchen."}));return}Q.job_id?_(`${ne.actionLabel} gestartet (Job-ID: ${Q.job_id})`):Q.ok?_(`${ne.actionLabel} erfolgreich ausgeführt.`):_(`Fehler: ${Q.err||"Unbekannter Fehler"}`),se({open:!1,actionPath:"",actionLabel:""}),H(""),v()}catch(w){_(`Fehler: ${w.message}`),se({open:!1,actionPath:"",actionLabel:""}),H("")}finally{F(!1)}}async function K(w,Q){_(`Upgrade für ${w} wird gestartet...`);try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:w,role:Q,quant:"Q4_K_M",jinja:!0})}),_("Upgrade-Download gestartet."),v()}catch(Le){_(`Upgrade fehlgeschlagen: ${Le.message}`)}}async function oe(){if(!(!Ne.trim()||G)){j(!0);try{await fe("/api/memory",{method:"POST",body:JSON.stringify({content:Ne,category:W,source:"dashboard"})}),ke(""),fe("/api/memory?category=").then(w=>b(w.slice(0,3))).catch(()=>{})}catch(w){console.error(w)}finally{j(!1)}}}const pe=A.find(w=>w.label.includes("OS-Update")&&(w.state==="running"||w.state==="queued")),me=A.find(w=>w.label.includes("Engine-Update")&&(w.state==="running"||w.state==="queued"));return n.jsxs("div",{className:"space-y-6",children:[ne.open&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/60 bg-card/90 backdrop-blur-xl p-5 shadow-2xl space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-space",children:"Sudo-Passwort erforderlich"}),n.jsx("button",{onClick:()=>{se({open:!1,actionPath:"",actionLabel:""}),H("")},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Für die Aktion ",n.jsx("strong",{children:ne.actionLabel})," wird das Administrator-Passwort (Sudo) auf der Box benötigt."]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("input",{type:"password",value:Y,onChange:w=>H(w.target.value),placeholder:"Sudo-Passwort eingeben...",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground",onKeyDown:w=>w.key==="Enter"&&J(),autoFocus:!0}),ne.error&&n.jsx("div",{className:"text-[10px] font-semibold text-red-400",children:ne.error})]}),n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsx("button",{onClick:()=>{se({open:!1,actionPath:"",actionLabel:""}),H("")},className:"h-8 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent transition-all cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:J,disabled:!Y||T,className:"h-8 px-4 rounded-lg bg-primary text-primary-foreground text-[10px] font-bold uppercase hover:opacity-90 transition-all disabled:opacity-50 cursor-pointer flex items-center justify-center gap-1.5",children:T?"Prüfe...":"Ausführen"})]})]})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Zentrale"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[n.jsxs("div",{className:"md:col-span-2 flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(gt,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"System-Status"})]}),o?n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(Qo,{value:o.cpu.percent,label:"CPU",detail:o.cpu.cores?`${o.cpu.cores} Cores`:void 0}),n.jsx(Qo,{value:o.ram.percent,label:"RAM",detail:`${En(o.ram.used)} / ${En(o.ram.total)} GB`}),o.gpu&&o.gpu.busy_percent!=null&&o.gpu.gtt_used!=null&&o.gpu.gtt_total!=null&&n.jsx(Qo,{value:o.gpu.busy_percent,label:"GPU",detail:`${En(o.gpu.gtt_used)} / ${En(o.gpu.gtt_total)} GB`}),o.disk&&n.jsx(Qo,{value:o.disk.percent,label:"Disk",detail:`${En(o.disk.used)} / ${En(o.disk.total)} GB`})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(o==null?void 0:o.temp)&&(o.temp.cpu||o.temp.gpu)&&n.jsxs("div",{className:"mt-4 flex gap-4 text-xs font-mono text-muted-foreground/80 border-t border-border/30 pt-3",children:[o.temp.cpu!=null&&n.jsxs("span",{children:["CPU Temp: ",o.temp.cpu," °C"]}),o.temp.gpu!=null&&n.jsxs("span",{children:["GPU Temp: ",o.temp.gpu," °C"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 border-b border-border/20 pb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ch,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Updates & Pflege"})]}),(k==null?void 0:k.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground/80 font-mono",children:["Zuletzt gesucht: ",new Date(k.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),k?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.os>0?"border-amber-500/30 bg-amber-500/5 text-amber-400 font-semibold":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"OS-Pakete"}),n.jsx("span",{className:"font-mono",children:k.os>0?`${k.os} verfügbar`:"aktuell"})]}),n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.engine>0?"border-amber-500/30 bg-amber-500/5 text-amber-400 font-semibold":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"Engine (llama.cpp)"}),n.jsx("span",{className:"font-mono",children:k.engine>0?"Update verfügbar":"aktuell"})]}),n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.models>0?"border-primary/30 bg-primary/5 text-primary font-semibold animate-pulse":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"Modell-Upgrades"}),n.jsx("span",{className:"font-mono",children:k.models>0?`${k.models} verfügbar`:"aktuell"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-border/20 pt-3",children:[n.jsx("button",{onClick:()=>B("/api/maintenance/os-update","OS-Update"),disabled:L||!!pe,className:"h-8 px-2 rounded-lg border border-border/60 bg-background/20 text-[10px] font-bold uppercase hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer disabled:opacity-50 flex items-center justify-center gap-1",children:pe?n.jsxs(n.Fragment,{children:[n.jsx(Br,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",pe.progress??0,"%)"]})]}):n.jsx("span",{children:"OS Update"})}),n.jsx("button",{onClick:()=>B("/api/maintenance/engine-update","Engine-Update"),disabled:L||!!me,className:"h-8 px-2 rounded-lg border border-border/60 bg-background/20 text-[10px] font-bold uppercase hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer disabled:opacity-50 flex items-center justify-center gap-1",children:me?n.jsxs(n.Fragment,{children:[n.jsx(Br,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",me.progress??0,"%)"]})]}):n.jsx("span",{children:"Engine Update"})})]}),n.jsxs("button",{onClick:()=>{Me("Host-System neu starten?","Bist du sicher, dass du das Host-System neu starten willst?",()=>B("/api/maintenance/reboot","Reboot"))},disabled:L,className:"w-full h-8 flex items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 text-red-400 text-[10px] font-bold uppercase hover:bg-red-500/10 transition-all cursor-pointer disabled:opacity-50",children:[n.jsx(df,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Host Reboot"})]}),k.model_list.length>0&&n.jsxs("div",{className:"space-y-1.5 border-t border-border/20 pt-3",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 tracking-wider",children:"Verfügbare Modell-Upgrades:"}),n.jsx("div",{className:"max-h-24 overflow-y-auto space-y-1.5 pr-1 scrollbar-thin",children:k.model_list.map(w=>n.jsxs("div",{className:"flex items-center justify-between p-2 rounded bg-background/25 border border-border/30 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("span",{className:"truncate flex-1 mr-1.5",title:`${w.role}: ${w.repo}`,children:[n.jsx("span",{className:"text-primary font-bold uppercase",children:w.role}),": ",w.repo.split("/").pop()]}),n.jsxs("button",{onClick:()=>K(w.repo,w.role),className:"px-2 py-0.5 text-[8px] font-bold uppercase rounded bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer flex items-center gap-0.5",children:[n.jsx(Vr,{className:"h-2.5 w-2.5"})," Laden"]})]},w.repo))})]})]}):n.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."}),C&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:C}),n.jsxs("div",{className:"text-[9px] text-muted-foreground/60 leading-normal border-t border-border/10 pt-2.5 flex items-start gap-1",children:[n.jsx(Wr,{className:"h-3 w-3 shrink-0 text-muted-foreground/50 mt-0.5"}),n.jsxs("span",{children:["OS-Update & Reboot benötigen NOPASSWD in ",n.jsx("code",{children:"/etc/sudoers"})," (z.B. ",n.jsx("code",{children:"hitonabi ALL=(root) NOPASSWD:..."}),") oder ein gültiges Sudo-Passwort per Pop-up."]})]})]}),n.jsx("div",{className:"mt-4 border-t border-border/30 pt-3 shrink-0",children:n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer")),className:"w-full h-8 flex items-center justify-center gap-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer shadow-md shadow-primary/10",children:"System-Zentrale öffnen"})})]})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 xl:grid-cols-4",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ss,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(a==null?void 0:a.webui_url)&&n.jsxs("a",{href:Ms(a.webui_url),target:"_blank",rel:"noopener",className:ee("flex items-center gap-1 px-3 py-1 rounded-lg text-xs font-medium transition-all",a.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/20":"border border-border text-muted-foreground"),children:[n.jsx(el,{className:"h-3 w-3"})," Hermes öffnen"]})]}),a?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[n.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:ee("h-2 w-2 rounded-full",a.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:a.gateway_reachable?"Online":"Offline"})]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[n.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"WebUI"}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:ee("h-2 w-2 rounded-full",a.webui_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:a.webui_reachable?"Online":"Offline"})]})]})]}),n.jsxs("div",{onClick:()=>Pe(!0),className:"p-3 bg-background/20 rounded-xl border border-border/40 hover:border-primary/45 hover:bg-background/30 transition-all duration-300 cursor-pointer group",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Aktives Gehirn"}),n.jsxs("button",{className:"flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider text-primary border border-primary/20 bg-primary/10 hover:bg-primary/20 px-1.5 py-0.5 rounded transition-all cursor-pointer font-space",children:[n.jsx(gt,{className:"h-3 w-3"})," Ändern"]})]}),n.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[n.jsx(Es,{className:"h-3.5 w-3.5"}),a.brain_model?`model: ${a.brain_model}`:"model: auto"]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),n.jsx("div",{className:"mt-3 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Gedächtnis & Stack-Tools via MCP gekoppelt."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Es,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Rollen-Belegung"})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:["fast","heavy","coder","reasoning","vision","scout"].map(w=>{var $t;const Q=f.find(lt=>lt.role===w),Le=Q?h.includes(Q.name):!1;return n.jsxs("div",{className:ee("flex items-center justify-between p-2 rounded-xl border transition-all duration-300",Le?"border-emerald-500/30 bg-emerald-500/5 shadow-sm shadow-emerald-500/5":Q?"border-primary/20 bg-primary/5":"border-border/30 bg-background/10 opacity-60"),children:[n.jsx("div",{className:"min-w-0 flex-1 mr-2",children:n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:ee("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",w==="fast"?"bg-cyan-500/15 text-cyan-400 border-cyan-500/25":w==="heavy"?"bg-amber-500/15 text-amber-400 border-amber-500/25":w==="coder"?"bg-violet-500/15 text-violet-400 border-violet-500/25":w==="reasoning"?"bg-emerald-500/15 text-emerald-400 border-emerald-500/25":w==="vision"?"bg-pink-500/15 text-pink-400 border-pink-500/25":"bg-teal-500/15 text-teal-400 border-teal-500/25"),children:w}),n.jsxs("div",{className:"flex flex-col min-w-0",children:[n.jsx("span",{className:"text-xs font-semibold truncate font-mono text-foreground",children:Q?($t=Q.name.split("/").pop())==null?void 0:$t.replace(/\.gguf$/i,""):"nicht zugewiesen"}),Q&&n.jsxs("div",{className:"flex gap-1 items-center mt-0.5 flex-wrap",children:[Q.prompt_cache&&n.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-cyan-500/10 text-cyan-400 border border-cyan-500/20 px-1 py-0.5 rounded",title:"Prompt Caching aktiv",children:"PC"}),Q.spec_draft_model&&n.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-1 py-0.5 rounded",title:`Speculative Decoding aktiv (Draft: ${Q.spec_draft_model})`,children:"SPEC"}),Q.parallel_slots>1&&n.jsxs("span",{className:"text-[7px] leading-none font-mono font-bold bg-violet-500/10 text-violet-400 border border-violet-500/20 px-1 py-0.5 rounded",title:`${Q.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",Q.parallel_slots]})]})]})]})}),n.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:Q?Le?n.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground uppercase tracking-wider font-mono",children:"bereit"}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground/60 uppercase tracking-wider font-mono",children:"—"})})]},w)})})]}),n.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Laden erfolgt automatisch per Auto-Swap."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Cs,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("textarea",{value:Ne,onChange:w=>ke(w.target.value),placeholder:"Fakt / Regel im Pool speichern...",rows:2,className:"w-full resize-none rounded-xl border border-border/50 bg-background/30 p-2 text-[10px] outline-none focus:ring-1 focus:ring-primary transition-all leading-normal"}),n.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[n.jsxs("select",{value:W,onChange:w=>ae(w.target.value),className:"h-7 rounded-lg border border-border/50 bg-background/50 px-2 text-[10px] outline-none cursor-pointer",children:[n.jsx("option",{value:"stable",children:"🔵 Fakt"}),n.jsx("option",{value:"instruction",children:"📋 Regel"}),n.jsx("option",{value:"user",children:"👤 User"}),n.jsx("option",{value:"versioned",children:"🟡 Version"})]}),n.jsxs("button",{onClick:oe,disabled:!Ne.trim()||G,className:"flex h-7 items-center gap-1 rounded-lg bg-primary px-3 text-[10px] font-semibold text-primary-foreground hover:opacity-90 disabled:opacity-50 transition-all cursor-pointer",children:[n.jsx(af,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),n.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[n.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),n.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:E.length===0?n.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):E.map(w=>n.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[n.jsx("span",{className:"shrink-0 text-[8px] font-mono text-muted-foreground/80 px-1 py-0.5 rounded bg-muted/20",children:w.category}),n.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:w.content,children:w.content})]},w.id))})]})]}),n.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Steht allen Clients per MCP zur Verfügung."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(ph,{className:"h-4.5 w-4.5 text-primary animate-pulse"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Effizienz & Ersparnis"})]}),O?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Geld gespart"}),n.jsxs("div",{className:"text-base font-bold text-emerald-400 mt-0.5 tracking-tight font-space",children:[O.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," €"]}),n.jsxs("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:["(",O.saved_usd.toLocaleString("en-US",{minimumFractionDigits:2})," $)"]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Gesamt-Tokens"}),n.jsx("div",{className:"text-base font-bold text-primary mt-0.5 tracking-tight font-space",children:O.total_tokens.toLocaleString("de-DE")}),n.jsx("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:"(Lokale Inferenz)"})]})]}),n.jsxs("div",{className:"space-y-2 border-t border-border/20 pt-3 text-[10px] text-muted-foreground",children:[n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Input (Prompts):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[O.prompt_tokens.toLocaleString("de-DE")," tkn"]})]}),n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Output (Antworten):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[O.completion_tokens.toLocaleString("de-DE")," tkn"]})]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Statistiken…"})]}),n.jsx("div",{className:"mt-4 text-[9px] text-muted-foreground/70 border-t border-border/30 pt-2.5 leading-normal",children:"Berechnet im Vergleich zu Cloud-APIs von Juni 2026 (Ø 15,00 $ / 75,00 $ pro 1M tkn)."})]})]}),a&&ce&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[n.jsx(gt,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),n.jsx("button",{onClick:()=>Pe(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',n.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),n.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:["auto","fast","heavy",...f.map(w=>{var Q;return((Q=w.name.split("/").pop())==null?void 0:Q.replace(".gguf",""))||w.name})].map(w=>{const Q=["auto","fast","heavy"].includes(w);return n.jsxs("button",{onClick:()=>_e(w),className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",a.brain_model===w||!a.brain_model&&w==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:w}),n.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:Q?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(a.brain_model===w||!a.brain_model&&w==="auto")&&n.jsx(zn,{className:"h-4 w-4 shrink-0 text-primary"})]},w)})})]})}),X&&n.jsx(Qr,{type:X.type,title:X.title,message:X.message,onConfirm:()=>X.onConfirm(),onCancel:X.onCancel})]})}function $r({children:o,tone:d="muted"}){const a={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return n.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${a[d]}`,children:o})}function Zu({caps:o}){return o?n.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[o.coder&&n.jsx($r,{children:"💻 Code"}),o.vision&&n.jsx($r,{children:"👁 Bild"}),o.reasoning&&n.jsx($r,{children:"🧠 Reason"}),o.moe&&n.jsxs($r,{tone:"primary",children:["🧩 MoE",o.active_b?`·${o.active_b}b`:""]}),o.tools==="yes"&&n.jsx($r,{tone:"primary",children:"🛠 Tools"}),o.tools==="likely"&&n.jsx($r,{tone:"warn",children:"🛠 Tools?"}),o.embedding&&n.jsx($r,{children:"🔢 Embed"})]}):null}function Si(o){return o?o>1024**3?`${(o/1024**3).toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`:""}function y0(o){if(!o)return"";const d=Math.floor(o/60);return d>0?`${d} min`:`${o} s`}function b0({onError:o}){const[d,a]=p.useState([]),[c,f]=p.useState(null);function m(){fe("/api/jobs").then(b=>a(b.jobs||[])).catch(()=>{})}p.useEffect(()=>{m();const b=setInterval(m,2e3);return()=>clearInterval(b)},[]);async function h(b){try{await fe(`/api/jobs/${b}/cancel`,{method:"POST"}),m()}catch(k){o?o(k.message):f(k.message)}}const x=d.filter(b=>b.state==="running"||b.state==="queued"),E=d.filter(b=>b.state!=="running"&&b.state!=="queued").slice(-3);return x.length===0&&E.length===0?null:n.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),x.map(b=>n.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[n.jsxs("div",{className:"flex justify-between items-center text-xs",children:[n.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:b.label}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-muted-foreground font-mono",children:[b.progress??0,"% • ",Si(b.done_bytes),"/",Si(b.total_bytes),b.eta_s?` • ETA ${y0(b.eta_s)}`:""]}),n.jsx("button",{onClick:()=>h(b.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),n.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:n.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${b.progress??0}%`}})})]},b.id)),E.map(b=>n.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[n.jsx("span",{className:"truncate",children:b.label}),n.jsx("span",{className:ee("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",b.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:b.state})]},b.id)),c&&n.jsx(Qr,{type:"alert",title:"Fehler",message:c,onConfirm:()=>f(null)})]})}function Ur(o){if(!o)return"—";const d=o/1024**3;return d>=1?`${d.toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`}function Yu(o){return o?`${Math.round(o/1024)}k`:"—"}function w0({fit:o}){const d={perfect:"bg-emerald-500/15 text-emerald-400 border border-emerald-500/20",marginal:"bg-amber-500/15 text-amber-400 border border-amber-500/20",too_tight:"bg-red-500/15 text-red-400 border border-red-500/20"}[o.level];return n.jsxs("span",{className:ee("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",d),children:[o.text," • ",o.req_gb," GB RAM"]})}const j0=["fast","heavy","coder","reasoning","agent","vision","scout"];function Ju(o){const d=o.toLowerCase();return d.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:d.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:d.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:d.includes("mistral")||d.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:d.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:d.includes("hermes")||d.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:d.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function k0(){var Zr,tr,Ut,Yr,In;const[o,d]=p.useState([]),[a,c]=p.useState([]),[f,m]=p.useState(null),[h,x]=p.useState(null),[E,b]=p.useState(null),[k,M]=p.useState(!0),[A,I]=p.useState(""),[O,S]=p.useState(null),[C,_]=p.useState(null),[L,Z]=p.useState(!1),[Y,H]=p.useState(null),[T,F]=p.useState("grid"),[ne,se]=p.useState("all"),[X,ye]=p.useState(null);function ce(z,re,ve){ye({type:"alert",title:z,message:re,onConfirm:()=>{ye(null)}})}function Pe(z,re,ve,Se){ye({type:"confirm",title:z,message:re,onConfirm:()=>{ye(null),ve()},onCancel:()=>{ye(null)}})}function _e(z,re,ve,Se,ze){ye({type:"prompt",title:z,message:re,defaultValue:ve,onConfirm:Nt=>{ye(null),Se(Nt)},onCancel:()=>{ye(null)}})}const Me=o.filter(z=>ne==="in_use"?!!z.role||a.includes(z.name):!0),[Ne,ke]=p.useState({width:800,height:360}),W=p.useRef(null),ae=p.useCallback(z=>{if(W.current&&(W.current.disconnect(),W.current=null),z){const re=new ResizeObserver(ve=>{if(!ve||ve.length===0)return;const Se=ve[0].contentRect;ke({width:Se.width,height:Se.height})});re.observe(z),W.current=re}},[]),G=Ne.width,j=Ne.height,v=z=>{const re=G*.1,ve=j*z,Se=G*.5,ze=j*.5,Nt=G*.3,Bt=ve,Vt=G*.3;return`M ${re} ${ve} C ${Nt} ${Bt}, ${Vt} ${ze}, ${Se} ${ze}`},B=z=>{const re=G*.5,ve=j*.5,Se=G*.9,ze=j*z,Nt=G*.7,Bt=ve,Vt=G*.7;return`M ${re} ${ve} C ${Nt} ${Bt}, ${Vt} ${ze}, ${Se} ${ze}`};function J(){Promise.all([fe("/api/models"),fe("/api/routing"),fe("/api/connect"),fe("/api/maintenance/updates")]).then(([z,re,ve,Se])=>{d(z.models||[]),c(z.running||[]),m(re),x(ve),b(Se)}).catch(z=>I(String(z))).finally(()=>M(!1))}p.useEffect(()=>{J();const z=setInterval(J,4e3);return()=>clearInterval(z)},[]);async function K(z){try{await fe(`/api/models/${encodeURIComponent(z)}/load`,{method:"POST"}),J()}catch(re){ce("Fehler",`Fehler beim Laden des Modells: ${re.message}`)}}async function oe(z){try{await fe(`/api/models/${encodeURIComponent(z)}/unload`,{method:"POST"}),J()}catch(re){ce("Fehler",`Fehler beim Entladen des Modells: ${re.message}`)}}async function pe(){try{await fe("/api/models/unload",{method:"POST"}),J()}catch(z){ce("Fehler",`Fehler beim Entladen aller Modelle: ${z.message}`)}}async function me(z,re){try{await fe(`/api/models/${encodeURIComponent(re)}/role`,{method:"POST",body:JSON.stringify({role:z||null})}),J()}catch(ve){ce("Fehler",`Fehler beim Zuweisen der Rolle: ${ve.message||ve}`)}}async function w(z,re){_e("Kontextlänge anpassen","Gib die gewünschte Kontextlänge in Tokens an:",String(re||32768),async ve=>{if(ve)try{await fe(`/api/models/${encodeURIComponent(z)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ve,10)})}),J()}catch(Se){ce("Fehler",`Fehler beim Setzen des Kontexts: ${Se.message||Se}`)}})}async function Q(z){Pe("Modell löschen?",`Modell '${z}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await fe(`/api/models/${encodeURIComponent(z)}`,{method:"DELETE"}),J()}catch(re){ce("Fehler",`Fehler beim Löschen: ${re.message||re}`)}})}async function Le(z,re,ve,Se){try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:z,role:re,quant:ve,jinja:Se})}),ce("Herunterladen gestartet",`Download für '${z}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(ze){ce("Fehler",`Fehler beim Starten des Upgrades: ${ze.message||ze}`)}}async function $t(z){z&&(await navigator.clipboard.writeText(z),Z(!0),setTimeout(()=>Z(!1),1500))}if(k)return n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(A)return n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Gateway oder Engine nicht erreichbar (",A,")."]});const lt=o.filter(z=>a.includes(z.name)),nt=lt.reduce((z,re)=>z+(re.size_bytes||0),0),On=16*1024**3,Tn=nt>On?nt*1.2:On,qr=z=>o.find(re=>re.role===z),er=z=>{const re=qr(z);return re?a.includes(re.name):!1};return n.jsxs("div",{className:"space-y-8",children:[n.jsx("style",{children:`
@keyframes flow-dash {
to {
stroke-dashoffset: -20;
}
}
.svg-flow-path {
stroke-dasharray: 4 6;
animation: flow-dash 1s linear infinite;
}
`}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(gi,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",Ur(nt)," / ",Ur(Tn)," geladen"]}),a.length>0&&n.jsx("button",{onClick:pe,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),n.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:lt.length===0?n.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):lt.map((z,re)=>{var ze;const ve=(z.size_bytes||0)/Tn*100,Se=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][re%4];return n.jsxs("div",{style:{width:`${ve}%`},className:ee("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",Se),title:`${z.name} (${Ur(z.size_bytes)})`,children:[n.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[z.role?`[${z.role}] `:"",(ze=z.name.split("/").pop())==null?void 0:ze.replace(".gguf","")]}),n.jsx("span",{className:"text-[8px] font-mono opacity-80",children:Ur(z.size_bytes)})]},z.name)})})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Klicke links auf Editoren, um Configs zu kopieren. Klicke rechts auf Rollen, um GGUF-Zuweisungen live zu ändern."})]}),n.jsxs("div",{ref:ae,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:v(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(Y==="roocode"||O==="roocode")&&n.jsx("path",{d:v(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:v(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(Y==="cursor"||O==="cursor")&&n.jsx("path",{d:v(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:v(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(Y==="opencode"||O==="opencode")&&n.jsx("path",{d:v(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:v(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(Y==="zed"||O==="zed")&&n.jsx("path",{d:v(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:v(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(Y==="continue"||O==="continue")&&n.jsx("path",{d:v(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:B(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),er("fast")&&n.jsx("path",{d:B(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:B(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),er("heavy")&&n.jsx("path",{d:B(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:B(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),er("coder")&&n.jsx("path",{d:B(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:B(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),er("vision")&&n.jsx("path",{d:B(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:B(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),er("scout")&&n.jsx("path",{d:B(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>H("roocode"),onMouseLeave:()=>H(null),onClick:()=>S(z=>z==="roocode"?null:"roocode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Roo Code"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>H("cursor"),onMouseLeave:()=>H(null),onClick:()=>S(z=>z==="cursor"?null:"cursor"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Cursor IDE"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>H("opencode"),onMouseLeave:()=>H(null),onClick:()=>S(z=>z==="opencode"?null:"opencode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"OpenCode"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>H("zed"),onMouseLeave:()=>H(null),onClick:()=>S(z=>z==="zed"?null:"zed"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Zed"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>H("continue"),onMouseLeave:()=>H(null),onClick:()=>S(z=>z==="continue"?null:"continue"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Continue"})]}),n.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[n.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",f!=null&&f.heavy_threshold_chars?f.heavy_threshold_chars/1e3:"4","k Zeichen"]}),n.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),j0.map(z=>{var Nt;const re=["12%","31%","50%","69%","88%"],ve=qr(z),Se=ve?a.includes(ve.name):!1;if(z==="reasoning"||z==="agent")return null;const ze={fast:0,heavy:1,coder:2,vision:3,scout:4}[z];return n.jsxs("div",{className:ee("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",Se?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":ve?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:re[ze]},onClick:()=>_(z),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:z}),Se&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:ve?(Nt=ve.name.split("/").pop())==null?void 0:Nt.replace(".gguf",""):"Keine Zuweisung"})]},z)}),O&&h&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200 flex flex-col justify-between",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:[O==="roocode"&&"Roo Code Setup",O==="cursor"&&"Cursor Setup",O==="opencode"&&"OpenCode Setup",O==="zed"&&"Zed Setup",O==="continue"&&"Continue Setup"]}),n.jsx("button",{onClick:()=>S(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[O==="roocode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),n.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",n.jsx("strong",{children:"OpenAI Compatible"}),"."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",n.jsx("code",{children:"settings.json"})," ein."]})]}),O==="cursor"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne Cursor Settings ➔ ",n.jsx("strong",{children:"Models"}),"."]}),n.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",n.jsx("strong",{children:"OpenAI API"})," auf."]}),n.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",n.jsx("strong",{children:"auto"}),"."]})]}),O==="opencode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die ",n.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),n.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",n.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),O==="zed"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die Zed Settings (",n.jsx("code",{children:"ctrl+,"}),")."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",n.jsx("code",{children:"language_models"})," ein."]})]}),O==="continue"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),n.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",n.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),h.tools&&n.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var z,re,ve,Se,ze;return $t(O==="roocode"?(z=h.tools.cline)==null?void 0:z.snippet:O==="cursor"?(re=h.tools.cursor)==null?void 0:re.snippet:O==="opencode"?(ve=h.tools.opencode)==null?void 0:ve.snippet:O==="zed"?(Se=h.tools.zed)==null?void 0:Se.snippet:(ze=h.tools.continue)==null?void 0:ze.snippet)},className:"text-xs font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[L?n.jsx(zn,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(lf,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:L?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-48 overflow-y-auto text-xs font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[O==="roocode"&&((Zr=h.tools.cline)==null?void 0:Zr.snippet),O==="cursor"&&((tr=h.tools.cursor)==null?void 0:tr.snippet),O==="opencode"&&((Ut=h.tools.opencode)==null?void 0:Ut.snippet),O==="zed"&&((Yr=h.tools.zed)==null?void 0:Yr.snippet),O==="continue"&&((In=h.tools.continue)==null?void 0:In.snippet)]})})]}),n.jsx("button",{onClick:()=>S(null),className:"w-full h-9 rounded-lg bg-primary text-primary-foreground hover:opacity-90 font-semibold text-xs transition-opacity cursor-pointer mt-2",children:"Schließen"})]})})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),n.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Gateway Steckplatz-Belegung (Slot-Zuweisung)"}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:["fast","heavy","coder","reasoning","vision","scout"].map(z=>{var Se;const re=o.find(ze=>ze.role===z),ve=re?a.includes(re.name):!1;return n.jsxs("div",{onClick:()=>_(z),className:ee("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",ve?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":re?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:ee("text-[9px] font-bold uppercase tracking-wider font-mono px-1.5 py-0.5 rounded border",z==="fast"?"bg-cyan-500/10 text-cyan-400 border-cyan-500/20":z==="heavy"?"bg-amber-500/10 text-amber-400 border-amber-500/20":z==="coder"?"bg-violet-500/10 text-violet-400 border-violet-500/20":z==="reasoning"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":z==="vision"?"bg-pink-500/10 text-pink-400 border-pink-500/20":"bg-teal-500/10 text-teal-400 border-teal-500/20"),children:z}),ve&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate text-foreground/90 pr-1 font-space",title:re==null?void 0:re.name,children:re?(Se=re.name.split("/").pop())==null?void 0:Se.replace(/\.gguf$/i,""):"nicht zugewiesen"}),n.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},z)})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[n.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",Me.length," von ",o.length,")"]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>se("all"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ne==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),n.jsx("button",{onClick:()=>se("in_use"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ne==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>F("grid"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",T==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),n.jsx("button",{onClick:()=>F("list"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",T==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),T==="grid"?n.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Me.length===0?n.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:ne==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):Me.map(z=>{const re=a.includes(z.name),ve=E==null?void 0:E.model_list.find(ze=>ze.role===z.role),Se=Ju(z.name);return n.jsxs("div",{className:ee("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",re?"border-primary/45 shadow-primary/5":z.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-start justify-between gap-3",children:n.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[n.jsx("div",{className:ee("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Se.color),title:Se.name,children:Se.initial}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:z.name,children:z.name.split("/").pop()}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:z.quant||"GGUF"}),re&&n.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[n.jsx(Xo,{className:"h-3 w-3 animate-pulse"})," Warm"]}),z.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-mono text-primary font-bold uppercase",children:z.role}),z.prompt_cache&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),z.spec_draft_model&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${z.spec_draft_model})`,children:"SPEC"}),z.parallel_slots>1&&n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${z.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",z.parallel_slots]})]})]})]})}),n.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:n.jsx(Zu,{caps:z.capabilities})})]}),n.jsxs("div",{className:"space-y-3 pt-1",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(gi,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),n.jsx("div",{className:"text-foreground font-semibold",children:Ur(z.size_bytes)})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(wh,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),n.jsx("div",{className:"text-foreground font-semibold",children:Yu(z.ctx)})]})]})]}),ve&&n.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),n.jsxs("span",{children:["Upgrade verfügbar: ",ve.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>Le(ve.repo,z.role,z.quant||"Q4_K_M",z.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[n.jsx(Vr,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[n.jsx("button",{onClick:()=>re?oe(z.name):K(z.name),className:ee("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center justify-center gap-1",re?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:re?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>w(z.name,z.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>Q(z.name),className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 flex items-center justify-center transition-colors cursor-pointer",title:"Modell löschen",children:n.jsx(vi,{className:"h-3.5 w-3.5"})})]})]})]},z.name)})}):n.jsx("div",{className:"space-y-2",children:Me.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:ne==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):Me.map(z=>{const re=a.includes(z.name),ve=Ju(z.name);return n.jsxs("div",{className:ee("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",re?"border-primary/45":z.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n.jsx("div",{className:ee("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",ve.color),title:ve.name,children:ve.initial}),n.jsxs("div",{className:"min-w-0 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:z.name,children:z.name.split("/").pop()}),z.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[8px] font-mono text-primary font-bold uppercase shrink-0",children:z.role}),z.prompt_cache&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),z.spec_draft_model&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${z.spec_draft_model})`,children:"SPEC"}),z.parallel_slots>1&&n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${z.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",z.parallel_slots]}),re&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{children:["Größe: ",Ur(z.size_bytes)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Kontext: ",Yu(z.ctx)]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:"font-mono text-[9px]",children:z.quant||"GGUF"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[n.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:n.jsx(Zu,{caps:z.capabilities})}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:()=>re?oe(z.name):K(z.name),className:ee("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center gap-1",re?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:re?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>w(z.name,z.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>Q(z.name),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all cursor-pointer",title:"Modell löschen",children:n.jsx(vi,{className:"h-3.5 w-3.5"})})]})]})]},z.name)})})]}),C&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:["Rolle '",C,"' konfigurieren"]}),n.jsx("button",{onClick:()=>_(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell aus deiner Bibliothek für die Rolle ",n.jsx("strong",{className:"text-foreground",children:C}),":"]}),n.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[n.jsx("button",{onClick:()=>{me(C,""),_(null)},className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:n.jsx("span",{children:"Zuweisung entfernen"})}),o.map(z=>{var re;return n.jsxs("button",{onClick:()=>{me(C,z.name),_(null)},className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",z.role===C?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"truncate max-w-[280px] font-semibold",children:(re=z.name.split("/").pop())==null?void 0:re.replace(".gguf","")}),n.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[Ur(z.size_bytes)," · ",z.quant]})]}),z.role===C&&n.jsx(zn,{className:"h-4 w-4 shrink-0 text-primary"})]},z.name)})]})]})}),X&&n.jsx(Qr,{type:X.type,title:X.title,message:X.message,defaultValue:X.defaultValue,onConfirm:X.onConfirm,onCancel:X.onCancel})]})}function N0(){const[o,d]=p.useState(""),[a,c]=p.useState([]),[f,m]=p.useState("Q4_K_M"),[h,x]=p.useState(""),[E,b]=p.useState(""),[k,M]=p.useState([]);async function A(S){const C=S??o;if(C.trim()){x("Analysiere HuggingFace Repository...");try{const _=await fe(`/api/hf/quants?repo=${encodeURIComponent(C)}`);d(_.repo),c(_.quants),_.quants.length&&m(_.quants.includes("Q4_K_M")?"Q4_K_M":_.quants[0]),x(_.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(_){x(`Fehler: ${_}`)}}}async function I(){if(E.trim()){x("Durchsuche HuggingFace...");try{const S=await fe(`/api/hf/search?q=${encodeURIComponent(E)}`);M(S.results),x(S.results.length?"":"Keine Ergebnisse gefunden.")}catch(S){x(`Suche fehlgeschlagen: ${S}`)}}}async function O(){if(o.trim()){x("Download-Job wird initiiert...");try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:o,quant:f,jinja:!0})}),x(`Download gestartet: ${o} (${f}). Fortschritt wird oben angezeigt.`)}catch(S){x(`Download-Fehler: ${S}`)}}}return n.jsxs("div",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx("input",{value:o,onChange:S=>d(S.target.value),placeholder:"HF-URL oder org/repo (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>A(),className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Quants laden"}),a.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("select",{value:f,onChange:S=>m(S.target.value),className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:a.map(S=>n.jsx("option",{value:S,className:"bg-popover text-foreground",children:S},S))}),n.jsxs("button",{onClick:O,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer flex items-center gap-1.5",children:[n.jsx(Vr,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),n.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:E,onChange:S=>b(S.target.value),onKeyDown:S=>S.key==="Enter"&&I(),placeholder:"HuggingFace durchsuchen (z.B. Llama-3.1)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(_i,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsx("button",{onClick:I,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer",children:"Suchen"})]}),k.length>0&&n.jsx("div",{className:"max-h-48 space-y-1.5 overflow-y-auto border border-border/40 bg-background/20 p-2 rounded-xl scrollbar-thin",children:k.map(S=>n.jsxs("button",{onClick:()=>{d(S.repo),M([]),b(""),A(S.repo)},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs bg-background/10 border border-border/10 hover:border-primary/30 hover:bg-background/30 transition-all",children:[n.jsx("span",{className:"font-semibold truncate",children:S.repo}),n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[n.jsx(Vr,{className:"h-3 w-3"})," ",S.downloads.toLocaleString()]})]},S.repo))}),h&&n.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:h})]})}const S0={vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:xi},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:mi},reasoning:{title:"Logik & Nachdenken",desc:"Komplexe logische Gedankengänge, Mathematik und tiefgründiges Planen (Reasoning).",icon:Cs},agent:{title:"Autonomer Agent (Hermes)",desc:"Führt selbstständig Terminalbefehle aus und interagiert mit deinem Homelab.",icon:Ss},scout:{title:"Allrounder & Chat",desc:"Schnelle Antworten, Zusammenfassungen, Übersetzungen und alltägliche Fragen.",icon:hi}};function C0(){const[o,d]=p.useState(null),[a,c]=p.useState([]),[f,m]=p.useState(null),[h,x]=p.useState(""),[E,b]=p.useState(!0),[k,M]=p.useState({}),[A,I]=p.useState({}),[O,S]=p.useState(!1);p.useEffect(()=>{Promise.all([fe("/api/discover"),fe("/api/models"),fe("/api/maintenance/updates").catch(()=>null)]).then(([_,L,Z])=>{d(_),c(L.models||[]),Z&&m(Z)}).catch(_=>x(String(_))).finally(()=>b(!1))},[]);async function C(_,L,Z,Y){M(H=>({...H,[_]:"Starte..."}));try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:_,role:L,quant:Z,jinja:Y})}),M(H=>({...H,[_]:"Download läuft"}))}catch{M(T=>({...T,[_]:"Fehler"}))}}return E?n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):h||!o?n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",h,")."]}):n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[n.jsxs("div",{children:["Modell-Registry geladen für ",n.jsxs("span",{className:"text-foreground font-bold",children:[o.sys_ram_gb," GB"]})," System-RAM."]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(cf,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),n.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),n.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:o.categories.map(_=>{const L=S0[_.role]||{title:_.title||_.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:Es},Z=L.icon,Y=a.find(X=>X.role===_.role),H=f==null?void 0:f.model_list.find(X=>X.role===_.role),T=_.models.find(X=>X.repo===_.recommended)||_.models[0];if(!T)return null;const F=k[T.repo],ne=_.models.filter(X=>X.repo!==_.recommended),se=!!A[_.role];return n.jsxs("div",{className:ee("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",Y?"border-border/60":"border-primary/20 shadow-primary/5"),children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:n.jsx(Z,{className:"h-5.5 w-5.5"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:L.title}),n.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",_.role]})]})]}),Y?n.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):n.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:L.desc}),n.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:Y?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:Y.name,children:Y.name.split("/").pop()}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[n.jsxs("span",{children:["Größe: ",Si(Y.size_bytes||0)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",Y.quant||"GGUF"]})]})]}):n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:T.name,children:T.name}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{children:["Ersteller: ",T.author]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",T.quant]})]}),n.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:n.jsx(w0,{fit:T.fit})})]})}),n.jsx("div",{className:"pt-1",children:Y?H?n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),n.jsxs("span",{children:["Bessere Version in der Registry: ",H.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>C(H.repo,_.role,T.quant||"Q4_K_M",T.caps.tools!=="no"),disabled:!!k[H.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[n.jsx(Vr,{className:"h-3.5 w-3.5"}),k[H.repo]||"Auf neue Version aktualisieren"]})]}):n.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[n.jsx(zn,{className:"h-4 w-4"})," Auf neuestem Stand"]}):n.jsxs("button",{onClick:()=>C(T.repo,_.role,T.quant||"Q4_K_M",T.caps.tools!=="no"),disabled:!!F,className:ee("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",F?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[n.jsx(Vr,{className:"h-3.5 w-3.5"}),F||"Optimales Modell einsetzen"]})})]}),ne.length>0&&n.jsxs("div",{className:"border-t border-border/20 pt-3",children:[n.jsxs("button",{onClick:()=>I(X=>({...X,[_.role]:!se})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[se?n.jsx(ch,{className:"h-3 w-3"}):n.jsx(ah,{className:"h-3 w-3"}),n.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",ne.length,")"]})]}),se&&n.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:ne.map(X=>n.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:X.name,children:X.name}),n.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[n.jsxs("span",{children:["Quant: ",X.quant]}),n.jsx("span",{children:"•"}),n.jsx("span",{children:X.fit.text})]})]}),n.jsx("button",{onClick:()=>C(X.repo,_.role,X.quant||"Q4_K_M",X.caps.tools!=="no"),disabled:!!k[X.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:k[X.repo]||"Installieren"})]},X.repo))})]})]},_.role)})}),n.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[n.jsxs("button",{onClick:()=>S(!O),className:"w-full px-5 py-4 flex items-center justify-between text-xs font-bold uppercase tracking-wider text-muted-foreground hover:bg-card/30 transition-colors cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(_i,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),n.jsx("span",{className:"text-[10px] text-primary hover:underline",children:O?"Ausblenden ▲":"Anzeigen ▼"})]}),O&&n.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:n.jsx(N0,{})})]})]})}function E0(){const[o,d]=p.useState("cockpit");return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Modell-Manager"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),n.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(a=>n.jsx("button",{onClick:()=>d(a),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",o===a?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:a==="cockpit"?"Cockpit":"Modelle finden"},a))})]}),n.jsx(b0,{}),n.jsx("div",{className:"transition-all duration-300",children:o==="cockpit"?n.jsx(k0,{}):n.jsx(C0,{})})]})}function kr(o){return(o/1024**3).toFixed(1)}function qo({label:o,percent:d,detail:a,icon:c}){const f=d>90?"bg-red-500 shadow-md shadow-red-500/20":d>75?"bg-amber-500 shadow-md shadow-amber-500/20":"bg-primary shadow-md shadow-primary/20";return n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/30 transition-all duration-300",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(c,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:o})]}),n.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(d),"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:n.jsx("div",{className:ee("h-full transition-all duration-700 ease-out",f),style:{width:`${Math.min(d,100)}%`}})}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function _0(){const[o,d]=p.useState(null),[a,c]=p.useState(null),[f,m]=p.useState(""),[h,x]=p.useState(""),[E,b]=p.useState({}),[k,M]=p.useState(null);function A(C,_,L){M({type:"alert",title:C,message:_,onConfirm:()=>{M(null)}})}function I(){fe("/api/system/status").then(d).catch(C=>m(String(C))),fe("/api/system/services").then(c).catch(()=>{})}p.useEffect(()=>{I();const C=setInterval(I,3e3);return()=>clearInterval(C)},[]);async function O(){x("Backup snapshotted...");try{const C=await fe("/api/system/backup",{method:"POST"});x(C.ok?`Snapshot erzeugt: ${C.snapshot} (${C.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(C){x(`Fehler: ${C.message}`)}}async function S(C){b(_=>({..._,[C]:!0}));try{const _=await fe("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:C})});_.ok?A("Erfolgreich",`Dienst ${C} wurde erfolgreich neu gestartet.`):A("Fehler beim Neustart",`Fehler beim Neustart: ${_.err||"Unbekannter Fehler"}`)}catch(_){A("Fehler",`Fehler: ${_.message}`)}finally{b(_=>({..._,[C]:!1}))}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"System-Diagnose & Status"}),n.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["System-Status nicht lesbar (",f,")."]}),o&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx(qo,{label:"CPU",percent:o.cpu.percent,detail:o.cpu.cores?`${o.cpu.cores} Cores`:void 0,icon:gt}),n.jsx(qo,{label:"RAM",percent:o.ram.percent,detail:`${kr(o.ram.used)} / ${kr(o.ram.total)} GB`,icon:Xo}),o.gpu&&o.gpu.busy_percent!=null&&n.jsx(qo,{label:"GPU",percent:o.gpu.busy_percent,detail:o.gpu.gtt_used!=null&&o.gpu.gtt_total?`${kr(o.gpu.gtt_used)} / ${kr(o.gpu.gtt_total)} GB (GTT/unified)`:o.gpu.vram_used!=null&&o.gpu.vram_total?`${kr(o.gpu.vram_used)} / ${kr(o.gpu.vram_total)} GB VRAM`:void 0,icon:gt}),o.disk&&n.jsx(qo,{label:"Disk",percent:o.disk.percent,detail:`${kr(o.disk.used)} / ${kr(o.disk.total)} GB`,icon:gi})]}),o.temp&&(o.temp.cpu||o.temp.gpu)&&n.jsxs("div",{className:"flex gap-3 text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-2.5 rounded-xl self-start w-fit",children:[o.temp.cpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[o.temp.cpu," °C"]})]}),o.temp.cpu!=null&&o.temp.gpu!=null&&n.jsx("span",{children:"|"}),o.temp.gpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[o.temp.gpu," °C"]})]})]})]}),a&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"logs"}})),className:"h-7 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",children:"System-Logs anzeigen"})]}),n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.services.map(C=>n.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-xl bg-background/20 border border-border/30 hover:border-primary/20 transition-all group",children:[n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx("span",{className:ee("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",C.ok?"bg-emerald-500":"bg-amber-500")}),n.jsxs("div",{className:"truncate",children:[n.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:C.name}),n.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:C.url})]})]}),n.jsx("button",{onClick:()=>S(C.name),disabled:E[C.name],className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-primary hover:bg-primary/5 flex items-center justify-center transition-all opacity-0 group-hover:opacity-100",title:"Dienst neu starten",children:n.jsx(Br,{className:ee("h-3.5 w-3.5",E[C.name]&&"animate-spin")})})]},C.name))}),n.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[n.jsxs("a",{href:Ms(a.links.engine_ui),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(el,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),n.jsxs("a",{href:Ms(a.links.gateway),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(el,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),n.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:n.jsxs("button",{onClick:O,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(kh,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),h&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:h}),k&&n.jsx(Qr,{type:k.type,title:k.title,message:k.message,onConfirm:k.onConfirm,onCancel:k.onCancel})]})}function P0(){const[o,d]=p.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[a,c]=p.useState(localStorage.getItem("mc_mcp_path")||""),[f,m]=p.useState(null),[h,x]=p.useState("cline"),[E,b]=p.useState(!1),[k,M]=p.useState("");p.useEffect(()=>{const C=new URLSearchParams;C.set("host",o),a&&C.set("mcp_path",a),fe(`/api/connect?${C}`).then(m).catch(_=>M(String(_)))},[o,a]);function A(C){d(C),C&&localStorage.setItem("mc_host",C)}function I(C){c(C),localStorage.setItem("mc_mcp_path",C)}const O=f==null?void 0:f.tools[h];async function S(){O&&(await navigator.clipboard.writeText(O.snippet),b(!0),setTimeout(()=>b(!1),1500))}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Verbindung & Integration"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen."})]}),n.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(gh,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),n.jsx("input",{value:o,onChange:C=>A(C.target.value),placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(xh,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),n.jsx("input",{value:a,onChange:C=>I(C.target.value),placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]})]}),k&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",k]}),f&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-1 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:Object.entries(f.tools).map(([C,_])=>n.jsx("button",{onClick:()=>x(C),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",h===C?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:_.label},C))}),O&&n.jsxs("div",{className:"space-y-3",children:[O.note&&n.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-xs text-muted-foreground leading-relaxed",children:[n.jsx(vh,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),n.jsx("span",{children:O.note})]}),n.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:[n.jsx(tl,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{children:h==="cline"||h==="cursor"?"config.json":"settings.json"})]}),n.jsxs("button",{onClick:S,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[E?n.jsx(zn,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(lf,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:E?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-5 overflow-x-auto text-xs font-mono text-cyan-200/90 whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",children:n.jsx("code",{children:O.snippet})})]})]})]})]})}const Xu=["user","instruction","stable","versioned","ephemeral"],fi={user:{label:"User",icon:Mh,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:Nh,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:Wr,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:_h,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:fh,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},ef={label:"Gedächtnis",icon:of,bg:"bg-muted/10",text:"text-muted-foreground"},M0={user:"border-l-cyan-500/80",instruction:"border-l-violet-500/80",stable:"border-l-indigo-500/80",versioned:"border-l-amber-500/80",ephemeral:"border-l-pink-500/80"};function R0(){const[o,d]=p.useState([]),[a,c]=p.useState(""),[f,m]=p.useState(""),[h,x]=p.useState(""),[E,b]=p.useState("stable"),[k,M]=p.useState(""),[A,I]=p.useState(!1),[O,S]=p.useState(null);function C(T,F,ne){S({type:"alert",title:T,message:F,onConfirm:()=>{S(null)}})}function _(T,F,ne){S({type:"confirm",title:T,message:F,onConfirm:()=>{S(null),ne()},onCancel:()=>S(null)})}function L(){const T=new URLSearchParams;f&&T.set("q",f),a&&T.set("category",a),fe(`/api/memory?${T}`).then(d).catch(F=>M(String(F)))}p.useEffect(L,[f,a]);async function Z(){h.trim()&&(await fe("/api/memory",{method:"POST",body:JSON.stringify({content:h,category:E,source:"ui"})}),x(""),L())}async function Y(T){await fe(`/api/memory/${T}`,{method:"DELETE"}),L()}async function H(){I(!0);try{const T=await fe("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(T.duplicate_count===0){C("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}_("Deduplizierung bestätigen",`${T.duplicate_count} Dublette(n) in ${T.groups.length} Gruppe(n) gefunden. Entfernen?`,async()=>{try{await fe("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),L()}catch(F){C("Fehler",`Fehler beim Löschen: ${F.message}`)}})}catch(T){C("Fehler",`Fehler bei der Deduplizierung: ${T.message}`)}finally{I(!1)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool (Memory)"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Die geteilte Konstitution des Systems. Alle Instanzen (Hermes, IDEs, Gateway) lesen und schreiben hierauf per MCP-Protokoll."})]}),n.jsxs("button",{onClick:H,disabled:A,className:"flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50 shrink-0 self-start",children:[n.jsx(Eh,{className:"h-4 w-4 text-primary animate-pulse"}),n.jsx("span",{children:"Deduplizieren"})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),n.jsx("textarea",{value:h,onChange:T=>x(T.target.value),placeholder:"Füge eine neue Regel, eine Vorliebe oder einen stabilen Fakt über das Projekt oder dich hinzu...",rows:3,className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3.5 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground transition-all leading-relaxed"}),n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),n.jsx("select",{value:E,onChange:T=>b(T.target.value),className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 py-1 text-xs outline-none font-semibold text-foreground cursor-pointer",children:Xu.map(T=>{var F;return n.jsx("option",{value:T,className:"bg-popover text-foreground",children:((F=fi[T])==null?void 0:F.label)||T},T)})})]}),n.jsxs("button",{onClick:Z,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(af,{className:"h-4 w-4"})," Speichern"]})]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:f,onChange:T=>m(T.target.value),placeholder:"Gedächtnis durchsuchen...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(_i,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl overflow-x-auto max-w-full",children:[n.jsx("button",{onClick:()=>c(""),className:ee("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",a?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Xu.map(T=>{const F=fi[T]||ef,ne=F.icon;return n.jsxs("button",{onClick:()=>c(T),className:ee("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 whitespace-nowrap",a===T?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[n.jsx(ne,{className:"h-3 w-3"}),n.jsx("span",{children:F.label})]},T)})]})]}),k&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Laden des Gedächtnisses: ",k]}),n.jsx("div",{className:"space-y-3",children:o.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):o.map(T=>{const F=fi[T.category]||ef,ne=F.icon;return n.jsxs("div",{className:ee("flex items-start justify-between gap-4 p-4 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 shadow-md shadow-black/5 hover:border-primary/20 transition-all group",M0[T.category]||"border-l-muted"),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsxs("span",{className:ee("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",F.bg,F.text),children:[n.jsx(ne,{className:"h-3 w-3"}),n.jsx("span",{className:"hidden sm:inline",children:F.label})]}),n.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:T.content})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground/60 bg-background/20 px-1.5 py-0.5 rounded uppercase tracking-wider",children:T.source}),n.jsx("button",{onClick:()=>Y(T.id),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",title:"Eintrag löschen",children:n.jsx(vi,{className:"h-3.5 w-3.5"})})]})]},T.id)})}),O&&n.jsx(Qr,{type:O.type,title:O.title,message:O.message,onConfirm:O.onConfirm,onCancel:O.onCancel})]})}function Zo({label:o,ok:d,detail:a,icon:c,onClick:f}){return n.jsxs("div",{onClick:f,className:ee("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/40 transition-all duration-300",d?"border-border/60":"border-amber-500/30",f&&"cursor-pointer hover:bg-card/70"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:o}),n.jsx(c,{className:ee("h-4.5 w-4.5",d?"text-primary":"text-amber-500")})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ee("h-2 w-2 rounded-full ring-2 ring-black/40",d?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-semibold text-foreground",children:d?"Bereit / Online":"Offline / Inaktiv"})]}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:a,children:a})]}),f&&n.jsxs("button",{onClick:m=>{m.stopPropagation(),f()},className:"mt-2 flex items-center justify-center gap-1.5 w-full py-1.5 px-3 rounded-lg border border-primary/30 bg-primary/10 hover:bg-primary/20 text-primary text-[10px] font-bold uppercase tracking-wider transition-all cursor-pointer font-space",children:[n.jsx(gt,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Gehirn wechseln"})]})]})}function z0(){const[o,d]=p.useState(null),[a,c]=p.useState(""),[f,m]=p.useState(null),[h,x]=p.useState(!1),[E,b]=p.useState([]),[k,M]=p.useState(null);function A(F,ne,se){M({type:"alert",title:F,message:ne,onConfirm:se})}const[I,O]=p.useState({width:800,height:360}),S=p.useRef(null),C=p.useCallback(F=>{if(S.current&&(S.current.disconnect(),S.current=null),F){const ne=new ResizeObserver(se=>{if(!se||se.length===0)return;const X=se[0].contentRect;O({width:X.width,height:X.height})});ne.observe(F),S.current=ne}},[]),_=I.width,L=I.height,Z=(F,ne,se,X)=>{const ye=(F+se)/2;return`M ${F} ${ne} C ${ye} ${ne}, ${ye} ${X}, ${se} ${X}`};function Y(){fe("/api/agent/status").then(d).catch(F=>c(String(F)))}function H(){fe("/api/models").then(F=>{const ne=F.models.map(se=>{var X;return((X=se.name.split("/").pop())==null?void 0:X.replace(".gguf",""))||se.name});b(["auto","fast","heavy",...ne])}).catch(F=>console.error("Error loading models",F))}async function T(F){try{await fe("/api/agent/brain",{method:"POST",body:JSON.stringify({model:F})}),A("Erfolgreich",`Hermes-Gehirn wurde auf '${F}' geändert. Der Gateway-Dienst wurde neu gestartet.`),Y(),x(!1)}catch(ne){A("Fehler",`Fehler beim Wechseln des Gehirns: ${ne.message}`)}}return p.useEffect(()=>{Y(),H();const F=setInterval(Y,5e3);return()=>clearInterval(F)},[]),n.jsxs("div",{className:"space-y-6",children:[n.jsx("style",{children:`
@keyframes flow-dash {
to {
stroke-dashoffset: -20;
}
}
.svg-flow-path {
stroke-dasharray: 4 6;
animation: flow-dash 1s linear infinite;
}
`}),n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Hermes Agenten-Cockpit"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",n.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(o==null?void 0:o.webui_url)&&n.jsxs("a",{href:Ms(o.webui_url),target:"_blank",rel:"noopener",className:ee("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",o.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[n.jsx(el,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes WebUI öffnen"})]})]}),a&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["Status nicht lesbar (",a,")."]}),o&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx(Zo,{label:"Agent Gateway",ok:o.gateway_reachable,detail:"Port :8642 (REST API)",icon:Ss}),n.jsx(Zo,{label:"Agent WebUI",ok:o.webui_reachable,detail:"Port :8787 (Chat UI)",icon:Xo}),n.jsx(Zo,{label:"Aktives Gehirn",ok:o.gateway_reachable,detail:o.brain_model?`Model: ${o.brain_model}`:"Model: auto",icon:gt,onClick:()=>x(!0)}),n.jsx(Zo,{label:"Verdrahtung",ok:o.has_config,detail:`Config: ${o.has_config?"✓":"—"} · Skills: ${o.has_skills?"✓":"—"} · Memory: ${o.has_memories?"✓":"—"}`,icon:rl})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Agent Flow Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Visualisiert das Zusammenspiel und die Verbindungspfade zwischen den Hermes-Systemkomponenten."})]}),n.jsxs("div",{ref:C,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:Z(_*.15,L*.5,_*.5,L*.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="webui"||o.webui_reachable)&&n.jsx("path",{d:Z(_*.15,L*.5,_*.5,L*.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Z(_*.5,L*.5,_*.85,L*.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="gateway"||f==="brain"||o.gateway_reachable)&&n.jsx("path",{d:Z(_*.5,L*.5,_*.85,L*.3),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Z(_*.5,L*.5,_*.85,L*.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="gateway"||f==="wiring"||o.gateway_reachable)&&n.jsx("path",{d:Z(_*.5,L*.5,_*.85,L*.7),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-36 h-9 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2.5 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"15%",top:"50%"},onMouseEnter:()=>m("webui"),onMouseLeave:()=>m(null),onClick:()=>o.webui_reachable&&window.open(Ms(o.webui_url),"_blank"),title:o.webui_reachable?"Klicken um Chat-WebUI zu öffnen":"WebUI Offline",children:[n.jsx(Xo,{className:ee("h-3.5 w-3.5",o.webui_reachable?"text-emerald-400":"text-amber-500")}),n.jsx("span",{children:"Agent WebUI"}),n.jsx("span",{className:ee("w-1.5 h-1.5 rounded-full animate-pulse ml-auto",o.webui_reachable?"bg-emerald-500":"bg-amber-500")})]}),n.jsxs("div",{className:"absolute select-none z-10 w-40 py-2.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5 cursor-pointer",style:{left:"50%",top:"50%"},onMouseEnter:()=>m("gateway"),onMouseLeave:()=>m(null),children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(Ss,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Agent Gateway"})]}),n.jsx("div",{className:"text-[9px] font-mono text-muted-foreground mt-0.5",children:"Port :8642"}),n.jsx("div",{className:ee("mt-1 px-1.5 py-0.5 rounded text-[8px] font-semibold uppercase font-mono border",o.gateway_reachable?"bg-emerald-500/10 border-emerald-500/20 text-emerald-400":"bg-red-500/10 border-red-500/20 text-red-400"),children:o.gateway_reachable?"Online":"Offline"})]}),n.jsxs("div",{className:ee("absolute z-20 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",o.gateway_reachable?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"30%"},onMouseEnter:()=>m("brain"),onMouseLeave:()=>m(null),onClick:()=>x(!0),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[n.jsx(gt,{className:"h-3 w-3 text-primary"}),n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Aktives Gehirn"})]}),o.gateway_reachable&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground font-space",title:o.brain_model,children:o.brain_model||"auto"})]}),n.jsxs("div",{className:ee("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none",o.has_config?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"70%"},onMouseEnter:()=>m("wiring"),onMouseLeave:()=>m(null),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[n.jsx(rl,{className:"h-3 w-3 text-primary"}),n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),o.has_config&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsxs("div",{className:"text-[9px] font-mono mt-0.5 text-muted-foreground flex gap-1 justify-between",children:[n.jsxs("span",{children:["Config: ",o.has_config?"✓":"—"]}),n.jsxs("span",{children:["Skills: ",o.has_skills?"✓":"—"]}),n.jsxs("span",{children:["Memory: ",o.has_memories?"✓":"—"]})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Agenten"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Verbindung hergestellt / Modul online"})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Wr,{className:"h-5 w-5 text-primary"}),n.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"SSH-Kopplung & Sandbox-Umgehung"})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground",children:"1. Warum verweigert Hermes Aktionen auf dem PC?"}),n.jsx("p",{children:"Hermes ist standardmäßig so ausgerichtet, dass er sich als virtueller Assistent ohne Systemzugriff versteht. Um dies zu umgehen, musst du Hermes' **System-Prompt** in der Chat-WebUI anpassen."}),n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Beispiel System-Prompt Erweiterung:"}),n.jsx("br",{}),'"Du hast über das terminal-Tool vollen SSH-Zugriff auf den Windows-PC des Users (TobisPC). Nutze SSH-Befehle um Aktionen dort auszuführen, wenn danach gefragt wird. Behaupte nie, du könntest das nicht!"']})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground",children:"2. SSH-Verbindung zum lokalen Windows-PC einrichten"}),n.jsx("p",{children:"Damit der Agent Befehle auf deinem PC ausführen kann, muss OpenSSH auf Windows aktiv und mit einem Key gekoppelt sein:"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1.5 text-[11px]",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"OpenSSH Server auf Windows starten:"})," In PowerShell als Admin ausführen: ",n.jsx("code",{className:"text-foreground font-mono",children:"Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0"})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"SSH-Key auf der Box erzeugen:"})," ",n.jsx("code",{className:"text-foreground font-mono",children:"ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_hermes_agent"})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Key autorisieren:"})," Kopiere den Inhalt von ",n.jsx("code",{className:"text-foreground font-mono",children:"~/.ssh/id_ed25519_hermes_agent.pub"})," in deine Windows-Datei ",n.jsx("code",{className:"text-foreground font-mono",children:"C:\\Users\\TobisPC\\.ssh\\authorized_keys"})]})]})]})]})]}),!o.gateway_reachable&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Wr,{className:"h-5 w-5 text-amber-500"}),n.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[n.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),n.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",n.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),n.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[n.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),n.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),n.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-webui"})]}),n.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",n.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]}),o&&h&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[n.jsx(gt,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),n.jsx("button",{onClick:()=>x(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',n.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),n.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:E.map(F=>{const ne=["auto","fast","heavy"].includes(F);return n.jsxs("button",{onClick:()=>T(F),className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",o.brain_model===F||!o.brain_model&&F==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:F}),n.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:ne?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(o.brain_model===F||!o.brain_model&&F==="auto")&&n.jsx(zn,{className:"h-4 w-4 shrink-0 text-primary"})]},F)})})]})}),k&&n.jsx(Qr,{type:k.type,title:k.title,message:k.message,onConfirm:()=>k.onConfirm&&k.onConfirm(),onCancel:k.onCancel})]})}function D0(){const[o,d]=p.useState("connect"),[a,c]=p.useState("roocode"),[f,m]=p.useState(null),h="192.168.178.151",[x,E]=p.useState(!1),[b,k]=p.useState(null);function M(){E(!0),fe("/api/health").then(A=>{m(A),k(A.engine_reachable?"success":"partial")}).catch(()=>{m(null),k("fail")}).finally(()=>E(!1))}return p.useEffect(()=>{M()},[]),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Stack-Anleitung & Vibe-Coding-Guide"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Einsteigerfreundliche Erklärungen zu deinem Stack und Schritt-für-Schritt-Anleitungen zur Anbindung deiner Editoren."})]}),n.jsxs("div",{className:"flex gap-4 border-b border-border/40 pb-px",children:[n.jsx("button",{onClick:()=>d("connect"),className:ee("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",o==="connect"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Editor-Anbindung"}),n.jsx("button",{onClick:()=>d("concepts"),className:ee("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",o==="concepts"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"KI-Wissensdatenbank (Juni 2026)"})]}),o==="connect"?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:ee("h-3 w-3 rounded-full ring-2 ring-black/40",b==="success"&&"bg-emerald-500 animate-pulse",b==="partial"&&"bg-amber-500",b==="fail"&&"bg-red-500",!b&&"bg-muted")}),n.jsxs("div",{children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),n.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5 font-mono",children:[b==="success"&&`Erfolgreich! Dein PC hat Zugriff auf das Box-Gateway (v${(f==null?void 0:f.version)||""}).`,b==="partial"&&"Gateway erreichbar, aber die llama-cpp-Engine ist offline.",b==="fail"&&"Verbindung fehlgeschlagen. Ist die Box im selben LAN-Netzwerk?",!b&&"Verbindung wird geprüft..."]})]})]}),n.jsxs("button",{onClick:M,disabled:x,className:"h-8 px-3 flex items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50 cursor-pointer self-start sm:self-auto shrink-0",children:[n.jsx(Br,{className:ee("h-3.5 w-3.5",x&&"animate-spin")}),n.jsx("span",{children:"Testen"})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx(of,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),n.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(gt,{className:"h-4 w-4 text-cyan-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),n.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein Dashboard. Hier siehst du die CPU-/RAM- und GPU-Last der Box und siehst sofort, ob Updates anstehen."})]}),n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Es,{className:"h-4 w-4 text-violet-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),n.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",n.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Cs,{className:"h-4 w-4 text-indigo-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),n.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein geteiltes Langzeitgedächtnis (Memory-Pool). Hier merkt sich dein Agent Regeln, Projekt-Details und Vorlieben."})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx(mi,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),n.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[n.jsxs("button",{onClick:()=>c("roocode"),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer flex items-center gap-1.5",a==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[n.jsx(cf,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),n.jsx("button",{onClick:()=>c("cursor"),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",a==="cursor"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"Cursor IDE"}),n.jsx("button",{onClick:()=>c("opencode"),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",a==="opencode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"OpenCode Desktop"})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[a==="roocode"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),n.jsx("p",{children:"Roo Code ist die beliebteste und flexibelste Vibe-Coding-Erweiterung für VS Code im Jahr 2026. Sie ermöglicht vollen Zugriff auf das Terminal und das MCP-Gedächtnis."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Roo Code installieren"]}),n.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"API-Anbindung konfigurieren"]}),n.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",h,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",n.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"MCP Gedächtnis verknüpfen (Optional, aber empfohlen)"]}),n.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",n.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",n.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),a==="cursor"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),n.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Einstellungen öffnen"]}),n.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",n.jsx("strong",{children:"Models"}),"."]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"OpenAI API überschreiben"]}),n.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",n.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://",h,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",n.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Modell hinzufügen"]}),n.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",n.jsx("strong",{children:"auto"})," ein und wähle es als aktives Modell aus. Cursor leitet ab jetzt alle deine Anfragen an die Box weiter."]})]})]})]}),a==="opencode"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),n.jsx("p",{children:"OpenCode ist eine standalone Desktop-App für ein ablenkungsfreies Coden über natürliche Sprache. Es trennt den KI-Prozess von deinem Editor."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"OpenCode Desktop herunterladen"]}),n.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"Endpunkt auf Box-Gateway setzen"]}),n.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",h,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Erster Vibe-Coding Test"]}),n.jsx("p",{className:"pl-6",children:'Starte eine neue Session und teste die Verbindung mit einem einfachen Prompt, z. B. *"Erstelle ein einfaches Skript, das die Fibonaccizahlen berechnet"*. Das Box-Gateway tauscht das Modell im Hintergrund vollautomatisch aus.'})]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 space-y-3 shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(tl,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),n.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Keine Verbindung?"})," Überprüfe im Live-Verbindungsprüfer oben, ob die Box-IP erreichbar ist. Stelle sicher, dass dein lokaler PC im selben WLAN/LAN-Netzwerk wie die Box eingeloggt ist."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue unter ",n.jsx("strong",{children:"Diagnose"}),", ob der Dienst `llama-swap` aktiv (grün) is. Wenn nicht, klicke daneben auf ",n.jsx("strong",{children:"Restart"}),"."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Hermes Agent reagiert merkwürdig?"})," Starte in der Hermes WebUI einfach eine frische Session (neuen Chat). Ältere Chats sammeln Kontext-Müll an."]})]})]})]}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex items-start gap-4",children:[n.jsx(hi,{className:"h-8 w-8 text-primary shrink-0 mt-0.5"}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Entwickler-Guide: Modernes Agentic Coding (2026)"}),n.jsx("p",{className:"text-xs text-muted-foreground leading-normal",children:"Willkommen im Wissenszentrum für dein Mission Control 2 Setup. Hier erfährst du, wie die verschiedenen Technologien (MoE, MCP, Skills, Hermes) zusammenarbeiten und wie du das Maximum aus deinen AI-Prozessabläufen herausholst."})]})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(Es,{className:"h-5 w-5 text-cyan-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"1. Mixture of Experts (MoE)"}),n.jsx("span",{className:"text-[9px] text-cyan-400 font-mono",children:"Effizienz durch Spezialisierung"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Bei traditionellen LLMs wird für jedes Wort das gesamte neuronale Netz aktiviert. Bei MoE besteht das Modell aus mehreren spezialisierten Teilnetzwerken (den ",n.jsx("em",{children:"Experts"}),"). Ein intelligenter ",n.jsx("em",{children:"Router"})," entscheidet pro Token (Wortteil), welche Experten zur Berechnung herangezogen werden."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Warum in MC2?"})," So können extrem leistungsstarke Modelle (wie DeepSeek-V3, Mixtral oder Command R+) mit wesentlich geringeren Hardwarekosten ausgeführt werden. Es wird nur ein Bruchteil der Parameter geladen und aktiv berechnet, was Speicherplatz spart und die Inferenz beschleunigt."]}),n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] text-foreground",children:[n.jsx("span",{className:"text-cyan-400",children:"Vorteil:"})," GPT-4-Klasse Performance bei einem Bruchteil der aktiven VRAM-Last auf deinem Homelab!"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(hi,{className:"h-5 w-5 text-violet-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"2. Model Context Protocol (MCP)"}),n.jsx("span",{className:"text-[9px] text-violet-400 font-mono",children:"Standardisierte Agenten-Tools"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," MCP ist ein offenes Protokoll (initiiert von Anthropic), das festlegt, wie ein KI-Client (z.B. Roo Code auf deinem PC) mit externen Datenquellen und Tools kommuniziert. Es funktioniert wie ein USB-Standard für KI."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Warum in MC2?"})," MCP trennt den AI-Kern von der Umgebung. Statt für jeden Editor eigene Tools zu schreiben, binden deine Agenten (Roo Code, Hermes) einfach MCP-Server an. Diese Server können Dateien lesen, Websuchen durchführen, Git bedienen oder mit deiner App interagieren."]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[n.jsx("div",{className:"font-bold text-foreground",children:"Gute Quellen für MCP Server:"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-muted-foreground",children:[n.jsxs("li",{children:[n.jsx("a",{href:"https://smithery.ai/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Smithery Registry"})," — Ein Portal zum Suchen und automatischen Installieren von MCP Servern."]}),n.jsxs("li",{children:[n.jsx("a",{href:"https://glama.ai/mcp/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Glama MCP Registry"})," — Eine kuratierte, umfangreiche Community-Datenbank von MCP Servern."]}),n.jsxs("li",{children:[n.jsx("a",{href:"https://github.com/modelcontextprotocol/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Offizielles Anthropic Repo"})," — Das offizielle Repository mit Standards wie filesystem, postgres, sqlite, brave-search und puppeteer."]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(Cs,{className:"h-5 w-5 text-emerald-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"3. Agent Skills"}),n.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Modulbasierte Fähigkeiten"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Ein Skill ist ein Verzeichnis mit standardisierten Anweisungen, Scripten und Beispielen, das deine Agenten für spezifische Aufgaben trainiert (z.B. Test-Driven Development, Code-Vereinfachung, API-Design)."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Wie benutzt man sie?"})," Lege einen Skill-Ordner unter ",n.jsx("code",{children:".agents/skills/<name>"})," in deinem Projekt an. Das Herzstück ist die Datei ",n.jsx("code",{children:"SKILL.md"})," mit folgendem Aufbau:"]}),n.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`---
name: tdd-pro
description: Drive development with strict TDD practices
---
# Instructions
...`}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[n.jsx("div",{className:"font-bold text-foreground",children:"Wo gibt es Skills & wo liegen sie?"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-2.5 text-muted-foreground",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"skills.sh Registry & CLI:"})," Das offizielle offene Portal für Agent-Skills (",n.jsx("a",{href:"https://skills.sh/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"skills.sh"}),"). Du kannst Skills direkt über das Terminal suchen und in deinem Projekt installieren:",n.jsxs("div",{className:"mt-1 font-mono text-[9px] bg-background/40 p-2 rounded border border-border/30 text-cyan-300",children:["# Nach Skills suchen:",n.jsx("br",{}),n.jsx("span",{className:"text-foreground",children:"npx skills find"}),n.jsx("br",{}),"# Skill zum aktuellen Projekt hinzufügen:",n.jsx("br",{}),n.jsx("span",{className:"text-foreground",children:"npx skills add [owner/repo]"})]})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Globaler Pfad:"})," ",n.jsx("code",{className:"text-foreground select-all",children:"C:\\Users\\TobisPC\\.gemini\\config\\plugins\\agent-skills\\skills\\"}),". Hier sind deine vorinstallierten, global verfügbaren Skills (wie ",n.jsx("i",{children:"code-simplification"}),", ",n.jsx("i",{children:"api-and-interface-design"}),", etc.) abgelegt."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Projekt-Pfad:"})," ",n.jsx("code",{className:"text-foreground select-all",children:".agents/skills/"}),". Lege diesen Ordner im Root eines beliebigen Projekts an. Dein lokaler Editor-Agent (z.B. Roo Code) liest ihn beim Starten automatisch ein."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Vorlagen / Beispiele:"})," Kopiere einfach bestehende Skills aus dem globalen Verzeichnis oder erstelle deine eigenen, indem du eine ",n.jsx("code",{children:"SKILL.md"})," mit YAML-Header (name, description) anlegst."]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(gt,{className:"h-5 w-5 text-indigo-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"4. Arbeiten mit Hermes"}),n.jsx("span",{className:"text-[9px] text-indigo-400 font-mono",children:"Autonomer Box-Agent"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Hermes ist der auf der Box installierte, autonome Hintergrund-Agent. Er verwaltet das Dateisystem und kann über REST (Port 8642) oder eine interaktive ChatUI (Port 8787) gesteuert werden."]}),n.jsx("p",{children:n.jsx("strong",{children:"Best Practices für Hermes:"})}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Chat-Kontext sauber halten:"})," Starte regelmäßig neue Chats. Zu große Historien verlangsamen den Agenten und führen zu Halluzinationen."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Gehirn festlegen:"})," Konfiguriere im Gateway die Modell-Rolle ",n.jsx("code",{children:"brain"})," für Hermes, damit er automatisch das passende Modell per Llama Swap lädt."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Sandbox umgehen:"})," Erweitere Hermes' System-Prompt (WebUI-Einstellungen), um Befehle über SSH an deinen Windows-PC zu leiten."]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(rl,{className:"h-5 w-5 text-amber-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"5. Richtiges Arbeiten mit Tools (Dateien, Terminal, DevTools)"}),n.jsx("span",{className:"text-[9px] text-amber-400 font-mono",children:"Fehler vermeiden & Kosten senken"})]})]}),n.jsxs("div",{className:"grid md:grid-cols-3 gap-4 text-xs text-muted-foreground leading-normal",children:[n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(tl,{className:"h-3.5 w-3.5 text-primary"})," Terminal"]}),n.jsxs("p",{className:"text-[11px]",children:["Verwende nur non-interaktive Befehle. Hänge bei langen Tasks (wie dev-Servern) ein ",n.jsx("code",{children:"&"})," an oder nutze die integrierte Job-Verwaltung. Verwende niemals interaktive Eingabeaufforderungen."]})]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(mi,{className:"h-3.5 w-3.5 text-cyan-400"})," Dateimanager"]}),n.jsxs("p",{className:"text-[11px]",children:["Überschreibe keine ganzen Dateien, wenn du nur eine Zeile ändern willst. Verwende gezielte Ersetzungs-Tools (wie ",n.jsx("code",{children:"replace_file_content"}),"). Das spart massiv Token-Kosten und beugt Fehlern vor."]})]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(rl,{className:"h-3.5 w-3.5 text-violet-400"})," Browser DevTools"]}),n.jsx("p",{className:"text-[11px]",children:"Koppele deine Debug-Dienste mit dem Chrome-DevTools-Plugin. So kann der Agent Fehler in der Konsole live analysieren und das DOM verifizieren, anstatt blind zu raten."})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(Wr,{className:"h-5 w-5 text-emerald-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie autonom ist Mission Control 2 wirklich?"}),n.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Die Grenze zwischen Automatisierung und Kontrolle"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-normal",children:[n.jsxs("p",{children:["Mission Control 2 ist als ",n.jsx("strong",{children:"semi-autonomes Gateway"})," konzipiert. Es besitzt die Fähigkeit, komplexe Workflows komplett selbstständig durchzuführen, unterliegt jedoch strikten Sicherheitsplanken:"]}),n.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 pt-1",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[n.jsx(_u,{className:"h-3 w-3 text-emerald-400"})," Was läuft vollautomatisch?"]}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[n.jsx("li",{children:"Modellaustausch (Routing) per llama-swap je nach Anfragetyp (z.B. Code vs. Reasoning)."}),n.jsx("li",{children:"Hintergrund-Synchronisation und Speicherung von Gedächtniseinträgen (Memory)."}),n.jsx("li",{children:"Modell-Installation und API-Key-Injektionen in Gateway-Verbindungen."})]})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[n.jsx(_u,{className:"h-3 w-3 text-amber-400"})," Wo ist menschliche Freigabe nötig?"]}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Systembefehle:"})," Das Ausführen von Terminal-Kommandos auf deinem PC erfordert standardmäßig deine Bestätigung."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Kritische Systemeingriffe:"})," OS-Updates, Engine-Rebuilds und Host-Reboots müssen manuell über das Dashboard ausgelöst werden."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Gedächtnis-Löschung:"})," Permanentes Verwerfen von gesammelten Memorys wird von dir freigegeben."]})]})]})]}),n.jsxs("p",{className:"text-[11px] bg-background/25 p-3 rounded-xl border border-border/30 mt-2",children:[n.jsx("strong",{children:"Fazit:"})," Der Stack erledigt die Kärrnerarbeit (Modelle tauschen, API-Adapter bereitstellen, Sandbox-Verbindungen herstellen) komplett im Hintergrund. Er agiert als dein persönlicher, treuer Copilot, ohne jemals ungefragt schädliche Operationen auf deinem Hauptsystem auszuführen."]})]})]})]})]})]})}function L0({title:o,hint:d}){return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold",children:o}),n.jsx("p",{className:"text-sm text-muted-foreground",children:d})]}),n.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card/50 py-20 text-center",children:[n.jsx(hh,{className:"h-8 w-8 text-muted-foreground"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const A0=[{id:"llama-swap",label:"Llama Swap",type:"system"},{id:"mission-control-2",label:"Mission Control 2",type:"user"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user"},{id:"hermes-dashboard",label:"Hermes Dashboard",type:"user"},{id:"hermes-webui",label:"Hermes WebUI",type:"user"}];function pi(o){return o==null?"":o>1024**3?`${(o/1024**3).toFixed(2)} GB`:`${(o/1024**2).toFixed(1)} MB`}function O0({open:o,onClose:d,defaultTab:a="maintenance"}){const[c,f]=p.useState(null),[m,h]=p.useState([]),[x,E]=p.useState("llama-swap"),[b,k]=p.useState(""),[M,A]=p.useState(!1),[I,O]=p.useState(null),[S,C]=p.useState({}),[_,L]=p.useState("maintenance"),[Z,Y]=p.useState(!1),[H,T]=p.useState(null);function F(w,Q,Le){T({type:"alert",title:w,message:Q,onConfirm:()=>{T(null),Le&&Le()}})}function ne(w,Q,Le){T({type:"confirm",title:w,message:Q,onConfirm:()=>{T(null),Le()},onCancel:()=>T(null)})}function se(w){return w?new Date(w*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}const[X,ye]=p.useState(""),[ce,Pe]=p.useState(""),[_e,Me]=p.useState(!1),[Ne,ke]=p.useState(!1);p.useEffect(()=>{o&&(ye(localStorage.getItem("mc_sudo_password")||""),Pe(localStorage.getItem("mc_hf_token")||""))},[o]),p.useEffect(()=>{o&&a&&L(a)},[o,a]);const W=p.useRef(null);function ae(){fe("/api/maintenance/updates").then(f).catch(w=>console.error("Error loading updates",w))}function G(){fe("/api/jobs").then(w=>h(w.jobs||[])).catch(w=>console.error("Error loading jobs",w))}function j(w){A(!0),O(null),fe(`/api/maintenance/logs?service=${w}&lines=150`).then(Q=>{Q.ok?k(Q.text):(k(`Fehler beim Laden der Logs: ${Q.err||"Unbekannter Fehler"}`),(Q.status==="incorrect_password"||Q.status==="password_required")&&O(Q.status))}).catch(Q=>k(`Fehler: ${Q.message}`)).finally(()=>{A(!1),setTimeout(()=>{W.current&&(W.current.scrollTop=W.current.scrollHeight)},50)})}p.useEffect(()=>{if(!o)return;ae(),G();const w=setInterval(()=>{G(),ae()},3e3);return()=>clearInterval(w)},[o]),p.useEffect(()=>{!o||_!=="logs"||j(x)},[o,_,x]);async function v(){try{await fe("/api/maintenance/os-update",{method:"POST"}),G(),L("maintenance")}catch(w){F("Fehler",`Fehler beim Starten des OS-Updates: ${w.message}`)}}async function B(){try{await fe("/api/maintenance/engine-update",{method:"POST"}),G(),L("maintenance")}catch(w){F("Fehler",`Fehler beim Engine-Update: ${w.message}`)}}async function J(){Y(!0);try{await fe("/api/maintenance/check-updates",{method:"POST"}),G(),L("maintenance")}catch(w){F("Fehler",`Fehler bei der Update-Suche: ${w.message}`)}finally{Y(!1)}}async function K(w,Q){try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:w,role:Q})}),F("Gestartet",`Modell-Upgrade für '${Q}' (${w}) gestartet.`),G(),L("maintenance")}catch(Le){F("Fehler",`Fehler beim Starten des Modell-Upgrades: ${Le.message}`)}}async function oe(){ne("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await fe("/api/maintenance/reboot",{method:"POST"}),F("Reboot","Reboot ausgelöst. System startet neu...",()=>{d()})}catch(w){F("Fehler",`Fehler beim Reboot: ${w.message}`)}})}async function pe(w){C(Q=>({...Q,[w]:!0}));try{const Q=await fe("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:w})});Q.ok?F("Dienst neu gestartet",`Dienst ${w} wurde erfolgreich neu gestartet.`,()=>{_==="logs"&&x===w&&j(w)}):F("Fehler",`Fehler beim Neustart: ${Q.err||"Unbekannter Fehler"}`)}catch(Q){F("Fehler",`Fehler beim Neustart: ${Q.message}`)}finally{C(Q=>({...Q,[w]:!1}))}}async function me(w){try{await fe(`/api/jobs/${w}/cancel`,{method:"POST"}),G()}catch(Q){F("Fehler",`Fehler beim Abbrechen: ${Q.message}`)}}return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ee("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",o?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:d}),n.jsxs("div",{className:ee("fixed inset-y-0 right-0 w-full sm:w-[500px] bg-card/85 backdrop-blur-xl border-l border-border/60 shadow-2xl z-50 flex flex-col transform transition-transform duration-300 ease-in-out font-sans text-foreground",o?"translate-x-0":"translate-x-full"),children:[n.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(gt,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),n.jsx("button",{onClick:d,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[n.jsx("button",{onClick:()=>L("maintenance"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),n.jsx("button",{onClick:()=>L("logs"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),n.jsx("button",{onClick:()=>L("settings"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[_==="maintenance"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),n.jsxs("div",{className:"flex items-center gap-2",children:[(c==null?void 0:c.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Zuletzt gesucht: ",se(c.last_check)]}),n.jsxs("button",{onClick:J,disabled:Z,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[n.jsx(Br,{className:ee("h-3 w-3",Z&&"animate-spin")}),"Nach Updates suchen"]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("button",{onClick:v,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[n.jsx(Wr,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),n.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:c!=null&&c.os?`${c.os} Updates verfügbar`:"Auf neuestem Stand"})]}),n.jsxs("button",{onClick:B,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[n.jsx(Sh,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),n.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:c!=null&&c.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),n.jsxs("button",{onClick:oe,className:"flex w-full items-center gap-3 p-3 rounded-xl border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 text-red-400 transition-all text-left text-xs font-semibold",children:[n.jsx(df,{className:"h-4.5 w-4.5"}),n.jsxs("div",{children:[n.jsx("div",{children:"Host-System neu starten (Reboot)"}),n.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),(c==null?void 0:c.model_list)&&c.model_list.length>0&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Verfügbare Modell-Upgrades"}),(c==null?void 0:c.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Gesucht: ",se(c.last_check)]})]}),n.jsx("div",{className:"space-y-2",children:c.model_list.map(w=>n.jsx("div",{className:"p-3 rounded-xl border border-border/60 bg-background/20 flex flex-col gap-2",children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xs font-semibold",children:w.title}),n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground",children:w.repo}),n.jsxs("div",{className:"text-[10px] text-primary font-semibold uppercase mt-0.5",children:["Rolle: ",w.role]})]}),n.jsxs("button",{onClick:()=>K(w.repo,w.role),className:"flex items-center gap-1.5 text-[10px] font-semibold text-emerald-400 hover:text-emerald-300 border border-emerald-500/20 bg-emerald-500/5 hover:bg-emerald-500/10 px-2 py-1 rounded-lg transition-colors shrink-0",children:[n.jsx(Vr,{className:"h-3.5 w-3.5"}),"Upgrade"]})]})},w.role))})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),n.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[m.filter(w=>w.state==="running"||w.state==="queued").length," Aktiv"]})]}),n.jsx("div",{className:"space-y-3",children:m.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):m.map(w=>{const Q=w.state==="running"||w.state==="queued";return n.jsxs("div",{className:ee("p-3 rounded-xl border transition-all duration-300",Q?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[Q&&n.jsxs("span",{className:"flex h-2 w-2 relative",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),w.label]}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[n.jsxs("span",{children:["ID: ",w.id]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:ee(w.state==="done"&&"text-emerald-400",w.state==="failed"&&"text-red-400",w.state==="running"&&"text-primary",w.state==="queued"&&"text-amber-400",w.state==="canceled"&&"text-muted-foreground"),children:w.state})]})]}),Q&&n.jsx("button",{onClick:()=>me(w.id),className:"text-[10px] font-semibold text-red-400 hover:text-red-300 border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 px-2 py-0.5 rounded transition-colors",children:"Abbrechen"})]}),w.state==="running"&&n.jsxs("div",{className:"mt-3 space-y-1",children:[n.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${w.progress??0}%`}})}),n.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[n.jsxs("span",{children:[w.progress??0,"%"]}),w.done_bytes!=null&&w.total_bytes!=null&&n.jsxs("span",{children:[pi(w.done_bytes)," / ",pi(w.total_bytes),w.rate_bps!=null&&` (${pi(w.rate_bps)}/s)`]}),w.eta_s!=null&&n.jsxs("span",{children:["ETA: ",w.eta_s,"s"]})]})]})]},w.id)})})]})]}),_==="logs"&&n.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("select",{value:x,onChange:w=>E(w.target.value),className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none text-foreground font-semibold",children:A0.map(w=>n.jsxs("option",{value:w.id,children:[w.label," (",w.type==="system"?"systemd-root":"user",")"]},w.id))}),n.jsxs("button",{onClick:()=>pe(x),disabled:S[x],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[n.jsx(Br,{className:ee("h-3.5 w-3.5",S[x]&&"animate-spin")}),"Restart"]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-[300px] border border-border/60 bg-black/50 rounded-xl overflow-hidden shadow-inner",children:[n.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[n.jsx(tl,{className:"h-3 w-3 text-primary"}),n.jsxs("span",{children:["stdout/stderr - ",x]})]}),n.jsx("button",{onClick:()=>j(x),disabled:M,className:"text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(Br,{className:ee("h-3 w-3",M&&"animate-spin")})})]}),n.jsx("pre",{ref:W,className:"flex-1 p-4 overflow-y-auto text-[10px] font-mono text-cyan-300/90 whitespace-pre-wrap select-text leading-relaxed scrollbar-thin",children:I==="password_required"||I==="incorrect_password"?n.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center h-full space-y-3",children:[n.jsx(Ph,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),n.jsx("div",{className:"text-xs font-semibold text-amber-300",children:I==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),n.jsxs("p",{className:"text-[10px] text-muted-foreground max-w-xs leading-normal",children:["Für das Auslesen der systemd-Logs von ",x," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),n.jsx("button",{onClick:()=>L("settings"),className:"px-3 py-1.5 text-[10px] font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-md transition-colors mt-2",children:"Sudo-Passwort eintragen"})]}):M&&!b?n.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):b||n.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]}),_==="settings"&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),n.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[n.jsx(Wr,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:_e?"text":"password",value:X,onChange:w=>ye(w.target.value),placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),n.jsx("button",{type:"button",onClick:()=>Me(!_e),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:_e?n.jsx(Pu,{className:"h-4 w-4"}):n.jsx(xi,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[n.jsx(yh,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:Ne?"text":"password",value:ce,onChange:w=>Pe(w.target.value),placeholder:"hf_...",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),n.jsx("button",{type:"button",onClick:()=>ke(!Ne),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:Ne?n.jsx(Pu,{className:"h-4 w-4"}):n.jsx(xi,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),n.jsxs("div",{className:"flex gap-3 pt-2",children:[n.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",X),localStorage.setItem("mc_hf_token",ce),F("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),n.jsx("button",{onClick:()=>{ye(""),Pe(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),F("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})]})]}),H&&n.jsx(Qr,{type:H.type,title:H.title,message:H.message,onConfirm:H.onConfirm,onCancel:H.onCancel})]})}function T0(){var I,O,S,C,_;const[o,d]=p.useState("dashboard"),[a,c]=p.useState(null),[f,m]=p.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[h,x]=p.useState(null),[E,b]=p.useState(!1),[k,M]=p.useState("maintenance");p.useEffect(()=>{const L=()=>fe("/api/health").then(c).catch(()=>c(null));L();const Z=setInterval(L,1e4);return()=>clearInterval(Z)},[]),p.useEffect(()=>{const L=()=>fe("/api/system/status").then(x).catch(()=>{});L();const Z=setInterval(L,2e4);return()=>clearInterval(Z)},[]),p.useEffect(()=>{document.documentElement.classList.add("dark")},[]),p.useEffect(()=>{const L=Z=>{var H;M(((H=Z.detail)==null?void 0:H.tab)||"maintenance"),b(!0)};return window.addEventListener("open-system-drawer",L),()=>window.removeEventListener("open-system-drawer",L)},[]);const A=yi.find(L=>L.id===o);return n.jsxs("div",{className:"flex h-full relative",children:[n.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[n.jsx("div",{className:"absolute inset-0 opacity-35 animate-aurora bg-gradient-to-tr from-teal-500/20 via-indigo-500/15 to-purple-500/20 blur-[130px]"}),n.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),n.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),n.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),n.jsx(Ig,{onNavigate:d}),n.jsx(O0,{open:E,onClose:()=>b(!1),defaultTab:k}),n.jsxs("aside",{className:ee("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",f?"w-16":"w-60"),children:[n.jsxs("div",{className:ee("flex items-center py-4 border-b border-border/40 shrink-0",f?"flex-col gap-3 px-2":"justify-between px-5"),children:[n.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[n.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!f&&n.jsxs("div",{className:"leading-tight",children:[n.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),n.jsx("button",{onClick:()=>{m(L=>{const Z=!L;return localStorage.setItem("mc_sidebar_collapsed",Z.toString()),Z})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:f?"Maximieren":"Minimieren",children:f?n.jsx(dh,{className:"h-4 w-4"}):n.jsx(ih,{className:"h-4 w-4"})})]}),n.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:yi.map(L=>n.jsxs("button",{onClick:()=>d(L.id),className:ee("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",f?"justify-center p-2.5":"gap-3 px-3 py-2",o===L.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:f?L.label:void 0,children:[n.jsx(L.icon,{className:"h-4.5 w-4.5 shrink-0"}),!f&&n.jsx("span",{className:"truncate",children:L.label})]},L.id))}),n.jsx("div",{className:ee("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",f?"px-2 text-center":"px-5"),children:f?n.jsx("div",{className:"flex justify-center",children:n.jsx("span",{className:ee("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",a?a.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:a?`Engine ${a.engine_reachable?"online":"offline"}`:"Backend offline"})}):n.jsxs("div",{className:"space-y-2 text-left",children:[a?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ee("h-2 w-2 rounded-full animate-pulse",a.engine_reachable?"bg-emerald-500":"bg-amber-500")}),n.jsxs("span",{className:"truncate",children:["Engine ",a.engine_reachable?"online":"offline"]})]}):n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",n.jsx("span",{className:"truncate",children:"Backend offline"})]}),(h==null?void 0:h.versions)&&n.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[n.jsxs("div",{className:"truncate",title:h.versions.mc2?`${h.versions.mc2.branch}-${h.versions.mc2.hash}${h.versions.mc2.dirty?"*":""} (${h.versions.mc2.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"MC2:"})," ",h.versions.mc2?`${h.versions.mc2.hash}${h.versions.mc2.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:((I=h.versions.engine)==null?void 0:I.type)==="git"?`${h.versions.engine.branch}-${h.versions.engine.hash}${h.versions.engine.dirty?"*":""} (${h.versions.engine.date})`:((O=h.versions.engine)==null?void 0:O.version_text)||"unbekannt",children:[n.jsx("strong",{children:"Engine:"})," ",((S=h.versions.engine)==null?void 0:S.type)==="git"?`${h.versions.engine.hash}${h.versions.engine.dirty?"*":""}`:((_=(C=h.versions.engine)==null?void 0:C.version_text)==null?void 0:_.split(" ").pop())||"—"]}),n.jsxs("div",{className:"truncate",title:h.versions.hermes_ui?`${h.versions.hermes_ui.branch}-${h.versions.hermes_ui.hash}${h.versions.hermes_ui.dirty?"*":""} (${h.versions.hermes_ui.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes UI:"})," ",h.versions.hermes_ui?`${h.versions.hermes_ui.hash}${h.versions.hermes_ui.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:h.versions.hermes_agent?`${h.versions.hermes_agent.branch}-${h.versions.hermes_agent.hash}${h.versions.hermes_agent.dirty?"*":""} (${h.versions.hermes_agent.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes Agent:"})," ",h.versions.hermes_agent?`${h.versions.hermes_agent.hash}${h.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-6 bg-card/20 backdrop-blur-sm",children:[n.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:A.hint}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),n.jsxs("button",{onClick:()=>{const L=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(L)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[n.jsx(mh,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Suchen"}),n.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),n.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[o==="dashboard"&&n.jsx(v0,{}),o==="models"&&n.jsx(E0,{}),o==="system"&&n.jsx(_0,{}),o==="connect"&&n.jsx(P0,{}),o==="memory"&&n.jsx(R0,{}),o==="agent"&&n.jsx(z0,{}),o==="guide"&&n.jsx(D0,{}),!["dashboard","models","system","connect","memory","agent","guide"].includes(o)&&n.jsx(L0,{title:A.label,hint:A.hint})]})]})]})}rh.createRoot(document.getElementById("root")).render(n.jsx(rf.StrictMode,{children:n.jsx(T0,{})}));