const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LiveAreaChartImpl-BkyPZEnE.js","assets/string-DoZi9Vij.js","assets/ModelsView-Ck3R7mcg.js","assets/JobsBar-D8URwRCr.js","assets/code-xml-ID_kOxxM.js","assets/rotate-ccw-Bz6oQ3_7.js","assets/zap-0IkDqAhv.js","assets/chevron-down-C-RXUrpR.js","assets/layers-BVbGNbDq.js","assets/ConnectView-CxDIL-EH.js","assets/GuideView-FadZtBSQ.js","assets/AuftragsbuchView-Cr_8mzDy.js","assets/SectionLabel-C_SwIL8k.js","assets/IdeenView-CZhoWV4q.js","assets/SkillsView-DIrPeuP2.js","assets/ChronikView-xh-P-c-1.js","assets/WissenView-DOBd5fRz.js"])))=>i.map(i=>d[i]); var Ev=Object.defineProperty;var oh=r=>{throw TypeError(r)};var Nv=(r,s,i)=>s in r?Ev(r,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[s]=i;var ih=(r,s,i)=>Nv(r,typeof s!="symbol"?s+"":s,i),iu=(r,s,i)=>s.has(r)||oh("Cannot "+i);var E=(r,s,i)=>(iu(r,s,"read from private field"),i?i.call(r):s.get(r)),pe=(r,s,i)=>s.has(r)?oh("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,i),J=(r,s,i,a)=>(iu(r,s,"write to private field"),a?a.call(r,i):s.set(r,i),i),_e=(r,s,i)=>(iu(r,s,"access private method"),i);var Wi=(r,s,i,a)=>({set _(u){J(r,s,u,i)},get _(){return E(r,s,a)}});function jv(r,s){for(var i=0;ia[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 i(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=i(u);fetch(u.href,f)}})();function cp(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var lu={exports:{}},ho={},au={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 lh;function Cv(){if(lh)return je;lh=1;var r=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=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 R(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,S={};function P(C,N,q){this.props=C,this.context=N,this.refs=S,this.updater=q||_}P.prototype.isReactComponent={},P.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")},P.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function A(){}A.prototype=P.prototype;function F(C,N,q){this.props=C,this.context=N,this.refs=S,this.updater=q||_}var V=F.prototype=new A;V.constructor=F,D(V,P.prototype),V.isPureReactComponent=!0;var I=Array.isArray,K=Object.prototype.hasOwnProperty,G={current:null},ue={key:!0,ref:!0,__self:!0,__source:!0};function ie(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=z[C];if(0>>1;Cu(W,Q))seu(de,W)?(z[C]=de,z[se]=Q,C=se):(z[C]=W,z[Y]=Q,C=Y);else if(seu(de,Q))z[C]=de,z[se]=Q,C=se;else break e}}return ne}function u(z,ne){var Q=z.sortIndex-ne.sortIndex;return Q!==0?Q:z.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,R=3,_=!1,D=!1,S=!1,P=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,F=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(z){for(var ne=i(k);ne!==null;){if(ne.callback===null)a(k);else if(ne.startTime<=z)a(k),ne.sortIndex=ne.expirationTime,s(y,ne);else break;ne=i(k)}}function I(z){if(S=!1,V(z),!D)if(i(y)!==null)D=!0,Ce(K);else{var ne=i(k);ne!==null&&Ne(I,ne.startTime-z)}}function K(z,ne){D=!1,S&&(S=!1,A(ie),ie=-1),_=!0;var Q=R;try{for(V(ne),x=i(y);x!==null&&(!(x.expirationTime>ne)||z&&!ke());){var C=x.callback;if(typeof C=="function"){x.callback=null,R=x.priorityLevel;var N=C(x.expirationTime<=ne);ne=r.unstable_now(),typeof N=="function"?x.callback=N:x===i(y)&&a(y),V(ne)}else a(y);x=i(y)}if(x!==null)var q=!0;else{var Y=i(k);Y!==null&&Ne(I,Y.startTime-ne),q=!1}return q}finally{x=null,R=Q,_=!1}}var G=!1,ue=null,ie=-1,ee=5,me=-1;function ke(){return!(r.unstable_now()-mez||125C?(z.sortIndex=Q,s(k,z),i(y)===null&&z===i(k)&&(S?(A(ie),ie=-1):S=!0,Ne(I,Q-C))):(z.sortIndex=N,s(y,z),D||_||(D=!0,Ce(K))),z},r.unstable_shouldYield=ke,r.unstable_wrapCallback=function(z){var ne=R;return function(){var Q=R;R=ne;try{return z.apply(this,arguments)}finally{R=Q}}}})(du)),du}var fh;function Mv(){return fh||(fh=1,cu.exports=Rv()),cu.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 hh;function Ov(){if(hh)return wt;hh=1;var r=Zu(),s=Mv();function i(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 R(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,o){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function D(e,t,n,o){if(t===null||typeof t>"u"||_(e,t,n,o))return!0;if(o)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 S(e,t,n,o,l,c,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=p}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){P[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];P[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){P[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){P[e]=new S(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){P[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){P[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){P[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){P[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){P[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function F(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,F);P[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(A,F);P[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(A,F);P[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){P[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),P.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){P[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function V(e,t,n,o){var l=P.hasOwnProperty(t)?P[t]:null;(l!==null?l.type!==0:o||!(2v||l[p]!==c[v]){var b=` `+l[p].replace(" at new "," at ");return e.displayName&&b.includes("")&&(b=b.replace("",e.displayName)),b}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 ie: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===ie?"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),o=""+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){o=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(p){o=""+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(),o="";return e&&(o=we(e)?e.checked?"true":"false":e.value),e=o,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,o=t.checked!=null?t.checked:t.defaultChecked;n=ye(t.value!=null?t.value:n),e._wrapperState={initialChecked:o,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),o=t.type;if(n!=null)o==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(o==="submit"||o==="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 o=t.type;if(!(o!=="submit"&&o!=="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 Ie(e,t,n,o){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Io.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},_m=["Webkit","ms","Moz","O"];Object.keys(Ps).forEach(function(e){_m.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 o=n.indexOf("--")===0,l=xc(n,t[n],o);n==="float"&&(n="cssFloat"),o?e.setProperty(n,l):e[n]=l}}var Pm=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 yl(e,t){if(t){if(Pm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function xl(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 wl=null;function kl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bl=null,Cr=null,_r=null;function kc(e){if(e=Ys(e)){if(typeof bl!="function")throw Error(i(280));var t=e.stateNode;t&&(t=ii(t),bl(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-(Um(e)/$m|0)|0}var Bo=64,Vo=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 Ho(e,t){var n=e.pendingLanes;if(n===0)return 0;var o=0,l=e.suspendedLanes,c=e.pingedLanes,p=n&268435455;if(p!==0){var v=p&~l;v!==0?o=Ts(v):(c&=p,c!==0&&(o=Ts(c)))}else p=n&~l,p!==0?o=Ts(p):c!==0&&(o=Ts(c));if(o===0)return 0;if(t!==0&&t!==o&&(t&l)===0&&(l=o&-o,c=t&-t,l>=c||l===16&&(c&4194240)!==0))return t;if((o&4)!==0&&(o|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;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-It(t),e[t]=n}function Wm(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 o=e.eventTimes;for(e=e.expirationTimes;0=Bs),Yc=" ",Xc=!1;function Jc(e,t){switch(e){case"keyup":return xg.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 kg(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 bg(e,t){if(Mr)return e==="compositionend"||!Ul&&Jc(e,t)?(e=Wc(),Go=Ll=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=o}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 Vl(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 Mg(e){var t=cd(),n=e.focusedElem,o=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ud(n.ownerDocument.documentElement,n)){if(o!==null&&Vl(n)){if(t=o.start,e=o.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(o.start,l);o=o.end===void 0?c:Math.min(o.end,l),!e.extend&&c>o&&(l=o,o=c,c=l),l=ad(n,c);var p=ad(n,o);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>o?(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,Hl=null,Qs=null,Wl=!1;function dd(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wl||Or==null||Or!==Er(o)||(o=Or,"selectionStart"in o&&Vl(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Qs&&Ws(Qs,o)||(Qs=o,o=ri(Hl,"onSelect"),0Ir||(e.current=ra[Ir],ra[Ir]=null,Ir--)}function Ae(e,t){Ir++,ra[Ir]=e.current,e.current=t}var jn={},lt=Nn(jn),mt=Nn(!1),er=jn;function zr(e,t){var n=e.type.contextTypes;if(!n)return jn;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var l={},c;for(c in n)l[c]=t[c];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function gt(e){return e=e.childContextTypes,e!=null}function li(){Fe(mt),Fe(lt)}function jd(e,t,n){if(lt.current!==jn)throw Error(i(168));Ae(lt,t),Ae(mt,n)}function Cd(e,t,n){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var l in o)if(!(l in t))throw Error(i(108,de(e)||"Unknown",l));return Q({},n,o)}function ai(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 o=e.stateNode;if(!o)throw Error(i(169));n?(e=Cd(e,t,er),o.__reactInternalMemoizedMergedChildContext=e,Fe(mt),Fe(lt),Ae(lt,e)):Fe(mt),Ae(mt,n)}var on=null,ui=!1,sa=!1;function Pd(e){on===null?on=[e]:on.push(e)}function Vg(e){ui=!0,Pd(e)}function Cn(){if(!sa&&on!==null){sa=!0;var e=0,t=De;try{var n=on;for(De=1;e>=p,l-=p,ln=1<<32-It(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=o(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(Sv){return t(M,Sv)}),$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=Ii(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=tu(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 oe(M,j,O,H);hi(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=eu(O,M.mode,H),j.return=M,M=j),p(M)):n(M,j)}return qe}var Br=Ad(!0),Id=Ad(!1),pi=Nn(null),mi=null,Vr=null,ca=null;function da(){ca=Vr=mi=null}function fa(e){var t=pi.current;Fe(pi),e._currentValue=t}function ha(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function Hr(e,t){mi=e,ca=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(ca!==e)if(e={context:e,memoizedValue:t,next:null},Vr===null){if(mi===null)throw Error(i(308));Vr=e,mi.dependencies={lanes:0,firstContext:e}}else Vr=Vr.next=e;return t}var rr=null;function pa(e){rr===null?rr=[e]:rr.push(e)}function zd(e,t,n,o){var l=t.interleaved;return l===null?(n.next=n,pa(t)):(n.next=l.next,l.next=n),t.interleaved=n,un(e,o)}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 ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fd(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 o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Me&2)!==0){var l=o.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),o.pending=t,un(e,n)}return l=o.interleaved,l===null?(t.next=t,pa(o)):(t.next=l.next,l.next=t),o.interleaved=t,un(e,n)}function gi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,Pl(e,n)}}function Ud(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){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:o.baseState,firstBaseUpdate:l,lastBaseUpdate:c,shared:o.shared,effects:o.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function vi(e,t,n,o){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 b=v,T=b.next;b.next=null,p===null?c=T:p.next=T,p=b;var $=e.alternate;$!==null&&($=$.updateQueue,v=$.lastBaseUpdate,v!==p&&(v===null?$.firstBaseUpdate=T:v.next=T,$.lastBaseUpdate=b))}if(c!==null){var B=l.baseState;p=0,$=T=b=null,v=c;do{var U=v.lane,X=v.eventTime;if((o&U)===U){$!==null&&($=$.next={eventTime:X,lane:0,tag:v.tag,payload:v.payload,callback:v.callback,next:null});e:{var re=e,oe=v;switch(U=t,X=n,oe.tag){case 1:if(re=oe.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=oe.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,b=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&&(b=B),l.baseState=b,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);ir|=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 o=wa.transition;wa.transition={};try{e(!1),t()}finally{De=n,wa.transition=o}}function lf(){return Tt().memoizedState}function Kg(e,t,n){var o=Tn(e);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},af(e))uf(t,n);else if(n=zd(e,t,n,o),n!==null){var l=ht();Vt(n,e,o,l),cf(n,t,o)}}function qg(e,t,n){var o=Tn(e),l={lane:o,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,zt(v,p)){var b=t.interleaved;b===null?(l.next=l,pa(t)):(l.next=b.next,b.next=l),t.interleaved=l;return}}catch{}finally{}n=zd(e,t,l,o),n!==null&&(l=ht(),Vt(n,e,o,l),cf(n,t,o))}}function af(e){var t=e.alternate;return e===He||t!==null&&t===He}function uf(e,t){no=wi=!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 o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,Pl(e,n)}}var Si={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},Gg={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,ki(4194308,4,tf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ki(4194308,4,e,t)},useInsertionEffect:function(e,t){return ki(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 o=Zt();return t=n!==void 0?n(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=Kg.bind(null,He,e),[o.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:Zd,useDebugValue:Ca,useDeferredValue:function(e){return Zt().memoizedState=e},useTransition:function(){var e=Zd(!1),t=e[0];return e=Qg.bind(null,e[1]),Zt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var o=He,l=Zt();if($e){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),et===null)throw Error(i(349));(or&30)!==0||Wd(o,t,n)}l.memoizedState=n;var c={value:n,getSnapshot:t};return l.queue=c,Xd(Kd.bind(null,o,c,e),[e]),o.flags|=2048,oo(9,Qd.bind(null,o,c,n,t),void 0,null),n},useId:function(){var e=Zt(),t=et.identifierPrefix;if($e){var n=an,o=ln;n=(o&~(1<<32-It(o)-1)).toString(32)+n,t=":"+t+"R"+n,n=ro++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=p.createElement(n,{is:o.is}):(e=p.createElement(n),n==="select"&&(p=e,o.multiple?p.multiple=!0:o.size&&(p.size=o.size))):e=p.createElementNS(e,n),e[qt]=t,e[Zs]=o,Rf(e,t,!1,!1),t.stateNode=e;e:{switch(p=xl(n,o),n){case"dialog":ze("cancel",e),ze("close",e),l=o;break;case"iframe":case"object":case"embed":ze("load",e),l=o;break;case"video":case"audio":for(l=0;lGr&&(t.flags|=128,o=!0,io(c,!1),t.lanes=4194304)}else{if(!o)if(e=yi(p),e!==null){if(t.flags|=128,o=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),io(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,o=!0,io(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,o?n&1|2:n&1),t):(ut(t),null);case 22:case 23:return Ya(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(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(i(156,t.tag))}function rv(e,t){switch(ia(t),t.tag){case 1:return gt(t.type)&&li(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wr(),Fe(mt),Fe(lt),xa(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return va(t),null;case 13:if(Fe(Ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));$r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fe(Ve),null;case 4:return Wr(),null;case 10:return fa(t.type._context),null;case 22:case 23:return Ya(),null;case 24:return null;default:return null}}var Ci=!1,ct=!1,sv=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(o){We(e,t,o)}else n.current=null}function Fa(e,t,n){try{n()}catch(o){We(e,t,o)}}var Tf=!1;function ov(e,t){if(Yl=Ko,e=cd(),Vl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var l=o.anchorOffset,c=o.focusNode;o=o.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var p=0,v=-1,b=-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||o!==0&&B.nodeType!==3||(b=p+o),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&&++$===o&&(b=p),(X=B.nextSibling)!==null)break;B=U,U=B.parentNode}B=X}n=v===-1||b===-1?null:{start:v,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xl={focusedElem:e,selectionRange:n},Ko=!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 oe=re.memoizedProps,qe=re.memoizedState,M=t.stateNode,j=M.getSnapshotBeforeUpdate(t.elementType===t.type?oe:Ut(t.type,oe),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(i(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 lo(e,t,n){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do{if((l.tag&e)===e){var c=l.destroy;l.destroy=void 0,c!==void 0&&Fa(t,n,c)}l=l.next}while(l!==o)}}function _i(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 o=n.create;n.destroy=o()}n=n.next}while(n!==t)}}function Ua(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[na],delete t[$g],delete t[Bg])),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 $a(e,t,n){var o=e.tag;if(o===5||o===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=oi));else if(o!==4&&(e=e.child,e!==null))for($a(e,t,n),e=e.sibling;e!==null;)$a(e,t,n),e=e.sibling}function Ba(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(Ba(e,t,n),e=e.sibling;e!==null;)Ba(e,t,n),e=e.sibling}var rt=null,$t=!1;function Rn(e,t,n){for(n=n.child;n!==null;)If(e,t,n),n=n.sibling}function If(e,t,n){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount($o,n)}catch{}switch(n.tag){case 5:ct||Kr(n,t);case 6:var o=rt,l=$t;rt=null,Rn(e,t,n),rt=o,$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?ta(e.parentNode,n):e.nodeType===1&&ta(e,n),Fs(e)):ta(rt,n.stateNode));break;case 4:o=rt,l=$t,rt=n.stateNode.containerInfo,$t=!0,Rn(e,t,n),rt=o,$t=l;break;case 0:case 11:case 14:case 15:if(!ct&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){l=o=o.next;do{var c=l,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&Fa(n,t,p),l=l.next}while(l!==o)}Rn(e,t,n);break;case 1:if(!ct&&(Kr(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.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=(o=ct)||n.memoizedState!==null,Rn(e,t,n),ct=o):Rn(e,t,n);break;default:Rn(e,t,n)}}function zf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new sv),t.forEach(function(o){var l=pv.bind(null,e,o);n.has(o)||(n.add(o),o.then(l,l))})}}function Bt(e,t){var n=t.deletions;if(n!==null)for(var o=0;ol&&(l=p),o&=~c}if(o=l,o=Ke()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*lv(o/1960))-o,10e?16:e,On===null)var o=!1;else{if(e=On,On=null,Ti=0,(Me&6)!==0)throw Error(i(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 b=0;bKe()-Wa?ar(e,0):Ha|=n),xt(e,t)}function Yf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Vo,Vo<<=1,(Vo&130023424)===0&&(Vo=4194304)));var n=ht();e=un(e,t),e!==null&&(Ls(e,t,n),xt(e,n))}function hv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yf(e,n)}function pv(e,t){var n=0;switch(e.tag){case 13:var o=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(i(314))}o!==null&&o.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,tv(e,t,n);vt=(e.flags&131072)!==0}else vt=!1,$e&&(t.flags&1048576)!==0&&Rd(t,di,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;ji(e,t),e=t.pendingProps;var l=zr(t,lt.current);Hr(t,n),l=ba(null,t,o,e,l,n);var c=Sa();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(o)?(c=!0,ai(t)):c=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ma(t),l.updater=Ei,t.stateNode=l,l._reactInternals=t,Pa(t,o,e,n),t=Ta(null,t,o,!0,c,n)):(t.tag=0,$e&&c&&oa(t),ft(null,t,l,n),t=t.child),t;case 16:o=t.elementType;e:{switch(ji(e,t),e=t.pendingProps,l=o._init,o=l(o._payload),t.type=o,l=t.tag=gv(o),e=Ut(o,e),l){case 0:t=Oa(null,t,o,e,n);break e;case 1:t=Ef(null,t,o,e,n);break e;case 11:t=xf(null,t,o,e,n);break e;case 14:t=wf(null,t,o,Ut(o.type,e),n);break e}throw Error(i(306,o,""))}return t;case 0:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:Ut(o,l),Oa(e,t,o,l,n);case 1:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:Ut(o,l),Ef(e,t,o,l,n);case 3:e:{if(Nf(t),e===null)throw Error(i(387));o=t.pendingProps,c=t.memoizedState,l=c.element,Fd(e,t),vi(t,o,null,n);var p=t.memoizedState;if(o=p.element,c.isDehydrated)if(c={element:o,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){l=Qr(Error(i(423)),t),t=jf(e,t,o,n,l);break e}else if(o!==l){l=Qr(Error(i(424)),t),t=jf(e,t,o,n,l);break e}else for(jt=En(t.stateNode.containerInfo.firstChild),Nt=t,$e=!0,Ft=null,n=Id(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($r(),o===l){t=dn(e,t,n);break e}ft(e,t,o,n)}t=t.child}return t;case 5:return Bd(t),e===null&&aa(t),o=t.type,l=t.pendingProps,c=e!==null?e.memoizedProps:null,p=l.children,Jl(o,l)?p=null:c!==null&&Jl(o,c)&&(t.flags|=32),Sf(e,t),ft(e,t,p,n),t.child;case 6:return e===null&&aa(t),null;case 13:return Cf(e,t,n);case 4:return ga(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Br(t,null,o,n):ft(e,t,o,n),t.child;case 11:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:Ut(o,l),xf(e,t,o,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(o=t.type._context,l=t.pendingProps,c=t.memoizedProps,p=l.value,Ae(pi,o._currentValue),o._currentValue=p,c!==null)if(zt(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 b=v.firstContext;b!==null;){if(b.context===o){if(c.tag===1){b=cn(-1,n&-n),b.tag=2;var T=c.updateQueue;if(T!==null){T=T.shared;var $=T.pending;$===null?b.next=b:(b.next=$.next,$.next=b),T.pending=b}}c.lanes|=n,b=c.alternate,b!==null&&(b.lanes|=n),ha(c.return,n,t),v.lanes|=n;break}b=b.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(i(341));p.lanes|=n,v=p.alternate,v!==null&&(v.lanes|=n),ha(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,o=t.pendingProps.children,Hr(t,n),l=Ot(l),o=o(l),t.flags|=1,ft(e,t,o,n),t.child;case 14:return o=t.type,l=Ut(o,t.pendingProps),l=Ut(o.type,l),wf(e,t,o,l,n);case 15:return kf(e,t,t.type,t.pendingProps,n);case 17:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:Ut(o,l),ji(e,t),t.tag=1,gt(o)?(e=!0,ai(t)):e=!1,Hr(t,n),ff(t,o,l),Pa(t,o,l,n),Ta(null,t,o,!0,e,n);case 19:return Pf(e,t,n);case 22:return bf(e,t,n)}throw Error(i(156,t.tag))};function Jf(e,t){return Mc(e,t)}function mv(e,t,n,o){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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dt(e,t,n,o){return new mv(e,t,n,o)}function Ja(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gv(e){if(typeof e=="function")return Ja(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 Ii(e,t,n,o,l,c){var p=2;if(o=e,typeof e=="function")Ja(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case ue:return cr(n.children,l,c,t);case ie: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 zi(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,o=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Dt(p,n,t,l),t.elementType=e,t.type=o,t.lanes=c,t}function cr(e,t,n,o){return e=Dt(7,e,o,t),e.lanes=n,e}function zi(e,t,n,o){return e=Dt(22,e,o,t),e.elementType=Ne,e.lanes=n,e.stateNode={isHidden:!1},e}function eu(e,t,n){return e=Dt(6,e,null,t),e.lanes=n,e}function tu(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 vv(e,t,n,o,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=_l(0),this.expirationTimes=_l(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_l(0),this.identifierPrefix=o,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,o,l,c,p,v,b){return e=new vv(e,t,n,v,b),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:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ma(c),e}function yv(e,t,n){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(s){console.error(s)}}return r(),uu.exports=Ov(),uu.exports}var mh;function Tv(){if(mh)return Qi;mh=1;var r=dp();return Qi.createRoot=r.createRoot,Qi.hydrateRoot=r.hydrateRoot,Qi}var Lv=Tv();const Dv=cp(Lv);var Do=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,ep,Av=(ep=class extends Do{constructor(){super();pe(this,fr);pe(this,$n);pe(this,as);J(this,as,s=>{if(typeof window<"u"&&window.addEventListener){const i=()=>s();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}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 i;J(this,as,s),(i=E(this,$n))==null||i.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(i=>{i(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,ep),Ju=new Av,Iv={setTimeout:(r,s)=>setTimeout(r,s),clearTimeout:r=>clearTimeout(r),setInterval:(r,s)=>setInterval(r,s),clearInterval:r=>clearInterval(r)},Bn,Gu,tp,zv=(tp=class{constructor(){pe(this,Bn,Iv);pe(this,Gu,!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,Gu=new WeakMap,tp),dr=new zv;function Fv(r){setTimeout(r,0)}var Uv=typeof window>"u"||"Deno"in globalThis;function bt(){}function $v(r,s){return typeof r=="function"?r(s):r}function Eu(r){return typeof r=="number"&&r>=0&&r!==1/0}function fp(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 gh(r,s){const{type:i="all",exact:a,fetchStatus:u,predicate:f,queryKey:m,stale:h}=r;if(m){if(a){if(s.queryHash!==ec(m,s.options))return!1}else if(!Eo(s.queryKey,m))return!1}if(i!=="all"){const y=s.isActive();if(i==="active"&&!y||i==="inactive"&&y)return!1}return!(typeof h=="boolean"&&s.isStale()!==h||u&&u!==s.state.fetchStatus||f&&!f(s))}function vh(r,s){const{exact:i,status:a,predicate:u,mutationKey:f}=r;if(f){if(!s.options.mutationKey)return!1;if(i){if(So(s.options.mutationKey)!==So(f))return!1}else if(!Eo(s.options.mutationKey,f))return!1}return!(a&&s.state.status!==a||u&&!u(s))}function ec(r,s){return((s==null?void 0:s.queryKeyHashFn)||So)(r)}function So(r){return JSON.stringify(r,(s,i)=>ju(i)?Object.keys(i).sort().reduce((a,u)=>(a[u]=i[u],a),{}):i)}function Eo(r,s){return r===s?!0:typeof r!=typeof s?!1:r&&s&&typeof r=="object"&&typeof s=="object"?Object.keys(s).every(i=>Eo(r[i],s[i])):!1}var Bv=Object.prototype.hasOwnProperty;function hp(r,s,i=0){if(r===s)return r;if(i>500)return s;const a=yh(r)&&yh(s);if(!a&&!(ju(r)&&ju(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 Cu(r,s,i){return typeof i.structuralSharing=="function"?i.structuralSharing(r,s):i.structuralSharing!==!1?hp(r,s):s}function Hv(r,s,i=0){const a=[...r,s];return i&&a.length>i?a.slice(1):a}function Wv(r,s,i=0){const a=[s,...r];return i&&a.length>i?a.slice(0,-1):a}var tc=Symbol();function pp(r,s){return!r.queryFn&&(s!=null&&s.initialPromise)?()=>s.initialPromise:!r.queryFn||r.queryFn===tc?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function mp(r,s){return typeof r=="function"?r(...s):!!r}function Qv(r,s,i){let a=!1,u;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(u??(u=s()),a||(a=!0,u.aborted?i():u.addEventListener("abort",i,{once:!0})),u)}),r}var No=(()=>{let r=()=>Uv;return{isServer(){return r()},setIsServer(s){r=s}}})();function _u(){let r,s;const i=new Promise((u,f)=>{r=u,s=f});i.status="pending",i.catch(()=>{});function a(u){Object.assign(i,u),delete i.resolve,delete i.reject}return i.resolve=u=>{a({status:"fulfilled",value:u}),r(u)},i.reject=u=>{a({status:"rejected",reason:u}),s(u)},i}var Kv=Fv;function qv(){let r=[],s=0,i=h=>{h()},a=h=>{h()},u=Kv;const f=h=>{s?r.push(h):u(()=>{i(h)})},m=()=>{const h=r;r=[],h.length&&u(()=>{a(()=>{h.forEach(y=>{i(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=>{i=h},setBatchNotifyFunction:h=>{a=h},setScheduler:h=>{u=h}}}var ot=qv(),us,Vn,cs,np,Gv=(np=class extends Do{constructor(){super();pe(this,us,!0);pe(this,Vn);pe(this,cs);J(this,cs,s=>{if(typeof window<"u"&&window.addEventListener){const i=()=>s(!0),a=()=>s(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",i),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 i;J(this,cs,s),(i=E(this,Vn))==null||i.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,np),sl=new Gv;function Zv(r){return Math.min(1e3*2**r,3e4)}function gp(r){return(r??"online")==="online"?sl.isOnline():!0}var Pu=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function vp(r){let s=!1,i=0,a;const u=_u(),f=()=>u.status!=="pending",m=S=>{var P;if(!f()){const A=new Pu(S);R(A),(P=r.onCancel)==null||P.call(r,A)}},h=()=>{s=!0},y=()=>{s=!1},k=()=>Ju.isFocused()&&(r.networkMode==="always"||sl.isOnline())&&r.canRun(),w=()=>gp(r.networkMode)&&r.canRun(),x=S=>{f()||(a==null||a(),u.resolve(S))},R=S=>{f()||(a==null||a(),u.reject(S))},_=()=>new Promise(S=>{var P;a=A=>{(f()||k())&&S(A)},(P=r.onPause)==null||P.call(r)}).then(()=>{var S;a=void 0,f()||(S=r.onContinue)==null||S.call(r)}),D=()=>{if(f())return;let S;const P=i===0?r.initialPromise:void 0;try{S=P??r.fn()}catch(A){S=Promise.reject(A)}Promise.resolve(S).then(x).catch(A=>{var G;if(f())return;const F=r.retry??(No.isServer()?0:3),V=r.retryDelay??Zv,I=typeof V=="function"?V(i,A):V,K=F===!0||typeof F=="number"&&ik()?void 0:_()).then(()=>{s?R(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,rp,yp=(rp=class{constructor(){pe(this,hr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Eu(this.gcTime)&&J(this,hr,dr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(No.isServer()?1/0:300*1e3))}clearGcTimeout(){E(this,hr)!==void 0&&(dr.clearTimeout(E(this,hr)),J(this,hr,void 0))}},hr=new WeakMap,rp);function Yv(r){return{onFetch:(s,i)=>{var w,x,R,_,D;const a=s.options,u=(R=(x=(w=s.fetchOptions)==null?void 0:w.meta)==null?void 0:x.fetchMore)==null?void 0:R.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 S=!1;const P=V=>{Qv(V,()=>s.signal,()=>S=!0)},A=pp(s.options,s.fetchOptions),F=async(V,I,K)=>{if(S)return Promise.reject(s.signal.reason);if(I==null&&V.pages.length)return Promise.resolve(V);const ue=(()=>{const ke={client:s.client,queryKey:s.queryKey,pageParam:I,direction:K?"backward":"forward",meta:s.options.meta};return P(ke),ke})(),ie=await A(ue),{maxPages:ee}=s.options,me=K?Wv:Hv;return{pages:me(V.pages,ie,ee),pageParams:me(V.pageParams,I,ee)}};if(u&&f.length){const V=u==="backward",I=V?Xv:wh,K={pages:f,pageParams:m},G=I(a,K);h=await F(K,G,V)}else{const V=r??f.length;do{const I=y===0?m[0]??a.initialPageParam:wh(a,h);if(y>0&&I==null)break;h=await F(h,I),y++}while(y{var S,P;return(P=(S=s.options).persister)==null?void 0:P.call(S,k,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},i)}:s.fetchFn=k}}}function wh(r,{pages:s,pageParams:i}){const a=s.length-1;return s.length>0?r.getNextPageParam(s[a],s,i[a],i):void 0}function Xv(r,{pages:s,pageParams:i}){var a;return s.length>0?(a=r.getPreviousPageParam)==null?void 0:a.call(r,s[0],s,i[0],i):void 0}var ds,pr,fs,At,mr,nt,Ro,gr,_t,xp,pn,sp,Jv=(sp=class extends yp{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,Ro);pe(this,gr);J(this,gr,!1),J(this,Ro,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,bh(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,Ro),...s},s!=null&&s._type&&J(this,ds,s._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=bh(this.options);i.data!==void 0&&(this.setState(kh(i.data,i.dataUpdatedAt)),J(this,pr,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,At).remove(this)}setData(s,i){const a=Cu(this.state.data,s,this.options);return _e(this,_t,pn).call(this,{data:a,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),a}setState(s){_e(this,_t,pn).call(this,{type:"setState",state:s})}cancel(s){var a,u;const i=(a=E(this,nt))==null?void 0:a.promise;return(u=E(this,nt))==null||u.cancel(s),i?i.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===tc||!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:!fp(this.state.dataUpdatedAt,s)}onFocus(){var i;const s=this.observers.find(a=>a.shouldFetchOnWindowFocus());s==null||s.refetch({cancelRefetch:!1}),(i=E(this,nt))==null||i.continue()}onOnline(){var i;const s=this.observers.find(a=>a.shouldFetchOnReconnect());s==null||s.refetch({cancelRefetch:!1}),(i=E(this,nt))==null||i.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(i=>i!==s),this.observers.length||(E(this,nt)&&(E(this,gr)||_e(this,_t,xp).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,i){var k,w,x,R,_,D,S,P,A,F,V;if(this.state.fetchStatus!=="idle"&&((k=E(this,nt))==null?void 0:k.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.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 I=this.observers.find(K=>K.options.queryFn);I&&this.setOptions(I.options)}const a=new AbortController,u=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(J(this,gr,!0),a.signal)})},f=()=>{const I=pp(this.options,i),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(I,G,this):I(G)},h=(()=>{const I={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:E(this,mr),state:this.state,fetchFn:f};return u(I),I})(),y=E(this,ds)==="infinite"?Yv(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,vp({initialPromise:i==null?void 0:i.initialPromise,fn:h.fetchFn,onCancel:I=>{I instanceof Pu&&I.revert&&this.setState({...E(this,fs),fetchStatus:"idle"}),a.abort()},onFail:(I,K)=>{_e(this,_t,pn).call(this,{type:"failed",failureCount:I,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 I=await E(this,nt).start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(_=(R=E(this,At).config).onSuccess)==null||_.call(R,I,this),(S=(D=E(this,At).config).onSettled)==null||S.call(D,I,this.state.error,this),I}catch(I){if(I instanceof Pu){if(I.silent)return E(this,nt).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw _e(this,_t,pn).call(this,{type:"error",error:I}),(A=(P=E(this,At).config).onError)==null||A.call(P,I,this),(V=(F=E(this,At).config).onSettled)==null||V.call(F,this.state.data,I,this),I}finally{this.scheduleGc()}}},ds=new WeakMap,pr=new WeakMap,fs=new WeakMap,At=new WeakMap,mr=new WeakMap,nt=new WeakMap,Ro=new WeakMap,gr=new WeakMap,_t=new WeakSet,xp=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},pn=function(s){const i=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,...wp(a.data,this.options),fetchMeta:s.meta??null};case"success":const u={...a,...kh(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=i(this.state),ot.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),E(this,At).notify({query:this,type:"updated",action:s})})},sp);function wp(r,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gp(s.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function kh(r,s){return{data:r,dataUpdatedAt:s??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bh(r){const s=typeof r.initialData=="function"?r.initialData():r.initialData,i=s!==void 0,a=i?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:i?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var kt,Re,Mo,pt,vr,hs,mn,Hn,Oo,ps,ms,yr,xr,Wn,gs,Te,wo,Ru,Mu,Ou,Tu,Lu,Du,Au,kp,op,ey=(op=class extends Do{constructor(s,i){super();pe(this,Te);pe(this,kt);pe(this,Re);pe(this,Mo);pe(this,pt);pe(this,vr);pe(this,hs);pe(this,mn);pe(this,Hn);pe(this,Oo);pe(this,ps);pe(this,ms);pe(this,yr);pe(this,xr);pe(this,Wn);pe(this,gs,new Set);this.options=i,J(this,kt,s),J(this,Hn,null),J(this,mn,_u()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,Re).addObserver(this),Sh(E(this,Re),this.options)?_e(this,Te,wo).call(this):this.updateResult(),_e(this,Te,Tu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Iu(E(this,Re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Iu(E(this,Re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_e(this,Te,Lu).call(this),_e(this,Te,Du).call(this),E(this,Re).removeObserver(this)}setOptions(s){const i=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,Au).call(this),E(this,Re).setOptions(this.options),i._defaulted&&!Nu(this.options,i)&&E(this,kt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,Re),observer:this});const u=this.hasListeners();u&&Eh(E(this,Re),a,this.options,i)&&_e(this,Te,wo).call(this),this.updateResult(),u&&(E(this,Re)!==a||Pt(this.options.enabled,E(this,Re))!==Pt(i.enabled,E(this,Re))||Gn(this.options.staleTime,E(this,Re))!==Gn(i.staleTime,E(this,Re)))&&_e(this,Te,Ru).call(this);const f=_e(this,Te,Mu).call(this);u&&(E(this,Re)!==a||Pt(this.options.enabled,E(this,Re))!==Pt(i.enabled,E(this,Re))||f!==E(this,Wn))&&_e(this,Te,Ou).call(this,f)}getOptimisticResult(s){const i=E(this,kt).getQueryCache().build(E(this,kt),s),a=this.createResult(i,s);return ny(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,i){return new Proxy(s,{get:(a,u)=>(this.trackProp(u),i==null||i(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 i=E(this,kt).defaultQueryOptions(s),a=E(this,kt).getQueryCache().build(E(this,kt),i);return a.fetch().then(()=>this.createResult(a,i))}fetch(s){return _e(this,Te,wo).call(this,{...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,pt)))}createResult(s,i){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,Mo),{state:w}=s;let x={...w},R=!1,_;if(i._optimisticResults){const me=this.hasListeners(),ke=!me&&Sh(s,i),le=me&&Eh(s,a,i,u);(ke||le)&&(x={...x,...wp(w.data,s.options)}),i._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:D,errorUpdatedAt:S,status:P}=x;_=x.data;let A=!1;if(i.placeholderData!==void 0&&_===void 0&&P==="pending"){let me;f!=null&&f.isPlaceholderData&&i.placeholderData===(h==null?void 0:h.placeholderData)?(me=f.data,A=!0):me=typeof i.placeholderData=="function"?i.placeholderData((ee=E(this,ms))==null?void 0:ee.state.data,E(this,ms)):i.placeholderData,me!==void 0&&(P="success",_=Cu(f==null?void 0:f.data,me,i),R=!0)}if(i.select&&_!==void 0&&!A)if(f&&_===(m==null?void 0:m.data)&&i.select===E(this,Oo))_=E(this,ps);else try{J(this,Oo,i.select),_=i.select(_),_=Cu(f==null?void 0:f.data,_,i),J(this,ps,_),J(this,Hn,null)}catch(me){J(this,Hn,me)}E(this,Hn)&&(D=E(this,Hn),_=E(this,ps),S=Date.now(),P="error");const F=x.fetchStatus==="fetching",V=P==="pending",I=P==="error",K=V&&F,G=_!==void 0,ie={status:P,fetchStatus:x.fetchStatus,isPending:V,isSuccess:P==="success",isError:I,isInitialLoading:K,isLoading:K,data:_,dataUpdatedAt:x.dataUpdatedAt,error:D,errorUpdatedAt:S,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:s.isFetched(),isFetchedAfterMount:x.dataUpdateCount>k.dataUpdateCount||x.errorUpdateCount>k.errorUpdateCount,isFetching:F,isRefetching:F&&!V,isLoadingError:I&&!G,isPaused:x.fetchStatus==="paused",isPlaceholderData:R,isRefetchError:I&&G,isStale:nc(s,i),refetch:this.refetch,promise:E(this,mn),isEnabled:Pt(i.enabled,s)!==!1};if(this.options.experimental_prefetchInRender){const me=ie.data!==void 0,ke=ie.status==="error"&&!me,le=ce=>{ke?ce.reject(ie.error):me&&ce.resolve(ie.data)},Le=()=>{const ce=J(this,mn,ie.promise=_u());le(ce)},Z=E(this,mn);switch(Z.status){case"pending":s.queryHash===a.queryHash&&le(Z);break;case"fulfilled":(ke||ie.data!==Z.value)&&Le();break;case"rejected":(!ke||ie.error!==Z.reason)&&Le();break}}return ie}updateResult(){const s=E(this,pt),i=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)),Nu(i,s))return;J(this,pt,i);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,kp).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_e(this,Te,Tu).call(this)}},kt=new WeakMap,Re=new WeakMap,Mo=new WeakMap,pt=new WeakMap,vr=new WeakMap,hs=new WeakMap,mn=new WeakMap,Hn=new WeakMap,Oo=new WeakMap,ps=new WeakMap,ms=new WeakMap,yr=new WeakMap,xr=new WeakMap,Wn=new WeakMap,gs=new WeakMap,Te=new WeakSet,wo=function(s){_e(this,Te,Au).call(this);let i=E(this,Re).fetch(this.options,s);return s!=null&&s.throwOnError||(i=i.catch(bt)),i},Ru=function(){_e(this,Te,Lu).call(this);const s=Gn(this.options.staleTime,E(this,Re));if(No.isServer()||E(this,pt).isStale||!Eu(s))return;const a=fp(E(this,pt).dataUpdatedAt,s)+1;J(this,yr,dr.setTimeout(()=>{E(this,pt).isStale||this.updateResult()},a))},Mu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,Re)):this.options.refetchInterval)??!1},Ou=function(s){_e(this,Te,Du).call(this),J(this,Wn,s),!(No.isServer()||Pt(this.options.enabled,E(this,Re))===!1||!Eu(E(this,Wn))||E(this,Wn)===0)&&J(this,xr,dr.setInterval(()=>{(this.options.refetchIntervalInBackground||Ju.isFocused())&&_e(this,Te,wo).call(this)},E(this,Wn)))},Tu=function(){_e(this,Te,Ru).call(this),_e(this,Te,Ou).call(this,_e(this,Te,Mu).call(this))},Lu=function(){E(this,yr)!==void 0&&(dr.clearTimeout(E(this,yr)),J(this,yr,void 0))},Du=function(){E(this,xr)!==void 0&&(dr.clearInterval(E(this,xr)),J(this,xr,void 0))},Au=function(){const s=E(this,kt).getQueryCache().build(E(this,kt),this.options);if(s===E(this,Re))return;const i=E(this,Re);J(this,Re,s),J(this,Mo,s.state),this.hasListeners()&&(i==null||i.removeObserver(this),s.addObserver(this))},kp=function(s){ot.batch(()=>{s.listeners&&this.listeners.forEach(i=>{i(E(this,pt))}),E(this,kt).getQueryCache().notify({query:E(this,Re),type:"observerResultsUpdated"})})},op);function ty(r,s){return Pt(s.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&Pt(s.retryOnMount,r)===!1)}function Sh(r,s){return ty(r,s)||r.state.data!==void 0&&Iu(r,s,s.refetchOnMount)}function Iu(r,s,i){if(Pt(s.enabled,r)!==!1&&Gn(s.staleTime,r)!=="static"){const a=typeof i=="function"?i(r):i;return a==="always"||a!==!1&&nc(r,s)}return!1}function Eh(r,s,i,a){return(r!==s||Pt(a.enabled,r)===!1)&&(!i.suspense||r.state.status!=="error")&&nc(r,i)}function nc(r,s){return Pt(s.enabled,r)!==!1&&r.isStaleByTime(Gn(s.staleTime,r))}function ny(r,s){return!Nu(r.getCurrentResult(),s)}var To,Jt,dt,wr,en,Fn,ip,ry=(ip=class extends yp{constructor(s){super();pe(this,en);pe(this,To);pe(this,Jt);pe(this,dt);pe(this,wr);J(this,To,s.client),this.mutationId=s.mutationId,J(this,dt,s.mutationCache),J(this,Jt,[]),this.state=s.state||sy(),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(i=>i!==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,R,_,D,S,P,A,F,V,I,K,G,ue;const i=()=>{_e(this,en,Fn).call(this,{type:"continue"})},a={client:E(this,To),meta:this.options.meta,mutationKey:this.options.mutationKey};J(this,wr,vp({fn:()=>this.options.mutationFn?this.options.mutationFn(s,a):Promise.reject(new Error("No mutationFn found")),onFail:(ie,ee)=>{_e(this,en,Fn).call(this,{type:"failed",failureCount:ie,error:ee})},onPause:()=>{_e(this,en,Fn).call(this,{type:"pause"})},onContinue:i,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)i();else{_e(this,en,Fn).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,Fn).call(this,{type:"pending",context:ee,variables:s,isPaused:f})}const ie=await E(this,wr).start();return await((k=(y=E(this,dt).config).onSuccess)==null?void 0:k.call(y,ie,s,this.state.context,this,a)),await((x=(w=this.options).onSuccess)==null?void 0:x.call(w,ie,s,this.state.context,a)),await((_=(R=E(this,dt).config).onSettled)==null?void 0:_.call(R,ie,null,this.state.variables,this.state.context,this,a)),await((S=(D=this.options).onSettled)==null?void 0:S.call(D,ie,null,s,this.state.context,a)),_e(this,en,Fn).call(this,{type:"success",data:ie}),ie}catch(ie){try{await((A=(P=E(this,dt).config).onError)==null?void 0:A.call(P,ie,s,this.state.context,this,a))}catch(ee){Promise.reject(ee)}try{await((V=(F=this.options).onError)==null?void 0:V.call(F,ie,s,this.state.context,a))}catch(ee){Promise.reject(ee)}try{await((K=(I=E(this,dt).config).onSettled)==null?void 0:K.call(I,void 0,ie,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,ie,s,this.state.context,a))}catch(ee){Promise.reject(ee)}throw _e(this,en,Fn).call(this,{type:"error",error:ie}),ie}finally{E(this,dt).runNext(this)}}},To=new WeakMap,Jt=new WeakMap,dt=new WeakMap,wr=new WeakMap,en=new WeakSet,Fn=function(s){const i=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=i(this.state),ot.batch(()=>{E(this,Jt).forEach(a=>{a.onMutationUpdate(s)}),E(this,dt).notify({mutation:this,type:"updated",action:s})})},ip);function sy(){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,Lo,lp,oy=(lp=class extends Do{constructor(s={}){super();pe(this,gn);pe(this,Ht);pe(this,Lo);this.config=s,J(this,gn,new Set),J(this,Ht,new Map),J(this,Lo,0)}build(s,i,a){const u=new ry({client:s,mutationCache:this,mutationId:++Wi(this,Lo)._,options:s.defaultMutationOptions(i),state:a});return this.add(u),u}add(s){E(this,gn).add(s);const i=Ki(s);if(typeof i=="string"){const a=E(this,Ht).get(i);a?a.push(s):E(this,Ht).set(i,[s])}this.notify({type:"added",mutation:s})}remove(s){if(E(this,gn).delete(s)){const i=Ki(s);if(typeof i=="string"){const a=E(this,Ht).get(i);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(i)}}this.notify({type:"removed",mutation:s})}canRun(s){const i=Ki(s);if(typeof i=="string"){const a=E(this,Ht).get(i),u=a==null?void 0:a.find(f=>f.state.status==="pending");return!u||u===s}else return!0}runNext(s){var a;const i=Ki(s);if(typeof i=="string"){const u=(a=E(this,Ht).get(i))==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(){ot.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 i={exact:!0,...s};return this.getAll().find(a=>vh(i,a))}findAll(s={}){return this.getAll().filter(i=>vh(s,i))}notify(s){ot.batch(()=>{this.listeners.forEach(i=>{i(s)})})}resumePausedMutations(){const s=this.getAll().filter(i=>i.state.isPaused);return ot.batch(()=>Promise.all(s.map(i=>i.continue().catch(bt))))}},gn=new WeakMap,Ht=new WeakMap,Lo=new WeakMap,lp);function Ki(r){var s;return(s=r.options.scope)==null?void 0:s.id}var tn,ap,iy=(ap=class extends Do{constructor(s={}){super();pe(this,tn);this.config=s,J(this,tn,new Map)}build(s,i,a){const u=i.queryKey,f=i.queryHash??ec(u,i);let m=this.get(f);return m||(m=new Jv({client:s,queryKey:u,queryHash:f,options:s.defaultQueryOptions(i),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 i=E(this,tn).get(s.queryHash);i&&(s.destroy(),i===s&&E(this,tn).delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){ot.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 i={exact:!0,...s};return this.getAll().find(a=>gh(i,a))}findAll(s={}){const i=this.getAll();return Object.keys(s).length>0?i.filter(a=>gh(s,a)):i}notify(s){ot.batch(()=>{this.listeners.forEach(i=>{i(s)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},tn=new WeakMap,ap),Qe,Qn,Kn,vs,ys,qn,xs,ws,up,ly=(up=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 iy),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(){Wi(this,qn)._++,E(this,qn)===1&&(J(this,xs,Ju.subscribe(async r=>{r&&(await this.resumePausedMutations(),E(this,Qe).onFocus())})),J(this,ws,sl.subscribe(async r=>{r&&(await this.resumePausedMutations(),E(this,Qe).onOnline())})))}unmount(){var r,s;Wi(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 i;const s=this.defaultQueryOptions({queryKey:r});return(i=E(this,Qe).get(s.queryHash))==null?void 0:i.state.data}ensureQueryData(r){const s=this.defaultQueryOptions(r),i=E(this,Qe).build(this,s),a=i.state.data;return a===void 0?this.fetchQuery(r):(r.revalidateIfStale&&i.isStaleByTime(Gn(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(a))}getQueriesData(r){return E(this,Qe).findAll(r).map(({queryKey:s,state:i})=>{const a=i.data;return[s,a]})}setQueryData(r,s,i){const a=this.defaultQueryOptions({queryKey:r}),u=E(this,Qe).get(a.queryHash),f=u==null?void 0:u.state.data,m=$v(s,f);if(m!==void 0)return E(this,Qe).build(this,a).setData(m,{...i,manual:!0})}setQueriesData(r,s,i){return ot.batch(()=>E(this,Qe).findAll(r).map(({queryKey:a})=>[a,this.setQueryData(a,s,i)]))}getQueryState(r){var i;const s=this.defaultQueryOptions({queryKey:r});return(i=E(this,Qe).get(s.queryHash))==null?void 0:i.state}removeQueries(r){const s=E(this,Qe);ot.batch(()=>{s.findAll(r).forEach(i=>{s.remove(i)})})}resetQueries(r,s){const i=E(this,Qe);return ot.batch(()=>(i.findAll(r).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...r},s)))}cancelQueries(r,s={}){const i={revert:!0,...s},a=ot.batch(()=>E(this,Qe).findAll(r).map(u=>u.cancel(i)));return Promise.all(a).then(bt).catch(bt)}invalidateQueries(r,s={}){return ot.batch(()=>(E(this,Qe).findAll(r).forEach(i=>{i.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 i={...s,cancelRefetch:s.cancelRefetch??!0},a=ot.batch(()=>E(this,Qe).findAll(r).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,i);return i.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 i=E(this,Qe).build(this,s);return i.isStaleByTime(Gn(s.staleTime,i))?i.fetch(s):Promise.resolve(i.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 sl.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(So(r),{queryKey:r,defaultOptions:s})}getQueryDefaults(r){const s=[...E(this,vs).values()],i={};return s.forEach(a=>{Eo(r,a.queryKey)&&Object.assign(i,a.defaultOptions)}),i}setMutationDefaults(r,s){E(this,ys).set(So(r),{mutationKey:r,defaultOptions:s})}getMutationDefaults(r){const s=[...E(this,ys).values()],i={};return s.forEach(a=>{Eo(r,a.mutationKey)&&Object.assign(i,a.defaultOptions)}),i}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=ec(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===tc&&(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,up),bp=g.createContext(void 0),ll=r=>{const s=g.useContext(bp);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},ay=({client:r,children:s})=>(g.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),d.jsx(bp.Provider,{value:r,children:s})),Sp=g.createContext(!1),uy=()=>g.useContext(Sp);Sp.Provider;function cy(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var dy=g.createContext(cy()),fy=()=>g.useContext(dy),hy=(r,s,i)=>{const a=i!=null&&i.state.error&&typeof r.throwOnError=="function"?mp(r.throwOnError,[i.state.error,i]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||a)&&(s.isReset()||(r.retryOnMount=!1))},py=r=>{g.useEffect(()=>{r.clearReset()},[r])},my=({result:r,errorResetBoundary:s,throwOnError:i,query:a,suspense:u})=>r.isError&&!s.isReset()&&!r.isFetching&&a&&(u&&r.data===void 0||mp(i,[r.error,a])),gy=r=>{if(r.suspense){const i=u=>u==="static"?u:Math.max(u??1e3,1e3),a=r.staleTime;r.staleTime=typeof a=="function"?(...u)=>i(a(...u)):i(a),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},vy=(r,s)=>r.isLoading&&r.isFetching&&!s,yy=(r,s)=>(r==null?void 0:r.suspense)&&s.isPending,Nh=(r,s,i)=>s.fetchOptimistic(r).catch(()=>{i.clearReset()});function xy(r,s,i){var _,D,S,P;const a=uy(),u=fy(),f=ll(),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,gy(m),hy(m,u,h),py(u);const k=!f.getQueryCache().get(m.queryHash),[w]=g.useState(()=>new s(f,m)),x=w.getOptimisticResult(m),R=!a&&y;if(g.useSyncExternalStore(g.useCallback(A=>{const F=R?w.subscribe(ot.batchCalls(A)):bt;return w.updateResult(),F},[w,R]),()=>w.getCurrentResult(),()=>w.getCurrentResult()),g.useEffect(()=>{w.setOptions(m)},[m,w]),yy(m,x))throw Nh(m,w,u);if(my({result:x,errorResetBoundary:u,throwOnError:m.throwOnError,query:h,suspense:m.suspense}))throw x.error;if((P=(S=f.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||P.call(S,m,x),m.experimental_prefetchInRender&&!No.isServer()&&vy(x,a)){const A=k?Nh(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 xy(r,ey)}const wy="modulepreload",ky=function(r){return"/"+r},jh={},Wt=function(s,i,a){let u=Promise.resolve();if(i&&i.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(i.map(k=>{if(k=ky(k),k in jh)return;jh[k]=!0;const w=k.endsWith(".css"),x=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${k}"]${x}`))return;const R=document.createElement("link");if(R.rel=w?"stylesheet":wy,w||(R.as="script"),R.crossOrigin="",R.href=k,y&&R.setAttribute("nonce",y),document.head.appendChild(R),w)return new Promise((_,D)=>{R.addEventListener("load",_),R.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 by=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ep=(...r)=>r.filter((s,i,a)=>!!s&&s.trim()!==""&&a.indexOf(s)===i).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 Sy={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 Ey=g.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:u="",children:f,iconNode:m,...h},y)=>g.createElement("svg",{ref:y,...Sy,width:s,height:s,stroke:r,strokeWidth:a?Number(i)*24/Number(s):i,className:Ep("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 i=g.forwardRef(({className:a,...u},f)=>g.createElement(Ey,{ref:f,iconNode:s,className:Ep(`lucide-${by(r)}`,a),...u}));return i.displayName=`${r}`,i};/** * @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=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 Ch=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 jy=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 jo=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 Cy=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 Np=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 _y=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 Py=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 Ry=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 My=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 ko=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 Oy=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 jp=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 Ty=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 Ly=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 Dy=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 Cp=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 Ay=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 _h=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 zu=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 zy=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 Fy=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 Uy=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 $y=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 By=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 rc=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 Vy=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 Hy=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 Wy=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 sc=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 Ky=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 qy=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 Ph=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 Gy=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 Zy=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 al=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 ic=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 Yy=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 lc=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 _p=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 Xy=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 Jy=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 e0=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 t0=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 Co=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 n0=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 ul=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),os=[{id:"dashboard",label:"Cockpit",hint:"Deine Box auf einen Blick",icon:Hy,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:rc,group:"Operativ"},{id:"skills",label:"Skills & Jobs",hint:"Autonome Skills manuell auslösen",icon:jo,group:"Operativ"},{id:"chronik",label:"Chronik",hint:"Was die Box von allein getan hat + Zeitmaschine",icon:By,group:"Operativ"},{id:"wissen",label:"Wissen",hint:"Lucys Wissens-Vault (Traum-Notizen)",icon:Wy,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:e0,group:"Werkzeuge"},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:jp,group:"Werkzeuge"},{id:"models",label:"Modelle",hint:"Speicher, laden & Rollen",icon:Np,group:"Wartung"},{id:"agent",label:"Hermes",hint:"Agent-Status & Verdrahtung",icon:jo,group:"Wartung"}];var Rh=1,r0=.9,s0=.8,o0=.17,fu=.1,hu=.999,i0=.9999,l0=.99,a0=/[\\\/_+.#"@\[\(\{&]/,u0=/[\\\/_+.#"@\[\(\{&]/g,c0=/[\s-]/,Pp=/[\s-]/g;function Fu(r,s,i,a,u,f,m){if(f===s.length)return u===r.length?Rh:l0;var h=`${u},${f}`;if(m[h]!==void 0)return m[h];for(var y=a.charAt(f),k=i.indexOf(y,u),w=0,x,R,_,D;k>=0;)x=Fu(r,s,i,a,k+1,f+1,m),x>w&&(k===u?x*=Rh:a0.test(r.charAt(k-1))?(x*=s0,_=r.slice(u,k-1).match(u0),_&&u>0&&(x*=Math.pow(hu,_.length))):c0.test(r.charAt(k-1))?(x*=r0,D=r.slice(u,k-1).match(Pp),D&&u>0&&(x*=Math.pow(hu,D.length))):(x*=o0,u>0&&(x*=Math.pow(hu,k-u))),r.charAt(k)!==s.charAt(f)&&(x*=i0)),(xx&&(x=R*fu)),x>w&&(w=x),k=i.indexOf(y,k+1);return m[h]=w,w}function Mh(r){return r.toLowerCase().replace(Pp," ")}function d0(r,s,i){return r=i&&i.length>0?`${r+" "+i.join(" ")}`:r,Fu(r,s,Mh(r),Mh(s),0,0,{})}function Zn(r,s,{checkForDefaultPrevented:i=!0}={}){return function(u){if(r==null||r(u),i===!1||!u.defaultPrevented)return s==null?void 0:s(u)}}function Oh(r,s){if(typeof r=="function")return r(s);r!=null&&(r.current=s)}function ks(...r){return s=>{let i=!1;const a=r.map(u=>{const f=Oh(u,s);return!i&&typeof f=="function"&&(i=!0),f});if(i)return()=>{for(let u=0;u{var A;const{scope:R,children:_,...D}=x,S=((A=R==null?void 0:R[r])==null?void 0:A[y])||h,P=g.useMemo(()=>D,Object.values(D));return d.jsx(S.Provider,{value:P,children:_})};k.displayName=f+"Provider";function w(x,R){var S;const _=((S=R==null?void 0:R[r])==null?void 0:S[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=i.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,h0(u,...s)]}function h0(...r){const s=r[0];if(r.length===1)return s;const i=()=>{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 i.scopeName=s.scopeName,i}var _o=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},p0=Xu[" useId ".trim().toString()]||(()=>{}),m0=0;function vn(r){const[s,i]=g.useState(p0());return _o(()=>{i(a=>a??String(m0++))},[r]),s?`radix-${s}`:""}var g0=Xu[" useInsertionEffect ".trim().toString()]||_o;function v0({prop:r,defaultProp:s,onChange:i=()=>{},caller:a}){const[u,f,m]=y0({defaultProp:s,onChange:i}),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 R=x0(w)?w(r):w;R!==r&&((x=m.current)==null||x.call(m,R))}else f(w)},[h,r,f,m]);return[y,k]}function y0({defaultProp:r,onChange:s}){const[i,a]=g.useState(r),u=g.useRef(i),f=g.useRef(s);return g0(()=>{f.current=s},[s]),g.useEffect(()=>{var m;u.current!==i&&((m=f.current)==null||m.call(f,i),u.current=i)},[i,u]),[i,a,f]}function x0(r){return typeof r=="function"}var Rp=dp();function Mp(r){const s=g.forwardRef((i,a)=>{let{children:u,...f}=i,m=null,h=!1;const y=[];Th(u)&&typeof qi=="function"&&(u=qi(u._payload)),g.Children.forEach(u,R=>{var _;if(E0(R)){h=!0;const D=R;let S="child"in D.props?D.props.child:D.props.children;Th(S)&&typeof qi=="function"&&(S=qi(S._payload)),m=k0(D,S),y.push((_=m==null?void 0:m.props)==null?void 0:_.children)}else y.push(R)}),m?m=g.cloneElement(m,void 0,y):!h&&g.Children.count(u)===1&&g.isValidElement(u)&&(m=u);const k=m?S0(m):void 0,w=br(a,k);if(!m){if(u||u===0)throw new Error(h?_0(r):C0(r));return u}const x=b0(f,m.props??{});return m.type!==g.Fragment&&(x.ref=a?w:k),g.cloneElement(m,x)});return s.displayName=`${r}.Slot`,s}var w0=Symbol.for("radix.slottable"),k0=(r,s)=>{if("child"in r.props){const i=r.props.child;return g.isValidElement(i)?g.cloneElement(i,void 0,r.props.children(i.props.children)):null}return g.isValidElement(s)?s:null};function b0(r,s){const i={...s};for(const a in s){const u=r[a],f=s[a];/^on[A-Z]/.test(a)?u&&f?i[a]=(...h)=>{const y=f(...h);return u(...h),y}:u&&(i[a]=u):a==="style"?i[a]={...u,...f}:a==="className"&&(i[a]=[u,f].filter(Boolean).join(" "))}return{...r,...i}}function S0(r){var a,u;let s=(a=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:a.get,i=s&&"isReactWarning"in s&&s.isReactWarning;return i?r.ref:(s=(u=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:u.get,i=s&&"isReactWarning"in s&&s.isReactWarning,i?r.props.ref:r.props.ref||r.ref)}function E0(r){return g.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===w0}var N0=Symbol.for("react.lazy");function Th(r){return r!=null&&typeof r=="object"&&"$$typeof"in r&&r.$$typeof===N0&&"_payload"in r&&j0(r._payload)}function j0(r){return typeof r=="object"&&r!==null&&"then"in r}var C0=r=>`${r} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,_0=r=>`${r} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,qi=Xu[" use ".trim().toString()],P0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],it=P0.reduce((r,s)=>{const i=Mp(`Primitive.${s}`),a=g.forwardRef((u,f)=>{const{asChild:m,...h}=u,y=m?i: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 R0(r,s){r&&Rp.flushSync(()=>r.dispatchEvent(s))}function Po(r){const s=g.useRef(r);return g.useEffect(()=>{s.current=r}),g.useMemo(()=>((...i)=>{var a;return(a=s.current)==null?void 0:a.call(s,...i)}),[])}function M0(r,s=globalThis==null?void 0:globalThis.document){const i=Po(r);g.useEffect(()=>{const a=u=>{u.key==="Escape"&&i(u)};return s.addEventListener("keydown",a,{capture:!0}),()=>s.removeEventListener("keydown",a,{capture:!0})},[i,s])}var O0="DismissableLayer",Uu="dismissableLayer.update",T0="dismissableLayer.pointerDownOutside",L0="dismissableLayer.focusOutside",Lh,ac=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Op=g.forwardRef((r,s)=>{const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:h,onDismiss:y,...k}=r,w=g.useContext(ac),[x,R]=g.useState(null),_=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,D]=g.useState({}),S=br(s,ee=>R(ee)),P=Array.from(w.layers),[A]=[...w.layersWithOutsidePointerEventsDisabled].slice(-1),F=P.indexOf(A),V=x?P.indexOf(x):-1,I=w.layersWithOutsidePointerEventsDisabled.size>0,K=V>=F,G=g.useRef(!1),ue=z0(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}),ie=F0(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 M0(ee=>{V===w.layers.size-1&&(u==null||u(ee),!ee.defaultPrevented&&y&&(ee.preventDefault(),y()))},_),g.useEffect(()=>{if(x)return i&&(w.layersWithOutsidePointerEventsDisabled.size===0&&(Lh=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),w.layersWithOutsidePointerEventsDisabled.add(x)),w.layers.add(x),Dh(),()=>{i&&(w.layersWithOutsidePointerEventsDisabled.delete(x),w.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=Lh))}},[x,_,i,w]),g.useEffect(()=>()=>{x&&(w.layers.delete(x),w.layersWithOutsidePointerEventsDisabled.delete(x),Dh())},[x,w]),g.useEffect(()=>{const ee=()=>D({});return document.addEventListener(Uu,ee),()=>document.removeEventListener(Uu,ee)},[]),d.jsx(it.div,{...k,ref:S,style:{pointerEvents:I?K?"auto":"none":void 0,...r.style},onFocusCapture:Zn(r.onFocusCapture,ie.onFocusCapture),onBlurCapture:Zn(r.onBlurCapture,ie.onBlurCapture),onPointerDownCapture:Zn(r.onPointerDownCapture,ue.onPointerDownCapture)})});Op.displayName=O0;var D0="DismissableLayerBranch",A0=g.forwardRef((r,s)=>{const i=g.useContext(ac),a=g.useRef(null),u=br(s,a);return g.useEffect(()=>{const f=a.current;if(f)return i.branches.add(f),()=>{i.branches.delete(f)}},[i.branches]),d.jsx(it.div,{...r,ref:u})});A0.displayName=D0;function I0(){const r=g.useContext(ac),[s,i]=g.useState(null);return g.useEffect(()=>{if(s)return r.dismissableSurfaces.add(s),()=>{r.dismissableSurfaces.delete(s)}},[s,r.dismissableSurfaces]),i}function z0(r,s){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:f}=s,m=Po(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 R(){return Array.from(k.current.values()).some(Boolean)}function _(F){if(!y.current)return;const V=F.target;V instanceof Node&&[...f].some(K=>K.contains(V))||k.current.set(F.type,!0),F.type==="click"&&window.setTimeout(()=>{y.current&&w.current()},0)}function D(F){y.current&&k.current.set(F.type,!1)}const S=F=>{if(F.target&&!h.current){let V=function(){i.removeEventListener("click",w.current);const K=R();x(),K||Tp(T0,m,I,{discrete:!0})};const I={originalEvent:F};y.current=!0,u.current=a&&F.button===0,k.current.clear(),!a||F.button!==0?V():(i.removeEventListener("click",w.current),w.current=V,i.addEventListener("click",w.current,{once:!0}))}else i.removeEventListener("click",w.current),x();h.current=!1},P=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const F of P)i.addEventListener(F,_,!0),i.addEventListener(F,D);const A=window.setTimeout(()=>{i.addEventListener("pointerdown",S)},0);return()=>{window.clearTimeout(A),i.removeEventListener("pointerdown",S),i.removeEventListener("click",w.current);for(const F of P)i.removeEventListener(F,_,!0),i.removeEventListener(F,D)}},[i,m,a,u,f]),{onPointerDownCapture:()=>h.current=!0}}function F0(r,s=globalThis==null?void 0:globalThis.document){const i=Po(r),a=g.useRef(!1);return g.useEffect(()=>{const u=f=>{f.target&&!a.current&&Tp(L0,i,{originalEvent:f},{discrete:!1})};return s.addEventListener("focusin",u),()=>s.removeEventListener("focusin",u)},[s,i]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Dh(){const r=new CustomEvent(Uu);document.dispatchEvent(r)}function Tp(r,s,i,{discrete:a}){const u=i.originalEvent.target,f=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:i});s&&u.addEventListener(r,s,{once:!0}),a?R0(u,f):u.dispatchEvent(f)}var pu="focusScope.autoFocusOnMount",mu="focusScope.autoFocusOnUnmount",Ah={bubbles:!1,cancelable:!0},U0="FocusScope",Lp=g.forwardRef((r,s)=>{const{loop:i=!1,trapped:a=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...m}=r,[h,y]=g.useState(null),k=Po(u),w=Po(f),x=g.useRef(null),R=br(s,S=>y(S)),_=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(a){let S=function(V){if(_.paused||!h)return;const I=V.target;h.contains(I)?x.current=I:Un(x.current,{select:!0})},P=function(V){if(_.paused||!h)return;const I=V.relatedTarget;I!==null&&(h.contains(I)||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",S),document.addEventListener("focusout",P);const F=new MutationObserver(A);return h&&F.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",P),F.disconnect()}}},[a,h,_.paused]),g.useEffect(()=>{if(h){zh.add(_);const S=document.activeElement;if(!h.contains(S)){const A=new CustomEvent(pu,Ah);h.addEventListener(pu,k),h.dispatchEvent(A),A.defaultPrevented||($0(Q0(Dp(h)),{select:!0}),document.activeElement===S&&Un(h))}return()=>{h.removeEventListener(pu,k),setTimeout(()=>{const A=new CustomEvent(mu,Ah);h.addEventListener(mu,w),h.dispatchEvent(A),A.defaultPrevented||Un(S??document.body,{select:!0}),h.removeEventListener(mu,w),zh.remove(_)},0)}}},[h,k,w,_]);const D=g.useCallback(S=>{if(!i&&!a||_.paused)return;const P=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,A=document.activeElement;if(P&&A){const F=S.currentTarget,[V,I]=B0(F);V&&I?!S.shiftKey&&A===I?(S.preventDefault(),i&&Un(V,{select:!0})):S.shiftKey&&A===V&&(S.preventDefault(),i&&Un(I,{select:!0})):A===F&&S.preventDefault()}},[i,a,_.paused]);return d.jsx(it.div,{tabIndex:-1,...m,ref:R,onKeyDown:D})});Lp.displayName=U0;function $0(r,{select:s=!1}={}){const i=document.activeElement;for(const a of r)if(Un(a,{select:s}),document.activeElement!==i)return}function B0(r){const s=Dp(r),i=Ih(s,r),a=Ih(s.reverse(),r);return[i,a]}function Dp(r){const s=[],i=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(;i.nextNode();)s.push(i.currentNode);return s}function Ih(r,s){for(const i of r)if(!V0(i,{upTo:s}))return i}function V0(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 H0(r){return r instanceof HTMLInputElement&&"select"in r}function Un(r,{select:s=!1}={}){if(r&&r.focus){const i=document.activeElement;r.focus({preventScroll:!0}),r!==i&&H0(r)&&s&&r.select()}}var zh=W0();function W0(){let r=[];return{add(s){const i=r[0];s!==i&&(i==null||i.pause()),r=Fh(r,s),r.unshift(s)},remove(s){var i;r=Fh(r,s),(i=r[0])==null||i.resume()}}}function Fh(r,s){const i=[...r],a=i.indexOf(s);return a!==-1&&i.splice(a,1),i}function Q0(r){return r.filter(s=>s.tagName!=="A")}var K0="Portal",Ap=g.forwardRef((r,s)=>{var h;const{container:i,...a}=r,[u,f]=g.useState(!1);_o(()=>f(!0),[]);const m=i||u&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return m?Rp.createPortal(d.jsx(it.div,{...a,ref:s}),m):null});Ap.displayName=K0;function q0(r,s){return g.useReducer((i,a)=>s[i][a]??i,r)}var cl=r=>{const{present:s,children:i}=r,a=G0(s),u=typeof i=="function"?i({present:a.isPresent}):g.Children.only(i),f=Z0(a.ref,Y0(u));return typeof i=="function"||a.isPresent?g.cloneElement(u,{ref:f}):null};cl.displayName="Presence";function G0(r){const[s,i]=g.useState(),a=g.useRef(null),u=g.useRef(r),f=g.useRef("none"),m=r?"mounted":"unmounted",[h,y]=q0(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const k=Gi(a.current);f.current=h==="mounted"?k:"none"},[h]),_o(()=>{const k=a.current,w=u.current;if(w!==r){const R=f.current,_=Gi(k);r?y("MOUNT"):_==="none"||(k==null?void 0:k.display)==="none"?y("UNMOUNT"):y(w&&R!==_?"ANIMATION_OUT":"UNMOUNT"),u.current=r}},[r,y]),_o(()=>{if(s){let k;const w=s.ownerDocument.defaultView??window,x=_=>{const S=Gi(a.current).includes(CSS.escape(_.animationName));if(_.target===s&&S&&(y("ANIMATION_END"),!u.current)){const P=s.style.animationFillMode;s.style.animationFillMode="forwards",k=w.setTimeout(()=>{s.style.animationFillMode==="forwards"&&(s.style.animationFillMode=P)})}},R=_=>{_.target===s&&(f.current=Gi(a.current))};return s.addEventListener("animationstart",R),s.addEventListener("animationcancel",x),s.addEventListener("animationend",x),()=>{w.clearTimeout(k),s.removeEventListener("animationstart",R),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,i(k)},[])}}function Uh(r,s){if(typeof r=="function")return r(s);r!=null&&(r.current=s)}function Z0(...r){const s=g.useRef(r);return s.current=r,g.useCallback(i=>{const a=s.current;let u=!1;const f=a.map(m=>{const h=Uh(m,i);return!u&&typeof h=="function"&&(u=!0),h});if(u)return()=>{for(let m=0;m{Xt||(Xt={start:$h(),end:$h()});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),Zi++,()=>{Zi===1&&(Xt==null||Xt.start.remove(),Xt==null||Xt.end.remove(),Xt=null),Zi=Math.max(0,Zi-1)}},[])}function $h(){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 i,a=1,u=arguments.length;a"u")return mx;var s=gx(r),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:s[0],top:s[1],right:s[2],gap:Math.max(0,a-i+s[2]-s[0])}},yx=Up(),is="data-scroll-locked",xx=function(r,s,i,a){var u=r.left,f=r.top,m=r.right,h=r.gap;return i===void 0&&(i="margin"),` .`.concat(ex,` { overflow: hidden `).concat(a,`; padding-right: `).concat(h,"px ").concat(a,`; } body[`).concat(is,`] { overflow: hidden `).concat(a,`; overscroll-behavior: contain; `).concat([s&&"position: relative ".concat(a,";"),i==="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,`; `),i==="padding"&&"padding-right: ".concat(h,"px ").concat(a,";")].filter(Boolean).join(""),` } .`).concat(tl,` { right: `).concat(h,"px ").concat(a,`; } .`).concat(nl,` { margin-right: `).concat(h,"px ").concat(a,`; } .`).concat(tl," .").concat(tl,` { right: 0 `).concat(a,`; } .`).concat(nl," .").concat(nl,` { margin-right: 0 `).concat(a,`; } body[`).concat(is,`] { `).concat(tx,": ").concat(h,`px; } `)},Vh=function(){var r=parseInt(document.body.getAttribute(is)||"0",10);return isFinite(r)?r:0},wx=function(){g.useEffect(function(){return document.body.setAttribute(is,(Vh()+1).toString()),function(){var r=Vh()-1;r<=0?document.body.removeAttribute(is):document.body.setAttribute(is,r.toString())}},[])},kx=function(r){var s=r.noRelative,i=r.noImportant,a=r.gapMode,u=a===void 0?"margin":a;wx();var f=g.useMemo(function(){return vx(u)},[u]);return g.createElement(yx,{styles:xx(f,!s,u,i?"":"!important")})},$u=!1;if(typeof window<"u")try{var Yi=Object.defineProperty({},"passive",{get:function(){return $u=!0,!0}});window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{$u=!1}var Yr=$u?{passive:!1}:!1,bx=function(r){return r.tagName==="TEXTAREA"},$p=function(r,s){if(!(r instanceof Element))return!1;var i=window.getComputedStyle(r);return i[s]!=="hidden"&&!(i.overflowY===i.overflowX&&!bx(r)&&i[s]==="visible")},Sx=function(r){return $p(r,"overflowY")},Ex=function(r){return $p(r,"overflowX")},Hh=function(r,s){var i=s.ownerDocument,a=s;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var u=Bp(r,a);if(u){var f=Vp(r,a),m=f[1],h=f[2];if(m>h)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},Nx=function(r){var s=r.scrollTop,i=r.scrollHeight,a=r.clientHeight;return[s,i,a]},jx=function(r){var s=r.scrollLeft,i=r.scrollWidth,a=r.clientWidth;return[s,i,a]},Bp=function(r,s){return r==="v"?Sx(s):Ex(s)},Vp=function(r,s){return r==="v"?Nx(s):jx(s)},Cx=function(r,s){return r==="h"&&s==="rtl"?-1:1},_x=function(r,s,i,a,u){var f=Cx(r,window.getComputedStyle(s).direction),m=f*a,h=i.target,y=s.contains(h),k=!1,w=m>0,x=0,R=0;do{if(!h)break;var _=Vp(r,h),D=_[0],S=_[1],P=_[2],A=S-P-f*D;(D||A)&&Bp(r,h)&&(x+=A,R+=D);var F=h.parentNode;h=F&&F.nodeType===Node.DOCUMENT_FRAGMENT_NODE?F.host:F}while(!y&&h!==document.body||y&&(s.contains(h)||s===h));return(w&&Math.abs(x)<1||!w&&Math.abs(R)<1)&&(k=!0),k},Xi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Wh=function(r){return[r.deltaX,r.deltaY]},Qh=function(r){return r&&"current"in r?r.current:r},Px=function(r,s){return r[0]===s[0]&&r[1]===s[1]},Rx=function(r){return` .block-interactivity-`.concat(r,` {pointer-events: none;} .allow-interactivity-`).concat(r,` {pointer-events: all;} `)},Mx=0,Xr=[];function Ox(r){var s=g.useRef([]),i=g.useRef([0,0]),a=g.useRef(),u=g.useState(Mx++)[0],f=g.useState(Up)[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 S=J0([r.lockRef.current],(r.shards||[]).map(Qh),!0).filter(Boolean);return S.forEach(function(P){return P.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),S.forEach(function(P){return P.classList.remove("allow-interactivity-".concat(u))})}}},[r.inert,r.lockRef.current,r.shards]);var h=g.useCallback(function(S,P){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!m.current.allowPinchZoom;var A=Xi(S),F=i.current,V="deltaX"in S?S.deltaX:F[0]-A[0],I="deltaY"in S?S.deltaY:F[1]-A[1],K,G=S.target,ue=Math.abs(V)>Math.abs(I)?"h":"v";if("touches"in S&&ue==="h"&&G.type==="range")return!1;var ie=window.getSelection(),ee=ie&&ie.anchorNode,me=ee?ee===G||ee.contains(G):!1;if(me)return!1;var ke=Hh(ue,G);if(!ke)return!0;if(ke?K=ue:(K=ue==="v"?"h":"v",ke=Hh(ue,G)),!ke)return!1;if(!a.current&&"changedTouches"in S&&(V||I)&&(a.current=K),!K)return!0;var le=a.current||K;return _x(le,P,S,le==="h"?V:I)},[]),y=g.useCallback(function(S){var P=S;if(!(!Xr.length||Xr[Xr.length-1]!==f)){var A="deltaY"in P?Wh(P):Xi(P),F=s.current.filter(function(K){return K.name===P.type&&(K.target===P.target||P.target===K.shadowParent)&&Px(K.delta,A)})[0];if(F&&F.should){P.cancelable&&P.preventDefault();return}if(!F){var V=(m.current.shards||[]).map(Qh).filter(Boolean).filter(function(K){return K.contains(P.target)}),I=V.length>0?h(P,V[0]):!m.current.noIsolation;I&&P.cancelable&&P.preventDefault()}}},[]),k=g.useCallback(function(S,P,A,F){var V={name:S,delta:P,target:A,should:F,shadowParent:Tx(A)};s.current.push(V),setTimeout(function(){s.current=s.current.filter(function(I){return I!==V})},1)},[]),w=g.useCallback(function(S){i.current=Xi(S),a.current=void 0},[]),x=g.useCallback(function(S){k(S.type,Wh(S),S.target,h(S,r.lockRef.current))},[]),R=g.useCallback(function(S){k(S.type,Xi(S),S.target,h(S,r.lockRef.current))},[]);g.useEffect(function(){return Xr.push(f),r.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:R}),document.addEventListener("wheel",y,Yr),document.addEventListener("touchmove",y,Yr),document.addEventListener("touchstart",w,Yr),function(){Xr=Xr.filter(function(S){return S!==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:Rx(u)}):null,_?g.createElement(kx,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function Tx(r){for(var s=null;r!==null;)r instanceof ShadowRoot&&(s=r.host,r=r.host),r=r.parentNode;return s}const Lx=ax(Fp,Ox);var Hp=g.forwardRef(function(r,s){return g.createElement(dl,nn({},r,{ref:s,sideCar:Lx}))});Hp.classNames=dl.classNames;var Dx=function(r){if(typeof document>"u")return null;var s=Array.isArray(r)?r[0]:r;return s.ownerDocument.body},Jr=new WeakMap,Ji=new WeakMap,el={},xu=0,Wp=function(r){return r&&(r.host||Wp(r.parentNode))},Ax=function(r,s){return s.map(function(i){if(r.contains(i))return i;var a=Wp(i);return a&&r.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",r,". Doing nothing"),null)}).filter(function(i){return!!i})},Ix=function(r,s,i,a){var u=Ax(s,Array.isArray(r)?r:[r]);el[i]||(el[i]=new WeakMap);var f=el[i],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(R){if(h.has(R))w(R);else try{var _=R.getAttribute(a),D=_!==null&&_!=="false",S=(Jr.get(R)||0)+1,P=(f.get(R)||0)+1;Jr.set(R,S),f.set(R,P),m.push(R),S===1&&D&&Ji.set(R,!0),P===1&&R.setAttribute(i,"true"),D||R.setAttribute(a,"true")}catch(A){console.error("aria-hidden: cannot operate on ",R,A)}})};return w(s),h.clear(),xu++,function(){m.forEach(function(x){var R=Jr.get(x)-1,_=f.get(x)-1;Jr.set(x,R),f.set(x,_),R||(Ji.has(x)||x.removeAttribute(a),Ji.delete(x)),_||x.removeAttribute(i)}),xu--,xu||(Jr=new WeakMap,Jr=new WeakMap,Ji=new WeakMap,el={})}},zx=function(r,s,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(r)?r:[r]),u=Dx(r);return u?(a.push.apply(a,Array.from(u.querySelectorAll("[aria-live], script"))),Ix(a,u,i,"aria-hidden")):function(){return null}},fl="Dialog",[Qp]=f0(fl),[Fx,Qt]=Qp(fl),Kp=r=>{const{__scopeDialog:s,children:i,open:a,defaultOpen:u,onOpenChange:f,modal:m=!0}=r,h=g.useRef(null),y=g.useRef(null),[k,w]=v0({prop:a,defaultProp:u??!1,onChange:f,caller:fl});return d.jsx(Fx,{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:i})};Kp.displayName=fl;var qp="DialogTrigger",Ux=g.forwardRef((r,s)=>{const{__scopeDialog:i,...a}=r,u=Qt(qp,i),f=br(s,u.triggerRef);return d.jsx(it.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)})});Ux.displayName=qp;var uc="DialogPortal",[$x,Gp]=Qp(uc,{forceMount:void 0}),Zp=r=>{const{__scopeDialog:s,forceMount:i,children:a,container:u}=r,f=Qt(uc,s);return d.jsx($x,{scope:s,forceMount:i,children:g.Children.map(a,m=>d.jsx(cl,{present:i||f.open,children:d.jsx(Ap,{asChild:!0,container:u,children:m})}))})};Zp.displayName=uc;var ol="DialogOverlay",Yp=g.forwardRef((r,s)=>{const i=Gp(ol,r.__scopeDialog),{forceMount:a=i.forceMount,...u}=r,f=Qt(ol,r.__scopeDialog);return f.modal?d.jsx(cl,{present:a||f.open,children:d.jsx(Vx,{...u,ref:s})}):null});Yp.displayName=ol;var Bx=Mp("DialogOverlay.RemoveScroll"),Vx=g.forwardRef((r,s)=>{const{__scopeDialog:i,...a}=r,u=Qt(ol,i),f=I0(),m=br(s,f);return d.jsx(Hp,{as:Bx,allowPinchZoom:!0,shards:[u.contentRef],children:d.jsx(it.div,{"data-state":cc(u.open),...a,ref:m,style:{pointerEvents:"auto",...a.style}})})}),bs="DialogContent",Xp=g.forwardRef((r,s)=>{const i=Gp(bs,r.__scopeDialog),{forceMount:a=i.forceMount,...u}=r,f=Qt(bs,r.__scopeDialog);return d.jsx(cl,{present:a||f.open,children:f.modal?d.jsx(Hx,{...u,ref:s}):d.jsx(Wx,{...u,ref:s})})});Xp.displayName=bs;var Hx=g.forwardRef((r,s)=>{const i=Qt(bs,r.__scopeDialog),a=g.useRef(null),u=br(s,i.contentRef,a);return g.useEffect(()=>{const f=a.current;if(f)return zx(f)},[]),d.jsx(Jp,{...r,ref:u,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:Zn(r.onCloseAutoFocus,f=>{var m;f.preventDefault(),(m=i.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())})}),Wx=g.forwardRef((r,s)=>{const i=Qt(bs,r.__scopeDialog),a=g.useRef(!1),u=g.useRef(!1);return d.jsx(Jp,{...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=i.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=i.triggerRef.current)==null?void 0:k.contains(m))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})}),Jp=g.forwardRef((r,s)=>{const{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:u,onCloseAutoFocus:f,...m}=r,h=Qt(bs,i);return X0(),d.jsx(d.Fragment,{children:d.jsx(Lp,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:u,onUnmountAutoFocus:f,children:d.jsx(Op,{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)})})})}),em="DialogTitle",Qx=g.forwardRef((r,s)=>{const{__scopeDialog:i,...a}=r,u=Qt(em,i);return d.jsx(it.h2,{id:u.titleId,...a,ref:s})});Qx.displayName=em;var tm="DialogDescription",Kx=g.forwardRef((r,s)=>{const{__scopeDialog:i,...a}=r,u=Qt(tm,i);return d.jsx(it.p,{id:u.descriptionId,...a,ref:s})});Kx.displayName=tm;var nm="DialogClose",qx=g.forwardRef((r,s)=>{const{__scopeDialog:i,...a}=r,u=Qt(nm,i);return d.jsx(it.button,{type:"button",...a,ref:s,onClick:Zn(r.onClick,()=>u.onOpenChange(!1))})});qx.displayName=nm;function cc(r){return r?"open":"closed"}var po='[cmdk-group=""]',wu='[cmdk-group-items=""]',Gx='[cmdk-group-heading=""]',rm='[cmdk-item=""]',Kh=`${rm}:not([aria-disabled="true"])`,Bu="cmdk-item-select",ns="data-value",Zx=(r,s,i)=>d0(r,s,i),sm=g.createContext(void 0),Ao=()=>g.useContext(sm),om=g.createContext(void 0),dc=()=>g.useContext(om),im=g.createContext(void 0),lm=g.forwardRef((r,s)=>{let i=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=am(r),{label:y,children:k,value:w,onValueChange:x,filter:R,shouldFilter:_,loop:D,disablePointerSelection:S=!1,vimBindings:P=!0,...A}=r,F=vn(),V=vn(),I=vn(),K=g.useRef(null),G=l1();kr(()=>{if(w!==void 0){let N=w.trim();i.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:()=>i.current,setState:(N,q,Y)=>{var W,se,de,ye;if(!Object.is(i.current[N],q)){if(i.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(I);we?we.focus():(W=document.getElementById(F))==null||W.focus()}if(G(7,()=>{var we;i.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())}}),[]),ie=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}),i.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(),i.current.value||ke(),ue.emit()}),()=>{f.current.delete(N),a.current.delete(N),i.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:F,inputId:I,labelId:V,listInnerRef:K}),[]);function ee(N,q){var Y,W;let se=(W=(Y=h.current)==null?void 0:Y.filter)!=null?W:Zx;return N?se(N,i.current.search,q):0}function me(){if(!i.current.search||h.current.shouldFilter===!1)return;let N=i.current.filtered.items,q=[];i.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(wu);se?se.appendChild(W.parentElement===se?W:W.closest(`${wu} > *`)):Y.appendChild(W.parentElement===Y?W:W.closest(`${wu} > *`))}),q.sort((W,se)=>se[1]-W[1]).forEach(W=>{var se;let de=(se=K.current)==null?void 0:se.querySelector(`${po}[${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(!i.current.search||h.current.shouldFilter===!1){i.current.filtered.count=a.current.size;return}i.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);i.current.filtered.items.set(de,Ge),Ge>0&&se++}for(let[de,ye]of u.current)for(let we of ye)if(i.current.filtered.items.get(we)>0){i.current.filtered.groups.add(de);break}i.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(po))==null?void 0:q.querySelector(Gx))==null||Y.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function Z(){var N;return(N=K.current)==null?void 0:N.querySelector(`${rm}[aria-selected="true"]`)}function ce(){var N;return Array.from(((N=K.current)==null?void 0:N.querySelectorAll(Kh))||[])}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 z(N){let q=Z(),Y=q==null?void 0:q.closest(po),W;for(;Y&&!W;)Y=N>0?o1(Y,po):i1(Y,po),W=Y==null?void 0:Y.querySelector(Kh);W?ue.setState("value",W.getAttribute(ns)):Ne(N)}let ne=()=>Ce(ce().length-1),Q=N=>{N.preventDefault(),N.metaKey?ne():N.altKey?z(1):Ne(1)},C=N=>{N.preventDefault(),N.metaKey?Ce(0):N.altKey?z(-1):Ne(-1)};return g.createElement(it.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":{P&&N.ctrlKey&&Q(N);break}case"ArrowDown":{Q(N);break}case"p":case"k":{P&&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(Bu);W.dispatchEvent(se)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:ie.inputId,id:ie.labelId,style:u1},y),hl(r,N=>g.createElement(om.Provider,{value:ue},g.createElement(sm.Provider,{value:ie},N))))}),Yx=g.forwardRef((r,s)=>{var i,a;let u=vn(),f=g.useRef(null),m=g.useContext(im),h=Ao(),y=am(r),k=(a=(i=y.current)==null?void 0:i.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=um(u,f,[r.value,r.children,f],r.keywords),x=dc(),R=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(Bu,D),()=>G.removeEventListener(Bu,D)},[_,r.onSelect,r.disabled]);function D(){var G,ue;S(),(ue=(G=y.current).onSelect)==null||ue.call(G,w.current)}function S(){x.setState("value",w.current,!0)}if(!_)return null;let{disabled:P,value:A,onSelect:F,forceMount:V,keywords:I,...K}=r;return g.createElement(it.div,{ref:ks(f,s),...K,id:u,"cmdk-item":"",role:"option","aria-disabled":!!P,"aria-selected":!!R,"data-disabled":!!P,"data-selected":!!R,onPointerMove:P||h.getDisablePointerSelection()?void 0:S,onClick:P?void 0:D},r.children)}),Xx=g.forwardRef((r,s)=>{let{heading:i,children:a,forceMount:u,...f}=r,m=vn(),h=g.useRef(null),y=g.useRef(null),k=vn(),w=Ao(),x=Yn(_=>u||w.filter()===!1?!0:_.search?_.filtered.groups.has(m):!0);kr(()=>w.group(m),[]),um(m,h,[r.value,r.heading,y]);let R=g.useMemo(()=>({id:m,forceMount:u}),[u]);return g.createElement(it.div,{ref:ks(h,s),...f,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},i&&g.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:k},i),hl(r,_=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?k:void 0},g.createElement(im.Provider,{value:R},_))))}),Jx=g.forwardRef((r,s)=>{let{alwaysRender:i,...a}=r,u=g.useRef(null),f=Yn(m=>!m.search);return!i&&!f?null:g.createElement(it.div,{ref:ks(u,s),...a,"cmdk-separator":"",role:"separator"})}),e1=g.forwardRef((r,s)=>{let{onValueChange:i,...a}=r,u=r.value!=null,f=dc(),m=Yn(k=>k.search),h=Yn(k=>k.selectedItemId),y=Ao();return g.useEffect(()=>{r.value!=null&&f.setState("search",r.value)},[r.value]),g.createElement(it.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),i==null||i(k.target.value)}})}),t1=g.forwardRef((r,s)=>{let{children:i,label:a="Suggestions",...u}=r,f=g.useRef(null),m=g.useRef(null),h=Yn(k=>k.selectedItemId),y=Ao();return g.useEffect(()=>{if(m.current&&f.current){let k=m.current,w=f.current,x,R=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let _=k.offsetHeight;w.style.setProperty("--cmdk-list-height",_.toFixed(1)+"px")})});return R.observe(k),()=>{cancelAnimationFrame(x),R.unobserve(k)}}},[]),g.createElement(it.div,{ref:ks(f,s),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":a,id:y.listId},hl(r,k=>g.createElement("div",{ref:ks(m,y.listInnerRef),"cmdk-list-sizer":""},k)))}),n1=g.forwardRef((r,s)=>{let{open:i,onOpenChange:a,overlayClassName:u,contentClassName:f,container:m,...h}=r;return g.createElement(Kp,{open:i,onOpenChange:a},g.createElement(Zp,{container:m},g.createElement(Yp,{"cmdk-overlay":"",className:u}),g.createElement(Xp,{"aria-label":r.label,"cmdk-dialog":"",className:f},g.createElement(lm,{ref:s,...h}))))}),r1=g.forwardRef((r,s)=>Yn(i=>i.filtered.count===0)?g.createElement(it.div,{ref:s,...r,"cmdk-empty":"",role:"presentation"}):null),s1=g.forwardRef((r,s)=>{let{progress:i,children:a,label:u="Loading...",...f}=r;return g.createElement(it.div,{ref:s,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},hl(r,m=>g.createElement("div",{"aria-hidden":!0},m)))}),es=Object.assign(lm,{List:t1,Item:Yx,Input:e1,Group:Xx,Separator:Jx,Dialog:n1,Empty:r1,Loading:s1});function o1(r,s){let i=r.nextElementSibling;for(;i;){if(i.matches(s))return i;i=i.nextElementSibling}}function i1(r,s){let i=r.previousElementSibling;for(;i;){if(i.matches(s))return i;i=i.previousElementSibling}}function am(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(),i=()=>r(s.snapshot());return g.useSyncExternalStore(s.subscribe,i,i)}function um(r,s,i,a=[]){let u=g.useRef(),f=Ao();return kr(()=>{var m;let h=(()=>{var k;for(let w of i){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 l1=()=>{let[r,s]=g.useState(),i=rs(()=>new Map);return kr(()=>{i.current.forEach(a=>a()),i.current=new Map},[r]),(a,u)=>{i.current.set(a,u),s({})}};function a1(r){let s=r.type;return typeof s=="function"?s(r.props):"render"in s?s.render(r.props):r}function hl({asChild:r,children:s},i){return r&&g.isValidElement(s)?g.cloneElement(a1(s),{ref:s.ref},i(s.props.children)):i(s)}var u1={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function c1({onNavigate:r}){const[s,i]=g.useState(!1);return g.useEffect(()=>{const a=u=>{(u.metaKey||u.ctrlKey)&&u.key.toLowerCase()==="k"&&(u.preventDefault(),i(f=>!f))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[]),d.jsx(es.Dialog,{open:s,onOpenChange:i,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh] overscroll-contain",onClick:()=>i(!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:os.map(a=>d.jsxs(es.Item,{value:`${a.label} ${a.hint}`,onSelect:()=>{r(a.id),i(!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 cm="mc_expert_mode",Vu="mc-expert-mode-change",d1=()=>{try{return localStorage.getItem(cm)==="true"}catch{return!1}};function f1(r){return window.addEventListener(Vu,r),window.addEventListener("storage",r),()=>{window.removeEventListener(Vu,r),window.removeEventListener("storage",r)}}function qh(r){localStorage.setItem(cm,String(r)),window.dispatchEvent(new Event(Vu))}function h1(){return g.useSyncExternalStore(f1,d1,()=>!1)}function dm(r){var s,i,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=v1(r),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=r;return{getClassGroupId:m=>{const h=m.split(fc);return h[0]===""&&h.length!==1&&h.shift(),fm(h,s)||g1(m)},getConflictingClassGroupIds:(m,h)=>{const y=i[m]||[];return h&&a[m]?[...y,...a[m]]:y}}},fm=(r,s)=>{var m;if(r.length===0)return s.classGroupId;const i=r[0],a=s.nextPart.get(i),u=a?fm(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},Gh=/^\[(.+)\]$/,g1=r=>{if(Gh.test(r)){const s=Gh.exec(r)[1],i=s==null?void 0:s.substring(0,s.indexOf(":"));if(i)return"arbitrary.."+i}},v1=r=>{const{theme:s,prefix:i}=r,a={nextPart:new Map,validators:[]};return x1(Object.entries(r.classGroups),i).forEach(([f,m])=>{Hu(m,a,f,s)}),a},Hu=(r,s,i,a)=>{r.forEach(u=>{if(typeof u=="string"){const f=u===""?s:Zh(s,u);f.classGroupId=i;return}if(typeof u=="function"){if(y1(u)){Hu(u(a),s,i,a);return}s.validators.push({validator:u,classGroupId:i});return}Object.entries(u).forEach(([f,m])=>{Hu(m,Zh(s,f),i,a)})})},Zh=(r,s)=>{let i=r;return s.split(fc).forEach(a=>{i.nextPart.has(a)||i.nextPart.set(a,{nextPart:new Map,validators:[]}),i=i.nextPart.get(a)}),i},y1=r=>r.isThemeGetter,x1=(r,s)=>s?r.map(([i,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[i,u]}):r,w1=r=>{if(r<1)return{get:()=>{},set:()=>{}};let s=0,i=new Map,a=new Map;const u=(f,m)=>{i.set(f,m),s++,s>r&&(s=0,a=i,i=new Map)};return{get(f){let m=i.get(f);if(m!==void 0)return m;if((m=a.get(f))!==void 0)return u(f,m),m},set(f,m){i.has(f)?i.set(f,m):u(f,m)}}},hm="!",k1=r=>{const{separator:s,experimentalParseClassName:i}=r,a=s.length===1,u=s[0],f=s.length,m=h=>{const y=[];let k=0,w=0,x;for(let P=0;Pw?x-w:void 0;return{modifiers:y,hasImportantModifier:_,baseClassName:D,maybePostfixModifierPosition:S}};return i?h=>i({className:h,parseClassName:m}):m},b1=r=>{if(r.length<=1)return r;const s=[];let i=[];return r.forEach(a=>{a[0]==="["?(s.push(...i.sort(),a),i=[]):i.push(a)}),s.push(...i.sort()),s},S1=r=>({cache:w1(r.cacheSize),parseClassName:k1(r),...m1(r)}),E1=/\s+/,N1=(r,s)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:u}=s,f=[],m=r.trim().split(E1);let h="";for(let y=m.length-1;y>=0;y-=1){const k=m[y],{modifiers:w,hasImportantModifier:x,baseClassName:R,maybePostfixModifierPosition:_}=i(k);let D=!!_,S=a(D?R.substring(0,_):R);if(!S){if(!D){h=k+(h.length>0?" "+h:h);continue}if(S=a(R),!S){h=k+(h.length>0?" "+h:h);continue}D=!1}const P=b1(w).join(":"),A=x?P+hm:P,F=A+S;if(f.includes(F))continue;f.push(F);const V=u(S,D);for(let I=0;I0?" "+h:h)}return h};function j1(){let r=0,s,i,a="";for(;r{if(typeof r=="string")return r;let s,i="";for(let a=0;ax(w),r());return i=S1(k),a=i.cache.get,u=i.cache.set,f=h,h(y)}function h(y){const k=a(y);if(k)return k;const w=N1(y,i);return u(y,w),w}return function(){return f(j1.apply(null,arguments))}}const Ue=r=>{const s=i=>i[r]||[];return s.isThemeGetter=!0,s},mm=/^\[(?:([a-z-]+):)?(.+)\]$/i,_1=/^\d+\/\d+$/,P1=new Set(["px","full","screen"]),R1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,M1=/\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$/,O1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,T1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,L1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hn=r=>ls(r)||P1.has(r)||_1.test(r),In=r=>Es(r,"length",B1),ls=r=>!!r&&!Number.isNaN(Number(r)),ku=r=>Es(r,"number",ls),mo=r=>!!r&&Number.isInteger(Number(r)),D1=r=>r.endsWith("%")&&ls(r.slice(0,-1)),be=r=>mm.test(r),zn=r=>R1.test(r),A1=new Set(["length","size","percentage"]),I1=r=>Es(r,A1,gm),z1=r=>Es(r,"position",gm),F1=new Set(["image","url"]),U1=r=>Es(r,F1,H1),$1=r=>Es(r,"",V1),go=()=>!0,Es=(r,s,i)=>{const a=mm.exec(r);return a?a[1]?typeof s=="string"?a[1]===s:s.has(a[1]):i(a[2]):!1},B1=r=>M1.test(r)&&!O1.test(r),gm=()=>!1,V1=r=>T1.test(r),H1=r=>L1.test(r),W1=()=>{const r=Ue("colors"),s=Ue("spacing"),i=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"),R=Ue("gap"),_=Ue("gradientColorStops"),D=Ue("gradientColorStopPositions"),S=Ue("inset"),P=Ue("margin"),A=Ue("opacity"),F=Ue("padding"),V=Ue("saturate"),I=Ue("scale"),K=Ue("sepia"),G=Ue("skew"),ue=Ue("space"),ie=Ue("translate"),ee=()=>["auto","contain","none"],me=()=>["auto","hidden","clip","visible","scroll"],ke=()=>["auto",be,s],le=()=>[be,s],Le=()=>["",hn,In],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"],z=()=>["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:[go],spacing:[hn,In],blur:["none","",zn,be],brightness:C(),borderColor:[r],borderRadius:["none","","full",zn,be],borderSpacing:le(),borderWidth:Le(),contrast:C(),grayscale:ne(),hueRotate:C(),invert:ne(),gap:le(),gradientColorStops:[r],gradientColorStopPositions:[D1,In],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:[zn]}],"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:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mo,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",mo,be]}],"grid-cols":[{"grid-cols":[go]}],"col-start-end":[{col:["auto",{span:["full",mo,be]},be]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[go]}],"row-start-end":[{row:["auto",{span:[mo,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:[R]}],"gap-x":[{"gap-x":[R]}],"gap-y":[{"gap-y":[R]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],pe:[{pe:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[P]}],mx:[{mx:[P]}],my:[{my:[P]}],ms:[{ms:[P]}],me:[{me:[P]}],mt:[{mt:[P]}],mr:[{mr:[P]}],mb:[{mb:[P]}],ml:[{ml:[P]}],"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:[zn]},zn]}],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",zn,In]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ku]}],"font-family":[{font:[go]}],"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,ku]}],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,In]}],"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(),z1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",I1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U1]}],"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,In]}],"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,In]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",zn,$1]}],"shadow-color":[{shadow:[go]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ne()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[a]}],contrast:[{contrast:[y]}],"drop-shadow":[{"drop-shadow":["","none",zn,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":[i]}],"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:[I]}],"scale-x":[{"scale-x":[I]}],"scale-y":[{"scale-y":[I]}],rotate:[{rotate:[mo,be]}],"translate-x":[{"translate-x":[ie]}],"translate-y":[{"translate-y":[ie]}],"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,In,ku]}],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"]}}},Q1=C1(W1);function Ee(...r){return Q1(p1(r))}function Yw(r){return r?r.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function K1(){const r=h1();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(Jy,{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(Xy,{className:"h-3.5 w-3.5"})," Experte"]})]})}async function Se(r,s){var y;const i={"Content-Type":"application/json",...s==null?void 0:s.headers},a=((y=s==null?void 0:s.method)==null?void 0:y.toUpperCase())||"GET",u=a==="GET"?null:localStorage.getItem("mc_sudo_password"),f=a==="GET"?null:localStorage.getItem("mc_hf_token");u&&(i["X-Sudo-Password"]=u);let m=s==null?void 0:s.body;if(a==="POST"){if(typeof m=="string")try{const k=JSON.parse(m);let w=!1;u&&!("sudo_password"in k)&&(k.sudo_password=u,w=!0),f&&!("hf_token"in k)&&(k.hf_token=f,w=!0),w&&(m=JSON.stringify(k))}catch{}else if(!m){const k={};u&&(k.sudo_password=u),f&&(k.hf_token=f),Object.keys(k).length>0&&(m=JSON.stringify(k))}}const h=await fetch(r,{...s,headers:i,body:m});if(!h.ok)throw new Error(`${h.status} ${h.statusText}`);return h.json()}const Xw=(r,s,i=!1,a=!0)=>Se("/api/groups",{method:"PUT",body:JSON.stringify({group:r,members:s,swap:i,persist:a})}),Jw=r=>Se("/api/routing/policy",{method:"PUT",body:JSON.stringify(r)});function q1({type:r,title:s,message:i,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(ul,{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:i}),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 vm(){const[r,s]=g.useState(null),i=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,R)=>{s({type:"prompt",title:h,message:y,defaultValue:k,autoValue:R==null?void 0:R.autoValue,autoLabel:R==null?void 0:R.autoLabel,onConfirm:_=>{s(null),w(_)},onCancel:()=>{s(null),x==null||x()}})},[]),m=r?d.jsx(q1,{...r}):null;return{showAlert:a,showConfirm:u,showPrompt:f,close:i,dialogElement:m}}let rl=!1;const G1=()=>rl;function Z1(){const r=ll();g.useEffect(()=>{const s=new EventSource("/api/events");return s.onopen=()=>{rl=!0},s.onerror=()=>{rl=!1},s.addEventListener("invalidate",i=>{var a;try{const u=((a=JSON.parse(i.data))==null?void 0:a.keys)??[];for(const f of u)r.invalidateQueries({queryKey:[f]})}catch{}}),()=>{rl=!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},pl=r=>()=>G1()?r*5:r,Y1=(r=St.schnell)=>Be({queryKey:Pe.auftragsbuch,queryFn:()=>Se("/api/auftragsbuch"),refetchInterval:pl(r)}),X1=(r=St.gemuetlich)=>Be({queryKey:Pe.ideen,queryFn:()=>Se("/api/ideen"),refetchInterval:pl(r)}),ek=(r,s=!1)=>Be({queryKey:["ideen-log",r],queryFn:()=>Se(`/api/ideen/${r}/log`),enabled:s,refetchInterval:4e3,staleTime:0}),tk=(r=150,s=St.gemuetlich)=>Be({queryKey:[...Pe.chronik,r],queryFn:()=>Se(`/api/chronik?limit=${r}`),refetchInterval:pl(s),select:i=>i.items??[]}),nk=()=>Be({queryKey:Pe.wissen,queryFn:()=>Se("/api/wissen")}),J1=(r=St.traege,s=!0)=>Be({queryKey:Pe.zeitmaschine,queryFn:()=>Se("/api/zeitmaschine"),refetchInterval:r,enabled:s}),ew=(r=12,s=St.schnell)=>Be({queryKey:Pe.voiceTrace,queryFn:()=>Se(`/api/voice/trace?limit=${r}`),refetchInterval:s,select:i=>i.turns??[]}),rk=(r=!0)=>Be({queryKey:Pe.memoryGraph,queryFn:()=>Se("/api/wissen/graph"),enabled:r,staleTime:60*1e3}),ym=()=>Be({queryKey:Pe.health,queryFn:()=>Se("/api/health"),refetchInterval:St.normal}),ml=(r=St.graph)=>Be({queryKey:Pe.systemStatus,queryFn:()=>Se("/api/system/status"),refetchInterval:r}),xm=(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}),wm=(r=St.schnell)=>Be({queryKey:Pe.models,queryFn:()=>Se("/api/models"),refetchInterval:pl(r)}),sk=(r=St.normal)=>Be({queryKey:Pe.groups,queryFn:()=>Se("/api/groups"),refetchInterval:r}),ok=()=>Be({queryKey:Pe.routingPolicy,queryFn:()=>Se("/api/routing/policy")}),tw=(r=3e3,s=!0)=>Be({queryKey:Pe.jobs,queryFn:()=>Se("/api/jobs"),refetchInterval:r,enabled:s,select:i=>i.jobs??[]}),km=(r=St.graph)=>Be({queryKey:Pe.tokenStats,queryFn:()=>Se("/api/system/token-stats"),refetchInterval:r}),nw=(r=St.normal)=>Be({queryKey:Pe.agentStatus,queryFn:()=>Se("/api/agent/status"),refetchInterval:r}),ik=(r=St.traege)=>Be({queryKey:Pe.hermesBrain,queryFn:()=>Se("/api/agent/brain"),refetchInterval:r}),bm=(r=St.traege)=>Be({queryKey:Pe.updates,queryFn:()=>Se("/api/maintenance/updates"),refetchInterval:r}),lk=()=>Be({queryKey:Pe.discover,queryFn:()=>Se("/api/discover")}),ak=r=>Be({queryKey:Pe.drafts(r),queryFn:()=>Se(`/api/models/drafts?target=${encodeURIComponent(r??"")}`),enabled:!!r}),uk=r=>Be({queryKey:Pe.connect(r),queryFn:()=>Se(r?`/api/connect?${r}`:"/api/connect")}),rw=()=>Be({queryKey:Pe.connectHealth,queryFn:()=>Se("/api/connect/health"),refetchInterval:15e3});function vo(r,...s){for(const i of s)r.invalidateQueries({queryKey:i})}function ts(r){return(r/1024**3).toFixed(1)}function bu(r){return r?r>1024**3?`${(r/1024**3).toFixed(1)} GB`:`${(r/1024**2).toFixed(0)} MB`:""}function ck(r){if(!r)return"—";const s=r/1024**3;return s>=1?`${s.toFixed(1)} GB`:`${(r/1024**2).toFixed(0)} MB`}function dk(r){if(!r)return"";const s=Math.floor(r/60);return s>0?`${s} min`:`${r} s`}function fk(r){return r?`${Math.round(r/1024)}k`:"—"}function hk(r){return r?new Date(r*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}function yo({icon:r,iconClass:s,name:i,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:i}),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 sw({label:r,ok:s,system:i,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,i&&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 ow=/\b(error|fehler|fail(ed|ure)?|fatal|critical|crit|panic|traceback|exception|denied|refused|unable|emerg|alert|oom|killed)\b/i,iw=/\b(warn(ing)?|deprecat\w*|retry(ing)?|timeout|timed out|degraded|missing|not found|nicht gefunden)\b/i;function lw(r){return ow.test(r)?"error":iw.test(r)?"warn":"info"}const aw={error:"text-red-400",warn:"text-amber-300",info:"text-cyan-300/80"};function uw({service:r,text:s,loading:i,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(P=>({t:P,level:lw(P)})):[],[s]),R=g.useMemo(()=>x.filter(P=>P.level!=="info").length,[x]),_=y.trim().toLowerCase(),D=x.filter(P=>(!m||P.level!=="info")&&(!_||P.t.toLowerCase().includes(_))),S=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(t0,{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(Zy,{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:P=>k(P.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(P=>!P),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(Co,{className:"h-3 w-3"}),"Nur Probleme",R>0?` (${R})`:""]}),d.jsx("button",{onClick:u,disabled:i,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",i&&"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:S?d.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-3 p-6 text-center",children:[d.jsx(Co,{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"})]}):i&&!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((P,A)=>d.jsx("div",{className:Ee("whitespace-pre-wrap",aw[P.level]),children:P.t||" "},A))})]})}function cw({open:r,showAlert:s}){const[i,a]=g.useState(""),[u,f]=g.useState(""),[m,h]=g.useState(!1),[y,k]=g.useState(!1);return g.useEffect(()=>{r&&(a(localStorage.getItem("mc_sudo_password")||""),f(localStorage.getItem("mc_hf_token")||""))},[r]),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] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[d.jsx(lc,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{type:m?"text":"password",value:i,onChange:w=>a(w.target.value),"aria-label":"Host Sudo-Passwort",name:"sudo-password",autoComplete:"off",spellCheck:!1,placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),d.jsx("button",{type:"button",onClick:()=>h(!m),"aria-label":m?"Passwort verbergen":"Passwort anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:m?d.jsx(_h,{className:"h-4 w-4","aria-hidden":"true"}):d.jsx(zu,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[d.jsx(Vy,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{type:y?"text":"password",value:u,onChange:w=>f(w.target.value),"aria-label":"HuggingFace API Token",name:"hf-token",autoComplete:"off",spellCheck:!1,placeholder:"hf_…",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),d.jsx("button",{type:"button",onClick:()=>k(!y),"aria-label":y?"Token verbergen":"Token anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:y?d.jsx(_h,{className:"h-4 w-4","aria-hidden":"true"}):d.jsx(zu,{className:"h-4 w-4","aria-hidden":"true"})})]}),d.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),d.jsxs("div",{className:"flex gap-3 pt-2",children:[d.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",i),localStorage.setItem("mc_hf_token",u),s("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),d.jsx("button",{onClick:()=>{a(""),f(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),s("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})}function dw({detail:r,maintenanceJob:s,onClose:i,onApply:a}){var y,k;const u=r.data,f={os:{icon:lc,cls:"text-cyan-400",title:"OS-Pakete (apt)"},engine:{icon:al,cls:"text-violet-400",title:"Inferenz-Engine (llama.cpp)"},swap:{icon:_p,cls:"text-fuchsia-400",title:"Router (llama-swap)"},hermes:{icon:jo,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:i}),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:i,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(ul,{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(Co,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5"}):d.jsx(Oy,{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(Ph,{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(Ch,{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(Ty,{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(Ph,{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(Ch,{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(Ay,{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(Fy,{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(Yy,{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:i,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 fw({open:r,onClose:s,defaultTab:i="maintenance"}){var jr,Cs;const a=ll(),{showAlert:u,showConfirm:f,dialogElement:m}=vm(),{data:h}=bm(),{data:y}=hc(),k=tw(3e3,r).data??[],{data:w}=J1(void 0,r),[x,R]=g.useState("llama-swap"),[_,D]=g.useState(""),[S,P]=g.useState(!1),[A,F]=g.useState(null),[V,I]=g.useState({}),[K,G]=g.useState("maintenance"),[ue,ie]=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)??[],z=()=>vo(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&&i&&G(i)},[r,i]),g.useEffect(()=>{r&&vo(a,Pe.updates,Pe.services,Pe.jobs,Pe.zeitmaschine)},[r]);function Q(L){P(!0),F(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")&&F(xe.status))}).catch(xe=>D(`Fehler: ${xe.message}`)).finally(()=>P(!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.`),z(),!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 Ie=await Se(`/api/maintenance/${xe}`,{method:"POST"});if(C(Ie)||N(Ie))return;z(),G("maintenance")}catch(Ie){u("Fehler",`Update konnte nicht starten: ${Ie.message}`)}}async function Y(){Z(!0);try{const L=await Se("/api/maintenance/hermes-update",{method:"POST"});if(C(L))return;z()}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(Ie=>Ie.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 Ie=await Se("/api/maintenance/update-all",{method:"POST"});if(C(Ie)||N(Ie))return;if((Ie==null?void 0:Ie.status)==="nothing"){u("Nichts zu tun","Es stehen keine Updates aus.");return}z(),G("maintenance")}catch(Ie){u("Fehler",`„Alle aktualisieren" konnte nicht starten: ${Ie.message}`)}})}async function ye(){ie(!0);try{await Se("/api/maintenance/check-updates",{method:"POST"}),vo(a,Pe.jobs,Pe.updates),G("maintenance")}catch(L){u("Fehler",`Fehler bei der Update-Suche: ${L.message}`)}finally{ie(!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.`),z(),G("maintenance")}catch(Ie){u("Fehler",`Fehler beim Starten des Modell-Upgrades: ${Ie.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."),vo(a,Pe.zeitmaschine)}catch(L){me(`Fehler: ${L.message}`)}finally{le(!1)}}async function Ns(L){I(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)}),vo(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{I(xe=>({...xe,[L]:!1}))}}async function Er(L){try{await Se(`/api/jobs/${L}/cancel`,{method:"POST"}),z()}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(Cp,{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(ul,{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(Ly,{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(yo,{icon:lc,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(yo,{icon:al,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(yo,{icon:_p,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(Ie=>Ie.key==="hermes_agent");return d.jsx(yo,{icon:jo,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(yo,{icon:Cy,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(sw,{label:L.name,system:L.scope==="system",ok:L.ok,busy:V[L.unit],onRestart:()=>Ns(L.unit),onLogs:()=>{R(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(Py,{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(Gy,{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:[bu(L.done_bytes)," / ",bu(L.total_bytes),L.rate_bps!=null&&` (${bu(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=>R(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(uw,{service:x,text:_,loading:S,logStatus:A,onRefresh:()=>Q(x),onOpenSettings:()=>G("settings")})]}),K==="settings"&&d.jsx(cw,{open:r,showAlert:u})]})]}),ce&&d.jsx(dw,{detail:ce,maintenanceJob:rn,onClose:()=>Ce(null),onApply:se}),m]})}let Wu=[],Qu=[];const Ku=new Set,Sm=()=>Ku.forEach(r=>r());function Em(r){return Ku.add(r),()=>{Ku.delete(r)}}function hw(r){Wu=[...Wu,r].slice(-40),Sm()}function pw(r){Qu=[...Qu,r].slice(-40),Sm()}const mw=()=>g.useSyncExternalStore(Em,()=>Wu),gw=()=>g.useSyncExternalStore(Em,()=>Qu);function vw(){const{data:r,dataUpdatedAt:s}=ml(),{data:i,dataUpdatedAt:a}=km(),u=g.useRef(null);g.useEffect(()=>{var f,m,h,y;r&&hw({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(!i)return;const f=Date.now(),m=i.prompt_tokens,h=i.completion_tokens;if(u.current){const y=Math.max((f-u.current.t)/1e3,.001);pw({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 yw(){var ie,ee,me,ke,le,Le;const{data:r,isError:s}=ym(),{data:i,isError:a}=hc(),{data:u}=wm(),{data:f}=ml(),m=s||a,h=!!r&&!!i,y=Z=>{var ce;return(ce=i==null?void 0:i.services.find(Ce=>Ce.unit===Z))==null?void 0:ce.ok},k=Z=>!!(i!=null&&i.services.some(ce=>ce.unit===Z)),w=r==null?void 0:r.engine_reachable,x=(ie=r==null?void 0:r.brain)==null?void 0:ie.ready,R=((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:al,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:_y,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:R?{kind:"loadModel",model:R,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:zu,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:jy,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:ic,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:jo,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:qy,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,S=((le=f==null?void 0:f.ram)==null?void 0:le.used)??0,P=((Le=f==null?void 0:f.ram)==null?void 0:Le.percent)??(D>0?Math.min(100,S/D*100):0),A=1024**3,F=D?P>=93?{status:"full",usedGb:S/A,totalGb:D/A,pct:P,text:"Speicher fast voll — Lucy könnte langsamer werden."}:P>=85?{status:"warn",usedGb:S/A,totalGb:D/A,pct:P,text:"Speicher gut gefüllt — noch okay."}:{status:"ok",usedGb:S/A,totalGb:D/A,pct:P,text:"Genug Speicher frei."}:{status:"unknown",usedGb:0,totalGb:0,pct:0,text:"Speicher-Auslastung unbekannt."},V=_.some(Z=>Z.status==="loading"),I=_.filter(Z=>Z.critical&&Z.status==="down"),K=_.filter(Z=>Z.status==="warn"||!Z.critical&&Z.status==="down"),G=F.status==="full";return{verdict:V&&!I.length?"loading":I.length?"problem":K.length||G?"warn":"gut",checks:_,memory:F,problems:I,warns:K,unreachable:m}}const xw={ok:"bg-emerald-500",warn:"bg-amber-500",alert:"bg-red-500",muted:"bg-muted-foreground/40",loading:"bg-muted-foreground/40 animate-pulse"},ww={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 xo({icon:r,title:s,value:i,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",ww[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",xw[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:i}),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(ko,{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 kw(){const{data:r,error:s}=ml(),i=mw();return{sys:r,hist:i,error:s}}const bw=g.lazy(()=>Wt(()=>import("./LiveAreaChartImpl-BkyPZEnE.js"),__vite__mapDeps([0,1])));function Nm(r){return d.jsx(g.Suspense,{fallback:d.jsx(Sw,{height:r.height??176}),children:d.jsx(bw,{...r})})}function Sw({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 jm={"1h":60,"24h":1440},Yh={live:"Live","1h":"1 h","24h":"24 h"};function Cm({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(Yh).map(i=>d.jsx("button",{onClick:()=>s(i),className:Ee("rounded-md px-2 py-0.5 text-[9px] font-bold uppercase tracking-wide transition-all cursor-pointer",r===i?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:Yh[i]},i))})}const Ew=[{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 Nw(){var w,x,R,_;const{sys:r,hist:s}=kw(),[i,a]=g.useState("live"),u=xm(i==="live"?60:jm[i],i!=="live"),f=g.useMemo(()=>{var D;return i==="live"?s:(((D=u.data)==null?void 0:D.points)??[]).map(S=>({t:S.t*1e3,cpu:S.cpu,ram:S.ram,gpu:S.gpu,disk:S.disk}))},[i,s,u.data]),m=!!(r!=null&&r.gpu&&r.gpu.busy_percent!=null&&r.gpu.gtt_used!=null&&r.gpu.gtt_total!=null),h=Ew.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:(R=r==null?void 0:r.disk)==null?void 0:R.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(Cp,{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"}),i==="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(Cm,{value:i,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))}),i!=="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."}),(i==="live"||f.length>0)&&d.jsx(Nm,{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"}],bo=r=>r==null?"–":`${(r/1e3).toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1})} s`;function jw(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 qu(r){return Ss.reduce((s,i)=>s+(r[i.key]??0),0)}function Cw(r){let s=null;for(const i of Ss){const a=r[i.key];a!=null&&(s==null||a>s.ms)&&(s={label:i.label,color:i.color,ms:a})}return s}function _w({t:r,scale:s}){const i=Ss.map(a=>`${a.label} ${bo(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:jw(r.ts)}),d.jsxs("div",{className:"relative h-4 flex-1 overflow-hidden rounded-sm bg-muted/25",title:i,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?"–":bo(qu(r))})]})}function Pw(){const{data:r}=ew(12),s=r??[],i=Math.max(1,...s.map(f=>qu(f))),a=s[0],u=a?Cw(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(zy,{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":bo(qu(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})," ",bo(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} ${bo(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(_w,{t:f,scale:i},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 Xh=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function Rw(){const{data:r}=km(),s=gw(),[i,a]=g.useState("live"),u=xm(i==="live"?60:jm[i],i!=="live"),f=g.useMemo(()=>{var w;if(i==="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))})]})]}),i!=="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(Nm,{data:f,series:Xh,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 il=r=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:r}}));function Mw({onNavigate:r}){var Z,ce,Ce,Ne;const{data:s}=wm(),{data:i}=hc(),{data:a}=bm(),{data:u}=nw(),{data:f}=rw(),{data:m}=Y1(),{data:h}=X1(),y=yw(),{showAlert:k,dialogElement:w}=vm(),x=ll(),[R,_]=g.useState({});async function D(z,ne){_(Q=>({...Q,[z]:!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,[z]:!1}))}}const S=((Z=s==null?void 0:s.running)==null?void 0:Z.length)??0,P=(i==null?void 0:i.services.filter(z=>z.ok).length)??0,A=(i==null?void 0:i.services.length)??0,F=A-P,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(z=>z.update===!0).length)??0),I=m!=null&&m.available?m.open_count:0,K=h!=null&&h.available?h.items.filter(z=>z.status==="blocked").length:0,G=f?[f.gateway,f.memory,f.desktop_gateway]:[],ue=G.filter(z=>z==null?void 0:z.ok).length,ie=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(z=>z.role==="hermes"),me=ee!=null&&ee.name?(Ne=ee.name.split("/").pop())==null?void 0:Ne.replace(/\.gguf$/i,""):"",ke=i==null?void 0:i.services.filter(z=>!z.ok).map(z=>z.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(Ow,{verdict:y.verdict,memory:y.memory,warns:y.warns,problems:y.problems}),d.jsxs("section",{children:[d.jsx(Su,{children:"Leistung"}),d.jsx("div",{className:"grid gap-4 md:grid-cols-1",children:d.jsx(Nw,{})}),d.jsx("div",{className:"mt-4",children:d.jsx(Pw,{})}),d.jsx("div",{className:"mt-4",children:d.jsx(Rw,{})})]}),d.jsxs("section",{children:[d.jsx(Su,{children:"Bereiche"}),d.jsxs("div",{className:"grid gap-4 grid-cols-2 md:grid-cols-3",children:[d.jsx(xo,{icon:rc,title:"Auftragsbuch",value:m!=null&&m.available?I:"—",unit:I===1?"Vorschlag":"Vorschläge",tone:m?K>0||I>0?"warn":"ok":"loading",hint:K>0?`${K} Karte${K===1?"":"n"} wartet auf deine Antwort`:I>0?`${I} offene Patches`:"Keine ausstehenden Vorschläge",onClick:()=>r("auftraege")}),d.jsx(xo,{icon:Np,title:"Modelle",value:S,unit:"warm",tone:S>0?"ok":"muted",hint:me?`Hirn: ${me}`:"Kein Hermes-Modell geladen",onClick:()=>r("models")}),d.jsx(xo,{icon:al,title:"Dienste",value:i?`${P}/${A}`:"…",unit:"laufen",tone:i?F>0?"warn":"ok":"loading",hint:ke?`Ausfall: ${ke}`:"Alle Dienste online",onClick:()=>il("maintenance")}),d.jsx(xo,{icon:ic,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:()=>il("maintenance")}),d.jsx(xo,{icon:oc,title:"Verbinden",value:f?`${ue}/${G.length}`:"…",unit:"Leitungen",tone:f?ue===G.length?"ok":"warn":"loading",hint:ie?`Gestört: ${ie}`:"Hermes Desktop & IDEs bereit",onClick:()=>r("connect")})]})]})]}),d.jsxs("div",{className:"space-y-6",children:[d.jsx(Tw,{problems:y.problems,pendingCount:V,openAuftraege:I,blockedIdeen:K,busy:R,onRepair:D,onNavigate:r}),d.jsxs("section",{children:[d.jsx(Su,{children:"Werkzeuge & Diagnose"}),d.jsx(Lw,{agent:u,svcErrors:F,onNavigate:r})]})]})]}),w]})}function Su({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 Ow({verdict:r,memory:s,warns:i,problems:a}){const u=i.length?`${i[0].label}: ${i[0].detail}${i.length>1?` (+${i.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:sc,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:$y,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Co,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:u},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Co,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(Uy,{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 Tw({problems:r,pendingCount:s,openAuftraege:i,blockedIdeen:a,busy:u,onRepair:f,onNavigate:m}){const h=s>0,y=i>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(Ry,{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(sc,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(n0,{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(jp,{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(ko,{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(rc,{className:"h-4.5 w-4.5"})}),d.jsxs("div",{children:[d.jsxs("p",{className:"text-sm font-bold text-foreground",children:[i," Vorschl",i===1?"ag":"äge"," im Auftragsbuch"]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Annehmen oder ablehnen."})]})]}),d.jsx(ko,{className:"h-4 w-4 shrink-0 text-primary/70"})]}),h&&d.jsxs("button",{onClick:()=>il("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(ic,{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(ko,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})})}function Lw({agent:r,svcErrors:s,onNavigate:i}){const a=[{label:"Hermes Agent",status:r?r.gateway_reachable?"Bereit":"Offline":"…",tone:r?r.gateway_reachable?"ok":"alert":"loading",action:()=>i("agent")},{label:"Konsole (Box-Shell)",status:r?r.box_console_reachable?"Bereit":"Offline":"…",tone:r?r.box_console_reachable?"ok":"warn":"loading",action:()=>i("konsole")},{label:"Systemlogs & Diagnose",status:s>0?`${s} Fehler`:"Keine Fehler",tone:s>0?"alert":"ok",action:()=>il("logs")},{label:"Wissens-Vault",status:"Öffnen",tone:"muted",action:()=>i("wissen")},{label:"Chronik & Zeitmaschine",status:"Öffnen",tone:"muted",action:()=>i("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 Dw=g.lazy(()=>Wt(()=>import("./ModelsView-Ck3R7mcg.js"),__vite__mapDeps([2,3,4,5,6,7,8])).then(r=>({default:r.ModelsView}))),Aw=g.lazy(()=>Wt(()=>import("./ConnectView-CxDIL-EH.js"),__vite__mapDeps([9,7])).then(r=>({default:r.ConnectView}))),Iw=g.lazy(()=>Wt(()=>import("./AgentView-BJR2UXXN.js"),[]).then(r=>({default:r.AgentView}))),zw=g.lazy(()=>Wt(()=>import("./KonsoleView-BwsSoiDo.js"),[]).then(r=>({default:r.KonsoleView}))),Fw=g.lazy(()=>Wt(()=>import("./GuideView-FadZtBSQ.js"),__vite__mapDeps([10,6,8])).then(r=>({default:r.GuideView}))),Uw=g.lazy(()=>Wt(()=>import("./AuftragsbuchView-Cr_8mzDy.js"),__vite__mapDeps([11,12,7])).then(r=>({default:r.AuftragsbuchView}))),$w=g.lazy(()=>Wt(()=>import("./IdeenView-CZhoWV4q.js"),__vite__mapDeps([13,12,4,8,7,5])).then(r=>({default:r.IdeenView}))),Bw=g.lazy(()=>Wt(()=>import("./SkillsView-DIrPeuP2.js"),__vite__mapDeps([14,3])).then(r=>({default:r.SkillsView}))),Vw=g.lazy(()=>Wt(()=>import("./ChronikView-xh-P-c-1.js"),__vite__mapDeps([15,5])).then(r=>({default:r.ChronikView}))),Hw=g.lazy(()=>Wt(()=>import("./WissenView-DOBd5fRz.js"),__vite__mapDeps([16,1])).then(r=>({default:r.WissenView})));function Ww(){return d.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:d.jsx(sc,{className:"h-5 w-5 animate-spin","aria-label":"Lädt …"})})}const Qw=/Mac|iPhone|iPad/.test(navigator.platform);function Kw(){vw(),Z1();const[r,s]=g.useState(()=>{const S=window.location.hash.slice(1);return os.some(P=>P.id===S)?S:"dashboard"}),i=g.useCallback(S=>{window.location.hash.slice(1)===S?s(S):window.location.hash=S},[]),[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:R}=ym(),{data:_}=ml();g.useEffect(()=>{document.documentElement.classList.add("dark")},[]),g.useEffect(()=>{const S=P=>{var F;w(((F=P.detail)==null?void 0:F.tab)||"maintenance"),y(!0)};return window.addEventListener("open-system-drawer",S),()=>window.removeEventListener("open-system-drawer",S)},[]),g.useEffect(()=>{const S=P=>{var F;const A=(F=P.detail)==null?void 0:F.view;A&&i(A)};return window.addEventListener("mc-navigate",S),()=>window.removeEventListener("mc-navigate",S)},[i]),g.useEffect(()=>{const S=()=>{const P=window.location.hash.slice(1);os.some(A=>A.id===P)&&s(P)};return window.addEventListener("hashchange",S),()=>window.removeEventListener("hashchange",S)},[]),g.useEffect(()=>{m(!1)},[r]);const D=os.find(S=>S.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(c1,{onNavigate:i}),d.jsx(fw,{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(Jh,{collapsed:a,onToggleCollapse:()=>{u(S=>{const P=!S;return localStorage.setItem("mc_sidebar_collapsed",P.toString()),P})},view:r,health:x,backendDown:R,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(Jh,{collapsed:!1,onClose:()=>m(!1),view:r,health:x,backendDown:R,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(Ky,{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(K1,{}),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 S=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(S)},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(Dy,{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:Qw?"⌘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(Ww,{}),children:[r==="dashboard"&&d.jsx(Mw,{onNavigate:S=>i(S)}),r==="ideen"&&d.jsx($w,{}),r==="auftraege"&&d.jsx(Uw,{}),r==="skills"&&d.jsx(Bw,{}),r==="models"&&d.jsx(Dw,{}),r==="connect"&&d.jsx(Aw,{}),r==="wissen"&&d.jsx(Hw,{}),r==="chronik"&&d.jsx(Vw,{}),r==="agent"&&d.jsx(Iw,{}),r==="konsole"&&d.jsx(zw,{}),r==="guide"&&d.jsx(Fw,{})]})})]})]})}function Jh({collapsed:r,onToggleCollapse:s,onClose:i,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(ko,{className:"h-4 w-4","aria-hidden":"true"}):d.jsx(My,{className:"h-4 w-4","aria-hidden":"true"})}),i&&d.jsx("button",{onClick:i,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation schließen",children:d.jsx(ul,{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 R=null;return os.map(_=>{const D=_.group!==R;return R=_.group,d.jsxs("div",{className:"space-y-1",children:[D&&(r?R!==os[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:i,"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 qw extends Yu.Component{constructor(){super(...arguments);ih(this,"state",{error:null})}static getDerivedStateFromError(i){return{error:i}}componentDidCatch(i,a){console.error("Unbehandelter UI-Fehler:",i,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 Gw=new ly({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});Dv.createRoot(document.getElementById("root")).render(d.jsx(Yu.StrictMode,{children:d.jsx(qw,{children:d.jsx(ay,{client:Gw,children:d.jsx(Kw,{})})})}));export{zy as $,rw as A,_y as B,Ry as C,Ch as D,zu as E,ko as F,Oy as G,Uy as H,nw as I,Ay as J,Yw as K,sc as L,jo as M,Ny as N,lc as O,Gy as P,e0 as Q,ss as R,Zy as S,Co as T,vo as U,al as V,n0 as W,ul as X,Np as Y,oc as Z,Qy as _,ok as a,Jy as a0,Y1 as a1,X1 as a2,Ty as a3,hk as a4,rc as a5,ek as a6,jp as a7,Iy as a8,Do as a9,Nu as aa,So as ab,sy as ac,ot as ad,bt as ae,mp as af,Be as ag,tw as ah,dk as ai,tk as aj,By as ak,ic as al,$y as am,J1 as an,Yu as ao,cp as ap,nk as aq,rk as ar,Wy as as,p1 as at,Zu as au,Rp as av,Xu as aw,Ee as b,ge as c,Jw as d,jy as e,wm as f,sk as g,ml as h,ik as i,d as j,vm as k,ck as l,ak as m,Se as n,ts as o,h1 as p,Pe as q,g as r,Xw as s,Cp as t,ll as u,fk as v,lk as w,bm as x,bu as y,uk as z};