const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LiveAreaChartImpl-Bb72EW29.js","assets/string-DoZi9Vij.js","assets/ModelsView-BYDzvdzC.js","assets/JobsBar-B1nmMx5i.js","assets/code-xml-DZ6lLr-w.js","assets/rotate-ccw-Dx0bZ_kA.js","assets/zap-B_VSdjfC.js","assets/chevron-down-D5zhK_UQ.js","assets/layers-DCwnbkXd.js","assets/ConnectView-Cz-npKrg.js","assets/GuideView-CP1Y1rbp.js","assets/AuftragsbuchView-C0bzCKZ0.js","assets/SectionLabel-R1yae0WQ.js","assets/IdeenView-wVxyfCCm.js","assets/SkillsView-C5MWeKc5.js","assets/ChronikView-Bz_yVFvS.js","assets/WissenView-DOJLqZxA.js"])))=>i.map(i=>d[i]); var Nv=Object.defineProperty;var ih=r=>{throw TypeError(r)};var jv=(r,s,o)=>s in r?Nv(r,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[s]=o;var Qo=(r,s,o)=>jv(r,typeof s!="symbol"?s+"":s,o),au=(r,s,o)=>s.has(r)||ih("Cannot "+o);var E=(r,s,o)=>(au(r,s,"read from private field"),o?o.call(r):s.get(r)),pe=(r,s,o)=>s.has(r)?ih("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,o),J=(r,s,o,a)=>(au(r,s,"write to private field"),a?a.call(r,o):s.set(r,o),o),_e=(r,s,o)=>(au(r,s,"access private method"),o);var Ko=(r,s,o,a)=>({set _(u){J(r,s,u,o)},get _(){return E(r,s,a)}});function Cv(r,s){for(var o=0;oa[u]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))a(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function o(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(u){if(u.ep)return;u.ep=!0;const f=o(u);fetch(u.href,f)}})();function ap(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var uu={exports:{}},fi={},cu={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 oh;function _v(){if(oh)return je;oh=1;var r=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),k=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),x=Symbol.iterator;function P(C){return C===null||typeof C!="object"?null:(C=x&&C[x]||C["@@iterator"],typeof C=="function"?C:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,b={};function R(C,N,q){this.props=C,this.context=N,this.refs=b,this.updater=q||_}R.prototype.isReactComponent={},R.prototype.setState=function(C,N){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,N,"setState")},R.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function A(){}A.prototype=R.prototype;function I(C,N,q){this.props=C,this.context=N,this.refs=b,this.updater=q||_}var V=I.prototype=new A;V.constructor=I,D(V,R.prototype),V.isPureReactComponent=!0;var z=Array.isArray,K=Object.prototype.hasOwnProperty,G={current:null},ue={key:!0,ref:!0,__self:!0,__source:!0};function oe(C,N,q){var Y,W={},se=null,de=null;if(N!=null)for(Y in N.ref!==void 0&&(de=N.ref),N.key!==void 0&&(se=""+N.key),N)K.call(N,Y)&&!ue.hasOwnProperty(Y)&&(W[Y]=N[Y]);var ye=arguments.length-2;if(ye===1)W.children=q;else if(1>>1,N=F[C];if(0>>1;Cu(W,Q))seu(de,W)?(F[C]=de,F[se]=Q,C=se):(F[C]=W,F[Y]=Q,C=Y);else if(seu(de,Q))F[C]=de,F[se]=Q,C=se;else break e}}return ne}function u(F,ne){var Q=F.sortIndex-ne.sortIndex;return Q!==0?Q:F.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var m=Date,h=m.now();r.unstable_now=function(){return m.now()-h}}var y=[],k=[],w=1,x=null,P=3,_=!1,D=!1,b=!1,R=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function V(F){for(var ne=o(k);ne!==null;){if(ne.callback===null)a(k);else if(ne.startTime<=F)a(k),ne.sortIndex=ne.expirationTime,s(y,ne);else break;ne=o(k)}}function z(F){if(b=!1,V(F),!D)if(o(y)!==null)D=!0,Ce(K);else{var ne=o(k);ne!==null&&Ne(z,ne.startTime-F)}}function K(F,ne){D=!1,b&&(b=!1,A(oe),oe=-1),_=!0;var Q=P;try{for(V(ne),x=o(y);x!==null&&(!(x.expirationTime>ne)||F&&!ke());){var C=x.callback;if(typeof C=="function"){x.callback=null,P=x.priorityLevel;var N=C(x.expirationTime<=ne);ne=r.unstable_now(),typeof N=="function"?x.callback=N:x===o(y)&&a(y),V(ne)}else a(y);x=o(y)}if(x!==null)var q=!0;else{var Y=o(k);Y!==null&&Ne(z,Y.startTime-ne),q=!1}return q}finally{x=null,P=Q,_=!1}}var G=!1,ue=null,oe=-1,ee=5,me=-1;function ke(){return!(r.unstable_now()-meF||125C?(F.sortIndex=Q,s(k,F),o(y)===null&&F===o(k)&&(b?(A(oe),oe=-1):b=!0,Ne(z,Q-C))):(F.sortIndex=N,s(y,F),D||_||(D=!0,Ce(K))),F},r.unstable_shouldYield=ke,r.unstable_wrapCallback=function(F){var ne=P;return function(){var Q=P;P=ne;try{return F.apply(this,arguments)}finally{P=Q}}}})(hu)),hu}var dh;function Ov(){return dh||(dh=1,fu.exports=Mv()),fu.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 fh;function Tv(){if(fh)return wt;fh=1;var r=Xu(),s=Ov();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,k=/^[: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]*$/,w={},x={};function P(e){return y.call(x,e)?!0:y.call(w,e)?!1:k.test(e)?x[e]=!0:(w[e]=!0,!1)}function _(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function D(e,t,n,i){if(t===null||typeof t>"u"||_(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.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 b(e,t,n,i,l,c,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=p}var R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){R[e]=new b(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];R[t]=new b(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){R[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){R[e]=new b(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){R[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){R[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){R[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){R[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){R[e]=new b(e,5,!1,e.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function I(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(A,I);R[t]=new b(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(A,I);R[t]=new b(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(A,I);R[t]=new b(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){R[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),R.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){R[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function V(e,t,n,i){var l=R.hasOwnProperty(t)?R[t]:null;(l!==null?l.type!==0:i||!(2v||l[p]!==c[v]){var S=` `+l[p].replace(" at new "," at ");return e.displayName&&S.includes("")&&(S=S.replace("",e.displayName)),S}while(1<=p&&0<=v);break}}}finally{q=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?N(e):""}function W(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=Y(e.type,!1),e;case 11:return e=Y(e.type.render,!1),e;case 1:return e=Y(e.type,!0),e;default:return""}}function se(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 ue:return"Fragment";case G:return"Portal";case ee:return"Profiler";case oe:return"StrictMode";case Le:return"Suspense";case Z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ke:return(e.displayName||"Context")+".Consumer";case me:return(e._context.displayName||"Context")+".Provider";case le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case Ce:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}function de(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 se(t);case 8:return t===oe?"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 ye(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function we(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ge(e){var t=we(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(p){i=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(p){i=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sr(e){e._valueTracker||(e._valueTracker=Ge(e))}function Ns(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=we(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Er(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 rn(e,t){var n=t.checked;return Q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function js(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=ye(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Nr(e,t){t=t.checked,t!=null&&V(e,"checked",t,!1)}function jr(e,t){Nr(e,t);var n=ye(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?L(e,t.type,n):t.hasOwnProperty("defaultValue")&&L(e,t.type,ye(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function L(e,t,n){(t!=="number"||Er(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var xe=Array.isArray;function ze(e,t,n,i){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=zi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _s(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ps={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},Pm=["Webkit","ms","Moz","O"];Object.keys(Ps).forEach(function(e){Pm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ps[t]=Ps[e]})});function xc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ps.hasOwnProperty(e)&&Ps[e]?(""+t).trim():t+"px"}function wc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,l=xc(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,l):e[n]=l}}var Rm=Q({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 wl(e,t){if(t){if(Rm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(o(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(t.style!=null&&typeof t.style!="object")throw Error(o(62))}}function kl(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 bl=null;function Sl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var El=null,Cr=null,_r=null;function kc(e){if(e=Ys(e)){if(typeof El!="function")throw Error(o(280));var t=e.stateNode;t&&(t=oo(t),El(e.stateNode,e.type,t))}}function bc(e){Cr?_r?_r.push(e):_r=[e]:Cr=e}function Sc(){if(Cr){var e=Cr,t=_r;if(_r=Cr=null,kc(e),t)for(e=0;e>>=0,e===0?32:31-($m(e)/Bm|0)|0}var Bi=64,Vi=4194304;function Ts(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 Hi(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,l=e.suspendedLanes,c=e.pingedLanes,p=n&268435455;if(p!==0){var v=p&~l;v!==0?i=Ts(v):(c&=p,c!==0&&(i=Ts(c)))}else p=n&~l,p!==0?i=Ts(p):c!==0&&(i=Ts(c));if(i===0)return 0;if(t!==0&&t!==i&&(t&l)===0&&(l=i&-i,c=t&-t,l>=c||l===16&&(c&4194240)!==0))return t;if((i&4)!==0&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function Ls(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=n}function Qm(e,t){var n=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 i=e.eventTimes;for(e=e.expirationTimes;0=Bs),Yc=" ",Xc=!1;function Jc(e,t){switch(e){case"keyup":return wg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ed(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mr=!1;function bg(e,t){switch(e){case"compositionend":return ed(t);case"keypress":return t.which!==32?null:(Xc=!0,Yc);case"textInput":return e=t.data,e===Yc&&Xc?null:e;default:return null}}function Sg(e,t){if(Mr)return e==="compositionend"||!Bl&&Jc(e,t)?(e=Wc(),Gi=Al=bn=null,Mr=!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)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ld(n)}}function ud(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ud(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cd(){for(var e=window,t=Er();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Er(e.document)}return t}function Wl(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 Og(e){var t=cd(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ud(n.ownerDocument.documentElement,n)){if(i!==null&&Wl(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,c=Math.min(i.start,l);i=i.end===void 0?c:Math.min(i.end,l),!e.extend&&c>i&&(l=i,i=c,c=l),l=ad(n,c);var p=ad(n,i);l&&p&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),c>i?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Or=null,Ql=null,Qs=null,Kl=!1;function dd(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kl||Or==null||Or!==Er(i)||(i=Or,"selectionStart"in i&&Wl(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Qs&&Ws(Qs,i)||(Qs=i,i=ro(Ql,"onSelect"),0zr||(e.current=ia[zr],ia[zr]=null,zr--)}function Ae(e,t){zr++,ia[zr]=e.current,e.current=t}var jn={},lt=Nn(jn),mt=Nn(!1),er=jn;function Fr(e,t){var n=e.type.contextTypes;if(!n)return jn;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var l={},c;for(c in n)l[c]=t[c];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function gt(e){return e=e.childContextTypes,e!=null}function lo(){Ie(mt),Ie(lt)}function jd(e,t,n){if(lt.current!==jn)throw Error(o(168));Ae(lt,t),Ae(mt,n)}function Cd(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var l in i)if(!(l in t))throw Error(o(108,de(e)||"Unknown",l));return Q({},n,i)}function ao(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jn,er=lt.current,Ae(lt,e),Ae(mt,mt.current),!0}function _d(e,t,n){var i=e.stateNode;if(!i)throw Error(o(169));n?(e=Cd(e,t,er),i.__reactInternalMemoizedMergedChildContext=e,Ie(mt),Ie(lt),Ae(lt,e)):Ie(mt),Ae(mt,n)}var on=null,uo=!1,oa=!1;function Pd(e){on===null?on=[e]:on.push(e)}function Hg(e){uo=!0,Pd(e)}function Cn(){if(!oa&&on!==null){oa=!0;var e=0,t=De;try{var n=on;for(De=1;e>=p,l-=p,ln=1<<32-zt(t)+l|n<ve?(tt=he,he=null):tt=he.sibling;var Oe=U(M,he,O[ve],H);if(Oe===null){he===null&&(he=tt);break}e&&he&&Oe.alternate===null&&t(M,he),j=c(Oe,j,ve),fe===null?ae=Oe:fe.sibling=Oe,fe=Oe,he=tt}if(ve===O.length)return n(M,he),$e&&nr(M,ve),ae;if(he===null){for(;veve?(tt=he,he=null):tt=he.sibling;var An=U(M,he,Oe.value,H);if(An===null){he===null&&(he=tt);break}e&&he&&An.alternate===null&&t(M,he),j=c(An,j,ve),fe===null?ae=An:fe.sibling=An,fe=An,he=tt}if(Oe.done)return n(M,he),$e&&nr(M,ve),ae;if(he===null){for(;!Oe.done;ve++,Oe=O.next())Oe=B(M,Oe.value,H),Oe!==null&&(j=c(Oe,j,ve),fe===null?ae=Oe:fe.sibling=Oe,fe=Oe);return $e&&nr(M,ve),ae}for(he=i(M,he);!Oe.done;ve++,Oe=O.next())Oe=X(he,M,ve,Oe.value,H),Oe!==null&&(e&&Oe.alternate!==null&&he.delete(Oe.key===null?ve:Oe.key),j=c(Oe,j,ve),fe===null?ae=Oe:fe.sibling=Oe,fe=Oe);return e&&he.forEach(function(Ev){return t(M,Ev)}),$e&&nr(M,ve),ae}function qe(M,j,O,H){if(typeof O=="object"&&O!==null&&O.type===ue&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case K:e:{for(var ae=O.key,fe=j;fe!==null;){if(fe.key===ae){if(ae=O.type,ae===ue){if(fe.tag===7){n(M,fe.sibling),j=l(fe,O.props.children),j.return=M,M=j;break e}}else if(fe.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===Ce&&Dd(ae)===fe.type){n(M,fe.sibling),j=l(fe,O.props),j.ref=Xs(M,fe,O),j.return=M,M=j;break e}n(M,fe);break}else t(M,fe);fe=fe.sibling}O.type===ue?(j=cr(O.props.children,M.mode,H,O.key),j.return=M,M=j):(H=Fo(O.type,O.key,O.props,null,M.mode,H),H.ref=Xs(M,j,O),H.return=M,M=H)}return p(M);case G:e:{for(fe=O.key;j!==null;){if(j.key===fe)if(j.tag===4&&j.stateNode.containerInfo===O.containerInfo&&j.stateNode.implementation===O.implementation){n(M,j.sibling),j=l(j,O.children||[]),j.return=M,M=j;break e}else{n(M,j);break}else t(M,j);j=j.sibling}j=ru(O,M.mode,H),j.return=M,M=j}return p(M);case Ce:return fe=O._init,qe(M,j,fe(O._payload),H)}if(xe(O))return re(M,j,O,H);if(ne(O))return ie(M,j,O,H);po(M,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,j!==null&&j.tag===6?(n(M,j.sibling),j=l(j,O),j.return=M,M=j):(n(M,j),j=nu(O,M.mode,H),j.return=M,M=j),p(M)):n(M,j)}return qe}var Br=Ad(!0),zd=Ad(!1),mo=Nn(null),go=null,Vr=null,fa=null;function ha(){fa=Vr=go=null}function pa(e){var t=mo.current;Ie(mo),e._currentValue=t}function ma(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Hr(e,t){go=e,fa=Vr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(vt=!0),e.firstContext=null)}function Ot(e){var t=e._currentValue;if(fa!==e)if(e={context:e,memoizedValue:t,next:null},Vr===null){if(go===null)throw Error(o(308));Vr=e,go.dependencies={lanes:0,firstContext:e}}else Vr=Vr.next=e;return t}var rr=null;function ga(e){rr===null?rr=[e]:rr.push(e)}function Fd(e,t,n,i){var l=t.interleaved;return l===null?(n.next=n,ga(t)):(n.next=l.next,l.next=n),t.interleaved=n,un(e,i)}function un(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _n=!1;function va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Id(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 cn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Me&2)!==0){var l=i.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),i.pending=t,un(e,n)}return l=i.interleaved,l===null?(t.next=t,ga(i)):(t.next=l.next,l.next=t),i.interleaved=t,un(e,n)}function vo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ml(e,n)}}function Ud(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var l=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var p={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};c===null?l=c=p:c=c.next=p,n=n.next}while(n!==null);c===null?l=c=t:c=c.next=t}else l=c=t;n={baseState:i.baseState,firstBaseUpdate:l,lastBaseUpdate:c,shared:i.shared,effects:i.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function yo(e,t,n,i){var l=e.updateQueue;_n=!1;var c=l.firstBaseUpdate,p=l.lastBaseUpdate,v=l.shared.pending;if(v!==null){l.shared.pending=null;var S=v,T=S.next;S.next=null,p===null?c=T:p.next=T,p=S;var $=e.alternate;$!==null&&($=$.updateQueue,v=$.lastBaseUpdate,v!==p&&(v===null?$.firstBaseUpdate=T:v.next=T,$.lastBaseUpdate=S))}if(c!==null){var B=l.baseState;p=0,$=T=S=null,v=c;do{var U=v.lane,X=v.eventTime;if((i&U)===U){$!==null&&($=$.next={eventTime:X,lane:0,tag:v.tag,payload:v.payload,callback:v.callback,next:null});e:{var re=e,ie=v;switch(U=t,X=n,ie.tag){case 1:if(re=ie.payload,typeof re=="function"){B=re.call(X,B,U);break e}B=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=ie.payload,U=typeof re=="function"?re.call(X,B,U):re,U==null)break e;B=Q({},B,U);break e;case 2:_n=!0}}v.callback!==null&&v.lane!==0&&(e.flags|=64,U=l.effects,U===null?l.effects=[v]:U.push(v))}else X={eventTime:X,lane:U,tag:v.tag,payload:v.payload,callback:v.callback,next:null},$===null?(T=$=X,S=B):$=$.next=X,p|=U;if(v=v.next,v===null){if(v=l.shared.pending,v===null)break;U=v,v=U.next,U.next=null,l.lastBaseUpdate=U,l.shared.pending=null}}while(!0);if($===null&&(S=B),l.baseState=S,l.firstBaseUpdate=T,l.lastBaseUpdate=$,t=l.shared.interleaved,t!==null){l=t;do p|=l.lane,l=l.next;while(l!==t)}else c===null&&(l.shared.lanes=0);or|=p,e.lanes=p,e.memoizedState=B}}function $d(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var i=ba.transition;ba.transition={};try{e(!1),t()}finally{De=n,ba.transition=i}}function lf(){return Tt().memoizedState}function qg(e,t,n){var i=Tn(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},af(e))uf(t,n);else if(n=Fd(e,t,n,i),n!==null){var l=ht();Vt(n,e,i,l),cf(n,t,i)}}function Gg(e,t,n){var i=Tn(e),l={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(af(e))uf(t,l);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,v=c(p,n);if(l.hasEagerState=!0,l.eagerState=v,Ft(v,p)){var S=t.interleaved;S===null?(l.next=l,ga(t)):(l.next=S.next,S.next=l),t.interleaved=l;return}}catch{}finally{}n=Fd(e,t,l,i),n!==null&&(l=ht(),Vt(n,e,i,l),cf(n,t,i))}}function af(e){var t=e.alternate;return e===He||t!==null&&t===He}function uf(e,t){ni=ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cf(e,t,n){if((n&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ml(e,n)}}var Eo={readContext:Ot,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useInsertionEffect:at,useLayoutEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useMutableSource:at,useSyncExternalStore:at,useId:at,unstable_isNewReconciler:!1},Zg={readContext:Ot,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Ot,useEffect:Xd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bo(4194308,4,tf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bo(4194308,4,e,t)},useInsertionEffect:function(e,t){return bo(4,2,e,t)},useMemo:function(e,t){var n=Zt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Zt();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=qg.bind(null,He,e),[i.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:Zd,useDebugValue:Pa,useDeferredValue:function(e){return Zt().memoizedState=e},useTransition:function(){var e=Zd(!1),t=e[0];return e=Kg.bind(null,e[1]),Zt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=He,l=Zt();if($e){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),et===null)throw Error(o(349));(ir&30)!==0||Wd(i,t,n)}l.memoizedState=n;var c={value:n,getSnapshot:t};return l.queue=c,Xd(Kd.bind(null,i,c,e),[e]),i.flags|=2048,ii(9,Qd.bind(null,i,c,n,t),void 0,null),n},useId:function(){var e=Zt(),t=et.identifierPrefix;if($e){var n=an,i=ln;n=(i&~(1<<32-zt(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=ri++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=p.createElement(n,{is:i.is}):(e=p.createElement(n),n==="select"&&(p=e,i.multiple?p.multiple=!0:i.size&&(p.size=i.size))):e=p.createElementNS(e,n),e[qt]=t,e[Zs]=i,Rf(e,t,!1,!1),t.stateNode=e;e:{switch(p=kl(n,i),n){case"dialog":Fe("cancel",e),Fe("close",e),l=i;break;case"iframe":case"object":case"embed":Fe("load",e),l=i;break;case"video":case"audio":for(l=0;lGr&&(t.flags|=128,i=!0,oi(c,!1),t.lanes=4194304)}else{if(!i)if(e=xo(p),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),oi(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!$e)return ut(t),null}else 2*Ke()-c.renderingStartTime>Gr&&n!==1073741824&&(t.flags|=128,i=!0,oi(c,!1),t.lanes=4194304);c.isBackwards?(p.sibling=t.child,t.child=p):(n=c.last,n!==null?n.sibling=p:t.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Ke(),t.sibling=null,n=Ve.current,Ae(Ve,i?n&1|2:n&1),t):(ut(t),null);case 22:case 23:return Ja(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(Ct&1073741824)!==0&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),null;case 24:return null;case 25:return null}throw Error(o(156,t.tag))}function sv(e,t){switch(aa(t),t.tag){case 1:return gt(t.type)&&lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wr(),Ie(mt),Ie(lt),ka(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return xa(t),null;case 13:if(Ie(Ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));$r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Ve),null;case 4:return Wr(),null;case 10:return pa(t.type._context),null;case 22:case 23:return Ja(),null;case 24:return null;default:return null}}var _o=!1,ct=!1,iv=typeof WeakSet=="function"?WeakSet:Set,te=null;function Kr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){We(e,t,i)}else n.current=null}function $a(e,t,n){try{n()}catch(i){We(e,t,i)}}var Tf=!1;function ov(e,t){if(Jl=Ki,e=cd(),Wl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var l=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var p=0,v=-1,S=-1,T=0,$=0,B=e,U=null;t:for(;;){for(var X;B!==n||l!==0&&B.nodeType!==3||(v=p+l),B!==c||i!==0&&B.nodeType!==3||(S=p+i),B.nodeType===3&&(p+=B.nodeValue.length),(X=B.firstChild)!==null;)U=B,B=X;for(;;){if(B===e)break t;if(U===n&&++T===l&&(v=p),U===c&&++$===i&&(S=p),(X=B.nextSibling)!==null)break;B=U,U=B.parentNode}B=X}n=v===-1||S===-1?null:{start:v,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(ea={focusedElem:e,selectionRange:n},Ki=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var re=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(re!==null){var ie=re.memoizedProps,qe=re.memoizedState,M=t.stateNode,j=M.getSnapshotBeforeUpdate(t.elementType===t.type?ie:Ut(t.type,ie),qe);M.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(H){We(t,t.return,H)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return re=Tf,Tf=!1,re}function li(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&e)===e){var c=l.destroy;l.destroy=void 0,c!==void 0&&$a(t,n,c)}l=l.next}while(l!==i)}}function Po(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function Ba(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Lf(e){var t=e.alternate;t!==null&&(e.alternate=null,Lf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qt],delete t[Zs],delete t[sa],delete t[Bg],delete t[Vg])),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 Df(e){return e.tag===5||e.tag===3||e.tag===4}function Af(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Df(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 Va(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=io));else if(i!==4&&(e=e.child,e!==null))for(Va(e,t,n),e=e.sibling;e!==null;)Va(e,t,n),e=e.sibling}function Ha(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Ha(e,t,n),e=e.sibling;e!==null;)Ha(e,t,n),e=e.sibling}var rt=null,$t=!1;function Rn(e,t,n){for(n=n.child;n!==null;)zf(e,t,n),n=n.sibling}function zf(e,t,n){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount($i,n)}catch{}switch(n.tag){case 5:ct||Kr(n,t);case 6:var i=rt,l=$t;rt=null,Rn(e,t,n),rt=i,$t=l,rt!==null&&($t?(e=rt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rt.removeChild(n.stateNode));break;case 18:rt!==null&&($t?(e=rt,n=n.stateNode,e.nodeType===8?ra(e.parentNode,n):e.nodeType===1&&ra(e,n),Is(e)):ra(rt,n.stateNode));break;case 4:i=rt,l=$t,rt=n.stateNode.containerInfo,$t=!0,Rn(e,t,n),rt=i,$t=l;break;case 0:case 11:case 14:case 15:if(!ct&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){l=i=i.next;do{var c=l,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&$a(n,t,p),l=l.next}while(l!==i)}Rn(e,t,n);break;case 1:if(!ct&&(Kr(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(v){We(n,t,v)}Rn(e,t,n);break;case 21:Rn(e,t,n);break;case 22:n.mode&1?(ct=(i=ct)||n.memoizedState!==null,Rn(e,t,n),ct=i):Rn(e,t,n);break;default:Rn(e,t,n)}}function Ff(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new iv),t.forEach(function(i){var l=mv.bind(null,e,i);n.has(i)||(n.add(i),i.then(l,l))})}}function Bt(e,t){var n=t.deletions;if(n!==null)for(var i=0;il&&(l=p),i&=~c}if(i=l,i=Ke()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*av(i/1960))-i,10e?16:e,On===null)var i=!1;else{if(e=On,On=null,Lo=0,(Me&6)!==0)throw Error(o(331));var l=Me;for(Me|=4,te=e.current;te!==null;){var c=te,p=c.child;if((te.flags&16)!==0){var v=c.deletions;if(v!==null){for(var S=0;SKe()-Ka?ar(e,0):Qa|=n),xt(e,t)}function Yf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Vi,Vi<<=1,(Vi&130023424)===0&&(Vi=4194304)));var n=ht();e=un(e,t),e!==null&&(Ls(e,t,n),xt(e,n))}function pv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yf(e,n)}function mv(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(o(314))}i!==null&&i.delete(t),Yf(e,n)}var Xf;Xf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mt.current)vt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return vt=!1,nv(e,t,n);vt=(e.flags&131072)!==0}else vt=!1,$e&&(t.flags&1048576)!==0&&Rd(t,fo,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Co(e,t),e=t.pendingProps;var l=Fr(t,lt.current);Hr(t,n),l=Ea(null,t,i,e,l,n);var c=Na();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,gt(i)?(c=!0,ao(t)):c=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,va(t),l.updater=No,t.stateNode=l,l._reactInternals=t,Ma(t,i,e,n),t=Da(null,t,i,!0,c,n)):(t.tag=0,$e&&c&&la(t),ft(null,t,l,n),t=t.child),t;case 16:i=t.elementType;e:{switch(Co(e,t),e=t.pendingProps,l=i._init,i=l(i._payload),t.type=i,l=t.tag=vv(i),e=Ut(i,e),l){case 0:t=La(null,t,i,e,n);break e;case 1:t=Ef(null,t,i,e,n);break e;case 11:t=xf(null,t,i,e,n);break e;case 14:t=wf(null,t,i,Ut(i.type,e),n);break e}throw Error(o(306,i,""))}return t;case 0:return i=t.type,l=t.pendingProps,l=t.elementType===i?l:Ut(i,l),La(e,t,i,l,n);case 1:return i=t.type,l=t.pendingProps,l=t.elementType===i?l:Ut(i,l),Ef(e,t,i,l,n);case 3:e:{if(Nf(t),e===null)throw Error(o(387));i=t.pendingProps,c=t.memoizedState,l=c.element,Id(e,t),yo(t,i,null,n);var p=t.memoizedState;if(i=p.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){l=Qr(Error(o(423)),t),t=jf(e,t,i,n,l);break e}else if(i!==l){l=Qr(Error(o(424)),t),t=jf(e,t,i,n,l);break e}else for(jt=En(t.stateNode.containerInfo.firstChild),Nt=t,$e=!0,It=null,n=zd(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($r(),i===l){t=dn(e,t,n);break e}ft(e,t,i,n)}t=t.child}return t;case 5:return Bd(t),e===null&&ca(t),i=t.type,l=t.pendingProps,c=e!==null?e.memoizedProps:null,p=l.children,ta(i,l)?p=null:c!==null&&ta(i,c)&&(t.flags|=32),Sf(e,t),ft(e,t,p,n),t.child;case 6:return e===null&&ca(t),null;case 13:return Cf(e,t,n);case 4:return ya(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Br(t,null,i,n):ft(e,t,i,n),t.child;case 11:return i=t.type,l=t.pendingProps,l=t.elementType===i?l:Ut(i,l),xf(e,t,i,l,n);case 7:return ft(e,t,t.pendingProps,n),t.child;case 8:return ft(e,t,t.pendingProps.children,n),t.child;case 12:return ft(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,l=t.pendingProps,c=t.memoizedProps,p=l.value,Ae(mo,i._currentValue),i._currentValue=p,c!==null)if(Ft(c.value,p)){if(c.children===l.children&&!mt.current){t=dn(e,t,n);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var v=c.dependencies;if(v!==null){p=c.child;for(var S=v.firstContext;S!==null;){if(S.context===i){if(c.tag===1){S=cn(-1,n&-n),S.tag=2;var T=c.updateQueue;if(T!==null){T=T.shared;var $=T.pending;$===null?S.next=S:(S.next=$.next,$.next=S),T.pending=S}}c.lanes|=n,S=c.alternate,S!==null&&(S.lanes|=n),ma(c.return,n,t),v.lanes|=n;break}S=S.next}}else if(c.tag===10)p=c.type===t.type?null:c.child;else if(c.tag===18){if(p=c.return,p===null)throw Error(o(341));p.lanes|=n,v=p.alternate,v!==null&&(v.lanes|=n),ma(p,n,t),p=c.sibling}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}ft(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,i=t.pendingProps.children,Hr(t,n),l=Ot(l),i=i(l),t.flags|=1,ft(e,t,i,n),t.child;case 14:return i=t.type,l=Ut(i,t.pendingProps),l=Ut(i.type,l),wf(e,t,i,l,n);case 15:return kf(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,l=t.pendingProps,l=t.elementType===i?l:Ut(i,l),Co(e,t),t.tag=1,gt(i)?(e=!0,ao(t)):e=!1,Hr(t,n),ff(t,i,l),Ma(t,i,l,n),Da(null,t,i,!0,e,n);case 19:return Pf(e,t,n);case 22:return bf(e,t,n)}throw Error(o(156,t.tag))};function Jf(e,t){return Mc(e,t)}function gv(e,t,n,i){this.tag=e,this.key=n,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dt(e,t,n,i){return new gv(e,t,n,i)}function tu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vv(e){if(typeof e=="function")return tu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===le)return 11;if(e===ce)return 14}return 2}function Dn(e,t){var n=e.alternate;return n===null?(n=Dt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Fo(e,t,n,i,l,c){var p=2;if(i=e,typeof e=="function")tu(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case ue:return cr(n.children,l,c,t);case oe:p=8,l|=8;break;case ee:return e=Dt(12,n,t,l|2),e.elementType=ee,e.lanes=c,e;case Le:return e=Dt(13,n,t,l),e.elementType=Le,e.lanes=c,e;case Z:return e=Dt(19,n,t,l),e.elementType=Z,e.lanes=c,e;case Ne:return Io(n,l,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case me:p=10;break e;case ke:p=9;break e;case le:p=11;break e;case ce:p=14;break e;case Ce:p=16,i=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return t=Dt(p,n,t,l),t.elementType=e,t.type=i,t.lanes=c,t}function cr(e,t,n,i){return e=Dt(7,e,i,t),e.lanes=n,e}function Io(e,t,n,i){return e=Dt(22,e,i,t),e.elementType=Ne,e.lanes=n,e.stateNode={isHidden:!1},e}function nu(e,t,n){return e=Dt(6,e,null,t),e.lanes=n,e}function ru(e,t,n){return t=Dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function yv(e,t,n,i,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=Rl(0),this.expirationTimes=Rl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rl(0),this.identifierPrefix=i,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function su(e,t,n,i,l,c,p,v,S){return e=new yv(e,t,n,v,S),t===1?(t=1,c===!0&&(t|=8)):t=0,c=Dt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},va(c),e}function xv(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(s){console.error(s)}}return r(),du.exports=Tv(),du.exports}var ph;function Lv(){if(ph)return qo;ph=1;var r=up();return qo.createRoot=r.createRoot,qo.hydrateRoot=r.hydrateRoot,qo}var Dv=Lv();const Av=ap(Dv);var Di=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fr,$n,as,Xh,zv=(Xh=class extends Di{constructor(){super();pe(this,fr);pe(this,$n);pe(this,as);J(this,as,s=>{if(typeof window<"u"&&window.addEventListener){const o=()=>s();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}})}onSubscribe(){E(this,$n)||this.setEventListener(E(this,as))}onUnsubscribe(){var s;this.hasListeners()||((s=E(this,$n))==null||s.call(this),J(this,$n,void 0))}setEventListener(s){var o;J(this,as,s),(o=E(this,$n))==null||o.call(this),J(this,$n,s(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(s){E(this,fr)!==s&&(J(this,fr,s),this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(o=>{o(s)})}isFocused(){var s;return typeof E(this,fr)=="boolean"?E(this,fr):((s=globalThis.document)==null?void 0:s.visibilityState)!=="hidden"}},fr=new WeakMap,$n=new WeakMap,as=new WeakMap,Xh),tc=new zv,Fv={setTimeout:(r,s)=>setTimeout(r,s),clearTimeout:r=>clearTimeout(r),setInterval:(r,s)=>setInterval(r,s),clearInterval:r=>clearInterval(r)},Bn,Yu,Jh,Iv=(Jh=class{constructor(){pe(this,Bn,Fv);pe(this,Yu,!1)}setTimeoutProvider(r){J(this,Bn,r)}setTimeout(r,s){return E(this,Bn).setTimeout(r,s)}clearTimeout(r){E(this,Bn).clearTimeout(r)}setInterval(r,s){return E(this,Bn).setInterval(r,s)}clearInterval(r){E(this,Bn).clearInterval(r)}},Bn=new WeakMap,Yu=new WeakMap,Jh),dr=new Iv;function Uv(r){setTimeout(r,0)}var $v=typeof window>"u"||"Deno"in globalThis;function bt(){}function Bv(r,s){return typeof r=="function"?r(s):r}function Cu(r){return typeof r=="number"&&r>=0&&r!==1/0}function cp(r,s){return Math.max(r+(s||0)-Date.now(),0)}function Gn(r,s){return typeof r=="function"?r(s):r}function Pt(r,s){return typeof r=="function"?r(s):r}function mh(r,s){const{type:o="all",exact:a,fetchStatus:u,predicate:f,queryKey:m,stale:h}=r;if(m){if(a){if(s.queryHash!==nc(m,s.options))return!1}else if(!Si(s.queryKey,m))return!1}if(o!=="all"){const y=s.isActive();if(o==="active"&&!y||o==="inactive"&&y)return!1}return!(typeof h=="boolean"&&s.isStale()!==h||u&&u!==s.state.fetchStatus||f&&!f(s))}function gh(r,s){const{exact:o,status:a,predicate:u,mutationKey:f}=r;if(f){if(!s.options.mutationKey)return!1;if(o){if(bi(s.options.mutationKey)!==bi(f))return!1}else if(!Si(s.options.mutationKey,f))return!1}return!(a&&s.state.status!==a||u&&!u(s))}function nc(r,s){return((s==null?void 0:s.queryKeyHashFn)||bi)(r)}function bi(r){return JSON.stringify(r,(s,o)=>Pu(o)?Object.keys(o).sort().reduce((a,u)=>(a[u]=o[u],a),{}):o)}function Si(r,s){return r===s?!0:typeof r!=typeof s?!1:r&&s&&typeof r=="object"&&typeof s=="object"?Object.keys(s).every(o=>Si(r[o],s[o])):!1}var Vv=Object.prototype.hasOwnProperty;function dp(r,s,o=0){if(r===s)return r;if(o>500)return s;const a=vh(r)&&vh(s);if(!a&&!(Pu(r)&&Pu(s)))return s;const f=(a?r:Object.keys(r)).length,m=a?s:Object.keys(s),h=m.length,y=a?new Array(h):{};let k=0;for(let w=0;w{dr.setTimeout(s,r)})}function Ru(r,s,o){return typeof o.structuralSharing=="function"?o.structuralSharing(r,s):o.structuralSharing!==!1?dp(r,s):s}function Wv(r,s,o=0){const a=[...r,s];return o&&a.length>o?a.slice(1):a}function Qv(r,s,o=0){const a=[s,...r];return o&&a.length>o?a.slice(0,-1):a}var rc=Symbol();function fp(r,s){return!r.queryFn&&(s!=null&&s.initialPromise)?()=>s.initialPromise:!r.queryFn||r.queryFn===rc?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function hp(r,s){return typeof r=="function"?r(...s):!!r}function Kv(r,s,o){let a=!1,u;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(u??(u=s()),a||(a=!0,u.aborted?o():u.addEventListener("abort",o,{once:!0})),u)}),r}var Ei=(()=>{let r=()=>$v;return{isServer(){return r()},setIsServer(s){r=s}}})();function Mu(){let r,s;const o=new Promise((u,f)=>{r=u,s=f});o.status="pending",o.catch(()=>{});function a(u){Object.assign(o,u),delete o.resolve,delete o.reject}return o.resolve=u=>{a({status:"fulfilled",value:u}),r(u)},o.reject=u=>{a({status:"rejected",reason:u}),s(u)},o}var qv=Uv;function Gv(){let r=[],s=0,o=h=>{h()},a=h=>{h()},u=qv;const f=h=>{s?r.push(h):u(()=>{o(h)})},m=()=>{const h=r;r=[],h.length&&u(()=>{a(()=>{h.forEach(y=>{o(y)})})})};return{batch:h=>{let y;s++;try{y=h()}finally{s--,s||m()}return y},batchCalls:h=>(...y)=>{f(()=>{h(...y)})},schedule:f,setNotifyFunction:h=>{o=h},setBatchNotifyFunction:h=>{a=h},setScheduler:h=>{u=h}}}var it=Gv(),us,Vn,cs,ep,Zv=(ep=class extends Di{constructor(){super();pe(this,us,!0);pe(this,Vn);pe(this,cs);J(this,cs,s=>{if(typeof window<"u"&&window.addEventListener){const o=()=>s(!0),a=()=>s(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",a)}}})}onSubscribe(){E(this,Vn)||this.setEventListener(E(this,cs))}onUnsubscribe(){var s;this.hasListeners()||((s=E(this,Vn))==null||s.call(this),J(this,Vn,void 0))}setEventListener(s){var o;J(this,cs,s),(o=E(this,Vn))==null||o.call(this),J(this,Vn,s(this.setOnline.bind(this)))}setOnline(s){E(this,us)!==s&&(J(this,us,s),this.listeners.forEach(a=>{a(s)}))}isOnline(){return E(this,us)}},us=new WeakMap,Vn=new WeakMap,cs=new WeakMap,ep),ol=new Zv;function Yv(r){return Math.min(1e3*2**r,3e4)}function pp(r){return(r??"online")==="online"?ol.isOnline():!0}var Ou=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function mp(r){let s=!1,o=0,a;const u=Mu(),f=()=>u.status!=="pending",m=b=>{var R;if(!f()){const A=new Ou(b);P(A),(R=r.onCancel)==null||R.call(r,A)}},h=()=>{s=!0},y=()=>{s=!1},k=()=>tc.isFocused()&&(r.networkMode==="always"||ol.isOnline())&&r.canRun(),w=()=>pp(r.networkMode)&&r.canRun(),x=b=>{f()||(a==null||a(),u.resolve(b))},P=b=>{f()||(a==null||a(),u.reject(b))},_=()=>new Promise(b=>{var R;a=A=>{(f()||k())&&b(A)},(R=r.onPause)==null||R.call(r)}).then(()=>{var b;a=void 0,f()||(b=r.onContinue)==null||b.call(r)}),D=()=>{if(f())return;let b;const R=o===0?r.initialPromise:void 0;try{b=R??r.fn()}catch(A){b=Promise.reject(A)}Promise.resolve(b).then(x).catch(A=>{var G;if(f())return;const I=r.retry??(Ei.isServer()?0:3),V=r.retryDelay??Yv,z=typeof V=="function"?V(o,A):V,K=I===!0||typeof I=="number"&&ok()?void 0:_()).then(()=>{s?P(A):D()})})};return{promise:u,status:()=>u.status,cancel:m,continue:()=>(a==null||a(),u),cancelRetry:h,continueRetry:y,canStart:w,start:()=>(w()?D():_().then(D),u)}}var hr,tp,gp=(tp=class{constructor(){pe(this,hr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cu(this.gcTime)&&J(this,hr,dr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(Ei.isServer()?1/0:300*1e3))}clearGcTimeout(){E(this,hr)!==void 0&&(dr.clearTimeout(E(this,hr)),J(this,hr,void 0))}},hr=new WeakMap,tp);function Xv(r){return{onFetch:(s,o)=>{var w,x,P,_,D;const a=s.options,u=(P=(x=(w=s.fetchOptions)==null?void 0:w.meta)==null?void 0:x.fetchMore)==null?void 0:P.direction,f=((_=s.state.data)==null?void 0:_.pages)||[],m=((D=s.state.data)==null?void 0:D.pageParams)||[];let h={pages:[],pageParams:[]},y=0;const k=async()=>{let b=!1;const R=V=>{Kv(V,()=>s.signal,()=>b=!0)},A=fp(s.options,s.fetchOptions),I=async(V,z,K)=>{if(b)return Promise.reject(s.signal.reason);if(z==null&&V.pages.length)return Promise.resolve(V);const ue=(()=>{const ke={client:s.client,queryKey:s.queryKey,pageParam:z,direction:K?"backward":"forward",meta:s.options.meta};return R(ke),ke})(),oe=await A(ue),{maxPages:ee}=s.options,me=K?Qv:Wv;return{pages:me(V.pages,oe,ee),pageParams:me(V.pageParams,z,ee)}};if(u&&f.length){const V=u==="backward",z=V?Jv:xh,K={pages:f,pageParams:m},G=z(a,K);h=await I(K,G,V)}else{const V=r??f.length;do{const z=y===0?m[0]??a.initialPageParam:xh(a,h);if(y>0&&z==null)break;h=await I(h,z),y++}while(y{var b,R;return(R=(b=s.options).persister)==null?void 0:R.call(b,k,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},o)}:s.fetchFn=k}}}function xh(r,{pages:s,pageParams:o}){const a=s.length-1;return s.length>0?r.getNextPageParam(s[a],s,o[a],o):void 0}function Jv(r,{pages:s,pageParams:o}){var a;return s.length>0?(a=r.getPreviousPageParam)==null?void 0:a.call(r,s[0],s,o[0],o):void 0}var ds,pr,fs,At,mr,nt,Ri,gr,_t,vp,pn,np,ey=(np=class extends gp{constructor(s){super();pe(this,_t);pe(this,ds);pe(this,pr);pe(this,fs);pe(this,At);pe(this,mr);pe(this,nt);pe(this,Ri);pe(this,gr);J(this,gr,!1),J(this,Ri,s.defaultOptions),this.setOptions(s.options),this.observers=[],J(this,mr,s.client),J(this,At,E(this,mr).getQueryCache()),this.queryKey=s.queryKey,this.queryHash=s.queryHash,J(this,pr,kh(this.options)),this.state=s.state??E(this,pr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return E(this,ds)}get promise(){var s;return(s=E(this,nt))==null?void 0:s.promise}setOptions(s){if(this.options={...E(this,Ri),...s},s!=null&&s._type&&J(this,ds,s._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const o=kh(this.options);o.data!==void 0&&(this.setState(wh(o.data,o.dataUpdatedAt)),J(this,pr,o))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,At).remove(this)}setData(s,o){const a=Ru(this.state.data,s,this.options);return _e(this,_t,pn).call(this,{data:a,type:"success",dataUpdatedAt:o==null?void 0:o.updatedAt,manual:o==null?void 0:o.manual}),a}setState(s){_e(this,_t,pn).call(this,{type:"setState",state:s})}cancel(s){var a,u;const o=(a=E(this,nt))==null?void 0:a.promise;return(u=E(this,nt))==null||u.cancel(s),o?o.then(bt).catch(bt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return E(this,pr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(s=>Pt(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(s=>Gn(s.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(s=0){return this.state.data===void 0?!0:s==="static"?!1:this.state.isInvalidated?!0:!cp(this.state.dataUpdatedAt,s)}onFocus(){var o;const s=this.observers.find(a=>a.shouldFetchOnWindowFocus());s==null||s.refetch({cancelRefetch:!1}),(o=E(this,nt))==null||o.continue()}onOnline(){var o;const s=this.observers.find(a=>a.shouldFetchOnReconnect());s==null||s.refetch({cancelRefetch:!1}),(o=E(this,nt))==null||o.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),E(this,At).notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(o=>o!==s),this.observers.length||(E(this,nt)&&(E(this,gr)||_e(this,_t,vp).call(this)?E(this,nt).cancel({revert:!0}):E(this,nt).cancelRetry()),this.scheduleGc()),E(this,At).notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_e(this,_t,pn).call(this,{type:"invalidate"})}async fetch(s,o){var k,w,x,P,_,D,b,R,A,I,V;if(this.state.fetchStatus!=="idle"&&((k=E(this,nt))==null?void 0:k.status())!=="rejected"){if(this.state.data!==void 0&&(o!=null&&o.cancelRefetch))this.cancel({silent:!0});else if(E(this,nt))return E(this,nt).continueRetry(),E(this,nt).promise}if(s&&this.setOptions(s),!this.options.queryFn){const z=this.observers.find(K=>K.options.queryFn);z&&this.setOptions(z.options)}const a=new AbortController,u=z=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>(J(this,gr,!0),a.signal)})},f=()=>{const z=fp(this.options,o),G=(()=>{const ue={client:E(this,mr),queryKey:this.queryKey,meta:this.meta};return u(ue),ue})();return J(this,gr,!1),this.options.persister?this.options.persister(z,G,this):z(G)},h=(()=>{const z={fetchOptions:o,options:this.options,queryKey:this.queryKey,client:E(this,mr),state:this.state,fetchFn:f};return u(z),z})(),y=E(this,ds)==="infinite"?Xv(this.options.pages):this.options.behavior;y==null||y.onFetch(h,this),J(this,fs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((w=h.fetchOptions)==null?void 0:w.meta))&&_e(this,_t,pn).call(this,{type:"fetch",meta:(x=h.fetchOptions)==null?void 0:x.meta}),J(this,nt,mp({initialPromise:o==null?void 0:o.initialPromise,fn:h.fetchFn,onCancel:z=>{z instanceof Ou&&z.revert&&this.setState({...E(this,fs),fetchStatus:"idle"}),a.abort()},onFail:(z,K)=>{_e(this,_t,pn).call(this,{type:"failed",failureCount:z,error:K})},onPause:()=>{_e(this,_t,pn).call(this,{type:"pause"})},onContinue:()=>{_e(this,_t,pn).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const z=await E(this,nt).start();if(z===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(z),(_=(P=E(this,At).config).onSuccess)==null||_.call(P,z,this),(b=(D=E(this,At).config).onSettled)==null||b.call(D,z,this.state.error,this),z}catch(z){if(z instanceof Ou){if(z.silent)return E(this,nt).promise;if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw _e(this,_t,pn).call(this,{type:"error",error:z}),(A=(R=E(this,At).config).onError)==null||A.call(R,z,this),(V=(I=E(this,At).config).onSettled)==null||V.call(I,this.state.data,z,this),z}finally{this.scheduleGc()}}},ds=new WeakMap,pr=new WeakMap,fs=new WeakMap,At=new WeakMap,mr=new WeakMap,nt=new WeakMap,Ri=new WeakMap,gr=new WeakMap,_t=new WeakSet,vp=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},pn=function(s){const o=a=>{switch(s.type){case"failed":return{...a,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...yp(a.data,this.options),fetchMeta:s.meta??null};case"success":const u={...a,...wh(s.data,s.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return J(this,fs,s.manual?u:void 0),u;case"error":const f=s.error;return{...a,error:f,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...s.state}}};this.state=o(this.state),it.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),E(this,At).notify({query:this,type:"updated",action:s})})},np);function yp(r,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pp(s.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function wh(r,s){return{data:r,dataUpdatedAt:s??Date.now(),error:null,isInvalidated:!1,status:"success"}}function kh(r){const s=typeof r.initialData=="function"?r.initialData():r.initialData,o=s!==void 0,a=o?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:o?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var kt,Re,Mi,pt,vr,hs,mn,Hn,Oi,ps,ms,yr,xr,Wn,gs,Te,xi,Tu,Lu,Du,Au,zu,Fu,Iu,xp,rp,ty=(rp=class extends Di{constructor(s,o){super();pe(this,Te);pe(this,kt);pe(this,Re);pe(this,Mi);pe(this,pt);pe(this,vr);pe(this,hs);pe(this,mn);pe(this,Hn);pe(this,Oi);pe(this,ps);pe(this,ms);pe(this,yr);pe(this,xr);pe(this,Wn);pe(this,gs,new Set);this.options=o,J(this,kt,s),J(this,Hn,null),J(this,mn,Mu()),this.bindMethods(),this.setOptions(o)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,Re).addObserver(this),bh(E(this,Re),this.options)?_e(this,Te,xi).call(this):this.updateResult(),_e(this,Te,Au).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Uu(E(this,Re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Uu(E(this,Re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_e(this,Te,zu).call(this),_e(this,Te,Fu).call(this),E(this,Re).removeObserver(this)}setOptions(s){const o=this.options,a=E(this,Re);if(this.options=E(this,kt).defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pt(this.options.enabled,E(this,Re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_e(this,Te,Iu).call(this),E(this,Re).setOptions(this.options),o._defaulted&&!_u(this.options,o)&&E(this,kt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,Re),observer:this});const u=this.hasListeners();u&&Sh(E(this,Re),a,this.options,o)&&_e(this,Te,xi).call(this),this.updateResult(),u&&(E(this,Re)!==a||Pt(this.options.enabled,E(this,Re))!==Pt(o.enabled,E(this,Re))||Gn(this.options.staleTime,E(this,Re))!==Gn(o.staleTime,E(this,Re)))&&_e(this,Te,Tu).call(this);const f=_e(this,Te,Lu).call(this);u&&(E(this,Re)!==a||Pt(this.options.enabled,E(this,Re))!==Pt(o.enabled,E(this,Re))||f!==E(this,Wn))&&_e(this,Te,Du).call(this,f)}getOptimisticResult(s){const o=E(this,kt).getQueryCache().build(E(this,kt),s),a=this.createResult(o,s);return ry(this,a)&&(J(this,pt,a),J(this,hs,this.options),J(this,vr,E(this,Re).state)),a}getCurrentResult(){return E(this,pt)}trackResult(s,o){return new Proxy(s,{get:(a,u)=>(this.trackProp(u),o==null||o(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&E(this,mn).status==="pending"&&E(this,mn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,u))})}trackProp(s){E(this,gs).add(s)}getCurrentQuery(){return E(this,Re)}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const o=E(this,kt).defaultQueryOptions(s),a=E(this,kt).getQueryCache().build(E(this,kt),o);return a.fetch().then(()=>this.createResult(a,o))}fetch(s){return _e(this,Te,xi).call(this,{...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,pt)))}createResult(s,o){var ee;const a=E(this,Re),u=this.options,f=E(this,pt),m=E(this,vr),h=E(this,hs),k=s!==a?s.state:E(this,Mi),{state:w}=s;let x={...w},P=!1,_;if(o._optimisticResults){const me=this.hasListeners(),ke=!me&&bh(s,o),le=me&&Sh(s,a,o,u);(ke||le)&&(x={...x,...yp(w.data,s.options)}),o._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:D,errorUpdatedAt:b,status:R}=x;_=x.data;let A=!1;if(o.placeholderData!==void 0&&_===void 0&&R==="pending"){let me;f!=null&&f.isPlaceholderData&&o.placeholderData===(h==null?void 0:h.placeholderData)?(me=f.data,A=!0):me=typeof o.placeholderData=="function"?o.placeholderData((ee=E(this,ms))==null?void 0:ee.state.data,E(this,ms)):o.placeholderData,me!==void 0&&(R="success",_=Ru(f==null?void 0:f.data,me,o),P=!0)}if(o.select&&_!==void 0&&!A)if(f&&_===(m==null?void 0:m.data)&&o.select===E(this,Oi))_=E(this,ps);else try{J(this,Oi,o.select),_=o.select(_),_=Ru(f==null?void 0:f.data,_,o),J(this,ps,_),J(this,Hn,null)}catch(me){J(this,Hn,me)}E(this,Hn)&&(D=E(this,Hn),_=E(this,ps),b=Date.now(),R="error");const I=x.fetchStatus==="fetching",V=R==="pending",z=R==="error",K=V&&I,G=_!==void 0,oe={status:R,fetchStatus:x.fetchStatus,isPending:V,isSuccess:R==="success",isError:z,isInitialLoading:K,isLoading:K,data:_,dataUpdatedAt:x.dataUpdatedAt,error:D,errorUpdatedAt:b,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:s.isFetched(),isFetchedAfterMount:x.dataUpdateCount>k.dataUpdateCount||x.errorUpdateCount>k.errorUpdateCount,isFetching:I,isRefetching:I&&!V,isLoadingError:z&&!G,isPaused:x.fetchStatus==="paused",isPlaceholderData:P,isRefetchError:z&&G,isStale:sc(s,o),refetch:this.refetch,promise:E(this,mn),isEnabled:Pt(o.enabled,s)!==!1};if(this.options.experimental_prefetchInRender){const me=oe.data!==void 0,ke=oe.status==="error"&&!me,le=ce=>{ke?ce.reject(oe.error):me&&ce.resolve(oe.data)},Le=()=>{const ce=J(this,mn,oe.promise=Mu());le(ce)},Z=E(this,mn);switch(Z.status){case"pending":s.queryHash===a.queryHash&&le(Z);break;case"fulfilled":(ke||oe.data!==Z.value)&&Le();break;case"rejected":(!ke||oe.error!==Z.reason)&&Le();break}}return oe}updateResult(){const s=E(this,pt),o=this.createResult(E(this,Re),this.options);if(J(this,vr,E(this,Re).state),J(this,hs,this.options),E(this,vr).data!==void 0&&J(this,ms,E(this,Re)),_u(o,s))return;J(this,pt,o);const a=()=>{if(!s)return!0;const{notifyOnChangeProps:u}=this.options,f=typeof u=="function"?u():u;if(f==="all"||!f&&!E(this,gs).size)return!0;const m=new Set(f??E(this,gs));return this.options.throwOnError&&m.add("error"),Object.keys(E(this,pt)).some(h=>{const y=h;return E(this,pt)[y]!==s[y]&&m.has(y)})};_e(this,Te,xp).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_e(this,Te,Au).call(this)}},kt=new WeakMap,Re=new WeakMap,Mi=new WeakMap,pt=new WeakMap,vr=new WeakMap,hs=new WeakMap,mn=new WeakMap,Hn=new WeakMap,Oi=new WeakMap,ps=new WeakMap,ms=new WeakMap,yr=new WeakMap,xr=new WeakMap,Wn=new WeakMap,gs=new WeakMap,Te=new WeakSet,xi=function(s){_e(this,Te,Iu).call(this);let o=E(this,Re).fetch(this.options,s);return s!=null&&s.throwOnError||(o=o.catch(bt)),o},Tu=function(){_e(this,Te,zu).call(this);const s=Gn(this.options.staleTime,E(this,Re));if(Ei.isServer()||E(this,pt).isStale||!Cu(s))return;const a=cp(E(this,pt).dataUpdatedAt,s)+1;J(this,yr,dr.setTimeout(()=>{E(this,pt).isStale||this.updateResult()},a))},Lu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,Re)):this.options.refetchInterval)??!1},Du=function(s){_e(this,Te,Fu).call(this),J(this,Wn,s),!(Ei.isServer()||Pt(this.options.enabled,E(this,Re))===!1||!Cu(E(this,Wn))||E(this,Wn)===0)&&J(this,xr,dr.setInterval(()=>{(this.options.refetchIntervalInBackground||tc.isFocused())&&_e(this,Te,xi).call(this)},E(this,Wn)))},Au=function(){_e(this,Te,Tu).call(this),_e(this,Te,Du).call(this,_e(this,Te,Lu).call(this))},zu=function(){E(this,yr)!==void 0&&(dr.clearTimeout(E(this,yr)),J(this,yr,void 0))},Fu=function(){E(this,xr)!==void 0&&(dr.clearInterval(E(this,xr)),J(this,xr,void 0))},Iu=function(){const s=E(this,kt).getQueryCache().build(E(this,kt),this.options);if(s===E(this,Re))return;const o=E(this,Re);J(this,Re,s),J(this,Mi,s.state),this.hasListeners()&&(o==null||o.removeObserver(this),s.addObserver(this))},xp=function(s){it.batch(()=>{s.listeners&&this.listeners.forEach(o=>{o(E(this,pt))}),E(this,kt).getQueryCache().notify({query:E(this,Re),type:"observerResultsUpdated"})})},rp);function ny(r,s){return Pt(s.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&Pt(s.retryOnMount,r)===!1)}function bh(r,s){return ny(r,s)||r.state.data!==void 0&&Uu(r,s,s.refetchOnMount)}function Uu(r,s,o){if(Pt(s.enabled,r)!==!1&&Gn(s.staleTime,r)!=="static"){const a=typeof o=="function"?o(r):o;return a==="always"||a!==!1&&sc(r,s)}return!1}function Sh(r,s,o,a){return(r!==s||Pt(a.enabled,r)===!1)&&(!o.suspense||r.state.status!=="error")&&sc(r,o)}function sc(r,s){return Pt(s.enabled,r)!==!1&&r.isStaleByTime(Gn(s.staleTime,r))}function ry(r,s){return!_u(r.getCurrentResult(),s)}var Ti,Jt,dt,wr,en,In,sp,sy=(sp=class extends gp{constructor(s){super();pe(this,en);pe(this,Ti);pe(this,Jt);pe(this,dt);pe(this,wr);J(this,Ti,s.client),this.mutationId=s.mutationId,J(this,dt,s.mutationCache),J(this,Jt,[]),this.state=s.state||iy(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){E(this,Jt).includes(s)||(E(this,Jt).push(s),this.clearGcTimeout(),E(this,dt).notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){J(this,Jt,E(this,Jt).filter(o=>o!==s)),this.scheduleGc(),E(this,dt).notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){E(this,Jt).length||(this.state.status==="pending"?this.scheduleGc():E(this,dt).remove(this))}continue(){var s;return((s=E(this,wr))==null?void 0:s.continue())??this.execute(this.state.variables)}async execute(s){var m,h,y,k,w,x,P,_,D,b,R,A,I,V,z,K,G,ue;const o=()=>{_e(this,en,In).call(this,{type:"continue"})},a={client:E(this,Ti),meta:this.options.meta,mutationKey:this.options.mutationKey};J(this,wr,mp({fn:()=>this.options.mutationFn?this.options.mutationFn(s,a):Promise.reject(new Error("No mutationFn found")),onFail:(oe,ee)=>{_e(this,en,In).call(this,{type:"failed",failureCount:oe,error:ee})},onPause:()=>{_e(this,en,In).call(this,{type:"pause"})},onContinue:o,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,dt).canRun(this)}));const u=this.state.status==="pending",f=!E(this,wr).canStart();try{if(u)o();else{_e(this,en,In).call(this,{type:"pending",variables:s,isPaused:f}),E(this,dt).config.onMutate&&await E(this,dt).config.onMutate(s,this,a);const ee=await((h=(m=this.options).onMutate)==null?void 0:h.call(m,s,a));ee!==this.state.context&&_e(this,en,In).call(this,{type:"pending",context:ee,variables:s,isPaused:f})}const oe=await E(this,wr).start();return await((k=(y=E(this,dt).config).onSuccess)==null?void 0:k.call(y,oe,s,this.state.context,this,a)),await((x=(w=this.options).onSuccess)==null?void 0:x.call(w,oe,s,this.state.context,a)),await((_=(P=E(this,dt).config).onSettled)==null?void 0:_.call(P,oe,null,this.state.variables,this.state.context,this,a)),await((b=(D=this.options).onSettled)==null?void 0:b.call(D,oe,null,s,this.state.context,a)),_e(this,en,In).call(this,{type:"success",data:oe}),oe}catch(oe){try{await((A=(R=E(this,dt).config).onError)==null?void 0:A.call(R,oe,s,this.state.context,this,a))}catch(ee){Promise.reject(ee)}try{await((V=(I=this.options).onError)==null?void 0:V.call(I,oe,s,this.state.context,a))}catch(ee){Promise.reject(ee)}try{await((K=(z=E(this,dt).config).onSettled)==null?void 0:K.call(z,void 0,oe,this.state.variables,this.state.context,this,a))}catch(ee){Promise.reject(ee)}try{await((ue=(G=this.options).onSettled)==null?void 0:ue.call(G,void 0,oe,s,this.state.context,a))}catch(ee){Promise.reject(ee)}throw _e(this,en,In).call(this,{type:"error",error:oe}),oe}finally{E(this,dt).runNext(this)}}},Ti=new WeakMap,Jt=new WeakMap,dt=new WeakMap,wr=new WeakMap,en=new WeakSet,In=function(s){const o=a=>{switch(s.type){case"failed":return{...a,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...a,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:s.error,failureCount:a.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=o(this.state),it.batch(()=>{E(this,Jt).forEach(a=>{a.onMutationUpdate(s)}),E(this,dt).notify({mutation:this,type:"updated",action:s})})},sp);function iy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gn,Ht,Li,ip,oy=(ip=class extends Di{constructor(s={}){super();pe(this,gn);pe(this,Ht);pe(this,Li);this.config=s,J(this,gn,new Set),J(this,Ht,new Map),J(this,Li,0)}build(s,o,a){const u=new sy({client:s,mutationCache:this,mutationId:++Ko(this,Li)._,options:s.defaultMutationOptions(o),state:a});return this.add(u),u}add(s){E(this,gn).add(s);const o=Go(s);if(typeof o=="string"){const a=E(this,Ht).get(o);a?a.push(s):E(this,Ht).set(o,[s])}this.notify({type:"added",mutation:s})}remove(s){if(E(this,gn).delete(s)){const o=Go(s);if(typeof o=="string"){const a=E(this,Ht).get(o);if(a)if(a.length>1){const u=a.indexOf(s);u!==-1&&a.splice(u,1)}else a[0]===s&&E(this,Ht).delete(o)}}this.notify({type:"removed",mutation:s})}canRun(s){const o=Go(s);if(typeof o=="string"){const a=E(this,Ht).get(o),u=a==null?void 0:a.find(f=>f.state.status==="pending");return!u||u===s}else return!0}runNext(s){var a;const o=Go(s);if(typeof o=="string"){const u=(a=E(this,Ht).get(o))==null?void 0:a.find(f=>f!==s&&f.state.isPaused);return(u==null?void 0:u.continue())??Promise.resolve()}else return Promise.resolve()}clear(){it.batch(()=>{E(this,gn).forEach(s=>{this.notify({type:"removed",mutation:s})}),E(this,gn).clear(),E(this,Ht).clear()})}getAll(){return Array.from(E(this,gn))}find(s){const o={exact:!0,...s};return this.getAll().find(a=>gh(o,a))}findAll(s={}){return this.getAll().filter(o=>gh(s,o))}notify(s){it.batch(()=>{this.listeners.forEach(o=>{o(s)})})}resumePausedMutations(){const s=this.getAll().filter(o=>o.state.isPaused);return it.batch(()=>Promise.all(s.map(o=>o.continue().catch(bt))))}},gn=new WeakMap,Ht=new WeakMap,Li=new WeakMap,ip);function Go(r){var s;return(s=r.options.scope)==null?void 0:s.id}var tn,op,ly=(op=class extends Di{constructor(s={}){super();pe(this,tn);this.config=s,J(this,tn,new Map)}build(s,o,a){const u=o.queryKey,f=o.queryHash??nc(u,o);let m=this.get(f);return m||(m=new ey({client:s,queryKey:u,queryHash:f,options:s.defaultQueryOptions(o),state:a,defaultOptions:s.getQueryDefaults(u)}),this.add(m)),m}add(s){E(this,tn).has(s.queryHash)||(E(this,tn).set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const o=E(this,tn).get(s.queryHash);o&&(s.destroy(),o===s&&E(this,tn).delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){it.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return E(this,tn).get(s)}getAll(){return[...E(this,tn).values()]}find(s){const o={exact:!0,...s};return this.getAll().find(a=>mh(o,a))}findAll(s={}){const o=this.getAll();return Object.keys(s).length>0?o.filter(a=>mh(s,a)):o}notify(s){it.batch(()=>{this.listeners.forEach(o=>{o(s)})})}onFocus(){it.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){it.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},tn=new WeakMap,op),Qe,Qn,Kn,vs,ys,qn,xs,ws,lp,ay=(lp=class{constructor(r={}){pe(this,Qe);pe(this,Qn);pe(this,Kn);pe(this,vs);pe(this,ys);pe(this,qn);pe(this,xs);pe(this,ws);J(this,Qe,r.queryCache||new ly),J(this,Qn,r.mutationCache||new oy),J(this,Kn,r.defaultOptions||{}),J(this,vs,new Map),J(this,ys,new Map),J(this,qn,0)}mount(){Ko(this,qn)._++,E(this,qn)===1&&(J(this,xs,tc.subscribe(async r=>{r&&(await this.resumePausedMutations(),E(this,Qe).onFocus())})),J(this,ws,ol.subscribe(async r=>{r&&(await this.resumePausedMutations(),E(this,Qe).onOnline())})))}unmount(){var r,s;Ko(this,qn)._--,E(this,qn)===0&&((r=E(this,xs))==null||r.call(this),J(this,xs,void 0),(s=E(this,ws))==null||s.call(this),J(this,ws,void 0))}isFetching(r){return E(this,Qe).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return E(this,Qn).findAll({...r,status:"pending"}).length}getQueryData(r){var o;const s=this.defaultQueryOptions({queryKey:r});return(o=E(this,Qe).get(s.queryHash))==null?void 0:o.state.data}ensureQueryData(r){const s=this.defaultQueryOptions(r),o=E(this,Qe).build(this,s),a=o.state.data;return a===void 0?this.fetchQuery(r):(r.revalidateIfStale&&o.isStaleByTime(Gn(s.staleTime,o))&&this.prefetchQuery(s),Promise.resolve(a))}getQueriesData(r){return E(this,Qe).findAll(r).map(({queryKey:s,state:o})=>{const a=o.data;return[s,a]})}setQueryData(r,s,o){const a=this.defaultQueryOptions({queryKey:r}),u=E(this,Qe).get(a.queryHash),f=u==null?void 0:u.state.data,m=Bv(s,f);if(m!==void 0)return E(this,Qe).build(this,a).setData(m,{...o,manual:!0})}setQueriesData(r,s,o){return it.batch(()=>E(this,Qe).findAll(r).map(({queryKey:a})=>[a,this.setQueryData(a,s,o)]))}getQueryState(r){var o;const s=this.defaultQueryOptions({queryKey:r});return(o=E(this,Qe).get(s.queryHash))==null?void 0:o.state}removeQueries(r){const s=E(this,Qe);it.batch(()=>{s.findAll(r).forEach(o=>{s.remove(o)})})}resetQueries(r,s){const o=E(this,Qe);return it.batch(()=>(o.findAll(r).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...r},s)))}cancelQueries(r,s={}){const o={revert:!0,...s},a=it.batch(()=>E(this,Qe).findAll(r).map(u=>u.cancel(o)));return Promise.all(a).then(bt).catch(bt)}invalidateQueries(r,s={}){return it.batch(()=>(E(this,Qe).findAll(r).forEach(o=>{o.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},s)))}refetchQueries(r,s={}){const o={...s,cancelRefetch:s.cancelRefetch??!0},a=it.batch(()=>E(this,Qe).findAll(r).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,o);return o.throwOnError||(f=f.catch(bt)),u.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(a).then(bt)}fetchQuery(r){const s=this.defaultQueryOptions(r);s.retry===void 0&&(s.retry=!1);const o=E(this,Qe).build(this,s);return o.isStaleByTime(Gn(s.staleTime,o))?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(bt).catch(bt)}fetchInfiniteQuery(r){return r._type="infinite",this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(bt).catch(bt)}ensureInfiniteQueryData(r){return r._type="infinite",this.ensureQueryData(r)}resumePausedMutations(){return ol.isOnline()?E(this,Qn).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Qe)}getMutationCache(){return E(this,Qn)}getDefaultOptions(){return E(this,Kn)}setDefaultOptions(r){J(this,Kn,r)}setQueryDefaults(r,s){E(this,vs).set(bi(r),{queryKey:r,defaultOptions:s})}getQueryDefaults(r){const s=[...E(this,vs).values()],o={};return s.forEach(a=>{Si(r,a.queryKey)&&Object.assign(o,a.defaultOptions)}),o}setMutationDefaults(r,s){E(this,ys).set(bi(r),{mutationKey:r,defaultOptions:s})}getMutationDefaults(r){const s=[...E(this,ys).values()],o={};return s.forEach(a=>{Si(r,a.mutationKey)&&Object.assign(o,a.defaultOptions)}),o}defaultQueryOptions(r){if(r._defaulted)return r;const s={...E(this,Kn).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return s.queryHash||(s.queryHash=nc(s.queryKey,s)),s.refetchOnReconnect===void 0&&(s.refetchOnReconnect=s.networkMode!=="always"),s.throwOnError===void 0&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===rc&&(s.enabled=!1),s}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...E(this,Kn).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){E(this,Qe).clear(),E(this,Qn).clear()}},Qe=new WeakMap,Qn=new WeakMap,Kn=new WeakMap,vs=new WeakMap,ys=new WeakMap,qn=new WeakMap,xs=new WeakMap,ws=new WeakMap,lp),wp=g.createContext(void 0),ul=r=>{const s=g.useContext(wp);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},uy=({client:r,children:s})=>(g.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),d.jsx(wp.Provider,{value:r,children:s})),kp=g.createContext(!1),cy=()=>g.useContext(kp);kp.Provider;function dy(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var fy=g.createContext(dy()),hy=()=>g.useContext(fy),py=(r,s,o)=>{const a=o!=null&&o.state.error&&typeof r.throwOnError=="function"?hp(r.throwOnError,[o.state.error,o]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||a)&&(s.isReset()||(r.retryOnMount=!1))},my=r=>{g.useEffect(()=>{r.clearReset()},[r])},gy=({result:r,errorResetBoundary:s,throwOnError:o,query:a,suspense:u})=>r.isError&&!s.isReset()&&!r.isFetching&&a&&(u&&r.data===void 0||hp(o,[r.error,a])),vy=r=>{if(r.suspense){const o=u=>u==="static"?u:Math.max(u??1e3,1e3),a=r.staleTime;r.staleTime=typeof a=="function"?(...u)=>o(a(...u)):o(a),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},yy=(r,s)=>r.isLoading&&r.isFetching&&!s,xy=(r,s)=>(r==null?void 0:r.suspense)&&s.isPending,Eh=(r,s,o)=>s.fetchOptimistic(r).catch(()=>{o.clearReset()});function wy(r,s,o){var _,D,b,R;const a=cy(),u=hy(),f=ul(),m=f.defaultQueryOptions(r);(D=(_=f.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||D.call(_,m);const h=f.getQueryCache().get(m.queryHash),y=r.subscribed!==!1;m._optimisticResults=a?"isRestoring":y?"optimistic":void 0,vy(m),py(m,u,h),my(u);const k=!f.getQueryCache().get(m.queryHash),[w]=g.useState(()=>new s(f,m)),x=w.getOptimisticResult(m),P=!a&&y;if(g.useSyncExternalStore(g.useCallback(A=>{const I=P?w.subscribe(it.batchCalls(A)):bt;return w.updateResult(),I},[w,P]),()=>w.getCurrentResult(),()=>w.getCurrentResult()),g.useEffect(()=>{w.setOptions(m)},[m,w]),xy(m,x))throw Eh(m,w,u);if(gy({result:x,errorResetBoundary:u,throwOnError:m.throwOnError,query:h,suspense:m.suspense}))throw x.error;if((R=(b=f.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||R.call(b,m,x),m.experimental_prefetchInRender&&!Ei.isServer()&&yy(x,a)){const A=k?Eh(m,w,u):h==null?void 0:h.promise;A==null||A.catch(bt).finally(()=>{w.updateResult()})}return m.notifyOnChangeProps?x:w.trackResult(x)}function Be(r,s){return wy(r,ty)}const ky="modulepreload",by=function(r){return"/"+r},Nh={},Wt=function(s,o,a){let u=Promise.resolve();if(o&&o.length>0){let m=function(k){return Promise.all(k.map(w=>Promise.resolve(w).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),y=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));u=m(o.map(k=>{if(k=by(k),k in Nh)return;Nh[k]=!0;const w=k.endsWith(".css"),x=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${k}"]${x}`))return;const P=document.createElement("link");if(P.rel=w?"stylesheet":ky,w||(P.as="script"),P.crossOrigin="",P.href=k,y&&P.setAttribute("nonce",y),document.head.appendChild(P),w)return new Promise((_,D)=>{P.addEventListener("load",_),P.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${k}`)))})}))}function f(m){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=m,window.dispatchEvent(h),!h.defaultPrevented)throw m}return u.then(m=>{for(const h of m||[])h.status==="rejected"&&f(h.reason);return s().catch(f)})};/** * @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 Sy=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bp=(...r)=>r.filter((s,o,a)=>!!s&&s.trim()!==""&&a.indexOf(s)===o).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 Ey={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 Ny=g.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:u="",children:f,iconNode:m,...h},y)=>g.createElement("svg",{ref:y,...Ey,width:s,height:s,stroke:r,strokeWidth:a?Number(o)*24/Number(s):o,className:bp("lucide",u),...h},[...m.map(([k,w])=>g.createElement(k,w)),...Array.isArray(f)?f:[f]]));/** * @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=(r,s)=>{const o=g.forwardRef(({className:a,...u},f)=>g.createElement(Ny,{ref:f,iconNode:s,className:bp(`lucide-${Sy(r)}`,a),...u}));return o.displayName=`${r}`,o};/** * @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 jy=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 jh=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 Cy=ge("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/** * @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 Ni=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 _y=ge("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @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 Sp=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 Py=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 Ry=ge("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** * @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 My=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 Oy=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 wi=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 Ty=ge("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @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 Ep=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 Ly=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 Dy=ge("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/** * @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 Ay=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 Np=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 zy=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 Fy=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 jp=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 Iy=ge("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @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 Uy=ge("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** * @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 $y=ge("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/** * @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 By=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 Vy=ge("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/** * @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 Hy=ge("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** * @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 ic=ge("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["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"}]]);/** * @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 Wy=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 Qy=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 Ky=ge("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/** * @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 qy=ge("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** * @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 ji=ge("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @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 Gy=ge("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @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 Zy=ge("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** * @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("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** * @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 oc=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 Yy=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 ss=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 Xy=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 cl=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 lc=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 Cp=ge("ShieldCheck",[["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:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @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 _p=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 Pp=ge("Shuffle",[["path",{d:"M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22",key:"1wmou1"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 6h1.9c1.5 0 2.9.9 3.6 2.2",key:"10bdb2"}],["path",{d:"M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8",key:"vgxac0"}],["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}]]);/** * @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 Jy=ge("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** * @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 e0=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 t0=ge("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/** * @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 n0=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 Ci=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 r0=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 dl=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),is=[{id:"dashboard",label:"Cockpit",hint:"Deine Box auf einen Blick",icon:Qy,group:"Operativ"},{id:"ideen",label:"Ideen",hint:"Schreib hin, was entstehen soll",icon:qy,group:"Operativ"},{id:"auftraege",label:"Auftragsbuch",hint:"Vorschläge der Box — annehmen oder ablehnen",icon:ic,group:"Operativ"},{id:"skills",label:"Skills & Jobs",hint:"Autonome Skills manuell auslösen",icon:Ni,group:"Operativ"},{id:"chronik",label:"Chronik",hint:"Was die Box von allein getan hat + Zeitmaschine",icon:Hy,group:"Operativ"},{id:"wissen",label:"Wissen",hint:"Lucys Wissens-Vault (Traum-Notizen)",icon:Ky,group:"Wissen"},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:oc,group:"Werkzeuge"},{id:"konsole",label:"Konsole",hint:"Direkte Box-Shell (SSH-artig)",icon:t0,group:"Werkzeuge"},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:Ep,group:"Werkzeuge"},{id:"models",label:"Modelle",hint:"Speicher, laden & Rollen",icon:Sp,group:"Wartung"},{id:"agent",label:"Hermes",hint:"Agent-Status & Verdrahtung",icon:Ni,group:"Wartung"}];var _h=1,s0=.9,i0=.8,o0=.17,pu=.1,mu=.999,l0=.9999,a0=.99,u0=/[\\\/_+.#"@\[\(\{&]/,c0=/[\\\/_+.#"@\[\(\{&]/g,d0=/[\s-]/,Rp=/[\s-]/g;function $u(r,s,o,a,u,f,m){if(f===s.length)return u===r.length?_h:a0;var h=`${u},${f}`;if(m[h]!==void 0)return m[h];for(var y=a.charAt(f),k=o.indexOf(y,u),w=0,x,P,_,D;k>=0;)x=$u(r,s,o,a,k+1,f+1,m),x>w&&(k===u?x*=_h:u0.test(r.charAt(k-1))?(x*=i0,_=r.slice(u,k-1).match(c0),_&&u>0&&(x*=Math.pow(mu,_.length))):d0.test(r.charAt(k-1))?(x*=s0,D=r.slice(u,k-1).match(Rp),D&&u>0&&(x*=Math.pow(mu,D.length))):(x*=o0,u>0&&(x*=Math.pow(mu,k-u))),r.charAt(k)!==s.charAt(f)&&(x*=l0)),(xx&&(x=P*pu)),x>w&&(w=x),k=o.indexOf(y,k+1);return m[h]=w,w}function Ph(r){return r.toLowerCase().replace(Rp," ")}function f0(r,s,o){return r=o&&o.length>0?`${r+" "+o.join(" ")}`:r,$u(r,s,Ph(r),Ph(s),0,0,{})}function Zn(r,s,{checkForDefaultPrevented:o=!0}={}){return function(u){if(r==null||r(u),o===!1||!u.defaultPrevented)return s==null?void 0:s(u)}}function Rh(r,s){if(typeof r=="function")return r(s);r!=null&&(r.current=s)}function ks(...r){return s=>{let o=!1;const a=r.map(u=>{const f=Rh(u,s);return!o&&typeof f=="function"&&(o=!0),f});if(o)return()=>{for(let u=0;u{var A;const{scope:P,children:_,...D}=x,b=((A=P==null?void 0:P[r])==null?void 0:A[y])||h,R=g.useMemo(()=>D,Object.values(D));return d.jsx(b.Provider,{value:R,children:_})};k.displayName=f+"Provider";function w(x,P){var b;const _=((b=P==null?void 0:P[r])==null?void 0:b[y])||h,D=g.useContext(_);if(D)return D;if(m!==void 0)return m;throw new Error(`\`${x}\` must be used within \`${f}\``)}return[k,w]}const u=()=>{const f=o.map(m=>g.createContext(m));return function(h){const y=(h==null?void 0:h[r])||f;return g.useMemo(()=>({[`__scope${r}`]:{...h,[r]:y}}),[h,y])}};return u.scopeName=r,[a,p0(u,...s)]}function p0(...r){const s=r[0];if(r.length===1)return s;const o=()=>{const a=r.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(f){const m=a.reduce((h,{useScope:y,scopeName:k})=>{const x=y(f)[`__scope${k}`];return{...h,...x}},{});return g.useMemo(()=>({[`__scope${s.scopeName}`]:m}),[m])}};return o.scopeName=s.scopeName,o}var _i=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},m0=ec[" useId ".trim().toString()]||(()=>{}),g0=0;function vn(r){const[s,o]=g.useState(m0());return _i(()=>{o(a=>a??String(g0++))},[r]),s?`radix-${s}`:""}var v0=ec[" useInsertionEffect ".trim().toString()]||_i;function y0({prop:r,defaultProp:s,onChange:o=()=>{},caller:a}){const[u,f,m]=x0({defaultProp:s,onChange:o}),h=r!==void 0,y=h?r:u;{const w=g.useRef(r!==void 0);g.useEffect(()=>{const x=w.current;x!==h&&console.warn(`${a} is changing from ${x?"controlled":"uncontrolled"} to ${h?"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.`),w.current=h},[h,a])}const k=g.useCallback(w=>{var x;if(h){const P=w0(w)?w(r):w;P!==r&&((x=m.current)==null||x.call(m,P))}else f(w)},[h,r,f,m]);return[y,k]}function x0({defaultProp:r,onChange:s}){const[o,a]=g.useState(r),u=g.useRef(o),f=g.useRef(s);return v0(()=>{f.current=s},[s]),g.useEffect(()=>{var m;u.current!==o&&((m=f.current)==null||m.call(f,o),u.current=o)},[o,u]),[o,a,f]}function w0(r){return typeof r=="function"}var Mp=up();function Op(r){const s=g.forwardRef((o,a)=>{let{children:u,...f}=o,m=null,h=!1;const y=[];Mh(u)&&typeof Zo=="function"&&(u=Zo(u._payload)),g.Children.forEach(u,P=>{var _;if(N0(P)){h=!0;const D=P;let b="child"in D.props?D.props.child:D.props.children;Mh(b)&&typeof Zo=="function"&&(b=Zo(b._payload)),m=b0(D,b),y.push((_=m==null?void 0:m.props)==null?void 0:_.children)}else y.push(P)}),m?m=g.cloneElement(m,void 0,y):!h&&g.Children.count(u)===1&&g.isValidElement(u)&&(m=u);const k=m?E0(m):void 0,w=br(a,k);if(!m){if(u||u===0)throw new Error(h?P0(r):_0(r));return u}const x=S0(f,m.props??{});return m.type!==g.Fragment&&(x.ref=a?w:k),g.cloneElement(m,x)});return s.displayName=`${r}.Slot`,s}var k0=Symbol.for("radix.slottable"),b0=(r,s)=>{if("child"in r.props){const o=r.props.child;return g.isValidElement(o)?g.cloneElement(o,void 0,r.props.children(o.props.children)):null}return g.isValidElement(s)?s:null};function S0(r,s){const o={...s};for(const a in s){const u=r[a],f=s[a];/^on[A-Z]/.test(a)?u&&f?o[a]=(...h)=>{const y=f(...h);return u(...h),y}:u&&(o[a]=u):a==="style"?o[a]={...u,...f}:a==="className"&&(o[a]=[u,f].filter(Boolean).join(" "))}return{...r,...o}}function E0(r){var a,u;let s=(a=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:a.get,o=s&&"isReactWarning"in s&&s.isReactWarning;return o?r.ref:(s=(u=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:u.get,o=s&&"isReactWarning"in s&&s.isReactWarning,o?r.props.ref:r.props.ref||r.ref)}function N0(r){return g.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===k0}var j0=Symbol.for("react.lazy");function Mh(r){return r!=null&&typeof r=="object"&&"$$typeof"in r&&r.$$typeof===j0&&"_payload"in r&&C0(r._payload)}function C0(r){return typeof r=="object"&&r!==null&&"then"in r}var _0=r=>`${r} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,P0=r=>`${r} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Zo=ec[" use ".trim().toString()],R0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ot=R0.reduce((r,s)=>{const o=Op(`Primitive.${s}`),a=g.forwardRef((u,f)=>{const{asChild:m,...h}=u,y=m?o:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(y,{...h,ref:f})});return a.displayName=`Primitive.${s}`,{...r,[s]:a}},{});function M0(r,s){r&&Mp.flushSync(()=>r.dispatchEvent(s))}function Pi(r){const s=g.useRef(r);return g.useEffect(()=>{s.current=r}),g.useMemo(()=>((...o)=>{var a;return(a=s.current)==null?void 0:a.call(s,...o)}),[])}function O0(r,s=globalThis==null?void 0:globalThis.document){const o=Pi(r);g.useEffect(()=>{const a=u=>{u.key==="Escape"&&o(u)};return s.addEventListener("keydown",a,{capture:!0}),()=>s.removeEventListener("keydown",a,{capture:!0})},[o,s])}var T0="DismissableLayer",Bu="dismissableLayer.update",L0="dismissableLayer.pointerDownOutside",D0="dismissableLayer.focusOutside",Oh,ac=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tp=g.forwardRef((r,s)=>{const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:h,onDismiss:y,...k}=r,w=g.useContext(ac),[x,P]=g.useState(null),_=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,D]=g.useState({}),b=br(s,ee=>P(ee)),R=Array.from(w.layers),[A]=[...w.layersWithOutsidePointerEventsDisabled].slice(-1),I=R.indexOf(A),V=x?R.indexOf(x):-1,z=w.layersWithOutsidePointerEventsDisabled.size>0,K=V>=I,G=g.useRef(!1),ue=I0(ee=>{const me=ee.target;if(!(me instanceof Node))return;const ke=[...w.branches].some(le=>le.contains(me));!K||ke||(f==null||f(ee),h==null||h(ee),ee.defaultPrevented||y==null||y())},{ownerDocument:_,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:G,dismissableSurfaces:w.dismissableSurfaces}),oe=U0(ee=>{if(a&&G.current)return;const me=ee.target;[...w.branches].some(le=>le.contains(me))||(m==null||m(ee),h==null||h(ee),ee.defaultPrevented||y==null||y())},_);return O0(ee=>{V===w.layers.size-1&&(u==null||u(ee),!ee.defaultPrevented&&y&&(ee.preventDefault(),y()))},_),g.useEffect(()=>{if(x)return o&&(w.layersWithOutsidePointerEventsDisabled.size===0&&(Oh=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),w.layersWithOutsidePointerEventsDisabled.add(x)),w.layers.add(x),Th(),()=>{o&&(w.layersWithOutsidePointerEventsDisabled.delete(x),w.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=Oh))}},[x,_,o,w]),g.useEffect(()=>()=>{x&&(w.layers.delete(x),w.layersWithOutsidePointerEventsDisabled.delete(x),Th())},[x,w]),g.useEffect(()=>{const ee=()=>D({});return document.addEventListener(Bu,ee),()=>document.removeEventListener(Bu,ee)},[]),d.jsx(ot.div,{...k,ref:b,style:{pointerEvents:z?K?"auto":"none":void 0,...r.style},onFocusCapture:Zn(r.onFocusCapture,oe.onFocusCapture),onBlurCapture:Zn(r.onBlurCapture,oe.onBlurCapture),onPointerDownCapture:Zn(r.onPointerDownCapture,ue.onPointerDownCapture)})});Tp.displayName=T0;var A0="DismissableLayerBranch",z0=g.forwardRef((r,s)=>{const o=g.useContext(ac),a=g.useRef(null),u=br(s,a);return g.useEffect(()=>{const f=a.current;if(f)return o.branches.add(f),()=>{o.branches.delete(f)}},[o.branches]),d.jsx(ot.div,{...r,ref:u})});z0.displayName=A0;function F0(){const r=g.useContext(ac),[s,o]=g.useState(null);return g.useEffect(()=>{if(s)return r.dismissableSurfaces.add(s),()=>{r.dismissableSurfaces.delete(s)}},[s,r.dismissableSurfaces]),o}function I0(r,s){const{ownerDocument:o=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:f}=s,m=Pi(r),h=g.useRef(!1),y=g.useRef(!1),k=g.useRef(new Map),w=g.useRef(()=>{});return g.useEffect(()=>{function x(){y.current=!1,u.current=!1,k.current.clear()}function P(){return Array.from(k.current.values()).some(Boolean)}function _(I){if(!y.current)return;const V=I.target;V instanceof Node&&[...f].some(K=>K.contains(V))||k.current.set(I.type,!0),I.type==="click"&&window.setTimeout(()=>{y.current&&w.current()},0)}function D(I){y.current&&k.current.set(I.type,!1)}const b=I=>{if(I.target&&!h.current){let V=function(){o.removeEventListener("click",w.current);const K=P();x(),K||Lp(L0,m,z,{discrete:!0})};const z={originalEvent:I};y.current=!0,u.current=a&&I.button===0,k.current.clear(),!a||I.button!==0?V():(o.removeEventListener("click",w.current),w.current=V,o.addEventListener("click",w.current,{once:!0}))}else o.removeEventListener("click",w.current),x();h.current=!1},R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const I of R)o.addEventListener(I,_,!0),o.addEventListener(I,D);const A=window.setTimeout(()=>{o.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(A),o.removeEventListener("pointerdown",b),o.removeEventListener("click",w.current);for(const I of R)o.removeEventListener(I,_,!0),o.removeEventListener(I,D)}},[o,m,a,u,f]),{onPointerDownCapture:()=>h.current=!0}}function U0(r,s=globalThis==null?void 0:globalThis.document){const o=Pi(r),a=g.useRef(!1);return g.useEffect(()=>{const u=f=>{f.target&&!a.current&&Lp(D0,o,{originalEvent:f},{discrete:!1})};return s.addEventListener("focusin",u),()=>s.removeEventListener("focusin",u)},[s,o]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Th(){const r=new CustomEvent(Bu);document.dispatchEvent(r)}function Lp(r,s,o,{discrete:a}){const u=o.originalEvent.target,f=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:o});s&&u.addEventListener(r,s,{once:!0}),a?M0(u,f):u.dispatchEvent(f)}var gu="focusScope.autoFocusOnMount",vu="focusScope.autoFocusOnUnmount",Lh={bubbles:!1,cancelable:!0},$0="FocusScope",Dp=g.forwardRef((r,s)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...m}=r,[h,y]=g.useState(null),k=Pi(u),w=Pi(f),x=g.useRef(null),P=br(s,b=>y(b)),_=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(a){let b=function(V){if(_.paused||!h)return;const z=V.target;h.contains(z)?x.current=z:Un(x.current,{select:!0})},R=function(V){if(_.paused||!h)return;const z=V.relatedTarget;z!==null&&(h.contains(z)||Un(x.current,{select:!0}))},A=function(V){if(document.activeElement===document.body)for(const K of V)K.removedNodes.length>0&&Un(h)};document.addEventListener("focusin",b),document.addEventListener("focusout",R);const I=new MutationObserver(A);return h&&I.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",R),I.disconnect()}}},[a,h,_.paused]),g.useEffect(()=>{if(h){Ah.add(_);const b=document.activeElement;if(!h.contains(b)){const A=new CustomEvent(gu,Lh);h.addEventListener(gu,k),h.dispatchEvent(A),A.defaultPrevented||(B0(K0(Ap(h)),{select:!0}),document.activeElement===b&&Un(h))}return()=>{h.removeEventListener(gu,k),setTimeout(()=>{const A=new CustomEvent(vu,Lh);h.addEventListener(vu,w),h.dispatchEvent(A),A.defaultPrevented||Un(b??document.body,{select:!0}),h.removeEventListener(vu,w),Ah.remove(_)},0)}}},[h,k,w,_]);const D=g.useCallback(b=>{if(!o&&!a||_.paused)return;const R=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,A=document.activeElement;if(R&&A){const I=b.currentTarget,[V,z]=V0(I);V&&z?!b.shiftKey&&A===z?(b.preventDefault(),o&&Un(V,{select:!0})):b.shiftKey&&A===V&&(b.preventDefault(),o&&Un(z,{select:!0})):A===I&&b.preventDefault()}},[o,a,_.paused]);return d.jsx(ot.div,{tabIndex:-1,...m,ref:P,onKeyDown:D})});Dp.displayName=$0;function B0(r,{select:s=!1}={}){const o=document.activeElement;for(const a of r)if(Un(a,{select:s}),document.activeElement!==o)return}function V0(r){const s=Ap(r),o=Dh(s,r),a=Dh(s.reverse(),r);return[o,a]}function Ap(r){const s=[],o=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const u=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||u?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)s.push(o.currentNode);return s}function Dh(r,s){for(const o of r)if(!H0(o,{upTo:s}))return o}function H0(r,{upTo:s}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(s!==void 0&&r===s)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function W0(r){return r instanceof HTMLInputElement&&"select"in r}function Un(r,{select:s=!1}={}){if(r&&r.focus){const o=document.activeElement;r.focus({preventScroll:!0}),r!==o&&W0(r)&&s&&r.select()}}var Ah=Q0();function Q0(){let r=[];return{add(s){const o=r[0];s!==o&&(o==null||o.pause()),r=zh(r,s),r.unshift(s)},remove(s){var o;r=zh(r,s),(o=r[0])==null||o.resume()}}}function zh(r,s){const o=[...r],a=o.indexOf(s);return a!==-1&&o.splice(a,1),o}function K0(r){return r.filter(s=>s.tagName!=="A")}var q0="Portal",zp=g.forwardRef((r,s)=>{var h;const{container:o,...a}=r,[u,f]=g.useState(!1);_i(()=>f(!0),[]);const m=o||u&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return m?Mp.createPortal(d.jsx(ot.div,{...a,ref:s}),m):null});zp.displayName=q0;function G0(r,s){return g.useReducer((o,a)=>s[o][a]??o,r)}var fl=r=>{const{present:s,children:o}=r,a=Z0(s),u=typeof o=="function"?o({present:a.isPresent}):g.Children.only(o),f=Y0(a.ref,X0(u));return typeof o=="function"||a.isPresent?g.cloneElement(u,{ref:f}):null};fl.displayName="Presence";function Z0(r){const[s,o]=g.useState(),a=g.useRef(null),u=g.useRef(r),f=g.useRef("none"),m=r?"mounted":"unmounted",[h,y]=G0(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const k=Yo(a.current);f.current=h==="mounted"?k:"none"},[h]),_i(()=>{const k=a.current,w=u.current;if(w!==r){const P=f.current,_=Yo(k);r?y("MOUNT"):_==="none"||(k==null?void 0:k.display)==="none"?y("UNMOUNT"):y(w&&P!==_?"ANIMATION_OUT":"UNMOUNT"),u.current=r}},[r,y]),_i(()=>{if(s){let k;const w=s.ownerDocument.defaultView??window,x=_=>{const b=Yo(a.current).includes(CSS.escape(_.animationName));if(_.target===s&&b&&(y("ANIMATION_END"),!u.current)){const R=s.style.animationFillMode;s.style.animationFillMode="forwards",k=w.setTimeout(()=>{s.style.animationFillMode==="forwards"&&(s.style.animationFillMode=R)})}},P=_=>{_.target===s&&(f.current=Yo(a.current))};return s.addEventListener("animationstart",P),s.addEventListener("animationcancel",x),s.addEventListener("animationend",x),()=>{w.clearTimeout(k),s.removeEventListener("animationstart",P),s.removeEventListener("animationcancel",x),s.removeEventListener("animationend",x)}}else y("ANIMATION_END")},[s,y]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:g.useCallback(k=>{a.current=k?getComputedStyle(k):null,o(k)},[])}}function Fh(r,s){if(typeof r=="function")return r(s);r!=null&&(r.current=s)}function Y0(...r){const s=g.useRef(r);return s.current=r,g.useCallback(o=>{const a=s.current;let u=!1;const f=a.map(m=>{const h=Fh(m,o);return!u&&typeof h=="function"&&(u=!0),h});if(u)return()=>{for(let m=0;m{Xt||(Xt={start:Ih(),end:Ih()});const{start:r,end:s}=Xt;return document.body.firstElementChild!==r&&document.body.insertAdjacentElement("afterbegin",r),document.body.lastElementChild!==s&&document.body.insertAdjacentElement("beforeend",s),Xo++,()=>{Xo===1&&(Xt==null||Xt.start.remove(),Xt==null||Xt.end.remove(),Xt=null),Xo=Math.max(0,Xo-1)}},[])}function Ih(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var nn=function(){return nn=Object.assign||function(s){for(var o,a=1,u=arguments.length;a"u")return gx;var s=vx(r),o=document.documentElement.clientWidth,a=window.innerWidth;return{left:s[0],top:s[1],right:s[2],gap:Math.max(0,a-o+s[2]-s[0])}},xx=$p(),os="data-scroll-locked",wx=function(r,s,o,a){var u=r.left,f=r.top,m=r.right,h=r.gap;return o===void 0&&(o="margin"),` .`.concat(tx,` { overflow: hidden `).concat(a,`; padding-right: `).concat(h,"px ").concat(a,`; } body[`).concat(os,`] { overflow: hidden `).concat(a,`; overscroll-behavior: contain; `).concat([s&&"position: relative ".concat(a,";"),o==="margin"&&` padding-left: `.concat(u,`px; padding-top: `).concat(f,`px; padding-right: `).concat(m,`px; margin-left:0; margin-top:0; margin-right: `).concat(h,"px ").concat(a,`; `),o==="padding"&&"padding-right: ".concat(h,"px ").concat(a,";")].filter(Boolean).join(""),` } .`).concat(rl,` { right: `).concat(h,"px ").concat(a,`; } .`).concat(sl,` { margin-right: `).concat(h,"px ").concat(a,`; } .`).concat(rl," .").concat(rl,` { right: 0 `).concat(a,`; } .`).concat(sl," .").concat(sl,` { margin-right: 0 `).concat(a,`; } body[`).concat(os,`] { `).concat(nx,": ").concat(h,`px; } `)},$h=function(){var r=parseInt(document.body.getAttribute(os)||"0",10);return isFinite(r)?r:0},kx=function(){g.useEffect(function(){return document.body.setAttribute(os,($h()+1).toString()),function(){var r=$h()-1;r<=0?document.body.removeAttribute(os):document.body.setAttribute(os,r.toString())}},[])},bx=function(r){var s=r.noRelative,o=r.noImportant,a=r.gapMode,u=a===void 0?"margin":a;kx();var f=g.useMemo(function(){return yx(u)},[u]);return g.createElement(xx,{styles:wx(f,!s,u,o?"":"!important")})},Vu=!1;if(typeof window<"u")try{var Jo=Object.defineProperty({},"passive",{get:function(){return Vu=!0,!0}});window.addEventListener("test",Jo,Jo),window.removeEventListener("test",Jo,Jo)}catch{Vu=!1}var Yr=Vu?{passive:!1}:!1,Sx=function(r){return r.tagName==="TEXTAREA"},Bp=function(r,s){if(!(r instanceof Element))return!1;var o=window.getComputedStyle(r);return o[s]!=="hidden"&&!(o.overflowY===o.overflowX&&!Sx(r)&&o[s]==="visible")},Ex=function(r){return Bp(r,"overflowY")},Nx=function(r){return Bp(r,"overflowX")},Bh=function(r,s){var o=s.ownerDocument,a=s;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var u=Vp(r,a);if(u){var f=Hp(r,a),m=f[1],h=f[2];if(m>h)return!0}a=a.parentNode}while(a&&a!==o.body);return!1},jx=function(r){var s=r.scrollTop,o=r.scrollHeight,a=r.clientHeight;return[s,o,a]},Cx=function(r){var s=r.scrollLeft,o=r.scrollWidth,a=r.clientWidth;return[s,o,a]},Vp=function(r,s){return r==="v"?Ex(s):Nx(s)},Hp=function(r,s){return r==="v"?jx(s):Cx(s)},_x=function(r,s){return r==="h"&&s==="rtl"?-1:1},Px=function(r,s,o,a,u){var f=_x(r,window.getComputedStyle(s).direction),m=f*a,h=o.target,y=s.contains(h),k=!1,w=m>0,x=0,P=0;do{if(!h)break;var _=Hp(r,h),D=_[0],b=_[1],R=_[2],A=b-R-f*D;(D||A)&&Vp(r,h)&&(x+=A,P+=D);var I=h.parentNode;h=I&&I.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host:I}while(!y&&h!==document.body||y&&(s.contains(h)||s===h));return(w&&Math.abs(x)<1||!w&&Math.abs(P)<1)&&(k=!0),k},el=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Vh=function(r){return[r.deltaX,r.deltaY]},Hh=function(r){return r&&"current"in r?r.current:r},Rx=function(r,s){return r[0]===s[0]&&r[1]===s[1]},Mx=function(r){return` .block-interactivity-`.concat(r,` {pointer-events: none;} .allow-interactivity-`).concat(r,` {pointer-events: all;} `)},Ox=0,Xr=[];function Tx(r){var s=g.useRef([]),o=g.useRef([0,0]),a=g.useRef(),u=g.useState(Ox++)[0],f=g.useState($p)[0],m=g.useRef(r);g.useEffect(function(){m.current=r},[r]),g.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(u));var b=ex([r.lockRef.current],(r.shards||[]).map(Hh),!0).filter(Boolean);return b.forEach(function(R){return R.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),b.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(u))})}}},[r.inert,r.lockRef.current,r.shards]);var h=g.useCallback(function(b,R){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!m.current.allowPinchZoom;var A=el(b),I=o.current,V="deltaX"in b?b.deltaX:I[0]-A[0],z="deltaY"in b?b.deltaY:I[1]-A[1],K,G=b.target,ue=Math.abs(V)>Math.abs(z)?"h":"v";if("touches"in b&&ue==="h"&&G.type==="range")return!1;var oe=window.getSelection(),ee=oe&&oe.anchorNode,me=ee?ee===G||ee.contains(G):!1;if(me)return!1;var ke=Bh(ue,G);if(!ke)return!0;if(ke?K=ue:(K=ue==="v"?"h":"v",ke=Bh(ue,G)),!ke)return!1;if(!a.current&&"changedTouches"in b&&(V||z)&&(a.current=K),!K)return!0;var le=a.current||K;return Px(le,R,b,le==="h"?V:z)},[]),y=g.useCallback(function(b){var R=b;if(!(!Xr.length||Xr[Xr.length-1]!==f)){var A="deltaY"in R?Vh(R):el(R),I=s.current.filter(function(K){return K.name===R.type&&(K.target===R.target||R.target===K.shadowParent)&&Rx(K.delta,A)})[0];if(I&&I.should){R.cancelable&&R.preventDefault();return}if(!I){var V=(m.current.shards||[]).map(Hh).filter(Boolean).filter(function(K){return K.contains(R.target)}),z=V.length>0?h(R,V[0]):!m.current.noIsolation;z&&R.cancelable&&R.preventDefault()}}},[]),k=g.useCallback(function(b,R,A,I){var V={name:b,delta:R,target:A,should:I,shadowParent:Lx(A)};s.current.push(V),setTimeout(function(){s.current=s.current.filter(function(z){return z!==V})},1)},[]),w=g.useCallback(function(b){o.current=el(b),a.current=void 0},[]),x=g.useCallback(function(b){k(b.type,Vh(b),b.target,h(b,r.lockRef.current))},[]),P=g.useCallback(function(b){k(b.type,el(b),b.target,h(b,r.lockRef.current))},[]);g.useEffect(function(){return Xr.push(f),r.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:P}),document.addEventListener("wheel",y,Yr),document.addEventListener("touchmove",y,Yr),document.addEventListener("touchstart",w,Yr),function(){Xr=Xr.filter(function(b){return b!==f}),document.removeEventListener("wheel",y,Yr),document.removeEventListener("touchmove",y,Yr),document.removeEventListener("touchstart",w,Yr)}},[]);var _=r.removeScrollBar,D=r.inert;return g.createElement(g.Fragment,null,D?g.createElement(f,{styles:Mx(u)}):null,_?g.createElement(bx,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function Lx(r){for(var s=null;r!==null;)r instanceof ShadowRoot&&(s=r.host,r=r.host),r=r.parentNode;return s}const Dx=ux(Up,Tx);var Wp=g.forwardRef(function(r,s){return g.createElement(hl,nn({},r,{ref:s,sideCar:Dx}))});Wp.classNames=hl.classNames;var Ax=function(r){if(typeof document>"u")return null;var s=Array.isArray(r)?r[0]:r;return s.ownerDocument.body},Jr=new WeakMap,tl=new WeakMap,nl={},ku=0,Qp=function(r){return r&&(r.host||Qp(r.parentNode))},zx=function(r,s){return s.map(function(o){if(r.contains(o))return o;var a=Qp(o);return a&&r.contains(a)?a:(console.error("aria-hidden",o,"in not contained inside",r,". Doing nothing"),null)}).filter(function(o){return!!o})},Fx=function(r,s,o,a){var u=zx(s,Array.isArray(r)?r:[r]);nl[o]||(nl[o]=new WeakMap);var f=nl[o],m=[],h=new Set,y=new Set(u),k=function(x){!x||h.has(x)||(h.add(x),k(x.parentNode))};u.forEach(k);var w=function(x){!x||y.has(x)||Array.prototype.forEach.call(x.children,function(P){if(h.has(P))w(P);else try{var _=P.getAttribute(a),D=_!==null&&_!=="false",b=(Jr.get(P)||0)+1,R=(f.get(P)||0)+1;Jr.set(P,b),f.set(P,R),m.push(P),b===1&&D&&tl.set(P,!0),R===1&&P.setAttribute(o,"true"),D||P.setAttribute(a,"true")}catch(A){console.error("aria-hidden: cannot operate on ",P,A)}})};return w(s),h.clear(),ku++,function(){m.forEach(function(x){var P=Jr.get(x)-1,_=f.get(x)-1;Jr.set(x,P),f.set(x,_),P||(tl.has(x)||x.removeAttribute(a),tl.delete(x)),_||x.removeAttribute(o)}),ku--,ku||(Jr=new WeakMap,Jr=new WeakMap,tl=new WeakMap,nl={})}},Ix=function(r,s,o){o===void 0&&(o="data-aria-hidden");var a=Array.from(Array.isArray(r)?r:[r]),u=Ax(r);return u?(a.push.apply(a,Array.from(u.querySelectorAll("[aria-live], script"))),Fx(a,u,o,"aria-hidden")):function(){return null}},pl="Dialog",[Kp]=h0(pl),[Ux,Qt]=Kp(pl),qp=r=>{const{__scopeDialog:s,children:o,open:a,defaultOpen:u,onOpenChange:f,modal:m=!0}=r,h=g.useRef(null),y=g.useRef(null),[k,w]=y0({prop:a,defaultProp:u??!1,onChange:f,caller:pl});return d.jsx(Ux,{scope:s,triggerRef:h,contentRef:y,contentId:vn(),titleId:vn(),descriptionId:vn(),open:k,onOpenChange:w,onOpenToggle:g.useCallback(()=>w(x=>!x),[w]),modal:m,children:o})};qp.displayName=pl;var Gp="DialogTrigger",$x=g.forwardRef((r,s)=>{const{__scopeDialog:o,...a}=r,u=Qt(Gp,o),f=br(s,u.triggerRef);return d.jsx(ot.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":cc(u.open),...a,ref:f,onClick:Zn(r.onClick,u.onOpenToggle)})});$x.displayName=Gp;var uc="DialogPortal",[Bx,Zp]=Kp(uc,{forceMount:void 0}),Yp=r=>{const{__scopeDialog:s,forceMount:o,children:a,container:u}=r,f=Qt(uc,s);return d.jsx(Bx,{scope:s,forceMount:o,children:g.Children.map(a,m=>d.jsx(fl,{present:o||f.open,children:d.jsx(zp,{asChild:!0,container:u,children:m})}))})};Yp.displayName=uc;var ll="DialogOverlay",Xp=g.forwardRef((r,s)=>{const o=Zp(ll,r.__scopeDialog),{forceMount:a=o.forceMount,...u}=r,f=Qt(ll,r.__scopeDialog);return f.modal?d.jsx(fl,{present:a||f.open,children:d.jsx(Hx,{...u,ref:s})}):null});Xp.displayName=ll;var Vx=Op("DialogOverlay.RemoveScroll"),Hx=g.forwardRef((r,s)=>{const{__scopeDialog:o,...a}=r,u=Qt(ll,o),f=F0(),m=br(s,f);return d.jsx(Wp,{as:Vx,allowPinchZoom:!0,shards:[u.contentRef],children:d.jsx(ot.div,{"data-state":cc(u.open),...a,ref:m,style:{pointerEvents:"auto",...a.style}})})}),bs="DialogContent",Jp=g.forwardRef((r,s)=>{const o=Zp(bs,r.__scopeDialog),{forceMount:a=o.forceMount,...u}=r,f=Qt(bs,r.__scopeDialog);return d.jsx(fl,{present:a||f.open,children:f.modal?d.jsx(Wx,{...u,ref:s}):d.jsx(Qx,{...u,ref:s})})});Jp.displayName=bs;var Wx=g.forwardRef((r,s)=>{const o=Qt(bs,r.__scopeDialog),a=g.useRef(null),u=br(s,o.contentRef,a);return g.useEffect(()=>{const f=a.current;if(f)return Ix(f)},[]),d.jsx(em,{...r,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Zn(r.onCloseAutoFocus,f=>{var m;f.preventDefault(),(m=o.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Zn(r.onPointerDownOutside,f=>{const m=f.detail.originalEvent,h=m.button===0&&m.ctrlKey===!0;(m.button===2||h)&&f.preventDefault()}),onFocusOutside:Zn(r.onFocusOutside,f=>f.preventDefault())})}),Qx=g.forwardRef((r,s)=>{const o=Qt(bs,r.__scopeDialog),a=g.useRef(!1),u=g.useRef(!1);return d.jsx(em,{...r,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var m,h;(m=r.onCloseAutoFocus)==null||m.call(r,f),f.defaultPrevented||(a.current||(h=o.triggerRef.current)==null||h.focus(),f.preventDefault()),a.current=!1,u.current=!1},onInteractOutside:f=>{var y,k;(y=r.onInteractOutside)==null||y.call(r,f),f.defaultPrevented||(a.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const m=f.target;((k=o.triggerRef.current)==null?void 0:k.contains(m))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})}),em=g.forwardRef((r,s)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:u,onCloseAutoFocus:f,...m}=r,h=Qt(bs,o);return J0(),d.jsx(d.Fragment,{children:d.jsx(Dp,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:u,onUnmountAutoFocus:f,children:d.jsx(Tp,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":cc(h.open),...m,ref:s,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1)})})})}),tm="DialogTitle",Kx=g.forwardRef((r,s)=>{const{__scopeDialog:o,...a}=r,u=Qt(tm,o);return d.jsx(ot.h2,{id:u.titleId,...a,ref:s})});Kx.displayName=tm;var nm="DialogDescription",qx=g.forwardRef((r,s)=>{const{__scopeDialog:o,...a}=r,u=Qt(nm,o);return d.jsx(ot.p,{id:u.descriptionId,...a,ref:s})});qx.displayName=nm;var rm="DialogClose",Gx=g.forwardRef((r,s)=>{const{__scopeDialog:o,...a}=r,u=Qt(rm,o);return d.jsx(ot.button,{type:"button",...a,ref:s,onClick:Zn(r.onClick,()=>u.onOpenChange(!1))})});Gx.displayName=rm;function cc(r){return r?"open":"closed"}var hi='[cmdk-group=""]',bu='[cmdk-group-items=""]',Zx='[cmdk-group-heading=""]',sm='[cmdk-item=""]',Wh=`${sm}:not([aria-disabled="true"])`,Hu="cmdk-item-select",ns="data-value",Yx=(r,s,o)=>f0(r,s,o),im=g.createContext(void 0),Ai=()=>g.useContext(im),om=g.createContext(void 0),dc=()=>g.useContext(om),lm=g.createContext(void 0),am=g.forwardRef((r,s)=>{let o=rs(()=>{var N,q;return{search:"",value:(q=(N=r.value)!=null?N:r.defaultValue)!=null?q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=rs(()=>new Set),u=rs(()=>new Map),f=rs(()=>new Map),m=rs(()=>new Set),h=um(r),{label:y,children:k,value:w,onValueChange:x,filter:P,shouldFilter:_,loop:D,disablePointerSelection:b=!1,vimBindings:R=!0,...A}=r,I=vn(),V=vn(),z=vn(),K=g.useRef(null),G=a1();kr(()=>{if(w!==void 0){let N=w.trim();o.current.value=N,ue.emit()}},[w]),kr(()=>{G(6,Le)},[]);let ue=g.useMemo(()=>({subscribe:N=>(m.current.add(N),()=>m.current.delete(N)),snapshot:()=>o.current,setState:(N,q,Y)=>{var W,se,de,ye;if(!Object.is(o.current[N],q)){if(o.current[N]=q,N==="search")le(),me(),G(1,ke);else if(N==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let we=document.getElementById(z);we?we.focus():(W=document.getElementById(I))==null||W.focus()}if(G(7,()=>{var we;o.current.selectedItemId=(we=Z())==null?void 0:we.id,ue.emit()}),Y||G(5,Le),((se=h.current)==null?void 0:se.value)!==void 0){let we=q??"";(ye=(de=h.current).onValueChange)==null||ye.call(de,we);return}}ue.emit()}},emit:()=>{m.current.forEach(N=>N())}}),[]),oe=g.useMemo(()=>({value:(N,q,Y)=>{var W;q!==((W=f.current.get(N))==null?void 0:W.value)&&(f.current.set(N,{value:q,keywords:Y}),o.current.filtered.items.set(N,ee(q,Y)),G(2,()=>{me(),ue.emit()}))},item:(N,q)=>(a.current.add(N),q&&(u.current.has(q)?u.current.get(q).add(N):u.current.set(q,new Set([N]))),G(3,()=>{le(),me(),o.current.value||ke(),ue.emit()}),()=>{f.current.delete(N),a.current.delete(N),o.current.filtered.items.delete(N);let Y=Z();G(4,()=>{le(),(Y==null?void 0:Y.getAttribute("id"))===N&&ke(),ue.emit()})}),group:N=>(u.current.has(N)||u.current.set(N,new Set),()=>{f.current.delete(N),u.current.delete(N)}),filter:()=>h.current.shouldFilter,label:y||r["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:I,inputId:z,labelId:V,listInnerRef:K}),[]);function ee(N,q){var Y,W;let se=(W=(Y=h.current)==null?void 0:Y.filter)!=null?W:Yx;return N?se(N,o.current.search,q):0}function me(){if(!o.current.search||h.current.shouldFilter===!1)return;let N=o.current.filtered.items,q=[];o.current.filtered.groups.forEach(W=>{let se=u.current.get(W),de=0;se.forEach(ye=>{let we=N.get(ye);de=Math.max(we,de)}),q.push([W,de])});let Y=K.current;ce().sort((W,se)=>{var de,ye;let we=W.getAttribute("id"),Ge=se.getAttribute("id");return((de=N.get(Ge))!=null?de:0)-((ye=N.get(we))!=null?ye:0)}).forEach(W=>{let se=W.closest(bu);se?se.appendChild(W.parentElement===se?W:W.closest(`${bu} > *`)):Y.appendChild(W.parentElement===Y?W:W.closest(`${bu} > *`))}),q.sort((W,se)=>se[1]-W[1]).forEach(W=>{var se;let de=(se=K.current)==null?void 0:se.querySelector(`${hi}[${ns}="${encodeURIComponent(W[0])}"]`);de==null||de.parentElement.appendChild(de)})}function ke(){let N=ce().find(Y=>Y.getAttribute("aria-disabled")!=="true"),q=N==null?void 0:N.getAttribute(ns);ue.setState("value",q||void 0)}function le(){var N,q,Y,W;if(!o.current.search||h.current.shouldFilter===!1){o.current.filtered.count=a.current.size;return}o.current.filtered.groups=new Set;let se=0;for(let de of a.current){let ye=(q=(N=f.current.get(de))==null?void 0:N.value)!=null?q:"",we=(W=(Y=f.current.get(de))==null?void 0:Y.keywords)!=null?W:[],Ge=ee(ye,we);o.current.filtered.items.set(de,Ge),Ge>0&&se++}for(let[de,ye]of u.current)for(let we of ye)if(o.current.filtered.items.get(we)>0){o.current.filtered.groups.add(de);break}o.current.filtered.count=se}function Le(){var N,q,Y;let W=Z();W&&(((N=W.parentElement)==null?void 0:N.firstChild)===W&&((Y=(q=W.closest(hi))==null?void 0:q.querySelector(Zx))==null||Y.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function Z(){var N;return(N=K.current)==null?void 0:N.querySelector(`${sm}[aria-selected="true"]`)}function ce(){var N;return Array.from(((N=K.current)==null?void 0:N.querySelectorAll(Wh))||[])}function Ce(N){let q=ce()[N];q&&ue.setState("value",q.getAttribute(ns))}function Ne(N){var q;let Y=Z(),W=ce(),se=W.findIndex(ye=>ye===Y),de=W[se+N];(q=h.current)!=null&&q.loop&&(de=se+N<0?W[W.length-1]:se+N===W.length?W[0]:W[se+N]),de&&ue.setState("value",de.getAttribute(ns))}function F(N){let q=Z(),Y=q==null?void 0:q.closest(hi),W;for(;Y&&!W;)Y=N>0?o1(Y,hi):l1(Y,hi),W=Y==null?void 0:Y.querySelector(Wh);W?ue.setState("value",W.getAttribute(ns)):Ne(N)}let ne=()=>Ce(ce().length-1),Q=N=>{N.preventDefault(),N.metaKey?ne():N.altKey?F(1):Ne(1)},C=N=>{N.preventDefault(),N.metaKey?Ce(0):N.altKey?F(-1):Ne(-1)};return g.createElement(ot.div,{ref:s,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:N=>{var q;(q=A.onKeyDown)==null||q.call(A,N);let Y=N.nativeEvent.isComposing||N.keyCode===229;if(!(N.defaultPrevented||Y))switch(N.key){case"n":case"j":{R&&N.ctrlKey&&Q(N);break}case"ArrowDown":{Q(N);break}case"p":case"k":{R&&N.ctrlKey&&C(N);break}case"ArrowUp":{C(N);break}case"Home":{N.preventDefault(),Ce(0);break}case"End":{N.preventDefault(),ne();break}case"Enter":{N.preventDefault();let W=Z();if(W){let se=new Event(Hu);W.dispatchEvent(se)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:oe.inputId,id:oe.labelId,style:c1},y),ml(r,N=>g.createElement(om.Provider,{value:ue},g.createElement(im.Provider,{value:oe},N))))}),Xx=g.forwardRef((r,s)=>{var o,a;let u=vn(),f=g.useRef(null),m=g.useContext(lm),h=Ai(),y=um(r),k=(a=(o=y.current)==null?void 0:o.forceMount)!=null?a:m==null?void 0:m.forceMount;kr(()=>{if(!k)return h.item(u,m==null?void 0:m.id)},[k]);let w=cm(u,f,[r.value,r.children,f],r.keywords),x=dc(),P=Yn(G=>G.value&&G.value===w.current),_=Yn(G=>k||h.filter()===!1?!0:G.search?G.filtered.items.get(u)>0:!0);g.useEffect(()=>{let G=f.current;if(!(!G||r.disabled))return G.addEventListener(Hu,D),()=>G.removeEventListener(Hu,D)},[_,r.onSelect,r.disabled]);function D(){var G,ue;b(),(ue=(G=y.current).onSelect)==null||ue.call(G,w.current)}function b(){x.setState("value",w.current,!0)}if(!_)return null;let{disabled:R,value:A,onSelect:I,forceMount:V,keywords:z,...K}=r;return g.createElement(ot.div,{ref:ks(f,s),...K,id:u,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!P,"data-disabled":!!R,"data-selected":!!P,onPointerMove:R||h.getDisablePointerSelection()?void 0:b,onClick:R?void 0:D},r.children)}),Jx=g.forwardRef((r,s)=>{let{heading:o,children:a,forceMount:u,...f}=r,m=vn(),h=g.useRef(null),y=g.useRef(null),k=vn(),w=Ai(),x=Yn(_=>u||w.filter()===!1?!0:_.search?_.filtered.groups.has(m):!0);kr(()=>w.group(m),[]),cm(m,h,[r.value,r.heading,y]);let P=g.useMemo(()=>({id:m,forceMount:u}),[u]);return g.createElement(ot.div,{ref:ks(h,s),...f,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},o&&g.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:k},o),ml(r,_=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":o?k:void 0},g.createElement(lm.Provider,{value:P},_))))}),e1=g.forwardRef((r,s)=>{let{alwaysRender:o,...a}=r,u=g.useRef(null),f=Yn(m=>!m.search);return!o&&!f?null:g.createElement(ot.div,{ref:ks(u,s),...a,"cmdk-separator":"",role:"separator"})}),t1=g.forwardRef((r,s)=>{let{onValueChange:o,...a}=r,u=r.value!=null,f=dc(),m=Yn(k=>k.search),h=Yn(k=>k.selectedItemId),y=Ai();return g.useEffect(()=>{r.value!=null&&f.setState("search",r.value)},[r.value]),g.createElement(ot.input,{ref:s,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":h,id:y.inputId,type:"text",value:u?r.value:m,onChange:k=>{u||f.setState("search",k.target.value),o==null||o(k.target.value)}})}),n1=g.forwardRef((r,s)=>{let{children:o,label:a="Suggestions",...u}=r,f=g.useRef(null),m=g.useRef(null),h=Yn(k=>k.selectedItemId),y=Ai();return g.useEffect(()=>{if(m.current&&f.current){let k=m.current,w=f.current,x,P=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let _=k.offsetHeight;w.style.setProperty("--cmdk-list-height",_.toFixed(1)+"px")})});return P.observe(k),()=>{cancelAnimationFrame(x),P.unobserve(k)}}},[]),g.createElement(ot.div,{ref:ks(f,s),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":a,id:y.listId},ml(r,k=>g.createElement("div",{ref:ks(m,y.listInnerRef),"cmdk-list-sizer":""},k)))}),r1=g.forwardRef((r,s)=>{let{open:o,onOpenChange:a,overlayClassName:u,contentClassName:f,container:m,...h}=r;return g.createElement(qp,{open:o,onOpenChange:a},g.createElement(Yp,{container:m},g.createElement(Xp,{"cmdk-overlay":"",className:u}),g.createElement(Jp,{"aria-label":r.label,"cmdk-dialog":"",className:f},g.createElement(am,{ref:s,...h}))))}),s1=g.forwardRef((r,s)=>Yn(o=>o.filtered.count===0)?g.createElement(ot.div,{ref:s,...r,"cmdk-empty":"",role:"presentation"}):null),i1=g.forwardRef((r,s)=>{let{progress:o,children:a,label:u="Loading...",...f}=r;return g.createElement(ot.div,{ref:s,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},ml(r,m=>g.createElement("div",{"aria-hidden":!0},m)))}),es=Object.assign(am,{List:n1,Item:Xx,Input:t1,Group:Jx,Separator:e1,Dialog:r1,Empty:s1,Loading:i1});function o1(r,s){let o=r.nextElementSibling;for(;o;){if(o.matches(s))return o;o=o.nextElementSibling}}function l1(r,s){let o=r.previousElementSibling;for(;o;){if(o.matches(s))return o;o=o.previousElementSibling}}function um(r){let s=g.useRef(r);return kr(()=>{s.current=r}),s}var kr=typeof window>"u"?g.useEffect:g.useLayoutEffect;function rs(r){let s=g.useRef();return s.current===void 0&&(s.current=r()),s}function Yn(r){let s=dc(),o=()=>r(s.snapshot());return g.useSyncExternalStore(s.subscribe,o,o)}function cm(r,s,o,a=[]){let u=g.useRef(),f=Ai();return kr(()=>{var m;let h=(()=>{var k;for(let w of o){if(typeof w=="string")return w.trim();if(typeof w=="object"&&"current"in w)return w.current?(k=w.current.textContent)==null?void 0:k.trim():u.current}})(),y=a.map(k=>k.trim());f.value(r,h,y),(m=s.current)==null||m.setAttribute(ns,h),u.current=h}),u}var a1=()=>{let[r,s]=g.useState(),o=rs(()=>new Map);return kr(()=>{o.current.forEach(a=>a()),o.current=new Map},[r]),(a,u)=>{o.current.set(a,u),s({})}};function u1(r){let s=r.type;return typeof s=="function"?s(r.props):"render"in s?s.render(r.props):r}function ml({asChild:r,children:s},o){return r&&g.isValidElement(s)?g.cloneElement(u1(s),{ref:s.ref},o(s.props.children)):o(s)}var c1={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function d1({onNavigate:r}){const[s,o]=g.useState(!1);return g.useEffect(()=>{const a=u=>{(u.metaKey||u.ctrlKey)&&u.key.toLowerCase()==="k"&&(u.preventDefault(),o(f=>!f))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[]),d.jsx(es.Dialog,{open:s,onOpenChange:o,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh] overscroll-contain",onClick:()=>o(!1),children:d.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:a=>a.stopPropagation(),children:[d.jsx(es.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"}),d.jsxs(es.List,{className:"max-h-80 overflow-y-auto p-2",children:[d.jsx(es.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),d.jsx(es.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:is.map(a=>d.jsxs(es.Item,{value:`${a.label} ${a.hint}`,onSelect:()=>{r(a.id),o(!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:[d.jsx(a.icon,{className:"h-4 w-4 text-primary"}),d.jsx("span",{children:a.label}),d.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:a.hint})]},a.id))})]})]})})}const dm="mc_expert_mode",Wu="mc-expert-mode-change",f1=()=>{try{return localStorage.getItem(dm)==="true"}catch{return!1}};function h1(r){return window.addEventListener(Wu,r),window.addEventListener("storage",r),()=>{window.removeEventListener(Wu,r),window.removeEventListener("storage",r)}}function Qh(r){localStorage.setItem(dm,String(r)),window.dispatchEvent(new Event(Wu))}function p1(){return g.useSyncExternalStore(h1,f1,()=>!1)}function fm(r){var s,o,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(s=0;s{const s=y1(r),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=r;return{getClassGroupId:m=>{const h=m.split(fc);return h[0]===""&&h.length!==1&&h.shift(),hm(h,s)||v1(m)},getConflictingClassGroupIds:(m,h)=>{const y=o[m]||[];return h&&a[m]?[...y,...a[m]]:y}}},hm=(r,s)=>{var m;if(r.length===0)return s.classGroupId;const o=r[0],a=s.nextPart.get(o),u=a?hm(r.slice(1),a):void 0;if(u)return u;if(s.validators.length===0)return;const f=r.join(fc);return(m=s.validators.find(({validator:h})=>h(f)))==null?void 0:m.classGroupId},Kh=/^\[(.+)\]$/,v1=r=>{if(Kh.test(r)){const s=Kh.exec(r)[1],o=s==null?void 0:s.substring(0,s.indexOf(":"));if(o)return"arbitrary.."+o}},y1=r=>{const{theme:s,prefix:o}=r,a={nextPart:new Map,validators:[]};return w1(Object.entries(r.classGroups),o).forEach(([f,m])=>{Qu(m,a,f,s)}),a},Qu=(r,s,o,a)=>{r.forEach(u=>{if(typeof u=="string"){const f=u===""?s:qh(s,u);f.classGroupId=o;return}if(typeof u=="function"){if(x1(u)){Qu(u(a),s,o,a);return}s.validators.push({validator:u,classGroupId:o});return}Object.entries(u).forEach(([f,m])=>{Qu(m,qh(s,f),o,a)})})},qh=(r,s)=>{let o=r;return s.split(fc).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},x1=r=>r.isThemeGetter,w1=(r,s)=>s?r.map(([o,a])=>{const u=a.map(f=>typeof f=="string"?s+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([m,h])=>[s+m,h])):f);return[o,u]}):r,k1=r=>{if(r<1)return{get:()=>{},set:()=>{}};let s=0,o=new Map,a=new Map;const u=(f,m)=>{o.set(f,m),s++,s>r&&(s=0,a=o,o=new Map)};return{get(f){let m=o.get(f);if(m!==void 0)return m;if((m=a.get(f))!==void 0)return u(f,m),m},set(f,m){o.has(f)?o.set(f,m):u(f,m)}}},pm="!",b1=r=>{const{separator:s,experimentalParseClassName:o}=r,a=s.length===1,u=s[0],f=s.length,m=h=>{const y=[];let k=0,w=0,x;for(let R=0;Rw?x-w:void 0;return{modifiers:y,hasImportantModifier:_,baseClassName:D,maybePostfixModifierPosition:b}};return o?h=>o({className:h,parseClassName:m}):m},S1=r=>{if(r.length<=1)return r;const s=[];let o=[];return r.forEach(a=>{a[0]==="["?(s.push(...o.sort(),a),o=[]):o.push(a)}),s.push(...o.sort()),s},E1=r=>({cache:k1(r.cacheSize),parseClassName:b1(r),...g1(r)}),N1=/\s+/,j1=(r,s)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:u}=s,f=[],m=r.trim().split(N1);let h="";for(let y=m.length-1;y>=0;y-=1){const k=m[y],{modifiers:w,hasImportantModifier:x,baseClassName:P,maybePostfixModifierPosition:_}=o(k);let D=!!_,b=a(D?P.substring(0,_):P);if(!b){if(!D){h=k+(h.length>0?" "+h:h);continue}if(b=a(P),!b){h=k+(h.length>0?" "+h:h);continue}D=!1}const R=S1(w).join(":"),A=x?R+pm:R,I=A+b;if(f.includes(I))continue;f.push(I);const V=u(b,D);for(let z=0;z0?" "+h:h)}return h};function C1(){let r=0,s,o,a="";for(;r{if(typeof r=="string")return r;let s,o="";for(let a=0;ax(w),r());return o=E1(k),a=o.cache.get,u=o.cache.set,f=h,h(y)}function h(y){const k=a(y);if(k)return k;const w=j1(y,o);return u(y,w),w}return function(){return f(C1.apply(null,arguments))}}const Ue=r=>{const s=o=>o[r]||[];return s.isThemeGetter=!0,s},gm=/^\[(?:([a-z-]+):)?(.+)\]$/i,P1=/^\d+\/\d+$/,R1=new Set(["px","full","screen"]),M1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,O1=/\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$/,T1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,L1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,D1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hn=r=>ls(r)||R1.has(r)||P1.test(r),zn=r=>Es(r,"length",V1),ls=r=>!!r&&!Number.isNaN(Number(r)),Su=r=>Es(r,"number",ls),pi=r=>!!r&&Number.isInteger(Number(r)),A1=r=>r.endsWith("%")&&ls(r.slice(0,-1)),be=r=>gm.test(r),Fn=r=>M1.test(r),z1=new Set(["length","size","percentage"]),F1=r=>Es(r,z1,vm),I1=r=>Es(r,"position",vm),U1=new Set(["image","url"]),$1=r=>Es(r,U1,W1),B1=r=>Es(r,"",H1),mi=()=>!0,Es=(r,s,o)=>{const a=gm.exec(r);return a?a[1]?typeof s=="string"?a[1]===s:s.has(a[1]):o(a[2]):!1},V1=r=>O1.test(r)&&!T1.test(r),vm=()=>!1,H1=r=>L1.test(r),W1=r=>D1.test(r),Q1=()=>{const r=Ue("colors"),s=Ue("spacing"),o=Ue("blur"),a=Ue("brightness"),u=Ue("borderColor"),f=Ue("borderRadius"),m=Ue("borderSpacing"),h=Ue("borderWidth"),y=Ue("contrast"),k=Ue("grayscale"),w=Ue("hueRotate"),x=Ue("invert"),P=Ue("gap"),_=Ue("gradientColorStops"),D=Ue("gradientColorStopPositions"),b=Ue("inset"),R=Ue("margin"),A=Ue("opacity"),I=Ue("padding"),V=Ue("saturate"),z=Ue("scale"),K=Ue("sepia"),G=Ue("skew"),ue=Ue("space"),oe=Ue("translate"),ee=()=>["auto","contain","none"],me=()=>["auto","hidden","clip","visible","scroll"],ke=()=>["auto",be,s],le=()=>[be,s],Le=()=>["",hn,zn],Z=()=>["auto",ls,be],ce=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ce=()=>["solid","dashed","dotted","double","none"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",be],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>[ls,be];return{cacheSize:500,separator:":",theme:{colors:[mi],spacing:[hn,zn],blur:["none","",Fn,be],brightness:C(),borderColor:[r],borderRadius:["none","","full",Fn,be],borderSpacing:le(),borderWidth:Le(),contrast:C(),grayscale:ne(),hueRotate:C(),invert:ne(),gap:le(),gradientColorStops:[r],gradientColorStopPositions:[A1,zn],inset:ke(),margin:ke(),opacity:C(),padding:le(),saturate:C(),scale:C(),sepia:ne(),skew:C(),space:le(),translate:le()},classGroups:{aspect:[{aspect:["auto","square","video",be]}],container:["container"],columns:[{columns:[Fn]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"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:[...ce(),be]}],overflow:[{overflow:me()}],"overflow-x":[{"overflow-x":me()}],"overflow-y":[{"overflow-y":me()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",pi,be]}],basis:[{basis:ke()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",be]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",pi,be]}],"grid-cols":[{"grid-cols":[mi]}],"col-start-end":[{col:["auto",{span:["full",pi,be]},be]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[mi]}],"row-start-end":[{row:["auto",{span:[pi,be]},be]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",be]}],gap:[{gap:[P]}],"gap-x":[{"gap-x":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[I]}],px:[{px:[I]}],py:[{py:[I]}],ps:[{ps:[I]}],pe:[{pe:[I]}],pt:[{pt:[I]}],pr:[{pr:[I]}],pb:[{pb:[I]}],pl:[{pl:[I]}],m:[{m:[R]}],mx:[{mx:[R]}],my:[{my:[R]}],ms:[{ms:[R]}],me:[{me:[R]}],mt:[{mt:[R]}],mr:[{mr:[R]}],mb:[{mb:[R]}],ml:[{ml:[R]}],"space-x":[{"space-x":[ue]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ue]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",be,s]}],"min-w":[{"min-w":[be,s,"min","max","fit"]}],"max-w":[{"max-w":[be,s,"none","full","min","max","fit","prose",{screen:[Fn]},Fn]}],h:[{h:[be,s,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[be,s,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[be,s,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[be,s,"auto","min","max","fit"]}],"font-size":[{text:["base",Fn,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Su]}],"font-family":[{font:[mi]}],"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",be]}],"line-clamp":[{"line-clamp":["none",ls,Su]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hn,be]}],"list-image":[{"list-image":["none",be]}],"list-style-type":[{list:["none","disc","decimal",be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hn,zn]}],"underline-offset":[{"underline-offset":["auto",hn,be]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:le()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be]}],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",be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ce(),I1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",F1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$1]}],"bg-color":[{bg:[r]}],"gradient-from-pos":[{from:[D]}],"gradient-via-pos":[{via:[D]}],"gradient-to-pos":[{to:[D]}],"gradient-from":[{from:[_]}],"gradient-via":[{via:[_]}],"gradient-to":[{to:[_]}],rounded:[{rounded:[f]}],"rounded-s":[{"rounded-s":[f]}],"rounded-e":[{"rounded-e":[f]}],"rounded-t":[{"rounded-t":[f]}],"rounded-r":[{"rounded-r":[f]}],"rounded-b":[{"rounded-b":[f]}],"rounded-l":[{"rounded-l":[f]}],"rounded-ss":[{"rounded-ss":[f]}],"rounded-se":[{"rounded-se":[f]}],"rounded-ee":[{"rounded-ee":[f]}],"rounded-es":[{"rounded-es":[f]}],"rounded-tl":[{"rounded-tl":[f]}],"rounded-tr":[{"rounded-tr":[f]}],"rounded-br":[{"rounded-br":[f]}],"rounded-bl":[{"rounded-bl":[f]}],"border-w":[{border:[h]}],"border-w-x":[{"border-x":[h]}],"border-w-y":[{"border-y":[h]}],"border-w-s":[{"border-s":[h]}],"border-w-e":[{"border-e":[h]}],"border-w-t":[{"border-t":[h]}],"border-w-r":[{"border-r":[h]}],"border-w-b":[{"border-b":[h]}],"border-w-l":[{"border-l":[h]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...Ce(),"hidden"]}],"divide-x":[{"divide-x":[h]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[h]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:Ce()}],"border-color":[{border:[u]}],"border-color-x":[{"border-x":[u]}],"border-color-y":[{"border-y":[u]}],"border-color-s":[{"border-s":[u]}],"border-color-e":[{"border-e":[u]}],"border-color-t":[{"border-t":[u]}],"border-color-r":[{"border-r":[u]}],"border-color-b":[{"border-b":[u]}],"border-color-l":[{"border-l":[u]}],"divide-color":[{divide:[u]}],"outline-style":[{outline:["",...Ce()]}],"outline-offset":[{"outline-offset":[hn,be]}],"outline-w":[{outline:[hn,zn]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:Le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[hn,zn]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",Fn,B1]}],"shadow-color":[{shadow:[mi]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ne()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[y]}],"drop-shadow":[{"drop-shadow":["","none",Fn,be]}],grayscale:[{grayscale:[k]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[x]}],saturate:[{saturate:[V]}],sepia:[{sepia:[K]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[y]}],"backdrop-grayscale":[{"backdrop-grayscale":[k]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[V]}],"backdrop-sepia":[{"backdrop-sepia":[K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",be]}],duration:[{duration:C()}],ease:[{ease:["linear","in","out","in-out",be]}],delay:[{delay:C()}],animate:[{animate:["none","spin","ping","pulse","bounce",be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[pi,be]}],"translate-x":[{"translate-x":[oe]}],"translate-y":[{"translate-y":[oe]}],"skew-x":[{"skew-x":[G]}],"skew-y":[{"skew-y":[G]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",be]}],accent:[{accent:["auto",r]}],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",be]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":le()}],"scroll-mx":[{"scroll-mx":le()}],"scroll-my":[{"scroll-my":le()}],"scroll-ms":[{"scroll-ms":le()}],"scroll-me":[{"scroll-me":le()}],"scroll-mt":[{"scroll-mt":le()}],"scroll-mr":[{"scroll-mr":le()}],"scroll-mb":[{"scroll-mb":le()}],"scroll-ml":[{"scroll-ml":le()}],"scroll-p":[{"scroll-p":le()}],"scroll-px":[{"scroll-px":le()}],"scroll-py":[{"scroll-py":le()}],"scroll-ps":[{"scroll-ps":le()}],"scroll-pe":[{"scroll-pe":le()}],"scroll-pt":[{"scroll-pt":le()}],"scroll-pr":[{"scroll-pr":le()}],"scroll-pb":[{"scroll-pb":le()}],"scroll-pl":[{"scroll-pl":le()}],"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",be]}],fill:[{fill:[r,"none"]}],"stroke-w":[{stroke:[hn,zn,Su]}],stroke:[{stroke:[r,"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"]}}},K1=_1(Q1);function Ee(...r){return K1(m1(r))}function tk(r){return r?r.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function q1(){const r=p1();return d.jsxs("div",{className:"flex items-center rounded-md border border-border/40 bg-background/40 p-0.5",role:"group","aria-label":"Ansichtsmodus",title:"Einfach zeigt nur das Wichtigste. Experte zeigt alle technischen Details.",children:[d.jsxs("button",{onClick:()=>Qh(!1),"aria-pressed":!r,className:Ee("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",r?"text-muted-foreground hover:text-foreground":"bg-primary/15 text-primary shadow-sm"),children:[d.jsx(e0,{className:"h-3.5 w-3.5"})," Einfach"]}),d.jsxs("button",{onClick:()=>Qh(!0),"aria-pressed":r,className:Ee("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",r?"bg-primary/15 text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),children:[d.jsx(Jy,{className:"h-3.5 w-3.5"})," Experte"]})]})}class G1 extends Error{constructor(o,a,u){super(u||`${o} ${a}`);Qo(this,"status");Qo(this,"detail");this.name="ApiError",this.status=o,this.detail=u}}async function Z1(r){try{const s=await r.text();if(!s)return null;try{const o=JSON.parse(s),a=(o==null?void 0:o.detail)??(o==null?void 0:o.err)??(o==null?void 0:o.message);return typeof a=="string"&&a.trim()?a.trim():Array.isArray(a)&&a.length&&a.map(u=>u==null?void 0:u.msg).filter(Boolean).join("; ")||null}catch{return s.slice(0,200).split(` `)[0].trim()||null}}catch{return null}}async function Se(r,s){const o=await fetch(r,{...s,headers:{"Content-Type":"application/json",...s==null?void 0:s.headers}});if(!o.ok)throw new G1(o.status,o.statusText,await Z1(o));return o.json()}const nk=(r,s,o=!1,a=!0)=>Se("/api/groups",{method:"PUT",body:JSON.stringify({group:r,members:s,swap:o,persist:a})}),rk=r=>Se("/api/routing/policy",{method:"PUT",body:JSON.stringify(r)});function Y1({type:r,title:s,message:o,defaultValue:a,autoValue:u,autoLabel:f,onConfirm:m,onCancel:h}){const y=g.useRef(null);return d.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":s,children:d.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:[d.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:s}),d.jsx("button",{onClick:h||(()=>m()),"aria-label":"Schließen",className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:d.jsx(dl,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsx("p",{className:"max-h-72 overflow-y-auto whitespace-pre-line text-xs text-muted-foreground leading-relaxed scrollbar-thin",children:o}),r==="prompt"&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{ref:y,type:"text",defaultValue:a,"aria-label":s,className:"flex-1 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:k=>{var w;k.key==="Enter"&&m((w=y.current)==null?void 0:w.value)}}),u!==void 0&&d.jsx("button",{type:"button",onClick:()=>{y.current&&(y.current.value=u)},title:"Setup-bewussten Optimalwert eintragen",className:"h-9 px-3 shrink-0 text-xs font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg transition-colors cursor-pointer",children:f||"Auto"})]}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(r==="confirm"||r==="prompt")&&d.jsx("button",{onClick:h,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"}),d.jsx("button",{onClick:()=>{var w;const k=r==="prompt"?(w=y.current)==null?void 0:w.value:void 0;m(k)},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:r==="confirm"?"Ja, fortfahren":r==="prompt"?"Übernehmen":"OK"})]})]})})}function ym(){const[r,s]=g.useState(null),o=g.useCallback(()=>s(null),[]),a=g.useCallback((h,y,k)=>{s({type:"alert",title:h,message:y,onConfirm:()=>{s(null),k==null||k()}})},[]),u=g.useCallback((h,y,k,w)=>{s({type:"confirm",title:h,message:y,onConfirm:()=>{s(null),k()},onCancel:()=>{s(null),w==null||w()}})},[]),f=g.useCallback((h,y,k,w,x,P)=>{s({type:"prompt",title:h,message:y,defaultValue:k,autoValue:P==null?void 0:P.autoValue,autoLabel:P==null?void 0:P.autoLabel,onConfirm:_=>{s(null),w(_)},onCancel:()=>{s(null),x==null||x()}})},[]),m=r?d.jsx(Y1,{...r}):null;return{showAlert:a,showConfirm:u,showPrompt:f,close:o,dialogElement:m}}let il=!1;const X1=()=>il;function J1(){const r=ul();g.useEffect(()=>{const s=new EventSource("/api/events");return s.onopen=()=>{il=!0},s.onerror=()=>{il=!1},s.addEventListener("invalidate",o=>{var a;try{const u=((a=JSON.parse(o.data))==null?void 0:a.keys)??[];for(const f of u)r.invalidateQueries({queryKey:[f]})}catch{}}),()=>{il=!1,s.close()}},[r])}const Pe={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],groups:["groups"],routing:["routing"],routingPolicy:["routing-policy"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],hermesBrain:["hermes-brain"],updates:["updates"],discover:["discover"],drafts:r=>["drafts",r??""],connect:r=>["connect",r??""],connectHealth:["connect-health"],memoryGraph:["memory-graph"],voiceTrace:["voice-trace"],auftragsbuch:["auftragsbuch"],ideen:["ideen"],chronik:["chronik"],wissen:["wissen"],zeitmaschine:["zeitmaschine"],reminders:["reminders"]},St={graph:3e3,schnell:8e3,normal:1e4,gemuetlich:3e4,traege:6e4},gl=r=>()=>X1()?r*5:r,ew=(r=St.schnell)=>Be({queryKey:Pe.auftragsbuch,queryFn:()=>Se("/api/auftragsbuch"),refetchInterval:gl(r)}),tw=(r=St.gemuetlich)=>Be({queryKey:Pe.ideen,queryFn:()=>Se("/api/ideen"),refetchInterval:gl(r)}),sk=(r,s=!1)=>Be({queryKey:["ideen-log",r],queryFn:()=>Se(`/api/ideen/${r}/log`),enabled:s,refetchInterval:4e3,staleTime:0}),ik=(r=150,s=St.gemuetlich)=>Be({queryKey:[...Pe.chronik,r],queryFn:()=>Se(`/api/chronik?limit=${r}`),refetchInterval:gl(s),select:o=>o.items??[]}),ok=()=>Be({queryKey:Pe.wissen,queryFn:()=>Se("/api/wissen")}),nw=(r=St.traege,s=!0)=>Be({queryKey:Pe.zeitmaschine,queryFn:()=>Se("/api/zeitmaschine"),refetchInterval:r,enabled:s}),rw=(r=12,s=St.schnell)=>Be({queryKey:Pe.voiceTrace,queryFn:()=>Se(`/api/voice/trace?limit=${r}`),refetchInterval:s,select:o=>o.turns??[]}),lk=(r=!0)=>Be({queryKey:Pe.memoryGraph,queryFn:()=>Se("/api/wissen/graph"),enabled:r,staleTime:60*1e3}),xm=()=>Be({queryKey:Pe.health,queryFn:()=>Se("/api/health"),refetchInterval:St.normal}),vl=(r=St.graph)=>Be({queryKey:Pe.systemStatus,queryFn:()=>Se("/api/system/status"),refetchInterval:r}),wm=(r,s=!0)=>Be({queryKey:["metrics-history",r],queryFn:()=>Se(`/api/system/history?minutes=${r}`),enabled:s,refetchInterval:6e4}),hc=(r=St.normal)=>Be({queryKey:Pe.services,queryFn:()=>Se("/api/system/services"),refetchInterval:r}),km=(r=St.schnell)=>Be({queryKey:Pe.models,queryFn:()=>Se("/api/models"),refetchInterval:gl(r)}),ak=(r=St.normal)=>Be({queryKey:Pe.groups,queryFn:()=>Se("/api/groups"),refetchInterval:r}),uk=()=>Be({queryKey:Pe.routingPolicy,queryFn:()=>Se("/api/routing/policy")}),sw=(r=3e3,s=!0)=>Be({queryKey:Pe.jobs,queryFn:()=>Se("/api/jobs"),refetchInterval:r,enabled:s,select:o=>o.jobs??[]}),bm=(r=St.graph)=>Be({queryKey:Pe.tokenStats,queryFn:()=>Se("/api/system/token-stats"),refetchInterval:r}),iw=(r=St.normal)=>Be({queryKey:Pe.agentStatus,queryFn:()=>Se("/api/agent/status"),refetchInterval:r}),ck=(r=St.traege)=>Be({queryKey:Pe.hermesBrain,queryFn:()=>Se("/api/agent/brain"),refetchInterval:r}),Sm=(r=St.traege)=>Be({queryKey:Pe.updates,queryFn:()=>Se("/api/maintenance/updates"),refetchInterval:r}),dk=()=>Be({queryKey:Pe.discover,queryFn:()=>Se("/api/discover")}),fk=r=>Be({queryKey:Pe.drafts(r),queryFn:()=>Se(`/api/models/drafts?target=${encodeURIComponent(r??"")}`),enabled:!!r}),hk=r=>Be({queryKey:Pe.connect(r),queryFn:()=>Se(r?`/api/connect?${r}`:"/api/connect")}),ow=()=>Be({queryKey:Pe.connectHealth,queryFn:()=>Se("/api/connect/health"),refetchInterval:15e3});function gi(r,...s){for(const o of s)r.invalidateQueries({queryKey:o})}function ts(r){return(r/1024**3).toFixed(1)}function Eu(r){return r?r>1024**3?`${(r/1024**3).toFixed(1)} GB`:`${(r/1024**2).toFixed(0)} MB`:""}function pk(r){if(!r)return"—";const s=r/1024**3;return s>=1?`${s.toFixed(1)} GB`:`${(r/1024**2).toFixed(0)} MB`}function mk(r){if(!r)return"";const s=Math.floor(r/60);return s>0?`${s} min`:`${r} s`}function gk(r){return r?`${Math.round(r/1024)}k`:"—"}function vk(r){return r?new Date(r*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}function vi({icon:r,iconClass:s,name:o,status:a,available:u,busy:f,actionLabel:m,onAction:h}){return d.jsxs("div",{className:Ee("flex items-center gap-3 rounded-lg border px-3 py-2",u?"border-amber-500/30 bg-amber-500/5":"border-border/50 bg-background/20"),children:[d.jsx(r,{className:Ee("h-4 w-4 shrink-0",s)}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-xs text-foreground truncate",children:o}),d.jsx("div",{className:Ee("text-[10px] truncate",u?"text-amber-400/90":"text-muted-foreground"),children:a})]}),d.jsx("button",{onClick:h,disabled:!u||f,className:Ee("text-[11px] font-semibold rounded-lg px-2.5 py-1 transition-colors shrink-0",u?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer":"border border-border/50 text-muted-foreground/40 cursor-default"),children:f?"…":m})]})}function lw({label:r,ok:s,system:o,busy:a,onRestart:u,onLogs:f}){return d.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border/50 bg-background/20 px-3 py-2",children:[d.jsx("span",{className:Ee("w-1.5 h-1.5 rounded-full shrink-0",s===!0?"bg-emerald-500":s===!1?"bg-red-500":"bg-muted-foreground/40")}),d.jsxs("span",{className:"flex-1 text-xs text-foreground truncate",children:[r,o&&d.jsx("span",{className:"text-[9px] text-muted-foreground",children:" (root)"})]}),d.jsx("button",{onClick:u,disabled:a,title:"Neu starten",className:"text-muted-foreground hover:text-primary transition-colors disabled:opacity-50",children:d.jsx(ss,{className:Ee("h-3.5 w-3.5",a&&"animate-spin")})}),d.jsx("button",{onClick:f,title:"Logs ansehen",className:"text-muted-foreground hover:text-primary transition-colors",children:d.jsx(Iy,{className:"h-3.5 w-3.5"})})]})}const aw=/\b(error|fehler|fail(ed|ure)?|fatal|critical|crit|panic|traceback|exception|denied|refused|unable|emerg|alert|oom|killed)\b/i,uw=/\b(warn(ing)?|deprecat\w*|retry(ing)?|timeout|timed out|degraded|missing|not found|nicht gefunden)\b/i;function cw(r){return aw.test(r)?"error":uw.test(r)?"warn":"info"}const dw={error:"text-red-400",warn:"text-amber-300",info:"text-cyan-300/80"};function fw({service:r,text:s,loading:o,logStatus:a,onRefresh:u,onOpenSettings:f}){const[m,h]=g.useState(!1),[y,k]=g.useState(""),w=g.useRef(null),x=g.useMemo(()=>s?s.split(` `).map(R=>({t:R,level:cw(R)})):[],[s]),P=g.useMemo(()=>x.filter(R=>R.level!=="info").length,[x]),_=y.trim().toLowerCase(),D=x.filter(R=>(!m||R.level!=="info")&&(!_||R.t.toLowerCase().includes(_))),b=a==="password_required"||a==="incorrect_password";return d.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:[d.jsxs("div",{className:"flex h-10 items-center justify-between gap-2 px-3 border-b border-border/40 bg-black/30 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground shrink-0",children:[d.jsx(n0,{className:"h-3 w-3 text-primary"}),d.jsx("span",{className:"hidden sm:inline",children:"stdout/stderr —"})," ",r]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsxs("div",{className:"relative",children:[d.jsx(Xy,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{value:y,onChange:R=>k(R.target.value),placeholder:"filtern…",className:"h-7 w-24 sm:w-36 rounded-md border border-border/50 bg-background/40 pl-6 pr-2 text-[10px] text-foreground outline-none focus:border-primary/50"})]}),d.jsxs("button",{onClick:()=>h(R=>!R),title:"Nur Fehler und Warnungen zeigen",className:Ee("flex h-7 items-center gap-1 rounded-md border px-2 text-[10px] font-semibold transition-colors",m?"border-amber-500/50 bg-amber-500/15 text-amber-300":"border-border/50 bg-background/20 text-muted-foreground hover:text-foreground"),children:[d.jsx(Ci,{className:"h-3 w-3"}),"Nur Probleme",P>0?` (${P})`:""]}),d.jsx("button",{onClick:u,disabled:o,title:"Neu laden",className:"flex h-7 w-7 items-center justify-center rounded-md border border-border/50 bg-background/20 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:d.jsx(ss,{className:Ee("h-3 w-3",o&&"animate-spin")})})]})]}),d.jsx("div",{ref:w,className:"flex-1 overflow-y-auto p-3 text-[10px] font-mono leading-relaxed scrollbar-thin select-text",children:b?d.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-3 p-6 text-center",children:[d.jsx(Ci,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),d.jsx("div",{className:"text-xs font-semibold text-amber-300",children:a==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),d.jsxs("p",{className:"max-w-xs text-[10px] leading-normal text-muted-foreground",children:["Für das Auslesen der systemd-Logs von ",r," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),d.jsx("button",{onClick:f,className:"mt-2 rounded-md bg-primary px-3 py-1.5 text-[10px] font-semibold text-primary-foreground transition-colors hover:bg-primary/95",children:"Sudo-Passwort eintragen"})]}):o&&!s?d.jsx("span",{className:"text-muted-foreground",children:"Lade Logs…"}):x.length===0?d.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."}):D.length===0?d.jsx("span",{className:"text-muted-foreground",children:m?"Keine Fehler oder Warnungen — der Dienst läuft sauber. ✓":"Kein Treffer für den Filter."}):D.map((R,A)=>d.jsx("div",{className:Ee("whitespace-pre-wrap",dw[R.level]),children:R.t||" "},A))})]})}function hw({open:r,showAlert:s}){const[o,a]=g.useState(null),[u,f]=g.useState(""),[m,h]=g.useState(!1),[y,k]=g.useState(!1),[w,x]=g.useState(!1);async function P(){k(!0);try{a(await Se("/api/maintenance/geheimnisse"))}catch(D){s("Nicht erreichbar",`Der Geheimnis-Zustand konnte nicht geladen werden: ${(D==null?void 0:D.message)||D}`)}finally{k(!1)}}g.useEffect(()=>{r&&(f(""),h(!1),P())},[r]);async function _(D){x(!0);try{const b=await Se("/api/maintenance/geheimnisse",{method:"POST",body:JSON.stringify({schluessel:"hf_token",wert:D})});a(b),f(""),s(D?"Gespeichert":"Gelöscht",D?"Der Token liegt jetzt auf der Box — der Browser behält ihn nicht.":"Der Token wurde von der Box entfernt.")}catch(b){s("Fehlgeschlagen",(b==null?void 0:b.message)||String(b))}finally{x(!1)}}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),d.jsx("p",{className:"text-[10px] leading-normal text-muted-foreground",children:"Geheimnisse liegen auf der Box (Datei mit Rechten 0600), nicht im Browser. Diese Seite zeigt nur, ob etwas gesetzt ist — den Wert bekommt sie nie zurück."})]}),d.jsxs("div",{className:"mc-card-sm space-y-1.5 p-3",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold",children:[d.jsx(Cp,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Box-Sudo-Passwort — nicht mehr nötig"]}),d.jsxs("p",{className:"text-[10px] leading-normal text-muted-foreground",children:["Systemdienste, OS-Update und Neustart laufen passwortlos (",d.jsx("code",{className:"font-mono text-primary",children:"NOPASSWD"})," in",d.jsx("code",{className:"font-mono",children:" /etc/sudoers"}),"). Das frühere Feld hat nie etwas bewirkt und lag dabei im Browser-Speicher — es ist am 28.08.2026 ersatzlos entfallen. Verlangt ",d.jsx("code",{className:"font-mono",children:"sudo"})," auf der Box je doch ein Passwort, sagt die Wartung das im Klartext; das ist dann dort zu lösen."]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"hf-token",className:"flex items-center gap-1.5 text-xs font-semibold",children:[d.jsx(Wy,{className:"h-4 w-4 text-violet-400","aria-hidden":"true"}),"HuggingFace-Token"]}),d.jsx("div",{className:"flex items-center gap-2 text-[11px]",children:y?d.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[d.jsx(ji,{className:"h-3 w-3 animate-spin","aria-hidden":"true"})," Zustand wird geladen …"]}):o!=null&&o.hf_token_gesetzt?d.jsxs("span",{className:"flex items-center gap-1.5 font-semibold text-emerald-400",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500","aria-hidden":"true"}),"Gesetzt",o.hf_token_aus_env?" (aus der Dienst-Umgebung)":""]}):d.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/50","aria-hidden":"true"}),"Nicht gesetzt"]})}),(o==null?void 0:o.hf_token_aus_env)&&d.jsxs("p",{className:"text-[9px] leading-normal text-amber-400/90",children:["Der Token kommt aus der Umgebung des Dienstes und hat Vorrang. Hier gespeicherte Werte bleiben wirkungslos, solange ",d.jsx("code",{className:"font-mono",children:"HF_TOKEN"})," gesetzt ist."]}),o&&!o.schreibbar&&d.jsx("p",{className:"text-[9px] leading-normal text-amber-400/90",children:"Die Ablage ist nicht beschreibbar — auf einem Entwicklungsrechner ohne den Modell-Ordner der Box ist das normal. Speichern würde hier ins Leere laufen."}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{id:"hf-token",type:m?"text":"password",value:u,onChange:D=>f(D.target.value),autoComplete:"off",spellCheck:!1,placeholder:o!=null&&o.hf_token_gesetzt?"Neuen Token eingeben, um zu ersetzen":"hf_…",className:"h-10 w-full rounded-lg border border-border/60 bg-background/40 pl-3 pr-10 text-xs text-foreground outline-none transition-colors focus:border-primary"}),d.jsx("button",{type:"button",onClick:()=>h(!m),"aria-label":m?"Token verbergen":"Token anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors hover:text-foreground",children:m?d.jsx(Fy,{className:"h-4 w-4","aria-hidden":"true"}):d.jsx(jp,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsxs("p",{className:"text-[9px] leading-normal text-muted-foreground",children:["Nötig für Modelle mit Zugangsschranke. Wird beim Download als",d.jsx("code",{className:"font-mono",children:" HF_TOKEN"})," an den Job gereicht und verlässt die Box nicht."]})]}),d.jsxs("div",{className:"flex gap-3 pt-2",children:[d.jsxs("button",{onClick:()=>_(u.trim()),disabled:w||!u.trim(),className:"flex h-9 flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-primary text-xs font-semibold text-primary-foreground shadow shadow-primary/10 transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-40",children:[w&&d.jsx(ji,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),"Auf der Box speichern"]}),d.jsx("button",{onClick:()=>_(null),disabled:w||!(o!=null&&o.hf_token_gesetzt),className:"flex h-9 cursor-pointer items-center justify-center rounded-lg border border-border/60 bg-background/20 px-4 text-xs font-semibold text-muted-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40",children:"Löschen"})]})]})}function pw({detail:r,maintenanceJob:s,onClose:o,onApply:a}){var y,k;const u=r.data,f={os:{icon:_p,cls:"text-cyan-400",title:"OS-Pakete (apt)"},engine:{icon:cl,cls:"text-violet-400",title:"Inferenz-Engine (llama.cpp)"},swap:{icon:Pp,cls:"text-fuchsia-400",title:"Router (llama-swap)"},hermes:{icon:Ni,cls:"text-amber-400",title:"Hermes-Agent"}}[r.kind],m=f.icon,h=u?r.kind==="os"?(u.count??0)===0:r.kind==="hermes"?(u.behind??0)===0:u.installed_build!=null&&u.latest_build!=null&&u.latest_build<=u.installed_build:!0;return d.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:[d.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:o}),d.jsxs("div",{className:"relative w-full max-w-lg max-h-[80vh] flex flex-col rounded-2xl border border-border/60 bg-card shadow-2xl font-sans text-foreground",children:[d.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(m,{className:Ee("h-4.5 w-4.5",f.cls)}),d.jsx("h3",{className:"text-sm font-semibold",children:f.title})]}),d.jsx("button",{onClick:o,className:"flex h-7 w-7 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:d.jsx(dl,{className:"h-4 w-4"})})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-xs space-y-3 scrollbar-thin",children:r.loading?d.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 text-muted-foreground",children:[d.jsx(ss,{className:"h-4 w-4 animate-spin"})," Details werden geladen…"]}):u!=null&&u.error?d.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-red-400",children:u.error}):d.jsxs(d.Fragment,{children:[(u==null?void 0:u.action_needed)!=null&&d.jsxs("div",{className:Ee("flex items-start gap-2 rounded-lg border p-3",u.action_needed?"border-amber-500/40 bg-amber-500/10":"border-emerald-500/40 bg-emerald-500/10"),children:[u.action_needed?d.jsx(Ci,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5"}):d.jsx(Ty,{className:"h-4 w-4 text-emerald-400 shrink-0 mt-0.5"}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:Ee("text-xs font-semibold",u.action_needed?"text-amber-300":"text-emerald-300"),children:["Musst du etwas tun? ",u.action_needed?"Ja":"Nein — die Box regelt das (Fangnetz)"]}),u.action_needed&&u.action_text&&d.jsx("div",{className:"mt-0.5 text-[11px] text-foreground/90",children:u.action_text})]})]}),(u==null?void 0:u.summary)&&d.jsxs("div",{className:"rounded-lg border border-primary/25 bg-primary/5 p-3 space-y-1",children:[d.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary",children:"Was dieses Update bedeutet (Zusammenfassung der Box)"}),d.jsx("pre",{className:"whitespace-pre-wrap text-[11px] leading-relaxed text-foreground/90 font-sans",children:u.summary})]}),r.kind==="os"?d.jsxs(d.Fragment,{children:[((u==null?void 0:u.count)??0)===0?d.jsx("div",{className:"text-muted-foreground",children:"Keine Pakete zu aktualisieren — System ist aktuell."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"text-muted-foreground",children:[u.count," Paket(e) werden aktualisiert:"]}),d.jsx("div",{className:"space-y-1",children:u.packages.map(w=>d.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[d.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[d.jsx(Ch,{className:"h-3 w-3 text-cyan-400 shrink-0"}),w.name]}),d.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-muted-foreground shrink-0",children:[d.jsx("span",{children:w.current}),d.jsx(jh,{className:"h-3 w-3"}),d.jsx("span",{className:"text-emerald-400",children:w.candidate})]})]},w.name))})]}),(((y=u==null?void 0:u.held_back)==null?void 0:y.length)??0)>0&&d.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/40 bg-background/20 p-3",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground",children:[d.jsx(Ly,{className:"h-3.5 w-3.5"})," Vom Hersteller zurückgestellt — kein Handeln nötig"]}),d.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Pakete gäbe es bereits, Ubuntu spielt sie aber gestaffelt aus (Phasen-Rollout) bzw. hält sie kurz zurück. Sie kommen bei einem der nächsten automatischen Läufe von selbst — das ist kein Fehler und nichts hängt fest."}),d.jsx("div",{className:"space-y-1",children:u.held_back.map(w=>d.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/30 bg-background/30 px-2.5 py-1.5",children:[d.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[d.jsx(Ch,{className:"h-3 w-3 text-muted-foreground shrink-0"}),w.name]}),d.jsx("span",{className:"text-[9px] text-muted-foreground shrink-0",children:w.reason==="phasing"?"Phasen-Rollout":"vorerst zurückgehalten"})]},w.name))})]})]}):r.kind==="engine"||r.kind==="swap"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[d.jsxs("span",{className:"rounded-md border border-border/40 bg-background/30 px-2 py-1",children:["Build ",(u==null?void 0:u.installed_build)??"?"]}),d.jsx(jh,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsxs("span",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/5 px-2 py-1 text-emerald-400",children:["Build ",(u==null?void 0:u.latest_build)??"?"]})]}),((u==null?void 0:u.name)||(u==null?void 0:u.latest_tag))&&d.jsxs("div",{className:"text-muted-foreground",children:["Release: ",d.jsx("span",{className:"text-foreground",children:u==null?void 0:u.name}),u!=null&&u.latest_tag?` (${u.latest_tag})`:""]}),(u==null?void 0:u.url)&&d.jsxs("a",{href:u.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Original-Release-Notes auf GitHub ",d.jsx(zy,{className:"h-3 w-3"})]}),(u==null?void 0:u.body)&&d.jsxs("details",{className:"group",children:[d.jsx("summary",{className:"cursor-pointer text-[10px] text-muted-foreground hover:text-foreground",children:"Original-Notizen (englisch) anzeigen"}),d.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap rounded-lg border border-border/40 bg-background/30 p-3 text-[10px] leading-relaxed text-muted-foreground max-h-60 overflow-y-auto scrollbar-thin",children:u.body})]})]}):(((k=u==null?void 0:u.commits)==null?void 0:k.length)??0)===0?d.jsx("div",{className:"text-muted-foreground",children:"Keine neuen Commits — Hermes-Agent ist bereits aktuell."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"text-muted-foreground",children:[u.behind," neue Commit(s) auf ",d.jsxs("span",{className:"font-mono text-foreground",children:["origin/",u.branch]}),":"]}),d.jsx("div",{className:"space-y-1",children:u.commits.map(w=>d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[d.jsx($y,{className:"h-3.5 w-3.5 text-primary shrink-0 mt-0.5"}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"text-[11px] truncate",children:w.subject}),d.jsxs("div",{className:"font-mono text-[9px] text-muted-foreground",children:[w.hash," · ",w.when]})]})]},w.hash))})]}),r.kind!=="os"&&!h&&d.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background/20 p-2.5",children:[d.jsx(Cp,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0 mt-0.5"}),d.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Vor dem Update sichert die Box automatisch den alten Stand. Danach prüft sie den ganzen Stack per echter Anfrage — läuft etwas nicht, rollt sie von selbst zurück",r.kind==="hermes"?" und startet den Gateway neu":"","."]})]})]})}),d.jsxs("div",{className:"flex gap-3 border-t border-border/40 p-4 shrink-0",children:[d.jsx("button",{onClick:o,className:"h-9 flex-1 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold text-muted-foreground hover:bg-accent transition-colors cursor-pointer",children:"Schließen"}),d.jsx("button",{onClick:a,disabled:r.loading||h||!!s,title:s?`Update läuft bereits: ${s.label}`:void 0,className:"h-9 flex-1 rounded-lg bg-primary text-xs font-semibold text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-40 disabled:cursor-default",children:s?"Update läuft…":"Jetzt aktualisieren"})]})]})]})}function mw({open:r,onClose:s,defaultTab:o="maintenance"}){var jr,Cs;const a=ul(),{showAlert:u,showConfirm:f,dialogElement:m}=ym(),{data:h}=Sm(),{data:y}=hc(),k=sw(3e3,r).data??[],{data:w}=nw(void 0,r),[x,P]=g.useState("llama-swap"),[_,D]=g.useState(""),[b,R]=g.useState(!1),[A,I]=g.useState(null),[V,z]=g.useState({}),[K,G]=g.useState("maintenance"),[ue,oe]=g.useState(!1),[ee,me]=g.useState(""),[ke,le]=g.useState(!1),[Le,Z]=g.useState(!1),[ce,Ce]=g.useState(null),Ne=(y==null?void 0:y.services)??[],F=()=>gi(a,Pe.jobs);function ne(L){return L?new Date(L*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}g.useEffect(()=>{r&&o&&G(o)},[r,o]),g.useEffect(()=>{r&&gi(a,Pe.updates,Pe.services,Pe.jobs,Pe.zeitmaschine)},[r]);function Q(L){R(!0),I(null),Se(`/api/maintenance/logs?service=${L}&lines=150`).then(xe=>{xe.ok?D(xe.text):(D(`Fehler beim Laden der Logs: ${xe.err||"Unbekannter Fehler"}`),(xe.status==="incorrect_password"||xe.status==="password_required")&&I(xe.status))}).catch(xe=>D(`Fehler: ${xe.message}`)).finally(()=>R(!1))}g.useEffect(()=>{!r||K!=="logs"||Q(x)},[r,K,x]);function C(L){return(L==null?void 0:L.status)==="busy"?(u("Update läuft bereits",`Es läuft gerade „${L.running}". Bitte warte, bis es fertig ist.`),F(),!0):!1}function N(L){return(L==null?void 0:L.status)==="password_required"||(L==null?void 0:L.status)==="incorrect_password"?(u("Box-Passwort nötig",(L.status==="incorrect_password"?"Das gespeicherte Box-Passwort stimmt nicht. ":"Für dieses Update braucht die Box dein Passwort. ")+"Bitte oben im Reiter „Einstellungen“ setzen bzw. korrigieren."),!0):L&&L.ok===!1?(u("Update fehlgeschlagen",L.err||"Unbekannter Fehler."),!0):!1}async function q(L){const xe={os:"os-update",engine:"engine-update",swap:"swap-update"}[L];try{const ze=await Se(`/api/maintenance/${xe}`,{method:"POST"});if(C(ze)||N(ze))return;F(),G("maintenance")}catch(ze){u("Fehler",`Update konnte nicht starten: ${ze.message}`)}}async function Y(){Z(!0);try{const L=await Se("/api/maintenance/hermes-update",{method:"POST"});if(C(L))return;F()}catch(L){u("Fehler",`Hermes-Update fehlgeschlagen: ${L.message}`)}finally{Z(!1)}}async function W(L){Ce({kind:L,loading:!0,data:null});try{const xe=await Se(`/api/maintenance/update-details?kind=${L}`);Ce({kind:L,loading:!1,data:xe})}catch(xe){Ce({kind:L,loading:!1,data:{kind:L,error:xe.message}})}}function se(){const L=ce==null?void 0:ce.kind;Ce(null),L==="os"||L==="engine"||L==="swap"?q(L):L==="hermes"&&Y()}function de(){var xe;const L=[h!=null&&h.engine?"Engine":null,h!=null&&h.swap?"Router":null,(xe=h==null?void 0:h.components)!=null&&xe.some(ze=>ze.update===!0)?"Hermes-Agent":null,h!=null&&h.os?`OS (${h.os} Pakete)`:null].filter(Boolean);f("Alle Updates einspielen?",`Nacheinander in einem Job: ${L.join(" → ")}. Jeder Schritt sichert und prüft sich selbst; schlägt einer fehl, stoppt der Rest. (OS braucht das Box-Passwort aus den Einstellungen — fehlt es, wird OS übersprungen.)`,async()=>{try{const ze=await Se("/api/maintenance/update-all",{method:"POST"});if(C(ze)||N(ze))return;if((ze==null?void 0:ze.status)==="nothing"){u("Nichts zu tun","Es stehen keine Updates aus.");return}F(),G("maintenance")}catch(ze){u("Fehler",`„Alle aktualisieren" konnte nicht starten: ${ze.message}`)}})}async function ye(){oe(!0);try{await Se("/api/maintenance/check-updates",{method:"POST"}),gi(a,Pe.jobs,Pe.updates),G("maintenance")}catch(L){u("Fehler",`Fehler bei der Update-Suche: ${L.message}`)}finally{oe(!1)}}async function we(L,xe){try{await Se("/api/models/install",{method:"POST",body:JSON.stringify({repo:L,role:xe})}),u("Gestartet",`Modell-Upgrade für '${xe}' (${L}) gestartet.`),F(),G("maintenance")}catch(ze){u("Fehler",`Fehler beim Starten des Modell-Upgrades: ${ze.message}`)}}async function Ge(){f("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await Se("/api/maintenance/reboot",{method:"POST"}),u("Reboot","Reboot ausgelöst. System startet neu...",()=>s())}catch(L){u("Fehler",`Fehler beim Reboot: ${L.message}`)}})}async function Sr(){le(!0),me("Snapshot wird erzeugt...");try{const L=await Se("/api/system/backup",{method:"POST"});me(L.ok?`Snapshot erzeugt: ${L.snapshot} (${L.files.length} Komponenten)`:"Backup fehlgeschlagen."),gi(a,Pe.zeitmaschine)}catch(L){me(`Fehler: ${L.message}`)}finally{le(!1)}}async function Ns(L){z(xe=>({...xe,[L]:!0}));try{const xe=await Se("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:L})});xe.ok?(u("Dienst neu gestartet",`Dienst ${L} wurde erfolgreich neu gestartet.`,()=>{K==="logs"&&x===L&&Q(L)}),gi(a,Pe.services,Pe.health,Pe.models)):u("Fehler",`Fehler beim Neustart: ${xe.err||"Unbekannter Fehler"}`)}catch(xe){u("Fehler",`Fehler beim Neustart: ${xe.message}`)}finally{z(xe=>({...xe,[L]:!1}))}}async function Er(L){try{await Se(`/api/jobs/${L}/cancel`,{method:"POST"}),F()}catch(xe){u("Fehler",`Fehler beim Abbrechen: ${xe.message}`)}}const rn=k.find(L=>(L.state==="running"||L.state==="queued")&&L.group==="maintenance"),js=(h?(h.os>0?1:0)+(h.engine?1:0)+(h.swap?1:0):0)+(((jr=h==null?void 0:h.components)==null?void 0:jr.filter(L=>L.update===!0).length)??0),Nr=(w==null?void 0:w.backups)??[];return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Ee("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",r?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:s}),d.jsxs("div",{className:Ee("fixed inset-y-0 right-0 w-full sm:w-[640px] 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",r?"translate-x-0":"translate-x-full"),children:[d.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Np,{className:"h-4.5 w-4.5 text-primary"}),d.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),d.jsx("button",{onClick:s,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:d.jsx(dl,{className:"h-4 w-4"})})]}),d.jsx("div",{className:"flex border-b border-border/40 px-6",children:["maintenance","logs","settings"].map(L=>d.jsx("button",{onClick:()=>G(L),className:Ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",K===L?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:L==="maintenance"?"System-Wartung":L==="logs"?"System-Logs":"Einstellungen"},L))}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[K==="maintenance"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Updates"}),d.jsxs("div",{className:"flex items-center gap-3",children:[js>0&&d.jsxs("button",{onClick:de,disabled:!!rn,className:"flex items-center gap-1 rounded-md border border-primary/40 bg-primary/10 px-2 py-1 text-[10px] font-bold text-primary transition-colors hover:bg-primary/20 disabled:opacity-50",children:[d.jsx(Dy,{className:"h-3 w-3"})," Alle aktualisieren (",js,")"]}),d.jsxs("button",{onClick:ye,disabled:ue||!!rn,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[d.jsx(ss,{className:Ee("h-3 w-3",ue&&"animate-spin")})," Nach Updates suchen"]})]})]}),(h==null?void 0:h.last_check)&&d.jsxs("div",{className:"text-[9px] text-muted-foreground -mt-1",children:["Zuletzt gesucht: ",ne(h.last_check)]}),rn&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-300",children:[d.jsx(ss,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}),d.jsxs("span",{children:["Update läuft: ",d.jsx("span",{className:"font-semibold",children:rn.label})," — bitte warten. Weitere Updates sind solange gesperrt."]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(vi,{icon:_p,iconClass:"text-cyan-400",name:"OS-Pakete (apt)",available:!!(h!=null&&h.os),status:h!=null&&h.os?`${h.os} verfügbar`:"aktuell",actionLabel:"Anzeigen",onAction:()=>W("os")}),d.jsx(vi,{icon:cl,iconClass:"text-violet-400",name:"Inferenz-Engine (llama.cpp)",available:!!(h!=null&&h.engine),status:h!=null&&h.engine?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>W("engine")}),d.jsx(vi,{icon:Pp,iconClass:"text-fuchsia-400",name:"Router (llama-swap)",available:!!(h!=null&&h.swap),status:h!=null&&h.swap?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>W("swap")}),(()=>{var xe;const L=(xe=h==null?void 0:h.components)==null?void 0:xe.find(ze=>ze.key==="hermes_agent");return d.jsx(vi,{icon:Ni,iconClass:"text-amber-400",name:"Hermes-Agent",available:(L==null?void 0:L.update)===!0,busy:Le,status:(L==null?void 0:L.update)===!0?`Update: ${L.latest}`:(L==null?void 0:L.reachable)===!1?"offline":"aktuell",actionLabel:"Anzeigen",onAction:()=>W("hermes")})})(),(Cs=h==null?void 0:h.model_list)==null?void 0:Cs.map(L=>d.jsx(vi,{icon:_y,iconClass:"text-emerald-400",name:`Modell · ${L.role}`,available:!0,status:L.title,actionLabel:"Upgrade",onAction:()=>we(L.repo,L.role)},L.role))]})]}),d.jsxs("div",{className:"space-y-2.5",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Dienste"}),d.jsxs("div",{className:"space-y-1.5",children:[Ne.length===0&&d.jsx("div",{className:"rounded-lg border border-dashed border-border/50 p-4 text-center text-xs text-muted-foreground",children:"Dienste-Liste wird geladen …"}),Ne.map(L=>d.jsx(lw,{label:L.name,system:L.scope==="system",ok:L.ok,busy:V[L.unit],onRestart:()=>Ns(L.unit),onLogs:()=>{P(L.unit),G("logs")}},L.unit))]})]}),d.jsxs("div",{className:"space-y-2.5",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Backup"}),d.jsxs("div",{className:"rounded-lg border border-border/50 bg-background/20 px-3 py-2.5 flex items-center gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-xs text-foreground truncate",children:Nr[0]?`Letztes: ${Nr[0].snapshot}`:"Noch kein Backup"}),d.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[Nr.length," Snapshots · Wiederherstellen: Chronik → Zeitmaschine"]})]}),d.jsxs("button",{onClick:Sr,disabled:ke,className:"flex items-center gap-1.5 text-[11px] font-semibold rounded-lg px-2.5 py-1 bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-50 shrink-0",children:[d.jsx(Ry,{className:Ee("h-3.5 w-3.5",ke&&"animate-pulse")})," Snapshot"]})]}),ee&&d.jsx("div",{className:"text-[10px] font-mono text-primary bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:ee})]}),d.jsxs("div",{className:"space-y-2.5",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-red-400/80",children:"Gefahrenzone"}),d.jsxs("button",{onClick:Ge,className:"flex w-full items-center gap-3 p-3 rounded-lg 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:[d.jsx(Yy,{className:"h-4.5 w-4.5"}),d.jsxs("div",{children:[d.jsx("div",{children:"Host-System neu starten"}),d.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet die ganze Box neu"})]})]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),d.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[k.filter(L=>L.state==="running"||L.state==="queued").length," Aktiv"]})]}),d.jsx("div",{className:"space-y-3",children:k.length===0?d.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."}):k.map(L=>{const xe=L.state==="running"||L.state==="queued";return d.jsxs("div",{className:Ee("p-3 rounded-xl border transition-all duration-300",xe?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[xe&&d.jsxs("span",{className:"flex h-2 w-2 relative",children:[d.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),d.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),L.label]}),d.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[d.jsxs("span",{children:["ID: ",L.id]}),d.jsx("span",{children:"•"}),d.jsx("span",{className:Ee(L.state==="done"&&"text-emerald-400",L.state==="failed"&&"text-red-400",L.state==="running"&&"text-primary",L.state==="queued"&&"text-amber-400",L.state==="canceled"&&"text-muted-foreground"),children:L.state})]})]}),xe&&d.jsx("button",{onClick:()=>Er(L.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"})]}),L.state==="running"&&d.jsxs("div",{className:"mt-3 space-y-1",children:[d.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${L.progress??0}%`}})}),d.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[d.jsxs("span",{children:[L.progress??0,"%"]}),L.done_bytes!=null&&L.total_bytes!=null&&d.jsxs("span",{children:[Eu(L.done_bytes)," / ",Eu(L.total_bytes),L.rate_bps!=null&&` (${Eu(L.rate_bps)}/s)`]}),L.eta_s!=null&&d.jsxs("span",{children:["ETA: ",L.eta_s,"s"]})]})]})]},L.id)})})]})]}),K==="logs"&&d.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("select",{value:x,onChange:L=>P(L.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:Ne.map(L=>d.jsxs("option",{value:L.unit,children:[L.name," (",L.scope==="system"?"systemd-root":"user",")"]},L.unit))}),d.jsxs("button",{onClick:()=>Ns(x),disabled:V[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:[d.jsx(ss,{className:Ee("h-3.5 w-3.5",V[x]&&"animate-spin")}),"Restart"]})]}),d.jsx(fw,{service:x,text:_,loading:b,logStatus:A,onRefresh:()=>Q(x),onOpenSettings:()=>G("settings")})]}),K==="settings"&&d.jsx(hw,{open:r,showAlert:u})]})]}),ce&&d.jsx(pw,{detail:ce,maintenanceJob:rn,onClose:()=>Ce(null),onApply:se}),m]})}let Ku=[],qu=[];const Gu=new Set,Em=()=>Gu.forEach(r=>r());function Nm(r){return Gu.add(r),()=>{Gu.delete(r)}}function gw(r){Ku=[...Ku,r].slice(-40),Em()}function vw(r){qu=[...qu,r].slice(-40),Em()}const yw=()=>g.useSyncExternalStore(Nm,()=>Ku),xw=()=>g.useSyncExternalStore(Nm,()=>qu);function ww(){const{data:r,dataUpdatedAt:s}=vl(),{data:o,dataUpdatedAt:a}=bm(),u=g.useRef(null);g.useEffect(()=>{var f,m,h,y;r&&gw({t:Date.now(),cpu:((f=r.cpu)==null?void 0:f.percent)??0,ram:((m=r.ram)==null?void 0:m.percent)??0,gpu:((h=r.gpu)==null?void 0:h.busy_percent)??null,disk:((y=r.disk)==null?void 0:y.percent)??null})},[s]),g.useEffect(()=>{if(!o)return;const f=Date.now(),m=o.prompt_tokens,h=o.completion_tokens;if(u.current){const y=Math.max((f-u.current.t)/1e3,.001);vw({t:f,prompt:Math.max(0,(m-u.current.p)/y),completion:Math.max(0,(h-u.current.c)/y)})}u.current={p:m,c:h,t:f}},[a])}function kw(){var oe,ee,me,ke,le,Le;const{data:r,isError:s}=xm(),{data:o,isError:a}=hc(),{data:u}=km(),{data:f}=vl(),m=s||a,h=!!r&&!!o,y=Z=>{var ce;return(ce=o==null?void 0:o.services.find(Ce=>Ce.unit===Z))==null?void 0:ce.ok},k=Z=>!!(o!=null&&o.services.some(ce=>ce.unit===Z)),w=r==null?void 0:r.engine_reachable,x=(oe=r==null?void 0:r.brain)==null?void 0:oe.ready,P=((ee=r==null?void 0:r.brain)==null?void 0:ee.model)||((me=u==null?void 0:u.models.find(Z=>Z.role==="hermes"))==null?void 0:me.name)||"",_=[];m&&_.push({id:"mc2",label:"Steuerpult (MC2)",icon:cl,critical:!0,status:"down",detail:"Die Zentrale antwortet nicht — alle Anzeigen hier können veraltet sein. Läuft die Box? Deploy aktiv?"}),_.push((()=>{const Z={id:"brain",label:"Lucys Hirn",icon:Py,critical:!0};return h?w===!1?{...Z,status:"down",detail:"Die Motor-Maschine (Engine) läuft nicht — Lucy kann gerade gar nicht denken.",repair:{kind:"restart",service:"llama-swap",label:"Motor neu starten",needsSudo:!0}}:x===!1?{...Z,status:"down",detail:"Lucys Hirn ist gerade eingeschlafen — einmal aufwecken.",repair:P?{kind:"loadModel",model:P,label:"Hirn aufwecken"}:void 0}:{...Z,status:"ok",detail:"Wach und ansprechbar."}:{...Z,status:"loading",detail:"Wird geprüft …"}})()),_.push((()=>{const Z={id:"vision",label:"Lucys Augen",icon:jp,critical:!1};if(!h||!u)return{...Z,status:"loading",detail:"Wird geprüft …"};const ce=u.models.find(Ne=>Ne.role==="vision");return ce?(u.running??[]).includes(ce.name)?{...Z,status:"ok",detail:"Sieht gerade zu (geladen, solange Lucy sie nutzt)."}:{...Z,status:"ok",detail:"Augen ruhen — sie laden von selbst, sobald Lucy startet oder ein Bild kommt.",repair:{kind:"loadModel",model:ce.name,label:"Augen wecken"}}:{...Z,status:"warn",detail:"Kein Augen-Modell eingerichtet — Lucy kann keine Bilder ansehen."}})()),_.push((()=>{const Z={id:"memory",label:"Lucys Gedächtnis",icon:Cy,critical:!0},ce=y("hermes-gateway");return!h||ce===void 0?{...Z,status:"loading",detail:"Wird geprüft …"}:ce?{...Z,status:"ok",detail:"Hermes-Natives Gedächtnis aktiv (SQLite & Embeddings)."}:{...Z,status:"down",detail:"Lucy kann sich gerade nichts merken — das Gateway antwortet nicht.",repair:{kind:"restart",service:"hermes-gateway",label:"Gateway neu starten"}}})()),_.push((()=>{const Z={id:"gateway",label:"Verbindung (Gateway)",icon:oc,critical:!0},ce=r?r.gateway_reachable:y("mc2-gateway");if(!h||ce===void 0)return{...Z,status:"loading",detail:"Wird geprüft …"};const Ce=k("mc2-gateway")?"mc2-gateway":"mission-control-2";return ce?{...Z,status:"ok",detail:"Apps und IDEs können Lucy erreichen."}:{...Z,status:"down",detail:"Der Modell-Gateway antwortet nicht — Lucy und die IDEs erreichen kein Modell.",repair:{kind:"restart",service:Ce,label:"Gateway neu starten"}}})()),_.push((()=>{const Z={id:"steward",label:"Wächter (Steward)",icon:lc,critical:!1};return h?k("mc2-steward")?y("mc2-steward")?{...Z,status:"ok",detail:"Wacht über Warm-Set, Dienste und Gedächtnis."}:{...Z,status:"warn",detail:"Der Wächter schläft — niemand meldet gerade Ausfälle oder wärmt Modelle nach.",repair:{kind:"restart",service:"mc2-steward",label:"Wächter neu starten"}}:{...Z,status:"ok",detail:"Auf dieser Installation nicht eingerichtet."}:{...Z,status:"loading",detail:"Wird geprüft …"}})()),_.push((()=>{const Z={id:"agent",label:"Lucys Agent (Hermes)",icon:Ni,critical:!0},ce=y("hermes-gateway");return!h||ce===void 0?{...Z,status:"loading",detail:"Wird geprüft …"}:ce?{...Z,status:"ok",detail:"Lucy ist bereit zu reden und zu handeln."}:{...Z,status:"down",detail:"Lucys Agent ist offline — sie reagiert gerade nicht.",repair:{kind:"restart",service:"hermes-gateway",label:"Agent neu starten"}}})()),_.push((()=>{const Z={id:"voice",label:"Lucys Stimme",icon:Zy,critical:!1},ce=y("voice-service");return!h||ce===void 0?{...Z,status:"loading",detail:"Wird geprüft …"}:ce?{...Z,status:"ok",detail:"Lucy kann hören und sprechen."}:{...Z,status:"warn",detail:"Sprechen ist gerade aus — Tippen geht weiter normal.",repair:{kind:"restart",service:"voice-service",label:"Stimme neu starten"}}})());const D=((ke=f==null?void 0:f.ram)==null?void 0:ke.total)??0,b=((le=f==null?void 0:f.ram)==null?void 0:le.used)??0,R=((Le=f==null?void 0:f.ram)==null?void 0:Le.percent)??(D>0?Math.min(100,b/D*100):0),A=1024**3,I=D?R>=93?{status:"full",usedGb:b/A,totalGb:D/A,pct:R,text:"Speicher fast voll — Lucy könnte langsamer werden."}:R>=85?{status:"warn",usedGb:b/A,totalGb:D/A,pct:R,text:"Speicher gut gefüllt — noch okay."}:{status:"ok",usedGb:b/A,totalGb:D/A,pct:R,text:"Genug Speicher frei."}:{status:"unknown",usedGb:0,totalGb:0,pct:0,text:"Speicher-Auslastung unbekannt."},V=_.some(Z=>Z.status==="loading"),z=_.filter(Z=>Z.critical&&Z.status==="down"),K=_.filter(Z=>Z.status==="warn"||!Z.critical&&Z.status==="down"),G=I.status==="full";return{verdict:V&&!z.length?"loading":z.length?"problem":K.length||G?"warn":"gut",checks:_,memory:I,problems:z,warns:K,unreachable:m}}const bw={ok:"bg-emerald-500",warn:"bg-amber-500",alert:"bg-red-500",muted:"bg-muted-foreground/40",loading:"bg-muted-foreground/40 animate-pulse"},Sw={ok:"hover:border-emerald-500/40",warn:"hover:border-amber-500/50",alert:"hover:border-red-500/50",muted:"hover:border-primary/40",loading:"hover:border-border/60"};function yi({icon:r,title:s,value:o,unit:a,tone:u="muted",hint:f,onClick:m}){return d.jsxs("button",{onClick:m,className:Ee("group relative flex flex-col items-start mc-card p-5 text-left cursor-pointer",Sw[u]),children:[d.jsxs("div",{className:"mb-4 flex w-full items-center justify-between",children:[d.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl border border-border/40 bg-background/30 text-foreground/80 transition-colors group-hover:text-primary",children:d.jsx(r,{className:"h-5 w-5"})}),d.jsx("span",{className:Ee("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",bw[u]),title:f})]}),d.jsxs("div",{className:"flex items-baseline gap-1.5",children:[d.jsx("span",{className:"text-2xl font-bold tracking-tight text-foreground font-space tabular-nums",children:o}),a&&d.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:a})]}),d.jsxs("div",{className:"mt-1 flex w-full items-center justify-between",children:[d.jsx("span",{className:"text-sm font-semibold text-foreground/90",children:s}),d.jsx(wi,{className:"h-4 w-4 text-muted-foreground/40 transition-all group-hover:translate-x-0.5 group-hover:text-primary"})]}),f&&d.jsx("span",{className:"mt-0.5 text-[11px] text-muted-foreground",children:f})]})}function Ew(){const{data:r,error:s}=vl(),o=yw();return{sys:r,hist:o,error:s}}const Nw=g.lazy(()=>Wt(()=>import("./LiveAreaChartImpl-Bb72EW29.js"),__vite__mapDeps([0,1])));function jm(r){return d.jsx(g.Suspense,{fallback:d.jsx(jw,{height:r.height??176}),children:d.jsx(Nw,{...r})})}function jw({height:r}){return d.jsx("div",{style:{height:r},className:"flex w-full items-end","aria-hidden":"true",children:d.jsx("div",{className:"h-px w-full bg-border/40"})})}const Cm={"1h":60,"24h":1440},Gh={live:"Live","1h":"1 h","24h":"24 h"};function _m({value:r,onChange:s}){return d.jsx("div",{className:"flex rounded-lg border border-border/40 bg-background/30 p-0.5",children:Object.keys(Gh).map(o=>d.jsx("button",{onClick:()=>s(o),className:Ee("rounded-md px-2 py-0.5 text-[9px] font-bold uppercase tracking-wide transition-all cursor-pointer",r===o?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:Gh[o]},o))})}const Cw=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function _w(){var w,x,P,_;const{sys:r,hist:s}=Ew(),[o,a]=g.useState("live"),u=wm(o==="live"?60:Cm[o],o!=="live"),f=g.useMemo(()=>{var D;return o==="live"?s:(((D=u.data)==null?void 0:D.points)??[]).map(b=>({t:b.t*1e3,cpu:b.cpu,ram:b.ram,gpu:b.gpu,disk:b.disk}))},[o,s,u.data]),m=!!(r!=null&&r.gpu&&r.gpu.busy_percent!=null&&r.gpu.gtt_used!=null&&r.gpu.gtt_total!=null),h=Cw.filter(D=>D.key!=="gpu"||m),y={cpu:(w=r==null?void 0:r.cpu)==null?void 0:w.percent,ram:(x=r==null?void 0:r.ram)==null?void 0:x.percent,gpu:m?r.gpu.busy_percent:null,disk:(P=r==null?void 0:r.disk)==null?void 0:P.percent},k={cpu:(_=r==null?void 0:r.cpu)!=null&&_.cores?`${r.cpu.cores} Cores`:"",ram:r?`${ts(r.ram.used)}/${ts(r.ram.total)} GB`:"",gpu:m?`${ts(r.gpu.gtt_used)}/${ts(r.gpu.gtt_total)} GB`:"",disk:r!=null&&r.disk?`${ts(r.disk.used)}/${ts(r.disk.total)} GB`:""};return d.jsxs("div",{className:"flex flex-col justify-between mc-card p-5",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[d.jsx(Np,{className:"h-4.5 w-4.5 text-primary"}),d.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),o==="live"&&d.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]}),d.jsx("div",{className:"ml-auto",children:d.jsx(_m,{value:o,onChange:a})})]}),r?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:h.map(D=>d.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:D.color}}),d.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:D.label}),d.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(y[D.key]??0),"%"]}),k[D.key]&&d.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:k[D.key]})]},D.key))}),o!=="live"&&f.length===0&&d.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:u.isLoading?"Verlauf wird geladen …":"Noch kein Verlauf — der Sammler baut die Historie gerade erst auf."}),(o==="live"||f.length>0)&&d.jsx(jm,{data:f,series:h,unit:"%",yMode:"percent",height:176,showTime:!0})]}):d.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(r==null?void 0:r.temp)&&(r.temp.cpu||r.temp.gpu)&&d.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[r.temp.cpu!=null&&d.jsxs("span",{children:["CPU Temp: ",r.temp.cpu," °C"]}),r.temp.gpu!=null&&d.jsxs("span",{children:["GPU Temp: ",r.temp.gpu," °C"]})]})]})}const Ss=[{key:"stt_ms",label:"STT",color:"#f59e0b"},{key:"vision_ms",label:"Sehen",color:"#a78bfa"},{key:"hirn_ms",label:"Hirn",color:"#2dd4bf"},{key:"gen_ms",label:"Antwort",color:"#60a5fa"}],ki=r=>r==null?"–":`${(r/1e3).toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1})} s`;function Pw(r){const s=Math.max(0,Date.now()/1e3-r);return s<60?`vor ${Math.round(s)} s`:s<3600?`vor ${Math.round(s/60)} min`:`vor ${Math.round(s/3600)} h`}function Zu(r){return Ss.reduce((s,o)=>s+(r[o.key]??0),0)}function Rw(r){let s=null;for(const o of Ss){const a=r[o.key];a!=null&&(s==null||a>s.ms)&&(s={label:o.label,color:o.color,ms:a})}return s}function Mw({t:r,scale:s}){const o=Ss.map(a=>`${a.label} ${ki(r[a.key])}`).join(" · ");return d.jsxs("div",{className:"flex items-center gap-2.5",children:[d.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[10px] text-muted-foreground/60",children:Pw(r.ts)}),d.jsxs("div",{className:"relative h-4 flex-1 overflow-hidden rounded-sm bg-muted/25",title:o,children:[d.jsx("div",{className:"absolute inset-0 flex",children:Ss.map(a=>{const u=r[a.key];return!u||u<=0?null:d.jsx("div",{style:{width:`${u/s*100}%`,background:a.color},className:"h-full first:rounded-l-sm"},a.key)})}),r.error&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-rose-500/15 text-[10px] font-semibold text-rose-300",children:"Fehler"})]}),d.jsx("span",{className:"w-12 shrink-0 text-right font-mono text-[11px] font-semibold tabular-nums text-foreground",children:r.error?"–":ki(Zu(r))})]})}function Ow(){const{data:r}=rw(12),s=r??[],o=Math.max(1,...s.map(f=>Zu(f))),a=s[0],u=a?Rw(a):null;return d.jsxs("div",{className:"mc-card p-5",children:[d.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Uy,{className:"h-4.5 w-4.5 text-primary"}),d.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Latenz je Turn"}),d.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),a?d.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[d.jsx("span",{className:`font-space text-3xl font-bold tracking-tight tabular-nums ${a.error?"text-rose-400":"text-foreground"}`,children:a.error?"Fehler":ki(Zu(a))}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["letzter Turn",!a.error&&u&&d.jsxs(d.Fragment,{children:[" · Täter: ",d.jsx("span",{style:{color:u.color},className:"font-semibold",children:u.label})," ",ki(u.ms)]})]})]}):d.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Noch kein Voice-Turn aufgezeichnet."}),a&&!a.error&&d.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-muted-foreground/70",children:Ss.filter(f=>a[f.key]!=null).map(f=>`${f.label} ${ki(a[f.key])}`).join(" · ")})]}),d.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1 pt-1",children:Ss.map(f=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:f.color}}),d.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f.label})]},f.key))})]}),s.length>0?d.jsx("div",{className:"space-y-1.5",children:s.map(f=>d.jsx(Mw,{t:f,scale:o},f.id))}):d.jsx("div",{className:"flex h-[120px] items-center justify-center px-6 text-center text-xs text-muted-foreground",children:"Sprich einmal mit Lucy — dann erscheint hier der Zeit-Wasserfall pro Turn, damit man den einen Hänger sofort sieht."}),d.jsx("div",{className:"mt-3 border-t border-border/30 pt-2 text-[10px] leading-relaxed text-muted-foreground/70",children:'„Hirn" = Zeit bis zum ersten Wort (Agent + Gedächtnis-Suche + Modell); Tool-Runden stecken in „Antwort". Reine Telegram-Turns laufen an MC2 vorbei und erscheinen hier nicht.'})]})}const Zh=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function Tw(){const{data:r}=bm(),s=xw(),[o,a]=g.useState("live"),u=wm(o==="live"?60:Cm[o],o!=="live"),f=g.useMemo(()=>{var w;if(o==="live")return s;const y=((w=u.data)==null?void 0:w.points)??[],k=[];for(let x=1;xd.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:y.color}}),d.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:y.label}),d.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((m==null?void 0:m[y.key])??0)})]},y.key))})]})]}),o!=="live"&&f.length===0?d.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:u.isLoading?"Verlauf wird geladen …":"Noch kein Verlauf — der Sammler baut die Historie gerade erst auf."}):r?d.jsx(jm,{data:f,series:Zh,unit:" tok/s",yMode:"auto",height:150,showTime:!0}):d.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),d.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}const al=r=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:r}}));function Lw({onNavigate:r}){var Z,ce,Ce,Ne;const{data:s}=km(),{data:o}=hc(),{data:a}=Sm(),{data:u}=iw(),{data:f}=ow(),{data:m}=ew(),{data:h}=tw(),y=kw(),{showAlert:k,dialogElement:w}=ym(),x=ul(),[P,_]=g.useState({});async function D(F,ne){_(Q=>({...Q,[F]:!0}));try{if(ne.kind==="loadModel")await Se(`/api/models/${encodeURIComponent(ne.model)}/load`,{method:"POST"});else{const Q=await Se("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:ne.service})});Q.ok||k("Reparatur nicht ganz geklappt",(Q.err||"Unbekannter Fehler")+(ne.needsSudo?` Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}x.invalidateQueries({queryKey:Pe.health}),x.invalidateQueries({queryKey:Pe.services}),x.invalidateQueries({queryKey:Pe.models})}catch(Q){k("Reparatur fehlgeschlagen",String((Q==null?void 0:Q.message)||Q))}finally{_(Q=>({...Q,[F]:!1}))}}const b=((Z=s==null?void 0:s.running)==null?void 0:Z.length)??0,R=(o==null?void 0:o.services.filter(F=>F.ok).length)??0,A=(o==null?void 0:o.services.length)??0,I=A-R,V=(a?(a.os>0?1:0)+(a.engine>0?1:0)+(a.swap>0?1:0)+(a.models>0?1:0):0)+(((ce=a==null?void 0:a.components)==null?void 0:ce.filter(F=>F.update===!0).length)??0),z=m!=null&&m.available?m.open_count:0,K=h!=null&&h.available?h.items.filter(F=>F.status==="blocked").length:0,G=f?[f.gateway,f.memory,f.desktop_gateway]:[],ue=G.filter(F=>F==null?void 0:F.ok).length,oe=f?f.gateway.ok?f.memory.ok?f.desktop_gateway.ok?"":"Desktop-Gateway":"Gedächtnis-Leitung":"Modell-Leitung":"",ee=(Ce=s==null?void 0:s.models)==null?void 0:Ce.find(F=>F.role==="hermes"),me=ee!=null&&ee.name?(Ne=ee.name.split("/").pop())==null?void 0:Ne.replace(/\.gguf$/i,""):"",ke=o==null?void 0:o.services.filter(F=>!F.ok).map(F=>F.name).join(", "),le=a?[a.os>0&&"OS",a.engine>0&&"Engine",a.swap>0&&"Swap",a.models>0&&"Modelle"].filter(Boolean):[],Le=le.length>0?le.join(" + "):"";return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 items-start",children:[d.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[d.jsx(Dw,{verdict:y.verdict,memory:y.memory,warns:y.warns,problems:y.problems}),d.jsxs("section",{children:[d.jsx(Nu,{children:"Leistung"}),d.jsx("div",{className:"grid gap-4 md:grid-cols-1",children:d.jsx(_w,{})}),d.jsx("div",{className:"mt-4",children:d.jsx(Ow,{})}),d.jsx("div",{className:"mt-4",children:d.jsx(Tw,{})})]}),d.jsxs("section",{children:[d.jsx(Nu,{children:"Bereiche"}),d.jsxs("div",{className:"grid gap-4 grid-cols-2 md:grid-cols-3",children:[d.jsx(yi,{icon:ic,title:"Auftragsbuch",value:m!=null&&m.available?z:"—",unit:z===1?"Vorschlag":"Vorschläge",tone:m?K>0||z>0?"warn":"ok":"loading",hint:K>0?`${K} Karte${K===1?"":"n"} wartet auf deine Antwort`:z>0?`${z} offene Patches`:"Keine ausstehenden Vorschläge",onClick:()=>r("auftraege")}),d.jsx(yi,{icon:Sp,title:"Modelle",value:b,unit:"warm",tone:b>0?"ok":"muted",hint:me?`Hirn: ${me}`:"Kein Hermes-Modell geladen",onClick:()=>r("models")}),d.jsx(yi,{icon:cl,title:"Dienste",value:o?`${R}/${A}`:"…",unit:"laufen",tone:o?I>0?"warn":"ok":"loading",hint:ke?`Ausfall: ${ke}`:"Alle Dienste online",onClick:()=>al("maintenance")}),d.jsx(yi,{icon:lc,title:"Updates",value:a?V>0?V:"0":"…",unit:V>0?"bereit":"aktuell",tone:a?V>0?"warn":"ok":"loading",hint:V>0?`Verfügbar: ${Le}`:"Alles auf dem neuesten Stand",onClick:()=>al("maintenance")}),d.jsx(yi,{icon:oc,title:"Verbinden",value:f?`${ue}/${G.length}`:"…",unit:"Leitungen",tone:f?ue===G.length?"ok":"warn":"loading",hint:oe?`Gestört: ${oe}`:"Hermes Desktop & IDEs bereit",onClick:()=>r("connect")})]})]})]}),d.jsxs("div",{className:"space-y-6",children:[d.jsx(Aw,{problems:y.problems,pendingCount:V,openAuftraege:z,blockedIdeen:K,busy:P,onRepair:D,onNavigate:r}),d.jsxs("section",{children:[d.jsx(Nu,{children:"Werkzeuge & Diagnose"}),d.jsx(zw,{agent:u,svcErrors:I,onNavigate:r})]})]})]}),w]})}function Nu({children:r}){return d.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:r})}function Dw({verdict:r,memory:s,warns:o,problems:a}){const u=o.length?`${o[0].label}: ${o[0].detail}${o.length>1?` (+${o.length-1} weitere)`:""}`:s.status==="full"?s.text:"Nichts Schlimmes — nur ein Hinweis.",f=a.length?`${a[0].label}: ${a[0].detail}${a.length>1?` (+${a.length-1} weitere)`:""}`:"Ein wichtiger Dienst hakt.",m={loading:{ring:"border-border/60 bg-card/45",icon:ji,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:Vy,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Ci,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:u},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Ci,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:f}}[r],h=m.icon,y={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[s.status],k={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[s.status];return d.jsxs("div",{className:Ee("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between h-full",m.ring),children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:d.jsx(h,{className:Ee("h-6 w-6",m.iconCls)})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:m.title}),d.jsx("p",{className:"text-xs text-muted-foreground",children:m.sub})]})]}),d.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[d.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[d.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(By,{className:"h-3.5 w-3.5"})," Speicher"]}),d.jsx("span",{className:Ee("font-mono font-bold",y),children:s.status==="unknown"?"—":`${s.usedGb.toFixed(1)} / ${s.totalGb.toFixed(1)} GB`})]}),d.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:d.jsx("div",{className:Ee("h-full rounded-full transition-all duration-500",k),style:{width:`${s.pct}%`}})})]})]})}function Aw({problems:r,pendingCount:s,openAuftraege:o,blockedIdeen:a,busy:u,onRepair:f,onNavigate:m}){const h=s>0,y=o>0,k=a>0,w=r.length===0&&!h&&!y&&!k;return d.jsx("div",{className:"h-full flex flex-col justify-between",children:w?d.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4 h-full",children:[d.jsx(My,{className:"h-5 w-5 shrink-0 text-emerald-400"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):d.jsxs("div",{className:"space-y-2 h-full flex flex-col justify-center",children:[r.map(x=>d.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-3 w-full",children:[d.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:d.jsx(x.icon,{className:"h-4.5 w-4.5"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-bold text-foreground",children:x.label}),d.jsx("p",{className:"truncate text-xs text-muted-foreground",children:x.detail})]})]}),x.repair&&d.jsxs("button",{onClick:()=>x.repair&&f(x.id,x.repair),disabled:!!u[x.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60 w-full sm:w-auto justify-center",children:[u[x.id]?d.jsx(ji,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(r0,{className:"h-3.5 w-3.5"}),x.repair.label]})]},x.id)),k&&d.jsxs("button",{onClick:()=>m("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-red-500/30 bg-red-500/5 p-4 text-left transition-all hover:bg-red-500/10 cursor-pointer",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:d.jsx(Ep,{className:"h-4.5 w-4.5"})}),d.jsxs("div",{children:[d.jsxs("p",{className:"text-sm font-bold text-foreground",children:[a," Karte",a===1?"":"n"," braucht deine Antwort"]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Die Box hängt an einer Frage und wartet auf dich."})]})]}),d.jsx(wi,{className:"h-4 w-4 shrink-0 text-red-300/70"})]}),y&&d.jsxs("button",{onClick:()=>m("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-primary/30 bg-primary/5 p-4 text-left transition-all hover:bg-primary/10 cursor-pointer",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-primary/30 bg-background/30 text-primary",children:d.jsx(ic,{className:"h-4.5 w-4.5"})}),d.jsxs("div",{children:[d.jsxs("p",{className:"text-sm font-bold text-foreground",children:[o," Vorschl",o===1?"ag":"äge"," im Auftragsbuch"]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Annehmen oder ablehnen."})]})]}),d.jsx(wi,{className:"h-4 w-4 shrink-0 text-primary/70"})]}),h&&d.jsxs("button",{onClick:()=>al("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:d.jsx(lc,{className:"h-4.5 w-4.5"})}),d.jsxs("div",{children:[d.jsxs("p",{className:"text-sm font-bold text-foreground",children:[s," Update",s===1?"":"s"," bereit"]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden."})]})]}),d.jsx(wi,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})})}function zw({agent:r,svcErrors:s,onNavigate:o}){const a=[{label:"Hermes Agent",status:r?r.gateway_reachable?"Bereit":"Offline":"…",tone:r?r.gateway_reachable?"ok":"alert":"loading",action:()=>o("agent")},{label:"Konsole (Box-Shell)",status:r?r.box_console_reachable?"Bereit":"Offline":"…",tone:r?r.box_console_reachable?"ok":"warn":"loading",action:()=>o("konsole")},{label:"Systemlogs & Diagnose",status:s>0?`${s} Fehler`:"Keine Fehler",tone:s>0?"alert":"ok",action:()=>al("logs")},{label:"Wissens-Vault",status:"Öffnen",tone:"muted",action:()=>o("wissen")},{label:"Chronik & Zeitmaschine",status:"Öffnen",tone:"muted",action:()=>o("chronik")}];return d.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/30 p-4 space-y-3 shadow-sm",children:d.jsx("div",{className:"divide-y divide-border/20",children:a.map((u,f)=>{const m={loading:"bg-muted-foreground/45 animate-pulse",ok:"bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.4)]",warn:"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.4)]",alert:"bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.4)]",muted:"bg-muted-foreground/30"}[u.tone];return d.jsxs("button",{onClick:u.action,className:"w-full py-2.5 px-1.5 flex items-center justify-between text-left hover:bg-card/45 rounded-lg transition-all group cursor-pointer text-xs",children:[d.jsx("span",{className:"text-muted-foreground group-hover:text-foreground transition-colors font-medium",children:u.label}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:Ee("text-[10px] font-semibold font-mono",u.tone==="ok"?"text-emerald-400":u.tone==="warn"?"text-amber-400":u.tone==="alert"?"text-red-400":"text-muted-foreground/60"),children:u.status}),d.jsx("span",{className:Ee("h-1.5 w-1.5 rounded-full",m)})]})]},f)})})})}const Fw=g.lazy(()=>Wt(()=>import("./ModelsView-BYDzvdzC.js"),__vite__mapDeps([2,3,4,5,6,7,8])).then(r=>({default:r.ModelsView}))),Iw=g.lazy(()=>Wt(()=>import("./ConnectView-Cz-npKrg.js"),__vite__mapDeps([9,7])).then(r=>({default:r.ConnectView}))),Uw=g.lazy(()=>Wt(()=>import("./AgentView-BgTBq7Qa.js"),[]).then(r=>({default:r.AgentView}))),$w=g.lazy(()=>Wt(()=>import("./KonsoleView-pXiZKOZ7.js"),[]).then(r=>({default:r.KonsoleView}))),Bw=g.lazy(()=>Wt(()=>import("./GuideView-CP1Y1rbp.js"),__vite__mapDeps([10,6,8])).then(r=>({default:r.GuideView}))),Vw=g.lazy(()=>Wt(()=>import("./AuftragsbuchView-C0bzCKZ0.js"),__vite__mapDeps([11,12,7])).then(r=>({default:r.AuftragsbuchView}))),Hw=g.lazy(()=>Wt(()=>import("./IdeenView-wVxyfCCm.js"),__vite__mapDeps([13,12,4,8,7,5])).then(r=>({default:r.IdeenView}))),Ww=g.lazy(()=>Wt(()=>import("./SkillsView-C5MWeKc5.js"),__vite__mapDeps([14,3])).then(r=>({default:r.SkillsView}))),Qw=g.lazy(()=>Wt(()=>import("./ChronikView-Bz_yVFvS.js"),__vite__mapDeps([15,5])).then(r=>({default:r.ChronikView}))),Kw=g.lazy(()=>Wt(()=>import("./WissenView-DOJLqZxA.js"),__vite__mapDeps([16,1])).then(r=>({default:r.WissenView})));function qw(){return d.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:d.jsx(ji,{className:"h-5 w-5 animate-spin","aria-label":"Lädt …"})})}const Gw=/Mac|iPhone|iPad/.test(navigator.platform);function Zw(){ww(),J1();const[r,s]=g.useState(()=>{const b=window.location.hash.slice(1);return is.some(R=>R.id===b)?b:"dashboard"}),o=g.useCallback(b=>{window.location.hash.slice(1)===b?s(b):window.location.hash=b},[]),[a,u]=g.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[f,m]=g.useState(!1),[h,y]=g.useState(!1),[k,w]=g.useState("maintenance"),{data:x,isError:P}=xm(),{data:_}=vl();g.useEffect(()=>{document.documentElement.classList.add("dark")},[]),g.useEffect(()=>{const b=R=>{var I;w(((I=R.detail)==null?void 0:I.tab)||"maintenance"),y(!0)};return window.addEventListener("open-system-drawer",b),()=>window.removeEventListener("open-system-drawer",b)},[]),g.useEffect(()=>{const b=R=>{var I;const A=(I=R.detail)==null?void 0:I.view;A&&o(A)};return window.addEventListener("mc-navigate",b),()=>window.removeEventListener("mc-navigate",b)},[o]),g.useEffect(()=>{const b=()=>{const R=window.location.hash.slice(1);is.some(A=>A.id===R)&&s(R)};return window.addEventListener("hashchange",b),()=>window.removeEventListener("hashchange",b)},[]),g.useEffect(()=>{m(!1)},[r]);const D=is.find(b=>b.id===r);return d.jsxs("div",{className:"flex h-full relative",children:[d.jsx("div",{className:"fixed inset-0 -z-50 pointer-events-none",style:{backgroundColor:"hsl(224,30%,6%)",backgroundImage:["radial-gradient(45% 40% at 12% 8%, hsl(172 72% 50% / 0.10), transparent 70%)","radial-gradient(50% 45% at 88% 92%, hsl(270 70% 60% / 0.10), transparent 70%)","radial-gradient(40% 35% at 75% 30%, hsl(239 70% 62% / 0.07), transparent 70%)"].join(", ")}}),d.jsx(d1,{onNavigate:o}),d.jsx(mw,{open:h,onClose:()=>y(!1),defaultTab:k}),d.jsx("aside",{className:Ee("hidden md:flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",a?"w-16":"w-60"),children:d.jsx(Yh,{collapsed:a,onToggleCollapse:()=>{u(b=>{const R=!b;return localStorage.setItem("mc_sidebar_collapsed",R.toString()),R})},view:r,health:x,backendDown:P,sysStatus:_})}),d.jsxs("div",{className:Ee("md:hidden fixed inset-0 z-50 transition-opacity duration-200",f?"opacity-100":"pointer-events-none opacity-0"),"aria-hidden":!f,children:[d.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:()=>m(!1)}),d.jsx("aside",{className:Ee("absolute inset-y-0 left-0 flex w-72 max-w-[85vw] flex-col border-r border-border/40 bg-[hsl(224,28%,8%)] transition-transform duration-300 ease-in-out",f?"translate-x-0":"-translate-x-full"),children:d.jsx(Yh,{collapsed:!1,onClose:()=>m(!1),view:r,health:x,backendDown:P,sysStatus:_})})]}),d.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[d.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between gap-3 border-b border-border/40 px-4 md:px-6 bg-card/20 backdrop-blur-sm",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[d.jsx("button",{onClick:()=>m(!0),className:"md:hidden p-1.5 -ml-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation öffnen",children:d.jsx(Gy,{className:"h-5 w-5","aria-hidden":"true"})}),d.jsx("div",{className:"truncate text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:D.hint})]}),d.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[d.jsx(q1,{}),d.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"hidden sm: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"}),d.jsxs("button",{onClick:()=>{const b=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(b)},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:[d.jsx(Ay,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"hidden sm:inline",children:"Suchen"}),d.jsx("kbd",{className:"hidden sm:inline rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:Gw?"⌘K":"Strg+K"})]})]})]}),d.jsx("main",{className:"flex-1 overflow-y-auto p-4 md:p-6 scrollbar-thin",children:d.jsxs(g.Suspense,{fallback:d.jsx(qw,{}),children:[r==="dashboard"&&d.jsx(Lw,{onNavigate:b=>o(b)}),r==="ideen"&&d.jsx(Hw,{}),r==="auftraege"&&d.jsx(Vw,{}),r==="skills"&&d.jsx(Ww,{}),r==="models"&&d.jsx(Fw,{}),r==="connect"&&d.jsx(Iw,{}),r==="wissen"&&d.jsx(Kw,{}),r==="chronik"&&d.jsx(Qw,{}),r==="agent"&&d.jsx(Uw,{}),r==="konsole"&&d.jsx($w,{}),r==="guide"&&d.jsx(Bw,{})]})})]})]})}function Yh({collapsed:r,onToggleCollapse:s,onClose:o,view:a,health:u,backendDown:f,sysStatus:m}){var h,y,k,w,x;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Ee("flex items-center py-4 border-b border-border/40 shrink-0",r?"flex-col gap-3 px-2":"justify-between px-5"),children:[d.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[d.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!r&&d.jsxs("div",{className:"leading-tight",children:[d.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),d.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),s&&d.jsx("button",{onClick:s,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":r?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:r?"Maximieren":"Minimieren",children:r?d.jsx(wi,{className:"h-4 w-4","aria-hidden":"true"}):d.jsx(Oy,{className:"h-4 w-4","aria-hidden":"true"})}),o&&d.jsx("button",{onClick:o,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation schließen",children:d.jsx(dl,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:(()=>{let P=null;return is.map(_=>{const D=_.group!==P;return P=_.group,d.jsxs("div",{className:"space-y-1",children:[D&&(r?P!==is[0].group&&d.jsx("div",{className:"my-3 border-t border-border/30"}):d.jsx("div",{className:"mt-5 mb-1.5 px-3 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/40 first:mt-0 select-none",children:_.group})),d.jsxs("a",{href:`#${_.id}`,onClick:o,"aria-current":a===_.id?"page":void 0,className:Ee("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",r?"justify-center p-2.5":"gap-3 px-3 py-2",a===_.id?r?"nav-active-collapsed":"nav-active":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:r?_.label:void 0,"aria-label":r?_.label:void 0,children:[d.jsx(_.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!r&&d.jsx("span",{className:"truncate",children:_.label})]})]},_.id)})})()}),d.jsx("div",{className:Ee("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",r?"px-2 text-center":"px-5"),children:r?d.jsx("div",{className:"flex justify-center",children:d.jsx("span",{className:Ee("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",f||!u?"bg-red-500":u.engine_reachable?u.brain&&!u.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500"),title:f?"Zentrale antwortet nicht — Anzeigen evtl. veraltet":u?u.engine_reachable?u.brain&&!u.brain.ready?`Hirn offline (${u.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):d.jsxs("div",{className:"space-y-2 text-left",children:[f?d.jsxs("span",{className:"flex items-center gap-2 text-red-400",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500 animate-pulse"}),d.jsx("span",{className:"truncate",children:"Zentrale antwortet nicht"})]}):u?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx("span",{className:Ee("h-2 w-2 rounded-full animate-pulse",u.engine_reachable?"bg-emerald-500":"bg-amber-500")}),d.jsxs("span",{className:"truncate",children:["Engine ",u.engine_reachable?"online":"offline"]})]}),u.brain&&!u.brain.ready&&d.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${u.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),d.jsxs("span",{className:"truncate",children:["Hirn offline",u.brain.model?` (${u.brain.model})`:""]})]})]}):d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",d.jsx("span",{className:"truncate",children:"Backend offline"})]}),(m==null?void 0:m.versions)&&d.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[d.jsxs("div",{className:"truncate",title:m.versions.mc2?`${m.versions.mc2.branch}-${m.versions.mc2.hash}${m.versions.mc2.dirty?"*":""} (${m.versions.mc2.date})`:"nicht gefunden",children:[d.jsx("strong",{children:"MC2:"})," ",m.versions.mc2?`${m.versions.mc2.hash}${m.versions.mc2.dirty?"*":""}`:"—"]}),d.jsxs("div",{className:"truncate",title:((h=m.versions.engine)==null?void 0:h.type)==="git"?`${m.versions.engine.branch}-${m.versions.engine.hash}${m.versions.engine.dirty?"*":""} (${m.versions.engine.date})`:((y=m.versions.engine)==null?void 0:y.version_text)||"unbekannt",children:[d.jsx("strong",{children:"Engine:"})," ",((k=m.versions.engine)==null?void 0:k.type)==="git"?`${m.versions.engine.hash}${m.versions.engine.dirty?"*":""}`:((x=(w=m.versions.engine)==null?void 0:w.version_text)==null?void 0:x.split(" ").pop())||"—"]}),d.jsxs("div",{className:"truncate",title:m.versions.hermes_agent?`${m.versions.hermes_agent.branch}-${m.versions.hermes_agent.hash}${m.versions.hermes_agent.dirty?"*":""} (${m.versions.hermes_agent.date})`:"nicht gefunden",children:[d.jsx("strong",{children:"Hermes Agent:"})," ",m.versions.hermes_agent?`${m.versions.hermes_agent.hash}${m.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]})}class Yw extends Ju.Component{constructor(){super(...arguments);Qo(this,"state",{error:null})}static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o,a){console.error("Unbehandelter UI-Fehler:",o,a.componentStack)}render(){return this.state.error?d.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:d.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[d.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),d.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),d.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const ju="mc_neuladen_wegen_version";function Xw(){window.addEventListener("vite:preloadError",r=>{sessionStorage.getItem(ju)||(r.preventDefault(),sessionStorage.setItem(ju,"1"),window.location.reload())}),window.addEventListener("load",()=>{window.setTimeout(()=>sessionStorage.removeItem(ju),5e3)})}Xw();const Jw=new ay({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});Av.createRoot(document.getElementById("root")).render(d.jsx(Ju.StrictMode,{children:d.jsx(Yw,{children:d.jsx(uy,{client:Jw,children:d.jsx(Zw,{})})})}));export{Uy as $,ow as A,Py as B,My as C,jh as D,jp as E,wi as F,Ty as G,By as H,iw as I,zy as J,tk as K,ji as L,Ni as M,jy as N,_p as O,Yy as P,t0 as Q,ss as R,Xy as S,Ci as T,gi as U,cl as V,r0 as W,dl as X,Sp as Y,oc as Z,qy as _,uk as a,e0 as a0,ew as a1,tw as a2,Ly as a3,vk as a4,ic as a5,sk as a6,Ep as a7,Iy as a8,Di as a9,_u as aa,bi as ab,iy as ac,it as ad,bt as ae,hp as af,Be as ag,sw as ah,mk as ai,ik as aj,Hy as ak,lc as al,Vy as am,nw as an,Ju as ao,ap,ok as aq,lk as ar,Ky as as,m1 as at,Xu as au,Mp as av,ec as aw,Ee as b,ge as c,rk as d,Cy as e,km as f,ak as g,vl as h,ck as i,d as j,ym as k,pk as l,fk as m,Se as n,ts as o,p1 as p,Pe as q,g as r,nk as s,Np as t,ul as u,gk as v,dk as w,Sm as x,Eu as y,hk as z};