@alexberardi/jarvis-admin 0.1.87 → 0.1.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- (function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))i(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function o(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(d){if(d.ep)return;d.ep=!0;const f=o(d);fetch(d.href,f)}})();function Zx(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var zu={exports:{}},cl={};var qp;function Lb(){if(qp)return cl;qp=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function o(i,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var v in d)v!=="key"&&(f[v]=d[v])}else f=d;return d=f.ref,{$$typeof:a,type:i,key:m,ref:d!==void 0?d:null,props:f}}return cl.Fragment=s,cl.jsx=o,cl.jsxs=o,cl}var Hp;function Bb(){return Hp||(Hp=1,zu.exports=Lb()),zu.exports}var l=Bb(),Du={exports:{}},Te={};var Gp;function qb(){if(Gp)return Te;Gp=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function M(S){return S===null||typeof S!="object"?null:(S=j&&S[j]||S["@@iterator"],typeof S=="function"?S:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,_={};function O(S,U,V){this.props=S,this.context=U,this.refs=_,this.updater=V||w}O.prototype.isReactComponent={},O.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,U,"setState")},O.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function k(){}k.prototype=O.prototype;function G(S,U,V){this.props=S,this.context=U,this.refs=_,this.updater=V||w}var $=G.prototype=new k;$.constructor=G,E($,O.prototype),$.isPureReactComponent=!0;var W=Array.isArray;function te(){}var H={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function oe(S,U,V){var J=V.ref;return{$$typeof:a,type:S,key:U,ref:J!==void 0?J:null,props:V}}function be(S,U){return oe(S.type,U,S.props)}function se(S){return typeof S=="object"&&S!==null&&S.$$typeof===a}function ie(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(V){return U[V]})}var Ee=/\/+/g;function Re(S,U){return typeof S=="object"&&S!==null&&S.key!=null?ie(""+S.key):U.toString(36)}function ne(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(te,te):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function C(S,U,V,J,re){var me=typeof S;(me==="undefined"||me==="boolean")&&(S=null);var ue=!1;if(S===null)ue=!0;else switch(me){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(S.$$typeof){case a:case s:ue=!0;break;case y:return ue=S._init,C(ue(S._payload),U,V,J,re)}}if(ue)return re=re(S),ue=J===""?"."+Re(S,0):J,W(re)?(V="",ue!=null&&(V=ue.replace(Ee,"$&/")+"/"),C(re,U,V,"",function(D){return D})):re!=null&&(se(re)&&(re=be(re,V+(re.key==null||S&&S.key===re.key?"":(""+re.key).replace(Ee,"$&/")+"/")+ue)),U.push(re)),1;ue=0;var je=J===""?".":J+":";if(W(S))for(var L=0;L<S.length;L++)J=S[L],me=je+Re(J,L),ue+=C(J,U,V,me,re);else if(L=M(S),typeof L=="function")for(S=L.call(S),L=0;!(J=S.next()).done;)J=J.value,me=je+Re(J,L++),ue+=C(J,U,V,me,re);else if(me==="object"){if(typeof S.then=="function")return C(ne(S),U,V,J,re);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ue}function X(S,U,V){if(S==null)return S;var J=[],re=0;return C(S,J,"","",function(me){return U.call(V,me,re++)}),J}function K(S){if(S._status===-1){var U=S._result;U=U(),U.then(function(V){(S._status===0||S._status===-1)&&(S._status=1,S._result=V)},function(V){(S._status===0||S._status===-1)&&(S._status=2,S._result=V)}),S._status===-1&&(S._status=0,S._result=U)}if(S._status===1)return S._result.default;throw S._result}var ve=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},ee={map:X,forEach:function(S,U,V){X(S,function(){U.apply(this,arguments)},V)},count:function(S){var U=0;return X(S,function(){U++}),U},toArray:function(S){return X(S,function(U){return U})||[]},only:function(S){if(!se(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Te.Activity=x,Te.Children=ee,Te.Component=O,Te.Fragment=o,Te.Profiler=d,Te.PureComponent=G,Te.StrictMode=i,Te.Suspense=g,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Te.__COMPILER_RUNTIME={__proto__:null,c:function(S){return H.H.useMemoCache(S)}},Te.cache=function(S){return function(){return S.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(S,U,V){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var J=E({},S.props),re=S.key;if(U!=null)for(me in U.key!==void 0&&(re=""+U.key),U)!z.call(U,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&U.ref===void 0||(J[me]=U[me]);var me=arguments.length-2;if(me===1)J.children=V;else if(1<me){for(var ue=Array(me),je=0;je<me;je++)ue[je]=arguments[je+2];J.children=ue}return oe(S.type,re,J)},Te.createContext=function(S){return S={$$typeof:m,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},Te.createElement=function(S,U,V){var J,re={},me=null;if(U!=null)for(J in U.key!==void 0&&(me=""+U.key),U)z.call(U,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(re[J]=U[J]);var ue=arguments.length-2;if(ue===1)re.children=V;else if(1<ue){for(var je=Array(ue),L=0;L<ue;L++)je[L]=arguments[L+2];re.children=je}if(S&&S.defaultProps)for(J in ue=S.defaultProps,ue)re[J]===void 0&&(re[J]=ue[J]);return oe(S,me,re)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(S){return{$$typeof:v,render:S}},Te.isValidElement=se,Te.lazy=function(S){return{$$typeof:y,_payload:{_status:-1,_result:S},_init:K}},Te.memo=function(S,U){return{$$typeof:h,type:S,compare:U===void 0?null:U}},Te.startTransition=function(S){var U=H.T,V={};H.T=V;try{var J=S(),re=H.S;re!==null&&re(V,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(te,ve)}catch(me){ve(me)}finally{U!==null&&V.types!==null&&(U.types=V.types),H.T=U}},Te.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Te.use=function(S){return H.H.use(S)},Te.useActionState=function(S,U,V){return H.H.useActionState(S,U,V)},Te.useCallback=function(S,U){return H.H.useCallback(S,U)},Te.useContext=function(S){return H.H.useContext(S)},Te.useDebugValue=function(){},Te.useDeferredValue=function(S,U){return H.H.useDeferredValue(S,U)},Te.useEffect=function(S,U){return H.H.useEffect(S,U)},Te.useEffectEvent=function(S){return H.H.useEffectEvent(S)},Te.useId=function(){return H.H.useId()},Te.useImperativeHandle=function(S,U,V){return H.H.useImperativeHandle(S,U,V)},Te.useInsertionEffect=function(S,U){return H.H.useInsertionEffect(S,U)},Te.useLayoutEffect=function(S,U){return H.H.useLayoutEffect(S,U)},Te.useMemo=function(S,U){return H.H.useMemo(S,U)},Te.useOptimistic=function(S,U){return H.H.useOptimistic(S,U)},Te.useReducer=function(S,U,V){return H.H.useReducer(S,U,V)},Te.useRef=function(S){return H.H.useRef(S)},Te.useState=function(S){return H.H.useState(S)},Te.useSyncExternalStore=function(S,U,V){return H.H.useSyncExternalStore(S,U,V)},Te.useTransition=function(){return H.H.useTransition()},Te.version="19.2.4",Te}var Qp;function gd(){return Qp||(Qp=1,Du.exports=qb()),Du.exports}var N=gd();const le=Zx(N);var Uu={exports:{}},ul={},Lu={exports:{}},Bu={};var Vp;function Hb(){return Vp||(Vp=1,(function(a){function s(C,X){var K=C.length;C.push(X);e:for(;0<K;){var ve=K-1>>>1,ee=C[ve];if(0<d(ee,X))C[ve]=X,C[K]=ee,K=ve;else break e}}function o(C){return C.length===0?null:C[0]}function i(C){if(C.length===0)return null;var X=C[0],K=C.pop();if(K!==X){C[0]=K;e:for(var ve=0,ee=C.length,S=ee>>>1;ve<S;){var U=2*(ve+1)-1,V=C[U],J=U+1,re=C[J];if(0>d(V,K))J<ee&&0>d(re,V)?(C[ve]=re,C[J]=K,ve=J):(C[ve]=V,C[U]=K,ve=U);else if(J<ee&&0>d(re,K))C[ve]=re,C[J]=K,ve=J;else break e}}return X}function d(C,X){var K=C.sortIndex-X.sortIndex;return K!==0?K:C.id-X.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();a.unstable_now=function(){return m.now()-v}}var g=[],h=[],y=1,x=null,j=3,M=!1,w=!1,E=!1,_=!1,O=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function $(C){for(var X=o(h);X!==null;){if(X.callback===null)i(h);else if(X.startTime<=C)i(h),X.sortIndex=X.expirationTime,s(g,X);else break;X=o(h)}}function W(C){if(E=!1,$(C),!w)if(o(g)!==null)w=!0,te||(te=!0,ie());else{var X=o(h);X!==null&&ne(W,X.startTime-C)}}var te=!1,H=-1,z=5,oe=-1;function be(){return _?!0:!(a.unstable_now()-oe<z)}function se(){if(_=!1,te){var C=a.unstable_now();oe=C;var X=!0;try{e:{w=!1,E&&(E=!1,k(H),H=-1),M=!0;var K=j;try{t:{for($(C),x=o(g);x!==null&&!(x.expirationTime>C&&be());){var ve=x.callback;if(typeof ve=="function"){x.callback=null,j=x.priorityLevel;var ee=ve(x.expirationTime<=C);if(C=a.unstable_now(),typeof ee=="function"){x.callback=ee,$(C),X=!0;break t}x===o(g)&&i(g),$(C)}else i(g);x=o(g)}if(x!==null)X=!0;else{var S=o(h);S!==null&&ne(W,S.startTime-C),X=!1}}break e}finally{x=null,j=K,M=!1}X=void 0}}finally{X?ie():te=!1}}}var ie;if(typeof G=="function")ie=function(){G(se)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Re=Ee.port2;Ee.port1.onmessage=se,ie=function(){Re.postMessage(null)}}else ie=function(){O(se,0)};function ne(C,X){H=O(function(){C(a.unstable_now())},X)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(C){C.callback=null},a.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<C?Math.floor(1e3/C):5},a.unstable_getCurrentPriorityLevel=function(){return j},a.unstable_next=function(C){switch(j){case 1:case 2:case 3:var X=3;break;default:X=j}var K=j;j=X;try{return C()}finally{j=K}},a.unstable_requestPaint=function(){_=!0},a.unstable_runWithPriority=function(C,X){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var K=j;j=C;try{return X()}finally{j=K}},a.unstable_scheduleCallback=function(C,X,K){var ve=a.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?ve+K:ve):K=ve,C){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=K+ee,C={id:y++,callback:X,priorityLevel:C,startTime:K,expirationTime:ee,sortIndex:-1},K>ve?(C.sortIndex=K,s(h,C),o(g)===null&&C===o(h)&&(E?(k(H),H=-1):E=!0,ne(W,K-ve))):(C.sortIndex=ee,s(g,C),w||M||(w=!0,te||(te=!0,ie()))),C},a.unstable_shouldYield=be,a.unstable_wrapCallback=function(C){var X=j;return function(){var K=j;j=X;try{return C.apply(this,arguments)}finally{j=K}}}})(Bu)),Bu}var Fp;function Gb(){return Fp||(Fp=1,Lu.exports=Hb()),Lu.exports}var qu={exports:{}},Rt={};var Yp;function Qb(){if(Yp)return Rt;Yp=1;var a=gd();function s(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(s(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,h,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:x==null?null:""+x,children:g,containerInfo:h,implementation:y}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Rt.createPortal=function(g,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(s(299));return f(g,h,null,y)},Rt.flushSync=function(g){var h=m.T,y=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=y,i.d.f()}},Rt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(g,h))},Rt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Rt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,x=v(y,h.crossOrigin),j=typeof h.integrity=="string"?h.integrity:void 0,M=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:x,integrity:j,fetchPriority:M}):y==="script"&&i.d.X(g,{crossOrigin:x,integrity:j,fetchPriority:M,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Rt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=v(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},Rt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,x=v(y,h.crossOrigin);i.d.L(g,y,{crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Rt.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=v(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},Rt.requestFormReset=function(g){i.d.r(g)},Rt.unstable_batchedUpdates=function(g,h){return g(h)},Rt.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.2.4",Rt}var Xp;function Jx(){if(Xp)return qu.exports;Xp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),qu.exports=Qb(),qu.exports}var Kp;function Vb(){if(Kp)return ul;Kp=1;var a=Gb(),s=gd(),o=Jx();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(r=c.return,r!==null){n=r;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return g(c),e;if(u===r)return g(c),t;u=u.sibling}throw Error(i(188))}if(n.return!==r.return)n=c,r=u;else{for(var p=!1,b=c.child;b;){if(b===n){p=!0,n=c,r=u;break}if(b===r){p=!0,r=c,n=u;break}b=b.sibling}if(!p){for(b=u.child;b;){if(b===n){p=!0,n=u,r=c;break}if(b===r){p=!0,r=u,n=c;break}b=b.sibling}if(!p)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,j=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),G=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function Re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case O:return"Profiler";case _:return"StrictMode";case W:return"Suspense";case te:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case G:return e.displayName||"Context";case k:return(e._context.displayName||"Context")+".Consumer";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:Re(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return Re(e(t))}catch{}}return null}var ne=Array.isArray,C=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},ve=[],ee=-1;function S(e){return{current:e}}function U(e){0>ee||(e.current=ve[ee],ve[ee]=null,ee--)}function V(e,t){ee++,ve[ee]=e.current,e.current=t}var J=S(null),re=S(null),me=S(null),ue=S(null);function je(e,t){switch(V(me,t),V(re,e),V(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ip(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ip(t),e=cp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(J),V(J,e)}function L(){U(J),U(re),U(me)}function D(e){e.memoizedState!==null&&V(ue,e);var t=J.current,n=cp(t,e.type);t!==n&&(V(re,e),V(J,n))}function Se(e){re.current===e&&(U(J),U(re)),ue.current===e&&(U(ue),sl._currentValue=K)}var pe,Ut;function ut(e){if(pe===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||"",Ut=-1<n.stack.indexOf(`
1
+ (function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))i(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function o(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(d){if(d.ep)return;d.ep=!0;const f=o(d);fetch(d.href,f)}})();function Zx(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var zu={exports:{}},cl={};var qp;function Lb(){if(qp)return cl;qp=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function o(i,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var v in d)v!=="key"&&(f[v]=d[v])}else f=d;return d=f.ref,{$$typeof:a,type:i,key:m,ref:d!==void 0?d:null,props:f}}return cl.Fragment=s,cl.jsx=o,cl.jsxs=o,cl}var Hp;function Bb(){return Hp||(Hp=1,zu.exports=Lb()),zu.exports}var l=Bb(),Du={exports:{}},_e={};var Gp;function qb(){if(Gp)return _e;Gp=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function M(S){return S===null||typeof S!="object"?null:(S=j&&S[j]||S["@@iterator"],typeof S=="function"?S:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,_={};function A(S,L,Q){this.props=S,this.context=L,this.refs=_,this.updater=Q||w}A.prototype.isReactComponent={},A.prototype.setState=function(S,L){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,L,"setState")},A.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function k(){}k.prototype=A.prototype;function X(S,L,Q){this.props=S,this.context=L,this.refs=_,this.updater=Q||w}var I=X.prototype=new k;I.constructor=X,E(I,A.prototype),I.isPureReactComponent=!0;var W=Array.isArray;function ee(){}var D={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function oe(S,L,Q){var Z=Q.ref;return{$$typeof:a,type:S,key:L,ref:Z!==void 0?Z:null,props:Q}}function be(S,L){return oe(S.type,L,S.props)}function se(S){return typeof S=="object"&&S!==null&&S.$$typeof===a}function pe(S){var L={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Q){return L[Q]})}var Ee=/\/+/g;function he(S,L){return typeof S=="object"&&S!==null&&S.key!=null?pe(""+S.key):L.toString(36)}function ne(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(ee,ee):(S.status="pending",S.then(function(L){S.status==="pending"&&(S.status="fulfilled",S.value=L)},function(L){S.status==="pending"&&(S.status="rejected",S.reason=L)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function C(S,L,Q,Z,re){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var ce=!1;if(S===null)ce=!0;else switch(fe){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(S.$$typeof){case a:case s:ce=!0;break;case y:return ce=S._init,C(ce(S._payload),L,Q,Z,re)}}if(ce)return re=re(S),ce=Z===""?"."+he(S,0):Z,W(re)?(Q="",ce!=null&&(Q=ce.replace(Ee,"$&/")+"/"),C(re,L,Q,"",function(U){return U})):re!=null&&(se(re)&&(re=be(re,Q+(re.key==null||S&&S.key===re.key?"":(""+re.key).replace(Ee,"$&/")+"/")+ce)),L.push(re)),1;ce=0;var Se=Z===""?".":Z+":";if(W(S))for(var B=0;B<S.length;B++)Z=S[B],fe=Se+he(Z,B),ce+=C(Z,L,Q,fe,re);else if(B=M(S),typeof B=="function")for(S=B.call(S),B=0;!(Z=S.next()).done;)Z=Z.value,fe=Se+he(Z,B++),ce+=C(Z,L,Q,fe,re);else if(fe==="object"){if(typeof S.then=="function")return C(ne(S),L,Q,Z,re);throw L=String(S),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return ce}function Y(S,L,Q){if(S==null)return S;var Z=[],re=0;return C(S,Z,"","",function(fe){return L.call(Q,fe,re++)}),Z}function K(S){if(S._status===-1){var L=S._result;L=L(),L.then(function(Q){(S._status===0||S._status===-1)&&(S._status=1,S._result=Q)},function(Q){(S._status===0||S._status===-1)&&(S._status=2,S._result=Q)}),S._status===-1&&(S._status=0,S._result=L)}if(S._status===1)return S._result.default;throw S._result}var ge=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},te={map:Y,forEach:function(S,L,Q){Y(S,function(){L.apply(this,arguments)},Q)},count:function(S){var L=0;return Y(S,function(){L++}),L},toArray:function(S){return Y(S,function(L){return L})||[]},only:function(S){if(!se(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return _e.Activity=x,_e.Children=te,_e.Component=A,_e.Fragment=o,_e.Profiler=d,_e.PureComponent=X,_e.StrictMode=i,_e.Suspense=g,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,_e.__COMPILER_RUNTIME={__proto__:null,c:function(S){return D.H.useMemoCache(S)}},_e.cache=function(S){return function(){return S.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(S,L,Q){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var Z=E({},S.props),re=S.key;if(L!=null)for(fe in L.key!==void 0&&(re=""+L.key),L)!z.call(L,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&L.ref===void 0||(Z[fe]=L[fe]);var fe=arguments.length-2;if(fe===1)Z.children=Q;else if(1<fe){for(var ce=Array(fe),Se=0;Se<fe;Se++)ce[Se]=arguments[Se+2];Z.children=ce}return oe(S.type,re,Z)},_e.createContext=function(S){return S={$$typeof:m,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},_e.createElement=function(S,L,Q){var Z,re={},fe=null;if(L!=null)for(Z in L.key!==void 0&&(fe=""+L.key),L)z.call(L,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(re[Z]=L[Z]);var ce=arguments.length-2;if(ce===1)re.children=Q;else if(1<ce){for(var Se=Array(ce),B=0;B<ce;B++)Se[B]=arguments[B+2];re.children=Se}if(S&&S.defaultProps)for(Z in ce=S.defaultProps,ce)re[Z]===void 0&&(re[Z]=ce[Z]);return oe(S,fe,re)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(S){return{$$typeof:v,render:S}},_e.isValidElement=se,_e.lazy=function(S){return{$$typeof:y,_payload:{_status:-1,_result:S},_init:K}},_e.memo=function(S,L){return{$$typeof:h,type:S,compare:L===void 0?null:L}},_e.startTransition=function(S){var L=D.T,Q={};D.T=Q;try{var Z=S(),re=D.S;re!==null&&re(Q,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(ee,ge)}catch(fe){ge(fe)}finally{L!==null&&Q.types!==null&&(L.types=Q.types),D.T=L}},_e.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},_e.use=function(S){return D.H.use(S)},_e.useActionState=function(S,L,Q){return D.H.useActionState(S,L,Q)},_e.useCallback=function(S,L){return D.H.useCallback(S,L)},_e.useContext=function(S){return D.H.useContext(S)},_e.useDebugValue=function(){},_e.useDeferredValue=function(S,L){return D.H.useDeferredValue(S,L)},_e.useEffect=function(S,L){return D.H.useEffect(S,L)},_e.useEffectEvent=function(S){return D.H.useEffectEvent(S)},_e.useId=function(){return D.H.useId()},_e.useImperativeHandle=function(S,L,Q){return D.H.useImperativeHandle(S,L,Q)},_e.useInsertionEffect=function(S,L){return D.H.useInsertionEffect(S,L)},_e.useLayoutEffect=function(S,L){return D.H.useLayoutEffect(S,L)},_e.useMemo=function(S,L){return D.H.useMemo(S,L)},_e.useOptimistic=function(S,L){return D.H.useOptimistic(S,L)},_e.useReducer=function(S,L,Q){return D.H.useReducer(S,L,Q)},_e.useRef=function(S){return D.H.useRef(S)},_e.useState=function(S){return D.H.useState(S)},_e.useSyncExternalStore=function(S,L,Q){return D.H.useSyncExternalStore(S,L,Q)},_e.useTransition=function(){return D.H.useTransition()},_e.version="19.2.4",_e}var Qp;function gd(){return Qp||(Qp=1,Du.exports=qb()),Du.exports}var N=gd();const le=Zx(N);var Uu={exports:{}},ul={},Lu={exports:{}},Bu={};var Vp;function Hb(){return Vp||(Vp=1,(function(a){function s(C,Y){var K=C.length;C.push(Y);e:for(;0<K;){var ge=K-1>>>1,te=C[ge];if(0<d(te,Y))C[ge]=Y,C[K]=te,K=ge;else break e}}function o(C){return C.length===0?null:C[0]}function i(C){if(C.length===0)return null;var Y=C[0],K=C.pop();if(K!==Y){C[0]=K;e:for(var ge=0,te=C.length,S=te>>>1;ge<S;){var L=2*(ge+1)-1,Q=C[L],Z=L+1,re=C[Z];if(0>d(Q,K))Z<te&&0>d(re,Q)?(C[ge]=re,C[Z]=K,ge=Z):(C[ge]=Q,C[L]=K,ge=L);else if(Z<te&&0>d(re,K))C[ge]=re,C[Z]=K,ge=Z;else break e}}return Y}function d(C,Y){var K=C.sortIndex-Y.sortIndex;return K!==0?K:C.id-Y.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();a.unstable_now=function(){return m.now()-v}}var g=[],h=[],y=1,x=null,j=3,M=!1,w=!1,E=!1,_=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function I(C){for(var Y=o(h);Y!==null;){if(Y.callback===null)i(h);else if(Y.startTime<=C)i(h),Y.sortIndex=Y.expirationTime,s(g,Y);else break;Y=o(h)}}function W(C){if(E=!1,I(C),!w)if(o(g)!==null)w=!0,ee||(ee=!0,pe());else{var Y=o(h);Y!==null&&ne(W,Y.startTime-C)}}var ee=!1,D=-1,z=5,oe=-1;function be(){return _?!0:!(a.unstable_now()-oe<z)}function se(){if(_=!1,ee){var C=a.unstable_now();oe=C;var Y=!0;try{e:{w=!1,E&&(E=!1,k(D),D=-1),M=!0;var K=j;try{t:{for(I(C),x=o(g);x!==null&&!(x.expirationTime>C&&be());){var ge=x.callback;if(typeof ge=="function"){x.callback=null,j=x.priorityLevel;var te=ge(x.expirationTime<=C);if(C=a.unstable_now(),typeof te=="function"){x.callback=te,I(C),Y=!0;break t}x===o(g)&&i(g),I(C)}else i(g);x=o(g)}if(x!==null)Y=!0;else{var S=o(h);S!==null&&ne(W,S.startTime-C),Y=!1}}break e}finally{x=null,j=K,M=!1}Y=void 0}}finally{Y?pe():ee=!1}}}var pe;if(typeof X=="function")pe=function(){X(se)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,he=Ee.port2;Ee.port1.onmessage=se,pe=function(){he.postMessage(null)}}else pe=function(){A(se,0)};function ne(C,Y){D=A(function(){C(a.unstable_now())},Y)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(C){C.callback=null},a.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<C?Math.floor(1e3/C):5},a.unstable_getCurrentPriorityLevel=function(){return j},a.unstable_next=function(C){switch(j){case 1:case 2:case 3:var Y=3;break;default:Y=j}var K=j;j=Y;try{return C()}finally{j=K}},a.unstable_requestPaint=function(){_=!0},a.unstable_runWithPriority=function(C,Y){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var K=j;j=C;try{return Y()}finally{j=K}},a.unstable_scheduleCallback=function(C,Y,K){var ge=a.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?ge+K:ge):K=ge,C){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=K+te,C={id:y++,callback:Y,priorityLevel:C,startTime:K,expirationTime:te,sortIndex:-1},K>ge?(C.sortIndex=K,s(h,C),o(g)===null&&C===o(h)&&(E?(k(D),D=-1):E=!0,ne(W,K-ge))):(C.sortIndex=te,s(g,C),w||M||(w=!0,ee||(ee=!0,pe()))),C},a.unstable_shouldYield=be,a.unstable_wrapCallback=function(C){var Y=j;return function(){var K=j;j=Y;try{return C.apply(this,arguments)}finally{j=K}}}})(Bu)),Bu}var Fp;function Gb(){return Fp||(Fp=1,Lu.exports=Hb()),Lu.exports}var qu={exports:{}},Rt={};var Yp;function Qb(){if(Yp)return Rt;Yp=1;var a=gd();function s(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(s(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,h,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:x==null?null:""+x,children:g,containerInfo:h,implementation:y}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Rt.createPortal=function(g,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(s(299));return f(g,h,null,y)},Rt.flushSync=function(g){var h=m.T,y=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=y,i.d.f()}},Rt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(g,h))},Rt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Rt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,x=v(y,h.crossOrigin),j=typeof h.integrity=="string"?h.integrity:void 0,M=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:x,integrity:j,fetchPriority:M}):y==="script"&&i.d.X(g,{crossOrigin:x,integrity:j,fetchPriority:M,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Rt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=v(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},Rt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,x=v(y,h.crossOrigin);i.d.L(g,y,{crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Rt.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=v(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},Rt.requestFormReset=function(g){i.d.r(g)},Rt.unstable_batchedUpdates=function(g,h){return g(h)},Rt.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.2.4",Rt}var Xp;function Jx(){if(Xp)return qu.exports;Xp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),qu.exports=Qb(),qu.exports}var Kp;function Vb(){if(Kp)return ul;Kp=1;var a=Gb(),s=gd(),o=Jx();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(r=c.return,r!==null){n=r;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return g(c),e;if(u===r)return g(c),t;u=u.sibling}throw Error(i(188))}if(n.return!==r.return)n=c,r=u;else{for(var p=!1,b=c.child;b;){if(b===n){p=!0,n=c,r=u;break}if(b===r){p=!0,r=c,n=u;break}b=b.sibling}if(!p){for(b=u.child;b;){if(b===n){p=!0,n=u,r=c;break}if(b===r){p=!0,r=u,n=c;break}b=b.sibling}if(!p)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,j=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),X=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function pe(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case A:return"Profiler";case _:return"StrictMode";case W:return"Suspense";case ee:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case X:return e.displayName||"Context";case k:return(e._context.displayName||"Context")+".Consumer";case I:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ne=Array.isArray,C=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},ge=[],te=-1;function S(e){return{current:e}}function L(e){0>te||(e.current=ge[te],ge[te]=null,te--)}function Q(e,t){te++,ge[te]=e.current,e.current=t}var Z=S(null),re=S(null),fe=S(null),ce=S(null);function Se(e,t){switch(Q(fe,t),Q(re,e),Q(Z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ip(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ip(t),e=cp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(Z),Q(Z,e)}function B(){L(Z),L(re),L(fe)}function U(e){e.memoizedState!==null&&Q(ce,e);var t=Z.current,n=cp(t,e.type);t!==n&&(Q(re,e),Q(Z,n))}function we(e){re.current===e&&(L(Z),L(re)),ce.current===e&&(L(ce),sl._currentValue=K)}var xe,Ut;function ut(e){if(xe===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||"",Ut=-1<n.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+pe+e+Ut}var Dn=!1;function mr(e,t){if(!e||Dn)return"";Dn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(F){var Q=F}Reflect.construct(e,[],I)}else{try{I.call()}catch(F){Q=F}e.call(I.prototype)}}else{try{throw Error()}catch(F){Q=F}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(F){if(F&&Q&&typeof F.stack=="string")return[F.stack,Q.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=r.DetermineComponentFrameRoot(),p=u[0],b=u[1];if(p&&b){var T=p.split(`
4
- `),q=b.split(`
5
- `);for(c=r=0;r<T.length&&!T[r].includes("DetermineComponentFrameRoot");)r++;for(;c<q.length&&!q[c].includes("DetermineComponentFrameRoot");)c++;if(r===T.length||c===q.length)for(r=T.length-1,c=q.length-1;1<=r&&0<=c&&T[r]!==q[c];)c--;for(;1<=r&&0<=c;r--,c--)if(T[r]!==q[c]){if(r!==1||c!==1)do if(r--,c--,0>c||T[r]!==q[c]){var Z=`
6
- `+T[r].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=r&&0<=c);break}}}finally{Dn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ut(n):""}function Un(e,t){switch(e.tag){case 26:case 27:case 5:return ut(e.type);case 16:return ut("Lazy");case 13:return e.child!==t&&t!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return mr(e.type,!1);case 11:return mr(e.type.render,!1);case 1:return mr(e.type,!0);case 31:return ut("Activity");default:return""}}function ps(e){try{var t="",n=null;do t+=Un(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
3
+ `+xe+e+Ut}var Dn=!1;function mr(e,t){if(!e||Dn)return"";Dn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(V){var G=V}Reflect.construct(e,[],P)}else{try{P.call()}catch(V){G=V}e.call(P.prototype)}}else{try{throw Error()}catch(V){G=V}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(V){if(V&&G&&typeof V.stack=="string")return[V.stack,G.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=r.DetermineComponentFrameRoot(),p=u[0],b=u[1];if(p&&b){var T=p.split(`
4
+ `),H=b.split(`
5
+ `);for(c=r=0;r<T.length&&!T[r].includes("DetermineComponentFrameRoot");)r++;for(;c<H.length&&!H[c].includes("DetermineComponentFrameRoot");)c++;if(r===T.length||c===H.length)for(r=T.length-1,c=H.length-1;1<=r&&0<=c&&T[r]!==H[c];)c--;for(;1<=r&&0<=c;r--,c--)if(T[r]!==H[c]){if(r!==1||c!==1)do if(r--,c--,0>c||T[r]!==H[c]){var $=`
6
+ `+T[r].replace(" at new "," at ");return e.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",e.displayName)),$}while(1<=r&&0<=c);break}}}finally{Dn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ut(n):""}function Un(e,t){switch(e.tag){case 26:case 27:case 5:return ut(e.type);case 16:return ut("Lazy");case 13:return e.child!==t&&t!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return mr(e.type,!1);case 11:return mr(e.type.render,!1);case 1:return mr(e.type,!0);case 31:return ut("Activity");default:return""}}function ps(e){try{var t="",n=null;do t+=Un(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
7
7
  Error generating stack: `+r.message+`
8
- `+r.stack}}var Jt=Object.prototype.hasOwnProperty,xs=a.unstable_scheduleCallback,vs=a.unstable_cancelCallback,Mt=a.unstable_shouldYield,nn=a.unstable_requestPaint,At=a.unstable_now,ji=a.unstable_getCurrentPriorityLevel,Ln=a.unstable_ImmediatePriority,Cl=a.unstable_UserBlockingPriority,Bn=a.unstable_NormalPriority,gs=a.unstable_LowPriority,Da=a.unstable_IdlePriority,Tl=a.log,rn=a.unstable_setDisableYieldValue,qn=null,Ot=null;function ga(e){if(typeof Tl=="function"&&rn(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(qn,e)}catch{}}var Tt=Math.clz32?Math.clz32:Ca,Si=Math.log,ys=Math.LN2;function Ca(e){return e>>>=0,e===0?32:31-(Si(e)/ys|0)|0}var hr=256,pr=262144,Hn=4194304;function Ta(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ce(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var c=0,u=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var b=r&134217727;return b!==0?(r=b&~u,r!==0?c=Ta(r):(p&=b,p!==0?c=Ta(p):n||(n=b&~e,n!==0&&(c=Ta(n))))):(b=r&~u,b!==0?c=Ta(b):p!==0?c=Ta(p):n||(n=r&~e,n!==0&&(c=Ta(n)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:c}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var e=Hn;return Hn<<=1,(Hn&62914560)===0&&(Hn=4194304),e}function sn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Lt(e,t,n,r,c,u){var p=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var b=e.entanglements,T=e.expirationTimes,q=e.hiddenUpdates;for(n=p&~n;0<n;){var Z=31-Tt(n),I=1<<Z;b[Z]=0,T[Z]=-1;var Q=q[Z];if(Q!==null)for(q[Z]=null,Z=0;Z<Q.length;Z++){var F=Q[Z];F!==null&&(F.lane&=-536870913)}n&=~I}r!==0&&Gn(e,r,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(p&~t))}function Gn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tt(n),c=1<<r;c&t|e[r]&t&&(e[r]|=t),n&=~c}}function qt(e,t){var n=t&-t;return n=(n&42)!==0?1:xr(n),(n&(e.suspendedLanes|t))!==0?0:n}function xr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ya(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function wi(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:Ap(e.type))}function Kd(e,t){var n=X.p;try{return X.p=e,t()}finally{X.p=n}}var ln=Math.random().toString(36).slice(2),Nt="__reactFiber$"+ln,Ht="__reactProps$"+ln,vr="__reactContainer$"+ln,Ei="__reactEvents$"+ln,Cg="__reactListeners$"+ln,Tg="__reactHandles$"+ln,$d="__reactResources$"+ln,bs="__reactMarker$"+ln;function Ci(e){delete e[Nt],delete e[Ht],delete e[Ei],delete e[Cg],delete e[Tg]}function gr(e){var t=e[Nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vr]||n[Nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xp(e);e!==null;){if(n=e[Nt])return n;e=xp(e)}return t}e=n,n=e.parentNode}return null}function yr(e){if(e=e[Nt]||e[vr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ns(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function br(e){var t=e[$d];return t||(t=e[$d]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[bs]=!0}var Zd=new Set,Jd={};function Qn(e,t){Nr(e,t),Nr(e+"Capture",t)}function Nr(e,t){for(Jd[e]=t,e=0;e<t.length;e++)Zd.add(t[e])}var _g=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Pd={},Id={};function Rg(e){return Jt.call(Id,e)?!0:Jt.call(Pd,e)?!1:_g.test(e)?Id[e]=!0:(Pd[e]=!0,!1)}function _l(e,t,n){if(Rg(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Rl(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ua(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function la(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kg(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,u=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(p){n=""+p,u.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(p){n=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ti(e){if(!e._valueTracker){var t=Wd(e)?"checked":"value";e._valueTracker=kg(e,t,""+e[t])}}function ef(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function kl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Mg=/[\n"\\]/g;function oa(e){return e.replace(Mg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function _i(e,t,n,r,c,u,p,b){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+la(t)):e.value!==""+la(t)&&(e.value=""+la(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?Ri(e,p,la(t)):n!=null?Ri(e,p,la(n)):r!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+la(b):e.removeAttribute("name")}function tf(e,t,n,r,c,u,p,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ti(e);return}n=n!=null?""+la(n):"",t=t!=null?""+la(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=b?e.checked:!!r,e.defaultChecked=!!r,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),Ti(e)}function Ri(e,t,n){t==="number"&&kl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function jr(e,t,n,r){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&r&&(e[n].defaultSelected=!0)}else{for(n=""+la(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function af(e,t,n){if(t!=null&&(t=""+la(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+la(n):""}function nf(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=la(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Ti(e)}function Sr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ag=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function rf(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Ag.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function sf(e,t,n){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&n[c]!==r&&rf(e,c,r)}else for(var u in t)t.hasOwnProperty(u)&&rf(e,u,t[u])}function ki(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Og=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),zg=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ml(e){return zg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function La(){}var Mi=null;function Ai(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wr=null,Er=null;function lf(e){var t=yr(e);if(t&&(e=t.stateNode)){var n=e[Ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(_i(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+oa(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var c=r[Ht]||null;if(!c)throw Error(i(90));_i(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&ef(r)}break e;case"textarea":af(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&jr(e,!!n.multiple,t,!1)}}}var Oi=!1;function of(e,t,n){if(Oi)return e(t,n);Oi=!0;try{var r=e(t);return r}finally{if(Oi=!1,(wr!==null||Er!==null)&&(yo(),wr&&(t=wr,e=Er,Er=wr=null,lf(t),e)))for(t=0;t<e.length;t++)lf(e[t])}}function js(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ht]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var Ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zi=!1;if(Ba)try{var Ss={};Object.defineProperty(Ss,"passive",{get:function(){zi=!0}}),window.addEventListener("test",Ss,Ss),window.removeEventListener("test",Ss,Ss)}catch{zi=!1}var on=null,Di=null,Al=null;function cf(){if(Al)return Al;var e,t=Di,n=t.length,r,c="value"in on?on.value:on.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var p=n-e;for(r=1;r<=p&&t[n-r]===c[u-r];r++);return Al=c.slice(e,1<r?1-r:void 0)}function Ol(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zl(){return!0}function uf(){return!1}function Gt(e){function t(n,r,c,u,p){this._reactName=n,this._targetInst=c,this.type=r,this.nativeEvent=u,this.target=p,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?zl:uf,this.isPropagationStopped=uf,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=Gt(Vn),ws=x({},Vn,{view:0,detail:0}),Dg=Gt(ws),Ui,Li,Es,Ul=x({},ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Es&&(Es&&e.type==="mousemove"?(Ui=e.screenX-Es.screenX,Li=e.screenY-Es.screenY):Li=Ui=0,Es=e),Ui)},movementY:function(e){return"movementY"in e?e.movementY:Li}}),df=Gt(Ul),Ug=x({},Ul,{dataTransfer:0}),Lg=Gt(Ug),Bg=x({},ws,{relatedTarget:0}),Bi=Gt(Bg),qg=x({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0}),Hg=Gt(qg),Gg=x({},Vn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qg=Gt(Gg),Vg=x({},Vn,{data:0}),ff=Gt(Vg),Fg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xg[e])?!!t[e]:!1}function qi(){return Kg}var $g=x({},ws,{key:function(e){if(e.key){var t=Fg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qi,charCode:function(e){return e.type==="keypress"?Ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zg=Gt($g),Jg=x({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mf=Gt(Jg),Pg=x({},ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qi}),Ig=Gt(Pg),Wg=x({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ey=Gt(Wg),ty=x({},Ul,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ay=Gt(ty),ny=x({},Vn,{newState:0,oldState:0}),ry=Gt(ny),sy=[9,13,27,32],Hi=Ba&&"CompositionEvent"in window,Cs=null;Ba&&"documentMode"in document&&(Cs=document.documentMode);var ly=Ba&&"TextEvent"in window&&!Cs,hf=Ba&&(!Hi||Cs&&8<Cs&&11>=Cs),pf=" ",xf=!1;function vf(e,t){switch(e){case"keyup":return sy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cr=!1;function oy(e,t){switch(e){case"compositionend":return gf(t);case"keypress":return t.which!==32?null:(xf=!0,pf);case"textInput":return e=t.data,e===pf&&xf?null:e;default:return null}}function iy(e,t){if(Cr)return e==="compositionend"||!Hi&&vf(e,t)?(e=cf(),Al=Di=on=null,Cr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return hf&&t.locale!=="ko"?null:t.data;default:return null}}var cy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cy[e.type]:t==="textarea"}function bf(e,t,n,r){wr?Er?Er.push(r):Er=[r]:wr=r,t=Co(t,"onChange"),0<t.length&&(n=new Dl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ts=null,_s=null;function uy(e){ap(e,0)}function Ll(e){var t=Ns(e);if(ef(t))return e}function Nf(e,t){if(e==="change")return t}var jf=!1;if(Ba){var Gi;if(Ba){var Qi="oninput"in document;if(!Qi){var Sf=document.createElement("div");Sf.setAttribute("oninput","return;"),Qi=typeof Sf.oninput=="function"}Gi=Qi}else Gi=!1;jf=Gi&&(!document.documentMode||9<document.documentMode)}function wf(){Ts&&(Ts.detachEvent("onpropertychange",Ef),_s=Ts=null)}function Ef(e){if(e.propertyName==="value"&&Ll(_s)){var t=[];bf(t,_s,e,Ai(e)),of(uy,t)}}function dy(e,t,n){e==="focusin"?(wf(),Ts=t,_s=n,Ts.attachEvent("onpropertychange",Ef)):e==="focusout"&&wf()}function fy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ll(_s)}function my(e,t){if(e==="click")return Ll(t)}function hy(e,t){if(e==="input"||e==="change")return Ll(t)}function py(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:py;function Rs(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var c=n[r];if(!Jt.call(t,c)||!Pt(e[c],t[c]))return!1}return!0}function Cf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tf(e,t){var n=Cf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cf(n)}}function _f(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_f(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=kl(e.document)}return t}function Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var xy=Ba&&"documentMode"in document&&11>=document.documentMode,Tr=null,Fi=null,ks=null,Yi=!1;function kf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yi||Tr==null||Tr!==kl(r)||(r=Tr,"selectionStart"in r&&Vi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ks&&Rs(ks,r)||(ks=r,r=Co(Fi,"onSelect"),0<r.length&&(t=new Dl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Fn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:Fn("Animation","AnimationEnd"),animationiteration:Fn("Animation","AnimationIteration"),animationstart:Fn("Animation","AnimationStart"),transitionrun:Fn("Transition","TransitionRun"),transitionstart:Fn("Transition","TransitionStart"),transitioncancel:Fn("Transition","TransitionCancel"),transitionend:Fn("Transition","TransitionEnd")},Xi={},Mf={};Ba&&(Mf=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);function Yn(e){if(Xi[e])return Xi[e];if(!_r[e])return e;var t=_r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mf)return Xi[e]=t[n];return e}var Af=Yn("animationend"),Of=Yn("animationiteration"),zf=Yn("animationstart"),vy=Yn("transitionrun"),gy=Yn("transitionstart"),yy=Yn("transitioncancel"),Df=Yn("transitionend"),Uf=new Map,Ki="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ki.push("scrollEnd");function ba(e,t){Uf.set(e,t),Qn(t,[e])}var Bl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ia=[],Rr=0,$i=0;function ql(){for(var e=Rr,t=$i=Rr=0;t<e;){var n=ia[t];ia[t++]=null;var r=ia[t];ia[t++]=null;var c=ia[t];ia[t++]=null;var u=ia[t];if(ia[t++]=null,r!==null&&c!==null){var p=r.pending;p===null?c.next=c:(c.next=p.next,p.next=c),r.pending=c}u!==0&&Lf(n,c,u)}}function Hl(e,t,n,r){ia[Rr++]=e,ia[Rr++]=t,ia[Rr++]=n,ia[Rr++]=r,$i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zi(e,t,n,r){return Hl(e,t,n,r),Gl(e)}function Xn(e,t){return Hl(e,null,null,t),Gl(e)}function Lf(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var c=!1,u=e.return;u!==null;)u.childLanes|=n,r=u.alternate,r!==null&&(r.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-Tt(n),e=u.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=n|536870912),u):null}function Gl(e){if(50<Is)throw Is=0,ru=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kr={};function by(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(e,t,n,r){return new by(e,t,n,r)}function Ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qa(e,t){var n=e.alternate;return n===null?(n=It(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&65011712,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.refCleanup=e.refCleanup,n}function Bf(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ql(e,t,n,r,c,u){var p=0;if(r=e,typeof e=="function")Ji(e)&&(p=1);else if(typeof e=="string")p=Eb(e,n,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case oe:return e=It(31,n,t,c),e.elementType=oe,e.lanes=u,e;case E:return Kn(n.children,c,u,t);case _:p=8,c|=24;break;case O:return e=It(12,n,t,c|2),e.elementType=O,e.lanes=u,e;case W:return e=It(13,n,t,c),e.elementType=W,e.lanes=u,e;case te:return e=It(19,n,t,c),e.elementType=te,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:p=10;break e;case k:p=9;break e;case $:p=11;break e;case H:p=14;break e;case z:p=16,r=null;break e}p=29,n=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=It(p,n,t,c),t.elementType=e,t.type=r,t.lanes=u,t}function Kn(e,t,n,r){return e=It(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=It(6,e,null,t),e.lanes=n,e}function qf(e){var t=It(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hf=new WeakMap;function ca(e,t){if(typeof e=="object"&&e!==null){var n=Hf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ps(t)},Hf.set(e,t),t)}return{value:e,source:t,stack:ps(t)}}var Mr=[],Ar=0,Vl=null,Ms=0,ua=[],da=0,cn=null,_a=1,Ra="";function Ha(e,t){Mr[Ar++]=Ms,Mr[Ar++]=Vl,Vl=e,Ms=t}function Gf(e,t,n){ua[da++]=_a,ua[da++]=Ra,ua[da++]=cn,cn=e;var r=_a;e=Ra;var c=32-Tt(r)-1;r&=~(1<<c),n+=1;var u=32-Tt(t)+c;if(30<u){var p=c-c%5;u=(r&(1<<p)-1).toString(32),r>>=p,c-=p,_a=1<<32-Tt(t)+c|n<<c|r,Ra=u+e}else _a=1<<u|n<<c|r,Ra=e}function Wi(e){e.return!==null&&(Ha(e,1),Gf(e,1,0))}function ec(e){for(;e===Vl;)Vl=Mr[--Ar],Mr[Ar]=null,Ms=Mr[--Ar],Mr[Ar]=null;for(;e===cn;)cn=ua[--da],ua[da]=null,Ra=ua[--da],ua[da]=null,_a=ua[--da],ua[da]=null}function Qf(e,t){ua[da++]=_a,ua[da++]=Ra,ua[da++]=cn,_a=t.id,Ra=t.overflow,cn=e}var jt=null,Ke=null,Le=!1,un=null,fa=!1,tc=Error(i(519));function dn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw As(ca(t,e)),tc}function Vf(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Nt]=e,t[Ht]=r,n){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(n=0;n<el.length;n++)ze(el[n],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),tf(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),nf(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||lp(t.textContent,n)?(r.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),r.onScroll!=null&&ze("scroll",t),r.onScrollEnd!=null&&ze("scrollend",t),r.onClick!=null&&(t.onclick=La),t=!0):t=!1,t||dn(e,!0)}function Ff(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:fa=!1;return;case 27:case 3:fa=!0;return;default:jt=jt.return}}function Or(e){if(e!==jt)return!1;if(!Le)return Ff(e),Le=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||yu(e.type,e.memoizedProps)),n=!n),n&&Ke&&dn(e),Ff(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=pp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=pp(e)}else t===27?(t=Ke,En(e.type)?(e=wu,wu=null,Ke=e):Ke=t):Ke=jt?ha(e.stateNode.nextSibling):null;return!0}function $n(){Ke=jt=null,Le=!1}function ac(){var e=un;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),un=null),e}function As(e){un===null?un=[e]:un.push(e)}var nc=S(null),Zn=null,Ga=null;function fn(e,t,n){V(nc,t._currentValue),t._currentValue=n}function Qa(e){e._currentValue=nc.current,U(nc)}function rc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function sc(e,t,n,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var p=c.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=c;for(var T=0;T<t.length;T++)if(b.context===t[T]){u.lanes|=n,b=u.alternate,b!==null&&(b.lanes|=n),rc(u.return,n,e),r||(p=null);break e}u=b.next}}else if(c.tag===18){if(p=c.return,p===null)throw Error(i(341));p.lanes|=n,u=p.alternate,u!==null&&(u.lanes|=n),rc(p,n,e),p=null}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===e){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}}function zr(e,t,n,r){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var p=c.alternate;if(p===null)throw Error(i(387));if(p=p.memoizedProps,p!==null){var b=c.type;Pt(c.pendingProps.value,p.value)||(e!==null?e.push(b):e=[b])}}else if(c===ue.current){if(p=c.alternate,p===null)throw Error(i(387));p.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(sl):e=[sl])}c=c.return}e!==null&&sc(t,e,n,r),t.flags|=262144}function Fl(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Jn(e){Zn=e,Ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return Yf(Zn,e)}function Yl(e,t){return Zn===null&&Jn(e),Yf(e,t)}function Yf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ga===null){if(e===null)throw Error(i(308));Ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ga=Ga.next=t;return n}var Ny=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},jy=a.unstable_scheduleCallback,Sy=a.unstable_NormalPriority,rt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lc(){return{controller:new Ny,data:new Map,refCount:0}}function Os(e){e.refCount--,e.refCount===0&&jy(Sy,function(){e.controller.abort()})}var zs=null,oc=0,Dr=0,Ur=null;function wy(e,t){if(zs===null){var n=zs=[];oc=0,Dr=uu(),Ur={status:"pending",value:void 0,then:function(r){n.push(r)}}}return oc++,t.then(Xf,Xf),t}function Xf(){if(--oc===0&&zs!==null){Ur!==null&&(Ur.status="fulfilled");var e=zs;zs=null,Dr=0,Ur=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ey(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),r}var Kf=C.S;C.S=function(e,t){kh=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wy(e,t),Kf!==null&&Kf(e,t)};var Pn=S(null);function ic(){var e=Pn.current;return e!==null?e:Xe.pooledCache}function Xl(e,t){t===null?V(Pn,Pn.current):V(Pn,t.pool)}function $f(){var e=ic();return e===null?null:{parent:rt._currentValue,pool:e}}var Lr=Error(i(460)),cc=Error(i(474)),Kl=Error(i(542)),$l={then:function(){}};function Zf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Jf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(La,La),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,If(e),e;default:if(typeof t.status=="string")t.then(La,La);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,If(e),e}throw Wn=t,Lr}}function In(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Wn=n,Lr):n}}var Wn=null;function Pf(){if(Wn===null)throw Error(i(459));var e=Wn;return Wn=null,e}function If(e){if(e===Lr||e===Kl)throw Error(i(483))}var Br=null,Ds=0;function Zl(e){var t=Ds;return Ds+=1,Br===null&&(Br=[]),Jf(Br,e,t)}function Us(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Jl(e,t){throw t.$$typeof===j?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Wf(e){function t(A,R){if(e){var B=A.deletions;B===null?(A.deletions=[R],A.flags|=16):B.push(R)}}function n(A,R){if(!e)return null;for(;R!==null;)t(A,R),R=R.sibling;return null}function r(A){for(var R=new Map;A!==null;)A.key!==null?R.set(A.key,A):R.set(A.index,A),A=A.sibling;return R}function c(A,R){return A=qa(A,R),A.index=0,A.sibling=null,A}function u(A,R,B){return A.index=B,e?(B=A.alternate,B!==null?(B=B.index,B<R?(A.flags|=67108866,R):B):(A.flags|=67108866,R)):(A.flags|=1048576,R)}function p(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function b(A,R,B,P){return R===null||R.tag!==6?(R=Pi(B,A.mode,P),R.return=A,R):(R=c(R,B),R.return=A,R)}function T(A,R,B,P){var ge=B.type;return ge===E?Z(A,R,B.props.children,P,B.key):R!==null&&(R.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===z&&In(ge)===R.type)?(R=c(R,B.props),Us(R,B),R.return=A,R):(R=Ql(B.type,B.key,B.props,null,A.mode,P),Us(R,B),R.return=A,R)}function q(A,R,B,P){return R===null||R.tag!==4||R.stateNode.containerInfo!==B.containerInfo||R.stateNode.implementation!==B.implementation?(R=Ii(B,A.mode,P),R.return=A,R):(R=c(R,B.children||[]),R.return=A,R)}function Z(A,R,B,P,ge){return R===null||R.tag!==7?(R=Kn(B,A.mode,P,ge),R.return=A,R):(R=c(R,B),R.return=A,R)}function I(A,R,B){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Pi(""+R,A.mode,B),R.return=A,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case M:return B=Ql(R.type,R.key,R.props,null,A.mode,B),Us(B,R),B.return=A,B;case w:return R=Ii(R,A.mode,B),R.return=A,R;case z:return R=In(R),I(A,R,B)}if(ne(R)||ie(R))return R=Kn(R,A.mode,B,null),R.return=A,R;if(typeof R.then=="function")return I(A,Zl(R),B);if(R.$$typeof===G)return I(A,Yl(A,R),B);Jl(A,R)}return null}function Q(A,R,B,P){var ge=R!==null?R.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return ge!==null?null:b(A,R,""+B,P);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case M:return B.key===ge?T(A,R,B,P):null;case w:return B.key===ge?q(A,R,B,P):null;case z:return B=In(B),Q(A,R,B,P)}if(ne(B)||ie(B))return ge!==null?null:Z(A,R,B,P,null);if(typeof B.then=="function")return Q(A,R,Zl(B),P);if(B.$$typeof===G)return Q(A,R,Yl(A,B),P);Jl(A,B)}return null}function F(A,R,B,P,ge){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return A=A.get(B)||null,b(R,A,""+P,ge);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case M:return A=A.get(P.key===null?B:P.key)||null,T(R,A,P,ge);case w:return A=A.get(P.key===null?B:P.key)||null,q(R,A,P,ge);case z:return P=In(P),F(A,R,B,P,ge)}if(ne(P)||ie(P))return A=A.get(B)||null,Z(R,A,P,ge,null);if(typeof P.then=="function")return F(A,R,B,Zl(P),ge);if(P.$$typeof===G)return F(A,R,B,Yl(R,P),ge);Jl(R,P)}return null}function ce(A,R,B,P){for(var ge=null,Be=null,he=R,ke=R=0,Ue=null;he!==null&&ke<B.length;ke++){he.index>ke?(Ue=he,he=null):Ue=he.sibling;var qe=Q(A,he,B[ke],P);if(qe===null){he===null&&(he=Ue);break}e&&he&&qe.alternate===null&&t(A,he),R=u(qe,R,ke),Be===null?ge=qe:Be.sibling=qe,Be=qe,he=Ue}if(ke===B.length)return n(A,he),Le&&Ha(A,ke),ge;if(he===null){for(;ke<B.length;ke++)he=I(A,B[ke],P),he!==null&&(R=u(he,R,ke),Be===null?ge=he:Be.sibling=he,Be=he);return Le&&Ha(A,ke),ge}for(he=r(he);ke<B.length;ke++)Ue=F(he,A,ke,B[ke],P),Ue!==null&&(e&&Ue.alternate!==null&&he.delete(Ue.key===null?ke:Ue.key),R=u(Ue,R,ke),Be===null?ge=Ue:Be.sibling=Ue,Be=Ue);return e&&he.forEach(function(kn){return t(A,kn)}),Le&&Ha(A,ke),ge}function Ne(A,R,B,P){if(B==null)throw Error(i(151));for(var ge=null,Be=null,he=R,ke=R=0,Ue=null,qe=B.next();he!==null&&!qe.done;ke++,qe=B.next()){he.index>ke?(Ue=he,he=null):Ue=he.sibling;var kn=Q(A,he,qe.value,P);if(kn===null){he===null&&(he=Ue);break}e&&he&&kn.alternate===null&&t(A,he),R=u(kn,R,ke),Be===null?ge=kn:Be.sibling=kn,Be=kn,he=Ue}if(qe.done)return n(A,he),Le&&Ha(A,ke),ge;if(he===null){for(;!qe.done;ke++,qe=B.next())qe=I(A,qe.value,P),qe!==null&&(R=u(qe,R,ke),Be===null?ge=qe:Be.sibling=qe,Be=qe);return Le&&Ha(A,ke),ge}for(he=r(he);!qe.done;ke++,qe=B.next())qe=F(he,A,ke,qe.value,P),qe!==null&&(e&&qe.alternate!==null&&he.delete(qe.key===null?ke:qe.key),R=u(qe,R,ke),Be===null?ge=qe:Be.sibling=qe,Be=qe);return e&&he.forEach(function(Ub){return t(A,Ub)}),Le&&Ha(A,ke),ge}function Ye(A,R,B,P){if(typeof B=="object"&&B!==null&&B.type===E&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case M:e:{for(var ge=B.key;R!==null;){if(R.key===ge){if(ge=B.type,ge===E){if(R.tag===7){n(A,R.sibling),P=c(R,B.props.children),P.return=A,A=P;break e}}else if(R.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===z&&In(ge)===R.type){n(A,R.sibling),P=c(R,B.props),Us(P,B),P.return=A,A=P;break e}n(A,R);break}else t(A,R);R=R.sibling}B.type===E?(P=Kn(B.props.children,A.mode,P,B.key),P.return=A,A=P):(P=Ql(B.type,B.key,B.props,null,A.mode,P),Us(P,B),P.return=A,A=P)}return p(A);case w:e:{for(ge=B.key;R!==null;){if(R.key===ge)if(R.tag===4&&R.stateNode.containerInfo===B.containerInfo&&R.stateNode.implementation===B.implementation){n(A,R.sibling),P=c(R,B.children||[]),P.return=A,A=P;break e}else{n(A,R);break}else t(A,R);R=R.sibling}P=Ii(B,A.mode,P),P.return=A,A=P}return p(A);case z:return B=In(B),Ye(A,R,B,P)}if(ne(B))return ce(A,R,B,P);if(ie(B)){if(ge=ie(B),typeof ge!="function")throw Error(i(150));return B=ge.call(B),Ne(A,R,B,P)}if(typeof B.then=="function")return Ye(A,R,Zl(B),P);if(B.$$typeof===G)return Ye(A,R,Yl(A,B),P);Jl(A,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,R!==null&&R.tag===6?(n(A,R.sibling),P=c(R,B),P.return=A,A=P):(n(A,R),P=Pi(B,A.mode,P),P.return=A,A=P),p(A)):n(A,R)}return function(A,R,B,P){try{Ds=0;var ge=Ye(A,R,B,P);return Br=null,ge}catch(he){if(he===Lr||he===Kl)throw he;var Be=It(29,he,null,A.mode);return Be.lanes=P,Be.return=A,Be}}}var er=Wf(!0),em=Wf(!1),mn=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function hn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(He&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=Gl(e),Lf(e,null,n),t}return Hl(e,r,t,n),Gl(e)}function Ls(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}function fc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var c=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var p={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=p:u=u.next=p,n=n.next}while(n!==null);u===null?c=u=t:u=u.next=t}else c=u=t;n={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var mc=!1;function Bs(){if(mc){var e=Ur;if(e!==null)throw e}}function qs(e,t,n,r){mc=!1;var c=e.updateQueue;mn=!1;var u=c.firstBaseUpdate,p=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var T=b,q=T.next;T.next=null,p===null?u=q:p.next=q,p=T;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,b=Z.lastBaseUpdate,b!==p&&(b===null?Z.firstBaseUpdate=q:b.next=q,Z.lastBaseUpdate=T))}if(u!==null){var I=c.baseState;p=0,Z=q=T=null,b=u;do{var Q=b.lane&-536870913,F=Q!==b.lane;if(F?(De&Q)===Q:(r&Q)===Q){Q!==0&&Q===Dr&&(mc=!0),Z!==null&&(Z=Z.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ce=e,Ne=b;Q=t;var Ye=n;switch(Ne.tag){case 1:if(ce=Ne.payload,typeof ce=="function"){I=ce.call(Ye,I,Q);break e}I=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=Ne.payload,Q=typeof ce=="function"?ce.call(Ye,I,Q):ce,Q==null)break e;I=x({},I,Q);break e;case 2:mn=!0}}Q=b.callback,Q!==null&&(e.flags|=64,F&&(e.flags|=8192),F=c.callbacks,F===null?c.callbacks=[Q]:F.push(Q))}else F={lane:Q,tag:b.tag,payload:b.payload,callback:b.callback,next:null},Z===null?(q=Z=F,T=I):Z=Z.next=F,p|=Q;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;F=b,b=F.next,F.next=null,c.lastBaseUpdate=F,c.shared.pending=null}}while(!0);Z===null&&(T=I),c.baseState=T,c.firstBaseUpdate=q,c.lastBaseUpdate=Z,u===null&&(c.shared.lanes=0),bn|=p,e.lanes=p,e.memoizedState=I}}function tm(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function am(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)tm(n[e],t)}var qr=S(null),Pl=S(0);function nm(e,t){e=Pa,V(Pl,e),V(qr,t),Pa=e|t.baseLanes}function hc(){V(Pl,Pa),V(qr,qr.current)}function pc(){Pa=Pl.current,U(qr),U(Pl)}var Wt=S(null),ma=null;function xn(e){var t=e.alternate;V(tt,tt.current&1),V(Wt,e),ma===null&&(t===null||qr.current!==null||t.memoizedState!==null)&&(ma=e)}function xc(e){V(tt,tt.current),V(Wt,e),ma===null&&(ma=e)}function rm(e){e.tag===22?(V(tt,tt.current),V(Wt,e),ma===null&&(ma=e)):vn()}function vn(){V(tt,tt.current),V(Wt,Wt.current)}function ea(e){U(Wt),ma===e&&(ma=null),U(tt)}var tt=S(0);function Il(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ju(n)||Su(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Va=0,_e=null,Ve=null,st=null,Wl=!1,Hr=!1,tr=!1,eo=0,Hs=0,Gr=null,Cy=0;function We(){throw Error(i(321))}function vc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function gc(e,t,n,r,c,u){return Va=u,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?Gm:Oc,tr=!1,u=n(r,c),tr=!1,Hr&&(u=lm(t,n,r,c)),sm(e),u}function sm(e){C.H=Vs;var t=Ve!==null&&Ve.next!==null;if(Va=0,st=Ve=_e=null,Wl=!1,Hs=0,Gr=null,t)throw Error(i(300));e===null||lt||(e=e.dependencies,e!==null&&Fl(e)&&(lt=!0))}function lm(e,t,n,r){_e=e;var c=0;do{if(Hr&&(Gr=null),Hs=0,Hr=!1,25<=c)throw Error(i(301));if(c+=1,st=Ve=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}C.H=Qm,u=t(n,r)}while(Hr);return u}function Ty(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Gs(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(_e.flags|=1024),t}function yc(){var e=eo!==0;return eo=0,e}function bc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Nc(e){if(Wl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wl=!1}Va=0,st=Ve=_e=null,Hr=!1,Hs=eo=0,Gr=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?_e.memoizedState=st=e:st=st.next=e,st}function at(){if(Ve===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=st===null?_e.memoizedState:st.next;if(t!==null)st=t,Ve=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},st===null?_e.memoizedState=st=e:st=st.next=e}return st}function to(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gs(e){var t=Hs;return Hs+=1,Gr===null&&(Gr=[]),e=Jf(Gr,e,t),t=_e,(st===null?t.memoizedState:st.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?Gm:Oc),e}function ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gs(e);if(e.$$typeof===G)return St(e)}throw Error(i(438,String(e)))}function jc(e){var t=null,n=_e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=_e.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=to(),_e.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=be;return t.index++,n}function Fa(e,t){return typeof t=="function"?t(e):t}function no(e){var t=at();return Sc(t,Ve,e)}function Sc(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var c=e.baseQueue,u=r.pending;if(u!==null){if(c!==null){var p=c.next;c.next=u.next,u.next=p}t.baseQueue=c=u,r.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var b=p=null,T=null,q=t,Z=!1;do{var I=q.lane&-536870913;if(I!==q.lane?(De&I)===I:(Va&I)===I){var Q=q.revertLane;if(Q===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),I===Dr&&(Z=!0);else if((Va&Q)===Q){q=q.next,Q===Dr&&(Z=!0);continue}else I={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},T===null?(b=T=I,p=u):T=T.next=I,_e.lanes|=Q,bn|=Q;I=q.action,tr&&n(u,I),u=q.hasEagerState?q.eagerState:n(u,I)}else Q={lane:I,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},T===null?(b=T=Q,p=u):T=T.next=Q,_e.lanes|=I,bn|=I;q=q.next}while(q!==null&&q!==t);if(T===null?p=u:T.next=b,!Pt(u,e.memoizedState)&&(lt=!0,Z&&(n=Ur,n!==null)))throw n;e.memoizedState=u,e.baseState=p,e.baseQueue=T,r.lastRenderedState=u}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function wc(e){var t=at(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,c=n.pending,u=t.memoizedState;if(c!==null){n.pending=null;var p=c=c.next;do u=e(u,p.action),p=p.next;while(p!==c);Pt(u,t.memoizedState)||(lt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,r]}function om(e,t,n){var r=_e,c=at(),u=Le;if(u){if(n===void 0)throw Error(i(407));n=n()}else n=t();var p=!Pt((Ve||c).memoizedState,n);if(p&&(c.memoizedState=n,lt=!0),c=c.queue,Tc(um.bind(null,r,c,e),[e]),c.getSnapshot!==t||p||st!==null&&st.memoizedState.tag&1){if(r.flags|=2048,Qr(9,{destroy:void 0},cm.bind(null,r,c,n,t),null),Xe===null)throw Error(i(349));u||(Va&127)!==0||im(r,t,n)}return n}function im(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_e.updateQueue,t===null?(t=to(),_e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cm(e,t,n,r){t.value=n,t.getSnapshot=r,dm(t)&&fm(e)}function um(e,t,n){return n(function(){dm(t)&&fm(e)})}function dm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function fm(e){var t=Xn(e,2);t!==null&&Xt(t,e,2)}function Ec(e){var t=zt();if(typeof e=="function"){var n=e;if(e=n(),tr){ga(!0);try{n()}finally{ga(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:e},t}function mm(e,t,n,r){return e.baseState=n,Sc(e,Ve,typeof r=="function"?r:Fa)}function _y(e,t,n,r,c){if(lo(e))throw Error(i(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){u.listeners.push(p)}};C.T!==null?n(!0):u.isTransition=!1,r(u),n=t.pending,n===null?(u.next=t.pending=u,hm(t,u)):(u.next=n.next,t.pending=n.next=u)}}function hm(e,t){var n=t.action,r=t.payload,c=e.state;if(t.isTransition){var u=C.T,p={};C.T=p;try{var b=n(c,r),T=C.S;T!==null&&T(p,b),pm(e,t,b)}catch(q){Cc(e,t,q)}finally{u!==null&&p.types!==null&&(u.types=p.types),C.T=u}}else try{u=n(c,r),pm(e,t,u)}catch(q){Cc(e,t,q)}}function pm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){xm(e,t,r)},function(r){return Cc(e,t,r)}):xm(e,t,n)}function xm(e,t,n){t.status="fulfilled",t.value=n,vm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,hm(e,n)))}function Cc(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,vm(t),t=t.next;while(t!==r)}e.action=null}function vm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function gm(e,t){return t}function ym(e,t){if(Le){var n=Xe.formState;if(n!==null){e:{var r=_e;if(Le){if(Ke){t:{for(var c=Ke,u=fa;c.nodeType!==8;){if(!u){c=null;break t}if(c=ha(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ke=ha(c.nextSibling),r=c.data==="F!";break e}}dn(r)}r=!1}r&&(t=n[0])}}return n=zt(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gm,lastRenderedState:t},n.queue=r,n=Bm.bind(null,_e,r),r.dispatch=n,r=Ec(!1),u=Ac.bind(null,_e,!1,r.queue),r=zt(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,n=_y.bind(null,_e,c,u,n),c.dispatch=n,r.memoizedState=e,[t,n,!1]}function bm(e){var t=at();return Nm(t,Ve,e)}function Nm(e,t,n){if(t=Sc(e,t,gm)[0],e=no(Fa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Gs(t)}catch(p){throw p===Lr?Kl:p}else r=t;t=at();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(_e.flags|=2048,Qr(9,{destroy:void 0},Ry.bind(null,c,n),null)),[r,u,e]}function Ry(e,t){e.action=t}function jm(e){var t=at(),n=Ve;if(n!==null)return Nm(t,n,e);at(),t=t.memoizedState,n=at();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qr(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=_e.updateQueue,t===null&&(t=to(),_e.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Sm(){return at().memoizedState}function ro(e,t,n,r){var c=zt();_e.flags|=e,c.memoizedState=Qr(1|t,{destroy:void 0},n,r===void 0?null:r)}function so(e,t,n,r){var c=at();r=r===void 0?null:r;var u=c.memoizedState.inst;Ve!==null&&r!==null&&vc(r,Ve.memoizedState.deps)?c.memoizedState=Qr(t,u,n,r):(_e.flags|=e,c.memoizedState=Qr(1|t,u,n,r))}function wm(e,t){ro(8390656,8,e,t)}function Tc(e,t){so(2048,8,e,t)}function ky(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=to(),_e.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Em(e){var t=at().memoizedState;return ky({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Cm(e,t){return so(4,2,e,t)}function Tm(e,t){return so(4,4,e,t)}function _m(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rm(e,t,n){n=n!=null?n.concat([e]):null,so(4,4,_m.bind(null,t,e),n)}function _c(){}function km(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Mm(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vc(t,r[1]))return r[0];if(r=e(),tr){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r}function Rc(e,t,n){return n===void 0||(Va&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Ah(),_e.lanes|=e,bn|=e,n)}function Am(e,t,n,r){return Pt(n,t)?n:qr.current!==null?(e=Rc(e,n,r),Pt(e,t)||(lt=!0),e):(Va&42)===0||(Va&1073741824)!==0&&(De&261930)===0?(lt=!0,e.memoizedState=n):(e=Ah(),_e.lanes|=e,bn|=e,t)}function Om(e,t,n,r,c){var u=X.p;X.p=u!==0&&8>u?u:8;var p=C.T,b={};C.T=b,Ac(e,!1,t,n);try{var T=c(),q=C.S;if(q!==null&&q(b,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var Z=Ey(T,r);Qs(e,t,Z,na(e))}else Qs(e,t,r,na(e))}catch(I){Qs(e,t,{then:function(){},status:"rejected",reason:I},na())}finally{X.p=u,p!==null&&b.types!==null&&(p.types=b.types),C.T=p}}function My(){}function kc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var c=zm(e).queue;Om(e,c,t,K,n===null?My:function(){return Dm(e),n(r)})}function zm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:K},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dm(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),Qs(e,t.next.queue,{},na())}function Mc(){return St(sl)}function Um(){return at().memoizedState}function Lm(){return at().memoizedState}function Ay(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=na();e=hn(n);var r=pn(t,e,n);r!==null&&(Xt(r,t,n),Ls(r,t,n)),t={cache:lc()},e.payload=t;return}t=t.return}}function Oy(e,t,n){var r=na();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lo(e)?qm(t,n):(n=Zi(e,t,n,r),n!==null&&(Xt(n,e,r),Hm(n,t,r)))}function Bm(e,t,n){var r=na();Qs(e,t,n,r)}function Qs(e,t,n,r){var c={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lo(e))qm(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var p=t.lastRenderedState,b=u(p,n);if(c.hasEagerState=!0,c.eagerState=b,Pt(b,p))return Hl(e,t,c,0),Xe===null&&ql(),!1}catch{}if(n=Zi(e,t,c,r),n!==null)return Xt(n,e,r),Hm(n,t,r),!0}return!1}function Ac(e,t,n,r){if(r={lane:2,revertLane:uu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lo(e)){if(t)throw Error(i(479))}else t=Zi(e,n,r,2),t!==null&&Xt(t,e,2)}function lo(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function qm(e,t){Hr=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hm(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}var Vs={readContext:St,use:ao,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};Vs.useEffectEvent=We;var Gm={readContext:St,use:ao,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:wm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ro(4194308,4,_m.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){ro(4,2,e,t)},useMemo:function(e,t){var n=zt();t=t===void 0?null:t;var r=e();if(tr){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zt();if(n!==void 0){var c=n(t);if(tr){ga(!0);try{n(t)}finally{ga(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=Oy.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ec(e);var t=e.queue,n=Bm.bind(null,_e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_c,useDeferredValue:function(e,t){var n=zt();return Rc(n,e,t)},useTransition:function(){var e=Ec(!1);return e=Om.bind(null,_e,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=_e,c=zt();if(Le){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xe===null)throw Error(i(349));(De&127)!==0||im(r,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,wm(um.bind(null,r,u,e),[e]),r.flags|=2048,Qr(9,{destroy:void 0},cm.bind(null,r,u,n,t),null),n},useId:function(){var e=zt(),t=Xe.identifierPrefix;if(Le){var n=Ra,r=_a;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=eo++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Cy++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mc,useFormState:ym,useActionState:ym,useOptimistic:function(e){var t=zt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ac.bind(null,_e,!0,n),n.dispatch=t,[e,t]},useMemoCache:jc,useCacheRefresh:function(){return zt().memoizedState=Ay.bind(null,_e)},useEffectEvent:function(e){var t=zt(),n={impl:e};return t.memoizedState=n,function(){if((He&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Oc={readContext:St,use:ao,useCallback:km,useContext:St,useEffect:Tc,useImperativeHandle:Rm,useInsertionEffect:Cm,useLayoutEffect:Tm,useMemo:Mm,useReducer:no,useRef:Sm,useState:function(){return no(Fa)},useDebugValue:_c,useDeferredValue:function(e,t){var n=at();return Am(n,Ve.memoizedState,e,t)},useTransition:function(){var e=no(Fa)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:om,useId:Um,useHostTransitionStatus:Mc,useFormState:bm,useActionState:bm,useOptimistic:function(e,t){var n=at();return mm(n,Ve,e,t)},useMemoCache:jc,useCacheRefresh:Lm};Oc.useEffectEvent=Em;var Qm={readContext:St,use:ao,useCallback:km,useContext:St,useEffect:Tc,useImperativeHandle:Rm,useInsertionEffect:Cm,useLayoutEffect:Tm,useMemo:Mm,useReducer:wc,useRef:Sm,useState:function(){return wc(Fa)},useDebugValue:_c,useDeferredValue:function(e,t){var n=at();return Ve===null?Rc(n,e,t):Am(n,Ve.memoizedState,e,t)},useTransition:function(){var e=wc(Fa)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:om,useId:Um,useHostTransitionStatus:Mc,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var n=at();return Ve!==null?mm(n,Ve,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:jc,useCacheRefresh:Lm};Qm.useEffectEvent=Em;function zc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:x({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Dc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=na(),c=hn(r);c.payload=t,n!=null&&(c.callback=n),t=pn(e,c,r),t!==null&&(Xt(t,e,r),Ls(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=na(),c=hn(r);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=pn(e,c,r),t!==null&&(Xt(t,e,r),Ls(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=na(),r=hn(n);r.tag=2,t!=null&&(r.callback=t),t=pn(e,r,n),t!==null&&(Xt(t,e,n),Ls(t,e,n))}};function Vm(e,t,n,r,c,u,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,p):t.prototype&&t.prototype.isPureReactComponent?!Rs(n,r)||!Rs(c,u):!0}function Fm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Dc.enqueueReplaceState(t,t.state,null)}function ar(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=x({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Ym(e){Bl(e)}function Xm(e){console.error(e)}function Km(e){Bl(e)}function oo(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function $m(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Uc(e,t,n){return n=hn(n),n.tag=3,n.payload={element:null},n.callback=function(){oo(e,t)},n}function Zm(e){return e=hn(e),e.tag=3,e}function Jm(e,t,n,r){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var u=r.value;e.payload=function(){return c(u)},e.callback=function(){$m(t,n,r)}}var p=n.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){$m(t,n,r),typeof c!="function"&&(Nn===null?Nn=new Set([this]):Nn.add(this));var b=r.stack;this.componentDidCatch(r.value,{componentStack:b!==null?b:""})})}function zy(e,t,n,r,c){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&zr(t,n,c,!0),n=Wt.current,n!==null){switch(n.tag){case 31:case 13:return ma===null?bo():n.alternate===null&&et===0&&(et=3),n.flags&=-257,n.flags|=65536,n.lanes=c,r===$l?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ou(e,r,c)),!1;case 22:return n.flags|=65536,r===$l?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ou(e,r,c)),!1}throw Error(i(435,n.tag))}return ou(e,r,c),bo(),!1}if(Le)return t=Wt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==tc&&(e=Error(i(422),{cause:r}),As(ca(e,n)))):(r!==tc&&(t=Error(i(423),{cause:r}),As(ca(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=ca(r,n),c=Uc(e.stateNode,r,c),fc(e,c),et!==4&&(et=2)),!1;var u=Error(i(520),{cause:r});if(u=ca(u,n),Ps===null?Ps=[u]:Ps.push(u),et!==4&&(et=2),t===null)return!0;r=ca(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=Uc(n.stateNode,r,e),fc(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Nn===null||!Nn.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Zm(c),Jm(c,e,n,r),fc(n,c),!1}n=n.return}while(n!==null);return!1}var Lc=Error(i(461)),lt=!1;function wt(e,t,n,r){t.child=e===null?em(t,null,n,r):er(t,e.child,n,r)}function Pm(e,t,n,r,c){n=n.render;var u=t.ref;if("ref"in r){var p={};for(var b in r)b!=="ref"&&(p[b]=r[b])}else p=r;return Jn(t),r=gc(e,t,n,p,u,c),b=yc(),e!==null&&!lt?(bc(e,t,c),Ya(e,t,c)):(Le&&b&&Wi(t),t.flags|=1,wt(e,t,r,c),t.child)}function Im(e,t,n,r,c){if(e===null){var u=n.type;return typeof u=="function"&&!Ji(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Wm(e,t,u,r,c)):(e=Ql(n.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Yc(e,c)){var p=u.memoizedProps;if(n=n.compare,n=n!==null?n:Rs,n(p,r)&&e.ref===t.ref)return Ya(e,t,c)}return t.flags|=1,e=qa(u,r),e.ref=t.ref,e.return=t,t.child=e}function Wm(e,t,n,r,c){if(e!==null){var u=e.memoizedProps;if(Rs(u,r)&&e.ref===t.ref)if(lt=!1,t.pendingProps=r=u,Yc(e,c))(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,Ya(e,t,c)}return Bc(e,t,n,r,c)}function eh(e,t,n,r){var c=r.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~u}else r=0,t.child=null;return th(e,t,u,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xl(t,u!==null?u.cachePool:null),u!==null?nm(t,u):hc(),rm(t);else return r=t.lanes=536870912,th(e,t,u!==null?u.baseLanes|n:n,n,r)}else u!==null?(Xl(t,u.cachePool),nm(t,u),vn(),t.memoizedState=null):(e!==null&&Xl(t,null),hc(),vn());return wt(e,t,c,n),t.child}function Fs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function th(e,t,n,r,c){var u=ic();return u=u===null?null:{parent:rt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Xl(t,null),hc(),rm(t),e!==null&&zr(e,t,r,!0),t.childLanes=c,null}function io(e,t){return t=uo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ah(e,t,n){return er(t,e.child,null,n),e=io(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function Dy(e,t,n){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(r.mode==="hidden")return e=io(t,r),t.lanes=536870912,Fs(null,e);if(xc(t),(e=Ke)?(e=hp(e,fa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cn!==null?{id:_a,overflow:Ra}:null,retryLane:536870912,hydrationErrors:null},n=qf(e),n.return=t,t.child=n,jt=t,Ke=null)):e=null,e===null)throw dn(t);return t.lanes=536870912,null}return io(t,r)}var u=e.memoizedState;if(u!==null){var p=u.dehydrated;if(xc(t),c)if(t.flags&256)t.flags&=-257,t=ah(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(lt||zr(e,t,n,!1),c=(n&e.childLanes)!==0,lt||c){if(r=Xe,r!==null&&(p=qt(r,n),p!==0&&p!==u.retryLane))throw u.retryLane=p,Xn(e,p),Xt(r,e,p),Lc;bo(),t=ah(e,t,n)}else e=u.treeContext,Ke=ha(p.nextSibling),jt=t,Le=!0,un=null,fa=!1,e!==null&&Qf(t,e),t=io(t,r),t.flags|=4096;return t}return e=qa(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function co(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,r,c){return Jn(t),n=gc(e,t,n,r,void 0,c),r=yc(),e!==null&&!lt?(bc(e,t,c),Ya(e,t,c)):(Le&&r&&Wi(t),t.flags|=1,wt(e,t,n,c),t.child)}function nh(e,t,n,r,c,u){return Jn(t),t.updateQueue=null,n=lm(t,r,n,c),sm(e),r=yc(),e!==null&&!lt?(bc(e,t,u),Ya(e,t,u)):(Le&&r&&Wi(t),t.flags|=1,wt(e,t,n,u),t.child)}function rh(e,t,n,r,c){if(Jn(t),t.stateNode===null){var u=kr,p=n.contextType;typeof p=="object"&&p!==null&&(u=St(p)),u=new n(r,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Dc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=r,u.state=t.memoizedState,u.refs={},uc(t),p=n.contextType,u.context=typeof p=="object"&&p!==null?St(p):kr,u.state=t.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(zc(t,n,p,r),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(p=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),p!==u.state&&Dc.enqueueReplaceState(u,u.state,null),qs(t,r,u,c),Bs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,T=ar(n,b);u.props=T;var q=u.context,Z=n.contextType;p=kr,typeof Z=="object"&&Z!==null&&(p=St(Z));var I=n.getDerivedStateFromProps;Z=typeof I=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,Z||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||q!==p)&&Fm(t,u,r,p),mn=!1;var Q=t.memoizedState;u.state=Q,qs(t,r,u,c),Bs(),q=t.memoizedState,b||Q!==q||mn?(typeof I=="function"&&(zc(t,n,I,r),q=t.memoizedState),(T=mn||Vm(t,n,T,r,Q,q,p))?(Z||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=q),u.props=r,u.state=q,u.context=p,r=T):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,dc(e,t),p=t.memoizedProps,Z=ar(n,p),u.props=Z,I=t.pendingProps,Q=u.context,q=n.contextType,T=kr,typeof q=="object"&&q!==null&&(T=St(q)),b=n.getDerivedStateFromProps,(q=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==I||Q!==T)&&Fm(t,u,r,T),mn=!1,Q=t.memoizedState,u.state=Q,qs(t,r,u,c),Bs();var F=t.memoizedState;p!==I||Q!==F||mn||e!==null&&e.dependencies!==null&&Fl(e.dependencies)?(typeof b=="function"&&(zc(t,n,b,r),F=t.memoizedState),(Z=mn||Vm(t,n,Z,r,Q,F,T)||e!==null&&e.dependencies!==null&&Fl(e.dependencies))?(q||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,F,T),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,F,T)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=F),u.props=r,u.state=F,u.context=T,r=Z):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),r=!1)}return u=r,co(e,t),r=(t.flags&128)!==0,u||r?(u=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&r?(t.child=er(t,e.child,null,c),t.child=er(t,null,n,c)):wt(e,t,n,c),t.memoizedState=u.state,e=t.child):e=Ya(e,t,c),e}function sh(e,t,n,r){return $n(),t.flags|=256,wt(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hc(e){return{baseLanes:e,cachePool:$f()}}function Gc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=aa),e}function lh(e,t,n){var r=t.pendingProps,c=!1,u=(t.flags&128)!==0,p;if((p=u)||(p=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),p&&(c=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?xn(t):vn(),(e=Ke)?(e=hp(e,fa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cn!==null?{id:_a,overflow:Ra}:null,retryLane:536870912,hydrationErrors:null},n=qf(e),n.return=t,t.child=n,jt=t,Ke=null)):e=null,e===null)throw dn(t);return Su(e)?t.lanes=32:t.lanes=536870912,null}var b=r.children;return r=r.fallback,c?(vn(),c=t.mode,b=uo({mode:"hidden",children:b},c),r=Kn(r,c,n,null),b.return=t,r.return=t,b.sibling=r,t.child=b,r=t.child,r.memoizedState=Hc(n),r.childLanes=Gc(e,p,n),t.memoizedState=qc,Fs(null,r)):(xn(t),Qc(t,b))}var T=e.memoizedState;if(T!==null&&(b=T.dehydrated,b!==null)){if(u)t.flags&256?(xn(t),t.flags&=-257,t=Vc(e,t,n)):t.memoizedState!==null?(vn(),t.child=e.child,t.flags|=128,t=null):(vn(),b=r.fallback,c=t.mode,r=uo({mode:"visible",children:r.children},c),b=Kn(b,c,n,null),b.flags|=2,r.return=t,b.return=t,r.sibling=b,t.child=r,er(t,e.child,null,n),r=t.child,r.memoizedState=Hc(n),r.childLanes=Gc(e,p,n),t.memoizedState=qc,t=Fs(null,r));else if(xn(t),Su(b)){if(p=b.nextSibling&&b.nextSibling.dataset,p)var q=p.dgst;p=q,r=Error(i(419)),r.stack="",r.digest=p,As({value:r,source:null,stack:null}),t=Vc(e,t,n)}else if(lt||zr(e,t,n,!1),p=(n&e.childLanes)!==0,lt||p){if(p=Xe,p!==null&&(r=qt(p,n),r!==0&&r!==T.retryLane))throw T.retryLane=r,Xn(e,r),Xt(p,e,r),Lc;ju(b)||bo(),t=Vc(e,t,n)}else ju(b)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Ke=ha(b.nextSibling),jt=t,Le=!0,un=null,fa=!1,e!==null&&Qf(t,e),t=Qc(t,r.children),t.flags|=4096);return t}return c?(vn(),b=r.fallback,c=t.mode,T=e.child,q=T.sibling,r=qa(T,{mode:"hidden",children:r.children}),r.subtreeFlags=T.subtreeFlags&65011712,q!==null?b=qa(q,b):(b=Kn(b,c,n,null),b.flags|=2),b.return=t,r.return=t,r.sibling=b,t.child=r,Fs(null,r),r=t.child,b=e.child.memoizedState,b===null?b=Hc(n):(c=b.cachePool,c!==null?(T=rt._currentValue,c=c.parent!==T?{parent:T,pool:T}:c):c=$f(),b={baseLanes:b.baseLanes|n,cachePool:c}),r.memoizedState=b,r.childLanes=Gc(e,p,n),t.memoizedState=qc,Fs(e.child,r)):(xn(t),n=e.child,e=n.sibling,n=qa(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=n,t.memoizedState=null,n)}function Qc(e,t){return t=uo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function uo(e,t){return e=It(22,e,null,t),e.lanes=0,e}function Vc(e,t,n){return er(t,e.child,null,n),e=Qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),rc(e.return,t,n)}function Fc(e,t,n,r,c,u){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:c,treeForkCount:u}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=r,p.tail=n,p.tailMode=c,p.treeForkCount=u)}function ih(e,t,n){var r=t.pendingProps,c=r.revealOrder,u=r.tail;r=r.children;var p=tt.current,b=(p&2)!==0;if(b?(p=p&1|2,t.flags|=128):p&=1,V(tt,p),wt(e,t,r,n),r=Le?Ms:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&oh(e,n,t);else if(e.tag===19)oh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&Il(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Fc(t,!1,c,n,u,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Il(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Fc(t,!0,n,null,u,r);break;case"together":Fc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ya(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(zr(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=qa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Yc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fl(e)))}function Uy(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),fn(t,rt,e.memoizedState.cache),$n();break;case 27:case 5:D(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:fn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,xc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(xn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?lh(e,t,n):(xn(t),e=Ya(e,t,n),e!==null?e.sibling:null);xn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(zr(e,t,n,!1),r=(n&t.childLanes)!==0),c){if(r)return ih(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),V(tt,tt.current),r)break;return null;case 22:return t.lanes=0,eh(e,t,n,t.pendingProps);case 24:fn(t,rt,e.memoizedState.cache)}return Ya(e,t,n)}function ch(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)lt=!0;else{if(!Yc(e,n)&&(t.flags&128)===0)return lt=!1,Uy(e,t,n);lt=(e.flags&131072)!==0}else lt=!1,Le&&(t.flags&1048576)!==0&&Gf(t,Ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=In(t.elementType),t.type=e,typeof e=="function")Ji(e)?(r=ar(e,r),t.tag=1,t=rh(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var c=e.$$typeof;if(c===$){t.tag=11,t=Pm(null,t,e,r,n);break e}else if(c===H){t.tag=14,t=Im(null,t,e,r,n);break e}}throw t=Re(e)||e,Error(i(306,t,""))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,c=ar(r,t.pendingProps),rh(e,t,r,c,n);case 3:e:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var u=t.memoizedState;c=u.element,dc(e,t),qs(t,r,null,n);var p=t.memoizedState;if(r=p.cache,fn(t,rt,r),r!==u.cache&&sc(t,[rt],n,!0),Bs(),r=p.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=sh(e,t,r,n);break e}else if(r!==c){c=ca(Error(i(424)),t),As(c),t=sh(e,t,r,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ke=ha(e.firstChild),jt=t,Le=!0,un=null,fa=!0,n=em(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($n(),r===c){t=Ya(e,t,n);break e}wt(e,t,r,n)}t=t.child}return t;case 26:return co(e,t),e===null?(n=bp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Le||(n=t.type,e=t.pendingProps,r=To(me.current).createElement(n),r[Nt]=t,r[Ht]=e,Et(r,n,e),vt(r),t.stateNode=r):t.memoizedState=bp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return D(t),e===null&&Le&&(r=t.stateNode=vp(t.type,t.pendingProps,me.current),jt=t,fa=!0,c=Ke,En(t.type)?(wu=c,Ke=ha(r.firstChild)):Ke=c),wt(e,t,t.pendingProps.children,n),co(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=r=Ke)&&(r=fb(r,t.type,t.pendingProps,fa),r!==null?(t.stateNode=r,jt=t,Ke=ha(r.firstChild),fa=!1,c=!0):c=!1),c||dn(t)),D(t),c=t.type,u=t.pendingProps,p=e!==null?e.memoizedProps:null,r=u.children,yu(c,u)?r=null:p!==null&&yu(c,p)&&(t.flags|=32),t.memoizedState!==null&&(c=gc(e,t,Ty,null,null,n),sl._currentValue=c),co(e,t),wt(e,t,r,n),t.child;case 6:return e===null&&Le&&((e=n=Ke)&&(n=mb(n,t.pendingProps,fa),n!==null?(t.stateNode=n,jt=t,Ke=null,e=!0):e=!1),e||dn(t)),null;case 13:return lh(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=er(t,null,r,n):wt(e,t,r,n),t.child;case 11:return Pm(e,t,t.type,t.pendingProps,n);case 7:return wt(e,t,t.pendingProps,n),t.child;case 8:return wt(e,t,t.pendingProps.children,n),t.child;case 12:return wt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,fn(t,t.type,r.value),wt(e,t,r.children,n),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Jn(t),c=St(c),r=r(c),t.flags|=1,wt(e,t,r,n),t.child;case 14:return Im(e,t,t.type,t.pendingProps,n);case 15:return Wm(e,t,t.type,t.pendingProps,n);case 19:return ih(e,t,n);case 31:return Dy(e,t,n);case 22:return eh(e,t,n,t.pendingProps);case 24:return Jn(t),r=St(rt),e===null?(c=ic(),c===null&&(c=Xe,u=lc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:r,cache:c},uc(t),fn(t,rt,c)):((e.lanes&n)!==0&&(dc(e,t),qs(t,null,null,n),Bs()),c=e.memoizedState,u=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),fn(t,rt,r)):(r=u.cache,fn(t,rt,r),r!==c.cache&&sc(t,[rt],n,!0))),wt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Xa(e){e.flags|=4}function Xc(e,t,n,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Uh())e.flags|=8192;else throw Wn=$l,cc}else e.flags&=-16777217}function uh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ep(t))if(Uh())e.flags|=8192;else throw Wn=$l,cc}function fo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_t():536870912,e.lanes|=t,Xr|=t)}function Ys(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ly(e,t,n){var r=t.pendingProps;switch(ec(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return $e(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qa(rt),L(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Or(t)?Xa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ac())),$e(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Xa(t),u!==null?($e(t),uh(t,u)):($e(t),Xc(t,c,null,r,n))):u?u!==e.memoizedState?(Xa(t),$e(t),uh(t,u)):($e(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Xa(t),$e(t),Xc(t,c,e,r,n)),null;case 27:if(Se(t),n=me.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Xa(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return $e(t),null}e=J.current,Or(t)?Vf(t):(e=vp(c,r,n),t.stateNode=e,Xa(t))}return $e(t),null;case 5:if(Se(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Xa(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return $e(t),null}if(u=J.current,Or(t))Vf(t);else{var p=To(me.current);switch(u){case 1:u=p.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=p.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=p.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?p.createElement("select",{is:r.is}):p.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?p.createElement(c,{is:r.is}):p.createElement(c)}}u[Nt]=t,u[Ht]=r;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)u.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=u;e:switch(Et(u,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Xa(t)}}return $e(t),Xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Xa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=me.current,Or(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,c=jt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||lp(e.nodeValue,n)),e||dn(t,!0)}else e=To(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return $e(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Or(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Nt]=t}else $n(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else n=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(i(558))}return $e(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Or(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Nt]=t}else $n(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),c=!1}else c=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==c&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fo(t,t.updateQueue),$e(t),null);case 4:return L(),e===null&&hu(t.stateNode.containerInfo),$e(t),null;case 10:return Qa(t.type),$e(t),null;case 19:if(U(tt),r=t.memoizedState,r===null)return $e(t),null;if(c=(t.flags&128)!==0,u=r.rendering,u===null)if(c)Ys(r,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Il(e),u!==null){for(t.flags|=128,Ys(r,!1),e=u.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Bf(n,e),n=n.sibling;return V(tt,tt.current&1|2),Le&&Ha(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&At()>vo&&(t.flags|=128,c=!0,Ys(r,!1),t.lanes=4194304)}else{if(!c)if(e=Il(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),Ys(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!Le)return $e(t),null}else 2*At()-r.renderingStartTime>vo&&n!==536870912&&(t.flags|=128,c=!0,Ys(r,!1),t.lanes=4194304);r.isBackwards?(u.sibling=t.child,t.child=u):(e=r.last,e!==null?e.sibling=u:t.child=u,r.last=u)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=At(),e.sibling=null,n=tt.current,V(tt,c?n&1|2:n&1),Le&&Ha(t,r.treeForkCount),e):($e(t),null);case 22:case 23:return ea(t),pc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),n=t.updateQueue,n!==null&&fo(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&U(Pn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qa(rt),$e(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function By(e,t){switch(ec(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qa(rt),L(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(i(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(tt),null;case 4:return L(),null;case 10:return Qa(t.type),null;case 22:case 23:return ea(t),pc(),e!==null&&U(Pn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qa(rt),null;case 25:return null;default:return null}}function dh(e,t){switch(ec(t),t.tag){case 3:Qa(rt),L();break;case 26:case 27:case 5:Se(t);break;case 4:L();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:U(tt);break;case 10:Qa(t.type);break;case 22:case 23:ea(t),pc(),e!==null&&U(Pn);break;case 24:Qa(rt)}}function Xs(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var c=r.next;n=c;do{if((n.tag&e)===e){r=void 0;var u=n.create,p=n.inst;r=u(),p.destroy=r}n=n.next}while(n!==c)}}catch(b){Qe(t,t.return,b)}}function gn(e,t,n){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var u=c.next;r=u;do{if((r.tag&e)===e){var p=r.inst,b=p.destroy;if(b!==void 0){p.destroy=void 0,c=t;var T=n,q=b;try{q()}catch(Z){Qe(c,T,Z)}}}r=r.next}while(r!==u)}}catch(Z){Qe(t,t.return,Z)}}function fh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{am(t,n)}catch(r){Qe(e,e.return,r)}}}function mh(e,t,n){n.props=ar(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Qe(e,t,r)}}function Ks(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(c){Qe(e,t,c)}}function ka(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(c){Qe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){Qe(e,t,c)}else n.current=null}function hh(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(c){Qe(e,e.return,c)}}function Kc(e,t,n){try{var r=e.stateNode;lb(r,e.type,n,t),r[Ht]=t}catch(c){Qe(e,e.return,c)}}function ph(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&En(e.type)||e.tag===4}function $c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ph(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&En(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=La));else if(r!==4&&(r===27&&En(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function mo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&En(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(mo(e,t,n),e=e.sibling;e!==null;)mo(e,t,n),e=e.sibling}function xh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Et(t,r,n),t[Nt]=e,t[Ht]=n}catch(u){Qe(e,e.return,u)}}var Ka=!1,ot=!1,Jc=!1,vh=typeof WeakSet=="function"?WeakSet:Set,gt=null;function qy(e,t){if(e=e.containerInfo,vu=zo,e=Rf(e),Vi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var c=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var p=0,b=-1,T=-1,q=0,Z=0,I=e,Q=null;t:for(;;){for(var F;I!==n||c!==0&&I.nodeType!==3||(b=p+c),I!==u||r!==0&&I.nodeType!==3||(T=p+r),I.nodeType===3&&(p+=I.nodeValue.length),(F=I.firstChild)!==null;)Q=I,I=F;for(;;){if(I===e)break t;if(Q===n&&++q===c&&(b=p),Q===u&&++Z===r&&(T=p),(F=I.nextSibling)!==null)break;I=Q,Q=I.parentNode}I=F}n=b===-1||T===-1?null:{start:b,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(gu={focusedElem:e,selectionRange:n},zo=!1,gt=t;gt!==null;)if(t=gt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gt=e;else for(;gt!==null;){switch(t=gt,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,c=u.memoizedProps,u=u.memoizedState,r=n.stateNode;try{var ce=ar(n.type,c);e=r.getSnapshotBeforeUpdate(ce,u),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){Qe(n,n.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Nu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,gt=e;break}gt=t.return}}function gh(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Za(e,n),r&4&&Xs(5,n);break;case 1:if(Za(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(p){Qe(n,n.return,p)}else{var c=ar(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Qe(n,n.return,p)}}r&64&&fh(n),r&512&&Ks(n,n.return);break;case 3:if(Za(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{am(e,t)}catch(p){Qe(n,n.return,p)}}break;case 27:t===null&&r&4&&xh(n);case 26:case 5:Za(e,n),t===null&&r&4&&hh(n),r&512&&Ks(n,n.return);break;case 12:Za(e,n);break;case 31:Za(e,n),r&4&&Nh(e,n);break;case 13:Za(e,n),r&4&&jh(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$y.bind(null,n),hb(e,n))));break;case 22:if(r=n.memoizedState!==null||Ka,!r){t=t!==null&&t.memoizedState!==null||ot,c=Ka;var u=ot;Ka=r,(ot=t)&&!u?Ja(e,n,(n.subtreeFlags&8772)!==0):Za(e,n),Ka=c,ot=u}break;case 30:break;default:Za(e,n)}}function yh(e){var t=e.alternate;t!==null&&(e.alternate=null,yh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ci(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Je=null,Qt=!1;function $a(e,t,n){for(n=n.child;n!==null;)bh(e,t,n),n=n.sibling}function bh(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(qn,n)}catch{}switch(n.tag){case 26:ot||ka(n,t),$a(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ot||ka(n,t);var r=Je,c=Qt;En(n.type)&&(Je=n.stateNode,Qt=!1),$a(e,t,n),al(n.stateNode),Je=r,Qt=c;break;case 5:ot||ka(n,t);case 6:if(r=Je,c=Qt,Je=null,$a(e,t,n),Je=r,Qt=c,Je!==null)if(Qt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(n.stateNode)}catch(u){Qe(n,t,u)}else try{Je.removeChild(n.stateNode)}catch(u){Qe(n,t,u)}break;case 18:Je!==null&&(Qt?(e=Je,fp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),es(e)):fp(Je,n.stateNode));break;case 4:r=Je,c=Qt,Je=n.stateNode.containerInfo,Qt=!0,$a(e,t,n),Je=r,Qt=c;break;case 0:case 11:case 14:case 15:gn(2,n,t),ot||gn(4,n,t),$a(e,t,n);break;case 1:ot||(ka(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&mh(n,t,r)),$a(e,t,n);break;case 21:$a(e,t,n);break;case 22:ot=(r=ot)||n.memoizedState!==null,$a(e,t,n),ot=r;break;default:$a(e,t,n)}}function Nh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{es(e)}catch(n){Qe(t,t.return,n)}}}function jh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{es(e)}catch(n){Qe(t,t.return,n)}}function Hy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vh),t;default:throw Error(i(435,e.tag))}}function ho(e,t){var n=Hy(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var c=Zy.bind(null,e,r);r.then(c,c)}})}function Vt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var c=n[r],u=e,p=t,b=p;e:for(;b!==null;){switch(b.tag){case 27:if(En(b.type)){Je=b.stateNode,Qt=!1;break e}break;case 5:Je=b.stateNode,Qt=!1;break e;case 3:case 4:Je=b.stateNode.containerInfo,Qt=!0;break e}b=b.return}if(Je===null)throw Error(i(160));bh(u,p,c),Je=null,Qt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sh(t,e),t=t.sibling}var Na=null;function Sh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Ft(e),r&4&&(gn(3,e,e.return),Xs(3,e),gn(5,e,e.return));break;case 1:Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),r&64&&Ka&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var c=Na;if(Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),r&4){var u=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":u=c.getElementsByTagName("title")[0],(!u||u[bs]||u[Nt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(r),c.head.insertBefore(u,c.querySelector("head > title"))),Et(u,r,n),u[Nt]=e,vt(u),r=u;break e;case"link":var p=Sp("link","href",c).get(r+(n.href||""));if(p){for(var b=0;b<p.length;b++)if(u=p[b],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){p.splice(b,1);break t}}u=c.createElement(r),Et(u,r,n),c.head.appendChild(u);break;case"meta":if(p=Sp("meta","content",c).get(r+(n.content||""))){for(b=0;b<p.length;b++)if(u=p[b],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){p.splice(b,1);break t}}u=c.createElement(r),Et(u,r,n),c.head.appendChild(u);break;default:throw Error(i(468,r))}u[Nt]=e,vt(u),r=u}e.stateNode=r}else wp(c,e.type,e.stateNode);else e.stateNode=jp(c,r,e.memoizedProps);else u!==r?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,r===null?wp(c,e.type,e.stateNode):jp(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),e.flags&32){c=e.stateNode;try{Sr(c,"")}catch(ce){Qe(e,e.return,ce)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Kc(e,c,n!==null?n.memoizedProps:c)),r&1024&&(Jc=!0);break;case 6:if(Vt(t,e),Ft(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ce){Qe(e,e.return,ce)}}break;case 3:if(ko=null,c=Na,Na=_o(t.containerInfo),Vt(t,e),Na=c,Ft(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{es(t.containerInfo)}catch(ce){Qe(e,e.return,ce)}Jc&&(Jc=!1,wh(e));break;case 4:r=Na,Na=_o(e.stateNode.containerInfo),Vt(t,e),Ft(e),Na=r;break;case 12:Vt(t,e),Ft(e);break;case 31:Vt(t,e),Ft(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 13:Vt(t,e),Ft(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(xo=At()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 22:c=e.memoizedState!==null;var T=n!==null&&n.memoizedState!==null,q=Ka,Z=ot;if(Ka=q||c,ot=Z||T,Vt(t,e),ot=Z,Ka=q,Ft(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||T||Ka||ot||nr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){T=n=t;try{if(u=T.stateNode,c)p=u.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{b=T.stateNode;var I=T.memoizedProps.style,Q=I!=null&&I.hasOwnProperty("display")?I.display:null;b.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(ce){Qe(T,T.return,ce)}}}else if(t.tag===6){if(n===null){T=t;try{T.stateNode.nodeValue=c?"":T.memoizedProps}catch(ce){Qe(T,T.return,ce)}}}else if(t.tag===18){if(n===null){T=t;try{var F=T.stateNode;c?mp(F,!0):mp(T.stateNode,!1)}catch(ce){Qe(T,T.return,ce)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ho(e,n))));break;case 19:Vt(t,e),Ft(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 30:break;case 21:break;default:Vt(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(ph(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode,u=$c(e);mo(e,u,c);break;case 5:var p=n.stateNode;n.flags&32&&(Sr(p,""),n.flags&=-33);var b=$c(e);mo(e,b,p);break;case 3:case 4:var T=n.stateNode.containerInfo,q=$c(e);Zc(e,q,T);break;default:throw Error(i(161))}}catch(Z){Qe(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Za(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gh(e,t.alternate,t),t=t.sibling}function nr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:gn(4,t,t.return),nr(t);break;case 1:ka(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&mh(t,t.return,n),nr(t);break;case 27:al(t.stateNode);case 26:case 5:ka(t,t.return),nr(t);break;case 22:t.memoizedState===null&&nr(t);break;case 30:nr(t);break;default:nr(t)}e=e.sibling}}function Ja(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,u=t,p=u.flags;switch(u.tag){case 0:case 11:case 15:Ja(c,u,n),Xs(4,u);break;case 1:if(Ja(c,u,n),r=u,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(q){Qe(r,r.return,q)}if(r=u,c=r.updateQueue,c!==null){var b=r.stateNode;try{var T=c.shared.hiddenCallbacks;if(T!==null)for(c.shared.hiddenCallbacks=null,c=0;c<T.length;c++)tm(T[c],b)}catch(q){Qe(r,r.return,q)}}n&&p&64&&fh(u),Ks(u,u.return);break;case 27:xh(u);case 26:case 5:Ja(c,u,n),n&&r===null&&p&4&&hh(u),Ks(u,u.return);break;case 12:Ja(c,u,n);break;case 31:Ja(c,u,n),n&&p&4&&Nh(c,u);break;case 13:Ja(c,u,n),n&&p&4&&jh(c,u);break;case 22:u.memoizedState===null&&Ja(c,u,n),Ks(u,u.return);break;case 30:break;default:Ja(c,u,n)}t=t.sibling}}function Pc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Os(n))}function Ic(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Os(e))}function ja(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eh(e,t,n,r),t=t.sibling}function Eh(e,t,n,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ja(e,t,n,r),c&2048&&Xs(9,t);break;case 1:ja(e,t,n,r);break;case 3:ja(e,t,n,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Os(e)));break;case 12:if(c&2048){ja(e,t,n,r),e=t.stateNode;try{var u=t.memoizedProps,p=u.id,b=u.onPostCommit;typeof b=="function"&&b(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Qe(t,t.return,T)}}else ja(e,t,n,r);break;case 31:ja(e,t,n,r);break;case 13:ja(e,t,n,r);break;case 23:break;case 22:u=t.stateNode,p=t.alternate,t.memoizedState!==null?u._visibility&2?ja(e,t,n,r):$s(e,t):u._visibility&2?ja(e,t,n,r):(u._visibility|=2,Vr(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Pc(p,t);break;case 24:ja(e,t,n,r),c&2048&&Ic(t.alternate,t);break;default:ja(e,t,n,r)}}function Vr(e,t,n,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,p=t,b=n,T=r,q=p.flags;switch(p.tag){case 0:case 11:case 15:Vr(u,p,b,T,c),Xs(8,p);break;case 23:break;case 22:var Z=p.stateNode;p.memoizedState!==null?Z._visibility&2?Vr(u,p,b,T,c):$s(u,p):(Z._visibility|=2,Vr(u,p,b,T,c)),c&&q&2048&&Pc(p.alternate,p);break;case 24:Vr(u,p,b,T,c),c&&q&2048&&Ic(p.alternate,p);break;default:Vr(u,p,b,T,c)}t=t.sibling}}function $s(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,c=r.flags;switch(r.tag){case 22:$s(n,r),c&2048&&Pc(r.alternate,r);break;case 24:$s(n,r),c&2048&&Ic(r.alternate,r);break;default:$s(n,r)}t=t.sibling}}var Zs=8192;function Fr(e,t,n){if(e.subtreeFlags&Zs)for(e=e.child;e!==null;)Ch(e,t,n),e=e.sibling}function Ch(e,t,n){switch(e.tag){case 26:Fr(e,t,n),e.flags&Zs&&e.memoizedState!==null&&Cb(n,Na,e.memoizedState,e.memoizedProps);break;case 5:Fr(e,t,n);break;case 3:case 4:var r=Na;Na=_o(e.stateNode.containerInfo),Fr(e,t,n),Na=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zs,Zs=16777216,Fr(e,t,n),Zs=r):Fr(e,t,n));break;default:Fr(e,t,n)}}function Th(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Js(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gt=r,Rh(r,e)}Th(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_h(e),e=e.sibling}function _h(e){switch(e.tag){case 0:case 11:case 15:Js(e),e.flags&2048&&gn(9,e,e.return);break;case 3:Js(e);break;case 12:Js(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,po(e)):Js(e);break;default:Js(e)}}function po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gt=r,Rh(r,e)}Th(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gn(8,t,t.return),po(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,po(t));break;default:po(t)}e=e.sibling}}function Rh(e,t){for(;gt!==null;){var n=gt;switch(n.tag){case 0:case 11:case 15:gn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Os(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,gt=r;else e:for(n=e;gt!==null;){r=gt;var c=r.sibling,u=r.return;if(yh(r),r===n){gt=null;break e}if(c!==null){c.return=u,gt=c;break e}gt=u}}}var Gy={getCacheForType:function(e){var t=St(rt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return St(rt).controller.signal}},Qy=typeof WeakMap=="function"?WeakMap:Map,He=0,Xe=null,Oe=null,De=0,Ge=0,ta=null,yn=!1,Yr=!1,Wc=!1,Pa=0,et=0,bn=0,rr=0,eu=0,aa=0,Xr=0,Ps=null,Yt=null,tu=!1,xo=0,kh=0,vo=1/0,go=null,Nn=null,dt=0,jn=null,Kr=null,Ia=0,au=0,nu=null,Mh=null,Is=0,ru=null;function na(){return(He&2)!==0&&De!==0?De&-De:C.T!==null?uu():wi()}function Ah(){if(aa===0)if((De&536870912)===0||Le){var e=pr;pr<<=1,(pr&3932160)===0&&(pr=262144),aa=e}else aa=536870912;return e=Wt.current,e!==null&&(e.flags|=32),aa}function Xt(e,t,n){(e===Xe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&($r(e,0),Sn(e,De,aa,!1)),Ie(e,n),((He&2)===0||e!==Xe)&&(e===Xe&&((He&2)===0&&(rr|=n),et===4&&Sn(e,De,aa,!1)),Ma(e))}function Oh(e,t,n){if((He&6)!==0)throw Error(i(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ze(e,t),c=r?Yy(e,t):lu(e,t,!0),u=r;do{if(c===0){Yr&&!r&&Sn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Vy(n)){c=lu(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var b=e;c=Ps;var T=b.current.memoizedState.isDehydrated;if(T&&($r(b,p).flags|=256),p=lu(b,p,!1),p!==2){if(Wc&&!T){b.errorRecoveryDisabledLanes|=u,rr|=u,c=4;break e}u=Yt,Yt=c,u!==null&&(Yt===null?Yt=u:Yt.push.apply(Yt,u))}c=p}if(u=!1,c!==2)continue}}if(c===1){$r(e,0),Sn(e,t,0,!0);break}e:{switch(r=e,u=c,u){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Sn(r,t,aa,!yn);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=xo+300-At(),10<c)){if(Sn(r,t,aa,!yn),Ce(r,0,!0)!==0)break e;Ia=t,r.timeoutHandle=up(zh.bind(null,r,n,Yt,go,tu,t,aa,rr,Xr,yn,u,"Throttled",-0,0),c);break e}zh(r,n,Yt,go,tu,t,aa,rr,Xr,yn,u,null,-0,0)}}break}while(!0);Ma(e)}function zh(e,t,n,r,c,u,p,b,T,q,Z,I,Q,F){if(e.timeoutHandle=-1,I=t.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:La},Ch(t,u,I);var ce=(u&62914560)===u?xo-At():(u&4194048)===u?kh-At():0;if(ce=Tb(I,ce),ce!==null){Ia=u,e.cancelPendingCommit=ce(Qh.bind(null,e,t,u,n,r,c,p,b,T,Z,I,null,Q,F)),Sn(e,u,p,!q);return}}Qh(e,t,u,n,r,c,p,b,T)}function Vy(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var c=n[r],u=c.getSnapshot;c=c.value;try{if(!Pt(u(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Sn(e,t,n,r){t&=~eu,t&=~rr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var u=31-Tt(c),p=1<<u;r[u]=-1,c&=~p}n!==0&&Gn(e,n,t)}function yo(){return(He&6)===0?(Ws(0),!1):!0}function su(){if(Oe!==null){if(Ge===0)var e=Oe.return;else e=Oe,Ga=Zn=null,Nc(e),Br=null,Ds=0,e=Oe;for(;e!==null;)dh(e.alternate,e),e=e.return;Oe=null}}function $r(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cb(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ia=0,su(),Xe=e,Oe=n=qa(e.current,null),De=t,Ge=0,ta=null,yn=!1,Yr=Ze(e,t),Wc=!1,Xr=aa=eu=rr=bn=et=0,Yt=Ps=null,tu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Tt(r),u=1<<c;t|=e[c],r&=~u}return Pa=t,ql(),n}function Dh(e,t){_e=null,C.H=Vs,t===Lr||t===Kl?(t=Pf(),Ge=3):t===cc?(t=Pf(),Ge=4):Ge=t===Lc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,Oe===null&&(et=1,oo(e,ca(t,e.current)))}function Uh(){var e=Wt.current;return e===null?!0:(De&4194048)===De?ma===null:(De&62914560)===De||(De&536870912)!==0?e===ma:!1}function Lh(){var e=C.H;return C.H=Vs,e===null?Vs:e}function Bh(){var e=C.A;return C.A=Gy,e}function bo(){et=4,yn||(De&4194048)!==De&&Wt.current!==null||(Yr=!0),(bn&134217727)===0&&(rr&134217727)===0||Xe===null||Sn(Xe,De,aa,!1)}function lu(e,t,n){var r=He;He|=2;var c=Lh(),u=Bh();(Xe!==e||De!==t)&&(go=null,$r(e,t)),t=!1;var p=et;e:do try{if(Ge!==0&&Oe!==null){var b=Oe,T=ta;switch(Ge){case 8:su(),p=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(t=!0);var q=Ge;if(Ge=0,ta=null,Zr(e,b,T,q),n&&Yr){p=0;break e}break;default:q=Ge,Ge=0,ta=null,Zr(e,b,T,q)}}Fy(),p=et;break}catch(Z){Dh(e,Z)}while(!0);return t&&e.shellSuspendCounter++,Ga=Zn=null,He=r,C.H=c,C.A=u,Oe===null&&(Xe=null,De=0,ql()),p}function Fy(){for(;Oe!==null;)qh(Oe)}function Yy(e,t){var n=He;He|=2;var r=Lh(),c=Bh();Xe!==e||De!==t?(go=null,vo=At()+500,$r(e,t)):Yr=Ze(e,t);e:do try{if(Ge!==0&&Oe!==null){t=Oe;var u=ta;t:switch(Ge){case 1:Ge=0,ta=null,Zr(e,t,u,1);break;case 2:case 9:if(Zf(u)){Ge=0,ta=null,Hh(t);break}t=function(){Ge!==2&&Ge!==9||Xe!==e||(Ge=7),Ma(e)},u.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Zf(u)?(Ge=0,ta=null,Hh(t)):(Ge=0,ta=null,Zr(e,t,u,7));break;case 5:var p=null;switch(Oe.tag){case 26:p=Oe.memoizedState;case 5:case 27:var b=Oe;if(p?Ep(p):b.stateNode.complete){Ge=0,ta=null;var T=b.sibling;if(T!==null)Oe=T;else{var q=b.return;q!==null?(Oe=q,No(q)):Oe=null}break t}}Ge=0,ta=null,Zr(e,t,u,5);break;case 6:Ge=0,ta=null,Zr(e,t,u,6);break;case 8:su(),et=6;break e;default:throw Error(i(462))}}Xy();break}catch(Z){Dh(e,Z)}while(!0);return Ga=Zn=null,C.H=r,C.A=c,He=n,Oe!==null?0:(Xe=null,De=0,ql(),et)}function Xy(){for(;Oe!==null&&!Mt();)qh(Oe)}function qh(e){var t=ch(e.alternate,e,Pa);e.memoizedProps=e.pendingProps,t===null?No(e):Oe=t}function Hh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=nh(n,t,t.pendingProps,t.type,void 0,De);break;case 11:t=nh(n,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:Nc(t);default:dh(n,t),t=Oe=Bf(t,Pa),t=ch(n,t,Pa)}e.memoizedProps=e.pendingProps,t===null?No(e):Oe=t}function Zr(e,t,n,r){Ga=Zn=null,Nc(t),Br=null,Ds=0;var c=t.return;try{if(zy(e,c,t,n,De)){et=1,oo(e,ca(n,e.current)),Oe=null;return}}catch(u){if(c!==null)throw Oe=c,u;et=1,oo(e,ca(n,e.current)),Oe=null;return}t.flags&32768?(Le||r===1?e=!0:Yr||(De&536870912)!==0?e=!1:(yn=e=!0,(r===2||r===9||r===3||r===6)&&(r=Wt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gh(t,e)):No(t)}function No(e){var t=e;do{if((t.flags&32768)!==0){Gh(t,yn);return}e=t.return;var n=Ly(t.alternate,t,Pa);if(n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);et===0&&(et=5)}function Gh(e,t){do{var n=By(e.alternate,e);if(n!==null){n.flags&=32767,Oe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=n}while(e!==null);et=6,Oe=null}function Qh(e,t,n,r,c,u,p,b,T){e.cancelPendingCommit=null;do jo();while(dt!==0);if((He&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(u=t.lanes|t.childLanes,u|=$i,Lt(e,n,u,p,b,T),e===Xe&&(Oe=Xe=null,De=0),Kr=t,jn=e,Ia=n,au=u,nu=c,Mh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jy(Bn,function(){return Kh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=C.T,C.T=null,c=X.p,X.p=2,p=He,He|=4;try{qy(e,t,n)}finally{He=p,X.p=c,C.T=r}}dt=1,Vh(),Fh(),Yh()}}function Vh(){if(dt===1){dt=0;var e=jn,t=Kr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var r=X.p;X.p=2;var c=He;He|=4;try{Sh(t,e);var u=gu,p=Rf(e.containerInfo),b=u.focusedElem,T=u.selectionRange;if(p!==b&&b&&b.ownerDocument&&_f(b.ownerDocument.documentElement,b)){if(T!==null&&Vi(b)){var q=T.start,Z=T.end;if(Z===void 0&&(Z=q),"selectionStart"in b)b.selectionStart=q,b.selectionEnd=Math.min(Z,b.value.length);else{var I=b.ownerDocument||document,Q=I&&I.defaultView||window;if(Q.getSelection){var F=Q.getSelection(),ce=b.textContent.length,Ne=Math.min(T.start,ce),Ye=T.end===void 0?Ne:Math.min(T.end,ce);!F.extend&&Ne>Ye&&(p=Ye,Ye=Ne,Ne=p);var A=Tf(b,Ne),R=Tf(b,Ye);if(A&&R&&(F.rangeCount!==1||F.anchorNode!==A.node||F.anchorOffset!==A.offset||F.focusNode!==R.node||F.focusOffset!==R.offset)){var B=I.createRange();B.setStart(A.node,A.offset),F.removeAllRanges(),Ne>Ye?(F.addRange(B),F.extend(R.node,R.offset)):(B.setEnd(R.node,R.offset),F.addRange(B))}}}}for(I=[],F=b;F=F.parentNode;)F.nodeType===1&&I.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<I.length;b++){var P=I[b];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}zo=!!vu,gu=vu=null}finally{He=c,X.p=r,C.T=n}}e.current=t,dt=2}}function Fh(){if(dt===2){dt=0;var e=jn,t=Kr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var r=X.p;X.p=2;var c=He;He|=4;try{gh(e,t.alternate,t)}finally{He=c,X.p=r,C.T=n}}dt=3}}function Yh(){if(dt===4||dt===3){dt=0,nn();var e=jn,t=Kr,n=Ia,r=Mh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,Kr=jn=null,Xh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Nn=null),ya(n),t=t.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(qn,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=C.T,c=X.p,X.p=2,C.T=null;try{for(var u=e.onRecoverableError,p=0;p<r.length;p++){var b=r[p];u(b.value,{componentStack:b.stack})}}finally{C.T=t,X.p=c}}(Ia&3)!==0&&jo(),Ma(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===ru?Is++:(Is=0,ru=e):Is=0,Ws(0)}}function Xh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Os(t)))}function jo(){return Vh(),Fh(),Yh(),Kh()}function Kh(){if(dt!==5)return!1;var e=jn,t=au;au=0;var n=ya(Ia),r=C.T,c=X.p;try{X.p=32>n?32:n,C.T=null,n=nu,nu=null;var u=jn,p=Ia;if(dt=0,Kr=jn=null,Ia=0,(He&6)!==0)throw Error(i(331));var b=He;if(He|=4,_h(u.current),Eh(u,u.current,p,n),He=b,Ws(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(qn,u)}catch{}return!0}finally{X.p=c,C.T=r,Xh(e,t)}}function $h(e,t,n){t=ca(n,t),t=Uc(e.stateNode,t,2),e=pn(e,t,2),e!==null&&(Ie(e,2),Ma(e))}function Qe(e,t,n){if(e.tag===3)$h(e,e,n);else for(;t!==null;){if(t.tag===3){$h(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Nn===null||!Nn.has(r))){e=ca(n,e),n=Zm(2),r=pn(t,n,2),r!==null&&(Jm(n,r,t,e),Ie(r,2),Ma(r));break}}t=t.return}}function ou(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qy;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(n)||(Wc=!0,c.add(n),e=Ky.bind(null,e,t,n),t.then(e,e))}function Ky(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xe===e&&(De&n)===n&&(et===4||et===3&&(De&62914560)===De&&300>At()-xo?(He&2)===0&&$r(e,0):eu|=n,Xr===De&&(Xr=0)),Ma(e)}function Zh(e,t){t===0&&(t=_t()),e=Xn(e,t),e!==null&&(Ie(e,t),Ma(e))}function $y(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zh(e,n)}function Zy(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zh(e,n)}function Jy(e,t){return xs(e,t)}var So=null,Jr=null,iu=!1,wo=!1,cu=!1,wn=0;function Ma(e){e!==Jr&&e.next===null&&(Jr===null?So=Jr=e:Jr=Jr.next=e),wo=!0,iu||(iu=!0,Iy())}function Ws(e,t){if(!cu&&wo){cu=!0;do for(var n=!1,r=So;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var u=0;else{var p=r.suspendedLanes,b=r.pingedLanes;u=(1<<31-Tt(42|e)+1)-1,u&=c&~(p&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Wh(r,u))}else u=De,u=Ce(r,r===Xe?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||Ze(r,u)||(n=!0,Wh(r,u));r=r.next}while(n);cu=!1}}function Py(){Jh()}function Jh(){wo=iu=!1;var e=0;wn!==0&&ib()&&(e=wn);for(var t=At(),n=null,r=So;r!==null;){var c=r.next,u=Ph(r,t);u===0?(r.next=null,n===null?So=c:n.next=c,c===null&&(Jr=n)):(n=r,(e!==0||(u&3)!==0)&&(wo=!0)),r=c}dt!==0&&dt!==5||Ws(e),wn!==0&&(wn=0)}function Ph(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var p=31-Tt(u),b=1<<p,T=c[p];T===-1?((b&n)===0||(b&r)!==0)&&(c[p]=xt(b,t)):T<=t&&(e.expiredLanes|=b),u&=~b}if(t=Xe,n=De,n=Ce(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&vs(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&vs(r),ya(n)){case 2:case 8:n=Cl;break;case 32:n=Bn;break;case 268435456:n=Da;break;default:n=Bn}return r=Ih.bind(null,e),n=xs(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&vs(r),e.callbackPriority=2,e.callbackNode=null,2}function Ih(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(jo()&&e.callbackNode!==n)return null;var r=De;return r=Ce(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Oh(e,r,t),Ph(e,At()),e.callbackNode!=null&&e.callbackNode===n?Ih.bind(null,e):null)}function Wh(e,t){if(jo())return null;Oh(e,t,!0)}function Iy(){ub(function(){(He&6)!==0?xs(Ln,Py):Jh()})}function uu(){if(wn===0){var e=Dr;e===0&&(e=hr,hr<<=1,(hr&261888)===0&&(hr=256)),wn=e}return wn}function ep(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ml(""+e)}function tp(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Wy(e,t,n,r,c){if(t==="submit"&&n&&n.stateNode===c){var u=ep((c[Ht]||null).action),p=r.submitter;p&&(t=(t=p[Ht]||null)?ep(t.formAction):p.getAttribute("formAction"),t!==null&&(u=t,p=null));var b=new Dl("action","action",null,r,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wn!==0){var T=p?tp(c,p):new FormData(c);kc(n,{pending:!0,data:T,method:c.method,action:u},null,T)}}else typeof u=="function"&&(b.preventDefault(),T=p?tp(c,p):new FormData(c),kc(n,{pending:!0,data:T,method:c.method,action:u},u,T))},currentTarget:c}]})}}for(var du=0;du<Ki.length;du++){var fu=Ki[du],eb=fu.toLowerCase(),tb=fu[0].toUpperCase()+fu.slice(1);ba(eb,"on"+tb)}ba(Af,"onAnimationEnd"),ba(Of,"onAnimationIteration"),ba(zf,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(vy,"onTransitionRun"),ba(gy,"onTransitionStart"),ba(yy,"onTransitionCancel"),ba(Df,"onTransitionEnd"),Nr("onMouseEnter",["mouseout","mouseover"]),Nr("onMouseLeave",["mouseout","mouseover"]),Nr("onPointerEnter",["pointerout","pointerover"]),Nr("onPointerLeave",["pointerout","pointerover"]),Qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var el="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ab=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(el));function ap(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],c=r.event;r=r.listeners;e:{var u=void 0;if(t)for(var p=r.length-1;0<=p;p--){var b=r[p],T=b.instance,q=b.currentTarget;if(b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=q;try{u(c)}catch(Z){Bl(Z)}c.currentTarget=null,u=T}else for(p=0;p<r.length;p++){if(b=r[p],T=b.instance,q=b.currentTarget,b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=q;try{u(c)}catch(Z){Bl(Z)}c.currentTarget=null,u=T}}}}function ze(e,t){var n=t[Ei];n===void 0&&(n=t[Ei]=new Set);var r=e+"__bubble";n.has(r)||(np(t,e,2,!1),n.add(r))}function mu(e,t,n){var r=0;t&&(r|=4),np(n,e,r,t)}var Eo="_reactListening"+Math.random().toString(36).slice(2);function hu(e){if(!e[Eo]){e[Eo]=!0,Zd.forEach(function(n){n!=="selectionchange"&&(ab.has(n)||mu(n,!1,e),mu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Eo]||(t[Eo]=!0,mu("selectionchange",!1,t))}}function np(e,t,n,r){switch(Ap(t)){case 2:var c=kb;break;case 8:c=Mb;break;default:c=Ru}n=c.bind(null,t,n,e),c=void 0,!zi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function pu(e,t,n,r,c){var u=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var p=r.tag;if(p===3||p===4){var b=r.stateNode.containerInfo;if(b===c)break;if(p===4)for(p=r.return;p!==null;){var T=p.tag;if((T===3||T===4)&&p.stateNode.containerInfo===c)return;p=p.return}for(;b!==null;){if(p=gr(b),p===null)return;if(T=p.tag,T===5||T===6||T===26||T===27){r=u=p;continue e}b=b.parentNode}}r=r.return}of(function(){var q=u,Z=Ai(n),I=[];e:{var Q=Uf.get(e);if(Q!==void 0){var F=Dl,ce=e;switch(e){case"keypress":if(Ol(n)===0)break e;case"keydown":case"keyup":F=Zg;break;case"focusin":ce="focus",F=Bi;break;case"focusout":ce="blur",F=Bi;break;case"beforeblur":case"afterblur":F=Bi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=df;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=Lg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=Ig;break;case Af:case Of:case zf:F=Hg;break;case Df:F=ey;break;case"scroll":case"scrollend":F=Dg;break;case"wheel":F=ay;break;case"copy":case"cut":case"paste":F=Qg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=mf;break;case"toggle":case"beforetoggle":F=ry}var Ne=(t&4)!==0,Ye=!Ne&&(e==="scroll"||e==="scrollend"),A=Ne?Q!==null?Q+"Capture":null:Q;Ne=[];for(var R=q,B;R!==null;){var P=R;if(B=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||B===null||A===null||(P=js(R,A),P!=null&&Ne.push(tl(R,P,B))),Ye)break;R=R.return}0<Ne.length&&(Q=new F(Q,ce,null,n,Z),I.push({event:Q,listeners:Ne}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",Q&&n!==Mi&&(ce=n.relatedTarget||n.fromElement)&&(gr(ce)||ce[vr]))break e;if((F||Q)&&(Q=Z.window===Z?Z:(Q=Z.ownerDocument)?Q.defaultView||Q.parentWindow:window,F?(ce=n.relatedTarget||n.toElement,F=q,ce=ce?gr(ce):null,ce!==null&&(Ye=f(ce),Ne=ce.tag,ce!==Ye||Ne!==5&&Ne!==27&&Ne!==6)&&(ce=null)):(F=null,ce=q),F!==ce)){if(Ne=df,P="onMouseLeave",A="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=mf,P="onPointerLeave",A="onPointerEnter",R="pointer"),Ye=F==null?Q:Ns(F),B=ce==null?Q:Ns(ce),Q=new Ne(P,R+"leave",F,n,Z),Q.target=Ye,Q.relatedTarget=B,P=null,gr(Z)===q&&(Ne=new Ne(A,R+"enter",ce,n,Z),Ne.target=B,Ne.relatedTarget=Ye,P=Ne),Ye=P,F&&ce)t:{for(Ne=nb,A=F,R=ce,B=0,P=A;P;P=Ne(P))B++;P=0;for(var ge=R;ge;ge=Ne(ge))P++;for(;0<B-P;)A=Ne(A),B--;for(;0<P-B;)R=Ne(R),P--;for(;B--;){if(A===R||R!==null&&A===R.alternate){Ne=A;break t}A=Ne(A),R=Ne(R)}Ne=null}else Ne=null;F!==null&&rp(I,Q,F,Ne,!1),ce!==null&&Ye!==null&&rp(I,Ye,ce,Ne,!0)}}e:{if(Q=q?Ns(q):window,F=Q.nodeName&&Q.nodeName.toLowerCase(),F==="select"||F==="input"&&Q.type==="file")var Be=Nf;else if(yf(Q))if(jf)Be=hy;else{Be=fy;var he=dy}else F=Q.nodeName,!F||F.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?q&&ki(q.elementType)&&(Be=Nf):Be=my;if(Be&&(Be=Be(e,q))){bf(I,Be,n,Z);break e}he&&he(e,Q,q),e==="focusout"&&q&&Q.type==="number"&&q.memoizedProps.value!=null&&Ri(Q,"number",Q.value)}switch(he=q?Ns(q):window,e){case"focusin":(yf(he)||he.contentEditable==="true")&&(Tr=he,Fi=q,ks=null);break;case"focusout":ks=Fi=Tr=null;break;case"mousedown":Yi=!0;break;case"contextmenu":case"mouseup":case"dragend":Yi=!1,kf(I,n,Z);break;case"selectionchange":if(xy)break;case"keydown":case"keyup":kf(I,n,Z)}var ke;if(Hi)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Cr?vf(e,n)&&(Ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ue="onCompositionStart");Ue&&(hf&&n.locale!=="ko"&&(Cr||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Cr&&(ke=cf()):(on=Z,Di="value"in on?on.value:on.textContent,Cr=!0)),he=Co(q,Ue),0<he.length&&(Ue=new ff(Ue,e,null,n,Z),I.push({event:Ue,listeners:he}),ke?Ue.data=ke:(ke=gf(n),ke!==null&&(Ue.data=ke)))),(ke=ly?oy(e,n):iy(e,n))&&(Ue=Co(q,"onBeforeInput"),0<Ue.length&&(he=new ff("onBeforeInput","beforeinput",null,n,Z),I.push({event:he,listeners:Ue}),he.data=ke)),Wy(I,e,q,n,Z)}ap(I,t)})}function tl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Co(e,t){for(var n=t+"Capture",r=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=js(e,n),c!=null&&r.unshift(tl(e,c,u)),c=js(e,t),c!=null&&r.push(tl(e,c,u))),e.tag===3)return r;e=e.return}return[]}function nb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(e,t,n,r,c){for(var u=t._reactName,p=[];n!==null&&n!==r;){var b=n,T=b.alternate,q=b.stateNode;if(b=b.tag,T!==null&&T===r)break;b!==5&&b!==26&&b!==27||q===null||(T=q,c?(q=js(n,u),q!=null&&p.unshift(tl(n,q,T))):c||(q=js(n,u),q!=null&&p.push(tl(n,q,T)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var rb=/\r\n?/g,sb=/\u0000|\uFFFD/g;function sp(e){return(typeof e=="string"?e:""+e).replace(rb,`
9
- `).replace(sb,"")}function lp(e,t){return t=sp(t),sp(e)===t}function Fe(e,t,n,r,c,u){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Sr(e,""+r);break;case"className":Rl(e,"class",r);break;case"tabIndex":Rl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(e,n,r);break;case"style":sf(e,r,u);break;case"data":if(t!=="object"){Rl(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Ml(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&Fe(e,t,"name",c.name,c,null),Fe(e,t,"formEncType",c.formEncType,c,null),Fe(e,t,"formMethod",c.formMethod,c,null),Fe(e,t,"formTarget",c.formTarget,c,null)):(Fe(e,t,"encType",c.encType,c,null),Fe(e,t,"method",c.method,c,null),Fe(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Ml(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=La);break;case"onScroll":r!=null&&ze("scroll",e);break;case"onScrollEnd":r!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Ml(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ze("beforetoggle",e),ze("toggle",e),_l(e,"popover",r);break;case"xlinkActuate":Ua(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ua(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ua(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ua(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ua(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ua(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ua(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ua(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ua(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":_l(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Og.get(n)||n,_l(e,n,r))}}function xu(e,t,n,r,c,u){switch(n){case"style":sf(e,r,u);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&Sr(e,""+r);break;case"onScroll":r!=null&&ze("scroll",e);break;case"onScrollEnd":r!=null&&ze("scrollend",e);break;case"onClick":r!=null&&(e.onclick=La);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jd.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),u=e[Ht]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof r=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,c);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):_l(e,n,r)}}}function Et(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var r=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var p=n[u];if(p!=null)switch(u){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Fe(e,t,u,p,n,null)}}c&&Fe(e,t,"srcSet",n.srcSet,n,null),r&&Fe(e,t,"src",n.src,n,null);return;case"input":ze("invalid",e);var b=u=p=c=null,T=null,q=null;for(r in n)if(n.hasOwnProperty(r)){var Z=n[r];if(Z!=null)switch(r){case"name":c=Z;break;case"type":p=Z;break;case"checked":T=Z;break;case"defaultChecked":q=Z;break;case"value":u=Z;break;case"defaultValue":b=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(137,t));break;default:Fe(e,t,r,Z,n,null)}}tf(e,u,b,T,q,p,c,!1);return;case"select":ze("invalid",e),r=p=u=null;for(c in n)if(n.hasOwnProperty(c)&&(b=n[c],b!=null))switch(c){case"value":u=b;break;case"defaultValue":p=b;break;case"multiple":r=b;default:Fe(e,t,c,b,n,null)}t=u,n=p,e.multiple=!!r,t!=null?jr(e,!!r,t,!1):n!=null&&jr(e,!!r,n,!0);return;case"textarea":ze("invalid",e),u=c=r=null;for(p in n)if(n.hasOwnProperty(p)&&(b=n[p],b!=null))switch(p){case"value":r=b;break;case"defaultValue":c=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(i(91));break;default:Fe(e,t,p,b,n,null)}nf(e,r,c,u);return;case"option":for(T in n)n.hasOwnProperty(T)&&(r=n[T],r!=null)&&(T==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Fe(e,t,T,r,n,null));return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(r=0;r<el.length;r++)ze(el[r],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in n)if(n.hasOwnProperty(q)&&(r=n[q],r!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Fe(e,t,q,r,n,null)}return;default:if(ki(t)){for(Z in n)n.hasOwnProperty(Z)&&(r=n[Z],r!==void 0&&xu(e,t,Z,r,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(r=n[b],r!=null&&Fe(e,t,b,r,n,null))}function lb(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,p=null,b=null,T=null,q=null,Z=null;for(F in n){var I=n[F];if(n.hasOwnProperty(F)&&I!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":T=I;default:r.hasOwnProperty(F)||Fe(e,t,F,null,r,I)}}for(var Q in r){var F=r[Q];if(I=n[Q],r.hasOwnProperty(Q)&&(F!=null||I!=null))switch(Q){case"type":u=F;break;case"name":c=F;break;case"checked":q=F;break;case"defaultChecked":Z=F;break;case"value":p=F;break;case"defaultValue":b=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:F!==I&&Fe(e,t,Q,F,r,I)}}_i(e,p,b,T,q,Z,u,c);return;case"select":F=p=b=Q=null;for(u in n)if(T=n[u],n.hasOwnProperty(u)&&T!=null)switch(u){case"value":break;case"multiple":F=T;default:r.hasOwnProperty(u)||Fe(e,t,u,null,r,T)}for(c in r)if(u=r[c],T=n[c],r.hasOwnProperty(c)&&(u!=null||T!=null))switch(c){case"value":Q=u;break;case"defaultValue":b=u;break;case"multiple":p=u;default:u!==T&&Fe(e,t,c,u,r,T)}t=b,n=p,r=F,Q!=null?jr(e,!!n,Q,!1):!!r!=!!n&&(t!=null?jr(e,!!n,t,!0):jr(e,!!n,n?[]:"",!1));return;case"textarea":F=Q=null;for(b in n)if(c=n[b],n.hasOwnProperty(b)&&c!=null&&!r.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Fe(e,t,b,null,r,c)}for(p in r)if(c=r[p],u=n[p],r.hasOwnProperty(p)&&(c!=null||u!=null))switch(p){case"value":Q=c;break;case"defaultValue":F=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==u&&Fe(e,t,p,c,r,u)}af(e,Q,F);return;case"option":for(var ce in n)Q=n[ce],n.hasOwnProperty(ce)&&Q!=null&&!r.hasOwnProperty(ce)&&(ce==="selected"?e.selected=!1:Fe(e,t,ce,null,r,Q));for(T in r)Q=r[T],F=n[T],r.hasOwnProperty(T)&&Q!==F&&(Q!=null||F!=null)&&(T==="selected"?e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":Fe(e,t,T,Q,r,F));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ne in n)Q=n[Ne],n.hasOwnProperty(Ne)&&Q!=null&&!r.hasOwnProperty(Ne)&&Fe(e,t,Ne,null,r,Q);for(q in r)if(Q=r[q],F=n[q],r.hasOwnProperty(q)&&Q!==F&&(Q!=null||F!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,t));break;default:Fe(e,t,q,Q,r,F)}return;default:if(ki(t)){for(var Ye in n)Q=n[Ye],n.hasOwnProperty(Ye)&&Q!==void 0&&!r.hasOwnProperty(Ye)&&xu(e,t,Ye,void 0,r,Q);for(Z in r)Q=r[Z],F=n[Z],!r.hasOwnProperty(Z)||Q===F||Q===void 0&&F===void 0||xu(e,t,Z,Q,r,F);return}}for(var A in n)Q=n[A],n.hasOwnProperty(A)&&Q!=null&&!r.hasOwnProperty(A)&&Fe(e,t,A,null,r,Q);for(I in r)Q=r[I],F=n[I],!r.hasOwnProperty(I)||Q===F||Q==null&&F==null||Fe(e,t,I,Q,r,F)}function op(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ob(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var c=n[r],u=c.transferSize,p=c.initiatorType,b=c.duration;if(u&&b&&op(p)){for(p=0,b=c.responseEnd,r+=1;r<n.length;r++){var T=n[r],q=T.startTime;if(q>b)break;var Z=T.transferSize,I=T.initiatorType;Z&&op(I)&&(T=T.responseEnd,p+=Z*(T<b?1:(b-q)/(T-q)))}if(--r,t+=8*(u+p)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var vu=null,gu=null;function To(e){return e.nodeType===9?e:e.ownerDocument}function ip(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function yu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bu=null;function ib(){var e=window.event;return e&&e.type==="popstate"?e===bu?!1:(bu=e,!0):(bu=null,!1)}var up=typeof setTimeout=="function"?setTimeout:void 0,cb=typeof clearTimeout=="function"?clearTimeout:void 0,dp=typeof Promise=="function"?Promise:void 0,ub=typeof queueMicrotask=="function"?queueMicrotask:typeof dp<"u"?function(e){return dp.resolve(null).then(e).catch(db)}:up;function db(e){setTimeout(function(){throw e})}function En(e){return e==="head"}function fp(e,t){var n=t,r=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(c),es(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")al(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,al(n);for(var u=n.firstChild;u;){var p=u.nextSibling,b=u.nodeName;u[bs]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=p}}else n==="body"&&al(e.ownerDocument.body);n=c}while(n);es(t)}function mp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function Nu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nu(n),Ci(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function fb(e,t,n,r){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[bs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=ha(e.nextSibling),e===null)break}return null}function mb(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ha(e.nextSibling),e===null))return null;return e}function hp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ha(e.nextSibling),e===null))return null;return e}function ju(e){return e.data==="$?"||e.data==="$~"}function Su(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hb(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ha(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var wu=null;function pp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ha(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function xp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function vp(e,t,n){switch(t=To(n),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function al(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ci(e)}var pa=new Map,gp=new Set;function _o(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wa=X.d;X.d={f:pb,r:xb,D:vb,C:gb,L:yb,m:bb,X:jb,S:Nb,M:Sb};function pb(){var e=Wa.f(),t=yo();return e||t}function xb(e){var t=yr(e);t!==null&&t.tag===5&&t.type==="form"?Dm(t):Wa.r(e)}var Pr=typeof document>"u"?null:document;function yp(e,t,n){var r=Pr;if(r&&typeof t=="string"&&t){var c=oa(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),gp.has(c)||(gp.add(c),e={rel:e,crossOrigin:n,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Et(t,"link",e),vt(t),r.head.appendChild(t)))}}function vb(e){Wa.D(e),yp("dns-prefetch",e,null)}function gb(e,t){Wa.C(e,t),yp("preconnect",e,t)}function yb(e,t,n){Wa.L(e,t,n);var r=Pr;if(r&&e&&t){var c='link[rel="preload"][as="'+oa(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+oa(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+oa(n.imageSizes)+'"]')):c+='[href="'+oa(e)+'"]';var u=c;switch(t){case"style":u=Ir(e);break;case"script":u=Wr(e)}pa.has(u)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),pa.set(u,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(nl(u))||t==="script"&&r.querySelector(rl(u))||(t=r.createElement("link"),Et(t,"link",e),vt(t),r.head.appendChild(t)))}}function bb(e,t){Wa.m(e,t);var n=Pr;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+oa(r)+'"][href="'+oa(e)+'"]',u=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Wr(e)}if(!pa.has(u)&&(e=x({rel:"modulepreload",href:e},t),pa.set(u,e),n.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(rl(u)))return}r=n.createElement("link"),Et(r,"link",e),vt(r),n.head.appendChild(r)}}}function Nb(e,t,n){Wa.S(e,t,n);var r=Pr;if(r&&e){var c=br(r).hoistableStyles,u=Ir(e);t=t||"default";var p=c.get(u);if(!p){var b={loading:0,preload:null};if(p=r.querySelector(nl(u)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=pa.get(u))&&Eu(e,n);var T=p=r.createElement("link");vt(T),Et(T,"link",e),T._p=new Promise(function(q,Z){T.onload=q,T.onerror=Z}),T.addEventListener("load",function(){b.loading|=1}),T.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Ro(p,t,r)}p={type:"stylesheet",instance:p,count:1,state:b},c.set(u,p)}}}function jb(e,t){Wa.X(e,t);var n=Pr;if(n&&e){var r=br(n).hoistableScripts,c=Wr(e),u=r.get(c);u||(u=n.querySelector(rl(c)),u||(e=x({src:e,async:!0},t),(t=pa.get(c))&&Cu(e,t),u=n.createElement("script"),vt(u),Et(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function Sb(e,t){Wa.M(e,t);var n=Pr;if(n&&e){var r=br(n).hoistableScripts,c=Wr(e),u=r.get(c);u||(u=n.querySelector(rl(c)),u||(e=x({src:e,async:!0,type:"module"},t),(t=pa.get(c))&&Cu(e,t),u=n.createElement("script"),vt(u),Et(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function bp(e,t,n,r){var c=(c=me.current)?_o(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ir(n.href),n=br(c).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ir(n.href);var u=br(c).hoistableStyles,p=u.get(e);if(p||(c=c.ownerDocument||c,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,p),(u=c.querySelector(nl(e)))&&!u._p&&(p.instance=u,p.state.loading=5),pa.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},pa.set(e,n),u||wb(c,e,n,p.state))),t&&r===null)throw Error(i(528,""));return p}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wr(n),n=br(c).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ir(e){return'href="'+oa(e)+'"'}function nl(e){return'link[rel="stylesheet"]['+e+"]"}function Np(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function wb(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Et(t,"link",n),vt(t),e.head.appendChild(t))}function Wr(e){return'[src="'+oa(e)+'"]'}function rl(e){return"script[async]"+e}function jp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+oa(n.href)+'"]');if(r)return t.instance=r,vt(r),r;var c=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),vt(r),Et(r,"style",c),Ro(r,n.precedence,e),t.instance=r;case"stylesheet":c=Ir(n.href);var u=e.querySelector(nl(c));if(u)return t.state.loading|=4,t.instance=u,vt(u),u;r=Np(n),(c=pa.get(c))&&Eu(r,c),u=(e.ownerDocument||e).createElement("link"),vt(u);var p=u;return p._p=new Promise(function(b,T){p.onload=b,p.onerror=T}),Et(u,"link",r),t.state.loading|=4,Ro(u,n.precedence,e),t.instance=u;case"script":return u=Wr(n.src),(c=e.querySelector(rl(u)))?(t.instance=c,vt(c),c):(r=n,(c=pa.get(u))&&(r=x({},n),Cu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),vt(c),Et(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ro(r,n.precedence,e));return t.instance}function Ro(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,u=c,p=0;p<r.length;p++){var b=r[p];if(b.dataset.precedence===t)u=b;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Eu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Cu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ko=null;function Sp(e,t,n){if(ko===null){var r=new Map,c=ko=new Map;c.set(n,r)}else c=ko,r=c.get(n),r||(r=new Map,c.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var u=n[c];if(!(u[bs]||u[Nt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var p=u.getAttribute(t)||"";p=e+p;var b=r.get(p);b?b.push(u):r.set(p,[u])}}return r}function wp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Eb(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ep(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Cb(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=Ir(r.href),u=t.querySelector(nl(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,vt(u);return}u=t.ownerDocument||t,r=Np(r),(c=pa.get(c))&&Eu(r,c),u=u.createElement("link"),vt(u);var p=u;p._p=new Promise(function(b,T){p.onload=b,p.onerror=T}),Et(u,"link",r),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Mo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Tu=0;function Tb(e,t){return e.stylesheets&&e.count===0&&Oo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Oo(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Tu===0&&(Tu=62500*ob());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Oo(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Tu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Oo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ao=null;function Oo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ao=new Map,t.forEach(_b,e),Ao=null,Mo.call(e))}function _b(e,t){if(!(t.state.loading&4)){var n=Ao.get(e);if(n)var r=n.get(null);else{n=new Map,Ao.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var p=c[u];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),r=p)}r&&n.set(null,r)}c=t.instance,p=c.getAttribute("data-precedence"),u=n.get(p)||r,u===r&&n.set(null,c),n.set(p,c),this.count++,r=Mo.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var sl={$$typeof:G,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Rb(e,t,n,r,c,u,p,b,T){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sn(0),this.hiddenUpdates=sn(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function Cp(e,t,n,r,c,u,p,b,T,q,Z,I){return e=new Rb(e,t,n,p,T,q,Z,I,b),t=1,u===!0&&(t|=24),u=It(3,null,null,t),e.current=u,u.stateNode=e,t=lc(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:r,isDehydrated:n,cache:t},uc(u),e}function Tp(e){return e?(e=kr,e):kr}function _p(e,t,n,r,c,u){c=Tp(c),r.context===null?r.context=c:r.pendingContext=c,r=hn(t),r.payload={element:n},u=u===void 0?null:u,u!==null&&(r.callback=u),n=pn(e,r,t),n!==null&&(Xt(n,e,t),Ls(n,e,t))}function Rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _u(e,t){Rp(e,t),(e=e.alternate)&&Rp(e,t)}function kp(e){if(e.tag===13||e.tag===31){var t=Xn(e,67108864);t!==null&&Xt(t,e,67108864),_u(e,67108864)}}function Mp(e){if(e.tag===13||e.tag===31){var t=na();t=xr(t);var n=Xn(e,t);n!==null&&Xt(n,e,t),_u(e,t)}}var zo=!0;function kb(e,t,n,r){var c=C.T;C.T=null;var u=X.p;try{X.p=2,Ru(e,t,n,r)}finally{X.p=u,C.T=c}}function Mb(e,t,n,r){var c=C.T;C.T=null;var u=X.p;try{X.p=8,Ru(e,t,n,r)}finally{X.p=u,C.T=c}}function Ru(e,t,n,r){if(zo){var c=ku(r);if(c===null)pu(e,t,r,Do,n),Op(e,r);else if(Ob(c,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Ab.indexOf(e)){for(;c!==null;){var u=yr(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var p=Ta(u.pendingLanes);if(p!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;p;){var T=1<<31-Tt(p);b.entanglements[1]|=T,p&=~T}Ma(u),(He&6)===0&&(vo=At()+500,Ws(0))}}break;case 31:case 13:b=Xn(u,2),b!==null&&Xt(b,u,2),yo(),_u(u,2)}if(u=ku(r),u===null&&pu(e,t,r,Do,n),u===c)break;c=u}c!==null&&r.stopPropagation()}else pu(e,t,r,null,n)}}function ku(e){return e=Ai(e),Mu(e)}var Do=null;function Mu(e){if(Do=null,e=gr(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=v(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Do=e,null}function Ap(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ji()){case Ln:return 2;case Cl:return 8;case Bn:case gs:return 32;case Da:return 268435456;default:return 32}default:return 32}}var Au=!1,Cn=null,Tn=null,_n=null,ll=new Map,ol=new Map,Rn=[],Ab="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Op(e,t){switch(e){case"focusin":case"focusout":Cn=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ol.delete(t.pointerId)}}function il(e,t,n,r,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:u,targetContainers:[c]},t!==null&&(t=yr(t),t!==null&&kp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Ob(e,t,n,r,c){switch(t){case"focusin":return Cn=il(Cn,e,t,n,r,c),!0;case"dragenter":return Tn=il(Tn,e,t,n,r,c),!0;case"mouseover":return _n=il(_n,e,t,n,r,c),!0;case"pointerover":var u=c.pointerId;return ll.set(u,il(ll.get(u)||null,e,t,n,r,c)),!0;case"gotpointercapture":return u=c.pointerId,ol.set(u,il(ol.get(u)||null,e,t,n,r,c)),!0}return!1}function zp(e){var t=gr(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,Kd(e.priority,function(){Mp(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,Kd(e.priority,function(){Mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ku(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Mi=r,n.target.dispatchEvent(r),Mi=null}else return t=yr(n),t!==null&&kp(t),e.blockedOn=n,!1;t.shift()}return!0}function Dp(e,t,n){Uo(e)&&n.delete(t)}function zb(){Au=!1,Cn!==null&&Uo(Cn)&&(Cn=null),Tn!==null&&Uo(Tn)&&(Tn=null),_n!==null&&Uo(_n)&&(_n=null),ll.forEach(Dp),ol.forEach(Dp)}function Lo(e,t){e.blockedOn===t&&(e.blockedOn=null,Au||(Au=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,zb)))}var Bo=null;function Up(e){Bo!==e&&(Bo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Bo===e&&(Bo=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Mu(r||n)===null)continue;break}var u=yr(n);u!==null&&(e.splice(t,3),t-=3,kc(u,{pending:!0,data:c,method:n.method,action:r},r,c))}}))}function es(e){function t(T){return Lo(T,e)}Cn!==null&&Lo(Cn,e),Tn!==null&&Lo(Tn,e),_n!==null&&Lo(_n,e),ll.forEach(t),ol.forEach(t);for(var n=0;n<Rn.length;n++){var r=Rn[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)zp(n),n.blockedOn===null&&Rn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var c=n[r],u=n[r+1],p=c[Ht]||null;if(typeof u=="function")p||Up(n);else if(p){var b=null;if(u&&u.hasAttribute("formAction")){if(c=u,p=u[Ht]||null)b=p.formAction;else if(Mu(c)!==null)continue}else b=p.action;typeof b=="function"?n[r+1]=b:(n.splice(r,3),r-=3),Up(n)}}}function Lp(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(p){return c=p})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Ou(e){this._internalRoot=e}qo.prototype.render=Ou.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,r=na();_p(n,r,e,t,null,null)},qo.prototype.unmount=Ou.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_p(e.current,2,null,e,null,null),yo(),t[vr]=null}};function qo(e){this._internalRoot=e}qo.prototype.unstable_scheduleHydration=function(e){if(e){var t=wi();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&zp(e)}};var Bp=s.version;if(Bp!=="19.2.4")throw Error(i(527,Bp,"19.2.4"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Db={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ho=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ho.isDisabled&&Ho.supportsFiber)try{qn=Ho.inject(Db),Ot=Ho}catch{}}return ul.createRoot=function(e,t){if(!d(e))throw Error(i(299));var n=!1,r="",c=Ym,u=Xm,p=Km;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Cp(e,1,!1,null,null,n,r,null,c,u,p,Lp),e[vr]=t.current,hu(e),new Ou(t)},ul.hydrateRoot=function(e,t,n){if(!d(e))throw Error(i(299));var r=!1,c="",u=Ym,p=Xm,b=Km,T=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=Cp(e,1,!0,t,n??null,r,c,T,u,p,b,Lp),t.context=Tp(null),n=t.current,r=na(),r=xr(r),c=hn(r),c.callback=null,pn(n,c,r),n=r,t.current.lanes=n,Ie(t,n),Ma(t),e[vr]=t.current,hu(e),new qo(t)},ul.version="19.2.4",ul}var $p;function Fb(){if($p)return Uu.exports;$p=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),Uu.exports=Vb(),Uu.exports}var Yb=Fb();var Zp="popstate";function Xb(a={}){function s(i,d){let{pathname:f,search:m,hash:v}=i.location;return td("",{pathname:f,search:m,hash:v},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function o(i,d){return typeof d=="string"?d:vl(d)}return $b(s,o,null,a)}function Pe(a,s){if(a===!1||a===null||typeof a>"u")throw new Error(s)}function Sa(a,s){if(!a){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function Kb(){return Math.random().toString(36).substring(2,10)}function Jp(a,s){return{usr:a.state,key:a.key,idx:s}}function td(a,s,o=null,i){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof s=="string"?is(s):s,state:o,key:s&&s.key||i||Kb()}}function vl({pathname:a="/",search:s="",hash:o=""}){return s&&s!=="?"&&(a+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function is(a){let s={};if(a){let o=a.indexOf("#");o>=0&&(s.hash=a.substring(o),a=a.substring(0,o));let i=a.indexOf("?");i>=0&&(s.search=a.substring(i),a=a.substring(0,i)),a&&(s.pathname=a)}return s}function $b(a,s,o,i={}){let{window:d=document.defaultView,v5Compat:f=!1}=i,m=d.history,v="POP",g=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function x(){v="POP";let _=y(),O=_==null?null:_-h;h=_,g&&g({action:v,location:E.location,delta:O})}function j(_,O){v="PUSH";let k=td(E.location,_,O);h=y()+1;let G=Jp(k,h),$=E.createHref(k);try{m.pushState(G,"",$)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;d.location.assign($)}f&&g&&g({action:v,location:E.location,delta:1})}function M(_,O){v="REPLACE";let k=td(E.location,_,O);h=y();let G=Jp(k,h),$=E.createHref(k);m.replaceState(G,"",$),f&&g&&g({action:v,location:E.location,delta:0})}function w(_){return Zb(_)}let E={get action(){return v},get location(){return a(d,m)},listen(_){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Zp,x),g=_,()=>{d.removeEventListener(Zp,x),g=null}},createHref(_){return s(d,_)},createURL:w,encodeLocation(_){let O=w(_);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:j,replace:M,go(_){return m.go(_)}};return E}function Zb(a,s=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),Pe(o,"No window.location.(origin|href) available to create URL");let i=typeof a=="string"?a:vl(a);return i=i.replace(/ $/,"%20"),!s&&i.startsWith("//")&&(i=o+i),new URL(i,o)}function Px(a,s,o="/"){return Jb(a,s,o,!1)}function Jb(a,s,o,i){let d=typeof s=="string"?is(s):s,f=an(d.pathname||"/",o);if(f==null)return null;let m=Ix(a);Pb(m);let v=null;for(let g=0;v==null&&g<m.length;++g){let h=i0(f);v=l0(m[g],h,i)}return v}function Ix(a,s=[],o=[],i="",d=!1){let f=(m,v,g=d,h)=>{let y={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:v,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&g)return;Pe(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let x=tn([i,y.relativePath]),j=o.concat(y);m.children&&m.children.length>0&&(Pe(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Ix(m.children,s,j,x,g)),!(m.path==null&&!m.index)&&s.push({path:x,score:r0(x,m.index),routesMeta:j})};return a.forEach((m,v)=>{if(m.path===""||!m.path?.includes("?"))f(m,v);else for(let g of Wx(m.path))f(m,v,!0,g)}),s}function Wx(a){let s=a.split("/");if(s.length===0)return[];let[o,...i]=s,d=o.endsWith("?"),f=o.replace(/\?$/,"");if(i.length===0)return d?[f,""]:[f];let m=Wx(i.join("/")),v=[];return v.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&v.push(...m),v.map(g=>a.startsWith("/")&&g===""?"/":g)}function Pb(a){a.sort((s,o)=>s.score!==o.score?o.score-s.score:s0(s.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var Ib=/^:[\w-]+$/,Wb=3,e0=2,t0=1,a0=10,n0=-2,Pp=a=>a==="*";function r0(a,s){let o=a.split("/"),i=o.length;return o.some(Pp)&&(i+=n0),s&&(i+=e0),o.filter(d=>!Pp(d)).reduce((d,f)=>d+(Ib.test(f)?Wb:f===""?t0:a0),i)}function s0(a,s){return a.length===s.length&&a.slice(0,-1).every((i,d)=>i===s[d])?a[a.length-1]-s[s.length-1]:0}function l0(a,s,o=!1){let{routesMeta:i}=a,d={},f="/",m=[];for(let v=0;v<i.length;++v){let g=i[v],h=v===i.length-1,y=f==="/"?s:s.slice(f.length)||"/",x=ni({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),j=g.route;if(!x&&h&&o&&!i[i.length-1].route.index&&(x=ni({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!x)return null;Object.assign(d,x.params),m.push({params:d,pathname:tn([f,x.pathname]),pathnameBase:f0(tn([f,x.pathnameBase])),route:j}),x.pathnameBase!=="/"&&(f=tn([f,x.pathnameBase]))}return m}function ni(a,s){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=o0(a.path,a.caseSensitive,a.end),d=s.match(o);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),v=d.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:x},j)=>{if(y==="*"){let w=v[j]||"";m=f.slice(0,f.length-w.length).replace(/(.)\/+$/,"$1")}const M=v[j];return x&&!M?h[y]=void 0:h[y]=(M||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:a}}function o0(a,s=!1,o=!0){Sa(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let i=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,v,g)=>(i.push({paramName:v,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,s?void 0:"i"),i]}function i0(a){try{return a.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return Sa(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),a}}function an(a,s){if(s==="/")return a;if(!a.toLowerCase().startsWith(s.toLowerCase()))return null;let o=s.endsWith("/")?s.length-1:s.length,i=a.charAt(o);return i&&i!=="/"?null:a.slice(o)||"/"}var c0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function u0(a,s="/"){let{pathname:o,search:i="",hash:d=""}=typeof a=="string"?is(a):a,f;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?f=Ip(o.substring(1),"/"):f=Ip(o,s)):f=s,{pathname:f,search:m0(i),hash:h0(d)}}function Ip(a,s){let o=s.replace(/\/+$/,"").split("/");return a.split("/").forEach(d=>{d===".."?o.length>1&&o.pop():d!=="."&&o.push(d)}),o.length>1?o.join("/"):"/"}function Hu(a,s,o,i){return`Cannot include a '${a}' character in a manually specified \`to.${s}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function d0(a){return a.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function yd(a){let s=d0(a);return s.map((o,i)=>i===s.length-1?o.pathname:o.pathnameBase)}function bd(a,s,o,i=!1){let d;typeof a=="string"?d=is(a):(d={...a},Pe(!d.pathname||!d.pathname.includes("?"),Hu("?","pathname","search",d)),Pe(!d.pathname||!d.pathname.includes("#"),Hu("#","pathname","hash",d)),Pe(!d.search||!d.search.includes("#"),Hu("#","search","hash",d)));let f=a===""||d.pathname==="",m=f?"/":d.pathname,v;if(m==null)v=o;else{let x=s.length-1;if(!i&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),x-=1;d.pathname=j.join("/")}v=x>=0?s[x]:"/"}let g=u0(d,v),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var tn=a=>a.join("/").replace(/\/\/+/g,"/"),f0=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),m0=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,h0=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,p0=class{constructor(a,s,o,i=!1){this.status=a,this.statusText=s||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function x0(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function v0(a){return a.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ev=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tv(a,s){let o=a;if(typeof o!="string"||!c0.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,d=!1;if(ev)try{let f=new URL(window.location.href),m=o.startsWith("//")?new URL(f.protocol+o):new URL(o),v=an(m.pathname,s);m.origin===f.origin&&v!=null?o=v+m.search+m.hash:d=!0}catch{Sa(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:d,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var av=["POST","PUT","PATCH","DELETE"];new Set(av);var g0=["GET",...av];new Set(g0);var cs=N.createContext(null);cs.displayName="DataRouter";var ui=N.createContext(null);ui.displayName="DataRouterState";var y0=N.createContext(!1),nv=N.createContext({isTransitioning:!1});nv.displayName="ViewTransition";var b0=N.createContext(new Map);b0.displayName="Fetchers";var N0=N.createContext(null);N0.displayName="Await";var sa=N.createContext(null);sa.displayName="Navigation";var yl=N.createContext(null);yl.displayName="Location";var va=N.createContext({outlet:null,matches:[],isDataRoute:!1});va.displayName="Route";var Nd=N.createContext(null);Nd.displayName="RouteError";var rv="REACT_ROUTER_ERROR",j0="REDIRECT",S0="ROUTE_ERROR_RESPONSE";function w0(a){if(a.startsWith(`${rv}:${j0}:{`))try{let s=JSON.parse(a.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function E0(a){if(a.startsWith(`${rv}:${S0}:{`))try{let s=JSON.parse(a.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new p0(s.status,s.statusText,s.data)}catch{}}function C0(a,{relative:s}={}){Pe(us(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=N.useContext(sa),{hash:d,pathname:f,search:m}=bl(a,{relative:s}),v=f;return o!=="/"&&(v=f==="/"?o:tn([o,f])),i.createHref({pathname:v,search:m,hash:d})}function us(){return N.useContext(yl)!=null}function zn(){return Pe(us(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(yl).location}var sv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lv(a){N.useContext(sa).static||N.useLayoutEffect(a)}function wa(){let{isDataRoute:a}=N.useContext(va);return a?Q0():T0()}function T0(){Pe(us(),"useNavigate() may be used only in the context of a <Router> component.");let a=N.useContext(cs),{basename:s,navigator:o}=N.useContext(sa),{matches:i}=N.useContext(va),{pathname:d}=zn(),f=JSON.stringify(yd(i)),m=N.useRef(!1);return lv(()=>{m.current=!0}),N.useCallback((g,h={})=>{if(Sa(m.current,sv),!m.current)return;if(typeof g=="number"){o.go(g);return}let y=bd(g,JSON.parse(f),d,h.relative==="path");a==null&&s!=="/"&&(y.pathname=y.pathname==="/"?s:tn([s,y.pathname])),(h.replace?o.replace:o.push)(y,h.state,h)},[s,o,f,d,a])}var _0=N.createContext(null);function R0(a){let s=N.useContext(va).outlet;return N.useMemo(()=>s&&N.createElement(_0.Provider,{value:a},s),[s,a])}function k0(){let{matches:a}=N.useContext(va),s=a[a.length-1];return s?s.params:{}}function bl(a,{relative:s}={}){let{matches:o}=N.useContext(va),{pathname:i}=zn(),d=JSON.stringify(yd(o));return N.useMemo(()=>bd(a,JSON.parse(d),i,s==="path"),[a,d,i,s])}function M0(a,s){return ov(a,s)}function ov(a,s,o,i,d){Pe(us(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=N.useContext(sa),{matches:m}=N.useContext(va),v=m[m.length-1],g=v?v.params:{},h=v?v.pathname:"/",y=v?v.pathnameBase:"/",x=v&&v.route;{let k=x&&x.path||"";cv(h,!x||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
8
+ `+r.stack}}var Jt=Object.prototype.hasOwnProperty,xs=a.unstable_scheduleCallback,vs=a.unstable_cancelCallback,Mt=a.unstable_shouldYield,nn=a.unstable_requestPaint,At=a.unstable_now,ji=a.unstable_getCurrentPriorityLevel,Ln=a.unstable_ImmediatePriority,Cl=a.unstable_UserBlockingPriority,Bn=a.unstable_NormalPriority,gs=a.unstable_LowPriority,Da=a.unstable_IdlePriority,Tl=a.log,rn=a.unstable_setDisableYieldValue,qn=null,Ot=null;function ga(e){if(typeof Tl=="function"&&rn(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(qn,e)}catch{}}var Tt=Math.clz32?Math.clz32:Ca,Si=Math.log,ys=Math.LN2;function Ca(e){return e>>>=0,e===0?32:31-(Si(e)/ys|0)|0}var hr=256,pr=262144,Hn=4194304;function Ta(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var c=0,u=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var b=r&134217727;return b!==0?(r=b&~u,r!==0?c=Ta(r):(p&=b,p!==0?c=Ta(p):n||(n=b&~e,n!==0&&(c=Ta(n))))):(b=r&~u,b!==0?c=Ta(b):p!==0?c=Ta(p):n||(n=r&~e,n!==0&&(c=Ta(n)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:c}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var e=Hn;return Hn<<=1,(Hn&62914560)===0&&(Hn=4194304),e}function sn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Lt(e,t,n,r,c,u){var p=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var b=e.entanglements,T=e.expirationTimes,H=e.hiddenUpdates;for(n=p&~n;0<n;){var $=31-Tt(n),P=1<<$;b[$]=0,T[$]=-1;var G=H[$];if(G!==null)for(H[$]=null,$=0;$<G.length;$++){var V=G[$];V!==null&&(V.lane&=-536870913)}n&=~P}r!==0&&Gn(e,r,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(p&~t))}function Gn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tt(n),c=1<<r;c&t|e[r]&t&&(e[r]|=t),n&=~c}}function qt(e,t){var n=t&-t;return n=(n&42)!==0?1:xr(n),(n&(e.suspendedLanes|t))!==0?0:n}function xr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ya(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function wi(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Ap(e.type))}function Kd(e,t){var n=Y.p;try{return Y.p=e,t()}finally{Y.p=n}}var ln=Math.random().toString(36).slice(2),Nt="__reactFiber$"+ln,Ht="__reactProps$"+ln,vr="__reactContainer$"+ln,Ei="__reactEvents$"+ln,Cg="__reactListeners$"+ln,Tg="__reactHandles$"+ln,$d="__reactResources$"+ln,bs="__reactMarker$"+ln;function Ci(e){delete e[Nt],delete e[Ht],delete e[Ei],delete e[Cg],delete e[Tg]}function gr(e){var t=e[Nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vr]||n[Nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xp(e);e!==null;){if(n=e[Nt])return n;e=xp(e)}return t}e=n,n=e.parentNode}return null}function yr(e){if(e=e[Nt]||e[vr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ns(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function br(e){var t=e[$d];return t||(t=e[$d]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[bs]=!0}var Zd=new Set,Jd={};function Qn(e,t){Nr(e,t),Nr(e+"Capture",t)}function Nr(e,t){for(Jd[e]=t,e=0;e<t.length;e++)Zd.add(t[e])}var _g=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Pd={},Id={};function Rg(e){return Jt.call(Id,e)?!0:Jt.call(Pd,e)?!1:_g.test(e)?Id[e]=!0:(Pd[e]=!0,!1)}function _l(e,t,n){if(Rg(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Rl(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ua(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function la(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kg(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,u=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(p){n=""+p,u.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(p){n=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ti(e){if(!e._valueTracker){var t=Wd(e)?"checked":"value";e._valueTracker=kg(e,t,""+e[t])}}function ef(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function kl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Mg=/[\n"\\]/g;function oa(e){return e.replace(Mg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function _i(e,t,n,r,c,u,p,b){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+la(t)):e.value!==""+la(t)&&(e.value=""+la(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?Ri(e,p,la(t)):n!=null?Ri(e,p,la(n)):r!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+la(b):e.removeAttribute("name")}function tf(e,t,n,r,c,u,p,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ti(e);return}n=n!=null?""+la(n):"",t=t!=null?""+la(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=b?e.checked:!!r,e.defaultChecked=!!r,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),Ti(e)}function Ri(e,t,n){t==="number"&&kl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function jr(e,t,n,r){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&r&&(e[n].defaultSelected=!0)}else{for(n=""+la(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function af(e,t,n){if(t!=null&&(t=""+la(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+la(n):""}function nf(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=la(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Ti(e)}function Sr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ag=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function rf(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Ag.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function sf(e,t,n){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&n[c]!==r&&rf(e,c,r)}else for(var u in t)t.hasOwnProperty(u)&&rf(e,u,t[u])}function ki(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Og=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),zg=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ml(e){return zg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function La(){}var Mi=null;function Ai(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wr=null,Er=null;function lf(e){var t=yr(e);if(t&&(e=t.stateNode)){var n=e[Ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(_i(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+oa(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var c=r[Ht]||null;if(!c)throw Error(i(90));_i(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&ef(r)}break e;case"textarea":af(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&jr(e,!!n.multiple,t,!1)}}}var Oi=!1;function of(e,t,n){if(Oi)return e(t,n);Oi=!0;try{var r=e(t);return r}finally{if(Oi=!1,(wr!==null||Er!==null)&&(yo(),wr&&(t=wr,e=Er,Er=wr=null,lf(t),e)))for(t=0;t<e.length;t++)lf(e[t])}}function js(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ht]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var Ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zi=!1;if(Ba)try{var Ss={};Object.defineProperty(Ss,"passive",{get:function(){zi=!0}}),window.addEventListener("test",Ss,Ss),window.removeEventListener("test",Ss,Ss)}catch{zi=!1}var on=null,Di=null,Al=null;function cf(){if(Al)return Al;var e,t=Di,n=t.length,r,c="value"in on?on.value:on.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var p=n-e;for(r=1;r<=p&&t[n-r]===c[u-r];r++);return Al=c.slice(e,1<r?1-r:void 0)}function Ol(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zl(){return!0}function uf(){return!1}function Gt(e){function t(n,r,c,u,p){this._reactName=n,this._targetInst=c,this.type=r,this.nativeEvent=u,this.target=p,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?zl:uf,this.isPropagationStopped=uf,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=Gt(Vn),ws=x({},Vn,{view:0,detail:0}),Dg=Gt(ws),Ui,Li,Es,Ul=x({},ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Es&&(Es&&e.type==="mousemove"?(Ui=e.screenX-Es.screenX,Li=e.screenY-Es.screenY):Li=Ui=0,Es=e),Ui)},movementY:function(e){return"movementY"in e?e.movementY:Li}}),df=Gt(Ul),Ug=x({},Ul,{dataTransfer:0}),Lg=Gt(Ug),Bg=x({},ws,{relatedTarget:0}),Bi=Gt(Bg),qg=x({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0}),Hg=Gt(qg),Gg=x({},Vn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qg=Gt(Gg),Vg=x({},Vn,{data:0}),ff=Gt(Vg),Fg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xg[e])?!!t[e]:!1}function qi(){return Kg}var $g=x({},ws,{key:function(e){if(e.key){var t=Fg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qi,charCode:function(e){return e.type==="keypress"?Ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zg=Gt($g),Jg=x({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mf=Gt(Jg),Pg=x({},ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qi}),Ig=Gt(Pg),Wg=x({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ey=Gt(Wg),ty=x({},Ul,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ay=Gt(ty),ny=x({},Vn,{newState:0,oldState:0}),ry=Gt(ny),sy=[9,13,27,32],Hi=Ba&&"CompositionEvent"in window,Cs=null;Ba&&"documentMode"in document&&(Cs=document.documentMode);var ly=Ba&&"TextEvent"in window&&!Cs,hf=Ba&&(!Hi||Cs&&8<Cs&&11>=Cs),pf=" ",xf=!1;function vf(e,t){switch(e){case"keyup":return sy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cr=!1;function oy(e,t){switch(e){case"compositionend":return gf(t);case"keypress":return t.which!==32?null:(xf=!0,pf);case"textInput":return e=t.data,e===pf&&xf?null:e;default:return null}}function iy(e,t){if(Cr)return e==="compositionend"||!Hi&&vf(e,t)?(e=cf(),Al=Di=on=null,Cr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return hf&&t.locale!=="ko"?null:t.data;default:return null}}var cy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cy[e.type]:t==="textarea"}function bf(e,t,n,r){wr?Er?Er.push(r):Er=[r]:wr=r,t=Co(t,"onChange"),0<t.length&&(n=new Dl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ts=null,_s=null;function uy(e){ap(e,0)}function Ll(e){var t=Ns(e);if(ef(t))return e}function Nf(e,t){if(e==="change")return t}var jf=!1;if(Ba){var Gi;if(Ba){var Qi="oninput"in document;if(!Qi){var Sf=document.createElement("div");Sf.setAttribute("oninput","return;"),Qi=typeof Sf.oninput=="function"}Gi=Qi}else Gi=!1;jf=Gi&&(!document.documentMode||9<document.documentMode)}function wf(){Ts&&(Ts.detachEvent("onpropertychange",Ef),_s=Ts=null)}function Ef(e){if(e.propertyName==="value"&&Ll(_s)){var t=[];bf(t,_s,e,Ai(e)),of(uy,t)}}function dy(e,t,n){e==="focusin"?(wf(),Ts=t,_s=n,Ts.attachEvent("onpropertychange",Ef)):e==="focusout"&&wf()}function fy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ll(_s)}function my(e,t){if(e==="click")return Ll(t)}function hy(e,t){if(e==="input"||e==="change")return Ll(t)}function py(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:py;function Rs(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var c=n[r];if(!Jt.call(t,c)||!Pt(e[c],t[c]))return!1}return!0}function Cf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tf(e,t){var n=Cf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cf(n)}}function _f(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_f(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=kl(e.document)}return t}function Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var xy=Ba&&"documentMode"in document&&11>=document.documentMode,Tr=null,Fi=null,ks=null,Yi=!1;function kf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yi||Tr==null||Tr!==kl(r)||(r=Tr,"selectionStart"in r&&Vi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ks&&Rs(ks,r)||(ks=r,r=Co(Fi,"onSelect"),0<r.length&&(t=new Dl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Fn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:Fn("Animation","AnimationEnd"),animationiteration:Fn("Animation","AnimationIteration"),animationstart:Fn("Animation","AnimationStart"),transitionrun:Fn("Transition","TransitionRun"),transitionstart:Fn("Transition","TransitionStart"),transitioncancel:Fn("Transition","TransitionCancel"),transitionend:Fn("Transition","TransitionEnd")},Xi={},Mf={};Ba&&(Mf=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);function Yn(e){if(Xi[e])return Xi[e];if(!_r[e])return e;var t=_r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mf)return Xi[e]=t[n];return e}var Af=Yn("animationend"),Of=Yn("animationiteration"),zf=Yn("animationstart"),vy=Yn("transitionrun"),gy=Yn("transitionstart"),yy=Yn("transitioncancel"),Df=Yn("transitionend"),Uf=new Map,Ki="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ki.push("scrollEnd");function ba(e,t){Uf.set(e,t),Qn(t,[e])}var Bl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ia=[],Rr=0,$i=0;function ql(){for(var e=Rr,t=$i=Rr=0;t<e;){var n=ia[t];ia[t++]=null;var r=ia[t];ia[t++]=null;var c=ia[t];ia[t++]=null;var u=ia[t];if(ia[t++]=null,r!==null&&c!==null){var p=r.pending;p===null?c.next=c:(c.next=p.next,p.next=c),r.pending=c}u!==0&&Lf(n,c,u)}}function Hl(e,t,n,r){ia[Rr++]=e,ia[Rr++]=t,ia[Rr++]=n,ia[Rr++]=r,$i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zi(e,t,n,r){return Hl(e,t,n,r),Gl(e)}function Xn(e,t){return Hl(e,null,null,t),Gl(e)}function Lf(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var c=!1,u=e.return;u!==null;)u.childLanes|=n,r=u.alternate,r!==null&&(r.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-Tt(n),e=u.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=n|536870912),u):null}function Gl(e){if(50<Is)throw Is=0,ru=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kr={};function by(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(e,t,n,r){return new by(e,t,n,r)}function Ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qa(e,t){var n=e.alternate;return n===null?(n=It(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&65011712,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.refCleanup=e.refCleanup,n}function Bf(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ql(e,t,n,r,c,u){var p=0;if(r=e,typeof e=="function")Ji(e)&&(p=1);else if(typeof e=="string")p=Eb(e,n,Z.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case oe:return e=It(31,n,t,c),e.elementType=oe,e.lanes=u,e;case E:return Kn(n.children,c,u,t);case _:p=8,c|=24;break;case A:return e=It(12,n,t,c|2),e.elementType=A,e.lanes=u,e;case W:return e=It(13,n,t,c),e.elementType=W,e.lanes=u,e;case ee:return e=It(19,n,t,c),e.elementType=ee,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:p=10;break e;case k:p=9;break e;case I:p=11;break e;case D:p=14;break e;case z:p=16,r=null;break e}p=29,n=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=It(p,n,t,c),t.elementType=e,t.type=r,t.lanes=u,t}function Kn(e,t,n,r){return e=It(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=It(6,e,null,t),e.lanes=n,e}function qf(e){var t=It(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hf=new WeakMap;function ca(e,t){if(typeof e=="object"&&e!==null){var n=Hf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ps(t)},Hf.set(e,t),t)}return{value:e,source:t,stack:ps(t)}}var Mr=[],Ar=0,Vl=null,Ms=0,ua=[],da=0,cn=null,_a=1,Ra="";function Ha(e,t){Mr[Ar++]=Ms,Mr[Ar++]=Vl,Vl=e,Ms=t}function Gf(e,t,n){ua[da++]=_a,ua[da++]=Ra,ua[da++]=cn,cn=e;var r=_a;e=Ra;var c=32-Tt(r)-1;r&=~(1<<c),n+=1;var u=32-Tt(t)+c;if(30<u){var p=c-c%5;u=(r&(1<<p)-1).toString(32),r>>=p,c-=p,_a=1<<32-Tt(t)+c|n<<c|r,Ra=u+e}else _a=1<<u|n<<c|r,Ra=e}function Wi(e){e.return!==null&&(Ha(e,1),Gf(e,1,0))}function ec(e){for(;e===Vl;)Vl=Mr[--Ar],Mr[Ar]=null,Ms=Mr[--Ar],Mr[Ar]=null;for(;e===cn;)cn=ua[--da],ua[da]=null,Ra=ua[--da],ua[da]=null,_a=ua[--da],ua[da]=null}function Qf(e,t){ua[da++]=_a,ua[da++]=Ra,ua[da++]=cn,_a=t.id,Ra=t.overflow,cn=e}var jt=null,Ke=null,Le=!1,un=null,fa=!1,tc=Error(i(519));function dn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw As(ca(t,e)),tc}function Vf(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Nt]=e,t[Ht]=r,n){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(n=0;n<el.length;n++)ze(el[n],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),tf(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),nf(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||lp(t.textContent,n)?(r.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),r.onScroll!=null&&ze("scroll",t),r.onScrollEnd!=null&&ze("scrollend",t),r.onClick!=null&&(t.onclick=La),t=!0):t=!1,t||dn(e,!0)}function Ff(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:fa=!1;return;case 27:case 3:fa=!0;return;default:jt=jt.return}}function Or(e){if(e!==jt)return!1;if(!Le)return Ff(e),Le=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||yu(e.type,e.memoizedProps)),n=!n),n&&Ke&&dn(e),Ff(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=pp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=pp(e)}else t===27?(t=Ke,En(e.type)?(e=wu,wu=null,Ke=e):Ke=t):Ke=jt?ha(e.stateNode.nextSibling):null;return!0}function $n(){Ke=jt=null,Le=!1}function ac(){var e=un;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),un=null),e}function As(e){un===null?un=[e]:un.push(e)}var nc=S(null),Zn=null,Ga=null;function fn(e,t,n){Q(nc,t._currentValue),t._currentValue=n}function Qa(e){e._currentValue=nc.current,L(nc)}function rc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function sc(e,t,n,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var p=c.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=c;for(var T=0;T<t.length;T++)if(b.context===t[T]){u.lanes|=n,b=u.alternate,b!==null&&(b.lanes|=n),rc(u.return,n,e),r||(p=null);break e}u=b.next}}else if(c.tag===18){if(p=c.return,p===null)throw Error(i(341));p.lanes|=n,u=p.alternate,u!==null&&(u.lanes|=n),rc(p,n,e),p=null}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===e){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}}function zr(e,t,n,r){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var p=c.alternate;if(p===null)throw Error(i(387));if(p=p.memoizedProps,p!==null){var b=c.type;Pt(c.pendingProps.value,p.value)||(e!==null?e.push(b):e=[b])}}else if(c===ce.current){if(p=c.alternate,p===null)throw Error(i(387));p.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(sl):e=[sl])}c=c.return}e!==null&&sc(t,e,n,r),t.flags|=262144}function Fl(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Jn(e){Zn=e,Ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return Yf(Zn,e)}function Yl(e,t){return Zn===null&&Jn(e),Yf(e,t)}function Yf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ga===null){if(e===null)throw Error(i(308));Ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ga=Ga.next=t;return n}var Ny=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},jy=a.unstable_scheduleCallback,Sy=a.unstable_NormalPriority,rt={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lc(){return{controller:new Ny,data:new Map,refCount:0}}function Os(e){e.refCount--,e.refCount===0&&jy(Sy,function(){e.controller.abort()})}var zs=null,oc=0,Dr=0,Ur=null;function wy(e,t){if(zs===null){var n=zs=[];oc=0,Dr=uu(),Ur={status:"pending",value:void 0,then:function(r){n.push(r)}}}return oc++,t.then(Xf,Xf),t}function Xf(){if(--oc===0&&zs!==null){Ur!==null&&(Ur.status="fulfilled");var e=zs;zs=null,Dr=0,Ur=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ey(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),r}var Kf=C.S;C.S=function(e,t){kh=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wy(e,t),Kf!==null&&Kf(e,t)};var Pn=S(null);function ic(){var e=Pn.current;return e!==null?e:Xe.pooledCache}function Xl(e,t){t===null?Q(Pn,Pn.current):Q(Pn,t.pool)}function $f(){var e=ic();return e===null?null:{parent:rt._currentValue,pool:e}}var Lr=Error(i(460)),cc=Error(i(474)),Kl=Error(i(542)),$l={then:function(){}};function Zf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Jf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(La,La),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,If(e),e;default:if(typeof t.status=="string")t.then(La,La);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,If(e),e}throw Wn=t,Lr}}function In(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Wn=n,Lr):n}}var Wn=null;function Pf(){if(Wn===null)throw Error(i(459));var e=Wn;return Wn=null,e}function If(e){if(e===Lr||e===Kl)throw Error(i(483))}var Br=null,Ds=0;function Zl(e){var t=Ds;return Ds+=1,Br===null&&(Br=[]),Jf(Br,e,t)}function Us(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Jl(e,t){throw t.$$typeof===j?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Wf(e){function t(O,R){if(e){var q=O.deletions;q===null?(O.deletions=[R],O.flags|=16):q.push(R)}}function n(O,R){if(!e)return null;for(;R!==null;)t(O,R),R=R.sibling;return null}function r(O){for(var R=new Map;O!==null;)O.key!==null?R.set(O.key,O):R.set(O.index,O),O=O.sibling;return R}function c(O,R){return O=qa(O,R),O.index=0,O.sibling=null,O}function u(O,R,q){return O.index=q,e?(q=O.alternate,q!==null?(q=q.index,q<R?(O.flags|=67108866,R):q):(O.flags|=67108866,R)):(O.flags|=1048576,R)}function p(O){return e&&O.alternate===null&&(O.flags|=67108866),O}function b(O,R,q,J){return R===null||R.tag!==6?(R=Pi(q,O.mode,J),R.return=O,R):(R=c(R,q),R.return=O,R)}function T(O,R,q,J){var ye=q.type;return ye===E?$(O,R,q.props.children,J,q.key):R!==null&&(R.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===z&&In(ye)===R.type)?(R=c(R,q.props),Us(R,q),R.return=O,R):(R=Ql(q.type,q.key,q.props,null,O.mode,J),Us(R,q),R.return=O,R)}function H(O,R,q,J){return R===null||R.tag!==4||R.stateNode.containerInfo!==q.containerInfo||R.stateNode.implementation!==q.implementation?(R=Ii(q,O.mode,J),R.return=O,R):(R=c(R,q.children||[]),R.return=O,R)}function $(O,R,q,J,ye){return R===null||R.tag!==7?(R=Kn(q,O.mode,J,ye),R.return=O,R):(R=c(R,q),R.return=O,R)}function P(O,R,q){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Pi(""+R,O.mode,q),R.return=O,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case M:return q=Ql(R.type,R.key,R.props,null,O.mode,q),Us(q,R),q.return=O,q;case w:return R=Ii(R,O.mode,q),R.return=O,R;case z:return R=In(R),P(O,R,q)}if(ne(R)||pe(R))return R=Kn(R,O.mode,q,null),R.return=O,R;if(typeof R.then=="function")return P(O,Zl(R),q);if(R.$$typeof===X)return P(O,Yl(O,R),q);Jl(O,R)}return null}function G(O,R,q,J){var ye=R!==null?R.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return ye!==null?null:b(O,R,""+q,J);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case M:return q.key===ye?T(O,R,q,J):null;case w:return q.key===ye?H(O,R,q,J):null;case z:return q=In(q),G(O,R,q,J)}if(ne(q)||pe(q))return ye!==null?null:$(O,R,q,J,null);if(typeof q.then=="function")return G(O,R,Zl(q),J);if(q.$$typeof===X)return G(O,R,Yl(O,q),J);Jl(O,q)}return null}function V(O,R,q,J,ye){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return O=O.get(q)||null,b(R,O,""+J,ye);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case M:return O=O.get(J.key===null?q:J.key)||null,T(R,O,J,ye);case w:return O=O.get(J.key===null?q:J.key)||null,H(R,O,J,ye);case z:return J=In(J),V(O,R,q,J,ye)}if(ne(J)||pe(J))return O=O.get(q)||null,$(R,O,J,ye,null);if(typeof J.then=="function")return V(O,R,q,Zl(J),ye);if(J.$$typeof===X)return V(O,R,q,Yl(R,J),ye);Jl(R,J)}return null}function ie(O,R,q,J){for(var ye=null,Be=null,me=R,ke=R=0,Ue=null;me!==null&&ke<q.length;ke++){me.index>ke?(Ue=me,me=null):Ue=me.sibling;var qe=G(O,me,q[ke],J);if(qe===null){me===null&&(me=Ue);break}e&&me&&qe.alternate===null&&t(O,me),R=u(qe,R,ke),Be===null?ye=qe:Be.sibling=qe,Be=qe,me=Ue}if(ke===q.length)return n(O,me),Le&&Ha(O,ke),ye;if(me===null){for(;ke<q.length;ke++)me=P(O,q[ke],J),me!==null&&(R=u(me,R,ke),Be===null?ye=me:Be.sibling=me,Be=me);return Le&&Ha(O,ke),ye}for(me=r(me);ke<q.length;ke++)Ue=V(me,O,ke,q[ke],J),Ue!==null&&(e&&Ue.alternate!==null&&me.delete(Ue.key===null?ke:Ue.key),R=u(Ue,R,ke),Be===null?ye=Ue:Be.sibling=Ue,Be=Ue);return e&&me.forEach(function(kn){return t(O,kn)}),Le&&Ha(O,ke),ye}function je(O,R,q,J){if(q==null)throw Error(i(151));for(var ye=null,Be=null,me=R,ke=R=0,Ue=null,qe=q.next();me!==null&&!qe.done;ke++,qe=q.next()){me.index>ke?(Ue=me,me=null):Ue=me.sibling;var kn=G(O,me,qe.value,J);if(kn===null){me===null&&(me=Ue);break}e&&me&&kn.alternate===null&&t(O,me),R=u(kn,R,ke),Be===null?ye=kn:Be.sibling=kn,Be=kn,me=Ue}if(qe.done)return n(O,me),Le&&Ha(O,ke),ye;if(me===null){for(;!qe.done;ke++,qe=q.next())qe=P(O,qe.value,J),qe!==null&&(R=u(qe,R,ke),Be===null?ye=qe:Be.sibling=qe,Be=qe);return Le&&Ha(O,ke),ye}for(me=r(me);!qe.done;ke++,qe=q.next())qe=V(me,O,ke,qe.value,J),qe!==null&&(e&&qe.alternate!==null&&me.delete(qe.key===null?ke:qe.key),R=u(qe,R,ke),Be===null?ye=qe:Be.sibling=qe,Be=qe);return e&&me.forEach(function(Ub){return t(O,Ub)}),Le&&Ha(O,ke),ye}function Ye(O,R,q,J){if(typeof q=="object"&&q!==null&&q.type===E&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case M:e:{for(var ye=q.key;R!==null;){if(R.key===ye){if(ye=q.type,ye===E){if(R.tag===7){n(O,R.sibling),J=c(R,q.props.children),J.return=O,O=J;break e}}else if(R.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===z&&In(ye)===R.type){n(O,R.sibling),J=c(R,q.props),Us(J,q),J.return=O,O=J;break e}n(O,R);break}else t(O,R);R=R.sibling}q.type===E?(J=Kn(q.props.children,O.mode,J,q.key),J.return=O,O=J):(J=Ql(q.type,q.key,q.props,null,O.mode,J),Us(J,q),J.return=O,O=J)}return p(O);case w:e:{for(ye=q.key;R!==null;){if(R.key===ye)if(R.tag===4&&R.stateNode.containerInfo===q.containerInfo&&R.stateNode.implementation===q.implementation){n(O,R.sibling),J=c(R,q.children||[]),J.return=O,O=J;break e}else{n(O,R);break}else t(O,R);R=R.sibling}J=Ii(q,O.mode,J),J.return=O,O=J}return p(O);case z:return q=In(q),Ye(O,R,q,J)}if(ne(q))return ie(O,R,q,J);if(pe(q)){if(ye=pe(q),typeof ye!="function")throw Error(i(150));return q=ye.call(q),je(O,R,q,J)}if(typeof q.then=="function")return Ye(O,R,Zl(q),J);if(q.$$typeof===X)return Ye(O,R,Yl(O,q),J);Jl(O,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,R!==null&&R.tag===6?(n(O,R.sibling),J=c(R,q),J.return=O,O=J):(n(O,R),J=Pi(q,O.mode,J),J.return=O,O=J),p(O)):n(O,R)}return function(O,R,q,J){try{Ds=0;var ye=Ye(O,R,q,J);return Br=null,ye}catch(me){if(me===Lr||me===Kl)throw me;var Be=It(29,me,null,O.mode);return Be.lanes=J,Be.return=O,Be}}}var er=Wf(!0),em=Wf(!1),mn=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function hn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(He&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=Gl(e),Lf(e,null,n),t}return Hl(e,r,t,n),Gl(e)}function Ls(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}function fc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var c=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var p={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=p:u=u.next=p,n=n.next}while(n!==null);u===null?c=u=t:u=u.next=t}else c=u=t;n={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var mc=!1;function Bs(){if(mc){var e=Ur;if(e!==null)throw e}}function qs(e,t,n,r){mc=!1;var c=e.updateQueue;mn=!1;var u=c.firstBaseUpdate,p=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var T=b,H=T.next;T.next=null,p===null?u=H:p.next=H,p=T;var $=e.alternate;$!==null&&($=$.updateQueue,b=$.lastBaseUpdate,b!==p&&(b===null?$.firstBaseUpdate=H:b.next=H,$.lastBaseUpdate=T))}if(u!==null){var P=c.baseState;p=0,$=H=T=null,b=u;do{var G=b.lane&-536870913,V=G!==b.lane;if(V?(De&G)===G:(r&G)===G){G!==0&&G===Dr&&(mc=!0),$!==null&&($=$.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ie=e,je=b;G=t;var Ye=n;switch(je.tag){case 1:if(ie=je.payload,typeof ie=="function"){P=ie.call(Ye,P,G);break e}P=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=je.payload,G=typeof ie=="function"?ie.call(Ye,P,G):ie,G==null)break e;P=x({},P,G);break e;case 2:mn=!0}}G=b.callback,G!==null&&(e.flags|=64,V&&(e.flags|=8192),V=c.callbacks,V===null?c.callbacks=[G]:V.push(G))}else V={lane:G,tag:b.tag,payload:b.payload,callback:b.callback,next:null},$===null?(H=$=V,T=P):$=$.next=V,p|=G;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;V=b,b=V.next,V.next=null,c.lastBaseUpdate=V,c.shared.pending=null}}while(!0);$===null&&(T=P),c.baseState=T,c.firstBaseUpdate=H,c.lastBaseUpdate=$,u===null&&(c.shared.lanes=0),bn|=p,e.lanes=p,e.memoizedState=P}}function tm(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function am(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)tm(n[e],t)}var qr=S(null),Pl=S(0);function nm(e,t){e=Pa,Q(Pl,e),Q(qr,t),Pa=e|t.baseLanes}function hc(){Q(Pl,Pa),Q(qr,qr.current)}function pc(){Pa=Pl.current,L(qr),L(Pl)}var Wt=S(null),ma=null;function xn(e){var t=e.alternate;Q(tt,tt.current&1),Q(Wt,e),ma===null&&(t===null||qr.current!==null||t.memoizedState!==null)&&(ma=e)}function xc(e){Q(tt,tt.current),Q(Wt,e),ma===null&&(ma=e)}function rm(e){e.tag===22?(Q(tt,tt.current),Q(Wt,e),ma===null&&(ma=e)):vn()}function vn(){Q(tt,tt.current),Q(Wt,Wt.current)}function ea(e){L(Wt),ma===e&&(ma=null),L(tt)}var tt=S(0);function Il(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ju(n)||Su(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Va=0,Re=null,Ve=null,st=null,Wl=!1,Hr=!1,tr=!1,eo=0,Hs=0,Gr=null,Cy=0;function We(){throw Error(i(321))}function vc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function gc(e,t,n,r,c,u){return Va=u,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?Gm:Oc,tr=!1,u=n(r,c),tr=!1,Hr&&(u=lm(t,n,r,c)),sm(e),u}function sm(e){C.H=Vs;var t=Ve!==null&&Ve.next!==null;if(Va=0,st=Ve=Re=null,Wl=!1,Hs=0,Gr=null,t)throw Error(i(300));e===null||lt||(e=e.dependencies,e!==null&&Fl(e)&&(lt=!0))}function lm(e,t,n,r){Re=e;var c=0;do{if(Hr&&(Gr=null),Hs=0,Hr=!1,25<=c)throw Error(i(301));if(c+=1,st=Ve=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}C.H=Qm,u=t(n,r)}while(Hr);return u}function Ty(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Gs(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Re.flags|=1024),t}function yc(){var e=eo!==0;return eo=0,e}function bc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Nc(e){if(Wl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wl=!1}Va=0,st=Ve=Re=null,Hr=!1,Hs=eo=0,Gr=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?Re.memoizedState=st=e:st=st.next=e,st}function at(){if(Ve===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=st===null?Re.memoizedState:st.next;if(t!==null)st=t,Ve=e;else{if(e===null)throw Re.alternate===null?Error(i(467)):Error(i(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},st===null?Re.memoizedState=st=e:st=st.next=e}return st}function to(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gs(e){var t=Hs;return Hs+=1,Gr===null&&(Gr=[]),e=Jf(Gr,e,t),t=Re,(st===null?t.memoizedState:st.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?Gm:Oc),e}function ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gs(e);if(e.$$typeof===X)return St(e)}throw Error(i(438,String(e)))}function jc(e){var t=null,n=Re.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Re.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=to(),Re.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=be;return t.index++,n}function Fa(e,t){return typeof t=="function"?t(e):t}function no(e){var t=at();return Sc(t,Ve,e)}function Sc(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var c=e.baseQueue,u=r.pending;if(u!==null){if(c!==null){var p=c.next;c.next=u.next,u.next=p}t.baseQueue=c=u,r.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var b=p=null,T=null,H=t,$=!1;do{var P=H.lane&-536870913;if(P!==H.lane?(De&P)===P:(Va&P)===P){var G=H.revertLane;if(G===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),P===Dr&&($=!0);else if((Va&G)===G){H=H.next,G===Dr&&($=!0);continue}else P={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},T===null?(b=T=P,p=u):T=T.next=P,Re.lanes|=G,bn|=G;P=H.action,tr&&n(u,P),u=H.hasEagerState?H.eagerState:n(u,P)}else G={lane:P,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},T===null?(b=T=G,p=u):T=T.next=G,Re.lanes|=P,bn|=P;H=H.next}while(H!==null&&H!==t);if(T===null?p=u:T.next=b,!Pt(u,e.memoizedState)&&(lt=!0,$&&(n=Ur,n!==null)))throw n;e.memoizedState=u,e.baseState=p,e.baseQueue=T,r.lastRenderedState=u}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function wc(e){var t=at(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,c=n.pending,u=t.memoizedState;if(c!==null){n.pending=null;var p=c=c.next;do u=e(u,p.action),p=p.next;while(p!==c);Pt(u,t.memoizedState)||(lt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,r]}function om(e,t,n){var r=Re,c=at(),u=Le;if(u){if(n===void 0)throw Error(i(407));n=n()}else n=t();var p=!Pt((Ve||c).memoizedState,n);if(p&&(c.memoizedState=n,lt=!0),c=c.queue,Tc(um.bind(null,r,c,e),[e]),c.getSnapshot!==t||p||st!==null&&st.memoizedState.tag&1){if(r.flags|=2048,Qr(9,{destroy:void 0},cm.bind(null,r,c,n,t),null),Xe===null)throw Error(i(349));u||(Va&127)!==0||im(r,t,n)}return n}function im(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t=to(),Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cm(e,t,n,r){t.value=n,t.getSnapshot=r,dm(t)&&fm(e)}function um(e,t,n){return n(function(){dm(t)&&fm(e)})}function dm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function fm(e){var t=Xn(e,2);t!==null&&Xt(t,e,2)}function Ec(e){var t=zt();if(typeof e=="function"){var n=e;if(e=n(),tr){ga(!0);try{n()}finally{ga(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:e},t}function mm(e,t,n,r){return e.baseState=n,Sc(e,Ve,typeof r=="function"?r:Fa)}function _y(e,t,n,r,c){if(lo(e))throw Error(i(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){u.listeners.push(p)}};C.T!==null?n(!0):u.isTransition=!1,r(u),n=t.pending,n===null?(u.next=t.pending=u,hm(t,u)):(u.next=n.next,t.pending=n.next=u)}}function hm(e,t){var n=t.action,r=t.payload,c=e.state;if(t.isTransition){var u=C.T,p={};C.T=p;try{var b=n(c,r),T=C.S;T!==null&&T(p,b),pm(e,t,b)}catch(H){Cc(e,t,H)}finally{u!==null&&p.types!==null&&(u.types=p.types),C.T=u}}else try{u=n(c,r),pm(e,t,u)}catch(H){Cc(e,t,H)}}function pm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){xm(e,t,r)},function(r){return Cc(e,t,r)}):xm(e,t,n)}function xm(e,t,n){t.status="fulfilled",t.value=n,vm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,hm(e,n)))}function Cc(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,vm(t),t=t.next;while(t!==r)}e.action=null}function vm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function gm(e,t){return t}function ym(e,t){if(Le){var n=Xe.formState;if(n!==null){e:{var r=Re;if(Le){if(Ke){t:{for(var c=Ke,u=fa;c.nodeType!==8;){if(!u){c=null;break t}if(c=ha(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ke=ha(c.nextSibling),r=c.data==="F!";break e}}dn(r)}r=!1}r&&(t=n[0])}}return n=zt(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gm,lastRenderedState:t},n.queue=r,n=Bm.bind(null,Re,r),r.dispatch=n,r=Ec(!1),u=Ac.bind(null,Re,!1,r.queue),r=zt(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,n=_y.bind(null,Re,c,u,n),c.dispatch=n,r.memoizedState=e,[t,n,!1]}function bm(e){var t=at();return Nm(t,Ve,e)}function Nm(e,t,n){if(t=Sc(e,t,gm)[0],e=no(Fa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Gs(t)}catch(p){throw p===Lr?Kl:p}else r=t;t=at();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(Re.flags|=2048,Qr(9,{destroy:void 0},Ry.bind(null,c,n),null)),[r,u,e]}function Ry(e,t){e.action=t}function jm(e){var t=at(),n=Ve;if(n!==null)return Nm(t,n,e);at(),t=t.memoizedState,n=at();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qr(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Re.updateQueue,t===null&&(t=to(),Re.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Sm(){return at().memoizedState}function ro(e,t,n,r){var c=zt();Re.flags|=e,c.memoizedState=Qr(1|t,{destroy:void 0},n,r===void 0?null:r)}function so(e,t,n,r){var c=at();r=r===void 0?null:r;var u=c.memoizedState.inst;Ve!==null&&r!==null&&vc(r,Ve.memoizedState.deps)?c.memoizedState=Qr(t,u,n,r):(Re.flags|=e,c.memoizedState=Qr(1|t,u,n,r))}function wm(e,t){ro(8390656,8,e,t)}function Tc(e,t){so(2048,8,e,t)}function ky(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=to(),Re.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Em(e){var t=at().memoizedState;return ky({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Cm(e,t){return so(4,2,e,t)}function Tm(e,t){return so(4,4,e,t)}function _m(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rm(e,t,n){n=n!=null?n.concat([e]):null,so(4,4,_m.bind(null,t,e),n)}function _c(){}function km(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Mm(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vc(t,r[1]))return r[0];if(r=e(),tr){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r}function Rc(e,t,n){return n===void 0||(Va&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Ah(),Re.lanes|=e,bn|=e,n)}function Am(e,t,n,r){return Pt(n,t)?n:qr.current!==null?(e=Rc(e,n,r),Pt(e,t)||(lt=!0),e):(Va&42)===0||(Va&1073741824)!==0&&(De&261930)===0?(lt=!0,e.memoizedState=n):(e=Ah(),Re.lanes|=e,bn|=e,t)}function Om(e,t,n,r,c){var u=Y.p;Y.p=u!==0&&8>u?u:8;var p=C.T,b={};C.T=b,Ac(e,!1,t,n);try{var T=c(),H=C.S;if(H!==null&&H(b,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var $=Ey(T,r);Qs(e,t,$,na(e))}else Qs(e,t,r,na(e))}catch(P){Qs(e,t,{then:function(){},status:"rejected",reason:P},na())}finally{Y.p=u,p!==null&&b.types!==null&&(p.types=b.types),C.T=p}}function My(){}function kc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var c=zm(e).queue;Om(e,c,t,K,n===null?My:function(){return Dm(e),n(r)})}function zm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:K},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dm(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),Qs(e,t.next.queue,{},na())}function Mc(){return St(sl)}function Um(){return at().memoizedState}function Lm(){return at().memoizedState}function Ay(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=na();e=hn(n);var r=pn(t,e,n);r!==null&&(Xt(r,t,n),Ls(r,t,n)),t={cache:lc()},e.payload=t;return}t=t.return}}function Oy(e,t,n){var r=na();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lo(e)?qm(t,n):(n=Zi(e,t,n,r),n!==null&&(Xt(n,e,r),Hm(n,t,r)))}function Bm(e,t,n){var r=na();Qs(e,t,n,r)}function Qs(e,t,n,r){var c={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lo(e))qm(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var p=t.lastRenderedState,b=u(p,n);if(c.hasEagerState=!0,c.eagerState=b,Pt(b,p))return Hl(e,t,c,0),Xe===null&&ql(),!1}catch{}if(n=Zi(e,t,c,r),n!==null)return Xt(n,e,r),Hm(n,t,r),!0}return!1}function Ac(e,t,n,r){if(r={lane:2,revertLane:uu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lo(e)){if(t)throw Error(i(479))}else t=Zi(e,n,r,2),t!==null&&Xt(t,e,2)}function lo(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function qm(e,t){Hr=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hm(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}var Vs={readContext:St,use:ao,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};Vs.useEffectEvent=We;var Gm={readContext:St,use:ao,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:wm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ro(4194308,4,_m.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){ro(4,2,e,t)},useMemo:function(e,t){var n=zt();t=t===void 0?null:t;var r=e();if(tr){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zt();if(n!==void 0){var c=n(t);if(tr){ga(!0);try{n(t)}finally{ga(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=Oy.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ec(e);var t=e.queue,n=Bm.bind(null,Re,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_c,useDeferredValue:function(e,t){var n=zt();return Rc(n,e,t)},useTransition:function(){var e=Ec(!1);return e=Om.bind(null,Re,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Re,c=zt();if(Le){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xe===null)throw Error(i(349));(De&127)!==0||im(r,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,wm(um.bind(null,r,u,e),[e]),r.flags|=2048,Qr(9,{destroy:void 0},cm.bind(null,r,u,n,t),null),n},useId:function(){var e=zt(),t=Xe.identifierPrefix;if(Le){var n=Ra,r=_a;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=eo++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Cy++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mc,useFormState:ym,useActionState:ym,useOptimistic:function(e){var t=zt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ac.bind(null,Re,!0,n),n.dispatch=t,[e,t]},useMemoCache:jc,useCacheRefresh:function(){return zt().memoizedState=Ay.bind(null,Re)},useEffectEvent:function(e){var t=zt(),n={impl:e};return t.memoizedState=n,function(){if((He&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Oc={readContext:St,use:ao,useCallback:km,useContext:St,useEffect:Tc,useImperativeHandle:Rm,useInsertionEffect:Cm,useLayoutEffect:Tm,useMemo:Mm,useReducer:no,useRef:Sm,useState:function(){return no(Fa)},useDebugValue:_c,useDeferredValue:function(e,t){var n=at();return Am(n,Ve.memoizedState,e,t)},useTransition:function(){var e=no(Fa)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:om,useId:Um,useHostTransitionStatus:Mc,useFormState:bm,useActionState:bm,useOptimistic:function(e,t){var n=at();return mm(n,Ve,e,t)},useMemoCache:jc,useCacheRefresh:Lm};Oc.useEffectEvent=Em;var Qm={readContext:St,use:ao,useCallback:km,useContext:St,useEffect:Tc,useImperativeHandle:Rm,useInsertionEffect:Cm,useLayoutEffect:Tm,useMemo:Mm,useReducer:wc,useRef:Sm,useState:function(){return wc(Fa)},useDebugValue:_c,useDeferredValue:function(e,t){var n=at();return Ve===null?Rc(n,e,t):Am(n,Ve.memoizedState,e,t)},useTransition:function(){var e=wc(Fa)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:om,useId:Um,useHostTransitionStatus:Mc,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var n=at();return Ve!==null?mm(n,Ve,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:jc,useCacheRefresh:Lm};Qm.useEffectEvent=Em;function zc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:x({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Dc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=na(),c=hn(r);c.payload=t,n!=null&&(c.callback=n),t=pn(e,c,r),t!==null&&(Xt(t,e,r),Ls(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=na(),c=hn(r);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=pn(e,c,r),t!==null&&(Xt(t,e,r),Ls(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=na(),r=hn(n);r.tag=2,t!=null&&(r.callback=t),t=pn(e,r,n),t!==null&&(Xt(t,e,n),Ls(t,e,n))}};function Vm(e,t,n,r,c,u,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,p):t.prototype&&t.prototype.isPureReactComponent?!Rs(n,r)||!Rs(c,u):!0}function Fm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Dc.enqueueReplaceState(t,t.state,null)}function ar(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=x({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Ym(e){Bl(e)}function Xm(e){console.error(e)}function Km(e){Bl(e)}function oo(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function $m(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Uc(e,t,n){return n=hn(n),n.tag=3,n.payload={element:null},n.callback=function(){oo(e,t)},n}function Zm(e){return e=hn(e),e.tag=3,e}function Jm(e,t,n,r){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var u=r.value;e.payload=function(){return c(u)},e.callback=function(){$m(t,n,r)}}var p=n.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){$m(t,n,r),typeof c!="function"&&(Nn===null?Nn=new Set([this]):Nn.add(this));var b=r.stack;this.componentDidCatch(r.value,{componentStack:b!==null?b:""})})}function zy(e,t,n,r,c){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&zr(t,n,c,!0),n=Wt.current,n!==null){switch(n.tag){case 31:case 13:return ma===null?bo():n.alternate===null&&et===0&&(et=3),n.flags&=-257,n.flags|=65536,n.lanes=c,r===$l?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ou(e,r,c)),!1;case 22:return n.flags|=65536,r===$l?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ou(e,r,c)),!1}throw Error(i(435,n.tag))}return ou(e,r,c),bo(),!1}if(Le)return t=Wt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==tc&&(e=Error(i(422),{cause:r}),As(ca(e,n)))):(r!==tc&&(t=Error(i(423),{cause:r}),As(ca(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=ca(r,n),c=Uc(e.stateNode,r,c),fc(e,c),et!==4&&(et=2)),!1;var u=Error(i(520),{cause:r});if(u=ca(u,n),Ps===null?Ps=[u]:Ps.push(u),et!==4&&(et=2),t===null)return!0;r=ca(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=Uc(n.stateNode,r,e),fc(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Nn===null||!Nn.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Zm(c),Jm(c,e,n,r),fc(n,c),!1}n=n.return}while(n!==null);return!1}var Lc=Error(i(461)),lt=!1;function wt(e,t,n,r){t.child=e===null?em(t,null,n,r):er(t,e.child,n,r)}function Pm(e,t,n,r,c){n=n.render;var u=t.ref;if("ref"in r){var p={};for(var b in r)b!=="ref"&&(p[b]=r[b])}else p=r;return Jn(t),r=gc(e,t,n,p,u,c),b=yc(),e!==null&&!lt?(bc(e,t,c),Ya(e,t,c)):(Le&&b&&Wi(t),t.flags|=1,wt(e,t,r,c),t.child)}function Im(e,t,n,r,c){if(e===null){var u=n.type;return typeof u=="function"&&!Ji(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Wm(e,t,u,r,c)):(e=Ql(n.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Yc(e,c)){var p=u.memoizedProps;if(n=n.compare,n=n!==null?n:Rs,n(p,r)&&e.ref===t.ref)return Ya(e,t,c)}return t.flags|=1,e=qa(u,r),e.ref=t.ref,e.return=t,t.child=e}function Wm(e,t,n,r,c){if(e!==null){var u=e.memoizedProps;if(Rs(u,r)&&e.ref===t.ref)if(lt=!1,t.pendingProps=r=u,Yc(e,c))(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,Ya(e,t,c)}return Bc(e,t,n,r,c)}function eh(e,t,n,r){var c=r.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~u}else r=0,t.child=null;return th(e,t,u,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xl(t,u!==null?u.cachePool:null),u!==null?nm(t,u):hc(),rm(t);else return r=t.lanes=536870912,th(e,t,u!==null?u.baseLanes|n:n,n,r)}else u!==null?(Xl(t,u.cachePool),nm(t,u),vn(),t.memoizedState=null):(e!==null&&Xl(t,null),hc(),vn());return wt(e,t,c,n),t.child}function Fs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function th(e,t,n,r,c){var u=ic();return u=u===null?null:{parent:rt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Xl(t,null),hc(),rm(t),e!==null&&zr(e,t,r,!0),t.childLanes=c,null}function io(e,t){return t=uo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ah(e,t,n){return er(t,e.child,null,n),e=io(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function Dy(e,t,n){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(r.mode==="hidden")return e=io(t,r),t.lanes=536870912,Fs(null,e);if(xc(t),(e=Ke)?(e=hp(e,fa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cn!==null?{id:_a,overflow:Ra}:null,retryLane:536870912,hydrationErrors:null},n=qf(e),n.return=t,t.child=n,jt=t,Ke=null)):e=null,e===null)throw dn(t);return t.lanes=536870912,null}return io(t,r)}var u=e.memoizedState;if(u!==null){var p=u.dehydrated;if(xc(t),c)if(t.flags&256)t.flags&=-257,t=ah(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(lt||zr(e,t,n,!1),c=(n&e.childLanes)!==0,lt||c){if(r=Xe,r!==null&&(p=qt(r,n),p!==0&&p!==u.retryLane))throw u.retryLane=p,Xn(e,p),Xt(r,e,p),Lc;bo(),t=ah(e,t,n)}else e=u.treeContext,Ke=ha(p.nextSibling),jt=t,Le=!0,un=null,fa=!1,e!==null&&Qf(t,e),t=io(t,r),t.flags|=4096;return t}return e=qa(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function co(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,r,c){return Jn(t),n=gc(e,t,n,r,void 0,c),r=yc(),e!==null&&!lt?(bc(e,t,c),Ya(e,t,c)):(Le&&r&&Wi(t),t.flags|=1,wt(e,t,n,c),t.child)}function nh(e,t,n,r,c,u){return Jn(t),t.updateQueue=null,n=lm(t,r,n,c),sm(e),r=yc(),e!==null&&!lt?(bc(e,t,u),Ya(e,t,u)):(Le&&r&&Wi(t),t.flags|=1,wt(e,t,n,u),t.child)}function rh(e,t,n,r,c){if(Jn(t),t.stateNode===null){var u=kr,p=n.contextType;typeof p=="object"&&p!==null&&(u=St(p)),u=new n(r,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Dc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=r,u.state=t.memoizedState,u.refs={},uc(t),p=n.contextType,u.context=typeof p=="object"&&p!==null?St(p):kr,u.state=t.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(zc(t,n,p,r),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(p=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),p!==u.state&&Dc.enqueueReplaceState(u,u.state,null),qs(t,r,u,c),Bs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,T=ar(n,b);u.props=T;var H=u.context,$=n.contextType;p=kr,typeof $=="object"&&$!==null&&(p=St($));var P=n.getDerivedStateFromProps;$=typeof P=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,$||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||H!==p)&&Fm(t,u,r,p),mn=!1;var G=t.memoizedState;u.state=G,qs(t,r,u,c),Bs(),H=t.memoizedState,b||G!==H||mn?(typeof P=="function"&&(zc(t,n,P,r),H=t.memoizedState),(T=mn||Vm(t,n,T,r,G,H,p))?($||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=H),u.props=r,u.state=H,u.context=p,r=T):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,dc(e,t),p=t.memoizedProps,$=ar(n,p),u.props=$,P=t.pendingProps,G=u.context,H=n.contextType,T=kr,typeof H=="object"&&H!==null&&(T=St(H)),b=n.getDerivedStateFromProps,(H=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==P||G!==T)&&Fm(t,u,r,T),mn=!1,G=t.memoizedState,u.state=G,qs(t,r,u,c),Bs();var V=t.memoizedState;p!==P||G!==V||mn||e!==null&&e.dependencies!==null&&Fl(e.dependencies)?(typeof b=="function"&&(zc(t,n,b,r),V=t.memoizedState),($=mn||Vm(t,n,$,r,G,V,T)||e!==null&&e.dependencies!==null&&Fl(e.dependencies))?(H||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,V,T),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,V,T)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=V),u.props=r,u.state=V,u.context=T,r=$):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),r=!1)}return u=r,co(e,t),r=(t.flags&128)!==0,u||r?(u=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&r?(t.child=er(t,e.child,null,c),t.child=er(t,null,n,c)):wt(e,t,n,c),t.memoizedState=u.state,e=t.child):e=Ya(e,t,c),e}function sh(e,t,n,r){return $n(),t.flags|=256,wt(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hc(e){return{baseLanes:e,cachePool:$f()}}function Gc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=aa),e}function lh(e,t,n){var r=t.pendingProps,c=!1,u=(t.flags&128)!==0,p;if((p=u)||(p=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),p&&(c=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?xn(t):vn(),(e=Ke)?(e=hp(e,fa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cn!==null?{id:_a,overflow:Ra}:null,retryLane:536870912,hydrationErrors:null},n=qf(e),n.return=t,t.child=n,jt=t,Ke=null)):e=null,e===null)throw dn(t);return Su(e)?t.lanes=32:t.lanes=536870912,null}var b=r.children;return r=r.fallback,c?(vn(),c=t.mode,b=uo({mode:"hidden",children:b},c),r=Kn(r,c,n,null),b.return=t,r.return=t,b.sibling=r,t.child=b,r=t.child,r.memoizedState=Hc(n),r.childLanes=Gc(e,p,n),t.memoizedState=qc,Fs(null,r)):(xn(t),Qc(t,b))}var T=e.memoizedState;if(T!==null&&(b=T.dehydrated,b!==null)){if(u)t.flags&256?(xn(t),t.flags&=-257,t=Vc(e,t,n)):t.memoizedState!==null?(vn(),t.child=e.child,t.flags|=128,t=null):(vn(),b=r.fallback,c=t.mode,r=uo({mode:"visible",children:r.children},c),b=Kn(b,c,n,null),b.flags|=2,r.return=t,b.return=t,r.sibling=b,t.child=r,er(t,e.child,null,n),r=t.child,r.memoizedState=Hc(n),r.childLanes=Gc(e,p,n),t.memoizedState=qc,t=Fs(null,r));else if(xn(t),Su(b)){if(p=b.nextSibling&&b.nextSibling.dataset,p)var H=p.dgst;p=H,r=Error(i(419)),r.stack="",r.digest=p,As({value:r,source:null,stack:null}),t=Vc(e,t,n)}else if(lt||zr(e,t,n,!1),p=(n&e.childLanes)!==0,lt||p){if(p=Xe,p!==null&&(r=qt(p,n),r!==0&&r!==T.retryLane))throw T.retryLane=r,Xn(e,r),Xt(p,e,r),Lc;ju(b)||bo(),t=Vc(e,t,n)}else ju(b)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Ke=ha(b.nextSibling),jt=t,Le=!0,un=null,fa=!1,e!==null&&Qf(t,e),t=Qc(t,r.children),t.flags|=4096);return t}return c?(vn(),b=r.fallback,c=t.mode,T=e.child,H=T.sibling,r=qa(T,{mode:"hidden",children:r.children}),r.subtreeFlags=T.subtreeFlags&65011712,H!==null?b=qa(H,b):(b=Kn(b,c,n,null),b.flags|=2),b.return=t,r.return=t,r.sibling=b,t.child=r,Fs(null,r),r=t.child,b=e.child.memoizedState,b===null?b=Hc(n):(c=b.cachePool,c!==null?(T=rt._currentValue,c=c.parent!==T?{parent:T,pool:T}:c):c=$f(),b={baseLanes:b.baseLanes|n,cachePool:c}),r.memoizedState=b,r.childLanes=Gc(e,p,n),t.memoizedState=qc,Fs(e.child,r)):(xn(t),n=e.child,e=n.sibling,n=qa(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=n,t.memoizedState=null,n)}function Qc(e,t){return t=uo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function uo(e,t){return e=It(22,e,null,t),e.lanes=0,e}function Vc(e,t,n){return er(t,e.child,null,n),e=Qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),rc(e.return,t,n)}function Fc(e,t,n,r,c,u){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:c,treeForkCount:u}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=r,p.tail=n,p.tailMode=c,p.treeForkCount=u)}function ih(e,t,n){var r=t.pendingProps,c=r.revealOrder,u=r.tail;r=r.children;var p=tt.current,b=(p&2)!==0;if(b?(p=p&1|2,t.flags|=128):p&=1,Q(tt,p),wt(e,t,r,n),r=Le?Ms:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&oh(e,n,t);else if(e.tag===19)oh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&Il(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Fc(t,!1,c,n,u,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Il(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Fc(t,!0,n,null,u,r);break;case"together":Fc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ya(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(zr(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=qa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Yc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fl(e)))}function Uy(e,t,n){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),fn(t,rt,e.memoizedState.cache),$n();break;case 27:case 5:U(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:fn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,xc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(xn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?lh(e,t,n):(xn(t),e=Ya(e,t,n),e!==null?e.sibling:null);xn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(zr(e,t,n,!1),r=(n&t.childLanes)!==0),c){if(r)return ih(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Q(tt,tt.current),r)break;return null;case 22:return t.lanes=0,eh(e,t,n,t.pendingProps);case 24:fn(t,rt,e.memoizedState.cache)}return Ya(e,t,n)}function ch(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)lt=!0;else{if(!Yc(e,n)&&(t.flags&128)===0)return lt=!1,Uy(e,t,n);lt=(e.flags&131072)!==0}else lt=!1,Le&&(t.flags&1048576)!==0&&Gf(t,Ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=In(t.elementType),t.type=e,typeof e=="function")Ji(e)?(r=ar(e,r),t.tag=1,t=rh(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var c=e.$$typeof;if(c===I){t.tag=11,t=Pm(null,t,e,r,n);break e}else if(c===D){t.tag=14,t=Im(null,t,e,r,n);break e}}throw t=he(e)||e,Error(i(306,t,""))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,c=ar(r,t.pendingProps),rh(e,t,r,c,n);case 3:e:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var u=t.memoizedState;c=u.element,dc(e,t),qs(t,r,null,n);var p=t.memoizedState;if(r=p.cache,fn(t,rt,r),r!==u.cache&&sc(t,[rt],n,!0),Bs(),r=p.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=sh(e,t,r,n);break e}else if(r!==c){c=ca(Error(i(424)),t),As(c),t=sh(e,t,r,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ke=ha(e.firstChild),jt=t,Le=!0,un=null,fa=!0,n=em(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($n(),r===c){t=Ya(e,t,n);break e}wt(e,t,r,n)}t=t.child}return t;case 26:return co(e,t),e===null?(n=bp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Le||(n=t.type,e=t.pendingProps,r=To(fe.current).createElement(n),r[Nt]=t,r[Ht]=e,Et(r,n,e),vt(r),t.stateNode=r):t.memoizedState=bp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return U(t),e===null&&Le&&(r=t.stateNode=vp(t.type,t.pendingProps,fe.current),jt=t,fa=!0,c=Ke,En(t.type)?(wu=c,Ke=ha(r.firstChild)):Ke=c),wt(e,t,t.pendingProps.children,n),co(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=r=Ke)&&(r=fb(r,t.type,t.pendingProps,fa),r!==null?(t.stateNode=r,jt=t,Ke=ha(r.firstChild),fa=!1,c=!0):c=!1),c||dn(t)),U(t),c=t.type,u=t.pendingProps,p=e!==null?e.memoizedProps:null,r=u.children,yu(c,u)?r=null:p!==null&&yu(c,p)&&(t.flags|=32),t.memoizedState!==null&&(c=gc(e,t,Ty,null,null,n),sl._currentValue=c),co(e,t),wt(e,t,r,n),t.child;case 6:return e===null&&Le&&((e=n=Ke)&&(n=mb(n,t.pendingProps,fa),n!==null?(t.stateNode=n,jt=t,Ke=null,e=!0):e=!1),e||dn(t)),null;case 13:return lh(e,t,n);case 4:return Se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=er(t,null,r,n):wt(e,t,r,n),t.child;case 11:return Pm(e,t,t.type,t.pendingProps,n);case 7:return wt(e,t,t.pendingProps,n),t.child;case 8:return wt(e,t,t.pendingProps.children,n),t.child;case 12:return wt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,fn(t,t.type,r.value),wt(e,t,r.children,n),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Jn(t),c=St(c),r=r(c),t.flags|=1,wt(e,t,r,n),t.child;case 14:return Im(e,t,t.type,t.pendingProps,n);case 15:return Wm(e,t,t.type,t.pendingProps,n);case 19:return ih(e,t,n);case 31:return Dy(e,t,n);case 22:return eh(e,t,n,t.pendingProps);case 24:return Jn(t),r=St(rt),e===null?(c=ic(),c===null&&(c=Xe,u=lc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:r,cache:c},uc(t),fn(t,rt,c)):((e.lanes&n)!==0&&(dc(e,t),qs(t,null,null,n),Bs()),c=e.memoizedState,u=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),fn(t,rt,r)):(r=u.cache,fn(t,rt,r),r!==c.cache&&sc(t,[rt],n,!0))),wt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Xa(e){e.flags|=4}function Xc(e,t,n,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Uh())e.flags|=8192;else throw Wn=$l,cc}else e.flags&=-16777217}function uh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ep(t))if(Uh())e.flags|=8192;else throw Wn=$l,cc}function fo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_t():536870912,e.lanes|=t,Xr|=t)}function Ys(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ly(e,t,n){var r=t.pendingProps;switch(ec(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return $e(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qa(rt),B(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Or(t)?Xa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ac())),$e(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Xa(t),u!==null?($e(t),uh(t,u)):($e(t),Xc(t,c,null,r,n))):u?u!==e.memoizedState?(Xa(t),$e(t),uh(t,u)):($e(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Xa(t),$e(t),Xc(t,c,e,r,n)),null;case 27:if(we(t),n=fe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Xa(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return $e(t),null}e=Z.current,Or(t)?Vf(t):(e=vp(c,r,n),t.stateNode=e,Xa(t))}return $e(t),null;case 5:if(we(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Xa(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return $e(t),null}if(u=Z.current,Or(t))Vf(t);else{var p=To(fe.current);switch(u){case 1:u=p.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=p.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=p.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?p.createElement("select",{is:r.is}):p.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?p.createElement(c,{is:r.is}):p.createElement(c)}}u[Nt]=t,u[Ht]=r;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)u.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=u;e:switch(Et(u,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Xa(t)}}return $e(t),Xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Xa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=fe.current,Or(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,c=jt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||lp(e.nodeValue,n)),e||dn(t,!0)}else e=To(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return $e(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Or(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Nt]=t}else $n(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else n=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(i(558))}return $e(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Or(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Nt]=t}else $n(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),c=!1}else c=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==c&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fo(t,t.updateQueue),$e(t),null);case 4:return B(),e===null&&hu(t.stateNode.containerInfo),$e(t),null;case 10:return Qa(t.type),$e(t),null;case 19:if(L(tt),r=t.memoizedState,r===null)return $e(t),null;if(c=(t.flags&128)!==0,u=r.rendering,u===null)if(c)Ys(r,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Il(e),u!==null){for(t.flags|=128,Ys(r,!1),e=u.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Bf(n,e),n=n.sibling;return Q(tt,tt.current&1|2),Le&&Ha(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&At()>vo&&(t.flags|=128,c=!0,Ys(r,!1),t.lanes=4194304)}else{if(!c)if(e=Il(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),Ys(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!Le)return $e(t),null}else 2*At()-r.renderingStartTime>vo&&n!==536870912&&(t.flags|=128,c=!0,Ys(r,!1),t.lanes=4194304);r.isBackwards?(u.sibling=t.child,t.child=u):(e=r.last,e!==null?e.sibling=u:t.child=u,r.last=u)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=At(),e.sibling=null,n=tt.current,Q(tt,c?n&1|2:n&1),Le&&Ha(t,r.treeForkCount),e):($e(t),null);case 22:case 23:return ea(t),pc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),n=t.updateQueue,n!==null&&fo(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&L(Pn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qa(rt),$e(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function By(e,t){switch(ec(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qa(rt),B(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(i(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(tt),null;case 4:return B(),null;case 10:return Qa(t.type),null;case 22:case 23:return ea(t),pc(),e!==null&&L(Pn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qa(rt),null;case 25:return null;default:return null}}function dh(e,t){switch(ec(t),t.tag){case 3:Qa(rt),B();break;case 26:case 27:case 5:we(t);break;case 4:B();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:L(tt);break;case 10:Qa(t.type);break;case 22:case 23:ea(t),pc(),e!==null&&L(Pn);break;case 24:Qa(rt)}}function Xs(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var c=r.next;n=c;do{if((n.tag&e)===e){r=void 0;var u=n.create,p=n.inst;r=u(),p.destroy=r}n=n.next}while(n!==c)}}catch(b){Qe(t,t.return,b)}}function gn(e,t,n){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var u=c.next;r=u;do{if((r.tag&e)===e){var p=r.inst,b=p.destroy;if(b!==void 0){p.destroy=void 0,c=t;var T=n,H=b;try{H()}catch($){Qe(c,T,$)}}}r=r.next}while(r!==u)}}catch($){Qe(t,t.return,$)}}function fh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{am(t,n)}catch(r){Qe(e,e.return,r)}}}function mh(e,t,n){n.props=ar(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Qe(e,t,r)}}function Ks(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(c){Qe(e,t,c)}}function ka(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(c){Qe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){Qe(e,t,c)}else n.current=null}function hh(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(c){Qe(e,e.return,c)}}function Kc(e,t,n){try{var r=e.stateNode;lb(r,e.type,n,t),r[Ht]=t}catch(c){Qe(e,e.return,c)}}function ph(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&En(e.type)||e.tag===4}function $c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ph(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&En(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=La));else if(r!==4&&(r===27&&En(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function mo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&En(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(mo(e,t,n),e=e.sibling;e!==null;)mo(e,t,n),e=e.sibling}function xh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Et(t,r,n),t[Nt]=e,t[Ht]=n}catch(u){Qe(e,e.return,u)}}var Ka=!1,ot=!1,Jc=!1,vh=typeof WeakSet=="function"?WeakSet:Set,gt=null;function qy(e,t){if(e=e.containerInfo,vu=zo,e=Rf(e),Vi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var c=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var p=0,b=-1,T=-1,H=0,$=0,P=e,G=null;t:for(;;){for(var V;P!==n||c!==0&&P.nodeType!==3||(b=p+c),P!==u||r!==0&&P.nodeType!==3||(T=p+r),P.nodeType===3&&(p+=P.nodeValue.length),(V=P.firstChild)!==null;)G=P,P=V;for(;;){if(P===e)break t;if(G===n&&++H===c&&(b=p),G===u&&++$===r&&(T=p),(V=P.nextSibling)!==null)break;P=G,G=P.parentNode}P=V}n=b===-1||T===-1?null:{start:b,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(gu={focusedElem:e,selectionRange:n},zo=!1,gt=t;gt!==null;)if(t=gt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gt=e;else for(;gt!==null;){switch(t=gt,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,c=u.memoizedProps,u=u.memoizedState,r=n.stateNode;try{var ie=ar(n.type,c);e=r.getSnapshotBeforeUpdate(ie,u),r.__reactInternalSnapshotBeforeUpdate=e}catch(je){Qe(n,n.return,je)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Nu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,gt=e;break}gt=t.return}}function gh(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Za(e,n),r&4&&Xs(5,n);break;case 1:if(Za(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(p){Qe(n,n.return,p)}else{var c=ar(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Qe(n,n.return,p)}}r&64&&fh(n),r&512&&Ks(n,n.return);break;case 3:if(Za(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{am(e,t)}catch(p){Qe(n,n.return,p)}}break;case 27:t===null&&r&4&&xh(n);case 26:case 5:Za(e,n),t===null&&r&4&&hh(n),r&512&&Ks(n,n.return);break;case 12:Za(e,n);break;case 31:Za(e,n),r&4&&Nh(e,n);break;case 13:Za(e,n),r&4&&jh(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$y.bind(null,n),hb(e,n))));break;case 22:if(r=n.memoizedState!==null||Ka,!r){t=t!==null&&t.memoizedState!==null||ot,c=Ka;var u=ot;Ka=r,(ot=t)&&!u?Ja(e,n,(n.subtreeFlags&8772)!==0):Za(e,n),Ka=c,ot=u}break;case 30:break;default:Za(e,n)}}function yh(e){var t=e.alternate;t!==null&&(e.alternate=null,yh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ci(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Je=null,Qt=!1;function $a(e,t,n){for(n=n.child;n!==null;)bh(e,t,n),n=n.sibling}function bh(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(qn,n)}catch{}switch(n.tag){case 26:ot||ka(n,t),$a(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ot||ka(n,t);var r=Je,c=Qt;En(n.type)&&(Je=n.stateNode,Qt=!1),$a(e,t,n),al(n.stateNode),Je=r,Qt=c;break;case 5:ot||ka(n,t);case 6:if(r=Je,c=Qt,Je=null,$a(e,t,n),Je=r,Qt=c,Je!==null)if(Qt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(n.stateNode)}catch(u){Qe(n,t,u)}else try{Je.removeChild(n.stateNode)}catch(u){Qe(n,t,u)}break;case 18:Je!==null&&(Qt?(e=Je,fp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),es(e)):fp(Je,n.stateNode));break;case 4:r=Je,c=Qt,Je=n.stateNode.containerInfo,Qt=!0,$a(e,t,n),Je=r,Qt=c;break;case 0:case 11:case 14:case 15:gn(2,n,t),ot||gn(4,n,t),$a(e,t,n);break;case 1:ot||(ka(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&mh(n,t,r)),$a(e,t,n);break;case 21:$a(e,t,n);break;case 22:ot=(r=ot)||n.memoizedState!==null,$a(e,t,n),ot=r;break;default:$a(e,t,n)}}function Nh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{es(e)}catch(n){Qe(t,t.return,n)}}}function jh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{es(e)}catch(n){Qe(t,t.return,n)}}function Hy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vh),t;default:throw Error(i(435,e.tag))}}function ho(e,t){var n=Hy(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var c=Zy.bind(null,e,r);r.then(c,c)}})}function Vt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var c=n[r],u=e,p=t,b=p;e:for(;b!==null;){switch(b.tag){case 27:if(En(b.type)){Je=b.stateNode,Qt=!1;break e}break;case 5:Je=b.stateNode,Qt=!1;break e;case 3:case 4:Je=b.stateNode.containerInfo,Qt=!0;break e}b=b.return}if(Je===null)throw Error(i(160));bh(u,p,c),Je=null,Qt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sh(t,e),t=t.sibling}var Na=null;function Sh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Ft(e),r&4&&(gn(3,e,e.return),Xs(3,e),gn(5,e,e.return));break;case 1:Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),r&64&&Ka&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var c=Na;if(Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),r&4){var u=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":u=c.getElementsByTagName("title")[0],(!u||u[bs]||u[Nt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(r),c.head.insertBefore(u,c.querySelector("head > title"))),Et(u,r,n),u[Nt]=e,vt(u),r=u;break e;case"link":var p=Sp("link","href",c).get(r+(n.href||""));if(p){for(var b=0;b<p.length;b++)if(u=p[b],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){p.splice(b,1);break t}}u=c.createElement(r),Et(u,r,n),c.head.appendChild(u);break;case"meta":if(p=Sp("meta","content",c).get(r+(n.content||""))){for(b=0;b<p.length;b++)if(u=p[b],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){p.splice(b,1);break t}}u=c.createElement(r),Et(u,r,n),c.head.appendChild(u);break;default:throw Error(i(468,r))}u[Nt]=e,vt(u),r=u}e.stateNode=r}else wp(c,e.type,e.stateNode);else e.stateNode=jp(c,r,e.memoizedProps);else u!==r?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,r===null?wp(c,e.type,e.stateNode):jp(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Vt(t,e),Ft(e),r&512&&(ot||n===null||ka(n,n.return)),e.flags&32){c=e.stateNode;try{Sr(c,"")}catch(ie){Qe(e,e.return,ie)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Kc(e,c,n!==null?n.memoizedProps:c)),r&1024&&(Jc=!0);break;case 6:if(Vt(t,e),Ft(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ie){Qe(e,e.return,ie)}}break;case 3:if(ko=null,c=Na,Na=_o(t.containerInfo),Vt(t,e),Na=c,Ft(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{es(t.containerInfo)}catch(ie){Qe(e,e.return,ie)}Jc&&(Jc=!1,wh(e));break;case 4:r=Na,Na=_o(e.stateNode.containerInfo),Vt(t,e),Ft(e),Na=r;break;case 12:Vt(t,e),Ft(e);break;case 31:Vt(t,e),Ft(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 13:Vt(t,e),Ft(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(xo=At()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 22:c=e.memoizedState!==null;var T=n!==null&&n.memoizedState!==null,H=Ka,$=ot;if(Ka=H||c,ot=$||T,Vt(t,e),ot=$,Ka=H,Ft(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||T||Ka||ot||nr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){T=n=t;try{if(u=T.stateNode,c)p=u.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{b=T.stateNode;var P=T.memoizedProps.style,G=P!=null&&P.hasOwnProperty("display")?P.display:null;b.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(ie){Qe(T,T.return,ie)}}}else if(t.tag===6){if(n===null){T=t;try{T.stateNode.nodeValue=c?"":T.memoizedProps}catch(ie){Qe(T,T.return,ie)}}}else if(t.tag===18){if(n===null){T=t;try{var V=T.stateNode;c?mp(V,!0):mp(T.stateNode,!1)}catch(ie){Qe(T,T.return,ie)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ho(e,n))));break;case 19:Vt(t,e),Ft(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ho(e,r)));break;case 30:break;case 21:break;default:Vt(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(ph(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode,u=$c(e);mo(e,u,c);break;case 5:var p=n.stateNode;n.flags&32&&(Sr(p,""),n.flags&=-33);var b=$c(e);mo(e,b,p);break;case 3:case 4:var T=n.stateNode.containerInfo,H=$c(e);Zc(e,H,T);break;default:throw Error(i(161))}}catch($){Qe(e,e.return,$)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Za(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gh(e,t.alternate,t),t=t.sibling}function nr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:gn(4,t,t.return),nr(t);break;case 1:ka(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&mh(t,t.return,n),nr(t);break;case 27:al(t.stateNode);case 26:case 5:ka(t,t.return),nr(t);break;case 22:t.memoizedState===null&&nr(t);break;case 30:nr(t);break;default:nr(t)}e=e.sibling}}function Ja(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,u=t,p=u.flags;switch(u.tag){case 0:case 11:case 15:Ja(c,u,n),Xs(4,u);break;case 1:if(Ja(c,u,n),r=u,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(H){Qe(r,r.return,H)}if(r=u,c=r.updateQueue,c!==null){var b=r.stateNode;try{var T=c.shared.hiddenCallbacks;if(T!==null)for(c.shared.hiddenCallbacks=null,c=0;c<T.length;c++)tm(T[c],b)}catch(H){Qe(r,r.return,H)}}n&&p&64&&fh(u),Ks(u,u.return);break;case 27:xh(u);case 26:case 5:Ja(c,u,n),n&&r===null&&p&4&&hh(u),Ks(u,u.return);break;case 12:Ja(c,u,n);break;case 31:Ja(c,u,n),n&&p&4&&Nh(c,u);break;case 13:Ja(c,u,n),n&&p&4&&jh(c,u);break;case 22:u.memoizedState===null&&Ja(c,u,n),Ks(u,u.return);break;case 30:break;default:Ja(c,u,n)}t=t.sibling}}function Pc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Os(n))}function Ic(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Os(e))}function ja(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eh(e,t,n,r),t=t.sibling}function Eh(e,t,n,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ja(e,t,n,r),c&2048&&Xs(9,t);break;case 1:ja(e,t,n,r);break;case 3:ja(e,t,n,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Os(e)));break;case 12:if(c&2048){ja(e,t,n,r),e=t.stateNode;try{var u=t.memoizedProps,p=u.id,b=u.onPostCommit;typeof b=="function"&&b(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Qe(t,t.return,T)}}else ja(e,t,n,r);break;case 31:ja(e,t,n,r);break;case 13:ja(e,t,n,r);break;case 23:break;case 22:u=t.stateNode,p=t.alternate,t.memoizedState!==null?u._visibility&2?ja(e,t,n,r):$s(e,t):u._visibility&2?ja(e,t,n,r):(u._visibility|=2,Vr(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Pc(p,t);break;case 24:ja(e,t,n,r),c&2048&&Ic(t.alternate,t);break;default:ja(e,t,n,r)}}function Vr(e,t,n,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,p=t,b=n,T=r,H=p.flags;switch(p.tag){case 0:case 11:case 15:Vr(u,p,b,T,c),Xs(8,p);break;case 23:break;case 22:var $=p.stateNode;p.memoizedState!==null?$._visibility&2?Vr(u,p,b,T,c):$s(u,p):($._visibility|=2,Vr(u,p,b,T,c)),c&&H&2048&&Pc(p.alternate,p);break;case 24:Vr(u,p,b,T,c),c&&H&2048&&Ic(p.alternate,p);break;default:Vr(u,p,b,T,c)}t=t.sibling}}function $s(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,c=r.flags;switch(r.tag){case 22:$s(n,r),c&2048&&Pc(r.alternate,r);break;case 24:$s(n,r),c&2048&&Ic(r.alternate,r);break;default:$s(n,r)}t=t.sibling}}var Zs=8192;function Fr(e,t,n){if(e.subtreeFlags&Zs)for(e=e.child;e!==null;)Ch(e,t,n),e=e.sibling}function Ch(e,t,n){switch(e.tag){case 26:Fr(e,t,n),e.flags&Zs&&e.memoizedState!==null&&Cb(n,Na,e.memoizedState,e.memoizedProps);break;case 5:Fr(e,t,n);break;case 3:case 4:var r=Na;Na=_o(e.stateNode.containerInfo),Fr(e,t,n),Na=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zs,Zs=16777216,Fr(e,t,n),Zs=r):Fr(e,t,n));break;default:Fr(e,t,n)}}function Th(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Js(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gt=r,Rh(r,e)}Th(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_h(e),e=e.sibling}function _h(e){switch(e.tag){case 0:case 11:case 15:Js(e),e.flags&2048&&gn(9,e,e.return);break;case 3:Js(e);break;case 12:Js(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,po(e)):Js(e);break;default:Js(e)}}function po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gt=r,Rh(r,e)}Th(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gn(8,t,t.return),po(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,po(t));break;default:po(t)}e=e.sibling}}function Rh(e,t){for(;gt!==null;){var n=gt;switch(n.tag){case 0:case 11:case 15:gn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Os(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,gt=r;else e:for(n=e;gt!==null;){r=gt;var c=r.sibling,u=r.return;if(yh(r),r===n){gt=null;break e}if(c!==null){c.return=u,gt=c;break e}gt=u}}}var Gy={getCacheForType:function(e){var t=St(rt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return St(rt).controller.signal}},Qy=typeof WeakMap=="function"?WeakMap:Map,He=0,Xe=null,Oe=null,De=0,Ge=0,ta=null,yn=!1,Yr=!1,Wc=!1,Pa=0,et=0,bn=0,rr=0,eu=0,aa=0,Xr=0,Ps=null,Yt=null,tu=!1,xo=0,kh=0,vo=1/0,go=null,Nn=null,dt=0,jn=null,Kr=null,Ia=0,au=0,nu=null,Mh=null,Is=0,ru=null;function na(){return(He&2)!==0&&De!==0?De&-De:C.T!==null?uu():wi()}function Ah(){if(aa===0)if((De&536870912)===0||Le){var e=pr;pr<<=1,(pr&3932160)===0&&(pr=262144),aa=e}else aa=536870912;return e=Wt.current,e!==null&&(e.flags|=32),aa}function Xt(e,t,n){(e===Xe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&($r(e,0),Sn(e,De,aa,!1)),Ie(e,n),((He&2)===0||e!==Xe)&&(e===Xe&&((He&2)===0&&(rr|=n),et===4&&Sn(e,De,aa,!1)),Ma(e))}function Oh(e,t,n){if((He&6)!==0)throw Error(i(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ze(e,t),c=r?Yy(e,t):lu(e,t,!0),u=r;do{if(c===0){Yr&&!r&&Sn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Vy(n)){c=lu(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var b=e;c=Ps;var T=b.current.memoizedState.isDehydrated;if(T&&($r(b,p).flags|=256),p=lu(b,p,!1),p!==2){if(Wc&&!T){b.errorRecoveryDisabledLanes|=u,rr|=u,c=4;break e}u=Yt,Yt=c,u!==null&&(Yt===null?Yt=u:Yt.push.apply(Yt,u))}c=p}if(u=!1,c!==2)continue}}if(c===1){$r(e,0),Sn(e,t,0,!0);break}e:{switch(r=e,u=c,u){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Sn(r,t,aa,!yn);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=xo+300-At(),10<c)){if(Sn(r,t,aa,!yn),Te(r,0,!0)!==0)break e;Ia=t,r.timeoutHandle=up(zh.bind(null,r,n,Yt,go,tu,t,aa,rr,Xr,yn,u,"Throttled",-0,0),c);break e}zh(r,n,Yt,go,tu,t,aa,rr,Xr,yn,u,null,-0,0)}}break}while(!0);Ma(e)}function zh(e,t,n,r,c,u,p,b,T,H,$,P,G,V){if(e.timeoutHandle=-1,P=t.subtreeFlags,P&8192||(P&16785408)===16785408){P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:La},Ch(t,u,P);var ie=(u&62914560)===u?xo-At():(u&4194048)===u?kh-At():0;if(ie=Tb(P,ie),ie!==null){Ia=u,e.cancelPendingCommit=ie(Qh.bind(null,e,t,u,n,r,c,p,b,T,$,P,null,G,V)),Sn(e,u,p,!H);return}}Qh(e,t,u,n,r,c,p,b,T)}function Vy(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var c=n[r],u=c.getSnapshot;c=c.value;try{if(!Pt(u(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Sn(e,t,n,r){t&=~eu,t&=~rr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var u=31-Tt(c),p=1<<u;r[u]=-1,c&=~p}n!==0&&Gn(e,n,t)}function yo(){return(He&6)===0?(Ws(0),!1):!0}function su(){if(Oe!==null){if(Ge===0)var e=Oe.return;else e=Oe,Ga=Zn=null,Nc(e),Br=null,Ds=0,e=Oe;for(;e!==null;)dh(e.alternate,e),e=e.return;Oe=null}}function $r(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cb(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ia=0,su(),Xe=e,Oe=n=qa(e.current,null),De=t,Ge=0,ta=null,yn=!1,Yr=Ze(e,t),Wc=!1,Xr=aa=eu=rr=bn=et=0,Yt=Ps=null,tu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Tt(r),u=1<<c;t|=e[c],r&=~u}return Pa=t,ql(),n}function Dh(e,t){Re=null,C.H=Vs,t===Lr||t===Kl?(t=Pf(),Ge=3):t===cc?(t=Pf(),Ge=4):Ge=t===Lc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,Oe===null&&(et=1,oo(e,ca(t,e.current)))}function Uh(){var e=Wt.current;return e===null?!0:(De&4194048)===De?ma===null:(De&62914560)===De||(De&536870912)!==0?e===ma:!1}function Lh(){var e=C.H;return C.H=Vs,e===null?Vs:e}function Bh(){var e=C.A;return C.A=Gy,e}function bo(){et=4,yn||(De&4194048)!==De&&Wt.current!==null||(Yr=!0),(bn&134217727)===0&&(rr&134217727)===0||Xe===null||Sn(Xe,De,aa,!1)}function lu(e,t,n){var r=He;He|=2;var c=Lh(),u=Bh();(Xe!==e||De!==t)&&(go=null,$r(e,t)),t=!1;var p=et;e:do try{if(Ge!==0&&Oe!==null){var b=Oe,T=ta;switch(Ge){case 8:su(),p=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(t=!0);var H=Ge;if(Ge=0,ta=null,Zr(e,b,T,H),n&&Yr){p=0;break e}break;default:H=Ge,Ge=0,ta=null,Zr(e,b,T,H)}}Fy(),p=et;break}catch($){Dh(e,$)}while(!0);return t&&e.shellSuspendCounter++,Ga=Zn=null,He=r,C.H=c,C.A=u,Oe===null&&(Xe=null,De=0,ql()),p}function Fy(){for(;Oe!==null;)qh(Oe)}function Yy(e,t){var n=He;He|=2;var r=Lh(),c=Bh();Xe!==e||De!==t?(go=null,vo=At()+500,$r(e,t)):Yr=Ze(e,t);e:do try{if(Ge!==0&&Oe!==null){t=Oe;var u=ta;t:switch(Ge){case 1:Ge=0,ta=null,Zr(e,t,u,1);break;case 2:case 9:if(Zf(u)){Ge=0,ta=null,Hh(t);break}t=function(){Ge!==2&&Ge!==9||Xe!==e||(Ge=7),Ma(e)},u.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Zf(u)?(Ge=0,ta=null,Hh(t)):(Ge=0,ta=null,Zr(e,t,u,7));break;case 5:var p=null;switch(Oe.tag){case 26:p=Oe.memoizedState;case 5:case 27:var b=Oe;if(p?Ep(p):b.stateNode.complete){Ge=0,ta=null;var T=b.sibling;if(T!==null)Oe=T;else{var H=b.return;H!==null?(Oe=H,No(H)):Oe=null}break t}}Ge=0,ta=null,Zr(e,t,u,5);break;case 6:Ge=0,ta=null,Zr(e,t,u,6);break;case 8:su(),et=6;break e;default:throw Error(i(462))}}Xy();break}catch($){Dh(e,$)}while(!0);return Ga=Zn=null,C.H=r,C.A=c,He=n,Oe!==null?0:(Xe=null,De=0,ql(),et)}function Xy(){for(;Oe!==null&&!Mt();)qh(Oe)}function qh(e){var t=ch(e.alternate,e,Pa);e.memoizedProps=e.pendingProps,t===null?No(e):Oe=t}function Hh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=nh(n,t,t.pendingProps,t.type,void 0,De);break;case 11:t=nh(n,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:Nc(t);default:dh(n,t),t=Oe=Bf(t,Pa),t=ch(n,t,Pa)}e.memoizedProps=e.pendingProps,t===null?No(e):Oe=t}function Zr(e,t,n,r){Ga=Zn=null,Nc(t),Br=null,Ds=0;var c=t.return;try{if(zy(e,c,t,n,De)){et=1,oo(e,ca(n,e.current)),Oe=null;return}}catch(u){if(c!==null)throw Oe=c,u;et=1,oo(e,ca(n,e.current)),Oe=null;return}t.flags&32768?(Le||r===1?e=!0:Yr||(De&536870912)!==0?e=!1:(yn=e=!0,(r===2||r===9||r===3||r===6)&&(r=Wt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gh(t,e)):No(t)}function No(e){var t=e;do{if((t.flags&32768)!==0){Gh(t,yn);return}e=t.return;var n=Ly(t.alternate,t,Pa);if(n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);et===0&&(et=5)}function Gh(e,t){do{var n=By(e.alternate,e);if(n!==null){n.flags&=32767,Oe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=n}while(e!==null);et=6,Oe=null}function Qh(e,t,n,r,c,u,p,b,T){e.cancelPendingCommit=null;do jo();while(dt!==0);if((He&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(u=t.lanes|t.childLanes,u|=$i,Lt(e,n,u,p,b,T),e===Xe&&(Oe=Xe=null,De=0),Kr=t,jn=e,Ia=n,au=u,nu=c,Mh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jy(Bn,function(){return Kh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=C.T,C.T=null,c=Y.p,Y.p=2,p=He,He|=4;try{qy(e,t,n)}finally{He=p,Y.p=c,C.T=r}}dt=1,Vh(),Fh(),Yh()}}function Vh(){if(dt===1){dt=0;var e=jn,t=Kr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var r=Y.p;Y.p=2;var c=He;He|=4;try{Sh(t,e);var u=gu,p=Rf(e.containerInfo),b=u.focusedElem,T=u.selectionRange;if(p!==b&&b&&b.ownerDocument&&_f(b.ownerDocument.documentElement,b)){if(T!==null&&Vi(b)){var H=T.start,$=T.end;if($===void 0&&($=H),"selectionStart"in b)b.selectionStart=H,b.selectionEnd=Math.min($,b.value.length);else{var P=b.ownerDocument||document,G=P&&P.defaultView||window;if(G.getSelection){var V=G.getSelection(),ie=b.textContent.length,je=Math.min(T.start,ie),Ye=T.end===void 0?je:Math.min(T.end,ie);!V.extend&&je>Ye&&(p=Ye,Ye=je,je=p);var O=Tf(b,je),R=Tf(b,Ye);if(O&&R&&(V.rangeCount!==1||V.anchorNode!==O.node||V.anchorOffset!==O.offset||V.focusNode!==R.node||V.focusOffset!==R.offset)){var q=P.createRange();q.setStart(O.node,O.offset),V.removeAllRanges(),je>Ye?(V.addRange(q),V.extend(R.node,R.offset)):(q.setEnd(R.node,R.offset),V.addRange(q))}}}}for(P=[],V=b;V=V.parentNode;)V.nodeType===1&&P.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<P.length;b++){var J=P[b];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}zo=!!vu,gu=vu=null}finally{He=c,Y.p=r,C.T=n}}e.current=t,dt=2}}function Fh(){if(dt===2){dt=0;var e=jn,t=Kr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var r=Y.p;Y.p=2;var c=He;He|=4;try{gh(e,t.alternate,t)}finally{He=c,Y.p=r,C.T=n}}dt=3}}function Yh(){if(dt===4||dt===3){dt=0,nn();var e=jn,t=Kr,n=Ia,r=Mh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,Kr=jn=null,Xh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Nn=null),ya(n),t=t.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(qn,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=C.T,c=Y.p,Y.p=2,C.T=null;try{for(var u=e.onRecoverableError,p=0;p<r.length;p++){var b=r[p];u(b.value,{componentStack:b.stack})}}finally{C.T=t,Y.p=c}}(Ia&3)!==0&&jo(),Ma(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===ru?Is++:(Is=0,ru=e):Is=0,Ws(0)}}function Xh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Os(t)))}function jo(){return Vh(),Fh(),Yh(),Kh()}function Kh(){if(dt!==5)return!1;var e=jn,t=au;au=0;var n=ya(Ia),r=C.T,c=Y.p;try{Y.p=32>n?32:n,C.T=null,n=nu,nu=null;var u=jn,p=Ia;if(dt=0,Kr=jn=null,Ia=0,(He&6)!==0)throw Error(i(331));var b=He;if(He|=4,_h(u.current),Eh(u,u.current,p,n),He=b,Ws(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(qn,u)}catch{}return!0}finally{Y.p=c,C.T=r,Xh(e,t)}}function $h(e,t,n){t=ca(n,t),t=Uc(e.stateNode,t,2),e=pn(e,t,2),e!==null&&(Ie(e,2),Ma(e))}function Qe(e,t,n){if(e.tag===3)$h(e,e,n);else for(;t!==null;){if(t.tag===3){$h(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Nn===null||!Nn.has(r))){e=ca(n,e),n=Zm(2),r=pn(t,n,2),r!==null&&(Jm(n,r,t,e),Ie(r,2),Ma(r));break}}t=t.return}}function ou(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qy;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(n)||(Wc=!0,c.add(n),e=Ky.bind(null,e,t,n),t.then(e,e))}function Ky(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xe===e&&(De&n)===n&&(et===4||et===3&&(De&62914560)===De&&300>At()-xo?(He&2)===0&&$r(e,0):eu|=n,Xr===De&&(Xr=0)),Ma(e)}function Zh(e,t){t===0&&(t=_t()),e=Xn(e,t),e!==null&&(Ie(e,t),Ma(e))}function $y(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zh(e,n)}function Zy(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zh(e,n)}function Jy(e,t){return xs(e,t)}var So=null,Jr=null,iu=!1,wo=!1,cu=!1,wn=0;function Ma(e){e!==Jr&&e.next===null&&(Jr===null?So=Jr=e:Jr=Jr.next=e),wo=!0,iu||(iu=!0,Iy())}function Ws(e,t){if(!cu&&wo){cu=!0;do for(var n=!1,r=So;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var u=0;else{var p=r.suspendedLanes,b=r.pingedLanes;u=(1<<31-Tt(42|e)+1)-1,u&=c&~(p&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Wh(r,u))}else u=De,u=Te(r,r===Xe?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||Ze(r,u)||(n=!0,Wh(r,u));r=r.next}while(n);cu=!1}}function Py(){Jh()}function Jh(){wo=iu=!1;var e=0;wn!==0&&ib()&&(e=wn);for(var t=At(),n=null,r=So;r!==null;){var c=r.next,u=Ph(r,t);u===0?(r.next=null,n===null?So=c:n.next=c,c===null&&(Jr=n)):(n=r,(e!==0||(u&3)!==0)&&(wo=!0)),r=c}dt!==0&&dt!==5||Ws(e),wn!==0&&(wn=0)}function Ph(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var p=31-Tt(u),b=1<<p,T=c[p];T===-1?((b&n)===0||(b&r)!==0)&&(c[p]=xt(b,t)):T<=t&&(e.expiredLanes|=b),u&=~b}if(t=Xe,n=De,n=Te(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&vs(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&vs(r),ya(n)){case 2:case 8:n=Cl;break;case 32:n=Bn;break;case 268435456:n=Da;break;default:n=Bn}return r=Ih.bind(null,e),n=xs(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&vs(r),e.callbackPriority=2,e.callbackNode=null,2}function Ih(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(jo()&&e.callbackNode!==n)return null;var r=De;return r=Te(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Oh(e,r,t),Ph(e,At()),e.callbackNode!=null&&e.callbackNode===n?Ih.bind(null,e):null)}function Wh(e,t){if(jo())return null;Oh(e,t,!0)}function Iy(){ub(function(){(He&6)!==0?xs(Ln,Py):Jh()})}function uu(){if(wn===0){var e=Dr;e===0&&(e=hr,hr<<=1,(hr&261888)===0&&(hr=256)),wn=e}return wn}function ep(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ml(""+e)}function tp(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Wy(e,t,n,r,c){if(t==="submit"&&n&&n.stateNode===c){var u=ep((c[Ht]||null).action),p=r.submitter;p&&(t=(t=p[Ht]||null)?ep(t.formAction):p.getAttribute("formAction"),t!==null&&(u=t,p=null));var b=new Dl("action","action",null,r,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wn!==0){var T=p?tp(c,p):new FormData(c);kc(n,{pending:!0,data:T,method:c.method,action:u},null,T)}}else typeof u=="function"&&(b.preventDefault(),T=p?tp(c,p):new FormData(c),kc(n,{pending:!0,data:T,method:c.method,action:u},u,T))},currentTarget:c}]})}}for(var du=0;du<Ki.length;du++){var fu=Ki[du],eb=fu.toLowerCase(),tb=fu[0].toUpperCase()+fu.slice(1);ba(eb,"on"+tb)}ba(Af,"onAnimationEnd"),ba(Of,"onAnimationIteration"),ba(zf,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(vy,"onTransitionRun"),ba(gy,"onTransitionStart"),ba(yy,"onTransitionCancel"),ba(Df,"onTransitionEnd"),Nr("onMouseEnter",["mouseout","mouseover"]),Nr("onMouseLeave",["mouseout","mouseover"]),Nr("onPointerEnter",["pointerout","pointerover"]),Nr("onPointerLeave",["pointerout","pointerover"]),Qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var el="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ab=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(el));function ap(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],c=r.event;r=r.listeners;e:{var u=void 0;if(t)for(var p=r.length-1;0<=p;p--){var b=r[p],T=b.instance,H=b.currentTarget;if(b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=H;try{u(c)}catch($){Bl($)}c.currentTarget=null,u=T}else for(p=0;p<r.length;p++){if(b=r[p],T=b.instance,H=b.currentTarget,b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=H;try{u(c)}catch($){Bl($)}c.currentTarget=null,u=T}}}}function ze(e,t){var n=t[Ei];n===void 0&&(n=t[Ei]=new Set);var r=e+"__bubble";n.has(r)||(np(t,e,2,!1),n.add(r))}function mu(e,t,n){var r=0;t&&(r|=4),np(n,e,r,t)}var Eo="_reactListening"+Math.random().toString(36).slice(2);function hu(e){if(!e[Eo]){e[Eo]=!0,Zd.forEach(function(n){n!=="selectionchange"&&(ab.has(n)||mu(n,!1,e),mu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Eo]||(t[Eo]=!0,mu("selectionchange",!1,t))}}function np(e,t,n,r){switch(Ap(t)){case 2:var c=kb;break;case 8:c=Mb;break;default:c=Ru}n=c.bind(null,t,n,e),c=void 0,!zi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function pu(e,t,n,r,c){var u=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var p=r.tag;if(p===3||p===4){var b=r.stateNode.containerInfo;if(b===c)break;if(p===4)for(p=r.return;p!==null;){var T=p.tag;if((T===3||T===4)&&p.stateNode.containerInfo===c)return;p=p.return}for(;b!==null;){if(p=gr(b),p===null)return;if(T=p.tag,T===5||T===6||T===26||T===27){r=u=p;continue e}b=b.parentNode}}r=r.return}of(function(){var H=u,$=Ai(n),P=[];e:{var G=Uf.get(e);if(G!==void 0){var V=Dl,ie=e;switch(e){case"keypress":if(Ol(n)===0)break e;case"keydown":case"keyup":V=Zg;break;case"focusin":ie="focus",V=Bi;break;case"focusout":ie="blur",V=Bi;break;case"beforeblur":case"afterblur":V=Bi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=df;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=Lg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=Ig;break;case Af:case Of:case zf:V=Hg;break;case Df:V=ey;break;case"scroll":case"scrollend":V=Dg;break;case"wheel":V=ay;break;case"copy":case"cut":case"paste":V=Qg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=mf;break;case"toggle":case"beforetoggle":V=ry}var je=(t&4)!==0,Ye=!je&&(e==="scroll"||e==="scrollend"),O=je?G!==null?G+"Capture":null:G;je=[];for(var R=H,q;R!==null;){var J=R;if(q=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||q===null||O===null||(J=js(R,O),J!=null&&je.push(tl(R,J,q))),Ye)break;R=R.return}0<je.length&&(G=new V(G,ie,null,n,$),P.push({event:G,listeners:je}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",G&&n!==Mi&&(ie=n.relatedTarget||n.fromElement)&&(gr(ie)||ie[vr]))break e;if((V||G)&&(G=$.window===$?$:(G=$.ownerDocument)?G.defaultView||G.parentWindow:window,V?(ie=n.relatedTarget||n.toElement,V=H,ie=ie?gr(ie):null,ie!==null&&(Ye=f(ie),je=ie.tag,ie!==Ye||je!==5&&je!==27&&je!==6)&&(ie=null)):(V=null,ie=H),V!==ie)){if(je=df,J="onMouseLeave",O="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(je=mf,J="onPointerLeave",O="onPointerEnter",R="pointer"),Ye=V==null?G:Ns(V),q=ie==null?G:Ns(ie),G=new je(J,R+"leave",V,n,$),G.target=Ye,G.relatedTarget=q,J=null,gr($)===H&&(je=new je(O,R+"enter",ie,n,$),je.target=q,je.relatedTarget=Ye,J=je),Ye=J,V&&ie)t:{for(je=nb,O=V,R=ie,q=0,J=O;J;J=je(J))q++;J=0;for(var ye=R;ye;ye=je(ye))J++;for(;0<q-J;)O=je(O),q--;for(;0<J-q;)R=je(R),J--;for(;q--;){if(O===R||R!==null&&O===R.alternate){je=O;break t}O=je(O),R=je(R)}je=null}else je=null;V!==null&&rp(P,G,V,je,!1),ie!==null&&Ye!==null&&rp(P,Ye,ie,je,!0)}}e:{if(G=H?Ns(H):window,V=G.nodeName&&G.nodeName.toLowerCase(),V==="select"||V==="input"&&G.type==="file")var Be=Nf;else if(yf(G))if(jf)Be=hy;else{Be=fy;var me=dy}else V=G.nodeName,!V||V.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?H&&ki(H.elementType)&&(Be=Nf):Be=my;if(Be&&(Be=Be(e,H))){bf(P,Be,n,$);break e}me&&me(e,G,H),e==="focusout"&&H&&G.type==="number"&&H.memoizedProps.value!=null&&Ri(G,"number",G.value)}switch(me=H?Ns(H):window,e){case"focusin":(yf(me)||me.contentEditable==="true")&&(Tr=me,Fi=H,ks=null);break;case"focusout":ks=Fi=Tr=null;break;case"mousedown":Yi=!0;break;case"contextmenu":case"mouseup":case"dragend":Yi=!1,kf(P,n,$);break;case"selectionchange":if(xy)break;case"keydown":case"keyup":kf(P,n,$)}var ke;if(Hi)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Cr?vf(e,n)&&(Ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ue="onCompositionStart");Ue&&(hf&&n.locale!=="ko"&&(Cr||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Cr&&(ke=cf()):(on=$,Di="value"in on?on.value:on.textContent,Cr=!0)),me=Co(H,Ue),0<me.length&&(Ue=new ff(Ue,e,null,n,$),P.push({event:Ue,listeners:me}),ke?Ue.data=ke:(ke=gf(n),ke!==null&&(Ue.data=ke)))),(ke=ly?oy(e,n):iy(e,n))&&(Ue=Co(H,"onBeforeInput"),0<Ue.length&&(me=new ff("onBeforeInput","beforeinput",null,n,$),P.push({event:me,listeners:Ue}),me.data=ke)),Wy(P,e,H,n,$)}ap(P,t)})}function tl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Co(e,t){for(var n=t+"Capture",r=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=js(e,n),c!=null&&r.unshift(tl(e,c,u)),c=js(e,t),c!=null&&r.push(tl(e,c,u))),e.tag===3)return r;e=e.return}return[]}function nb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(e,t,n,r,c){for(var u=t._reactName,p=[];n!==null&&n!==r;){var b=n,T=b.alternate,H=b.stateNode;if(b=b.tag,T!==null&&T===r)break;b!==5&&b!==26&&b!==27||H===null||(T=H,c?(H=js(n,u),H!=null&&p.unshift(tl(n,H,T))):c||(H=js(n,u),H!=null&&p.push(tl(n,H,T)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var rb=/\r\n?/g,sb=/\u0000|\uFFFD/g;function sp(e){return(typeof e=="string"?e:""+e).replace(rb,`
9
+ `).replace(sb,"")}function lp(e,t){return t=sp(t),sp(e)===t}function Fe(e,t,n,r,c,u){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Sr(e,""+r);break;case"className":Rl(e,"class",r);break;case"tabIndex":Rl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(e,n,r);break;case"style":sf(e,r,u);break;case"data":if(t!=="object"){Rl(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Ml(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&Fe(e,t,"name",c.name,c,null),Fe(e,t,"formEncType",c.formEncType,c,null),Fe(e,t,"formMethod",c.formMethod,c,null),Fe(e,t,"formTarget",c.formTarget,c,null)):(Fe(e,t,"encType",c.encType,c,null),Fe(e,t,"method",c.method,c,null),Fe(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Ml(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=La);break;case"onScroll":r!=null&&ze("scroll",e);break;case"onScrollEnd":r!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Ml(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ze("beforetoggle",e),ze("toggle",e),_l(e,"popover",r);break;case"xlinkActuate":Ua(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ua(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ua(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ua(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ua(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ua(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ua(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ua(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ua(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":_l(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Og.get(n)||n,_l(e,n,r))}}function xu(e,t,n,r,c,u){switch(n){case"style":sf(e,r,u);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&Sr(e,""+r);break;case"onScroll":r!=null&&ze("scroll",e);break;case"onScrollEnd":r!=null&&ze("scrollend",e);break;case"onClick":r!=null&&(e.onclick=La);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jd.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),u=e[Ht]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof r=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,c);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):_l(e,n,r)}}}function Et(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var r=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var p=n[u];if(p!=null)switch(u){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Fe(e,t,u,p,n,null)}}c&&Fe(e,t,"srcSet",n.srcSet,n,null),r&&Fe(e,t,"src",n.src,n,null);return;case"input":ze("invalid",e);var b=u=p=c=null,T=null,H=null;for(r in n)if(n.hasOwnProperty(r)){var $=n[r];if($!=null)switch(r){case"name":c=$;break;case"type":p=$;break;case"checked":T=$;break;case"defaultChecked":H=$;break;case"value":u=$;break;case"defaultValue":b=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,t));break;default:Fe(e,t,r,$,n,null)}}tf(e,u,b,T,H,p,c,!1);return;case"select":ze("invalid",e),r=p=u=null;for(c in n)if(n.hasOwnProperty(c)&&(b=n[c],b!=null))switch(c){case"value":u=b;break;case"defaultValue":p=b;break;case"multiple":r=b;default:Fe(e,t,c,b,n,null)}t=u,n=p,e.multiple=!!r,t!=null?jr(e,!!r,t,!1):n!=null&&jr(e,!!r,n,!0);return;case"textarea":ze("invalid",e),u=c=r=null;for(p in n)if(n.hasOwnProperty(p)&&(b=n[p],b!=null))switch(p){case"value":r=b;break;case"defaultValue":c=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(i(91));break;default:Fe(e,t,p,b,n,null)}nf(e,r,c,u);return;case"option":for(T in n)n.hasOwnProperty(T)&&(r=n[T],r!=null)&&(T==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Fe(e,t,T,r,n,null));return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(r=0;r<el.length;r++)ze(el[r],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in n)if(n.hasOwnProperty(H)&&(r=n[H],r!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Fe(e,t,H,r,n,null)}return;default:if(ki(t)){for($ in n)n.hasOwnProperty($)&&(r=n[$],r!==void 0&&xu(e,t,$,r,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(r=n[b],r!=null&&Fe(e,t,b,r,n,null))}function lb(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,p=null,b=null,T=null,H=null,$=null;for(V in n){var P=n[V];if(n.hasOwnProperty(V)&&P!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":T=P;default:r.hasOwnProperty(V)||Fe(e,t,V,null,r,P)}}for(var G in r){var V=r[G];if(P=n[G],r.hasOwnProperty(G)&&(V!=null||P!=null))switch(G){case"type":u=V;break;case"name":c=V;break;case"checked":H=V;break;case"defaultChecked":$=V;break;case"value":p=V;break;case"defaultValue":b=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(137,t));break;default:V!==P&&Fe(e,t,G,V,r,P)}}_i(e,p,b,T,H,$,u,c);return;case"select":V=p=b=G=null;for(u in n)if(T=n[u],n.hasOwnProperty(u)&&T!=null)switch(u){case"value":break;case"multiple":V=T;default:r.hasOwnProperty(u)||Fe(e,t,u,null,r,T)}for(c in r)if(u=r[c],T=n[c],r.hasOwnProperty(c)&&(u!=null||T!=null))switch(c){case"value":G=u;break;case"defaultValue":b=u;break;case"multiple":p=u;default:u!==T&&Fe(e,t,c,u,r,T)}t=b,n=p,r=V,G!=null?jr(e,!!n,G,!1):!!r!=!!n&&(t!=null?jr(e,!!n,t,!0):jr(e,!!n,n?[]:"",!1));return;case"textarea":V=G=null;for(b in n)if(c=n[b],n.hasOwnProperty(b)&&c!=null&&!r.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Fe(e,t,b,null,r,c)}for(p in r)if(c=r[p],u=n[p],r.hasOwnProperty(p)&&(c!=null||u!=null))switch(p){case"value":G=c;break;case"defaultValue":V=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==u&&Fe(e,t,p,c,r,u)}af(e,G,V);return;case"option":for(var ie in n)G=n[ie],n.hasOwnProperty(ie)&&G!=null&&!r.hasOwnProperty(ie)&&(ie==="selected"?e.selected=!1:Fe(e,t,ie,null,r,G));for(T in r)G=r[T],V=n[T],r.hasOwnProperty(T)&&G!==V&&(G!=null||V!=null)&&(T==="selected"?e.selected=G&&typeof G!="function"&&typeof G!="symbol":Fe(e,t,T,G,r,V));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in n)G=n[je],n.hasOwnProperty(je)&&G!=null&&!r.hasOwnProperty(je)&&Fe(e,t,je,null,r,G);for(H in r)if(G=r[H],V=n[H],r.hasOwnProperty(H)&&G!==V&&(G!=null||V!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,t));break;default:Fe(e,t,H,G,r,V)}return;default:if(ki(t)){for(var Ye in n)G=n[Ye],n.hasOwnProperty(Ye)&&G!==void 0&&!r.hasOwnProperty(Ye)&&xu(e,t,Ye,void 0,r,G);for($ in r)G=r[$],V=n[$],!r.hasOwnProperty($)||G===V||G===void 0&&V===void 0||xu(e,t,$,G,r,V);return}}for(var O in n)G=n[O],n.hasOwnProperty(O)&&G!=null&&!r.hasOwnProperty(O)&&Fe(e,t,O,null,r,G);for(P in r)G=r[P],V=n[P],!r.hasOwnProperty(P)||G===V||G==null&&V==null||Fe(e,t,P,G,r,V)}function op(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ob(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var c=n[r],u=c.transferSize,p=c.initiatorType,b=c.duration;if(u&&b&&op(p)){for(p=0,b=c.responseEnd,r+=1;r<n.length;r++){var T=n[r],H=T.startTime;if(H>b)break;var $=T.transferSize,P=T.initiatorType;$&&op(P)&&(T=T.responseEnd,p+=$*(T<b?1:(b-H)/(T-H)))}if(--r,t+=8*(u+p)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var vu=null,gu=null;function To(e){return e.nodeType===9?e:e.ownerDocument}function ip(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function yu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bu=null;function ib(){var e=window.event;return e&&e.type==="popstate"?e===bu?!1:(bu=e,!0):(bu=null,!1)}var up=typeof setTimeout=="function"?setTimeout:void 0,cb=typeof clearTimeout=="function"?clearTimeout:void 0,dp=typeof Promise=="function"?Promise:void 0,ub=typeof queueMicrotask=="function"?queueMicrotask:typeof dp<"u"?function(e){return dp.resolve(null).then(e).catch(db)}:up;function db(e){setTimeout(function(){throw e})}function En(e){return e==="head"}function fp(e,t){var n=t,r=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(c),es(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")al(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,al(n);for(var u=n.firstChild;u;){var p=u.nextSibling,b=u.nodeName;u[bs]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=p}}else n==="body"&&al(e.ownerDocument.body);n=c}while(n);es(t)}function mp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function Nu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nu(n),Ci(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function fb(e,t,n,r){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[bs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=ha(e.nextSibling),e===null)break}return null}function mb(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ha(e.nextSibling),e===null))return null;return e}function hp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ha(e.nextSibling),e===null))return null;return e}function ju(e){return e.data==="$?"||e.data==="$~"}function Su(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hb(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ha(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var wu=null;function pp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ha(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function xp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function vp(e,t,n){switch(t=To(n),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function al(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ci(e)}var pa=new Map,gp=new Set;function _o(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wa=Y.d;Y.d={f:pb,r:xb,D:vb,C:gb,L:yb,m:bb,X:jb,S:Nb,M:Sb};function pb(){var e=Wa.f(),t=yo();return e||t}function xb(e){var t=yr(e);t!==null&&t.tag===5&&t.type==="form"?Dm(t):Wa.r(e)}var Pr=typeof document>"u"?null:document;function yp(e,t,n){var r=Pr;if(r&&typeof t=="string"&&t){var c=oa(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),gp.has(c)||(gp.add(c),e={rel:e,crossOrigin:n,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Et(t,"link",e),vt(t),r.head.appendChild(t)))}}function vb(e){Wa.D(e),yp("dns-prefetch",e,null)}function gb(e,t){Wa.C(e,t),yp("preconnect",e,t)}function yb(e,t,n){Wa.L(e,t,n);var r=Pr;if(r&&e&&t){var c='link[rel="preload"][as="'+oa(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+oa(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+oa(n.imageSizes)+'"]')):c+='[href="'+oa(e)+'"]';var u=c;switch(t){case"style":u=Ir(e);break;case"script":u=Wr(e)}pa.has(u)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),pa.set(u,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(nl(u))||t==="script"&&r.querySelector(rl(u))||(t=r.createElement("link"),Et(t,"link",e),vt(t),r.head.appendChild(t)))}}function bb(e,t){Wa.m(e,t);var n=Pr;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+oa(r)+'"][href="'+oa(e)+'"]',u=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Wr(e)}if(!pa.has(u)&&(e=x({rel:"modulepreload",href:e},t),pa.set(u,e),n.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(rl(u)))return}r=n.createElement("link"),Et(r,"link",e),vt(r),n.head.appendChild(r)}}}function Nb(e,t,n){Wa.S(e,t,n);var r=Pr;if(r&&e){var c=br(r).hoistableStyles,u=Ir(e);t=t||"default";var p=c.get(u);if(!p){var b={loading:0,preload:null};if(p=r.querySelector(nl(u)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=pa.get(u))&&Eu(e,n);var T=p=r.createElement("link");vt(T),Et(T,"link",e),T._p=new Promise(function(H,$){T.onload=H,T.onerror=$}),T.addEventListener("load",function(){b.loading|=1}),T.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Ro(p,t,r)}p={type:"stylesheet",instance:p,count:1,state:b},c.set(u,p)}}}function jb(e,t){Wa.X(e,t);var n=Pr;if(n&&e){var r=br(n).hoistableScripts,c=Wr(e),u=r.get(c);u||(u=n.querySelector(rl(c)),u||(e=x({src:e,async:!0},t),(t=pa.get(c))&&Cu(e,t),u=n.createElement("script"),vt(u),Et(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function Sb(e,t){Wa.M(e,t);var n=Pr;if(n&&e){var r=br(n).hoistableScripts,c=Wr(e),u=r.get(c);u||(u=n.querySelector(rl(c)),u||(e=x({src:e,async:!0,type:"module"},t),(t=pa.get(c))&&Cu(e,t),u=n.createElement("script"),vt(u),Et(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function bp(e,t,n,r){var c=(c=fe.current)?_o(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ir(n.href),n=br(c).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ir(n.href);var u=br(c).hoistableStyles,p=u.get(e);if(p||(c=c.ownerDocument||c,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,p),(u=c.querySelector(nl(e)))&&!u._p&&(p.instance=u,p.state.loading=5),pa.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},pa.set(e,n),u||wb(c,e,n,p.state))),t&&r===null)throw Error(i(528,""));return p}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wr(n),n=br(c).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ir(e){return'href="'+oa(e)+'"'}function nl(e){return'link[rel="stylesheet"]['+e+"]"}function Np(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function wb(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Et(t,"link",n),vt(t),e.head.appendChild(t))}function Wr(e){return'[src="'+oa(e)+'"]'}function rl(e){return"script[async]"+e}function jp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+oa(n.href)+'"]');if(r)return t.instance=r,vt(r),r;var c=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),vt(r),Et(r,"style",c),Ro(r,n.precedence,e),t.instance=r;case"stylesheet":c=Ir(n.href);var u=e.querySelector(nl(c));if(u)return t.state.loading|=4,t.instance=u,vt(u),u;r=Np(n),(c=pa.get(c))&&Eu(r,c),u=(e.ownerDocument||e).createElement("link"),vt(u);var p=u;return p._p=new Promise(function(b,T){p.onload=b,p.onerror=T}),Et(u,"link",r),t.state.loading|=4,Ro(u,n.precedence,e),t.instance=u;case"script":return u=Wr(n.src),(c=e.querySelector(rl(u)))?(t.instance=c,vt(c),c):(r=n,(c=pa.get(u))&&(r=x({},n),Cu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),vt(c),Et(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ro(r,n.precedence,e));return t.instance}function Ro(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,u=c,p=0;p<r.length;p++){var b=r[p];if(b.dataset.precedence===t)u=b;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Eu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Cu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ko=null;function Sp(e,t,n){if(ko===null){var r=new Map,c=ko=new Map;c.set(n,r)}else c=ko,r=c.get(n),r||(r=new Map,c.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var u=n[c];if(!(u[bs]||u[Nt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var p=u.getAttribute(t)||"";p=e+p;var b=r.get(p);b?b.push(u):r.set(p,[u])}}return r}function wp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Eb(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ep(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Cb(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=Ir(r.href),u=t.querySelector(nl(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,vt(u);return}u=t.ownerDocument||t,r=Np(r),(c=pa.get(c))&&Eu(r,c),u=u.createElement("link"),vt(u);var p=u;p._p=new Promise(function(b,T){p.onload=b,p.onerror=T}),Et(u,"link",r),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Mo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Tu=0;function Tb(e,t){return e.stylesheets&&e.count===0&&Oo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Oo(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Tu===0&&(Tu=62500*ob());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Oo(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Tu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Oo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ao=null;function Oo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ao=new Map,t.forEach(_b,e),Ao=null,Mo.call(e))}function _b(e,t){if(!(t.state.loading&4)){var n=Ao.get(e);if(n)var r=n.get(null);else{n=new Map,Ao.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var p=c[u];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),r=p)}r&&n.set(null,r)}c=t.instance,p=c.getAttribute("data-precedence"),u=n.get(p)||r,u===r&&n.set(null,c),n.set(p,c),this.count++,r=Mo.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var sl={$$typeof:X,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Rb(e,t,n,r,c,u,p,b,T){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sn(0),this.hiddenUpdates=sn(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function Cp(e,t,n,r,c,u,p,b,T,H,$,P){return e=new Rb(e,t,n,p,T,H,$,P,b),t=1,u===!0&&(t|=24),u=It(3,null,null,t),e.current=u,u.stateNode=e,t=lc(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:r,isDehydrated:n,cache:t},uc(u),e}function Tp(e){return e?(e=kr,e):kr}function _p(e,t,n,r,c,u){c=Tp(c),r.context===null?r.context=c:r.pendingContext=c,r=hn(t),r.payload={element:n},u=u===void 0?null:u,u!==null&&(r.callback=u),n=pn(e,r,t),n!==null&&(Xt(n,e,t),Ls(n,e,t))}function Rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _u(e,t){Rp(e,t),(e=e.alternate)&&Rp(e,t)}function kp(e){if(e.tag===13||e.tag===31){var t=Xn(e,67108864);t!==null&&Xt(t,e,67108864),_u(e,67108864)}}function Mp(e){if(e.tag===13||e.tag===31){var t=na();t=xr(t);var n=Xn(e,t);n!==null&&Xt(n,e,t),_u(e,t)}}var zo=!0;function kb(e,t,n,r){var c=C.T;C.T=null;var u=Y.p;try{Y.p=2,Ru(e,t,n,r)}finally{Y.p=u,C.T=c}}function Mb(e,t,n,r){var c=C.T;C.T=null;var u=Y.p;try{Y.p=8,Ru(e,t,n,r)}finally{Y.p=u,C.T=c}}function Ru(e,t,n,r){if(zo){var c=ku(r);if(c===null)pu(e,t,r,Do,n),Op(e,r);else if(Ob(c,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Ab.indexOf(e)){for(;c!==null;){var u=yr(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var p=Ta(u.pendingLanes);if(p!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;p;){var T=1<<31-Tt(p);b.entanglements[1]|=T,p&=~T}Ma(u),(He&6)===0&&(vo=At()+500,Ws(0))}}break;case 31:case 13:b=Xn(u,2),b!==null&&Xt(b,u,2),yo(),_u(u,2)}if(u=ku(r),u===null&&pu(e,t,r,Do,n),u===c)break;c=u}c!==null&&r.stopPropagation()}else pu(e,t,r,null,n)}}function ku(e){return e=Ai(e),Mu(e)}var Do=null;function Mu(e){if(Do=null,e=gr(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=v(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Do=e,null}function Ap(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ji()){case Ln:return 2;case Cl:return 8;case Bn:case gs:return 32;case Da:return 268435456;default:return 32}default:return 32}}var Au=!1,Cn=null,Tn=null,_n=null,ll=new Map,ol=new Map,Rn=[],Ab="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Op(e,t){switch(e){case"focusin":case"focusout":Cn=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ol.delete(t.pointerId)}}function il(e,t,n,r,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:u,targetContainers:[c]},t!==null&&(t=yr(t),t!==null&&kp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Ob(e,t,n,r,c){switch(t){case"focusin":return Cn=il(Cn,e,t,n,r,c),!0;case"dragenter":return Tn=il(Tn,e,t,n,r,c),!0;case"mouseover":return _n=il(_n,e,t,n,r,c),!0;case"pointerover":var u=c.pointerId;return ll.set(u,il(ll.get(u)||null,e,t,n,r,c)),!0;case"gotpointercapture":return u=c.pointerId,ol.set(u,il(ol.get(u)||null,e,t,n,r,c)),!0}return!1}function zp(e){var t=gr(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,Kd(e.priority,function(){Mp(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,Kd(e.priority,function(){Mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ku(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Mi=r,n.target.dispatchEvent(r),Mi=null}else return t=yr(n),t!==null&&kp(t),e.blockedOn=n,!1;t.shift()}return!0}function Dp(e,t,n){Uo(e)&&n.delete(t)}function zb(){Au=!1,Cn!==null&&Uo(Cn)&&(Cn=null),Tn!==null&&Uo(Tn)&&(Tn=null),_n!==null&&Uo(_n)&&(_n=null),ll.forEach(Dp),ol.forEach(Dp)}function Lo(e,t){e.blockedOn===t&&(e.blockedOn=null,Au||(Au=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,zb)))}var Bo=null;function Up(e){Bo!==e&&(Bo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Bo===e&&(Bo=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Mu(r||n)===null)continue;break}var u=yr(n);u!==null&&(e.splice(t,3),t-=3,kc(u,{pending:!0,data:c,method:n.method,action:r},r,c))}}))}function es(e){function t(T){return Lo(T,e)}Cn!==null&&Lo(Cn,e),Tn!==null&&Lo(Tn,e),_n!==null&&Lo(_n,e),ll.forEach(t),ol.forEach(t);for(var n=0;n<Rn.length;n++){var r=Rn[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)zp(n),n.blockedOn===null&&Rn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var c=n[r],u=n[r+1],p=c[Ht]||null;if(typeof u=="function")p||Up(n);else if(p){var b=null;if(u&&u.hasAttribute("formAction")){if(c=u,p=u[Ht]||null)b=p.formAction;else if(Mu(c)!==null)continue}else b=p.action;typeof b=="function"?n[r+1]=b:(n.splice(r,3),r-=3),Up(n)}}}function Lp(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(p){return c=p})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Ou(e){this._internalRoot=e}qo.prototype.render=Ou.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,r=na();_p(n,r,e,t,null,null)},qo.prototype.unmount=Ou.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_p(e.current,2,null,e,null,null),yo(),t[vr]=null}};function qo(e){this._internalRoot=e}qo.prototype.unstable_scheduleHydration=function(e){if(e){var t=wi();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&zp(e)}};var Bp=s.version;if(Bp!=="19.2.4")throw Error(i(527,Bp,"19.2.4"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Db={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ho=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ho.isDisabled&&Ho.supportsFiber)try{qn=Ho.inject(Db),Ot=Ho}catch{}}return ul.createRoot=function(e,t){if(!d(e))throw Error(i(299));var n=!1,r="",c=Ym,u=Xm,p=Km;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Cp(e,1,!1,null,null,n,r,null,c,u,p,Lp),e[vr]=t.current,hu(e),new Ou(t)},ul.hydrateRoot=function(e,t,n){if(!d(e))throw Error(i(299));var r=!1,c="",u=Ym,p=Xm,b=Km,T=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=Cp(e,1,!0,t,n??null,r,c,T,u,p,b,Lp),t.context=Tp(null),n=t.current,r=na(),r=xr(r),c=hn(r),c.callback=null,pn(n,c,r),n=r,t.current.lanes=n,Ie(t,n),Ma(t),e[vr]=t.current,hu(e),new qo(t)},ul.version="19.2.4",ul}var $p;function Fb(){if($p)return Uu.exports;$p=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),Uu.exports=Vb(),Uu.exports}var Yb=Fb();var Zp="popstate";function Xb(a={}){function s(i,d){let{pathname:f,search:m,hash:v}=i.location;return td("",{pathname:f,search:m,hash:v},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function o(i,d){return typeof d=="string"?d:vl(d)}return $b(s,o,null,a)}function Pe(a,s){if(a===!1||a===null||typeof a>"u")throw new Error(s)}function Sa(a,s){if(!a){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function Kb(){return Math.random().toString(36).substring(2,10)}function Jp(a,s){return{usr:a.state,key:a.key,idx:s}}function td(a,s,o=null,i){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof s=="string"?is(s):s,state:o,key:s&&s.key||i||Kb()}}function vl({pathname:a="/",search:s="",hash:o=""}){return s&&s!=="?"&&(a+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function is(a){let s={};if(a){let o=a.indexOf("#");o>=0&&(s.hash=a.substring(o),a=a.substring(0,o));let i=a.indexOf("?");i>=0&&(s.search=a.substring(i),a=a.substring(0,i)),a&&(s.pathname=a)}return s}function $b(a,s,o,i={}){let{window:d=document.defaultView,v5Compat:f=!1}=i,m=d.history,v="POP",g=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function x(){v="POP";let _=y(),A=_==null?null:_-h;h=_,g&&g({action:v,location:E.location,delta:A})}function j(_,A){v="PUSH";let k=td(E.location,_,A);h=y()+1;let X=Jp(k,h),I=E.createHref(k);try{m.pushState(X,"",I)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;d.location.assign(I)}f&&g&&g({action:v,location:E.location,delta:1})}function M(_,A){v="REPLACE";let k=td(E.location,_,A);h=y();let X=Jp(k,h),I=E.createHref(k);m.replaceState(X,"",I),f&&g&&g({action:v,location:E.location,delta:0})}function w(_){return Zb(_)}let E={get action(){return v},get location(){return a(d,m)},listen(_){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Zp,x),g=_,()=>{d.removeEventListener(Zp,x),g=null}},createHref(_){return s(d,_)},createURL:w,encodeLocation(_){let A=w(_);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:j,replace:M,go(_){return m.go(_)}};return E}function Zb(a,s=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),Pe(o,"No window.location.(origin|href) available to create URL");let i=typeof a=="string"?a:vl(a);return i=i.replace(/ $/,"%20"),!s&&i.startsWith("//")&&(i=o+i),new URL(i,o)}function Px(a,s,o="/"){return Jb(a,s,o,!1)}function Jb(a,s,o,i){let d=typeof s=="string"?is(s):s,f=an(d.pathname||"/",o);if(f==null)return null;let m=Ix(a);Pb(m);let v=null;for(let g=0;v==null&&g<m.length;++g){let h=i0(f);v=l0(m[g],h,i)}return v}function Ix(a,s=[],o=[],i="",d=!1){let f=(m,v,g=d,h)=>{let y={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:v,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&g)return;Pe(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let x=tn([i,y.relativePath]),j=o.concat(y);m.children&&m.children.length>0&&(Pe(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Ix(m.children,s,j,x,g)),!(m.path==null&&!m.index)&&s.push({path:x,score:r0(x,m.index),routesMeta:j})};return a.forEach((m,v)=>{if(m.path===""||!m.path?.includes("?"))f(m,v);else for(let g of Wx(m.path))f(m,v,!0,g)}),s}function Wx(a){let s=a.split("/");if(s.length===0)return[];let[o,...i]=s,d=o.endsWith("?"),f=o.replace(/\?$/,"");if(i.length===0)return d?[f,""]:[f];let m=Wx(i.join("/")),v=[];return v.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&v.push(...m),v.map(g=>a.startsWith("/")&&g===""?"/":g)}function Pb(a){a.sort((s,o)=>s.score!==o.score?o.score-s.score:s0(s.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var Ib=/^:[\w-]+$/,Wb=3,e0=2,t0=1,a0=10,n0=-2,Pp=a=>a==="*";function r0(a,s){let o=a.split("/"),i=o.length;return o.some(Pp)&&(i+=n0),s&&(i+=e0),o.filter(d=>!Pp(d)).reduce((d,f)=>d+(Ib.test(f)?Wb:f===""?t0:a0),i)}function s0(a,s){return a.length===s.length&&a.slice(0,-1).every((i,d)=>i===s[d])?a[a.length-1]-s[s.length-1]:0}function l0(a,s,o=!1){let{routesMeta:i}=a,d={},f="/",m=[];for(let v=0;v<i.length;++v){let g=i[v],h=v===i.length-1,y=f==="/"?s:s.slice(f.length)||"/",x=ni({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),j=g.route;if(!x&&h&&o&&!i[i.length-1].route.index&&(x=ni({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!x)return null;Object.assign(d,x.params),m.push({params:d,pathname:tn([f,x.pathname]),pathnameBase:f0(tn([f,x.pathnameBase])),route:j}),x.pathnameBase!=="/"&&(f=tn([f,x.pathnameBase]))}return m}function ni(a,s){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=o0(a.path,a.caseSensitive,a.end),d=s.match(o);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),v=d.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:x},j)=>{if(y==="*"){let w=v[j]||"";m=f.slice(0,f.length-w.length).replace(/(.)\/+$/,"$1")}const M=v[j];return x&&!M?h[y]=void 0:h[y]=(M||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:a}}function o0(a,s=!1,o=!0){Sa(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let i=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,v,g)=>(i.push({paramName:v,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,s?void 0:"i"),i]}function i0(a){try{return a.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return Sa(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),a}}function an(a,s){if(s==="/")return a;if(!a.toLowerCase().startsWith(s.toLowerCase()))return null;let o=s.endsWith("/")?s.length-1:s.length,i=a.charAt(o);return i&&i!=="/"?null:a.slice(o)||"/"}var c0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function u0(a,s="/"){let{pathname:o,search:i="",hash:d=""}=typeof a=="string"?is(a):a,f;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?f=Ip(o.substring(1),"/"):f=Ip(o,s)):f=s,{pathname:f,search:m0(i),hash:h0(d)}}function Ip(a,s){let o=s.replace(/\/+$/,"").split("/");return a.split("/").forEach(d=>{d===".."?o.length>1&&o.pop():d!=="."&&o.push(d)}),o.length>1?o.join("/"):"/"}function Hu(a,s,o,i){return`Cannot include a '${a}' character in a manually specified \`to.${s}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function d0(a){return a.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function yd(a){let s=d0(a);return s.map((o,i)=>i===s.length-1?o.pathname:o.pathnameBase)}function bd(a,s,o,i=!1){let d;typeof a=="string"?d=is(a):(d={...a},Pe(!d.pathname||!d.pathname.includes("?"),Hu("?","pathname","search",d)),Pe(!d.pathname||!d.pathname.includes("#"),Hu("#","pathname","hash",d)),Pe(!d.search||!d.search.includes("#"),Hu("#","search","hash",d)));let f=a===""||d.pathname==="",m=f?"/":d.pathname,v;if(m==null)v=o;else{let x=s.length-1;if(!i&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),x-=1;d.pathname=j.join("/")}v=x>=0?s[x]:"/"}let g=u0(d,v),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var tn=a=>a.join("/").replace(/\/\/+/g,"/"),f0=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),m0=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,h0=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,p0=class{constructor(a,s,o,i=!1){this.status=a,this.statusText=s||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function x0(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function v0(a){return a.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ev=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tv(a,s){let o=a;if(typeof o!="string"||!c0.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,d=!1;if(ev)try{let f=new URL(window.location.href),m=o.startsWith("//")?new URL(f.protocol+o):new URL(o),v=an(m.pathname,s);m.origin===f.origin&&v!=null?o=v+m.search+m.hash:d=!0}catch{Sa(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:d,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var av=["POST","PUT","PATCH","DELETE"];new Set(av);var g0=["GET",...av];new Set(g0);var cs=N.createContext(null);cs.displayName="DataRouter";var ui=N.createContext(null);ui.displayName="DataRouterState";var y0=N.createContext(!1),nv=N.createContext({isTransitioning:!1});nv.displayName="ViewTransition";var b0=N.createContext(new Map);b0.displayName="Fetchers";var N0=N.createContext(null);N0.displayName="Await";var sa=N.createContext(null);sa.displayName="Navigation";var yl=N.createContext(null);yl.displayName="Location";var va=N.createContext({outlet:null,matches:[],isDataRoute:!1});va.displayName="Route";var Nd=N.createContext(null);Nd.displayName="RouteError";var rv="REACT_ROUTER_ERROR",j0="REDIRECT",S0="ROUTE_ERROR_RESPONSE";function w0(a){if(a.startsWith(`${rv}:${j0}:{`))try{let s=JSON.parse(a.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function E0(a){if(a.startsWith(`${rv}:${S0}:{`))try{let s=JSON.parse(a.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new p0(s.status,s.statusText,s.data)}catch{}}function C0(a,{relative:s}={}){Pe(us(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=N.useContext(sa),{hash:d,pathname:f,search:m}=bl(a,{relative:s}),v=f;return o!=="/"&&(v=f==="/"?o:tn([o,f])),i.createHref({pathname:v,search:m,hash:d})}function us(){return N.useContext(yl)!=null}function zn(){return Pe(us(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(yl).location}var sv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lv(a){N.useContext(sa).static||N.useLayoutEffect(a)}function wa(){let{isDataRoute:a}=N.useContext(va);return a?Q0():T0()}function T0(){Pe(us(),"useNavigate() may be used only in the context of a <Router> component.");let a=N.useContext(cs),{basename:s,navigator:o}=N.useContext(sa),{matches:i}=N.useContext(va),{pathname:d}=zn(),f=JSON.stringify(yd(i)),m=N.useRef(!1);return lv(()=>{m.current=!0}),N.useCallback((g,h={})=>{if(Sa(m.current,sv),!m.current)return;if(typeof g=="number"){o.go(g);return}let y=bd(g,JSON.parse(f),d,h.relative==="path");a==null&&s!=="/"&&(y.pathname=y.pathname==="/"?s:tn([s,y.pathname])),(h.replace?o.replace:o.push)(y,h.state,h)},[s,o,f,d,a])}var _0=N.createContext(null);function R0(a){let s=N.useContext(va).outlet;return N.useMemo(()=>s&&N.createElement(_0.Provider,{value:a},s),[s,a])}function k0(){let{matches:a}=N.useContext(va),s=a[a.length-1];return s?s.params:{}}function bl(a,{relative:s}={}){let{matches:o}=N.useContext(va),{pathname:i}=zn(),d=JSON.stringify(yd(o));return N.useMemo(()=>bd(a,JSON.parse(d),i,s==="path"),[a,d,i,s])}function M0(a,s){return ov(a,s)}function ov(a,s,o,i,d){Pe(us(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=N.useContext(sa),{matches:m}=N.useContext(va),v=m[m.length-1],g=v?v.params:{},h=v?v.pathname:"/",y=v?v.pathnameBase:"/",x=v&&v.route;{let k=x&&x.path||"";cv(h,!x||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
10
 
11
- Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let j=zn(),M;if(s){let k=typeof s=="string"?is(s):s;Pe(y==="/"||k.pathname?.startsWith(y),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${k.pathname}" was given in the \`location\` prop.`),M=k}else M=j;let w=M.pathname||"/",E=w;if(y!=="/"){let k=y.replace(/^\//,"").split("/");E="/"+w.replace(/^\//,"").split("/").slice(k.length).join("/")}let _=Px(a,{pathname:E});Sa(x||_!=null,`No routes matched location "${M.pathname}${M.search}${M.hash}" `),Sa(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${M.pathname}${M.search}${M.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let O=U0(_&&_.map(k=>Object.assign({},k,{params:Object.assign({},g,k.params),pathname:tn([y,f.encodeLocation?f.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?y:tn([y,f.encodeLocation?f.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),m,o,i,d);return s&&O?N.createElement(yl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...M},navigationType:"POP"}},O):O}function A0(){let a=G0(),s=x0(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),o=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",a),m=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:f},"ErrorBoundary")," or"," ",N.createElement("code",{style:f},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},s),o?N.createElement("pre",{style:d},o):null,m)}var O0=N.createElement(A0,null),iv=class extends N.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,s){return s.location!==a.location||s.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:s.error,location:s.location,revalidation:a.revalidation||s.revalidation}}componentDidCatch(a,s){this.props.onError?this.props.onError(a,s):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const o=E0(a.digest);o&&(a=o)}let s=a!==void 0?N.createElement(va.Provider,{value:this.props.routeContext},N.createElement(Nd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?N.createElement(z0,{error:a},s):s}};iv.contextType=y0;var Gu=new WeakMap;function z0({children:a,error:s}){let{basename:o}=N.useContext(sa);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let i=w0(s.digest);if(i){let d=Gu.get(s);if(d)throw d;let f=tv(i.location,o);if(ev&&!Gu.get(s))if(f.isExternal||i.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:i.replace}));throw Gu.set(s,m),m}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function D0({routeContext:a,match:s,children:o}){let i=N.useContext(cs);return i&&i.static&&i.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=s.route.id),N.createElement(va.Provider,{value:a},o)}function U0(a,s=[],o=null,i=null,d=null){if(a==null){if(!o)return null;if(o.errors)a=o.matches;else if(s.length===0&&!o.initialized&&o.matches.length>0)a=o.matches;else return null}let f=a,m=o?.errors;if(m!=null){let y=f.findIndex(x=>x.route.id&&m?.[x.route.id]!==void 0);Pe(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,y+1))}let v=!1,g=-1;if(o)for(let y=0;y<f.length;y++){let x=f[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(g=y),x.route.id){let{loaderData:j,errors:M}=o,w=x.route.loader&&!j.hasOwnProperty(x.route.id)&&(!M||M[x.route.id]===void 0);if(x.route.lazy||w){v=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let h=o&&i?(y,x)=>{i(y,{location:o.location,params:o.matches?.[0]?.params??{},unstable_pattern:v0(o.matches),errorInfo:x})}:void 0;return f.reduceRight((y,x,j)=>{let M,w=!1,E=null,_=null;o&&(M=m&&x.route.id?m[x.route.id]:void 0,E=x.route.errorElement||O0,v&&(g<0&&j===0?(cv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,_=null):g===j&&(w=!0,_=x.route.hydrateFallbackElement||null)));let O=s.concat(f.slice(0,j+1)),k=()=>{let G;return M?G=E:w?G=_:x.route.Component?G=N.createElement(x.route.Component,null):x.route.element?G=x.route.element:G=y,N.createElement(D0,{match:x,routeContext:{outlet:y,matches:O,isDataRoute:o!=null},children:G})};return o&&(x.route.ErrorBoundary||x.route.errorElement||j===0)?N.createElement(iv,{location:o.location,revalidation:o.revalidation,component:E,error:M,children:k(),routeContext:{outlet:null,matches:O,isDataRoute:!0},onError:h}):k()},null)}function jd(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L0(a){let s=N.useContext(cs);return Pe(s,jd(a)),s}function B0(a){let s=N.useContext(ui);return Pe(s,jd(a)),s}function q0(a){let s=N.useContext(va);return Pe(s,jd(a)),s}function Sd(a){let s=q0(a),o=s.matches[s.matches.length-1];return Pe(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function H0(){return Sd("useRouteId")}function G0(){let a=N.useContext(Nd),s=B0("useRouteError"),o=Sd("useRouteError");return a!==void 0?a:s.errors?.[o]}function Q0(){let{router:a}=L0("useNavigate"),s=Sd("useNavigate"),o=N.useRef(!1);return lv(()=>{o.current=!0}),N.useCallback(async(d,f={})=>{Sa(o.current,sv),o.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:s,...f}))},[a,s])}var Wp={};function cv(a,s,o){!s&&!Wp[a]&&(Wp[a]=!0,Sa(!1,o))}N.memo(V0);function V0({routes:a,future:s,state:o,onError:i}){return ov(a,void 0,o,i,s)}function ri({to:a,replace:s,state:o,relative:i}){Pe(us(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=N.useContext(sa);Sa(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=N.useContext(va),{pathname:m}=zn(),v=wa(),g=bd(a,yd(f),m,i==="path"),h=JSON.stringify(g);return N.useEffect(()=>{v(JSON.parse(h),{replace:s,state:o,relative:i})},[v,h,i,s,o]),null}function F0(a){return R0(a.context)}function mt(a){Pe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Y0({basename:a="/",children:s=null,location:o,navigationType:i="POP",navigator:d,static:f=!1,unstable_useTransitions:m}){Pe(!us(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let v=a.replace(/^\/*/,"/"),g=N.useMemo(()=>({basename:v,navigator:d,static:f,unstable_useTransitions:m,future:{}}),[v,d,f,m]);typeof o=="string"&&(o=is(o));let{pathname:h="/",search:y="",hash:x="",state:j=null,key:M="default"}=o,w=N.useMemo(()=>{let E=an(h,v);return E==null?null:{location:{pathname:E,search:y,hash:x,state:j,key:M},navigationType:i}},[v,h,y,x,j,M,i]);return Sa(w!=null,`<Router basename="${v}"> is not able to match the URL "${h}${y}${x}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:N.createElement(sa.Provider,{value:g},N.createElement(yl.Provider,{children:s,value:w}))}function X0({children:a,location:s}){return M0(ad(a),s)}function ad(a,s=[]){let o=[];return N.Children.forEach(a,(i,d)=>{if(!N.isValidElement(i))return;let f=[...s,d];if(i.type===N.Fragment){o.push.apply(o,ad(i.props.children,f));return}Pe(i.type===mt,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let m={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(m.children=ad(i.props.children,f)),o.push(m)}),o}var Po="get",Io="application/x-www-form-urlencoded";function di(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function K0(a){return di(a)&&a.tagName.toLowerCase()==="button"}function $0(a){return di(a)&&a.tagName.toLowerCase()==="form"}function Z0(a){return di(a)&&a.tagName.toLowerCase()==="input"}function J0(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function P0(a,s){return a.button===0&&(!s||s==="_self")&&!J0(a)}var Go=null;function I0(){if(Go===null)try{new FormData(document.createElement("form"),0),Go=!1}catch{Go=!0}return Go}var W0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qu(a){return a!=null&&!W0.has(a)?(Sa(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Io}"`),null):a}function e1(a,s){let o,i,d,f,m;if($0(a)){let v=a.getAttribute("action");i=v?an(v,s):null,o=a.getAttribute("method")||Po,d=Qu(a.getAttribute("enctype"))||Io,f=new FormData(a)}else if(K0(a)||Z0(a)&&(a.type==="submit"||a.type==="image")){let v=a.form;if(v==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||v.getAttribute("action");if(i=g?an(g,s):null,o=a.getAttribute("formmethod")||v.getAttribute("method")||Po,d=Qu(a.getAttribute("formenctype"))||Qu(v.getAttribute("enctype"))||Io,f=new FormData(v,a),!I0()){let{name:h,type:y,value:x}=a;if(y==="image"){let j=h?`${h}.`:"";f.append(`${j}x`,"0"),f.append(`${j}y`,"0")}else h&&f.append(h,x)}}else{if(di(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Po,i=null,d=Io,m=a}return f&&d==="text/plain"&&(m=f,f=void 0),{action:i,method:o.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function wd(a,s){if(a===!1||a===null||typeof a>"u")throw new Error(s)}function t1(a,s,o,i){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return o?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${i}`:d.pathname=`${d.pathname}.${i}`:d.pathname==="/"?d.pathname=`_root.${i}`:s&&an(d.pathname,s)==="/"?d.pathname=`${s.replace(/\/$/,"")}/_root.${i}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${i}`,d}async function a1(a,s){if(a.id in s)return s[a.id];try{let o=await import(a.module);return s[a.id]=o,o}catch(o){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function n1(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function r1(a,s,o){let i=await Promise.all(a.map(async d=>{let f=s.routes[d.route.id];if(f){let m=await a1(f,o);return m.links?m.links():[]}return[]}));return i1(i.flat(1).filter(n1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function ex(a,s,o,i,d,f){let m=(g,h)=>o[h]?g.route.id!==o[h].route.id:!0,v=(g,h)=>o[h].pathname!==g.pathname||o[h].route.path?.endsWith("*")&&o[h].params["*"]!==g.params["*"];return f==="assets"?s.filter((g,h)=>m(g,h)||v(g,h)):f==="data"?s.filter((g,h)=>{let y=i.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||v(g,h))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function s1(a,s,{includeHydrateFallback:o}={}){return l1(a.map(i=>{let d=s.routes[i.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),o&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function l1(a){return[...new Set(a)]}function o1(a){let s={},o=Object.keys(a).sort();for(let i of o)s[i]=a[i];return s}function i1(a,s){let o=new Set;return new Set(s),a.reduce((i,d)=>{let f=JSON.stringify(o1(d));return o.has(f)||(o.add(f),i.push({key:f,link:d})),i},[])}function uv(){let a=N.useContext(cs);return wd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function c1(){let a=N.useContext(ui);return wd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Ed=N.createContext(void 0);Ed.displayName="FrameworkContext";function dv(){let a=N.useContext(Ed);return wd(a,"You must render this element inside a <HydratedRouter> element"),a}function u1(a,s){let o=N.useContext(Ed),[i,d]=N.useState(!1),[f,m]=N.useState(!1),{onFocus:v,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:x}=s,j=N.useRef(null);N.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let E=O=>{O.forEach(k=>{m(k.isIntersecting)})},_=new IntersectionObserver(E,{threshold:.5});return j.current&&_.observe(j.current),()=>{_.disconnect()}}},[a]),N.useEffect(()=>{if(i){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[i]);let M=()=>{d(!0)},w=()=>{d(!1),m(!1)};return o?a!=="intent"?[f,j,{}]:[f,j,{onFocus:dl(v,M),onBlur:dl(g,w),onMouseEnter:dl(h,M),onMouseLeave:dl(y,w),onTouchStart:dl(x,M)}]:[!1,j,{}]}function dl(a,s){return o=>{a&&a(o),o.defaultPrevented||s(o)}}function d1({page:a,...s}){let{router:o}=uv(),i=N.useMemo(()=>Px(o.routes,a,o.basename),[o.routes,a,o.basename]);return i?N.createElement(m1,{page:a,matches:i,...s}):null}function f1(a){let{manifest:s,routeModules:o}=dv(),[i,d]=N.useState([]);return N.useEffect(()=>{let f=!1;return r1(a,s,o).then(m=>{f||d(m)}),()=>{f=!0}},[a,s,o]),i}function m1({page:a,matches:s,...o}){let i=zn(),{future:d,manifest:f,routeModules:m}=dv(),{basename:v}=uv(),{loaderData:g,matches:h}=c1(),y=N.useMemo(()=>ex(a,s,h,f,i,"data"),[a,s,h,f,i]),x=N.useMemo(()=>ex(a,s,h,f,i,"assets"),[a,s,h,f,i]),j=N.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,_=!1;if(s.forEach(k=>{let G=f.routes[k.route.id];!G||!G.hasLoader||(!y.some($=>$.route.id===k.route.id)&&k.route.id in g&&m[k.route.id]?.shouldRevalidate||G.hasClientLoader?_=!0:E.add(k.route.id))}),E.size===0)return[];let O=t1(a,v,d.unstable_trailingSlashAwareDataRequests,"data");return _&&E.size>0&&O.searchParams.set("_routes",s.filter(k=>E.has(k.route.id)).map(k=>k.route.id).join(",")),[O.pathname+O.search]},[v,d.unstable_trailingSlashAwareDataRequests,g,i,f,y,s,a,m]),M=N.useMemo(()=>s1(x,f),[x,f]),w=f1(x);return N.createElement(N.Fragment,null,j.map(E=>N.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),M.map(E=>N.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),w.map(({key:E,link:_})=>N.createElement("link",{key:E,nonce:o.nonce,..._,crossOrigin:_.crossOrigin??o.crossOrigin})))}function h1(...a){return s=>{a.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var p1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{p1&&(window.__reactRouterVersion="7.13.0")}catch{}function x1({basename:a,children:s,unstable_useTransitions:o,window:i}){let d=N.useRef();d.current==null&&(d.current=Xb({window:i,v5Compat:!0}));let f=d.current,[m,v]=N.useState({action:f.action,location:f.location}),g=N.useCallback(h=>{o===!1?v(h):N.startTransition(()=>v(h))},[o]);return N.useLayoutEffect(()=>f.listen(g),[f,g]),N.createElement(Y0,{basename:a,children:s,location:m.location,navigationType:m.action,navigator:f,unstable_useTransitions:o})}var fv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cd=N.forwardRef(function({onClick:s,discover:o="render",prefetch:i="none",relative:d,reloadDocument:f,replace:m,state:v,target:g,to:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:j,...M},w){let{basename:E,unstable_useTransitions:_}=N.useContext(sa),O=typeof h=="string"&&fv.test(h),k=tv(h,E);h=k.to;let G=C0(h,{relative:d}),[$,W,te]=u1(i,M),H=y1(h,{replace:m,state:v,target:g,preventScrollReset:y,relative:d,viewTransition:x,unstable_defaultShouldRevalidate:j,unstable_useTransitions:_});function z(be){s&&s(be),be.defaultPrevented||H(be)}let oe=N.createElement("a",{...M,...te,href:k.absoluteURL||G,onClick:k.isExternal||f?s:z,ref:h1(w,W),target:g,"data-discover":!O&&o==="render"?"true":void 0});return $&&!O?N.createElement(N.Fragment,null,oe,N.createElement(d1,{page:G})):oe});Cd.displayName="Link";var mv=N.forwardRef(function({"aria-current":s="page",caseSensitive:o=!1,className:i="",end:d=!1,style:f,to:m,viewTransition:v,children:g,...h},y){let x=bl(m,{relative:h.relative}),j=zn(),M=N.useContext(ui),{navigator:w,basename:E}=N.useContext(sa),_=M!=null&&w1(x)&&v===!0,O=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,k=j.pathname,G=M&&M.navigation&&M.navigation.location?M.navigation.location.pathname:null;o||(k=k.toLowerCase(),G=G?G.toLowerCase():null,O=O.toLowerCase()),G&&E&&(G=an(G,E)||G);const $=O!=="/"&&O.endsWith("/")?O.length-1:O.length;let W=k===O||!d&&k.startsWith(O)&&k.charAt($)==="/",te=G!=null&&(G===O||!d&&G.startsWith(O)&&G.charAt(O.length)==="/"),H={isActive:W,isPending:te,isTransitioning:_},z=W?s:void 0,oe;typeof i=="function"?oe=i(H):oe=[i,W?"active":null,te?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let be=typeof f=="function"?f(H):f;return N.createElement(Cd,{...h,"aria-current":z,className:oe,ref:y,style:be,to:m,viewTransition:v},typeof g=="function"?g(H):g)});mv.displayName="NavLink";var v1=N.forwardRef(({discover:a="render",fetcherKey:s,navigate:o,reloadDocument:i,replace:d,state:f,method:m=Po,action:v,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:j,...M},w)=>{let{unstable_useTransitions:E}=N.useContext(sa),_=j1(),O=S1(v,{relative:h}),k=m.toLowerCase()==="get"?"get":"post",G=typeof v=="string"&&fv.test(v),$=W=>{if(g&&g(W),W.defaultPrevented)return;W.preventDefault();let te=W.nativeEvent.submitter,H=te?.getAttribute("formmethod")||m,z=()=>_(te||W.currentTarget,{fetcherKey:s,method:H,navigate:o,replace:d,state:f,relative:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:j});E&&o!==!1?N.startTransition(()=>z()):z()};return N.createElement("form",{ref:w,method:k,action:O,onSubmit:i?g:$,...M,"data-discover":!G&&a==="render"?"true":void 0})});v1.displayName="Form";function g1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hv(a){let s=N.useContext(cs);return Pe(s,g1(a)),s}function y1(a,{target:s,replace:o,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v,unstable_useTransitions:g}={}){let h=wa(),y=zn(),x=bl(a,{relative:f});return N.useCallback(j=>{if(P0(j,s)){j.preventDefault();let M=o!==void 0?o:vl(y)===vl(x),w=()=>h(a,{replace:M,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v});g?N.startTransition(()=>w()):w()}},[y,h,x,o,i,s,a,d,f,m,v,g])}var b1=0,N1=()=>`__${String(++b1)}__`;function j1(){let{router:a}=hv("useSubmit"),{basename:s}=N.useContext(sa),o=H0(),i=a.fetch,d=a.navigate;return N.useCallback(async(f,m={})=>{let{action:v,method:g,encType:h,formData:y,body:x}=e1(f,s);if(m.navigate===!1){let j=m.fetcherKey||N1();await i(j,o,m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await d(m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:o,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,d,s,o])}function S1(a,{relative:s}={}){let{basename:o}=N.useContext(sa),i=N.useContext(va);Pe(i,"useFormAction must be used inside a RouteContext");let[d]=i.matches.slice(-1),f={...bl(a||".",{relative:s})},m=zn();if(a==null){f.search=m.search;let v=new URLSearchParams(f.search),g=v.getAll("index");if(g.some(y=>y==="")){v.delete("index"),g.filter(x=>x).forEach(x=>v.append("index",x));let y=v.toString();f.search=y?`?${y}`:""}}return(!a||a===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(f.pathname=f.pathname==="/"?o:tn([o,f.pathname])),vl(f)}function w1(a,{relative:s}={}){let o=N.useContext(nv);Pe(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=hv("useViewTransitionState"),d=bl(a,{relative:s});if(!o.isTransitioning)return!1;let f=an(o.currentLocation.pathname,i)||o.currentLocation.pathname,m=an(o.nextLocation.pathname,i)||o.nextLocation.pathname;return ni(d.pathname,m)!=null||ni(d.pathname,f)!=null}var E1=Jx();const C1=Zx(E1);var ds=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},T1={setTimeout:(a,s)=>setTimeout(a,s),clearTimeout:a=>clearTimeout(a),setInterval:(a,s)=>setInterval(a,s),clearInterval:a=>clearInterval(a)},_1=class{#e=T1;#t=!1;setTimeoutProvider(a){this.#e=a}setTimeout(a,s){return this.#e.setTimeout(a,s)}clearTimeout(a){this.#e.clearTimeout(a)}setInterval(a,s){return this.#e.setInterval(a,s)}clearInterval(a){this.#e.clearInterval(a)}},lr=new _1;function R1(a){setTimeout(a,0)}var cr=typeof window>"u"||"Deno"in globalThis;function Dt(){}function k1(a,s){return typeof a=="function"?a(s):a}function nd(a){return typeof a=="number"&&a>=0&&a!==1/0}function pv(a,s){return Math.max(a+(s||0)-Date.now(),0)}function An(a,s){return typeof a=="function"?a(s):a}function xa(a,s){return typeof a=="function"?a(s):a}function tx(a,s){const{type:o="all",exact:i,fetchStatus:d,predicate:f,queryKey:m,stale:v}=a;if(m){if(i){if(s.queryHash!==Td(m,s.options))return!1}else if(!gl(s.queryKey,m))return!1}if(o!=="all"){const g=s.isActive();if(o==="active"&&!g||o==="inactive"&&g)return!1}return!(typeof v=="boolean"&&s.isStale()!==v||d&&d!==s.state.fetchStatus||f&&!f(s))}function ax(a,s){const{exact:o,status:i,predicate:d,mutationKey:f}=a;if(f){if(!s.options.mutationKey)return!1;if(o){if(ur(s.options.mutationKey)!==ur(f))return!1}else if(!gl(s.options.mutationKey,f))return!1}return!(i&&s.state.status!==i||d&&!d(s))}function Td(a,s){return(s?.queryKeyHashFn||ur)(a)}function ur(a){return JSON.stringify(a,(s,o)=>rd(o)?Object.keys(o).sort().reduce((i,d)=>(i[d]=o[d],i),{}):o)}function gl(a,s){return a===s?!0:typeof a!=typeof s?!1:a&&s&&typeof a=="object"&&typeof s=="object"?Object.keys(s).every(o=>gl(a[o],s[o])):!1}var M1=Object.prototype.hasOwnProperty;function xv(a,s,o=0){if(a===s)return a;if(o>500)return s;const i=nx(a)&&nx(s);if(!i&&!(rd(a)&&rd(s)))return s;const f=(i?a:Object.keys(a)).length,m=i?s:Object.keys(s),v=m.length,g=i?new Array(v):{};let h=0;for(let y=0;y<v;y++){const x=i?y:m[y],j=a[x],M=s[x];if(j===M){g[x]=j,(i?y<f:M1.call(a,x))&&h++;continue}if(j===null||M===null||typeof j!="object"||typeof M!="object"){g[x]=M;continue}const w=xv(j,M,o+1);g[x]=w,w===j&&h++}return f===v&&h===f?a:g}function si(a,s){if(!s||Object.keys(a).length!==Object.keys(s).length)return!1;for(const o in a)if(a[o]!==s[o])return!1;return!0}function nx(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function rd(a){if(!rx(a))return!1;const s=a.constructor;if(s===void 0)return!0;const o=s.prototype;return!(!rx(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function rx(a){return Object.prototype.toString.call(a)==="[object Object]"}function A1(a){return new Promise(s=>{lr.setTimeout(s,a)})}function sd(a,s,o){return typeof o.structuralSharing=="function"?o.structuralSharing(a,s):o.structuralSharing!==!1?xv(a,s):s}function O1(a,s,o=0){const i=[...a,s];return o&&i.length>o?i.slice(1):i}function z1(a,s,o=0){const i=[s,...a];return o&&i.length>o?i.slice(0,-1):i}var _d=Symbol();function vv(a,s){return!a.queryFn&&s?.initialPromise?()=>s.initialPromise:!a.queryFn||a.queryFn===_d?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function Rd(a,s){return typeof a=="function"?a(...s):!!a}function D1(a,s,o){let i=!1,d;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(d??=s(),i||(i=!0,d.aborted?o():d.addEventListener("abort",o,{once:!0})),d)}),a}var U1=class extends ds{#e;#t;#a;constructor(){super(),this.#a=a=>{if(!cr&&window.addEventListener){const s=()=>a();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#a=a,this.#t?.(),this.#t=a(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()})}setFocused(a){this.#e!==a&&(this.#e=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(s=>{s(a)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},kd=new U1;function ld(){let a,s;const o=new Promise((d,f)=>{a=d,s=f});o.status="pending",o.catch(()=>{});function i(d){Object.assign(o,d),delete o.resolve,delete o.reject}return o.resolve=d=>{i({status:"fulfilled",value:d}),a(d)},o.reject=d=>{i({status:"rejected",reason:d}),s(d)},o}var L1=R1;function B1(){let a=[],s=0,o=v=>{v()},i=v=>{v()},d=L1;const f=v=>{s?a.push(v):d(()=>{o(v)})},m=()=>{const v=a;a=[],v.length&&d(()=>{i(()=>{v.forEach(g=>{o(g)})})})};return{batch:v=>{let g;s++;try{g=v()}finally{s--,s||m()}return g},batchCalls:v=>(...g)=>{f(()=>{v(...g)})},schedule:f,setNotifyFunction:v=>{o=v},setBatchNotifyFunction:v=>{i=v},setScheduler:v=>{d=v}}}var ht=B1(),q1=class extends ds{#e=!0;#t;#a;constructor(){super(),this.#a=a=>{if(!cr&&window.addEventListener){const s=()=>a(!0),o=()=>a(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#a=a,this.#t?.(),this.#t=a(this.setOnline.bind(this))}setOnline(a){this.#e!==a&&(this.#e=a,this.listeners.forEach(o=>{o(a)}))}isOnline(){return this.#e}},li=new q1;function H1(a){return Math.min(1e3*2**a,3e4)}function gv(a){return(a??"online")==="online"?li.isOnline():!0}var od=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function yv(a){let s=!1,o=0,i;const d=ld(),f=()=>d.status!=="pending",m=E=>{if(!f()){const _=new od(E);j(_),a.onCancel?.(_)}},v=()=>{s=!0},g=()=>{s=!1},h=()=>kd.isFocused()&&(a.networkMode==="always"||li.isOnline())&&a.canRun(),y=()=>gv(a.networkMode)&&a.canRun(),x=E=>{f()||(i?.(),d.resolve(E))},j=E=>{f()||(i?.(),d.reject(E))},M=()=>new Promise(E=>{i=_=>{(f()||h())&&E(_)},a.onPause?.()}).then(()=>{i=void 0,f()||a.onContinue?.()}),w=()=>{if(f())return;let E;const _=o===0?a.initialPromise:void 0;try{E=_??a.fn()}catch(O){E=Promise.reject(O)}Promise.resolve(E).then(x).catch(O=>{if(f())return;const k=a.retry??(cr?0:3),G=a.retryDelay??H1,$=typeof G=="function"?G(o,O):G,W=k===!0||typeof k=="number"&&o<k||typeof k=="function"&&k(o,O);if(s||!W){j(O);return}o++,a.onFail?.(o,O),A1($).then(()=>h()?void 0:M()).then(()=>{s?j(O):w()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(i?.(),d),cancelRetry:v,continueRetry:g,canStart:y,start:()=>(y()?w():M().then(w),d)}}var bv=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nd(this.gcTime)&&(this.#e=lr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(cr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(lr.clearTimeout(this.#e),this.#e=void 0)}},G1=class extends bv{#e;#t;#a;#r;#n;#l;#o;constructor(a){super(),this.#o=!1,this.#l=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#r=a.client,this.#a=this.#r.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#e=lx(this.options),this.state=a.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(a){if(this.options={...this.#l,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=lx(this.options);s.data!==void 0&&(this.setState(sx(s.data,s.dataUpdatedAt)),this.#e=s)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(a,s){const o=sd(this.state.data,a,this.options);return this.#s({data:o,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),o}setState(a,s){this.#s({type:"setState",state:a,setStateOptions:s})}cancel(a){const s=this.#n?.promise;return this.#n?.cancel(a),s?s.then(Dt).catch(Dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(a=>xa(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_d||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>An(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!pv(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(s=>s.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(s=>s.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(s=>s!==a),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(a,s){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(a&&this.setOptions(a),!this.options.queryFn){const v=this.observers.find(g=>g.options.queryFn);v&&this.setOptions(v.options)}const o=new AbortController,i=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(this.#o=!0,o.signal)})},d=()=>{const v=vv(this.options,s),h=(()=>{const y={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(y),y})();return this.#o=!1,this.options.persister?this.options.persister(v,h,this):v(h)},m=(()=>{const v={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:d};return i(v),v})();this.options.behavior?.onFetch(m,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#s({type:"fetch",meta:m.fetchOptions?.meta}),this.#n=yv({initialPromise:s?.initialPromise,fn:m.fetchFn,onCancel:v=>{v instanceof od&&v.revert&&this.setState({...this.#t,fetchStatus:"idle"}),o.abort()},onFail:(v,g)=>{this.#s({type:"failed",failureCount:v,error:g})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const v=await this.#n.start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),this.#a.config.onSuccess?.(v,this),this.#a.config.onSettled?.(v,this.state.error,this),v}catch(v){if(v instanceof od){if(v.silent)return this.#n.promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw this.#s({type:"error",error:v}),this.#a.config.onError?.(v,this),this.#a.config.onSettled?.(this.state.data,v,this),v}finally{this.scheduleGc()}}#s(a){const s=o=>{switch(a.type){case"failed":return{...o,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...Nv(o.data,this.options),fetchMeta:a.meta??null};case"success":const i={...o,...sx(a.data,a.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=a.manual?i:void 0,i;case"error":const d=a.error;return{...o,error:d,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...a.state}}};this.state=s(this.state),ht.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:a})})}};function Nv(a,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gv(s.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function sx(a,s){return{data:a,dataUpdatedAt:s??Date.now(),error:null,isInvalidated:!1,status:"success"}}function lx(a){const s=typeof a.initialData=="function"?a.initialData():a.initialData,o=s!==void 0,i=o?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:o?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var Q1=class extends ds{constructor(a,s){super(),this.options=s,this.#e=a,this.#s=null,this.#o=ld(),this.bindMethods(),this.setOptions(s)}#e;#t=void 0;#a=void 0;#r=void 0;#n;#l;#o;#s;#p;#f;#m;#c;#u;#i;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ox(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return id(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return id(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#N(),this.#t.removeObserver(this)}setOptions(a){const s=this.options,o=this.#t;if(this.options=this.#e.defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xa(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#t.setOptions(this.options),s._defaulted&&!si(this.options,s)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&ix(this.#t,o,this.options,s)&&this.#d(),this.updateResult(),i&&(this.#t!==o||xa(this.options.enabled,this.#t)!==xa(s.enabled,this.#t)||An(this.options.staleTime,this.#t)!==An(s.staleTime,this.#t))&&this.#x();const d=this.#v();i&&(this.#t!==o||xa(this.options.enabled,this.#t)!==xa(s.enabled,this.#t)||d!==this.#i)&&this.#g(d)}getOptimisticResult(a){const s=this.#e.getQueryCache().build(this.#e,a),o=this.createResult(s,a);return F1(this,o)&&(this.#r=o,this.#l=this.options,this.#n=this.#t.state),o}getCurrentResult(){return this.#r}trackResult(a,s){return new Proxy(a,{get:(o,i)=>(this.trackProp(i),s?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,i))})}trackProp(a){this.#h.add(a)}getCurrentQuery(){return this.#t}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const s=this.#e.defaultQueryOptions(a),o=this.#e.getQueryCache().build(this.#e,s);return o.fetch().then(()=>this.createResult(o,s))}fetch(a){return this.#d({...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(a){this.#j();let s=this.#t.fetch(this.options,a);return a?.throwOnError||(s=s.catch(Dt)),s}#x(){this.#b();const a=An(this.options.staleTime,this.#t);if(cr||this.#r.isStale||!nd(a))return;const o=pv(this.#r.dataUpdatedAt,a)+1;this.#c=lr.setTimeout(()=>{this.#r.isStale||this.updateResult()},o)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(a){this.#N(),this.#i=a,!(cr||xa(this.options.enabled,this.#t)===!1||!nd(this.#i)||this.#i===0)&&(this.#u=lr.setInterval(()=>{(this.options.refetchIntervalInBackground||kd.isFocused())&&this.#d()},this.#i))}#y(){this.#x(),this.#g(this.#v())}#b(){this.#c&&(lr.clearTimeout(this.#c),this.#c=void 0)}#N(){this.#u&&(lr.clearInterval(this.#u),this.#u=void 0)}createResult(a,s){const o=this.#t,i=this.options,d=this.#r,f=this.#n,m=this.#l,g=a!==o?a.state:this.#a,{state:h}=a;let y={...h},x=!1,j;if(s._optimisticResults){const z=this.hasListeners(),oe=!z&&ox(a,s),be=z&&ix(a,o,s,i);(oe||be)&&(y={...y,...Nv(h.data,a.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:M,errorUpdatedAt:w,status:E}=y;j=y.data;let _=!1;if(s.placeholderData!==void 0&&j===void 0&&E==="pending"){let z;d?.isPlaceholderData&&s.placeholderData===m?.placeholderData?(z=d.data,_=!0):z=typeof s.placeholderData=="function"?s.placeholderData(this.#m?.state.data,this.#m):s.placeholderData,z!==void 0&&(E="success",j=sd(d?.data,z,s),x=!0)}if(s.select&&j!==void 0&&!_)if(d&&j===f?.data&&s.select===this.#p)j=this.#f;else try{this.#p=s.select,j=s.select(j),j=sd(d?.data,j,s),this.#f=j,this.#s=null}catch(z){this.#s=z}this.#s&&(M=this.#s,j=this.#f,w=Date.now(),E="error");const O=y.fetchStatus==="fetching",k=E==="pending",G=E==="error",$=k&&O,W=j!==void 0,H={status:E,fetchStatus:y.fetchStatus,isPending:k,isSuccess:E==="success",isError:G,isInitialLoading:$,isLoading:$,data:j,dataUpdatedAt:y.dataUpdatedAt,error:M,errorUpdatedAt:w,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>g.dataUpdateCount||y.errorUpdateCount>g.errorUpdateCount,isFetching:O,isRefetching:O&&!k,isLoadingError:G&&!W,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:G&&W,isStale:Md(a,s),refetch:this.refetch,promise:this.#o,isEnabled:xa(s.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const z=H.data!==void 0,oe=H.status==="error"&&!z,be=Ee=>{oe?Ee.reject(H.error):z&&Ee.resolve(H.data)},se=()=>{const Ee=this.#o=H.promise=ld();be(Ee)},ie=this.#o;switch(ie.status){case"pending":a.queryHash===o.queryHash&&be(ie);break;case"fulfilled":(oe||H.data!==ie.value)&&se();break;case"rejected":(!oe||H.error!==ie.reason)&&se();break}}return H}updateResult(){const a=this.#r,s=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#l=this.options,this.#n.data!==void 0&&(this.#m=this.#t),si(s,a))return;this.#r=s;const o=()=>{if(!a)return!0;const{notifyOnChangeProps:i}=this.options,d=typeof i=="function"?i():i;if(d==="all"||!d&&!this.#h.size)return!0;const f=new Set(d??this.#h);return this.options.throwOnError&&f.add("error"),Object.keys(this.#r).some(m=>{const v=m;return this.#r[v]!==a[v]&&f.has(v)})};this.#S({listeners:o()})}#j(){const a=this.#e.getQueryCache().build(this.#e,this.options);if(a===this.#t)return;const s=this.#t;this.#t=a,this.#a=a.state,this.hasListeners()&&(s?.removeObserver(this),a.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(a){ht.batch(()=>{a.listeners&&this.listeners.forEach(s=>{s(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function V1(a,s){return xa(s.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&s.retryOnMount===!1)}function ox(a,s){return V1(a,s)||a.state.data!==void 0&&id(a,s,s.refetchOnMount)}function id(a,s,o){if(xa(s.enabled,a)!==!1&&An(s.staleTime,a)!=="static"){const i=typeof o=="function"?o(a):o;return i==="always"||i!==!1&&Md(a,s)}return!1}function ix(a,s,o,i){return(a!==s||xa(i.enabled,a)===!1)&&(!o.suspense||a.state.status!=="error")&&Md(a,o)}function Md(a,s){return xa(s.enabled,a)!==!1&&a.isStaleByTime(An(s.staleTime,a))}function F1(a,s){return!si(a.getCurrentResult(),s)}function cx(a){return{onFetch:(s,o)=>{const i=s.options,d=s.fetchOptions?.meta?.fetchMore?.direction,f=s.state.data?.pages||[],m=s.state.data?.pageParams||[];let v={pages:[],pageParams:[]},g=0;const h=async()=>{let y=!1;const x=w=>{D1(w,()=>s.signal,()=>y=!0)},j=vv(s.options,s.fetchOptions),M=async(w,E,_)=>{if(y)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const te={client:s.client,queryKey:s.queryKey,pageParam:E,direction:_?"backward":"forward",meta:s.options.meta};return x(te),te})(),G=await j(k),{maxPages:$}=s.options,W=_?z1:O1;return{pages:W(w.pages,G,$),pageParams:W(w.pageParams,E,$)}};if(d&&f.length){const w=d==="backward",E=w?Y1:ux,_={pages:f,pageParams:m},O=E(i,_);v=await M(_,O,w)}else{const w=a??f.length;do{const E=g===0?m[0]??i.initialPageParam:ux(i,v);if(g>0&&E==null)break;v=await M(v,E),g++}while(g<w)}return v};s.options.persister?s.fetchFn=()=>s.options.persister?.(h,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},o):s.fetchFn=h}}}function ux(a,{pages:s,pageParams:o}){const i=s.length-1;return s.length>0?a.getNextPageParam(s[i],s,o[i],o):void 0}function Y1(a,{pages:s,pageParams:o}){return s.length>0?a.getPreviousPageParam?.(s[0],s,o[0],o):void 0}var X1=class extends bv{#e;#t;#a;#r;constructor(a){super(),this.#e=a.client,this.mutationId=a.mutationId,this.#a=a.mutationCache,this.#t=[],this.state=a.state||jv(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#t.includes(a)||(this.#t.push(a),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#t=this.#t.filter(s=>s!==a),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#a.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(a){const s=()=>{this.#n({type:"continue"})},o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=yv({fn:()=>this.options.mutationFn?this.options.mutationFn(a,o):Promise.reject(new Error("No mutationFn found")),onFail:(f,m)=>{this.#n({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#n({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)});const i=this.state.status==="pending",d=!this.#r.canStart();try{if(i)s();else{this.#n({type:"pending",variables:a,isPaused:d}),this.#a.config.onMutate&&await this.#a.config.onMutate(a,this,o);const m=await this.options.onMutate?.(a,o);m!==this.state.context&&this.#n({type:"pending",context:m,variables:a,isPaused:d})}const f=await this.#r.start();return await this.#a.config.onSuccess?.(f,a,this.state.context,this,o),await this.options.onSuccess?.(f,a,this.state.context,o),await this.#a.config.onSettled?.(f,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(f,null,a,this.state.context,o),this.#n({type:"success",data:f}),f}catch(f){try{await this.#a.config.onError?.(f,a,this.state.context,this,o)}catch(m){Promise.reject(m)}try{await this.options.onError?.(f,a,this.state.context,o)}catch(m){Promise.reject(m)}try{await this.#a.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,o)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,o)}catch(m){Promise.reject(m)}throw this.#n({type:"error",error:f}),f}finally{this.#a.runNext(this)}}#n(a){const s=o=>{switch(a.type){case"failed":return{...o,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...o,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:a.error,failureCount:o.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=s(this.state),ht.batch(()=>{this.#t.forEach(o=>{o.onMutationUpdate(a)}),this.#a.notify({mutation:this,type:"updated",action:a})})}};function jv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var K1=class extends ds{constructor(a={}){super(),this.config=a,this.#e=new Set,this.#t=new Map,this.#a=0}#e;#t;#a;build(a,s,o){const i=new X1({client:a,mutationCache:this,mutationId:++this.#a,options:a.defaultMutationOptions(s),state:o});return this.add(i),i}add(a){this.#e.add(a);const s=Qo(a);if(typeof s=="string"){const o=this.#t.get(s);o?o.push(a):this.#t.set(s,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#e.delete(a)){const s=Qo(a);if(typeof s=="string"){const o=this.#t.get(s);if(o)if(o.length>1){const i=o.indexOf(a);i!==-1&&o.splice(i,1)}else o[0]===a&&this.#t.delete(s)}}this.notify({type:"removed",mutation:a})}canRun(a){const s=Qo(a);if(typeof s=="string"){const i=this.#t.get(s)?.find(d=>d.state.status==="pending");return!i||i===a}else return!0}runNext(a){const s=Qo(a);return typeof s=="string"?this.#t.get(s)?.find(i=>i!==a&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ht.batch(()=>{this.#e.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(a){const s={exact:!0,...a};return this.getAll().find(o=>ax(s,o))}findAll(a={}){return this.getAll().filter(s=>ax(a,s))}notify(a){ht.batch(()=>{this.listeners.forEach(s=>{s(a)})})}resumePausedMutations(){const a=this.getAll().filter(s=>s.state.isPaused);return ht.batch(()=>Promise.all(a.map(s=>s.continue().catch(Dt))))}};function Qo(a){return a.options.scope?.id}var $1=class extends ds{#e;#t=void 0;#a;#r;constructor(s,o){super(),this.#e=s,this.setOptions(o),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){const o=this.options;this.options=this.#e.defaultMutationOptions(s),si(this.options,o)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),o?.mutationKey&&this.options.mutationKey&&ur(o.mutationKey)!==ur(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(s){this.#n(),this.#l(s)}getCurrentResult(){return this.#t}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#n(),this.#l()}mutate(s,o){return this.#r=o,this.#a?.removeObserver(this),this.#a=this.#e.getMutationCache().build(this.#e,this.options),this.#a.addObserver(this),this.#a.execute(s)}#n(){const s=this.#a?.state??jv();this.#t={...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset}}#l(s){ht.batch(()=>{if(this.#r&&this.hasListeners()){const o=this.#t.variables,i=this.#t.context,d={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(s?.type==="success"){try{this.#r.onSuccess?.(s.data,o,i,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(s.data,null,o,i,d)}catch(f){Promise.reject(f)}}else if(s?.type==="error"){try{this.#r.onError?.(s.error,o,i,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(void 0,s.error,o,i,d)}catch(f){Promise.reject(f)}}}this.listeners.forEach(o=>{o(this.#t)})})}},Z1=class extends ds{constructor(a={}){super(),this.config=a,this.#e=new Map}#e;build(a,s,o){const i=s.queryKey,d=s.queryHash??Td(i,s);let f=this.get(d);return f||(f=new G1({client:a,queryKey:i,queryHash:d,options:a.defaultQueryOptions(s),state:o,defaultOptions:a.getQueryDefaults(i)}),this.add(f)),f}add(a){this.#e.has(a.queryHash)||(this.#e.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const s=this.#e.get(a.queryHash);s&&(a.destroy(),s===a&&this.#e.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){ht.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#e.get(a)}getAll(){return[...this.#e.values()]}find(a){const s={exact:!0,...a};return this.getAll().find(o=>tx(s,o))}findAll(a={}){const s=this.getAll();return Object.keys(a).length>0?s.filter(o=>tx(a,o)):s}notify(a){ht.batch(()=>{this.listeners.forEach(s=>{s(a)})})}onFocus(){ht.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){ht.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},J1=class{#e;#t;#a;#r;#n;#l;#o;#s;constructor(a={}){this.#e=a.queryCache||new Z1,this.#t=a.mutationCache||new K1,this.#a=a.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#o=kd.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=li.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(a){return this.#e.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#t.findAll({...a,status:"pending"}).length}getQueryData(a){const s=this.defaultQueryOptions({queryKey:a});return this.#e.get(s.queryHash)?.state.data}ensureQueryData(a){const s=this.defaultQueryOptions(a),o=this.#e.build(this,s),i=o.state.data;return i===void 0?this.fetchQuery(a):(a.revalidateIfStale&&o.isStaleByTime(An(s.staleTime,o))&&this.prefetchQuery(s),Promise.resolve(i))}getQueriesData(a){return this.#e.findAll(a).map(({queryKey:s,state:o})=>{const i=o.data;return[s,i]})}setQueryData(a,s,o){const i=this.defaultQueryOptions({queryKey:a}),f=this.#e.get(i.queryHash)?.state.data,m=k1(s,f);if(m!==void 0)return this.#e.build(this,i).setData(m,{...o,manual:!0})}setQueriesData(a,s,o){return ht.batch(()=>this.#e.findAll(a).map(({queryKey:i})=>[i,this.setQueryData(i,s,o)]))}getQueryState(a){const s=this.defaultQueryOptions({queryKey:a});return this.#e.get(s.queryHash)?.state}removeQueries(a){const s=this.#e;ht.batch(()=>{s.findAll(a).forEach(o=>{s.remove(o)})})}resetQueries(a,s){const o=this.#e;return ht.batch(()=>(o.findAll(a).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...a},s)))}cancelQueries(a,s={}){const o={revert:!0,...s},i=ht.batch(()=>this.#e.findAll(a).map(d=>d.cancel(o)));return Promise.all(i).then(Dt).catch(Dt)}invalidateQueries(a,s={}){return ht.batch(()=>(this.#e.findAll(a).forEach(o=>{o.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},s)))}refetchQueries(a,s={}){const o={...s,cancelRefetch:s.cancelRefetch??!0},i=ht.batch(()=>this.#e.findAll(a).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,o);return o.throwOnError||(f=f.catch(Dt)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(i).then(Dt)}fetchQuery(a){const s=this.defaultQueryOptions(a);s.retry===void 0&&(s.retry=!1);const o=this.#e.build(this,s);return o.isStaleByTime(An(s.staleTime,o))?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Dt).catch(Dt)}fetchInfiniteQuery(a){return a.behavior=cx(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Dt).catch(Dt)}ensureInfiniteQueryData(a){return a.behavior=cx(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return li.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#a}setDefaultOptions(a){this.#a=a}setQueryDefaults(a,s){this.#r.set(ur(a),{queryKey:a,defaultOptions:s})}getQueryDefaults(a){const s=[...this.#r.values()],o={};return s.forEach(i=>{gl(a,i.queryKey)&&Object.assign(o,i.defaultOptions)}),o}setMutationDefaults(a,s){this.#n.set(ur(a),{mutationKey:a,defaultOptions:s})}getMutationDefaults(a){const s=[...this.#n.values()],o={};return s.forEach(i=>{gl(a,i.mutationKey)&&Object.assign(o,i.defaultOptions)}),o}defaultQueryOptions(a){if(a._defaulted)return a;const s={...this.#a.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return s.queryHash||(s.queryHash=Td(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===_d&&(s.enabled=!1),s}defaultMutationOptions(a){return a?._defaulted?a:{...this.#a.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Sv=N.createContext(void 0),ct=a=>{const s=N.useContext(Sv);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},P1=({client:a,children:s})=>(N.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),l.jsx(Sv.Provider,{value:a,children:s})),wv=N.createContext(!1),I1=()=>N.useContext(wv);wv.Provider;function W1(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var e2=N.createContext(W1()),t2=()=>N.useContext(e2),a2=(a,s,o)=>{const i=o?.state.error&&typeof a.throwOnError=="function"?Rd(a.throwOnError,[o.state.error,o]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||i)&&(s.isReset()||(a.retryOnMount=!1))},n2=a=>{N.useEffect(()=>{a.clearReset()},[a])},r2=({result:a,errorResetBoundary:s,throwOnError:o,query:i,suspense:d})=>a.isError&&!s.isReset()&&!a.isFetching&&i&&(d&&a.data===void 0||Rd(o,[a.error,i])),s2=a=>{if(a.suspense){const o=d=>d==="static"?d:Math.max(d??1e3,1e3),i=a.staleTime;a.staleTime=typeof i=="function"?(...d)=>o(i(...d)):o(i),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},l2=(a,s)=>a.isLoading&&a.isFetching&&!s,o2=(a,s)=>a?.suspense&&s.isPending,dx=(a,s,o)=>s.fetchOptimistic(a).catch(()=>{o.clearReset()});function i2(a,s,o){const i=I1(),d=t2(),f=ct(),m=f.defaultQueryOptions(a);f.getDefaultOptions().queries?._experimental_beforeQuery?.(m);const v=f.getQueryCache().get(m.queryHash);m._optimisticResults=i?"isRestoring":"optimistic",s2(m),a2(m,d,v),n2(d);const g=!f.getQueryCache().get(m.queryHash),[h]=N.useState(()=>new s(f,m)),y=h.getOptimisticResult(m),x=!i&&a.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(j=>{const M=x?h.subscribe(ht.batchCalls(j)):Dt;return h.updateResult(),M},[h,x]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(m)},[m,h]),o2(m,y))throw dx(m,h,d);if(r2({result:y,errorResetBoundary:d,throwOnError:m.throwOnError,query:v,suspense:m.suspense}))throw y.error;return f.getDefaultOptions().queries?._experimental_afterQuery?.(m,y),m.experimental_prefetchInRender&&!cr&&l2(y,i)&&(g?dx(m,h,d):v?.promise)?.catch(Dt).finally(()=>{h.updateResult()}),m.notifyOnChangeProps?y:h.trackResult(y)}function yt(a,s){return i2(a,Q1)}function bt(a,s){const o=ct(),[i]=N.useState(()=>new $1(o,a));N.useEffect(()=>{i.setOptions(a)},[i,a]);const d=N.useSyncExternalStore(N.useCallback(m=>i.subscribe(ht.batchCalls(m)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),f=N.useCallback((m,v)=>{i.mutate(m,v).catch(Dt)},[i]);if(d.error&&Rd(i.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}function c2(a){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",s.appendChild(o),o.styleSheet?o.styleSheet.cssText=a:o.appendChild(document.createTextNode(a))}const u2=a=>{switch(a){case"success":return m2;case"info":return p2;case"warning":return h2;case"error":return x2;default:return null}},d2=Array(12).fill(0),f2=({visible:a,className:s})=>le.createElement("div",{className:["sonner-loading-wrapper",s].filter(Boolean).join(" "),"data-visible":a},le.createElement("div",{className:"sonner-spinner"},d2.map((o,i)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),m2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),h2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),p2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),x2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),v2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),g2=()=>{const[a,s]=le.useState(document.hidden);return le.useEffect(()=>{const o=()=>{s(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a};let cd=1;class y2{constructor(){this.subscribe=s=>(this.subscribers.push(s),()=>{const o=this.subscribers.indexOf(s);this.subscribers.splice(o,1)}),this.publish=s=>{this.subscribers.forEach(o=>o(s))},this.addToast=s=>{this.publish(s),this.toasts=[...this.toasts,s]},this.create=s=>{var o;const{message:i,...d}=s,f=typeof s?.id=="number"||((o=s.id)==null?void 0:o.length)>0?s.id:cd++,m=this.toasts.find(g=>g.id===f),v=s.dismissible===void 0?!0:s.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),m?this.toasts=this.toasts.map(g=>g.id===f?(this.publish({...g,...s,id:f,title:i}),{...g,...s,id:f,dismissible:v,title:i}):g):this.addToast({title:i,...d,dismissible:v,id:f}),f},this.dismiss=s=>(s?(this.dismissedToasts.add(s),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:s,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(i=>i({id:o.id,dismiss:!0}))}),s),this.message=(s,o)=>this.create({...o,message:s}),this.error=(s,o)=>this.create({...o,message:s,type:"error"}),this.success=(s,o)=>this.create({...o,type:"success",message:s}),this.info=(s,o)=>this.create({...o,type:"info",message:s}),this.warning=(s,o)=>this.create({...o,type:"warning",message:s}),this.loading=(s,o)=>this.create({...o,type:"loading",message:s}),this.promise=(s,o)=>{if(!o)return;let i;o.loading!==void 0&&(i=this.create({...o,promise:s,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const d=Promise.resolve(s instanceof Function?s():s);let f=i!==void 0,m;const v=d.then(async h=>{if(m=["resolve",h],le.isValidElement(h))f=!1,this.create({id:i,type:"default",message:h});else if(N2(h)&&!h.ok){f=!1;const x=typeof o.error=="function"?await o.error(`HTTP error! status: ${h.status}`):o.error,j=typeof o.description=="function"?await o.description(`HTTP error! status: ${h.status}`):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:j,...w})}else if(h instanceof Error){f=!1;const x=typeof o.error=="function"?await o.error(h):o.error,j=typeof o.description=="function"?await o.description(h):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:j,...w})}else if(o.success!==void 0){f=!1;const x=typeof o.success=="function"?await o.success(h):o.success,j=typeof o.description=="function"?await o.description(h):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"success",description:j,...w})}}).catch(async h=>{if(m=["reject",h],o.error!==void 0){f=!1;const y=typeof o.error=="function"?await o.error(h):o.error,x=typeof o.description=="function"?await o.description(h):o.description,M=typeof y=="object"&&!le.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:x,...M})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),o.finally==null||o.finally.call(o)}),g=()=>new Promise((h,y)=>v.then(()=>m[0]==="reject"?y(m[1]):h(m[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:g}:Object.assign(i,{unwrap:g})},this.custom=(s,o)=>{const i=o?.id||cd++;return this.create({jsx:s(i),id:i,...o}),i},this.getActiveToasts=()=>this.toasts.filter(s=>!this.dismissedToasts.has(s.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Kt=new y2,b2=(a,s)=>{const o=s?.id||cd++;return Kt.addToast({title:a,...s,id:o}),o},N2=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",j2=b2,S2=()=>Kt.toasts,w2=()=>Kt.getActiveToasts(),Me=Object.assign(j2,{success:Kt.success,info:Kt.info,warning:Kt.warning,error:Kt.error,custom:Kt.custom,message:Kt.message,promise:Kt.promise,dismiss:Kt.dismiss,loading:Kt.loading},{getHistory:S2,getToasts:w2});c2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Vo(a){return a.label!==void 0}const E2=3,C2="24px",T2="16px",fx=4e3,_2=356,R2=14,k2=45,M2=200;function Aa(...a){return a.filter(Boolean).join(" ")}function A2(a){const[s,o]=a.split("-"),i=[];return s&&i.push(s),o&&i.push(o),i}const O2=a=>{var s,o,i,d,f,m,v,g,h;const{invert:y,toast:x,unstyled:j,interacting:M,setHeights:w,visibleToasts:E,heights:_,index:O,toasts:k,expanded:G,removeToast:$,defaultRichColors:W,closeButton:te,style:H,cancelButtonStyle:z,actionButtonStyle:oe,className:be="",descriptionClassName:se="",duration:ie,position:Ee,gap:Re,expandByDefault:ne,classNames:C,icons:X,closeButtonAriaLabel:K="Close toast"}=a,[ve,ee]=le.useState(null),[S,U]=le.useState(null),[V,J]=le.useState(!1),[re,me]=le.useState(!1),[ue,je]=le.useState(!1),[L,D]=le.useState(!1),[Se,pe]=le.useState(!1),[Ut,ut]=le.useState(0),[Dn,mr]=le.useState(0),Un=le.useRef(x.duration||ie||fx),ps=le.useRef(null),Jt=le.useRef(null),xs=O===0,vs=O+1<=E,Mt=x.type,nn=x.dismissible!==!1,At=x.className||"",ji=x.descriptionClassName||"",Ln=le.useMemo(()=>_.findIndex(Ce=>Ce.toastId===x.id)||0,[_,x.id]),Cl=le.useMemo(()=>{var Ce;return(Ce=x.closeButton)!=null?Ce:te},[x.closeButton,te]),Bn=le.useMemo(()=>x.duration||ie||fx,[x.duration,ie]),gs=le.useRef(0),Da=le.useRef(0),Tl=le.useRef(0),rn=le.useRef(null),[qn,Ot]=Ee.split("-"),ga=le.useMemo(()=>_.reduce((Ce,Ze,xt)=>xt>=Ln?Ce:Ce+Ze.height,0),[_,Ln]),Tt=g2(),Si=x.invert||y,ys=Mt==="loading";Da.current=le.useMemo(()=>Ln*Re+ga,[Ln,ga]),le.useEffect(()=>{Un.current=Bn},[Bn]),le.useEffect(()=>{J(!0)},[]),le.useEffect(()=>{const Ce=Jt.current;if(Ce){const Ze=Ce.getBoundingClientRect().height;return mr(Ze),w(xt=>[{toastId:x.id,height:Ze,position:x.position},...xt]),()=>w(xt=>xt.filter(_t=>_t.toastId!==x.id))}},[w,x.id]),le.useLayoutEffect(()=>{if(!V)return;const Ce=Jt.current,Ze=Ce.style.height;Ce.style.height="auto";const xt=Ce.getBoundingClientRect().height;Ce.style.height=Ze,mr(xt),w(_t=>_t.find(Ie=>Ie.toastId===x.id)?_t.map(Ie=>Ie.toastId===x.id?{...Ie,height:xt}:Ie):[{toastId:x.id,height:xt,position:x.position},..._t])},[V,x.title,x.description,w,x.id,x.jsx,x.action,x.cancel]);const Ca=le.useCallback(()=>{me(!0),ut(Da.current),w(Ce=>Ce.filter(Ze=>Ze.toastId!==x.id)),setTimeout(()=>{$(x)},M2)},[x,$,w,Da]);le.useEffect(()=>{if(x.promise&&Mt==="loading"||x.duration===1/0||x.type==="loading")return;let Ce;return G||M||Tt?(()=>{if(Tl.current<gs.current){const _t=new Date().getTime()-gs.current;Un.current=Un.current-_t}Tl.current=new Date().getTime()})():Un.current!==1/0&&(gs.current=new Date().getTime(),Ce=setTimeout(()=>{x.onAutoClose==null||x.onAutoClose.call(x,x),Ca()},Un.current)),()=>clearTimeout(Ce)},[G,M,x,Mt,Tt,Ca]),le.useEffect(()=>{x.delete&&(Ca(),x.onDismiss==null||x.onDismiss.call(x,x))},[Ca,x.delete]);function hr(){var Ce;if(X?.loading){var Ze;return le.createElement("div",{className:Aa(C?.loader,x==null||(Ze=x.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":Mt==="loading"},X.loading)}return le.createElement(f2,{className:Aa(C?.loader,x==null||(Ce=x.classNames)==null?void 0:Ce.loader),visible:Mt==="loading"})}const pr=x.icon||X?.[Mt]||u2(Mt);var Hn,Ta;return le.createElement("li",{tabIndex:0,ref:Jt,className:Aa(be,At,C?.toast,x==null||(s=x.classNames)==null?void 0:s.toast,C?.default,C?.[Mt],x==null||(o=x.classNames)==null?void 0:o[Mt]),"data-sonner-toast":"","data-rich-colors":(Hn=x.richColors)!=null?Hn:W,"data-styled":!(x.jsx||x.unstyled||j),"data-mounted":V,"data-promise":!!x.promise,"data-swiped":Se,"data-removed":re,"data-visible":vs,"data-y-position":qn,"data-x-position":Ot,"data-index":O,"data-front":xs,"data-swiping":ue,"data-dismissible":nn,"data-type":Mt,"data-invert":Si,"data-swipe-out":L,"data-swipe-direction":S,"data-expanded":!!(G||ne&&V),"data-testid":x.testId,style:{"--index":O,"--toasts-before":O,"--z-index":k.length-O,"--offset":`${re?Ut:Da.current}px`,"--initial-height":ne?"auto":`${Dn}px`,...H,...x.style},onDragEnd:()=>{je(!1),ee(null),rn.current=null},onPointerDown:Ce=>{Ce.button!==2&&(ys||!nn||(ps.current=new Date,ut(Da.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(je(!0),rn.current={x:Ce.clientX,y:Ce.clientY})))},onPointerUp:()=>{var Ce,Ze,xt;if(L||!nn)return;rn.current=null;const _t=Number(((Ce=Jt.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sn=Number(((Ze=Jt.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ie=new Date().getTime()-((xt=ps.current)==null?void 0:xt.getTime()),Lt=ve==="x"?_t:sn,Gn=Math.abs(Lt)/Ie;if(Math.abs(Lt)>=k2||Gn>.11){ut(Da.current),x.onDismiss==null||x.onDismiss.call(x,x),U(ve==="x"?_t>0?"right":"left":sn>0?"down":"up"),Ca(),D(!0);return}else{var Bt,qt;(Bt=Jt.current)==null||Bt.style.setProperty("--swipe-amount-x","0px"),(qt=Jt.current)==null||qt.style.setProperty("--swipe-amount-y","0px")}pe(!1),je(!1),ee(null)},onPointerMove:Ce=>{var Ze,xt,_t;if(!rn.current||!nn||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;const Ie=Ce.clientY-rn.current.y,Lt=Ce.clientX-rn.current.x;var Gn;const Bt=(Gn=a.swipeDirections)!=null?Gn:A2(Ee);!ve&&(Math.abs(Lt)>1||Math.abs(Ie)>1)&&ee(Math.abs(Lt)>Math.abs(Ie)?"x":"y");let qt={x:0,y:0};const xr=ya=>1/(1.5+Math.abs(ya)/20);if(ve==="y"){if(Bt.includes("top")||Bt.includes("bottom"))if(Bt.includes("top")&&Ie<0||Bt.includes("bottom")&&Ie>0)qt.y=Ie;else{const ya=Ie*xr(Ie);qt.y=Math.abs(ya)<Math.abs(Ie)?ya:Ie}}else if(ve==="x"&&(Bt.includes("left")||Bt.includes("right")))if(Bt.includes("left")&&Lt<0||Bt.includes("right")&&Lt>0)qt.x=Lt;else{const ya=Lt*xr(Lt);qt.x=Math.abs(ya)<Math.abs(Lt)?ya:Lt}(Math.abs(qt.x)>0||Math.abs(qt.y)>0)&&pe(!0),(xt=Jt.current)==null||xt.style.setProperty("--swipe-amount-x",`${qt.x}px`),(_t=Jt.current)==null||_t.style.setProperty("--swipe-amount-y",`${qt.y}px`)}},Cl&&!x.jsx&&Mt!=="loading"?le.createElement("button",{"aria-label":K,"data-disabled":ys,"data-close-button":!0,onClick:ys||!nn?()=>{}:()=>{Ca(),x.onDismiss==null||x.onDismiss.call(x,x)},className:Aa(C?.closeButton,x==null||(i=x.classNames)==null?void 0:i.closeButton)},(Ta=X?.close)!=null?Ta:v2):null,(Mt||x.icon||x.promise)&&x.icon!==null&&(X?.[Mt]!==null||x.icon)?le.createElement("div",{"data-icon":"",className:Aa(C?.icon,x==null||(d=x.classNames)==null?void 0:d.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||hr():null,x.type!=="loading"?pr:null):null,le.createElement("div",{"data-content":"",className:Aa(C?.content,x==null||(f=x.classNames)==null?void 0:f.content)},le.createElement("div",{"data-title":"",className:Aa(C?.title,x==null||(m=x.classNames)==null?void 0:m.title)},x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title),x.description?le.createElement("div",{"data-description":"",className:Aa(se,ji,C?.description,x==null||(v=x.classNames)==null?void 0:v.description)},typeof x.description=="function"?x.description():x.description):null),le.isValidElement(x.cancel)?x.cancel:x.cancel&&Vo(x.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||z,onClick:Ce=>{Vo(x.cancel)&&nn&&(x.cancel.onClick==null||x.cancel.onClick.call(x.cancel,Ce),Ca())},className:Aa(C?.cancelButton,x==null||(g=x.classNames)==null?void 0:g.cancelButton)},x.cancel.label):null,le.isValidElement(x.action)?x.action:x.action&&Vo(x.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||oe,onClick:Ce=>{Vo(x.action)&&(x.action.onClick==null||x.action.onClick.call(x.action,Ce),!Ce.defaultPrevented&&Ca())},className:Aa(C?.actionButton,x==null||(h=x.classNames)==null?void 0:h.actionButton)},x.action.label):null)};function mx(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function z2(a,s){const o={};return[a,s].forEach((i,d)=>{const f=d===1,m=f?"--mobile-offset":"--offset",v=f?T2:C2;function g(h){["top","right","bottom","left"].forEach(y=>{o[`${m}-${y}`]=typeof h=="number"?`${h}px`:h})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(h=>{i[h]===void 0?o[`${m}-${h}`]=v:o[`${m}-${h}`]=typeof i[h]=="number"?`${i[h]}px`:i[h]}):g(v)}),o}const D2=le.forwardRef(function(s,o){const{id:i,invert:d,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:v,closeButton:g,className:h,offset:y,mobileOffset:x,theme:j="light",richColors:M,duration:w,style:E,visibleToasts:_=E2,toastOptions:O,dir:k=mx(),gap:G=R2,icons:$,containerAriaLabel:W="Notifications"}=s,[te,H]=le.useState([]),z=le.useMemo(()=>i?te.filter(V=>V.toasterId===i):te.filter(V=>!V.toasterId),[te,i]),oe=le.useMemo(()=>Array.from(new Set([f].concat(z.filter(V=>V.position).map(V=>V.position)))),[z,f]),[be,se]=le.useState([]),[ie,Ee]=le.useState(!1),[Re,ne]=le.useState(!1),[C,X]=le.useState(j!=="system"?j:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=le.useRef(null),ve=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=le.useRef(null),S=le.useRef(!1),U=le.useCallback(V=>{H(J=>{var re;return(re=J.find(me=>me.id===V.id))!=null&&re.delete||Kt.dismiss(V.id),J.filter(({id:me})=>me!==V.id)})},[]);return le.useEffect(()=>Kt.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{H(J=>J.map(re=>re.id===V.id?{...re,delete:!0}:re))});return}setTimeout(()=>{C1.flushSync(()=>{H(J=>{const re=J.findIndex(me=>me.id===V.id);return re!==-1?[...J.slice(0,re),{...J[re],...V},...J.slice(re+1)]:[V,...J]})})})}),[te]),le.useEffect(()=>{if(j!=="system"){X(j);return}if(j==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:J})=>{X(J?"dark":"light")})}catch{V.addListener(({matches:re})=>{try{X(re?"dark":"light")}catch(me){console.error(me)}})}},[j]),le.useEffect(()=>{te.length<=1&&Ee(!1)},[te]),le.useEffect(()=>{const V=J=>{var re;if(m.every(je=>J[je]||J.code===je)){var ue;Ee(!0),(ue=K.current)==null||ue.focus()}J.code==="Escape"&&(document.activeElement===K.current||(re=K.current)!=null&&re.contains(document.activeElement))&&Ee(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[m]),le.useEffect(()=>{if(K.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,S.current=!1)}},[K.current]),le.createElement("section",{ref:o,"aria-label":`${W} ${ve}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},oe.map((V,J)=>{var re;const[me,ue]=V.split("-");return z.length?le.createElement("ol",{key:V,dir:k==="auto"?mx():k,tabIndex:-1,ref:K,className:h,"data-sonner-toaster":!0,"data-sonner-theme":C,"data-y-position":me,"data-x-position":ue,style:{"--front-toast-height":`${((re=be[0])==null?void 0:re.height)||0}px`,"--width":`${_2}px`,"--gap":`${G}px`,...E,...z2(y,x)},onBlur:je=>{S.current&&!je.currentTarget.contains(je.relatedTarget)&&(S.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:je=>{je.target instanceof HTMLElement&&je.target.dataset.dismissible==="false"||S.current||(S.current=!0,ee.current=je.relatedTarget)},onMouseEnter:()=>Ee(!0),onMouseMove:()=>Ee(!0),onMouseLeave:()=>{Re||Ee(!1)},onDragEnd:()=>Ee(!1),onPointerDown:je=>{je.target instanceof HTMLElement&&je.target.dataset.dismissible==="false"||ne(!0)},onPointerUp:()=>ne(!1)},z.filter(je=>!je.position&&J===0||je.position===V).map((je,L)=>{var D,Se;return le.createElement(O2,{key:je.id,icons:$,index:L,toast:je,defaultRichColors:M,duration:(D=O?.duration)!=null?D:w,className:O?.className,descriptionClassName:O?.descriptionClassName,invert:d,visibleToasts:_,closeButton:(Se=O?.closeButton)!=null?Se:g,interacting:Re,position:V,style:O?.style,unstyled:O?.unstyled,classNames:O?.classNames,cancelButtonStyle:O?.cancelButtonStyle,actionButtonStyle:O?.actionButtonStyle,closeButtonAriaLabel:O?.closeButtonAriaLabel,removeToast:U,toasts:z.filter(pe=>pe.position==je.position),heights:be.filter(pe=>pe.position==je.position),setHeights:se,expandByDefault:v,gap:G,expanded:ie,swipeDirections:s.swipeDirections})})):null}))}),Ev=N.createContext(void 0),Cv="jarvis-admin-theme";function U2(){const a=localStorage.getItem(Cv);return a==="light"||a==="dark"?a:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function L2({children:a}){const[s,o]=N.useState(U2);N.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark"),localStorage.setItem(Cv,s)},[s]);const i=N.useCallback(()=>{o(d=>d==="dark"?"light":"dark")},[]);return l.jsx(Ev.Provider,{value:{theme:s,toggleTheme:i},children:a})}function B2(){const a=N.useContext(Ev);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}function Tv(a,s){return function(){return a.apply(s,arguments)}}const{toString:q2}=Object.prototype,{getPrototypeOf:Ad}=Object,{iterator:fi,toStringTag:_v}=Symbol,mi=(a=>s=>{const o=q2.call(s);return a[o]||(a[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Ea=a=>(a=a.toLowerCase(),s=>mi(s)===a),hi=a=>s=>typeof s===a,{isArray:fs}=Array,ls=hi("undefined");function Nl(a){return a!==null&&!ls(a)&&a.constructor!==null&&!ls(a.constructor)&&$t(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const Rv=Ea("ArrayBuffer");function H2(a){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(a):s=a&&a.buffer&&Rv(a.buffer),s}const G2=hi("string"),$t=hi("function"),kv=hi("number"),jl=a=>a!==null&&typeof a=="object",Q2=a=>a===!0||a===!1,Wo=a=>{if(mi(a)!=="object")return!1;const s=Ad(a);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(_v in a)&&!(fi in a)},V2=a=>{if(!jl(a)||Nl(a))return!1;try{return Object.keys(a).length===0&&Object.getPrototypeOf(a)===Object.prototype}catch{return!1}},F2=Ea("Date"),Y2=Ea("File"),X2=Ea("Blob"),K2=Ea("FileList"),$2=a=>jl(a)&&$t(a.pipe),Z2=a=>{let s;return a&&(typeof FormData=="function"&&a instanceof FormData||$t(a.append)&&((s=mi(a))==="formdata"||s==="object"&&$t(a.toString)&&a.toString()==="[object FormData]"))},J2=Ea("URLSearchParams"),[P2,I2,W2,eN]=["ReadableStream","Request","Response","Headers"].map(Ea),tN=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sl(a,s,{allOwnKeys:o=!1}={}){if(a===null||typeof a>"u")return;let i,d;if(typeof a!="object"&&(a=[a]),fs(a))for(i=0,d=a.length;i<d;i++)s.call(null,a[i],i,a);else{if(Nl(a))return;const f=o?Object.getOwnPropertyNames(a):Object.keys(a),m=f.length;let v;for(i=0;i<m;i++)v=f[i],s.call(null,a[v],v,a)}}function Mv(a,s){if(Nl(a))return null;s=s.toLowerCase();const o=Object.keys(a);let i=o.length,d;for(;i-- >0;)if(d=o[i],s===d.toLowerCase())return d;return null}const or=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Av=a=>!ls(a)&&a!==or;function ud(){const{caseless:a,skipUndefined:s}=Av(this)&&this||{},o={},i=(d,f)=>{const m=a&&Mv(o,f)||f;Wo(o[m])&&Wo(d)?o[m]=ud(o[m],d):Wo(d)?o[m]=ud({},d):fs(d)?o[m]=d.slice():(!s||!ls(d))&&(o[m]=d)};for(let d=0,f=arguments.length;d<f;d++)arguments[d]&&Sl(arguments[d],i);return o}const aN=(a,s,o,{allOwnKeys:i}={})=>(Sl(s,(d,f)=>{o&&$t(d)?Object.defineProperty(a,f,{value:Tv(d,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(a,f,{value:d,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),a),nN=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),rN=(a,s,o,i)=>{a.prototype=Object.create(s.prototype,i),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(a,"super",{value:s.prototype}),o&&Object.assign(a.prototype,o)},sN=(a,s,o,i)=>{let d,f,m;const v={};if(s=s||{},a==null)return s;do{for(d=Object.getOwnPropertyNames(a),f=d.length;f-- >0;)m=d[f],(!i||i(m,a,s))&&!v[m]&&(s[m]=a[m],v[m]=!0);a=o!==!1&&Ad(a)}while(a&&(!o||o(a,s))&&a!==Object.prototype);return s},lN=(a,s,o)=>{a=String(a),(o===void 0||o>a.length)&&(o=a.length),o-=s.length;const i=a.indexOf(s,o);return i!==-1&&i===o},oN=a=>{if(!a)return null;if(fs(a))return a;let s=a.length;if(!kv(s))return null;const o=new Array(s);for(;s-- >0;)o[s]=a[s];return o},iN=(a=>s=>a&&s instanceof a)(typeof Uint8Array<"u"&&Ad(Uint8Array)),cN=(a,s)=>{const i=(a&&a[fi]).call(a);let d;for(;(d=i.next())&&!d.done;){const f=d.value;s.call(a,f[0],f[1])}},uN=(a,s)=>{let o;const i=[];for(;(o=a.exec(s))!==null;)i.push(o);return i},dN=Ea("HTMLFormElement"),fN=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,i,d){return i.toUpperCase()+d}),hx=(({hasOwnProperty:a})=>(s,o)=>a.call(s,o))(Object.prototype),mN=Ea("RegExp"),Ov=(a,s)=>{const o=Object.getOwnPropertyDescriptors(a),i={};Sl(o,(d,f)=>{let m;(m=s(d,f,a))!==!1&&(i[f]=m||d)}),Object.defineProperties(a,i)},hN=a=>{Ov(a,(s,o)=>{if($t(a)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const i=a[o];if($t(i)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},pN=(a,s)=>{const o={},i=d=>{d.forEach(f=>{o[f]=!0})};return fs(a)?i(a):i(String(a).split(s)),o},xN=()=>{},vN=(a,s)=>a!=null&&Number.isFinite(a=+a)?a:s;function gN(a){return!!(a&&$t(a.append)&&a[_v]==="FormData"&&a[fi])}const yN=a=>{const s=new Array(10),o=(i,d)=>{if(jl(i)){if(s.indexOf(i)>=0)return;if(Nl(i))return i;if(!("toJSON"in i)){s[d]=i;const f=fs(i)?[]:{};return Sl(i,(m,v)=>{const g=o(m,d+1);!ls(g)&&(f[v]=g)}),s[d]=void 0,f}}return i};return o(a,0)},bN=Ea("AsyncFunction"),NN=a=>a&&(jl(a)||$t(a))&&$t(a.then)&&$t(a.catch),zv=((a,s)=>a?setImmediate:s?((o,i)=>(or.addEventListener("message",({source:d,data:f})=>{d===or&&f===o&&i.length&&i.shift()()},!1),d=>{i.push(d),or.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",$t(or.postMessage)),jN=typeof queueMicrotask<"u"?queueMicrotask.bind(or):typeof process<"u"&&process.nextTick||zv,SN=a=>a!=null&&$t(a[fi]),Y={isArray:fs,isArrayBuffer:Rv,isBuffer:Nl,isFormData:Z2,isArrayBufferView:H2,isString:G2,isNumber:kv,isBoolean:Q2,isObject:jl,isPlainObject:Wo,isEmptyObject:V2,isReadableStream:P2,isRequest:I2,isResponse:W2,isHeaders:eN,isUndefined:ls,isDate:F2,isFile:Y2,isBlob:X2,isRegExp:mN,isFunction:$t,isStream:$2,isURLSearchParams:J2,isTypedArray:iN,isFileList:K2,forEach:Sl,merge:ud,extend:aN,trim:tN,stripBOM:nN,inherits:rN,toFlatObject:sN,kindOf:mi,kindOfTest:Ea,endsWith:lN,toArray:oN,forEachEntry:cN,matchAll:uN,isHTMLForm:dN,hasOwnProperty:hx,hasOwnProp:hx,reduceDescriptors:Ov,freezeMethods:hN,toObjectSet:pN,toCamelCase:fN,noop:xN,toFiniteNumber:vN,findKey:Mv,global:or,isContextDefined:Av,isSpecCompliantForm:gN,toJSONObject:yN,isAsyncFn:bN,isThenable:NN,setImmediate:zv,asap:jN,isIterable:SN};let we=class Dv extends Error{static from(s,o,i,d,f,m){const v=new Dv(s.message,o||s.code,i,d,f);return v.cause=s,v.name=s.name,m&&Object.assign(v,m),v}constructor(s,o,i,d,f){super(s),this.name="AxiosError",this.isAxiosError=!0,o&&(this.code=o),i&&(this.config=i),d&&(this.request=d),f&&(this.response=f,this.status=f.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.status}}};we.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";we.ERR_BAD_OPTION="ERR_BAD_OPTION";we.ECONNABORTED="ECONNABORTED";we.ETIMEDOUT="ETIMEDOUT";we.ERR_NETWORK="ERR_NETWORK";we.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";we.ERR_DEPRECATED="ERR_DEPRECATED";we.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";we.ERR_BAD_REQUEST="ERR_BAD_REQUEST";we.ERR_CANCELED="ERR_CANCELED";we.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";we.ERR_INVALID_URL="ERR_INVALID_URL";const wN=null;function dd(a){return Y.isPlainObject(a)||Y.isArray(a)}function Uv(a){return Y.endsWith(a,"[]")?a.slice(0,-2):a}function px(a,s,o){return a?a.concat(s).map(function(d,f){return d=Uv(d),!o&&f?"["+d+"]":d}).join(o?".":""):s}function EN(a){return Y.isArray(a)&&!a.some(dd)}const CN=Y.toFlatObject(Y,{},null,function(s){return/^is[A-Z]/.test(s)});function pi(a,s,o){if(!Y.isObject(a))throw new TypeError("target must be an object");s=s||new FormData,o=Y.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!Y.isUndefined(_[E])});const i=o.metaTokens,d=o.visitor||y,f=o.dots,m=o.indexes,g=(o.Blob||typeof Blob<"u"&&Blob)&&Y.isSpecCompliantForm(s);if(!Y.isFunction(d))throw new TypeError("visitor must be a function");function h(w){if(w===null)return"";if(Y.isDate(w))return w.toISOString();if(Y.isBoolean(w))return w.toString();if(!g&&Y.isBlob(w))throw new we("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(w)||Y.isTypedArray(w)?g&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function y(w,E,_){let O=w;if(w&&!_&&typeof w=="object"){if(Y.endsWith(E,"{}"))E=i?E:E.slice(0,-2),w=JSON.stringify(w);else if(Y.isArray(w)&&EN(w)||(Y.isFileList(w)||Y.endsWith(E,"[]"))&&(O=Y.toArray(w)))return E=Uv(E),O.forEach(function(G,$){!(Y.isUndefined(G)||G===null)&&s.append(m===!0?px([E],$,f):m===null?E:E+"[]",h(G))}),!1}return dd(w)?!0:(s.append(px(_,E,f),h(w)),!1)}const x=[],j=Object.assign(CN,{defaultVisitor:y,convertValue:h,isVisitable:dd});function M(w,E){if(!Y.isUndefined(w)){if(x.indexOf(w)!==-1)throw Error("Circular reference detected in "+E.join("."));x.push(w),Y.forEach(w,function(O,k){(!(Y.isUndefined(O)||O===null)&&d.call(s,O,Y.isString(k)?k.trim():k,E,j))===!0&&M(O,E?E.concat(k):[k])}),x.pop()}}if(!Y.isObject(a))throw new TypeError("data must be an object");return M(a),s}function xx(a){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Od(a,s){this._pairs=[],a&&pi(a,this,s)}const Lv=Od.prototype;Lv.append=function(s,o){this._pairs.push([s,o])};Lv.toString=function(s){const o=s?function(i){return s.call(this,i,xx)}:xx;return this._pairs.map(function(d){return o(d[0])+"="+o(d[1])},"").join("&")};function TN(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Bv(a,s,o){if(!s)return a;const i=o&&o.encode||TN,d=Y.isFunction(o)?{serialize:o}:o,f=d&&d.serialize;let m;if(f?m=f(s,d):m=Y.isURLSearchParams(s)?s.toString():new Od(s,d).toString(i),m){const v=a.indexOf("#");v!==-1&&(a=a.slice(0,v)),a+=(a.indexOf("?")===-1?"?":"&")+m}return a}class vx{constructor(){this.handlers=[]}use(s,o,i){return this.handlers.push({fulfilled:s,rejected:o,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Y.forEach(this.handlers,function(i){i!==null&&s(i)})}}const qv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_N=typeof URLSearchParams<"u"?URLSearchParams:Od,RN=typeof FormData<"u"?FormData:null,kN=typeof Blob<"u"?Blob:null,MN={isBrowser:!0,classes:{URLSearchParams:_N,FormData:RN,Blob:kN},protocols:["http","https","file","blob","url","data"]},zd=typeof window<"u"&&typeof document<"u",fd=typeof navigator=="object"&&navigator||void 0,AN=zd&&(!fd||["ReactNative","NativeScript","NS"].indexOf(fd.product)<0),ON=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",zN=zd&&window.location.href||"http://localhost",DN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zd,hasStandardBrowserEnv:AN,hasStandardBrowserWebWorkerEnv:ON,navigator:fd,origin:zN},Symbol.toStringTag,{value:"Module"})),kt={...DN,...MN};function UN(a,s){return pi(a,new kt.classes.URLSearchParams,{visitor:function(o,i,d,f){return kt.isNode&&Y.isBuffer(o)?(this.append(i,o.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...s})}function LN(a){return Y.matchAll(/\w+|\[(\w*)]/g,a).map(s=>s[0]==="[]"?"":s[1]||s[0])}function BN(a){const s={},o=Object.keys(a);let i;const d=o.length;let f;for(i=0;i<d;i++)f=o[i],s[f]=a[f];return s}function Hv(a){function s(o,i,d,f){let m=o[f++];if(m==="__proto__")return!0;const v=Number.isFinite(+m),g=f>=o.length;return m=!m&&Y.isArray(d)?d.length:m,g?(Y.hasOwnProp(d,m)?d[m]=[d[m],i]:d[m]=i,!v):((!d[m]||!Y.isObject(d[m]))&&(d[m]=[]),s(o,i,d[m],f)&&Y.isArray(d[m])&&(d[m]=BN(d[m])),!v)}if(Y.isFormData(a)&&Y.isFunction(a.entries)){const o={};return Y.forEachEntry(a,(i,d)=>{s(LN(i),d,o,0)}),o}return null}function qN(a,s,o){if(Y.isString(a))try{return(s||JSON.parse)(a),Y.trim(a)}catch(i){if(i.name!=="SyntaxError")throw i}return(o||JSON.stringify)(a)}const wl={transitional:qv,adapter:["xhr","http","fetch"],transformRequest:[function(s,o){const i=o.getContentType()||"",d=i.indexOf("application/json")>-1,f=Y.isObject(s);if(f&&Y.isHTMLForm(s)&&(s=new FormData(s)),Y.isFormData(s))return d?JSON.stringify(Hv(s)):s;if(Y.isArrayBuffer(s)||Y.isBuffer(s)||Y.isStream(s)||Y.isFile(s)||Y.isBlob(s)||Y.isReadableStream(s))return s;if(Y.isArrayBufferView(s))return s.buffer;if(Y.isURLSearchParams(s))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),s.toString();let v;if(f){if(i.indexOf("application/x-www-form-urlencoded")>-1)return UN(s,this.formSerializer).toString();if((v=Y.isFileList(s))||i.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return pi(v?{"files[]":s}:s,g&&new g,this.formSerializer)}}return f||d?(o.setContentType("application/json",!1),qN(s)):s}],transformResponse:[function(s){const o=this.transitional||wl.transitional,i=o&&o.forcedJSONParsing,d=this.responseType==="json";if(Y.isResponse(s)||Y.isReadableStream(s))return s;if(s&&Y.isString(s)&&(i&&!this.responseType||d)){const m=!(o&&o.silentJSONParsing)&&d;try{return JSON.parse(s,this.parseReviver)}catch(v){if(m)throw v.name==="SyntaxError"?we.from(v,we.ERR_BAD_RESPONSE,this,null,this.response):v}}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],a=>{wl.headers[a]={}});const HN=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),GN=a=>{const s={};let o,i,d;return a&&a.split(`
12
- `).forEach(function(m){d=m.indexOf(":"),o=m.substring(0,d).trim().toLowerCase(),i=m.substring(d+1).trim(),!(!o||s[o]&&HN[o])&&(o==="set-cookie"?s[o]?s[o].push(i):s[o]=[i]:s[o]=s[o]?s[o]+", "+i:i)}),s},gx=Symbol("internals");function fl(a){return a&&String(a).trim().toLowerCase()}function ei(a){return a===!1||a==null?a:Y.isArray(a)?a.map(ei):String(a)}function QN(a){const s=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=o.exec(a);)s[i[1]]=i[2];return s}const VN=a=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(a.trim());function Vu(a,s,o,i,d){if(Y.isFunction(i))return i.call(this,s,o);if(d&&(s=o),!!Y.isString(s)){if(Y.isString(i))return s.indexOf(i)!==-1;if(Y.isRegExp(i))return i.test(s)}}function FN(a){return a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,o,i)=>o.toUpperCase()+i)}function YN(a,s){const o=Y.toCamelCase(" "+s);["get","set","has"].forEach(i=>{Object.defineProperty(a,i+o,{value:function(d,f,m){return this[i].call(this,s,d,f,m)},configurable:!0})})}let Zt=class{constructor(s){s&&this.set(s)}set(s,o,i){const d=this;function f(v,g,h){const y=fl(g);if(!y)throw new Error("header name must be a non-empty string");const x=Y.findKey(d,y);(!x||d[x]===void 0||h===!0||h===void 0&&d[x]!==!1)&&(d[x||g]=ei(v))}const m=(v,g)=>Y.forEach(v,(h,y)=>f(h,y,g));if(Y.isPlainObject(s)||s instanceof this.constructor)m(s,o);else if(Y.isString(s)&&(s=s.trim())&&!VN(s))m(GN(s),o);else if(Y.isObject(s)&&Y.isIterable(s)){let v={},g,h;for(const y of s){if(!Y.isArray(y))throw TypeError("Object iterator must return a key-value pair");v[h=y[0]]=(g=v[h])?Y.isArray(g)?[...g,y[1]]:[g,y[1]]:y[1]}m(v,o)}else s!=null&&f(o,s,i);return this}get(s,o){if(s=fl(s),s){const i=Y.findKey(this,s);if(i){const d=this[i];if(!o)return d;if(o===!0)return QN(d);if(Y.isFunction(o))return o.call(this,d,i);if(Y.isRegExp(o))return o.exec(d);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,o){if(s=fl(s),s){const i=Y.findKey(this,s);return!!(i&&this[i]!==void 0&&(!o||Vu(this,this[i],i,o)))}return!1}delete(s,o){const i=this;let d=!1;function f(m){if(m=fl(m),m){const v=Y.findKey(i,m);v&&(!o||Vu(i,i[v],v,o))&&(delete i[v],d=!0)}}return Y.isArray(s)?s.forEach(f):f(s),d}clear(s){const o=Object.keys(this);let i=o.length,d=!1;for(;i--;){const f=o[i];(!s||Vu(this,this[f],f,s,!0))&&(delete this[f],d=!0)}return d}normalize(s){const o=this,i={};return Y.forEach(this,(d,f)=>{const m=Y.findKey(i,f);if(m){o[m]=ei(d),delete o[f];return}const v=s?FN(f):String(f).trim();v!==f&&delete o[f],o[v]=ei(d),i[v]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const o=Object.create(null);return Y.forEach(this,(i,d)=>{i!=null&&i!==!1&&(o[d]=s&&Y.isArray(i)?i.join(", "):i)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,o])=>s+": "+o).join(`
13
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...o){const i=new this(s);return o.forEach(d=>i.set(d)),i}static accessor(s){const i=(this[gx]=this[gx]={accessors:{}}).accessors,d=this.prototype;function f(m){const v=fl(m);i[v]||(YN(d,m),i[v]=!0)}return Y.isArray(s)?s.forEach(f):f(s),this}};Zt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(Zt.prototype,({value:a},s)=>{let o=s[0].toUpperCase()+s.slice(1);return{get:()=>a,set(i){this[o]=i}}});Y.freezeMethods(Zt);function Fu(a,s){const o=this||wl,i=s||o,d=Zt.from(i.headers);let f=i.data;return Y.forEach(a,function(v){f=v.call(o,f,d.normalize(),s?s.status:void 0)}),d.normalize(),f}function Gv(a){return!!(a&&a.__CANCEL__)}let El=class extends we{constructor(s,o,i){super(s??"canceled",we.ERR_CANCELED,o,i),this.name="CanceledError",this.__CANCEL__=!0}};function Qv(a,s,o){const i=o.config.validateStatus;!o.status||!i||i(o.status)?a(o):s(new we("Request failed with status code "+o.status,[we.ERR_BAD_REQUEST,we.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function XN(a){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return s&&s[1]||""}function KN(a,s){a=a||10;const o=new Array(a),i=new Array(a);let d=0,f=0,m;return s=s!==void 0?s:1e3,function(g){const h=Date.now(),y=i[f];m||(m=h),o[d]=g,i[d]=h;let x=f,j=0;for(;x!==d;)j+=o[x++],x=x%a;if(d=(d+1)%a,d===f&&(f=(f+1)%a),h-m<s)return;const M=y&&h-y;return M?Math.round(j*1e3/M):void 0}}function $N(a,s){let o=0,i=1e3/s,d,f;const m=(h,y=Date.now())=>{o=y,d=null,f&&(clearTimeout(f),f=null),a(...h)};return[(...h)=>{const y=Date.now(),x=y-o;x>=i?m(h,y):(d=h,f||(f=setTimeout(()=>{f=null,m(d)},i-x)))},()=>d&&m(d)]}const oi=(a,s,o=3)=>{let i=0;const d=KN(50,250);return $N(f=>{const m=f.loaded,v=f.lengthComputable?f.total:void 0,g=m-i,h=d(g),y=m<=v;i=m;const x={loaded:m,total:v,progress:v?m/v:void 0,bytes:g,rate:h||void 0,estimated:h&&v&&y?(v-m)/h:void 0,event:f,lengthComputable:v!=null,[s?"download":"upload"]:!0};a(x)},o)},yx=(a,s)=>{const o=a!=null;return[i=>s[0]({lengthComputable:o,total:a,loaded:i}),s[1]]},bx=a=>(...s)=>Y.asap(()=>a(...s)),ZN=kt.hasStandardBrowserEnv?((a,s)=>o=>(o=new URL(o,kt.origin),a.protocol===o.protocol&&a.host===o.host&&(s||a.port===o.port)))(new URL(kt.origin),kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent)):()=>!0,JN=kt.hasStandardBrowserEnv?{write(a,s,o,i,d,f,m){if(typeof document>"u")return;const v=[`${a}=${encodeURIComponent(s)}`];Y.isNumber(o)&&v.push(`expires=${new Date(o).toUTCString()}`),Y.isString(i)&&v.push(`path=${i}`),Y.isString(d)&&v.push(`domain=${d}`),f===!0&&v.push("secure"),Y.isString(m)&&v.push(`SameSite=${m}`),document.cookie=v.join("; ")},read(a){if(typeof document>"u")return null;const s=document.cookie.match(new RegExp("(?:^|; )"+a+"=([^;]*)"));return s?decodeURIComponent(s[1]):null},remove(a){this.write(a,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function PN(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function IN(a,s){return s?a.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):a}function Vv(a,s,o){let i=!PN(s);return a&&(i||o==!1)?IN(a,s):s}const Nx=a=>a instanceof Zt?{...a}:a;function dr(a,s){s=s||{};const o={};function i(h,y,x,j){return Y.isPlainObject(h)&&Y.isPlainObject(y)?Y.merge.call({caseless:j},h,y):Y.isPlainObject(y)?Y.merge({},y):Y.isArray(y)?y.slice():y}function d(h,y,x,j){if(Y.isUndefined(y)){if(!Y.isUndefined(h))return i(void 0,h,x,j)}else return i(h,y,x,j)}function f(h,y){if(!Y.isUndefined(y))return i(void 0,y)}function m(h,y){if(Y.isUndefined(y)){if(!Y.isUndefined(h))return i(void 0,h)}else return i(void 0,y)}function v(h,y,x){if(x in s)return i(h,y);if(x in a)return i(void 0,h)}const g={url:f,method:f,data:f,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:v,headers:(h,y,x)=>d(Nx(h),Nx(y),x,!0)};return Y.forEach(Object.keys({...a,...s}),function(y){const x=g[y]||d,j=x(a[y],s[y],y);Y.isUndefined(j)&&x!==v||(o[y]=j)}),o}const Fv=a=>{const s=dr({},a);let{data:o,withXSRFToken:i,xsrfHeaderName:d,xsrfCookieName:f,headers:m,auth:v}=s;if(s.headers=m=Zt.from(m),s.url=Bv(Vv(s.baseURL,s.url,s.allowAbsoluteUrls),a.params,a.paramsSerializer),v&&m.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):""))),Y.isFormData(o)){if(kt.hasStandardBrowserEnv||kt.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(Y.isFunction(o.getHeaders)){const g=o.getHeaders(),h=["content-type","content-length"];Object.entries(g).forEach(([y,x])=>{h.includes(y.toLowerCase())&&m.set(y,x)})}}if(kt.hasStandardBrowserEnv&&(i&&Y.isFunction(i)&&(i=i(s)),i||i!==!1&&ZN(s.url))){const g=d&&f&&JN.read(f);g&&m.set(d,g)}return s},WN=typeof XMLHttpRequest<"u",ej=WN&&function(a){return new Promise(function(o,i){const d=Fv(a);let f=d.data;const m=Zt.from(d.headers).normalize();let{responseType:v,onUploadProgress:g,onDownloadProgress:h}=d,y,x,j,M,w;function E(){M&&M(),w&&w(),d.cancelToken&&d.cancelToken.unsubscribe(y),d.signal&&d.signal.removeEventListener("abort",y)}let _=new XMLHttpRequest;_.open(d.method.toUpperCase(),d.url,!0),_.timeout=d.timeout;function O(){if(!_)return;const G=Zt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),W={data:!v||v==="text"||v==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:G,config:a,request:_};Qv(function(H){o(H),E()},function(H){i(H),E()},W),_=null}"onloadend"in _?_.onloadend=O:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(O)},_.onabort=function(){_&&(i(new we("Request aborted",we.ECONNABORTED,a,_)),_=null)},_.onerror=function($){const W=$&&$.message?$.message:"Network Error",te=new we(W,we.ERR_NETWORK,a,_);te.event=$||null,i(te),_=null},_.ontimeout=function(){let $=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded";const W=d.transitional||qv;d.timeoutErrorMessage&&($=d.timeoutErrorMessage),i(new we($,W.clarifyTimeoutError?we.ETIMEDOUT:we.ECONNABORTED,a,_)),_=null},f===void 0&&m.setContentType(null),"setRequestHeader"in _&&Y.forEach(m.toJSON(),function($,W){_.setRequestHeader(W,$)}),Y.isUndefined(d.withCredentials)||(_.withCredentials=!!d.withCredentials),v&&v!=="json"&&(_.responseType=d.responseType),h&&([j,w]=oi(h,!0),_.addEventListener("progress",j)),g&&_.upload&&([x,M]=oi(g),_.upload.addEventListener("progress",x),_.upload.addEventListener("loadend",M)),(d.cancelToken||d.signal)&&(y=G=>{_&&(i(!G||G.type?new El(null,a,_):G),_.abort(),_=null)},d.cancelToken&&d.cancelToken.subscribe(y),d.signal&&(d.signal.aborted?y():d.signal.addEventListener("abort",y)));const k=XN(d.url);if(k&&kt.protocols.indexOf(k)===-1){i(new we("Unsupported protocol "+k+":",we.ERR_BAD_REQUEST,a));return}_.send(f||null)})},tj=(a,s)=>{const{length:o}=a=a?a.filter(Boolean):[];if(s||o){let i=new AbortController,d;const f=function(h){if(!d){d=!0,v();const y=h instanceof Error?h:this.reason;i.abort(y instanceof we?y:new El(y instanceof Error?y.message:y))}};let m=s&&setTimeout(()=>{m=null,f(new we(`timeout of ${s}ms exceeded`,we.ETIMEDOUT))},s);const v=()=>{a&&(m&&clearTimeout(m),m=null,a.forEach(h=>{h.unsubscribe?h.unsubscribe(f):h.removeEventListener("abort",f)}),a=null)};a.forEach(h=>h.addEventListener("abort",f));const{signal:g}=i;return g.unsubscribe=()=>Y.asap(v),g}},aj=function*(a,s){let o=a.byteLength;if(o<s){yield a;return}let i=0,d;for(;i<o;)d=i+s,yield a.slice(i,d),i=d},nj=async function*(a,s){for await(const o of rj(a))yield*aj(o,s)},rj=async function*(a){if(a[Symbol.asyncIterator]){yield*a;return}const s=a.getReader();try{for(;;){const{done:o,value:i}=await s.read();if(o)break;yield i}}finally{await s.cancel()}},jx=(a,s,o,i)=>{const d=nj(a,s);let f=0,m,v=g=>{m||(m=!0,i&&i(g))};return new ReadableStream({async pull(g){try{const{done:h,value:y}=await d.next();if(h){v(),g.close();return}let x=y.byteLength;if(o){let j=f+=x;o(j)}g.enqueue(new Uint8Array(y))}catch(h){throw v(h),h}},cancel(g){return v(g),d.return()}},{highWaterMark:2})},Sx=64*1024,{isFunction:Fo}=Y,sj=(({Request:a,Response:s})=>({Request:a,Response:s}))(Y.global),{ReadableStream:wx,TextEncoder:Ex}=Y.global,Cx=(a,...s)=>{try{return!!a(...s)}catch{return!1}},lj=a=>{a=Y.merge.call({skipUndefined:!0},sj,a);const{fetch:s,Request:o,Response:i}=a,d=s?Fo(s):typeof fetch=="function",f=Fo(o),m=Fo(i);if(!d)return!1;const v=d&&Fo(wx),g=d&&(typeof Ex=="function"?(w=>E=>w.encode(E))(new Ex):async w=>new Uint8Array(await new o(w).arrayBuffer())),h=f&&v&&Cx(()=>{let w=!1;const E=new o(kt.origin,{body:new wx,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!E}),y=m&&v&&Cx(()=>Y.isReadableStream(new i("").body)),x={stream:y&&(w=>w.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!x[w]&&(x[w]=(E,_)=>{let O=E&&E[w];if(O)return O.call(E);throw new we(`Response type '${w}' is not supported`,we.ERR_NOT_SUPPORT,_)})});const j=async w=>{if(w==null)return 0;if(Y.isBlob(w))return w.size;if(Y.isSpecCompliantForm(w))return(await new o(kt.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(w)||Y.isArrayBuffer(w))return w.byteLength;if(Y.isURLSearchParams(w)&&(w=w+""),Y.isString(w))return(await g(w)).byteLength},M=async(w,E)=>{const _=Y.toFiniteNumber(w.getContentLength());return _??j(E)};return async w=>{let{url:E,method:_,data:O,signal:k,cancelToken:G,timeout:$,onDownloadProgress:W,onUploadProgress:te,responseType:H,headers:z,withCredentials:oe="same-origin",fetchOptions:be}=Fv(w),se=s||fetch;H=H?(H+"").toLowerCase():"text";let ie=tj([k,G&&G.toAbortSignal()],$),Ee=null;const Re=ie&&ie.unsubscribe&&(()=>{ie.unsubscribe()});let ne;try{if(te&&h&&_!=="get"&&_!=="head"&&(ne=await M(z,O))!==0){let S=new o(E,{method:"POST",body:O,duplex:"half"}),U;if(Y.isFormData(O)&&(U=S.headers.get("content-type"))&&z.setContentType(U),S.body){const[V,J]=yx(ne,oi(bx(te)));O=jx(S.body,Sx,V,J)}}Y.isString(oe)||(oe=oe?"include":"omit");const C=f&&"credentials"in o.prototype,X={...be,signal:ie,method:_.toUpperCase(),headers:z.normalize().toJSON(),body:O,duplex:"half",credentials:C?oe:void 0};Ee=f&&new o(E,X);let K=await(f?se(Ee,be):se(E,X));const ve=y&&(H==="stream"||H==="response");if(y&&(W||ve&&Re)){const S={};["status","statusText","headers"].forEach(re=>{S[re]=K[re]});const U=Y.toFiniteNumber(K.headers.get("content-length")),[V,J]=W&&yx(U,oi(bx(W),!0))||[];K=new i(jx(K.body,Sx,V,()=>{J&&J(),Re&&Re()}),S)}H=H||"text";let ee=await x[Y.findKey(x,H)||"text"](K,w);return!ve&&Re&&Re(),await new Promise((S,U)=>{Qv(S,U,{data:ee,headers:Zt.from(K.headers),status:K.status,statusText:K.statusText,config:w,request:Ee})})}catch(C){throw Re&&Re(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new we("Network Error",we.ERR_NETWORK,w,Ee),{cause:C.cause||C}):we.from(C,C&&C.code,w,Ee)}}},oj=new Map,Yv=a=>{let s=a&&a.env||{};const{fetch:o,Request:i,Response:d}=s,f=[i,d,o];let m=f.length,v=m,g,h,y=oj;for(;v--;)g=f[v],h=y.get(g),h===void 0&&y.set(g,h=v?new Map:lj(s)),y=h;return h};Yv();const Dd={http:wN,xhr:ej,fetch:{get:Yv}};Y.forEach(Dd,(a,s)=>{if(a){try{Object.defineProperty(a,"name",{value:s})}catch{}Object.defineProperty(a,"adapterName",{value:s})}});const Tx=a=>`- ${a}`,ij=a=>Y.isFunction(a)||a===null||a===!1;function cj(a,s){a=Y.isArray(a)?a:[a];const{length:o}=a;let i,d;const f={};for(let m=0;m<o;m++){i=a[m];let v;if(d=i,!ij(i)&&(d=Dd[(v=String(i)).toLowerCase()],d===void 0))throw new we(`Unknown adapter '${v}'`);if(d&&(Y.isFunction(d)||(d=d.get(s))))break;f[v||"#"+m]=d}if(!d){const m=Object.entries(f).map(([g,h])=>`adapter ${g} `+(h===!1?"is not supported by the environment":"is not available in the build"));let v=o?m.length>1?`since :
11
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let j=zn(),M;if(s){let k=typeof s=="string"?is(s):s;Pe(y==="/"||k.pathname?.startsWith(y),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${k.pathname}" was given in the \`location\` prop.`),M=k}else M=j;let w=M.pathname||"/",E=w;if(y!=="/"){let k=y.replace(/^\//,"").split("/");E="/"+w.replace(/^\//,"").split("/").slice(k.length).join("/")}let _=Px(a,{pathname:E});Sa(x||_!=null,`No routes matched location "${M.pathname}${M.search}${M.hash}" `),Sa(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${M.pathname}${M.search}${M.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let A=U0(_&&_.map(k=>Object.assign({},k,{params:Object.assign({},g,k.params),pathname:tn([y,f.encodeLocation?f.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?y:tn([y,f.encodeLocation?f.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),m,o,i,d);return s&&A?N.createElement(yl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...M},navigationType:"POP"}},A):A}function A0(){let a=G0(),s=x0(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),o=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",a),m=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:f},"ErrorBoundary")," or"," ",N.createElement("code",{style:f},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},s),o?N.createElement("pre",{style:d},o):null,m)}var O0=N.createElement(A0,null),iv=class extends N.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,s){return s.location!==a.location||s.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:s.error,location:s.location,revalidation:a.revalidation||s.revalidation}}componentDidCatch(a,s){this.props.onError?this.props.onError(a,s):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const o=E0(a.digest);o&&(a=o)}let s=a!==void 0?N.createElement(va.Provider,{value:this.props.routeContext},N.createElement(Nd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?N.createElement(z0,{error:a},s):s}};iv.contextType=y0;var Gu=new WeakMap;function z0({children:a,error:s}){let{basename:o}=N.useContext(sa);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let i=w0(s.digest);if(i){let d=Gu.get(s);if(d)throw d;let f=tv(i.location,o);if(ev&&!Gu.get(s))if(f.isExternal||i.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:i.replace}));throw Gu.set(s,m),m}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function D0({routeContext:a,match:s,children:o}){let i=N.useContext(cs);return i&&i.static&&i.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=s.route.id),N.createElement(va.Provider,{value:a},o)}function U0(a,s=[],o=null,i=null,d=null){if(a==null){if(!o)return null;if(o.errors)a=o.matches;else if(s.length===0&&!o.initialized&&o.matches.length>0)a=o.matches;else return null}let f=a,m=o?.errors;if(m!=null){let y=f.findIndex(x=>x.route.id&&m?.[x.route.id]!==void 0);Pe(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,y+1))}let v=!1,g=-1;if(o)for(let y=0;y<f.length;y++){let x=f[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(g=y),x.route.id){let{loaderData:j,errors:M}=o,w=x.route.loader&&!j.hasOwnProperty(x.route.id)&&(!M||M[x.route.id]===void 0);if(x.route.lazy||w){v=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let h=o&&i?(y,x)=>{i(y,{location:o.location,params:o.matches?.[0]?.params??{},unstable_pattern:v0(o.matches),errorInfo:x})}:void 0;return f.reduceRight((y,x,j)=>{let M,w=!1,E=null,_=null;o&&(M=m&&x.route.id?m[x.route.id]:void 0,E=x.route.errorElement||O0,v&&(g<0&&j===0?(cv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,_=null):g===j&&(w=!0,_=x.route.hydrateFallbackElement||null)));let A=s.concat(f.slice(0,j+1)),k=()=>{let X;return M?X=E:w?X=_:x.route.Component?X=N.createElement(x.route.Component,null):x.route.element?X=x.route.element:X=y,N.createElement(D0,{match:x,routeContext:{outlet:y,matches:A,isDataRoute:o!=null},children:X})};return o&&(x.route.ErrorBoundary||x.route.errorElement||j===0)?N.createElement(iv,{location:o.location,revalidation:o.revalidation,component:E,error:M,children:k(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:h}):k()},null)}function jd(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L0(a){let s=N.useContext(cs);return Pe(s,jd(a)),s}function B0(a){let s=N.useContext(ui);return Pe(s,jd(a)),s}function q0(a){let s=N.useContext(va);return Pe(s,jd(a)),s}function Sd(a){let s=q0(a),o=s.matches[s.matches.length-1];return Pe(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function H0(){return Sd("useRouteId")}function G0(){let a=N.useContext(Nd),s=B0("useRouteError"),o=Sd("useRouteError");return a!==void 0?a:s.errors?.[o]}function Q0(){let{router:a}=L0("useNavigate"),s=Sd("useNavigate"),o=N.useRef(!1);return lv(()=>{o.current=!0}),N.useCallback(async(d,f={})=>{Sa(o.current,sv),o.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:s,...f}))},[a,s])}var Wp={};function cv(a,s,o){!s&&!Wp[a]&&(Wp[a]=!0,Sa(!1,o))}N.memo(V0);function V0({routes:a,future:s,state:o,onError:i}){return ov(a,void 0,o,i,s)}function ri({to:a,replace:s,state:o,relative:i}){Pe(us(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=N.useContext(sa);Sa(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=N.useContext(va),{pathname:m}=zn(),v=wa(),g=bd(a,yd(f),m,i==="path"),h=JSON.stringify(g);return N.useEffect(()=>{v(JSON.parse(h),{replace:s,state:o,relative:i})},[v,h,i,s,o]),null}function F0(a){return R0(a.context)}function mt(a){Pe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Y0({basename:a="/",children:s=null,location:o,navigationType:i="POP",navigator:d,static:f=!1,unstable_useTransitions:m}){Pe(!us(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let v=a.replace(/^\/*/,"/"),g=N.useMemo(()=>({basename:v,navigator:d,static:f,unstable_useTransitions:m,future:{}}),[v,d,f,m]);typeof o=="string"&&(o=is(o));let{pathname:h="/",search:y="",hash:x="",state:j=null,key:M="default"}=o,w=N.useMemo(()=>{let E=an(h,v);return E==null?null:{location:{pathname:E,search:y,hash:x,state:j,key:M},navigationType:i}},[v,h,y,x,j,M,i]);return Sa(w!=null,`<Router basename="${v}"> is not able to match the URL "${h}${y}${x}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:N.createElement(sa.Provider,{value:g},N.createElement(yl.Provider,{children:s,value:w}))}function X0({children:a,location:s}){return M0(ad(a),s)}function ad(a,s=[]){let o=[];return N.Children.forEach(a,(i,d)=>{if(!N.isValidElement(i))return;let f=[...s,d];if(i.type===N.Fragment){o.push.apply(o,ad(i.props.children,f));return}Pe(i.type===mt,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let m={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(m.children=ad(i.props.children,f)),o.push(m)}),o}var Po="get",Io="application/x-www-form-urlencoded";function di(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function K0(a){return di(a)&&a.tagName.toLowerCase()==="button"}function $0(a){return di(a)&&a.tagName.toLowerCase()==="form"}function Z0(a){return di(a)&&a.tagName.toLowerCase()==="input"}function J0(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function P0(a,s){return a.button===0&&(!s||s==="_self")&&!J0(a)}var Go=null;function I0(){if(Go===null)try{new FormData(document.createElement("form"),0),Go=!1}catch{Go=!0}return Go}var W0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qu(a){return a!=null&&!W0.has(a)?(Sa(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Io}"`),null):a}function e1(a,s){let o,i,d,f,m;if($0(a)){let v=a.getAttribute("action");i=v?an(v,s):null,o=a.getAttribute("method")||Po,d=Qu(a.getAttribute("enctype"))||Io,f=new FormData(a)}else if(K0(a)||Z0(a)&&(a.type==="submit"||a.type==="image")){let v=a.form;if(v==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||v.getAttribute("action");if(i=g?an(g,s):null,o=a.getAttribute("formmethod")||v.getAttribute("method")||Po,d=Qu(a.getAttribute("formenctype"))||Qu(v.getAttribute("enctype"))||Io,f=new FormData(v,a),!I0()){let{name:h,type:y,value:x}=a;if(y==="image"){let j=h?`${h}.`:"";f.append(`${j}x`,"0"),f.append(`${j}y`,"0")}else h&&f.append(h,x)}}else{if(di(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Po,i=null,d=Io,m=a}return f&&d==="text/plain"&&(m=f,f=void 0),{action:i,method:o.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function wd(a,s){if(a===!1||a===null||typeof a>"u")throw new Error(s)}function t1(a,s,o,i){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return o?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${i}`:d.pathname=`${d.pathname}.${i}`:d.pathname==="/"?d.pathname=`_root.${i}`:s&&an(d.pathname,s)==="/"?d.pathname=`${s.replace(/\/$/,"")}/_root.${i}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${i}`,d}async function a1(a,s){if(a.id in s)return s[a.id];try{let o=await import(a.module);return s[a.id]=o,o}catch(o){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function n1(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function r1(a,s,o){let i=await Promise.all(a.map(async d=>{let f=s.routes[d.route.id];if(f){let m=await a1(f,o);return m.links?m.links():[]}return[]}));return i1(i.flat(1).filter(n1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function ex(a,s,o,i,d,f){let m=(g,h)=>o[h]?g.route.id!==o[h].route.id:!0,v=(g,h)=>o[h].pathname!==g.pathname||o[h].route.path?.endsWith("*")&&o[h].params["*"]!==g.params["*"];return f==="assets"?s.filter((g,h)=>m(g,h)||v(g,h)):f==="data"?s.filter((g,h)=>{let y=i.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||v(g,h))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function s1(a,s,{includeHydrateFallback:o}={}){return l1(a.map(i=>{let d=s.routes[i.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),o&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function l1(a){return[...new Set(a)]}function o1(a){let s={},o=Object.keys(a).sort();for(let i of o)s[i]=a[i];return s}function i1(a,s){let o=new Set;return new Set(s),a.reduce((i,d)=>{let f=JSON.stringify(o1(d));return o.has(f)||(o.add(f),i.push({key:f,link:d})),i},[])}function uv(){let a=N.useContext(cs);return wd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function c1(){let a=N.useContext(ui);return wd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Ed=N.createContext(void 0);Ed.displayName="FrameworkContext";function dv(){let a=N.useContext(Ed);return wd(a,"You must render this element inside a <HydratedRouter> element"),a}function u1(a,s){let o=N.useContext(Ed),[i,d]=N.useState(!1),[f,m]=N.useState(!1),{onFocus:v,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:x}=s,j=N.useRef(null);N.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let E=A=>{A.forEach(k=>{m(k.isIntersecting)})},_=new IntersectionObserver(E,{threshold:.5});return j.current&&_.observe(j.current),()=>{_.disconnect()}}},[a]),N.useEffect(()=>{if(i){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[i]);let M=()=>{d(!0)},w=()=>{d(!1),m(!1)};return o?a!=="intent"?[f,j,{}]:[f,j,{onFocus:dl(v,M),onBlur:dl(g,w),onMouseEnter:dl(h,M),onMouseLeave:dl(y,w),onTouchStart:dl(x,M)}]:[!1,j,{}]}function dl(a,s){return o=>{a&&a(o),o.defaultPrevented||s(o)}}function d1({page:a,...s}){let{router:o}=uv(),i=N.useMemo(()=>Px(o.routes,a,o.basename),[o.routes,a,o.basename]);return i?N.createElement(m1,{page:a,matches:i,...s}):null}function f1(a){let{manifest:s,routeModules:o}=dv(),[i,d]=N.useState([]);return N.useEffect(()=>{let f=!1;return r1(a,s,o).then(m=>{f||d(m)}),()=>{f=!0}},[a,s,o]),i}function m1({page:a,matches:s,...o}){let i=zn(),{future:d,manifest:f,routeModules:m}=dv(),{basename:v}=uv(),{loaderData:g,matches:h}=c1(),y=N.useMemo(()=>ex(a,s,h,f,i,"data"),[a,s,h,f,i]),x=N.useMemo(()=>ex(a,s,h,f,i,"assets"),[a,s,h,f,i]),j=N.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,_=!1;if(s.forEach(k=>{let X=f.routes[k.route.id];!X||!X.hasLoader||(!y.some(I=>I.route.id===k.route.id)&&k.route.id in g&&m[k.route.id]?.shouldRevalidate||X.hasClientLoader?_=!0:E.add(k.route.id))}),E.size===0)return[];let A=t1(a,v,d.unstable_trailingSlashAwareDataRequests,"data");return _&&E.size>0&&A.searchParams.set("_routes",s.filter(k=>E.has(k.route.id)).map(k=>k.route.id).join(",")),[A.pathname+A.search]},[v,d.unstable_trailingSlashAwareDataRequests,g,i,f,y,s,a,m]),M=N.useMemo(()=>s1(x,f),[x,f]),w=f1(x);return N.createElement(N.Fragment,null,j.map(E=>N.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),M.map(E=>N.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),w.map(({key:E,link:_})=>N.createElement("link",{key:E,nonce:o.nonce,..._,crossOrigin:_.crossOrigin??o.crossOrigin})))}function h1(...a){return s=>{a.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var p1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{p1&&(window.__reactRouterVersion="7.13.0")}catch{}function x1({basename:a,children:s,unstable_useTransitions:o,window:i}){let d=N.useRef();d.current==null&&(d.current=Xb({window:i,v5Compat:!0}));let f=d.current,[m,v]=N.useState({action:f.action,location:f.location}),g=N.useCallback(h=>{o===!1?v(h):N.startTransition(()=>v(h))},[o]);return N.useLayoutEffect(()=>f.listen(g),[f,g]),N.createElement(Y0,{basename:a,children:s,location:m.location,navigationType:m.action,navigator:f,unstable_useTransitions:o})}var fv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cd=N.forwardRef(function({onClick:s,discover:o="render",prefetch:i="none",relative:d,reloadDocument:f,replace:m,state:v,target:g,to:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:j,...M},w){let{basename:E,unstable_useTransitions:_}=N.useContext(sa),A=typeof h=="string"&&fv.test(h),k=tv(h,E);h=k.to;let X=C0(h,{relative:d}),[I,W,ee]=u1(i,M),D=y1(h,{replace:m,state:v,target:g,preventScrollReset:y,relative:d,viewTransition:x,unstable_defaultShouldRevalidate:j,unstable_useTransitions:_});function z(be){s&&s(be),be.defaultPrevented||D(be)}let oe=N.createElement("a",{...M,...ee,href:k.absoluteURL||X,onClick:k.isExternal||f?s:z,ref:h1(w,W),target:g,"data-discover":!A&&o==="render"?"true":void 0});return I&&!A?N.createElement(N.Fragment,null,oe,N.createElement(d1,{page:X})):oe});Cd.displayName="Link";var mv=N.forwardRef(function({"aria-current":s="page",caseSensitive:o=!1,className:i="",end:d=!1,style:f,to:m,viewTransition:v,children:g,...h},y){let x=bl(m,{relative:h.relative}),j=zn(),M=N.useContext(ui),{navigator:w,basename:E}=N.useContext(sa),_=M!=null&&w1(x)&&v===!0,A=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,k=j.pathname,X=M&&M.navigation&&M.navigation.location?M.navigation.location.pathname:null;o||(k=k.toLowerCase(),X=X?X.toLowerCase():null,A=A.toLowerCase()),X&&E&&(X=an(X,E)||X);const I=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let W=k===A||!d&&k.startsWith(A)&&k.charAt(I)==="/",ee=X!=null&&(X===A||!d&&X.startsWith(A)&&X.charAt(A.length)==="/"),D={isActive:W,isPending:ee,isTransitioning:_},z=W?s:void 0,oe;typeof i=="function"?oe=i(D):oe=[i,W?"active":null,ee?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let be=typeof f=="function"?f(D):f;return N.createElement(Cd,{...h,"aria-current":z,className:oe,ref:y,style:be,to:m,viewTransition:v},typeof g=="function"?g(D):g)});mv.displayName="NavLink";var v1=N.forwardRef(({discover:a="render",fetcherKey:s,navigate:o,reloadDocument:i,replace:d,state:f,method:m=Po,action:v,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:j,...M},w)=>{let{unstable_useTransitions:E}=N.useContext(sa),_=j1(),A=S1(v,{relative:h}),k=m.toLowerCase()==="get"?"get":"post",X=typeof v=="string"&&fv.test(v),I=W=>{if(g&&g(W),W.defaultPrevented)return;W.preventDefault();let ee=W.nativeEvent.submitter,D=ee?.getAttribute("formmethod")||m,z=()=>_(ee||W.currentTarget,{fetcherKey:s,method:D,navigate:o,replace:d,state:f,relative:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:j});E&&o!==!1?N.startTransition(()=>z()):z()};return N.createElement("form",{ref:w,method:k,action:A,onSubmit:i?g:I,...M,"data-discover":!X&&a==="render"?"true":void 0})});v1.displayName="Form";function g1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hv(a){let s=N.useContext(cs);return Pe(s,g1(a)),s}function y1(a,{target:s,replace:o,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v,unstable_useTransitions:g}={}){let h=wa(),y=zn(),x=bl(a,{relative:f});return N.useCallback(j=>{if(P0(j,s)){j.preventDefault();let M=o!==void 0?o:vl(y)===vl(x),w=()=>h(a,{replace:M,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v});g?N.startTransition(()=>w()):w()}},[y,h,x,o,i,s,a,d,f,m,v,g])}var b1=0,N1=()=>`__${String(++b1)}__`;function j1(){let{router:a}=hv("useSubmit"),{basename:s}=N.useContext(sa),o=H0(),i=a.fetch,d=a.navigate;return N.useCallback(async(f,m={})=>{let{action:v,method:g,encType:h,formData:y,body:x}=e1(f,s);if(m.navigate===!1){let j=m.fetcherKey||N1();await i(j,o,m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await d(m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:o,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,d,s,o])}function S1(a,{relative:s}={}){let{basename:o}=N.useContext(sa),i=N.useContext(va);Pe(i,"useFormAction must be used inside a RouteContext");let[d]=i.matches.slice(-1),f={...bl(a||".",{relative:s})},m=zn();if(a==null){f.search=m.search;let v=new URLSearchParams(f.search),g=v.getAll("index");if(g.some(y=>y==="")){v.delete("index"),g.filter(x=>x).forEach(x=>v.append("index",x));let y=v.toString();f.search=y?`?${y}`:""}}return(!a||a===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(f.pathname=f.pathname==="/"?o:tn([o,f.pathname])),vl(f)}function w1(a,{relative:s}={}){let o=N.useContext(nv);Pe(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=hv("useViewTransitionState"),d=bl(a,{relative:s});if(!o.isTransitioning)return!1;let f=an(o.currentLocation.pathname,i)||o.currentLocation.pathname,m=an(o.nextLocation.pathname,i)||o.nextLocation.pathname;return ni(d.pathname,m)!=null||ni(d.pathname,f)!=null}var E1=Jx();const C1=Zx(E1);var ds=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},T1={setTimeout:(a,s)=>setTimeout(a,s),clearTimeout:a=>clearTimeout(a),setInterval:(a,s)=>setInterval(a,s),clearInterval:a=>clearInterval(a)},_1=class{#e=T1;#t=!1;setTimeoutProvider(a){this.#e=a}setTimeout(a,s){return this.#e.setTimeout(a,s)}clearTimeout(a){this.#e.clearTimeout(a)}setInterval(a,s){return this.#e.setInterval(a,s)}clearInterval(a){this.#e.clearInterval(a)}},lr=new _1;function R1(a){setTimeout(a,0)}var cr=typeof window>"u"||"Deno"in globalThis;function Dt(){}function k1(a,s){return typeof a=="function"?a(s):a}function nd(a){return typeof a=="number"&&a>=0&&a!==1/0}function pv(a,s){return Math.max(a+(s||0)-Date.now(),0)}function An(a,s){return typeof a=="function"?a(s):a}function xa(a,s){return typeof a=="function"?a(s):a}function tx(a,s){const{type:o="all",exact:i,fetchStatus:d,predicate:f,queryKey:m,stale:v}=a;if(m){if(i){if(s.queryHash!==Td(m,s.options))return!1}else if(!gl(s.queryKey,m))return!1}if(o!=="all"){const g=s.isActive();if(o==="active"&&!g||o==="inactive"&&g)return!1}return!(typeof v=="boolean"&&s.isStale()!==v||d&&d!==s.state.fetchStatus||f&&!f(s))}function ax(a,s){const{exact:o,status:i,predicate:d,mutationKey:f}=a;if(f){if(!s.options.mutationKey)return!1;if(o){if(ur(s.options.mutationKey)!==ur(f))return!1}else if(!gl(s.options.mutationKey,f))return!1}return!(i&&s.state.status!==i||d&&!d(s))}function Td(a,s){return(s?.queryKeyHashFn||ur)(a)}function ur(a){return JSON.stringify(a,(s,o)=>rd(o)?Object.keys(o).sort().reduce((i,d)=>(i[d]=o[d],i),{}):o)}function gl(a,s){return a===s?!0:typeof a!=typeof s?!1:a&&s&&typeof a=="object"&&typeof s=="object"?Object.keys(s).every(o=>gl(a[o],s[o])):!1}var M1=Object.prototype.hasOwnProperty;function xv(a,s,o=0){if(a===s)return a;if(o>500)return s;const i=nx(a)&&nx(s);if(!i&&!(rd(a)&&rd(s)))return s;const f=(i?a:Object.keys(a)).length,m=i?s:Object.keys(s),v=m.length,g=i?new Array(v):{};let h=0;for(let y=0;y<v;y++){const x=i?y:m[y],j=a[x],M=s[x];if(j===M){g[x]=j,(i?y<f:M1.call(a,x))&&h++;continue}if(j===null||M===null||typeof j!="object"||typeof M!="object"){g[x]=M;continue}const w=xv(j,M,o+1);g[x]=w,w===j&&h++}return f===v&&h===f?a:g}function si(a,s){if(!s||Object.keys(a).length!==Object.keys(s).length)return!1;for(const o in a)if(a[o]!==s[o])return!1;return!0}function nx(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function rd(a){if(!rx(a))return!1;const s=a.constructor;if(s===void 0)return!0;const o=s.prototype;return!(!rx(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function rx(a){return Object.prototype.toString.call(a)==="[object Object]"}function A1(a){return new Promise(s=>{lr.setTimeout(s,a)})}function sd(a,s,o){return typeof o.structuralSharing=="function"?o.structuralSharing(a,s):o.structuralSharing!==!1?xv(a,s):s}function O1(a,s,o=0){const i=[...a,s];return o&&i.length>o?i.slice(1):i}function z1(a,s,o=0){const i=[s,...a];return o&&i.length>o?i.slice(0,-1):i}var _d=Symbol();function vv(a,s){return!a.queryFn&&s?.initialPromise?()=>s.initialPromise:!a.queryFn||a.queryFn===_d?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function Rd(a,s){return typeof a=="function"?a(...s):!!a}function D1(a,s,o){let i=!1,d;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(d??=s(),i||(i=!0,d.aborted?o():d.addEventListener("abort",o,{once:!0})),d)}),a}var U1=class extends ds{#e;#t;#a;constructor(){super(),this.#a=a=>{if(!cr&&window.addEventListener){const s=()=>a();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#a=a,this.#t?.(),this.#t=a(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()})}setFocused(a){this.#e!==a&&(this.#e=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(s=>{s(a)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},kd=new U1;function ld(){let a,s;const o=new Promise((d,f)=>{a=d,s=f});o.status="pending",o.catch(()=>{});function i(d){Object.assign(o,d),delete o.resolve,delete o.reject}return o.resolve=d=>{i({status:"fulfilled",value:d}),a(d)},o.reject=d=>{i({status:"rejected",reason:d}),s(d)},o}var L1=R1;function B1(){let a=[],s=0,o=v=>{v()},i=v=>{v()},d=L1;const f=v=>{s?a.push(v):d(()=>{o(v)})},m=()=>{const v=a;a=[],v.length&&d(()=>{i(()=>{v.forEach(g=>{o(g)})})})};return{batch:v=>{let g;s++;try{g=v()}finally{s--,s||m()}return g},batchCalls:v=>(...g)=>{f(()=>{v(...g)})},schedule:f,setNotifyFunction:v=>{o=v},setBatchNotifyFunction:v=>{i=v},setScheduler:v=>{d=v}}}var ht=B1(),q1=class extends ds{#e=!0;#t;#a;constructor(){super(),this.#a=a=>{if(!cr&&window.addEventListener){const s=()=>a(!0),o=()=>a(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#a=a,this.#t?.(),this.#t=a(this.setOnline.bind(this))}setOnline(a){this.#e!==a&&(this.#e=a,this.listeners.forEach(o=>{o(a)}))}isOnline(){return this.#e}},li=new q1;function H1(a){return Math.min(1e3*2**a,3e4)}function gv(a){return(a??"online")==="online"?li.isOnline():!0}var od=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function yv(a){let s=!1,o=0,i;const d=ld(),f=()=>d.status!=="pending",m=E=>{if(!f()){const _=new od(E);j(_),a.onCancel?.(_)}},v=()=>{s=!0},g=()=>{s=!1},h=()=>kd.isFocused()&&(a.networkMode==="always"||li.isOnline())&&a.canRun(),y=()=>gv(a.networkMode)&&a.canRun(),x=E=>{f()||(i?.(),d.resolve(E))},j=E=>{f()||(i?.(),d.reject(E))},M=()=>new Promise(E=>{i=_=>{(f()||h())&&E(_)},a.onPause?.()}).then(()=>{i=void 0,f()||a.onContinue?.()}),w=()=>{if(f())return;let E;const _=o===0?a.initialPromise:void 0;try{E=_??a.fn()}catch(A){E=Promise.reject(A)}Promise.resolve(E).then(x).catch(A=>{if(f())return;const k=a.retry??(cr?0:3),X=a.retryDelay??H1,I=typeof X=="function"?X(o,A):X,W=k===!0||typeof k=="number"&&o<k||typeof k=="function"&&k(o,A);if(s||!W){j(A);return}o++,a.onFail?.(o,A),A1(I).then(()=>h()?void 0:M()).then(()=>{s?j(A):w()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(i?.(),d),cancelRetry:v,continueRetry:g,canStart:y,start:()=>(y()?w():M().then(w),d)}}var bv=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nd(this.gcTime)&&(this.#e=lr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(cr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(lr.clearTimeout(this.#e),this.#e=void 0)}},G1=class extends bv{#e;#t;#a;#r;#n;#l;#o;constructor(a){super(),this.#o=!1,this.#l=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#r=a.client,this.#a=this.#r.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#e=lx(this.options),this.state=a.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(a){if(this.options={...this.#l,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=lx(this.options);s.data!==void 0&&(this.setState(sx(s.data,s.dataUpdatedAt)),this.#e=s)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(a,s){const o=sd(this.state.data,a,this.options);return this.#s({data:o,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),o}setState(a,s){this.#s({type:"setState",state:a,setStateOptions:s})}cancel(a){const s=this.#n?.promise;return this.#n?.cancel(a),s?s.then(Dt).catch(Dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(a=>xa(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_d||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>An(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!pv(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(s=>s.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(s=>s.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(s=>s!==a),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(a,s){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(a&&this.setOptions(a),!this.options.queryFn){const v=this.observers.find(g=>g.options.queryFn);v&&this.setOptions(v.options)}const o=new AbortController,i=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(this.#o=!0,o.signal)})},d=()=>{const v=vv(this.options,s),h=(()=>{const y={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(y),y})();return this.#o=!1,this.options.persister?this.options.persister(v,h,this):v(h)},m=(()=>{const v={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:d};return i(v),v})();this.options.behavior?.onFetch(m,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#s({type:"fetch",meta:m.fetchOptions?.meta}),this.#n=yv({initialPromise:s?.initialPromise,fn:m.fetchFn,onCancel:v=>{v instanceof od&&v.revert&&this.setState({...this.#t,fetchStatus:"idle"}),o.abort()},onFail:(v,g)=>{this.#s({type:"failed",failureCount:v,error:g})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const v=await this.#n.start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),this.#a.config.onSuccess?.(v,this),this.#a.config.onSettled?.(v,this.state.error,this),v}catch(v){if(v instanceof od){if(v.silent)return this.#n.promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw this.#s({type:"error",error:v}),this.#a.config.onError?.(v,this),this.#a.config.onSettled?.(this.state.data,v,this),v}finally{this.scheduleGc()}}#s(a){const s=o=>{switch(a.type){case"failed":return{...o,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...Nv(o.data,this.options),fetchMeta:a.meta??null};case"success":const i={...o,...sx(a.data,a.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=a.manual?i:void 0,i;case"error":const d=a.error;return{...o,error:d,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...a.state}}};this.state=s(this.state),ht.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:a})})}};function Nv(a,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gv(s.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function sx(a,s){return{data:a,dataUpdatedAt:s??Date.now(),error:null,isInvalidated:!1,status:"success"}}function lx(a){const s=typeof a.initialData=="function"?a.initialData():a.initialData,o=s!==void 0,i=o?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:o?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var Q1=class extends ds{constructor(a,s){super(),this.options=s,this.#e=a,this.#s=null,this.#o=ld(),this.bindMethods(),this.setOptions(s)}#e;#t=void 0;#a=void 0;#r=void 0;#n;#l;#o;#s;#p;#f;#m;#c;#u;#i;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ox(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return id(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return id(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#N(),this.#t.removeObserver(this)}setOptions(a){const s=this.options,o=this.#t;if(this.options=this.#e.defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xa(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#t.setOptions(this.options),s._defaulted&&!si(this.options,s)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&ix(this.#t,o,this.options,s)&&this.#d(),this.updateResult(),i&&(this.#t!==o||xa(this.options.enabled,this.#t)!==xa(s.enabled,this.#t)||An(this.options.staleTime,this.#t)!==An(s.staleTime,this.#t))&&this.#x();const d=this.#v();i&&(this.#t!==o||xa(this.options.enabled,this.#t)!==xa(s.enabled,this.#t)||d!==this.#i)&&this.#g(d)}getOptimisticResult(a){const s=this.#e.getQueryCache().build(this.#e,a),o=this.createResult(s,a);return F1(this,o)&&(this.#r=o,this.#l=this.options,this.#n=this.#t.state),o}getCurrentResult(){return this.#r}trackResult(a,s){return new Proxy(a,{get:(o,i)=>(this.trackProp(i),s?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,i))})}trackProp(a){this.#h.add(a)}getCurrentQuery(){return this.#t}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const s=this.#e.defaultQueryOptions(a),o=this.#e.getQueryCache().build(this.#e,s);return o.fetch().then(()=>this.createResult(o,s))}fetch(a){return this.#d({...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(a){this.#j();let s=this.#t.fetch(this.options,a);return a?.throwOnError||(s=s.catch(Dt)),s}#x(){this.#b();const a=An(this.options.staleTime,this.#t);if(cr||this.#r.isStale||!nd(a))return;const o=pv(this.#r.dataUpdatedAt,a)+1;this.#c=lr.setTimeout(()=>{this.#r.isStale||this.updateResult()},o)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(a){this.#N(),this.#i=a,!(cr||xa(this.options.enabled,this.#t)===!1||!nd(this.#i)||this.#i===0)&&(this.#u=lr.setInterval(()=>{(this.options.refetchIntervalInBackground||kd.isFocused())&&this.#d()},this.#i))}#y(){this.#x(),this.#g(this.#v())}#b(){this.#c&&(lr.clearTimeout(this.#c),this.#c=void 0)}#N(){this.#u&&(lr.clearInterval(this.#u),this.#u=void 0)}createResult(a,s){const o=this.#t,i=this.options,d=this.#r,f=this.#n,m=this.#l,g=a!==o?a.state:this.#a,{state:h}=a;let y={...h},x=!1,j;if(s._optimisticResults){const z=this.hasListeners(),oe=!z&&ox(a,s),be=z&&ix(a,o,s,i);(oe||be)&&(y={...y,...Nv(h.data,a.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:M,errorUpdatedAt:w,status:E}=y;j=y.data;let _=!1;if(s.placeholderData!==void 0&&j===void 0&&E==="pending"){let z;d?.isPlaceholderData&&s.placeholderData===m?.placeholderData?(z=d.data,_=!0):z=typeof s.placeholderData=="function"?s.placeholderData(this.#m?.state.data,this.#m):s.placeholderData,z!==void 0&&(E="success",j=sd(d?.data,z,s),x=!0)}if(s.select&&j!==void 0&&!_)if(d&&j===f?.data&&s.select===this.#p)j=this.#f;else try{this.#p=s.select,j=s.select(j),j=sd(d?.data,j,s),this.#f=j,this.#s=null}catch(z){this.#s=z}this.#s&&(M=this.#s,j=this.#f,w=Date.now(),E="error");const A=y.fetchStatus==="fetching",k=E==="pending",X=E==="error",I=k&&A,W=j!==void 0,D={status:E,fetchStatus:y.fetchStatus,isPending:k,isSuccess:E==="success",isError:X,isInitialLoading:I,isLoading:I,data:j,dataUpdatedAt:y.dataUpdatedAt,error:M,errorUpdatedAt:w,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>g.dataUpdateCount||y.errorUpdateCount>g.errorUpdateCount,isFetching:A,isRefetching:A&&!k,isLoadingError:X&&!W,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:X&&W,isStale:Md(a,s),refetch:this.refetch,promise:this.#o,isEnabled:xa(s.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const z=D.data!==void 0,oe=D.status==="error"&&!z,be=Ee=>{oe?Ee.reject(D.error):z&&Ee.resolve(D.data)},se=()=>{const Ee=this.#o=D.promise=ld();be(Ee)},pe=this.#o;switch(pe.status){case"pending":a.queryHash===o.queryHash&&be(pe);break;case"fulfilled":(oe||D.data!==pe.value)&&se();break;case"rejected":(!oe||D.error!==pe.reason)&&se();break}}return D}updateResult(){const a=this.#r,s=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#l=this.options,this.#n.data!==void 0&&(this.#m=this.#t),si(s,a))return;this.#r=s;const o=()=>{if(!a)return!0;const{notifyOnChangeProps:i}=this.options,d=typeof i=="function"?i():i;if(d==="all"||!d&&!this.#h.size)return!0;const f=new Set(d??this.#h);return this.options.throwOnError&&f.add("error"),Object.keys(this.#r).some(m=>{const v=m;return this.#r[v]!==a[v]&&f.has(v)})};this.#S({listeners:o()})}#j(){const a=this.#e.getQueryCache().build(this.#e,this.options);if(a===this.#t)return;const s=this.#t;this.#t=a,this.#a=a.state,this.hasListeners()&&(s?.removeObserver(this),a.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(a){ht.batch(()=>{a.listeners&&this.listeners.forEach(s=>{s(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function V1(a,s){return xa(s.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&s.retryOnMount===!1)}function ox(a,s){return V1(a,s)||a.state.data!==void 0&&id(a,s,s.refetchOnMount)}function id(a,s,o){if(xa(s.enabled,a)!==!1&&An(s.staleTime,a)!=="static"){const i=typeof o=="function"?o(a):o;return i==="always"||i!==!1&&Md(a,s)}return!1}function ix(a,s,o,i){return(a!==s||xa(i.enabled,a)===!1)&&(!o.suspense||a.state.status!=="error")&&Md(a,o)}function Md(a,s){return xa(s.enabled,a)!==!1&&a.isStaleByTime(An(s.staleTime,a))}function F1(a,s){return!si(a.getCurrentResult(),s)}function cx(a){return{onFetch:(s,o)=>{const i=s.options,d=s.fetchOptions?.meta?.fetchMore?.direction,f=s.state.data?.pages||[],m=s.state.data?.pageParams||[];let v={pages:[],pageParams:[]},g=0;const h=async()=>{let y=!1;const x=w=>{D1(w,()=>s.signal,()=>y=!0)},j=vv(s.options,s.fetchOptions),M=async(w,E,_)=>{if(y)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const ee={client:s.client,queryKey:s.queryKey,pageParam:E,direction:_?"backward":"forward",meta:s.options.meta};return x(ee),ee})(),X=await j(k),{maxPages:I}=s.options,W=_?z1:O1;return{pages:W(w.pages,X,I),pageParams:W(w.pageParams,E,I)}};if(d&&f.length){const w=d==="backward",E=w?Y1:ux,_={pages:f,pageParams:m},A=E(i,_);v=await M(_,A,w)}else{const w=a??f.length;do{const E=g===0?m[0]??i.initialPageParam:ux(i,v);if(g>0&&E==null)break;v=await M(v,E),g++}while(g<w)}return v};s.options.persister?s.fetchFn=()=>s.options.persister?.(h,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},o):s.fetchFn=h}}}function ux(a,{pages:s,pageParams:o}){const i=s.length-1;return s.length>0?a.getNextPageParam(s[i],s,o[i],o):void 0}function Y1(a,{pages:s,pageParams:o}){return s.length>0?a.getPreviousPageParam?.(s[0],s,o[0],o):void 0}var X1=class extends bv{#e;#t;#a;#r;constructor(a){super(),this.#e=a.client,this.mutationId=a.mutationId,this.#a=a.mutationCache,this.#t=[],this.state=a.state||jv(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#t.includes(a)||(this.#t.push(a),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#t=this.#t.filter(s=>s!==a),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#a.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(a){const s=()=>{this.#n({type:"continue"})},o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=yv({fn:()=>this.options.mutationFn?this.options.mutationFn(a,o):Promise.reject(new Error("No mutationFn found")),onFail:(f,m)=>{this.#n({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#n({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)});const i=this.state.status==="pending",d=!this.#r.canStart();try{if(i)s();else{this.#n({type:"pending",variables:a,isPaused:d}),this.#a.config.onMutate&&await this.#a.config.onMutate(a,this,o);const m=await this.options.onMutate?.(a,o);m!==this.state.context&&this.#n({type:"pending",context:m,variables:a,isPaused:d})}const f=await this.#r.start();return await this.#a.config.onSuccess?.(f,a,this.state.context,this,o),await this.options.onSuccess?.(f,a,this.state.context,o),await this.#a.config.onSettled?.(f,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(f,null,a,this.state.context,o),this.#n({type:"success",data:f}),f}catch(f){try{await this.#a.config.onError?.(f,a,this.state.context,this,o)}catch(m){Promise.reject(m)}try{await this.options.onError?.(f,a,this.state.context,o)}catch(m){Promise.reject(m)}try{await this.#a.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,o)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,o)}catch(m){Promise.reject(m)}throw this.#n({type:"error",error:f}),f}finally{this.#a.runNext(this)}}#n(a){const s=o=>{switch(a.type){case"failed":return{...o,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...o,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:a.error,failureCount:o.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=s(this.state),ht.batch(()=>{this.#t.forEach(o=>{o.onMutationUpdate(a)}),this.#a.notify({mutation:this,type:"updated",action:a})})}};function jv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var K1=class extends ds{constructor(a={}){super(),this.config=a,this.#e=new Set,this.#t=new Map,this.#a=0}#e;#t;#a;build(a,s,o){const i=new X1({client:a,mutationCache:this,mutationId:++this.#a,options:a.defaultMutationOptions(s),state:o});return this.add(i),i}add(a){this.#e.add(a);const s=Qo(a);if(typeof s=="string"){const o=this.#t.get(s);o?o.push(a):this.#t.set(s,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#e.delete(a)){const s=Qo(a);if(typeof s=="string"){const o=this.#t.get(s);if(o)if(o.length>1){const i=o.indexOf(a);i!==-1&&o.splice(i,1)}else o[0]===a&&this.#t.delete(s)}}this.notify({type:"removed",mutation:a})}canRun(a){const s=Qo(a);if(typeof s=="string"){const i=this.#t.get(s)?.find(d=>d.state.status==="pending");return!i||i===a}else return!0}runNext(a){const s=Qo(a);return typeof s=="string"?this.#t.get(s)?.find(i=>i!==a&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ht.batch(()=>{this.#e.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(a){const s={exact:!0,...a};return this.getAll().find(o=>ax(s,o))}findAll(a={}){return this.getAll().filter(s=>ax(a,s))}notify(a){ht.batch(()=>{this.listeners.forEach(s=>{s(a)})})}resumePausedMutations(){const a=this.getAll().filter(s=>s.state.isPaused);return ht.batch(()=>Promise.all(a.map(s=>s.continue().catch(Dt))))}};function Qo(a){return a.options.scope?.id}var $1=class extends ds{#e;#t=void 0;#a;#r;constructor(s,o){super(),this.#e=s,this.setOptions(o),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){const o=this.options;this.options=this.#e.defaultMutationOptions(s),si(this.options,o)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),o?.mutationKey&&this.options.mutationKey&&ur(o.mutationKey)!==ur(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(s){this.#n(),this.#l(s)}getCurrentResult(){return this.#t}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#n(),this.#l()}mutate(s,o){return this.#r=o,this.#a?.removeObserver(this),this.#a=this.#e.getMutationCache().build(this.#e,this.options),this.#a.addObserver(this),this.#a.execute(s)}#n(){const s=this.#a?.state??jv();this.#t={...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset}}#l(s){ht.batch(()=>{if(this.#r&&this.hasListeners()){const o=this.#t.variables,i=this.#t.context,d={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(s?.type==="success"){try{this.#r.onSuccess?.(s.data,o,i,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(s.data,null,o,i,d)}catch(f){Promise.reject(f)}}else if(s?.type==="error"){try{this.#r.onError?.(s.error,o,i,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(void 0,s.error,o,i,d)}catch(f){Promise.reject(f)}}}this.listeners.forEach(o=>{o(this.#t)})})}},Z1=class extends ds{constructor(a={}){super(),this.config=a,this.#e=new Map}#e;build(a,s,o){const i=s.queryKey,d=s.queryHash??Td(i,s);let f=this.get(d);return f||(f=new G1({client:a,queryKey:i,queryHash:d,options:a.defaultQueryOptions(s),state:o,defaultOptions:a.getQueryDefaults(i)}),this.add(f)),f}add(a){this.#e.has(a.queryHash)||(this.#e.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const s=this.#e.get(a.queryHash);s&&(a.destroy(),s===a&&this.#e.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){ht.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#e.get(a)}getAll(){return[...this.#e.values()]}find(a){const s={exact:!0,...a};return this.getAll().find(o=>tx(s,o))}findAll(a={}){const s=this.getAll();return Object.keys(a).length>0?s.filter(o=>tx(a,o)):s}notify(a){ht.batch(()=>{this.listeners.forEach(s=>{s(a)})})}onFocus(){ht.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){ht.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},J1=class{#e;#t;#a;#r;#n;#l;#o;#s;constructor(a={}){this.#e=a.queryCache||new Z1,this.#t=a.mutationCache||new K1,this.#a=a.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#o=kd.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=li.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(a){return this.#e.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#t.findAll({...a,status:"pending"}).length}getQueryData(a){const s=this.defaultQueryOptions({queryKey:a});return this.#e.get(s.queryHash)?.state.data}ensureQueryData(a){const s=this.defaultQueryOptions(a),o=this.#e.build(this,s),i=o.state.data;return i===void 0?this.fetchQuery(a):(a.revalidateIfStale&&o.isStaleByTime(An(s.staleTime,o))&&this.prefetchQuery(s),Promise.resolve(i))}getQueriesData(a){return this.#e.findAll(a).map(({queryKey:s,state:o})=>{const i=o.data;return[s,i]})}setQueryData(a,s,o){const i=this.defaultQueryOptions({queryKey:a}),f=this.#e.get(i.queryHash)?.state.data,m=k1(s,f);if(m!==void 0)return this.#e.build(this,i).setData(m,{...o,manual:!0})}setQueriesData(a,s,o){return ht.batch(()=>this.#e.findAll(a).map(({queryKey:i})=>[i,this.setQueryData(i,s,o)]))}getQueryState(a){const s=this.defaultQueryOptions({queryKey:a});return this.#e.get(s.queryHash)?.state}removeQueries(a){const s=this.#e;ht.batch(()=>{s.findAll(a).forEach(o=>{s.remove(o)})})}resetQueries(a,s){const o=this.#e;return ht.batch(()=>(o.findAll(a).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...a},s)))}cancelQueries(a,s={}){const o={revert:!0,...s},i=ht.batch(()=>this.#e.findAll(a).map(d=>d.cancel(o)));return Promise.all(i).then(Dt).catch(Dt)}invalidateQueries(a,s={}){return ht.batch(()=>(this.#e.findAll(a).forEach(o=>{o.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},s)))}refetchQueries(a,s={}){const o={...s,cancelRefetch:s.cancelRefetch??!0},i=ht.batch(()=>this.#e.findAll(a).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,o);return o.throwOnError||(f=f.catch(Dt)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(i).then(Dt)}fetchQuery(a){const s=this.defaultQueryOptions(a);s.retry===void 0&&(s.retry=!1);const o=this.#e.build(this,s);return o.isStaleByTime(An(s.staleTime,o))?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Dt).catch(Dt)}fetchInfiniteQuery(a){return a.behavior=cx(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Dt).catch(Dt)}ensureInfiniteQueryData(a){return a.behavior=cx(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return li.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#a}setDefaultOptions(a){this.#a=a}setQueryDefaults(a,s){this.#r.set(ur(a),{queryKey:a,defaultOptions:s})}getQueryDefaults(a){const s=[...this.#r.values()],o={};return s.forEach(i=>{gl(a,i.queryKey)&&Object.assign(o,i.defaultOptions)}),o}setMutationDefaults(a,s){this.#n.set(ur(a),{mutationKey:a,defaultOptions:s})}getMutationDefaults(a){const s=[...this.#n.values()],o={};return s.forEach(i=>{gl(a,i.mutationKey)&&Object.assign(o,i.defaultOptions)}),o}defaultQueryOptions(a){if(a._defaulted)return a;const s={...this.#a.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return s.queryHash||(s.queryHash=Td(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===_d&&(s.enabled=!1),s}defaultMutationOptions(a){return a?._defaulted?a:{...this.#a.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Sv=N.createContext(void 0),ct=a=>{const s=N.useContext(Sv);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},P1=({client:a,children:s})=>(N.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),l.jsx(Sv.Provider,{value:a,children:s})),wv=N.createContext(!1),I1=()=>N.useContext(wv);wv.Provider;function W1(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var e2=N.createContext(W1()),t2=()=>N.useContext(e2),a2=(a,s,o)=>{const i=o?.state.error&&typeof a.throwOnError=="function"?Rd(a.throwOnError,[o.state.error,o]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||i)&&(s.isReset()||(a.retryOnMount=!1))},n2=a=>{N.useEffect(()=>{a.clearReset()},[a])},r2=({result:a,errorResetBoundary:s,throwOnError:o,query:i,suspense:d})=>a.isError&&!s.isReset()&&!a.isFetching&&i&&(d&&a.data===void 0||Rd(o,[a.error,i])),s2=a=>{if(a.suspense){const o=d=>d==="static"?d:Math.max(d??1e3,1e3),i=a.staleTime;a.staleTime=typeof i=="function"?(...d)=>o(i(...d)):o(i),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},l2=(a,s)=>a.isLoading&&a.isFetching&&!s,o2=(a,s)=>a?.suspense&&s.isPending,dx=(a,s,o)=>s.fetchOptimistic(a).catch(()=>{o.clearReset()});function i2(a,s,o){const i=I1(),d=t2(),f=ct(),m=f.defaultQueryOptions(a);f.getDefaultOptions().queries?._experimental_beforeQuery?.(m);const v=f.getQueryCache().get(m.queryHash);m._optimisticResults=i?"isRestoring":"optimistic",s2(m),a2(m,d,v),n2(d);const g=!f.getQueryCache().get(m.queryHash),[h]=N.useState(()=>new s(f,m)),y=h.getOptimisticResult(m),x=!i&&a.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(j=>{const M=x?h.subscribe(ht.batchCalls(j)):Dt;return h.updateResult(),M},[h,x]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(m)},[m,h]),o2(m,y))throw dx(m,h,d);if(r2({result:y,errorResetBoundary:d,throwOnError:m.throwOnError,query:v,suspense:m.suspense}))throw y.error;return f.getDefaultOptions().queries?._experimental_afterQuery?.(m,y),m.experimental_prefetchInRender&&!cr&&l2(y,i)&&(g?dx(m,h,d):v?.promise)?.catch(Dt).finally(()=>{h.updateResult()}),m.notifyOnChangeProps?y:h.trackResult(y)}function yt(a,s){return i2(a,Q1)}function bt(a,s){const o=ct(),[i]=N.useState(()=>new $1(o,a));N.useEffect(()=>{i.setOptions(a)},[i,a]);const d=N.useSyncExternalStore(N.useCallback(m=>i.subscribe(ht.batchCalls(m)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),f=N.useCallback((m,v)=>{i.mutate(m,v).catch(Dt)},[i]);if(d.error&&Rd(i.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}function c2(a){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",s.appendChild(o),o.styleSheet?o.styleSheet.cssText=a:o.appendChild(document.createTextNode(a))}const u2=a=>{switch(a){case"success":return m2;case"info":return p2;case"warning":return h2;case"error":return x2;default:return null}},d2=Array(12).fill(0),f2=({visible:a,className:s})=>le.createElement("div",{className:["sonner-loading-wrapper",s].filter(Boolean).join(" "),"data-visible":a},le.createElement("div",{className:"sonner-spinner"},d2.map((o,i)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),m2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),h2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),p2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),x2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),v2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),g2=()=>{const[a,s]=le.useState(document.hidden);return le.useEffect(()=>{const o=()=>{s(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a};let cd=1;class y2{constructor(){this.subscribe=s=>(this.subscribers.push(s),()=>{const o=this.subscribers.indexOf(s);this.subscribers.splice(o,1)}),this.publish=s=>{this.subscribers.forEach(o=>o(s))},this.addToast=s=>{this.publish(s),this.toasts=[...this.toasts,s]},this.create=s=>{var o;const{message:i,...d}=s,f=typeof s?.id=="number"||((o=s.id)==null?void 0:o.length)>0?s.id:cd++,m=this.toasts.find(g=>g.id===f),v=s.dismissible===void 0?!0:s.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),m?this.toasts=this.toasts.map(g=>g.id===f?(this.publish({...g,...s,id:f,title:i}),{...g,...s,id:f,dismissible:v,title:i}):g):this.addToast({title:i,...d,dismissible:v,id:f}),f},this.dismiss=s=>(s?(this.dismissedToasts.add(s),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:s,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(i=>i({id:o.id,dismiss:!0}))}),s),this.message=(s,o)=>this.create({...o,message:s}),this.error=(s,o)=>this.create({...o,message:s,type:"error"}),this.success=(s,o)=>this.create({...o,type:"success",message:s}),this.info=(s,o)=>this.create({...o,type:"info",message:s}),this.warning=(s,o)=>this.create({...o,type:"warning",message:s}),this.loading=(s,o)=>this.create({...o,type:"loading",message:s}),this.promise=(s,o)=>{if(!o)return;let i;o.loading!==void 0&&(i=this.create({...o,promise:s,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const d=Promise.resolve(s instanceof Function?s():s);let f=i!==void 0,m;const v=d.then(async h=>{if(m=["resolve",h],le.isValidElement(h))f=!1,this.create({id:i,type:"default",message:h});else if(N2(h)&&!h.ok){f=!1;const x=typeof o.error=="function"?await o.error(`HTTP error! status: ${h.status}`):o.error,j=typeof o.description=="function"?await o.description(`HTTP error! status: ${h.status}`):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:j,...w})}else if(h instanceof Error){f=!1;const x=typeof o.error=="function"?await o.error(h):o.error,j=typeof o.description=="function"?await o.description(h):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:j,...w})}else if(o.success!==void 0){f=!1;const x=typeof o.success=="function"?await o.success(h):o.success,j=typeof o.description=="function"?await o.description(h):o.description,w=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"success",description:j,...w})}}).catch(async h=>{if(m=["reject",h],o.error!==void 0){f=!1;const y=typeof o.error=="function"?await o.error(h):o.error,x=typeof o.description=="function"?await o.description(h):o.description,M=typeof y=="object"&&!le.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:x,...M})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),o.finally==null||o.finally.call(o)}),g=()=>new Promise((h,y)=>v.then(()=>m[0]==="reject"?y(m[1]):h(m[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:g}:Object.assign(i,{unwrap:g})},this.custom=(s,o)=>{const i=o?.id||cd++;return this.create({jsx:s(i),id:i,...o}),i},this.getActiveToasts=()=>this.toasts.filter(s=>!this.dismissedToasts.has(s.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Kt=new y2,b2=(a,s)=>{const o=s?.id||cd++;return Kt.addToast({title:a,...s,id:o}),o},N2=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",j2=b2,S2=()=>Kt.toasts,w2=()=>Kt.getActiveToasts(),Me=Object.assign(j2,{success:Kt.success,info:Kt.info,warning:Kt.warning,error:Kt.error,custom:Kt.custom,message:Kt.message,promise:Kt.promise,dismiss:Kt.dismiss,loading:Kt.loading},{getHistory:S2,getToasts:w2});c2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Vo(a){return a.label!==void 0}const E2=3,C2="24px",T2="16px",fx=4e3,_2=356,R2=14,k2=45,M2=200;function Aa(...a){return a.filter(Boolean).join(" ")}function A2(a){const[s,o]=a.split("-"),i=[];return s&&i.push(s),o&&i.push(o),i}const O2=a=>{var s,o,i,d,f,m,v,g,h;const{invert:y,toast:x,unstyled:j,interacting:M,setHeights:w,visibleToasts:E,heights:_,index:A,toasts:k,expanded:X,removeToast:I,defaultRichColors:W,closeButton:ee,style:D,cancelButtonStyle:z,actionButtonStyle:oe,className:be="",descriptionClassName:se="",duration:pe,position:Ee,gap:he,expandByDefault:ne,classNames:C,icons:Y,closeButtonAriaLabel:K="Close toast"}=a,[ge,te]=le.useState(null),[S,L]=le.useState(null),[Q,Z]=le.useState(!1),[re,fe]=le.useState(!1),[ce,Se]=le.useState(!1),[B,U]=le.useState(!1),[we,xe]=le.useState(!1),[Ut,ut]=le.useState(0),[Dn,mr]=le.useState(0),Un=le.useRef(x.duration||pe||fx),ps=le.useRef(null),Jt=le.useRef(null),xs=A===0,vs=A+1<=E,Mt=x.type,nn=x.dismissible!==!1,At=x.className||"",ji=x.descriptionClassName||"",Ln=le.useMemo(()=>_.findIndex(Te=>Te.toastId===x.id)||0,[_,x.id]),Cl=le.useMemo(()=>{var Te;return(Te=x.closeButton)!=null?Te:ee},[x.closeButton,ee]),Bn=le.useMemo(()=>x.duration||pe||fx,[x.duration,pe]),gs=le.useRef(0),Da=le.useRef(0),Tl=le.useRef(0),rn=le.useRef(null),[qn,Ot]=Ee.split("-"),ga=le.useMemo(()=>_.reduce((Te,Ze,xt)=>xt>=Ln?Te:Te+Ze.height,0),[_,Ln]),Tt=g2(),Si=x.invert||y,ys=Mt==="loading";Da.current=le.useMemo(()=>Ln*he+ga,[Ln,ga]),le.useEffect(()=>{Un.current=Bn},[Bn]),le.useEffect(()=>{Z(!0)},[]),le.useEffect(()=>{const Te=Jt.current;if(Te){const Ze=Te.getBoundingClientRect().height;return mr(Ze),w(xt=>[{toastId:x.id,height:Ze,position:x.position},...xt]),()=>w(xt=>xt.filter(_t=>_t.toastId!==x.id))}},[w,x.id]),le.useLayoutEffect(()=>{if(!Q)return;const Te=Jt.current,Ze=Te.style.height;Te.style.height="auto";const xt=Te.getBoundingClientRect().height;Te.style.height=Ze,mr(xt),w(_t=>_t.find(Ie=>Ie.toastId===x.id)?_t.map(Ie=>Ie.toastId===x.id?{...Ie,height:xt}:Ie):[{toastId:x.id,height:xt,position:x.position},..._t])},[Q,x.title,x.description,w,x.id,x.jsx,x.action,x.cancel]);const Ca=le.useCallback(()=>{fe(!0),ut(Da.current),w(Te=>Te.filter(Ze=>Ze.toastId!==x.id)),setTimeout(()=>{I(x)},M2)},[x,I,w,Da]);le.useEffect(()=>{if(x.promise&&Mt==="loading"||x.duration===1/0||x.type==="loading")return;let Te;return X||M||Tt?(()=>{if(Tl.current<gs.current){const _t=new Date().getTime()-gs.current;Un.current=Un.current-_t}Tl.current=new Date().getTime()})():Un.current!==1/0&&(gs.current=new Date().getTime(),Te=setTimeout(()=>{x.onAutoClose==null||x.onAutoClose.call(x,x),Ca()},Un.current)),()=>clearTimeout(Te)},[X,M,x,Mt,Tt,Ca]),le.useEffect(()=>{x.delete&&(Ca(),x.onDismiss==null||x.onDismiss.call(x,x))},[Ca,x.delete]);function hr(){var Te;if(Y?.loading){var Ze;return le.createElement("div",{className:Aa(C?.loader,x==null||(Ze=x.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":Mt==="loading"},Y.loading)}return le.createElement(f2,{className:Aa(C?.loader,x==null||(Te=x.classNames)==null?void 0:Te.loader),visible:Mt==="loading"})}const pr=x.icon||Y?.[Mt]||u2(Mt);var Hn,Ta;return le.createElement("li",{tabIndex:0,ref:Jt,className:Aa(be,At,C?.toast,x==null||(s=x.classNames)==null?void 0:s.toast,C?.default,C?.[Mt],x==null||(o=x.classNames)==null?void 0:o[Mt]),"data-sonner-toast":"","data-rich-colors":(Hn=x.richColors)!=null?Hn:W,"data-styled":!(x.jsx||x.unstyled||j),"data-mounted":Q,"data-promise":!!x.promise,"data-swiped":we,"data-removed":re,"data-visible":vs,"data-y-position":qn,"data-x-position":Ot,"data-index":A,"data-front":xs,"data-swiping":ce,"data-dismissible":nn,"data-type":Mt,"data-invert":Si,"data-swipe-out":B,"data-swipe-direction":S,"data-expanded":!!(X||ne&&Q),"data-testid":x.testId,style:{"--index":A,"--toasts-before":A,"--z-index":k.length-A,"--offset":`${re?Ut:Da.current}px`,"--initial-height":ne?"auto":`${Dn}px`,...D,...x.style},onDragEnd:()=>{Se(!1),te(null),rn.current=null},onPointerDown:Te=>{Te.button!==2&&(ys||!nn||(ps.current=new Date,ut(Da.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(Se(!0),rn.current={x:Te.clientX,y:Te.clientY})))},onPointerUp:()=>{var Te,Ze,xt;if(B||!nn)return;rn.current=null;const _t=Number(((Te=Jt.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sn=Number(((Ze=Jt.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ie=new Date().getTime()-((xt=ps.current)==null?void 0:xt.getTime()),Lt=ge==="x"?_t:sn,Gn=Math.abs(Lt)/Ie;if(Math.abs(Lt)>=k2||Gn>.11){ut(Da.current),x.onDismiss==null||x.onDismiss.call(x,x),L(ge==="x"?_t>0?"right":"left":sn>0?"down":"up"),Ca(),U(!0);return}else{var Bt,qt;(Bt=Jt.current)==null||Bt.style.setProperty("--swipe-amount-x","0px"),(qt=Jt.current)==null||qt.style.setProperty("--swipe-amount-y","0px")}xe(!1),Se(!1),te(null)},onPointerMove:Te=>{var Ze,xt,_t;if(!rn.current||!nn||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;const Ie=Te.clientY-rn.current.y,Lt=Te.clientX-rn.current.x;var Gn;const Bt=(Gn=a.swipeDirections)!=null?Gn:A2(Ee);!ge&&(Math.abs(Lt)>1||Math.abs(Ie)>1)&&te(Math.abs(Lt)>Math.abs(Ie)?"x":"y");let qt={x:0,y:0};const xr=ya=>1/(1.5+Math.abs(ya)/20);if(ge==="y"){if(Bt.includes("top")||Bt.includes("bottom"))if(Bt.includes("top")&&Ie<0||Bt.includes("bottom")&&Ie>0)qt.y=Ie;else{const ya=Ie*xr(Ie);qt.y=Math.abs(ya)<Math.abs(Ie)?ya:Ie}}else if(ge==="x"&&(Bt.includes("left")||Bt.includes("right")))if(Bt.includes("left")&&Lt<0||Bt.includes("right")&&Lt>0)qt.x=Lt;else{const ya=Lt*xr(Lt);qt.x=Math.abs(ya)<Math.abs(Lt)?ya:Lt}(Math.abs(qt.x)>0||Math.abs(qt.y)>0)&&xe(!0),(xt=Jt.current)==null||xt.style.setProperty("--swipe-amount-x",`${qt.x}px`),(_t=Jt.current)==null||_t.style.setProperty("--swipe-amount-y",`${qt.y}px`)}},Cl&&!x.jsx&&Mt!=="loading"?le.createElement("button",{"aria-label":K,"data-disabled":ys,"data-close-button":!0,onClick:ys||!nn?()=>{}:()=>{Ca(),x.onDismiss==null||x.onDismiss.call(x,x)},className:Aa(C?.closeButton,x==null||(i=x.classNames)==null?void 0:i.closeButton)},(Ta=Y?.close)!=null?Ta:v2):null,(Mt||x.icon||x.promise)&&x.icon!==null&&(Y?.[Mt]!==null||x.icon)?le.createElement("div",{"data-icon":"",className:Aa(C?.icon,x==null||(d=x.classNames)==null?void 0:d.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||hr():null,x.type!=="loading"?pr:null):null,le.createElement("div",{"data-content":"",className:Aa(C?.content,x==null||(f=x.classNames)==null?void 0:f.content)},le.createElement("div",{"data-title":"",className:Aa(C?.title,x==null||(m=x.classNames)==null?void 0:m.title)},x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title),x.description?le.createElement("div",{"data-description":"",className:Aa(se,ji,C?.description,x==null||(v=x.classNames)==null?void 0:v.description)},typeof x.description=="function"?x.description():x.description):null),le.isValidElement(x.cancel)?x.cancel:x.cancel&&Vo(x.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||z,onClick:Te=>{Vo(x.cancel)&&nn&&(x.cancel.onClick==null||x.cancel.onClick.call(x.cancel,Te),Ca())},className:Aa(C?.cancelButton,x==null||(g=x.classNames)==null?void 0:g.cancelButton)},x.cancel.label):null,le.isValidElement(x.action)?x.action:x.action&&Vo(x.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||oe,onClick:Te=>{Vo(x.action)&&(x.action.onClick==null||x.action.onClick.call(x.action,Te),!Te.defaultPrevented&&Ca())},className:Aa(C?.actionButton,x==null||(h=x.classNames)==null?void 0:h.actionButton)},x.action.label):null)};function mx(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function z2(a,s){const o={};return[a,s].forEach((i,d)=>{const f=d===1,m=f?"--mobile-offset":"--offset",v=f?T2:C2;function g(h){["top","right","bottom","left"].forEach(y=>{o[`${m}-${y}`]=typeof h=="number"?`${h}px`:h})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(h=>{i[h]===void 0?o[`${m}-${h}`]=v:o[`${m}-${h}`]=typeof i[h]=="number"?`${i[h]}px`:i[h]}):g(v)}),o}const D2=le.forwardRef(function(s,o){const{id:i,invert:d,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:v,closeButton:g,className:h,offset:y,mobileOffset:x,theme:j="light",richColors:M,duration:w,style:E,visibleToasts:_=E2,toastOptions:A,dir:k=mx(),gap:X=R2,icons:I,containerAriaLabel:W="Notifications"}=s,[ee,D]=le.useState([]),z=le.useMemo(()=>i?ee.filter(Q=>Q.toasterId===i):ee.filter(Q=>!Q.toasterId),[ee,i]),oe=le.useMemo(()=>Array.from(new Set([f].concat(z.filter(Q=>Q.position).map(Q=>Q.position)))),[z,f]),[be,se]=le.useState([]),[pe,Ee]=le.useState(!1),[he,ne]=le.useState(!1),[C,Y]=le.useState(j!=="system"?j:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=le.useRef(null),ge=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),te=le.useRef(null),S=le.useRef(!1),L=le.useCallback(Q=>{D(Z=>{var re;return(re=Z.find(fe=>fe.id===Q.id))!=null&&re.delete||Kt.dismiss(Q.id),Z.filter(({id:fe})=>fe!==Q.id)})},[]);return le.useEffect(()=>Kt.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{D(Z=>Z.map(re=>re.id===Q.id?{...re,delete:!0}:re))});return}setTimeout(()=>{C1.flushSync(()=>{D(Z=>{const re=Z.findIndex(fe=>fe.id===Q.id);return re!==-1?[...Z.slice(0,re),{...Z[re],...Q},...Z.slice(re+1)]:[Q,...Z]})})})}),[ee]),le.useEffect(()=>{if(j!=="system"){Y(j);return}if(j==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:Z})=>{Y(Z?"dark":"light")})}catch{Q.addListener(({matches:re})=>{try{Y(re?"dark":"light")}catch(fe){console.error(fe)}})}},[j]),le.useEffect(()=>{ee.length<=1&&Ee(!1)},[ee]),le.useEffect(()=>{const Q=Z=>{var re;if(m.every(Se=>Z[Se]||Z.code===Se)){var ce;Ee(!0),(ce=K.current)==null||ce.focus()}Z.code==="Escape"&&(document.activeElement===K.current||(re=K.current)!=null&&re.contains(document.activeElement))&&Ee(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[m]),le.useEffect(()=>{if(K.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,S.current=!1)}},[K.current]),le.createElement("section",{ref:o,"aria-label":`${W} ${ge}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},oe.map((Q,Z)=>{var re;const[fe,ce]=Q.split("-");return z.length?le.createElement("ol",{key:Q,dir:k==="auto"?mx():k,tabIndex:-1,ref:K,className:h,"data-sonner-toaster":!0,"data-sonner-theme":C,"data-y-position":fe,"data-x-position":ce,style:{"--front-toast-height":`${((re=be[0])==null?void 0:re.height)||0}px`,"--width":`${_2}px`,"--gap":`${X}px`,...E,...z2(y,x)},onBlur:Se=>{S.current&&!Se.currentTarget.contains(Se.relatedTarget)&&(S.current=!1,te.current&&(te.current.focus({preventScroll:!0}),te.current=null))},onFocus:Se=>{Se.target instanceof HTMLElement&&Se.target.dataset.dismissible==="false"||S.current||(S.current=!0,te.current=Se.relatedTarget)},onMouseEnter:()=>Ee(!0),onMouseMove:()=>Ee(!0),onMouseLeave:()=>{he||Ee(!1)},onDragEnd:()=>Ee(!1),onPointerDown:Se=>{Se.target instanceof HTMLElement&&Se.target.dataset.dismissible==="false"||ne(!0)},onPointerUp:()=>ne(!1)},z.filter(Se=>!Se.position&&Z===0||Se.position===Q).map((Se,B)=>{var U,we;return le.createElement(O2,{key:Se.id,icons:I,index:B,toast:Se,defaultRichColors:M,duration:(U=A?.duration)!=null?U:w,className:A?.className,descriptionClassName:A?.descriptionClassName,invert:d,visibleToasts:_,closeButton:(we=A?.closeButton)!=null?we:g,interacting:he,position:Q,style:A?.style,unstyled:A?.unstyled,classNames:A?.classNames,cancelButtonStyle:A?.cancelButtonStyle,actionButtonStyle:A?.actionButtonStyle,closeButtonAriaLabel:A?.closeButtonAriaLabel,removeToast:L,toasts:z.filter(xe=>xe.position==Se.position),heights:be.filter(xe=>xe.position==Se.position),setHeights:se,expandByDefault:v,gap:X,expanded:pe,swipeDirections:s.swipeDirections})})):null}))}),Ev=N.createContext(void 0),Cv="jarvis-admin-theme";function U2(){const a=localStorage.getItem(Cv);return a==="light"||a==="dark"?a:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function L2({children:a}){const[s,o]=N.useState(U2);N.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark"),localStorage.setItem(Cv,s)},[s]);const i=N.useCallback(()=>{o(d=>d==="dark"?"light":"dark")},[]);return l.jsx(Ev.Provider,{value:{theme:s,toggleTheme:i},children:a})}function B2(){const a=N.useContext(Ev);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}function Tv(a,s){return function(){return a.apply(s,arguments)}}const{toString:q2}=Object.prototype,{getPrototypeOf:Ad}=Object,{iterator:fi,toStringTag:_v}=Symbol,mi=(a=>s=>{const o=q2.call(s);return a[o]||(a[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Ea=a=>(a=a.toLowerCase(),s=>mi(s)===a),hi=a=>s=>typeof s===a,{isArray:fs}=Array,ls=hi("undefined");function Nl(a){return a!==null&&!ls(a)&&a.constructor!==null&&!ls(a.constructor)&&$t(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const Rv=Ea("ArrayBuffer");function H2(a){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(a):s=a&&a.buffer&&Rv(a.buffer),s}const G2=hi("string"),$t=hi("function"),kv=hi("number"),jl=a=>a!==null&&typeof a=="object",Q2=a=>a===!0||a===!1,Wo=a=>{if(mi(a)!=="object")return!1;const s=Ad(a);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(_v in a)&&!(fi in a)},V2=a=>{if(!jl(a)||Nl(a))return!1;try{return Object.keys(a).length===0&&Object.getPrototypeOf(a)===Object.prototype}catch{return!1}},F2=Ea("Date"),Y2=Ea("File"),X2=Ea("Blob"),K2=Ea("FileList"),$2=a=>jl(a)&&$t(a.pipe),Z2=a=>{let s;return a&&(typeof FormData=="function"&&a instanceof FormData||$t(a.append)&&((s=mi(a))==="formdata"||s==="object"&&$t(a.toString)&&a.toString()==="[object FormData]"))},J2=Ea("URLSearchParams"),[P2,I2,W2,eN]=["ReadableStream","Request","Response","Headers"].map(Ea),tN=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sl(a,s,{allOwnKeys:o=!1}={}){if(a===null||typeof a>"u")return;let i,d;if(typeof a!="object"&&(a=[a]),fs(a))for(i=0,d=a.length;i<d;i++)s.call(null,a[i],i,a);else{if(Nl(a))return;const f=o?Object.getOwnPropertyNames(a):Object.keys(a),m=f.length;let v;for(i=0;i<m;i++)v=f[i],s.call(null,a[v],v,a)}}function Mv(a,s){if(Nl(a))return null;s=s.toLowerCase();const o=Object.keys(a);let i=o.length,d;for(;i-- >0;)if(d=o[i],s===d.toLowerCase())return d;return null}const or=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Av=a=>!ls(a)&&a!==or;function ud(){const{caseless:a,skipUndefined:s}=Av(this)&&this||{},o={},i=(d,f)=>{const m=a&&Mv(o,f)||f;Wo(o[m])&&Wo(d)?o[m]=ud(o[m],d):Wo(d)?o[m]=ud({},d):fs(d)?o[m]=d.slice():(!s||!ls(d))&&(o[m]=d)};for(let d=0,f=arguments.length;d<f;d++)arguments[d]&&Sl(arguments[d],i);return o}const aN=(a,s,o,{allOwnKeys:i}={})=>(Sl(s,(d,f)=>{o&&$t(d)?Object.defineProperty(a,f,{value:Tv(d,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(a,f,{value:d,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),a),nN=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),rN=(a,s,o,i)=>{a.prototype=Object.create(s.prototype,i),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(a,"super",{value:s.prototype}),o&&Object.assign(a.prototype,o)},sN=(a,s,o,i)=>{let d,f,m;const v={};if(s=s||{},a==null)return s;do{for(d=Object.getOwnPropertyNames(a),f=d.length;f-- >0;)m=d[f],(!i||i(m,a,s))&&!v[m]&&(s[m]=a[m],v[m]=!0);a=o!==!1&&Ad(a)}while(a&&(!o||o(a,s))&&a!==Object.prototype);return s},lN=(a,s,o)=>{a=String(a),(o===void 0||o>a.length)&&(o=a.length),o-=s.length;const i=a.indexOf(s,o);return i!==-1&&i===o},oN=a=>{if(!a)return null;if(fs(a))return a;let s=a.length;if(!kv(s))return null;const o=new Array(s);for(;s-- >0;)o[s]=a[s];return o},iN=(a=>s=>a&&s instanceof a)(typeof Uint8Array<"u"&&Ad(Uint8Array)),cN=(a,s)=>{const i=(a&&a[fi]).call(a);let d;for(;(d=i.next())&&!d.done;){const f=d.value;s.call(a,f[0],f[1])}},uN=(a,s)=>{let o;const i=[];for(;(o=a.exec(s))!==null;)i.push(o);return i},dN=Ea("HTMLFormElement"),fN=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,i,d){return i.toUpperCase()+d}),hx=(({hasOwnProperty:a})=>(s,o)=>a.call(s,o))(Object.prototype),mN=Ea("RegExp"),Ov=(a,s)=>{const o=Object.getOwnPropertyDescriptors(a),i={};Sl(o,(d,f)=>{let m;(m=s(d,f,a))!==!1&&(i[f]=m||d)}),Object.defineProperties(a,i)},hN=a=>{Ov(a,(s,o)=>{if($t(a)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const i=a[o];if($t(i)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},pN=(a,s)=>{const o={},i=d=>{d.forEach(f=>{o[f]=!0})};return fs(a)?i(a):i(String(a).split(s)),o},xN=()=>{},vN=(a,s)=>a!=null&&Number.isFinite(a=+a)?a:s;function gN(a){return!!(a&&$t(a.append)&&a[_v]==="FormData"&&a[fi])}const yN=a=>{const s=new Array(10),o=(i,d)=>{if(jl(i)){if(s.indexOf(i)>=0)return;if(Nl(i))return i;if(!("toJSON"in i)){s[d]=i;const f=fs(i)?[]:{};return Sl(i,(m,v)=>{const g=o(m,d+1);!ls(g)&&(f[v]=g)}),s[d]=void 0,f}}return i};return o(a,0)},bN=Ea("AsyncFunction"),NN=a=>a&&(jl(a)||$t(a))&&$t(a.then)&&$t(a.catch),zv=((a,s)=>a?setImmediate:s?((o,i)=>(or.addEventListener("message",({source:d,data:f})=>{d===or&&f===o&&i.length&&i.shift()()},!1),d=>{i.push(d),or.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",$t(or.postMessage)),jN=typeof queueMicrotask<"u"?queueMicrotask.bind(or):typeof process<"u"&&process.nextTick||zv,SN=a=>a!=null&&$t(a[fi]),F={isArray:fs,isArrayBuffer:Rv,isBuffer:Nl,isFormData:Z2,isArrayBufferView:H2,isString:G2,isNumber:kv,isBoolean:Q2,isObject:jl,isPlainObject:Wo,isEmptyObject:V2,isReadableStream:P2,isRequest:I2,isResponse:W2,isHeaders:eN,isUndefined:ls,isDate:F2,isFile:Y2,isBlob:X2,isRegExp:mN,isFunction:$t,isStream:$2,isURLSearchParams:J2,isTypedArray:iN,isFileList:K2,forEach:Sl,merge:ud,extend:aN,trim:tN,stripBOM:nN,inherits:rN,toFlatObject:sN,kindOf:mi,kindOfTest:Ea,endsWith:lN,toArray:oN,forEachEntry:cN,matchAll:uN,isHTMLForm:dN,hasOwnProperty:hx,hasOwnProp:hx,reduceDescriptors:Ov,freezeMethods:hN,toObjectSet:pN,toCamelCase:fN,noop:xN,toFiniteNumber:vN,findKey:Mv,global:or,isContextDefined:Av,isSpecCompliantForm:gN,toJSONObject:yN,isAsyncFn:bN,isThenable:NN,setImmediate:zv,asap:jN,isIterable:SN};let Ce=class Dv extends Error{static from(s,o,i,d,f,m){const v=new Dv(s.message,o||s.code,i,d,f);return v.cause=s,v.name=s.name,m&&Object.assign(v,m),v}constructor(s,o,i,d,f){super(s),this.name="AxiosError",this.isAxiosError=!0,o&&(this.code=o),i&&(this.config=i),d&&(this.request=d),f&&(this.response=f,this.status=f.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.status}}};Ce.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Ce.ERR_BAD_OPTION="ERR_BAD_OPTION";Ce.ECONNABORTED="ECONNABORTED";Ce.ETIMEDOUT="ETIMEDOUT";Ce.ERR_NETWORK="ERR_NETWORK";Ce.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Ce.ERR_DEPRECATED="ERR_DEPRECATED";Ce.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Ce.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Ce.ERR_CANCELED="ERR_CANCELED";Ce.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Ce.ERR_INVALID_URL="ERR_INVALID_URL";const wN=null;function dd(a){return F.isPlainObject(a)||F.isArray(a)}function Uv(a){return F.endsWith(a,"[]")?a.slice(0,-2):a}function px(a,s,o){return a?a.concat(s).map(function(d,f){return d=Uv(d),!o&&f?"["+d+"]":d}).join(o?".":""):s}function EN(a){return F.isArray(a)&&!a.some(dd)}const CN=F.toFlatObject(F,{},null,function(s){return/^is[A-Z]/.test(s)});function pi(a,s,o){if(!F.isObject(a))throw new TypeError("target must be an object");s=s||new FormData,o=F.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!F.isUndefined(_[E])});const i=o.metaTokens,d=o.visitor||y,f=o.dots,m=o.indexes,g=(o.Blob||typeof Blob<"u"&&Blob)&&F.isSpecCompliantForm(s);if(!F.isFunction(d))throw new TypeError("visitor must be a function");function h(w){if(w===null)return"";if(F.isDate(w))return w.toISOString();if(F.isBoolean(w))return w.toString();if(!g&&F.isBlob(w))throw new Ce("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(w)||F.isTypedArray(w)?g&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function y(w,E,_){let A=w;if(w&&!_&&typeof w=="object"){if(F.endsWith(E,"{}"))E=i?E:E.slice(0,-2),w=JSON.stringify(w);else if(F.isArray(w)&&EN(w)||(F.isFileList(w)||F.endsWith(E,"[]"))&&(A=F.toArray(w)))return E=Uv(E),A.forEach(function(X,I){!(F.isUndefined(X)||X===null)&&s.append(m===!0?px([E],I,f):m===null?E:E+"[]",h(X))}),!1}return dd(w)?!0:(s.append(px(_,E,f),h(w)),!1)}const x=[],j=Object.assign(CN,{defaultVisitor:y,convertValue:h,isVisitable:dd});function M(w,E){if(!F.isUndefined(w)){if(x.indexOf(w)!==-1)throw Error("Circular reference detected in "+E.join("."));x.push(w),F.forEach(w,function(A,k){(!(F.isUndefined(A)||A===null)&&d.call(s,A,F.isString(k)?k.trim():k,E,j))===!0&&M(A,E?E.concat(k):[k])}),x.pop()}}if(!F.isObject(a))throw new TypeError("data must be an object");return M(a),s}function xx(a){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Od(a,s){this._pairs=[],a&&pi(a,this,s)}const Lv=Od.prototype;Lv.append=function(s,o){this._pairs.push([s,o])};Lv.toString=function(s){const o=s?function(i){return s.call(this,i,xx)}:xx;return this._pairs.map(function(d){return o(d[0])+"="+o(d[1])},"").join("&")};function TN(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Bv(a,s,o){if(!s)return a;const i=o&&o.encode||TN,d=F.isFunction(o)?{serialize:o}:o,f=d&&d.serialize;let m;if(f?m=f(s,d):m=F.isURLSearchParams(s)?s.toString():new Od(s,d).toString(i),m){const v=a.indexOf("#");v!==-1&&(a=a.slice(0,v)),a+=(a.indexOf("?")===-1?"?":"&")+m}return a}class vx{constructor(){this.handlers=[]}use(s,o,i){return this.handlers.push({fulfilled:s,rejected:o,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){F.forEach(this.handlers,function(i){i!==null&&s(i)})}}const qv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_N=typeof URLSearchParams<"u"?URLSearchParams:Od,RN=typeof FormData<"u"?FormData:null,kN=typeof Blob<"u"?Blob:null,MN={isBrowser:!0,classes:{URLSearchParams:_N,FormData:RN,Blob:kN},protocols:["http","https","file","blob","url","data"]},zd=typeof window<"u"&&typeof document<"u",fd=typeof navigator=="object"&&navigator||void 0,AN=zd&&(!fd||["ReactNative","NativeScript","NS"].indexOf(fd.product)<0),ON=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",zN=zd&&window.location.href||"http://localhost",DN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zd,hasStandardBrowserEnv:AN,hasStandardBrowserWebWorkerEnv:ON,navigator:fd,origin:zN},Symbol.toStringTag,{value:"Module"})),kt={...DN,...MN};function UN(a,s){return pi(a,new kt.classes.URLSearchParams,{visitor:function(o,i,d,f){return kt.isNode&&F.isBuffer(o)?(this.append(i,o.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...s})}function LN(a){return F.matchAll(/\w+|\[(\w*)]/g,a).map(s=>s[0]==="[]"?"":s[1]||s[0])}function BN(a){const s={},o=Object.keys(a);let i;const d=o.length;let f;for(i=0;i<d;i++)f=o[i],s[f]=a[f];return s}function Hv(a){function s(o,i,d,f){let m=o[f++];if(m==="__proto__")return!0;const v=Number.isFinite(+m),g=f>=o.length;return m=!m&&F.isArray(d)?d.length:m,g?(F.hasOwnProp(d,m)?d[m]=[d[m],i]:d[m]=i,!v):((!d[m]||!F.isObject(d[m]))&&(d[m]=[]),s(o,i,d[m],f)&&F.isArray(d[m])&&(d[m]=BN(d[m])),!v)}if(F.isFormData(a)&&F.isFunction(a.entries)){const o={};return F.forEachEntry(a,(i,d)=>{s(LN(i),d,o,0)}),o}return null}function qN(a,s,o){if(F.isString(a))try{return(s||JSON.parse)(a),F.trim(a)}catch(i){if(i.name!=="SyntaxError")throw i}return(o||JSON.stringify)(a)}const wl={transitional:qv,adapter:["xhr","http","fetch"],transformRequest:[function(s,o){const i=o.getContentType()||"",d=i.indexOf("application/json")>-1,f=F.isObject(s);if(f&&F.isHTMLForm(s)&&(s=new FormData(s)),F.isFormData(s))return d?JSON.stringify(Hv(s)):s;if(F.isArrayBuffer(s)||F.isBuffer(s)||F.isStream(s)||F.isFile(s)||F.isBlob(s)||F.isReadableStream(s))return s;if(F.isArrayBufferView(s))return s.buffer;if(F.isURLSearchParams(s))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),s.toString();let v;if(f){if(i.indexOf("application/x-www-form-urlencoded")>-1)return UN(s,this.formSerializer).toString();if((v=F.isFileList(s))||i.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return pi(v?{"files[]":s}:s,g&&new g,this.formSerializer)}}return f||d?(o.setContentType("application/json",!1),qN(s)):s}],transformResponse:[function(s){const o=this.transitional||wl.transitional,i=o&&o.forcedJSONParsing,d=this.responseType==="json";if(F.isResponse(s)||F.isReadableStream(s))return s;if(s&&F.isString(s)&&(i&&!this.responseType||d)){const m=!(o&&o.silentJSONParsing)&&d;try{return JSON.parse(s,this.parseReviver)}catch(v){if(m)throw v.name==="SyntaxError"?Ce.from(v,Ce.ERR_BAD_RESPONSE,this,null,this.response):v}}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],a=>{wl.headers[a]={}});const HN=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),GN=a=>{const s={};let o,i,d;return a&&a.split(`
12
+ `).forEach(function(m){d=m.indexOf(":"),o=m.substring(0,d).trim().toLowerCase(),i=m.substring(d+1).trim(),!(!o||s[o]&&HN[o])&&(o==="set-cookie"?s[o]?s[o].push(i):s[o]=[i]:s[o]=s[o]?s[o]+", "+i:i)}),s},gx=Symbol("internals");function fl(a){return a&&String(a).trim().toLowerCase()}function ei(a){return a===!1||a==null?a:F.isArray(a)?a.map(ei):String(a)}function QN(a){const s=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=o.exec(a);)s[i[1]]=i[2];return s}const VN=a=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(a.trim());function Vu(a,s,o,i,d){if(F.isFunction(i))return i.call(this,s,o);if(d&&(s=o),!!F.isString(s)){if(F.isString(i))return s.indexOf(i)!==-1;if(F.isRegExp(i))return i.test(s)}}function FN(a){return a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,o,i)=>o.toUpperCase()+i)}function YN(a,s){const o=F.toCamelCase(" "+s);["get","set","has"].forEach(i=>{Object.defineProperty(a,i+o,{value:function(d,f,m){return this[i].call(this,s,d,f,m)},configurable:!0})})}let Zt=class{constructor(s){s&&this.set(s)}set(s,o,i){const d=this;function f(v,g,h){const y=fl(g);if(!y)throw new Error("header name must be a non-empty string");const x=F.findKey(d,y);(!x||d[x]===void 0||h===!0||h===void 0&&d[x]!==!1)&&(d[x||g]=ei(v))}const m=(v,g)=>F.forEach(v,(h,y)=>f(h,y,g));if(F.isPlainObject(s)||s instanceof this.constructor)m(s,o);else if(F.isString(s)&&(s=s.trim())&&!VN(s))m(GN(s),o);else if(F.isObject(s)&&F.isIterable(s)){let v={},g,h;for(const y of s){if(!F.isArray(y))throw TypeError("Object iterator must return a key-value pair");v[h=y[0]]=(g=v[h])?F.isArray(g)?[...g,y[1]]:[g,y[1]]:y[1]}m(v,o)}else s!=null&&f(o,s,i);return this}get(s,o){if(s=fl(s),s){const i=F.findKey(this,s);if(i){const d=this[i];if(!o)return d;if(o===!0)return QN(d);if(F.isFunction(o))return o.call(this,d,i);if(F.isRegExp(o))return o.exec(d);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,o){if(s=fl(s),s){const i=F.findKey(this,s);return!!(i&&this[i]!==void 0&&(!o||Vu(this,this[i],i,o)))}return!1}delete(s,o){const i=this;let d=!1;function f(m){if(m=fl(m),m){const v=F.findKey(i,m);v&&(!o||Vu(i,i[v],v,o))&&(delete i[v],d=!0)}}return F.isArray(s)?s.forEach(f):f(s),d}clear(s){const o=Object.keys(this);let i=o.length,d=!1;for(;i--;){const f=o[i];(!s||Vu(this,this[f],f,s,!0))&&(delete this[f],d=!0)}return d}normalize(s){const o=this,i={};return F.forEach(this,(d,f)=>{const m=F.findKey(i,f);if(m){o[m]=ei(d),delete o[f];return}const v=s?FN(f):String(f).trim();v!==f&&delete o[f],o[v]=ei(d),i[v]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const o=Object.create(null);return F.forEach(this,(i,d)=>{i!=null&&i!==!1&&(o[d]=s&&F.isArray(i)?i.join(", "):i)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,o])=>s+": "+o).join(`
13
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...o){const i=new this(s);return o.forEach(d=>i.set(d)),i}static accessor(s){const i=(this[gx]=this[gx]={accessors:{}}).accessors,d=this.prototype;function f(m){const v=fl(m);i[v]||(YN(d,m),i[v]=!0)}return F.isArray(s)?s.forEach(f):f(s),this}};Zt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);F.reduceDescriptors(Zt.prototype,({value:a},s)=>{let o=s[0].toUpperCase()+s.slice(1);return{get:()=>a,set(i){this[o]=i}}});F.freezeMethods(Zt);function Fu(a,s){const o=this||wl,i=s||o,d=Zt.from(i.headers);let f=i.data;return F.forEach(a,function(v){f=v.call(o,f,d.normalize(),s?s.status:void 0)}),d.normalize(),f}function Gv(a){return!!(a&&a.__CANCEL__)}let El=class extends Ce{constructor(s,o,i){super(s??"canceled",Ce.ERR_CANCELED,o,i),this.name="CanceledError",this.__CANCEL__=!0}};function Qv(a,s,o){const i=o.config.validateStatus;!o.status||!i||i(o.status)?a(o):s(new Ce("Request failed with status code "+o.status,[Ce.ERR_BAD_REQUEST,Ce.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function XN(a){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return s&&s[1]||""}function KN(a,s){a=a||10;const o=new Array(a),i=new Array(a);let d=0,f=0,m;return s=s!==void 0?s:1e3,function(g){const h=Date.now(),y=i[f];m||(m=h),o[d]=g,i[d]=h;let x=f,j=0;for(;x!==d;)j+=o[x++],x=x%a;if(d=(d+1)%a,d===f&&(f=(f+1)%a),h-m<s)return;const M=y&&h-y;return M?Math.round(j*1e3/M):void 0}}function $N(a,s){let o=0,i=1e3/s,d,f;const m=(h,y=Date.now())=>{o=y,d=null,f&&(clearTimeout(f),f=null),a(...h)};return[(...h)=>{const y=Date.now(),x=y-o;x>=i?m(h,y):(d=h,f||(f=setTimeout(()=>{f=null,m(d)},i-x)))},()=>d&&m(d)]}const oi=(a,s,o=3)=>{let i=0;const d=KN(50,250);return $N(f=>{const m=f.loaded,v=f.lengthComputable?f.total:void 0,g=m-i,h=d(g),y=m<=v;i=m;const x={loaded:m,total:v,progress:v?m/v:void 0,bytes:g,rate:h||void 0,estimated:h&&v&&y?(v-m)/h:void 0,event:f,lengthComputable:v!=null,[s?"download":"upload"]:!0};a(x)},o)},yx=(a,s)=>{const o=a!=null;return[i=>s[0]({lengthComputable:o,total:a,loaded:i}),s[1]]},bx=a=>(...s)=>F.asap(()=>a(...s)),ZN=kt.hasStandardBrowserEnv?((a,s)=>o=>(o=new URL(o,kt.origin),a.protocol===o.protocol&&a.host===o.host&&(s||a.port===o.port)))(new URL(kt.origin),kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent)):()=>!0,JN=kt.hasStandardBrowserEnv?{write(a,s,o,i,d,f,m){if(typeof document>"u")return;const v=[`${a}=${encodeURIComponent(s)}`];F.isNumber(o)&&v.push(`expires=${new Date(o).toUTCString()}`),F.isString(i)&&v.push(`path=${i}`),F.isString(d)&&v.push(`domain=${d}`),f===!0&&v.push("secure"),F.isString(m)&&v.push(`SameSite=${m}`),document.cookie=v.join("; ")},read(a){if(typeof document>"u")return null;const s=document.cookie.match(new RegExp("(?:^|; )"+a+"=([^;]*)"));return s?decodeURIComponent(s[1]):null},remove(a){this.write(a,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function PN(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function IN(a,s){return s?a.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):a}function Vv(a,s,o){let i=!PN(s);return a&&(i||o==!1)?IN(a,s):s}const Nx=a=>a instanceof Zt?{...a}:a;function dr(a,s){s=s||{};const o={};function i(h,y,x,j){return F.isPlainObject(h)&&F.isPlainObject(y)?F.merge.call({caseless:j},h,y):F.isPlainObject(y)?F.merge({},y):F.isArray(y)?y.slice():y}function d(h,y,x,j){if(F.isUndefined(y)){if(!F.isUndefined(h))return i(void 0,h,x,j)}else return i(h,y,x,j)}function f(h,y){if(!F.isUndefined(y))return i(void 0,y)}function m(h,y){if(F.isUndefined(y)){if(!F.isUndefined(h))return i(void 0,h)}else return i(void 0,y)}function v(h,y,x){if(x in s)return i(h,y);if(x in a)return i(void 0,h)}const g={url:f,method:f,data:f,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:v,headers:(h,y,x)=>d(Nx(h),Nx(y),x,!0)};return F.forEach(Object.keys({...a,...s}),function(y){const x=g[y]||d,j=x(a[y],s[y],y);F.isUndefined(j)&&x!==v||(o[y]=j)}),o}const Fv=a=>{const s=dr({},a);let{data:o,withXSRFToken:i,xsrfHeaderName:d,xsrfCookieName:f,headers:m,auth:v}=s;if(s.headers=m=Zt.from(m),s.url=Bv(Vv(s.baseURL,s.url,s.allowAbsoluteUrls),a.params,a.paramsSerializer),v&&m.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):""))),F.isFormData(o)){if(kt.hasStandardBrowserEnv||kt.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(F.isFunction(o.getHeaders)){const g=o.getHeaders(),h=["content-type","content-length"];Object.entries(g).forEach(([y,x])=>{h.includes(y.toLowerCase())&&m.set(y,x)})}}if(kt.hasStandardBrowserEnv&&(i&&F.isFunction(i)&&(i=i(s)),i||i!==!1&&ZN(s.url))){const g=d&&f&&JN.read(f);g&&m.set(d,g)}return s},WN=typeof XMLHttpRequest<"u",ej=WN&&function(a){return new Promise(function(o,i){const d=Fv(a);let f=d.data;const m=Zt.from(d.headers).normalize();let{responseType:v,onUploadProgress:g,onDownloadProgress:h}=d,y,x,j,M,w;function E(){M&&M(),w&&w(),d.cancelToken&&d.cancelToken.unsubscribe(y),d.signal&&d.signal.removeEventListener("abort",y)}let _=new XMLHttpRequest;_.open(d.method.toUpperCase(),d.url,!0),_.timeout=d.timeout;function A(){if(!_)return;const X=Zt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),W={data:!v||v==="text"||v==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:X,config:a,request:_};Qv(function(D){o(D),E()},function(D){i(D),E()},W),_=null}"onloadend"in _?_.onloadend=A:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(A)},_.onabort=function(){_&&(i(new Ce("Request aborted",Ce.ECONNABORTED,a,_)),_=null)},_.onerror=function(I){const W=I&&I.message?I.message:"Network Error",ee=new Ce(W,Ce.ERR_NETWORK,a,_);ee.event=I||null,i(ee),_=null},_.ontimeout=function(){let I=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded";const W=d.transitional||qv;d.timeoutErrorMessage&&(I=d.timeoutErrorMessage),i(new Ce(I,W.clarifyTimeoutError?Ce.ETIMEDOUT:Ce.ECONNABORTED,a,_)),_=null},f===void 0&&m.setContentType(null),"setRequestHeader"in _&&F.forEach(m.toJSON(),function(I,W){_.setRequestHeader(W,I)}),F.isUndefined(d.withCredentials)||(_.withCredentials=!!d.withCredentials),v&&v!=="json"&&(_.responseType=d.responseType),h&&([j,w]=oi(h,!0),_.addEventListener("progress",j)),g&&_.upload&&([x,M]=oi(g),_.upload.addEventListener("progress",x),_.upload.addEventListener("loadend",M)),(d.cancelToken||d.signal)&&(y=X=>{_&&(i(!X||X.type?new El(null,a,_):X),_.abort(),_=null)},d.cancelToken&&d.cancelToken.subscribe(y),d.signal&&(d.signal.aborted?y():d.signal.addEventListener("abort",y)));const k=XN(d.url);if(k&&kt.protocols.indexOf(k)===-1){i(new Ce("Unsupported protocol "+k+":",Ce.ERR_BAD_REQUEST,a));return}_.send(f||null)})},tj=(a,s)=>{const{length:o}=a=a?a.filter(Boolean):[];if(s||o){let i=new AbortController,d;const f=function(h){if(!d){d=!0,v();const y=h instanceof Error?h:this.reason;i.abort(y instanceof Ce?y:new El(y instanceof Error?y.message:y))}};let m=s&&setTimeout(()=>{m=null,f(new Ce(`timeout of ${s}ms exceeded`,Ce.ETIMEDOUT))},s);const v=()=>{a&&(m&&clearTimeout(m),m=null,a.forEach(h=>{h.unsubscribe?h.unsubscribe(f):h.removeEventListener("abort",f)}),a=null)};a.forEach(h=>h.addEventListener("abort",f));const{signal:g}=i;return g.unsubscribe=()=>F.asap(v),g}},aj=function*(a,s){let o=a.byteLength;if(o<s){yield a;return}let i=0,d;for(;i<o;)d=i+s,yield a.slice(i,d),i=d},nj=async function*(a,s){for await(const o of rj(a))yield*aj(o,s)},rj=async function*(a){if(a[Symbol.asyncIterator]){yield*a;return}const s=a.getReader();try{for(;;){const{done:o,value:i}=await s.read();if(o)break;yield i}}finally{await s.cancel()}},jx=(a,s,o,i)=>{const d=nj(a,s);let f=0,m,v=g=>{m||(m=!0,i&&i(g))};return new ReadableStream({async pull(g){try{const{done:h,value:y}=await d.next();if(h){v(),g.close();return}let x=y.byteLength;if(o){let j=f+=x;o(j)}g.enqueue(new Uint8Array(y))}catch(h){throw v(h),h}},cancel(g){return v(g),d.return()}},{highWaterMark:2})},Sx=64*1024,{isFunction:Fo}=F,sj=(({Request:a,Response:s})=>({Request:a,Response:s}))(F.global),{ReadableStream:wx,TextEncoder:Ex}=F.global,Cx=(a,...s)=>{try{return!!a(...s)}catch{return!1}},lj=a=>{a=F.merge.call({skipUndefined:!0},sj,a);const{fetch:s,Request:o,Response:i}=a,d=s?Fo(s):typeof fetch=="function",f=Fo(o),m=Fo(i);if(!d)return!1;const v=d&&Fo(wx),g=d&&(typeof Ex=="function"?(w=>E=>w.encode(E))(new Ex):async w=>new Uint8Array(await new o(w).arrayBuffer())),h=f&&v&&Cx(()=>{let w=!1;const E=new o(kt.origin,{body:new wx,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!E}),y=m&&v&&Cx(()=>F.isReadableStream(new i("").body)),x={stream:y&&(w=>w.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!x[w]&&(x[w]=(E,_)=>{let A=E&&E[w];if(A)return A.call(E);throw new Ce(`Response type '${w}' is not supported`,Ce.ERR_NOT_SUPPORT,_)})});const j=async w=>{if(w==null)return 0;if(F.isBlob(w))return w.size;if(F.isSpecCompliantForm(w))return(await new o(kt.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(F.isArrayBufferView(w)||F.isArrayBuffer(w))return w.byteLength;if(F.isURLSearchParams(w)&&(w=w+""),F.isString(w))return(await g(w)).byteLength},M=async(w,E)=>{const _=F.toFiniteNumber(w.getContentLength());return _??j(E)};return async w=>{let{url:E,method:_,data:A,signal:k,cancelToken:X,timeout:I,onDownloadProgress:W,onUploadProgress:ee,responseType:D,headers:z,withCredentials:oe="same-origin",fetchOptions:be}=Fv(w),se=s||fetch;D=D?(D+"").toLowerCase():"text";let pe=tj([k,X&&X.toAbortSignal()],I),Ee=null;const he=pe&&pe.unsubscribe&&(()=>{pe.unsubscribe()});let ne;try{if(ee&&h&&_!=="get"&&_!=="head"&&(ne=await M(z,A))!==0){let S=new o(E,{method:"POST",body:A,duplex:"half"}),L;if(F.isFormData(A)&&(L=S.headers.get("content-type"))&&z.setContentType(L),S.body){const[Q,Z]=yx(ne,oi(bx(ee)));A=jx(S.body,Sx,Q,Z)}}F.isString(oe)||(oe=oe?"include":"omit");const C=f&&"credentials"in o.prototype,Y={...be,signal:pe,method:_.toUpperCase(),headers:z.normalize().toJSON(),body:A,duplex:"half",credentials:C?oe:void 0};Ee=f&&new o(E,Y);let K=await(f?se(Ee,be):se(E,Y));const ge=y&&(D==="stream"||D==="response");if(y&&(W||ge&&he)){const S={};["status","statusText","headers"].forEach(re=>{S[re]=K[re]});const L=F.toFiniteNumber(K.headers.get("content-length")),[Q,Z]=W&&yx(L,oi(bx(W),!0))||[];K=new i(jx(K.body,Sx,Q,()=>{Z&&Z(),he&&he()}),S)}D=D||"text";let te=await x[F.findKey(x,D)||"text"](K,w);return!ge&&he&&he(),await new Promise((S,L)=>{Qv(S,L,{data:te,headers:Zt.from(K.headers),status:K.status,statusText:K.statusText,config:w,request:Ee})})}catch(C){throw he&&he(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new Ce("Network Error",Ce.ERR_NETWORK,w,Ee),{cause:C.cause||C}):Ce.from(C,C&&C.code,w,Ee)}}},oj=new Map,Yv=a=>{let s=a&&a.env||{};const{fetch:o,Request:i,Response:d}=s,f=[i,d,o];let m=f.length,v=m,g,h,y=oj;for(;v--;)g=f[v],h=y.get(g),h===void 0&&y.set(g,h=v?new Map:lj(s)),y=h;return h};Yv();const Dd={http:wN,xhr:ej,fetch:{get:Yv}};F.forEach(Dd,(a,s)=>{if(a){try{Object.defineProperty(a,"name",{value:s})}catch{}Object.defineProperty(a,"adapterName",{value:s})}});const Tx=a=>`- ${a}`,ij=a=>F.isFunction(a)||a===null||a===!1;function cj(a,s){a=F.isArray(a)?a:[a];const{length:o}=a;let i,d;const f={};for(let m=0;m<o;m++){i=a[m];let v;if(d=i,!ij(i)&&(d=Dd[(v=String(i)).toLowerCase()],d===void 0))throw new Ce(`Unknown adapter '${v}'`);if(d&&(F.isFunction(d)||(d=d.get(s))))break;f[v||"#"+m]=d}if(!d){const m=Object.entries(f).map(([g,h])=>`adapter ${g} `+(h===!1?"is not supported by the environment":"is not available in the build"));let v=o?m.length>1?`since :
14
14
  `+m.map(Tx).join(`
15
- `):" "+Tx(m[0]):"as no adapter specified";throw new we("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return d}const Xv={getAdapter:cj,adapters:Dd};function Yu(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new El(null,a)}function _x(a){return Yu(a),a.headers=Zt.from(a.headers),a.data=Fu.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),Xv.getAdapter(a.adapter||wl.adapter,a)(a).then(function(i){return Yu(a),i.data=Fu.call(a,a.transformResponse,i),i.headers=Zt.from(i.headers),i},function(i){return Gv(i)||(Yu(a),i&&i.response&&(i.response.data=Fu.call(a,a.transformResponse,i.response),i.response.headers=Zt.from(i.response.headers))),Promise.reject(i)})}const Kv="1.13.4",xi={};["object","boolean","number","function","string","symbol"].forEach((a,s)=>{xi[a]=function(i){return typeof i===a||"a"+(s<1?"n ":" ")+a}});const Rx={};xi.transitional=function(s,o,i){function d(f,m){return"[Axios v"+Kv+"] Transitional option '"+f+"'"+m+(i?". "+i:"")}return(f,m,v)=>{if(s===!1)throw new we(d(m," has been removed"+(o?" in "+o:"")),we.ERR_DEPRECATED);return o&&!Rx[m]&&(Rx[m]=!0,console.warn(d(m," has been deprecated since v"+o+" and will be removed in the near future"))),s?s(f,m,v):!0}};xi.spelling=function(s){return(o,i)=>(console.warn(`${i} is likely a misspelling of ${s}`),!0)};function uj(a,s,o){if(typeof a!="object")throw new we("options must be an object",we.ERR_BAD_OPTION_VALUE);const i=Object.keys(a);let d=i.length;for(;d-- >0;){const f=i[d],m=s[f];if(m){const v=a[f],g=v===void 0||m(v,f,a);if(g!==!0)throw new we("option "+f+" must be "+g,we.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new we("Unknown option "+f,we.ERR_BAD_OPTION)}}const ti={assertOptions:uj,validators:xi},Oa=ti.validators;let ir=class{constructor(s){this.defaults=s||{},this.interceptors={request:new vx,response:new vx}}async request(s,o){try{return await this._request(s,o)}catch(i){if(i instanceof Error){let d={};Error.captureStackTrace?Error.captureStackTrace(d):d=new Error;const f=d.stack?d.stack.replace(/^.+\n/,""):"";try{i.stack?f&&!String(i.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(i.stack+=`
16
- `+f):i.stack=f}catch{}}throw i}}_request(s,o){typeof s=="string"?(o=o||{},o.url=s):o=s||{},o=dr(this.defaults,o);const{transitional:i,paramsSerializer:d,headers:f}=o;i!==void 0&&ti.assertOptions(i,{silentJSONParsing:Oa.transitional(Oa.boolean),forcedJSONParsing:Oa.transitional(Oa.boolean),clarifyTimeoutError:Oa.transitional(Oa.boolean)},!1),d!=null&&(Y.isFunction(d)?o.paramsSerializer={serialize:d}:ti.assertOptions(d,{encode:Oa.function,serialize:Oa.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),ti.assertOptions(o,{baseUrl:Oa.spelling("baseURL"),withXsrfToken:Oa.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let m=f&&Y.merge(f.common,f[o.method]);f&&Y.forEach(["delete","get","head","post","put","patch","common"],w=>{delete f[w]}),o.headers=Zt.concat(m,f);const v=[];let g=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(o)===!1||(g=g&&E.synchronous,v.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let y,x=0,j;if(!g){const w=[_x.bind(this),void 0];for(w.unshift(...v),w.push(...h),j=w.length,y=Promise.resolve(o);x<j;)y=y.then(w[x++],w[x++]);return y}j=v.length;let M=o;for(;x<j;){const w=v[x++],E=v[x++];try{M=w(M)}catch(_){E.call(this,_);break}}try{y=_x.call(this,M)}catch(w){return Promise.reject(w)}for(x=0,j=h.length;x<j;)y=y.then(h[x++],h[x++]);return y}getUri(s){s=dr(this.defaults,s);const o=Vv(s.baseURL,s.url,s.allowAbsoluteUrls);return Bv(o,s.params,s.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(s){ir.prototype[s]=function(o,i){return this.request(dr(i||{},{method:s,url:o,data:(i||{}).data}))}});Y.forEach(["post","put","patch"],function(s){function o(i){return function(f,m,v){return this.request(dr(v||{},{method:s,headers:i?{"Content-Type":"multipart/form-data"}:{},url:f,data:m}))}}ir.prototype[s]=o(),ir.prototype[s+"Form"]=o(!0)});let dj=class $v{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(f){o=f});const i=this;this.promise.then(d=>{if(!i._listeners)return;let f=i._listeners.length;for(;f-- >0;)i._listeners[f](d);i._listeners=null}),this.promise.then=d=>{let f;const m=new Promise(v=>{i.subscribe(v),f=v}).then(d);return m.cancel=function(){i.unsubscribe(f)},m},s(function(f,m,v){i.reason||(i.reason=new El(f,m,v),o(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const o=this._listeners.indexOf(s);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const s=new AbortController,o=i=>{s.abort(i)};return this.subscribe(o),s.signal.unsubscribe=()=>this.unsubscribe(o),s.signal}static source(){let s;return{token:new $v(function(d){s=d}),cancel:s}}};function fj(a){return function(o){return a.apply(null,o)}}function mj(a){return Y.isObject(a)&&a.isAxiosError===!0}const md={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(md).forEach(([a,s])=>{md[s]=a});function Zv(a){const s=new ir(a),o=Tv(ir.prototype.request,s);return Y.extend(o,ir.prototype,s,{allOwnKeys:!0}),Y.extend(o,s,null,{allOwnKeys:!0}),o.create=function(d){return Zv(dr(a,d))},o}const nt=Zv(wl);nt.Axios=ir;nt.CanceledError=El;nt.CancelToken=dj;nt.isCancel=Gv;nt.VERSION=Kv;nt.toFormData=pi;nt.AxiosError=we;nt.Cancel=nt.CanceledError;nt.all=function(s){return Promise.all(s)};nt.spread=fj;nt.isAxiosError=mj;nt.mergeConfig=dr;nt.AxiosHeaders=Zt;nt.formToJSON=a=>Hv(Y.isHTMLForm(a)?new FormData(a):a);nt.getAdapter=Xv.getAdapter;nt.HttpStatusCode=md;nt.default=nt;const{Axios:m3,AxiosError:h3,CanceledError:p3,isCancel:x3,CancelToken:v3,VERSION:g3,all:y3,Cancel:b3,isAxiosError:N3,spread:j3,toFormData:S3,AxiosHeaders:w3,HttpStatusCode:E3,formToJSON:C3,getAdapter:T3,mergeConfig:_3}=nt,xe=nt.create({baseURL:""});function rs(a){a?xe.defaults.headers.common.Authorization=`Bearer ${a}`:delete xe.defaults.headers.common.Authorization}let hd=null;function hj(a){hd=a}let Jv=null;function pj(a){Jv=a}xe.interceptors.request.use(a=>{if(!a.headers.Authorization){const s=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token");s&&(a.headers.Authorization=`Bearer ${s}`)}return a});xe.interceptors.response.use(a=>a,async a=>{const s=a.config;if(s.url?.startsWith("/api/auth/"))return Promise.reject(a);if(a.response?.status===401&&!s._retry&&hd){s._retry=!0;const o=await hd();if(o)return s.headers.Authorization=`Bearer ${o}`,xe(s);Jv?.()}return Promise.reject(a)});async function xj(){const{data:a}=await xe.get("/api/auth/setup-status");return a}async function Pv(a,s,o){const{data:i}=await xe.post("/api/auth/setup",{email:a,password:s,username:o});return i}async function vj(a,s){const{data:o}=await xe.post("/api/auth/login",{email:a,password:s});return o}async function gj(a){const{data:s}=await xe.post("/api/auth/refresh",{refresh_token:a});return s}const Iv=N.createContext(void 0),ml="jarvis-admin:access_token",ts="jarvis-admin:refresh_token",Yo="jarvis-admin:user",yj=600*1e3;function bj({children:a}){const[s,o]=N.useState(()=>{const g=localStorage.getItem(ml),h=localStorage.getItem(ts),y=localStorage.getItem(Yo);if(g&&h&&y)try{const x=JSON.parse(y);return rs(g),{user:x,accessToken:g,refreshToken:h,isAuthenticated:!0,isLoading:!1,error:null}}catch{}return{user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null}}),i=N.useCallback(()=>{localStorage.removeItem(ml),localStorage.removeItem(ts),localStorage.removeItem(Yo),rs(null),o({user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null})},[]),d=N.useCallback(async()=>{const g=localStorage.getItem(ts);if(!g)return null;try{const h=await gj(g),y=h.access_token,x=h.refresh_token??g;return localStorage.setItem(ml,y),localStorage.setItem(ts,x),rs(y),o(j=>({...j,accessToken:y,refreshToken:x})),y}catch{return i(),null}},[i]);N.useEffect(()=>{hj(d),pj(i)},[d,i]),N.useEffect(()=>{if(!s.isAuthenticated)return;const g=setInterval(()=>{d()},yj);return()=>clearInterval(g)},[s.isAuthenticated,d]);const f=N.useCallback(async(g,h)=>{o(y=>({...y,error:null,isLoading:!0}));try{const y=await vj(g,h);if(!y.user.is_superuser){o(x=>({...x,isLoading:!1,error:"Admin access required. This account is not a superuser."}));return}localStorage.setItem(ml,y.access_token),localStorage.setItem(ts,y.refresh_token),localStorage.setItem(Yo,JSON.stringify(y.user)),rs(y.access_token),o({user:y.user,accessToken:y.access_token,refreshToken:y.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(y){const x=y?.response?.data?.detail??"Login failed";o(j=>({...j,isLoading:!1,error:x}))}},[]),m=N.useCallback(async(g,h,y)=>{o(x=>({...x,error:null,isLoading:!0}));try{const x=await Pv(g,h,y);localStorage.setItem(ml,x.access_token),localStorage.setItem(ts,x.refresh_token),localStorage.setItem(Yo,JSON.stringify(x.user)),rs(x.access_token),o({user:x.user,accessToken:x.access_token,refreshToken:x.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(x){const j=x?.response?.data?.detail??"Setup failed";o(M=>({...M,isLoading:!1,error:j}))}},[]),v=N.useMemo(()=>({state:s,login:f,setup:m,logout:i}),[s,f,m,i]);return l.jsx(Iv.Provider,{value:v,children:a})}function Ud(){const a=N.useContext(Iv);if(!a)throw new Error("useAuth must be used within AuthProvider");return a}const Wv=(...a)=>a.filter((s,o,i)=>!!s&&s.trim()!==""&&i.indexOf(s)===o).join(" ").trim();const Nj=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const jj=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,o,i)=>i?i.toUpperCase():o.toLowerCase());const kx=a=>{const s=jj(a);return s.charAt(0).toUpperCase()+s.slice(1)};var Sj={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"};const wj=a=>{for(const s in a)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1};const Ej=N.forwardRef(({color:a="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:d="",children:f,iconNode:m,...v},g)=>N.createElement("svg",{ref:g,...Sj,width:s,height:s,stroke:a,strokeWidth:i?Number(o)*24/Number(s):o,className:Wv("lucide",d),...!f&&!wj(v)&&{"aria-hidden":"true"},...v},[...m.map(([h,y])=>N.createElement(h,y)),...Array.isArray(f)?f:[f]]));const ye=(a,s)=>{const o=N.forwardRef(({className:i,...d},f)=>N.createElement(Ej,{ref:f,iconNode:s,className:Wv(`lucide-${Nj(kx(a))}`,`lucide-${a}`,i),...d}));return o.displayName=kx(a),o};const Cj=[["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"}]],Tj=ye("activity",Cj);const _j=[["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"}]],Rj=ye("box",_j);const kj=[["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"}]],Mj=ye("boxes",kj);const Aj=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],pd=ye("brain",Aj);const Oj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vi=ye("check",Oj);const zj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ld=ye("chevron-down",zj);const Dj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eg=ye("chevron-right",Dj);const Uj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Bd=ye("circle-alert",Uj);const Lj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],qd=ye("circle-arrow-up",Lj);const Bj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],qj=ye("circle-check-big",Bj);const Hj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],pt=ye("circle-check",Hj);const Gj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],xl=ye("circle-x",Gj);const Qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],os=ye("circle",Qj);const Vj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fj=ye("clock",Vj);const Yj=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Hd=ye("copy",Yj);const Xj=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],On=ye("cpu",Xj);const Kj=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$j=ye("database",Kj);const Zj=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],za=ye("download",Zj);const Jj=[["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"}]],Pj=ye("external-link",Jj);const Ij=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],tg=ye("file-text",Ij);const Wj=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],xd=ye("git-merge",Wj);const eS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],tS=ye("globe",eS);const aS=[["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"}]],Gd=ye("hard-drive",aS);const nS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],rS=ye("info",nS);const sS=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],lS=ye("key-round",sS);const oS=[["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"}]],iS=ye("key",oS);const cS=[["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"}]],uS=ye("layout-dashboard",cS);const dS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ct=ye("loader-circle",dS);const fS=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],mS=ye("lock-open",fS);const hS=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],gi=ye("lock",hS);const pS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],xS=ye("log-out",pS);const vS=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Mx=ye("mic",vS);const gS=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],yS=ye("monitor",gS);const bS=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],NS=ye("moon",bS);const jS=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],SS=ye("pencil",jS);const wS=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ag=ye("play",wS);const ES=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ai=ye("plus",ES);const CS=[["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"}]],it=ye("refresh-cw",CS);const TS=[["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"}]],yi=ye("rotate-ccw",TS);const _S=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Qd=ye("rotate-cw",_S);const RS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],kS=ye("search",RS);const MS=[["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"}]],Vd=ye("server",MS);const AS=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ng=ye("settings",AS);const OS=[["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"}]],zS=ye("shield-check",OS);const DS=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],US=ye("sparkles",DS);const LS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],BS=ye("square",LS);const qS=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],HS=ye("sun",qS);const GS=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],bi=ye("trash-2",GS);const QS=[["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"}]],ra=ye("triangle-alert",QS);const VS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],FS=ye("user-x",VS);const YS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],XS=ye("users",YS);const KS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fd=ye("x",KS);const $S=[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ZS=ye("zap-off",$S);const JS=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ii=ye("zap",JS);function rg(a){var s,o,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var d=a.length;for(s=0;s<d;s++)a[s]&&(o=rg(a[s]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function PS(){for(var a,s,o=0,i="",d=arguments.length;o<d;o++)(a=arguments[o])&&(s=rg(a))&&(i&&(i+=" "),i+=s);return i}const IS=(a,s)=>{const o=new Array(a.length+s.length);for(let i=0;i<a.length;i++)o[i]=a[i];for(let i=0;i<s.length;i++)o[a.length+i]=s[i];return o},WS=(a,s)=>({classGroupId:a,validator:s}),sg=(a=new Map,s=null,o)=>({nextPart:a,validators:s,classGroupId:o}),ci="-",Ax=[],ew="arbitrary..",tw=a=>{const s=nw(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return aw(m);const v=m.split(ci),g=v[0]===""&&v.length>1?1:0;return lg(v,g,s)},getConflictingClassGroupIds:(m,v)=>{if(v){const g=i[m],h=o[m];return g?h?IS(h,g):g:h||Ax}return o[m]||Ax}}},lg=(a,s,o)=>{if(a.length-s===0)return o.classGroupId;const d=a[s],f=o.nextPart.get(d);if(f){const h=lg(a,s+1,f);if(h)return h}const m=o.validators;if(m===null)return;const v=s===0?a.join(ci):a.slice(s).join(ci),g=m.length;for(let h=0;h<g;h++){const y=m[h];if(y.validator(v))return y.classGroupId}},aw=a=>a.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=a.slice(1,-1),o=s.indexOf(":"),i=s.slice(0,o);return i?ew+i:void 0})(),nw=a=>{const{theme:s,classGroups:o}=a;return rw(o,s)},rw=(a,s)=>{const o=sg();for(const i in a){const d=a[i];Yd(d,o,i,s)}return o},Yd=(a,s,o,i)=>{const d=a.length;for(let f=0;f<d;f++){const m=a[f];sw(m,s,o,i)}},sw=(a,s,o,i)=>{if(typeof a=="string"){lw(a,s,o);return}if(typeof a=="function"){ow(a,s,o,i);return}iw(a,s,o,i)},lw=(a,s,o)=>{const i=a===""?s:og(s,a);i.classGroupId=o},ow=(a,s,o,i)=>{if(cw(a)){Yd(a(i),s,o,i);return}s.validators===null&&(s.validators=[]),s.validators.push(WS(o,a))},iw=(a,s,o,i)=>{const d=Object.entries(a),f=d.length;for(let m=0;m<f;m++){const[v,g]=d[m];Yd(g,og(s,v),o,i)}},og=(a,s)=>{let o=a;const i=s.split(ci),d=i.length;for(let f=0;f<d;f++){const m=i[f];let v=o.nextPart.get(m);v||(v=sg(),o.nextPart.set(m,v)),o=v}return o},cw=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,uw=a=>{if(a<1)return{get:()=>{},set:()=>{}};let s=0,o=Object.create(null),i=Object.create(null);const d=(f,m)=>{o[f]=m,s++,s>a&&(s=0,i=o,o=Object.create(null))};return{get(f){let m=o[f];if(m!==void 0)return m;if((m=i[f])!==void 0)return d(f,m),m},set(f,m){f in o?o[f]=m:d(f,m)}}},vd="!",Ox=":",dw=[],zx=(a,s,o,i,d)=>({modifiers:a,hasImportantModifier:s,baseClassName:o,maybePostfixModifierPosition:i,isExternal:d}),fw=a=>{const{prefix:s,experimentalParseClassName:o}=a;let i=d=>{const f=[];let m=0,v=0,g=0,h;const y=d.length;for(let E=0;E<y;E++){const _=d[E];if(m===0&&v===0){if(_===Ox){f.push(d.slice(g,E)),g=E+1;continue}if(_==="/"){h=E;continue}}_==="["?m++:_==="]"?m--:_==="("?v++:_===")"&&v--}const x=f.length===0?d:d.slice(g);let j=x,M=!1;x.endsWith(vd)?(j=x.slice(0,-1),M=!0):x.startsWith(vd)&&(j=x.slice(1),M=!0);const w=h&&h>g?h-g:void 0;return zx(f,M,j,w)};if(s){const d=s+Ox,f=i;i=m=>m.startsWith(d)?f(m.slice(d.length)):zx(dw,!1,m,void 0,!0)}if(o){const d=i;i=f=>o({className:f,parseClassName:d})}return i},mw=a=>{const s=new Map;return a.orderSensitiveModifiers.forEach((o,i)=>{s.set(o,1e6+i)}),o=>{const i=[];let d=[];for(let f=0;f<o.length;f++){const m=o[f],v=m[0]==="[",g=s.has(m);v||g?(d.length>0&&(d.sort(),i.push(...d),d=[]),i.push(m)):d.push(m)}return d.length>0&&(d.sort(),i.push(...d)),i}},hw=a=>({cache:uw(a.cacheSize),parseClassName:fw(a),sortModifiers:mw(a),...tw(a)}),pw=/\s+/,xw=(a,s)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:d,sortModifiers:f}=s,m=[],v=a.trim().split(pw);let g="";for(let h=v.length-1;h>=0;h-=1){const y=v[h],{isExternal:x,modifiers:j,hasImportantModifier:M,baseClassName:w,maybePostfixModifierPosition:E}=o(y);if(x){g=y+(g.length>0?" "+g:g);continue}let _=!!E,O=i(_?w.substring(0,E):w);if(!O){if(!_){g=y+(g.length>0?" "+g:g);continue}if(O=i(w),!O){g=y+(g.length>0?" "+g:g);continue}_=!1}const k=j.length===0?"":j.length===1?j[0]:f(j).join(":"),G=M?k+vd:k,$=G+O;if(m.indexOf($)>-1)continue;m.push($);const W=d(O,_);for(let te=0;te<W.length;++te){const H=W[te];m.push(G+H)}g=y+(g.length>0?" "+g:g)}return g},vw=(...a)=>{let s=0,o,i,d="";for(;s<a.length;)(o=a[s++])&&(i=ig(o))&&(d&&(d+=" "),d+=i);return d},ig=a=>{if(typeof a=="string")return a;let s,o="";for(let i=0;i<a.length;i++)a[i]&&(s=ig(a[i]))&&(o&&(o+=" "),o+=s);return o},gw=(a,...s)=>{let o,i,d,f;const m=g=>{const h=s.reduce((y,x)=>x(y),a());return o=hw(h),i=o.cache.get,d=o.cache.set,f=v,v(g)},v=g=>{const h=i(g);if(h)return h;const y=xw(g,o);return d(g,y),y};return f=m,(...g)=>f(vw(...g))},yw=[],ft=a=>{const s=o=>o[a]||yw;return s.isThemeGetter=!0,s},cg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ug=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bw=/^\d+\/\d+$/,Nw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jw=/\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$/,Sw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ww=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ew=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,as=a=>bw.test(a),Ae=a=>!!a&&!Number.isNaN(Number(a)),Mn=a=>!!a&&Number.isInteger(Number(a)),Xu=a=>a.endsWith("%")&&Ae(a.slice(0,-1)),en=a=>Nw.test(a),Cw=()=>!0,Tw=a=>jw.test(a)&&!Sw.test(a),dg=()=>!1,_w=a=>ww.test(a),Rw=a=>Ew.test(a),kw=a=>!de(a)&&!fe(a),Mw=a=>ms(a,hg,dg),de=a=>cg.test(a),sr=a=>ms(a,pg,Tw),Ku=a=>ms(a,Uw,Ae),Dx=a=>ms(a,fg,dg),Aw=a=>ms(a,mg,Rw),Xo=a=>ms(a,xg,_w),fe=a=>ug.test(a),hl=a=>hs(a,pg),Ow=a=>hs(a,Lw),Ux=a=>hs(a,fg),zw=a=>hs(a,hg),Dw=a=>hs(a,mg),Ko=a=>hs(a,xg,!0),ms=(a,s,o)=>{const i=cg.exec(a);return i?i[1]?s(i[1]):o(i[2]):!1},hs=(a,s,o=!1)=>{const i=ug.exec(a);return i?i[1]?s(i[1]):o:!1},fg=a=>a==="position"||a==="percentage",mg=a=>a==="image"||a==="url",hg=a=>a==="length"||a==="size"||a==="bg-size",pg=a=>a==="length",Uw=a=>a==="number",Lw=a=>a==="family-name",xg=a=>a==="shadow",Bw=()=>{const a=ft("color"),s=ft("font"),o=ft("text"),i=ft("font-weight"),d=ft("tracking"),f=ft("leading"),m=ft("breakpoint"),v=ft("container"),g=ft("spacing"),h=ft("radius"),y=ft("shadow"),x=ft("inset-shadow"),j=ft("text-shadow"),M=ft("drop-shadow"),w=ft("blur"),E=ft("perspective"),_=ft("aspect"),O=ft("ease"),k=ft("animate"),G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...$(),fe,de],te=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],z=()=>[fe,de,g],oe=()=>[as,"full","auto",...z()],be=()=>[Mn,"none","subgrid",fe,de],se=()=>["auto",{span:["full",Mn,fe,de]},Mn,fe,de],ie=()=>[Mn,"auto",fe,de],Ee=()=>["auto","min","max","fr",fe,de],Re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...z()],X=()=>[as,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],K=()=>[a,fe,de],ve=()=>[...$(),Ux,Dx,{position:[fe,de]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],S=()=>["auto","cover","contain",zw,Mw,{size:[fe,de]}],U=()=>[Xu,hl,sr],V=()=>["","none","full",h,fe,de],J=()=>["",Ae,hl,sr],re=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Ae,Xu,Ux,Dx],je=()=>["","none",w,fe,de],L=()=>["none",Ae,fe,de],D=()=>["none",Ae,fe,de],Se=()=>[Ae,fe,de],pe=()=>[as,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[en],breakpoint:[en],color:[Cw],container:[en],"drop-shadow":[en],ease:["in","out","in-out"],font:[kw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[en],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[en],shadow:[en],spacing:["px",Ae],text:[en],"text-shadow":[en],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",as,de,fe,_]}],container:["container"],columns:[{columns:[Ae,de,fe,v]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:W()}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{start:oe()}],end:[{end:oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[Mn,"auto",fe,de]}],basis:[{basis:[as,"full","auto",v,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,as,"auto","initial","none",de]}],grow:[{grow:["",Ae,fe,de]}],shrink:[{shrink:["",Ae,fe,de]}],order:[{order:[Mn,"first","last","none",fe,de]}],"grid-cols":[{"grid-cols":be()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":be()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ee()}],"auto-rows":[{"auto-rows":Ee()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...Re(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...Re()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":Re()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[v,"screen",...X()]}],"min-w":[{"min-w":[v,"screen","none",...X()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[m]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",o,hl,sr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,fe,Ku]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xu,de]}],"font-family":[{font:[Ow,de,s]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,fe,de]}],"line-clamp":[{"line-clamp":[Ae,"none",fe,Ku]}],leading:[{leading:[f,...z()]}],"list-image":[{"list-image":["none",fe,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",fe,sr]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[Ae,"auto",fe,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ve()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mn,fe,de],radial:["",fe,de],conic:[Mn,fe,de]},Dw,Aw]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,fe,de]}],"outline-w":[{outline:["",Ae,hl,sr]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",y,Ko,Xo]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",x,Ko,Xo]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[Ae,sr]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",j,Ko,Xo]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[Ae,fe,de]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[fe,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":$()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ve()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,de]}],filter:[{filter:["","none",fe,de]}],blur:[{blur:je()}],brightness:[{brightness:[Ae,fe,de]}],contrast:[{contrast:[Ae,fe,de]}],"drop-shadow":[{"drop-shadow":["","none",M,Ko,Xo]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",Ae,fe,de]}],"hue-rotate":[{"hue-rotate":[Ae,fe,de]}],invert:[{invert:["",Ae,fe,de]}],saturate:[{saturate:[Ae,fe,de]}],sepia:[{sepia:["",Ae,fe,de]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,de]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,fe,de]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,fe,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,fe,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,fe,de]}],"backdrop-invert":[{"backdrop-invert":["",Ae,fe,de]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,fe,de]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,fe,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,fe,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",fe,de]}],ease:[{ease:["linear","initial",O,fe,de]}],delay:[{delay:[Ae,fe,de]}],animate:[{animate:["none",k,fe,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,fe,de]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[fe,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,de]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",fe,de]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[Ae,hl,sr,Ku]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},qw=gw(Bw);function ae(...a){return qw(PS(a))}async function Hw(){const{data:a}=await xe.get("/api/system/info");return a}function Gw(){return yt({queryKey:["system-info"],queryFn:Hw,staleTime:6e4})}function Qw(a){const s=Math.floor(a/86400),o=Math.floor(a%86400/3600);if(s>0)return`${s}d ${o}h`;const i=Math.floor(a%3600/60);return o>0?`${o}h ${i}m`:`${i}m`}function Vw(){const{data:a}=Gw();return a?l.jsxs("div",{className:"border-t border-[var(--color-border)] px-3 py-2 text-[10px] text-[var(--color-text-muted)]",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(On,{size:10}),l.jsxs("span",{children:[a.cpuCount," cores"]}),l.jsx("span",{className:"mx-0.5",children:"|"}),l.jsx(Gd,{size:10}),l.jsxs("span",{children:[Math.round(a.totalMemoryMb/1024),"GB"]})]}),l.jsxs("div",{className:"mt-0.5",children:[a.hostname," · up ",Qw(a.uptime)," · v",a.version]})]}):null}const Fw=[{label:"Dashboard",icon:uS,path:"/dashboard"},{label:"Settings",icon:ng,path:"/settings"},{label:"Services",icon:Vd,path:"/services"},{label:"Models",icon:Rj,path:"/models"},{label:"Quick Sets",icon:ii,path:"/quick-sets"},{label:"Traces",icon:Tj,path:"/traces"},{label:"Nodes",icon:On,path:"/nodes"},{label:"Users",icon:XS,path:"/users"},{label:"Native",icon:Mj,path:"/native-services"},{label:"Updates",icon:qd,path:"/update"}];function Yw(){return l.jsxs("aside",{className:"flex w-56 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsx("div",{className:"flex h-14 items-center border-b border-[var(--color-border)] px-4",children:l.jsx("span",{className:"text-lg font-bold text-[var(--color-primary)]",children:"Jarvis"})}),l.jsx("nav",{className:"flex-1 space-y-1 p-2",children:Fw.map(a=>l.jsxs(mv,{to:a.path,className:({isActive:s})=>ae("flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",s?"bg-[var(--color-primary)]/10 text-[var(--color-primary)]":"text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-text)]"),children:[l.jsx(a.icon,{size:18}),a.label]},a.path))}),l.jsx(Vw,{})]})}function Xw(){const{state:a,logout:s}=Ud(),{theme:o,toggleTheme:i}=B2();return l.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-[var(--color-border)] bg-[var(--color-surface)] px-6",children:[l.jsx("h2",{className:"text-sm font-medium text-[var(--color-text-muted)]",children:"Admin Dashboard"}),l.jsxs("div",{className:"flex items-center gap-3",children:[a.user&&l.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:a.user.email}),l.jsx("button",{onClick:i,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",title:`Switch to ${o==="dark"?"light":"dark"} mode`,children:o==="dark"?l.jsx(HS,{size:18}):l.jsx(NS,{size:18})}),l.jsx("button",{onClick:s,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-red-500",title:"Logout",children:l.jsx(xS,{size:18})})]})]})}function Kw(){const{state:a}=Ud();return a.isLoading?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading..."})}):a.isAuthenticated?l.jsxs("div",{className:"flex h-screen bg-[var(--color-background)]",children:[l.jsx(Yw,{}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx(Xw,{}),l.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:l.jsx(F0,{})})]})]}):l.jsx(ri,{to:"/login",replace:!0})}function $w(){const{state:a,login:s,setup:o}=Ud(),i=wa(),[d,f]=N.useState("loading"),[m,v]=N.useState(""),[g,h]=N.useState(""),[y,x]=N.useState(""),[j,M]=N.useState(""),[w,E]=N.useState(null);if(N.useEffect(()=>{let $=!1;async function W(){try{const{data:te}=await xe.get("/api/setup/status");if(!$&&!te.configured){i("/setup",{replace:!0});return}}catch{if(!$){i("/setup",{replace:!0});return}}try{const te=await xj();$||f(te.needs_setup?"setup":"login")}catch{$||f("login")}}return W(),()=>{$=!0}},[i]),a.isAuthenticated)return l.jsx(ri,{to:"/settings",replace:!0});const _=$=>{$.preventDefault(),s(m,y)},O=$=>{if($.preventDefault(),E(null),y!==j){E("Passwords do not match");return}if(y.length<8){E("Password must be at least 8 characters");return}o(m,y,g||void 0)},k=ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]"),G=w??a.error;return d==="loading"?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-border)] border-t-[var(--color-primary)]"})})})}):l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:d==="setup"?l.jsxs(l.Fragment,{children:[l.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),l.jsx("p",{className:"mb-6 text-center text-sm text-[var(--color-text-muted)]",children:"Set up your first administrator account to get started."}),l.jsxs("form",{onSubmit:O,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:$=>v($.target.value),className:k,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"username",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Username"}),l.jsx("input",{id:"username",type:"text",required:!0,autoComplete:"username",value:g,onChange:$=>h($.target.value),className:k,placeholder:"admin"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:y,onChange:$=>x($.target.value),className:k})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),l.jsx("input",{id:"confirm-password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:j,onChange:$=>M($.target.value),className:k})]}),G&&l.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:G}),l.jsx("button",{type:"submit",disabled:a.isLoading,className:ae("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50","transition-opacity"),children:a.isLoading?"Creating account...":"Create Admin Account"})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("h1",{className:"mb-6 text-center text-2xl font-bold text-[var(--color-text)]",children:"Jarvis Admin"}),l.jsxs("form",{onSubmit:_,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:$=>v($.target.value),className:k,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",required:!0,autoComplete:"current-password",value:y,onChange:$=>x($.target.value),className:k})]}),G&&l.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:G}),l.jsx("button",{type:"submit",disabled:a.isLoading,className:ae("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50","transition-opacity"),children:a.isLoading?"Signing in...":"Sign in"})]})]})})})}async function Zw(){const{data:a}=await xe.get("/api/settings/");return a}async function Jw(a,s,o){const{data:i}=await xe.put(`/api/settings/${encodeURIComponent(a)}/${s}`,{value:o});return i}function Pw(){return yt({queryKey:["settings"],queryFn:Zw,staleTime:3e4})}function Iw(){const a=ct();return bt({mutationFn:({serviceName:s,key:o,value:i})=>Jw(s,o,i),onSuccess:()=>{a.invalidateQueries({queryKey:["settings"]})}})}function Ww({setting:a,onSave:s,onCancel:o,isSaving:i}){const[d,f]=N.useState(()=>a.value_type==="json"?JSON.stringify(a.value,null,2):a.value_type==="bool"?"":String(a.value??"")),[m,v]=N.useState(()=>!!a.value),[g,h]=N.useState(null),y=!!a.options?.length,x=y&&!a.options.includes(d),[j,M]=N.useState(x),w=_=>{_.preventDefault();let O;switch(a.value_type){case"bool":O=m;break;case"int":if(O=parseInt(d,10),isNaN(O)){h("Must be a whole number");return}h(null);break;case"float":if(O=parseFloat(d),isNaN(O)){h("Must be a number");return}h(null);break;case"json":try{O=JSON.parse(d),h(null)}catch{h("Invalid JSON");return}break;default:O=d}s(O)},E=ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-2 focus:ring-[var(--color-primary)]");return l.jsxs("form",{onSubmit:w,className:"flex items-center gap-2",children:[y?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{value:j?"__other__":d,onChange:_=>{_.target.value==="__other__"?(M(!0),f("")):(M(!1),f(_.target.value))},className:ae(E,"max-w-xs"),children:[a.options.map(_=>l.jsx("option",{value:String(_),children:String(_)},String(_))),l.jsx("option",{value:"__other__",children:"Other..."})]}),j&&l.jsx("input",{type:"text",value:d,onChange:_=>f(_.target.value),placeholder:"Custom value",className:ae(E,"max-w-xs"),autoFocus:!0})]}):a.value_type==="bool"?l.jsx("button",{type:"button",onClick:()=>v(_=>!_),className:ae("relative h-6 w-11 rounded-full transition-colors",m?"bg-[var(--color-primary)]":"bg-[var(--color-border)]"),children:l.jsx("span",{className:ae("absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform",m&&"translate-x-5")})}):a.value_type==="json"?l.jsxs("div",{className:"flex-1",children:[l.jsx("textarea",{value:d,onChange:_=>{f(_.target.value),h(null)},rows:4,className:ae(E,"font-mono text-xs")}),g&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:g})]}):l.jsxs("div",{children:[l.jsx("input",{type:a.value_type==="int"||a.value_type==="float"?"number":a.is_secret?"password":"text",step:a.value_type==="float"?"any":void 0,value:d,onChange:_=>{f(_.target.value),h(null)},className:ae(E,"max-w-xs")}),g&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:g})]}),l.jsx("button",{type:"submit",disabled:i,className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:i?"Saving...":"Save"}),l.jsx("button",{type:"button",onClick:o,className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})}function eE(a){return a.is_secret?"********":a.value===null||a.value===void 0?"(not set)":a.value_type==="json"?JSON.stringify(a.value):String(a.value)}const tE={string:"bg-blue-500/10 text-blue-500",int:"bg-emerald-500/10 text-emerald-500",float:"bg-emerald-500/10 text-emerald-500",bool:"bg-amber-500/10 text-amber-500",json:"bg-purple-500/10 text-purple-500"};function aE({setting:a,serviceName:s,onRestartService:o}){const[i,d]=N.useState(!1),f=Iw(),m=v=>{f.mutate({serviceName:s,key:a.key,value:v},{onSuccess:g=>{d(!1),g.requires_reload?Me.warning(`Setting updated. ${s} requires a restart to apply.`,o?{action:{label:"Restart",onClick:o}}:void 0):Me.success("Setting updated")},onError:g=>{Me.error(`Failed to update: ${g.message}`)}})};return l.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg px-3 py-2 hover:bg-[var(--color-surface-alt)]",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"text-sm font-medium text-[var(--color-text)]",children:a.key}),l.jsx("span",{className:ae("rounded px-1.5 py-0.5 text-[10px] font-medium",tE[a.value_type]??"bg-gray-500/10 text-gray-500"),children:a.value_type}),a.from_db&&l.jsx("span",{title:"Stored in database",children:l.jsx($j,{size:12,className:"text-[var(--color-tertiary)]"})}),a.requires_reload&&l.jsx("span",{title:"Requires service restart",children:l.jsx(ra,{size:12,className:"text-amber-500"})})]}),a.description&&l.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:a.description}),i?l.jsx("div",{className:"mt-2",children:l.jsx(Ww,{setting:a,onSave:m,onCancel:()=>d(!1),isSaving:f.isPending})}):l.jsx("p",{className:"mt-1 font-mono text-xs text-[var(--color-text-muted)]",children:eE(a)})]}),!i&&l.jsx("button",{onClick:()=>d(!0),className:"shrink-0 rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-primary)]",title:"Edit",children:l.jsx(SS,{size:14})})]})}function nE({category:a,settings:s,serviceName:o,onRestartService:i}){const[d,f]=N.useState(!0);return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>f(m=>!m),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[d?l.jsx(Ld,{size:14}):l.jsx(eg,{size:14}),a,l.jsxs("span",{className:"font-normal",children:["(",s.length,")"]})]}),d&&l.jsx("div",{className:"space-y-0.5",children:s.map(m=>l.jsx(aE,{setting:m,serviceName:o,onRestartService:i},m.key))})]})}async function rE(){const{data:a}=await xe.get("/api/containers");return a}async function sE(a){const{data:s}=await xe.post(`/api/containers/${a}/restart`);return s}function vg(){return yt({queryKey:["containers"],queryFn:rE,staleTime:1e4,refetchInterval:1e4})}function gg(){const a=ct();return bt({mutationFn:s=>sE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["containers"]})}})}function lE({result:a,defaultExpanded:s=!1}){const[o,i]=N.useState(s),{data:d}=vg(),f=gg(),m=N.useCallback(()=>{const g=d?.containers.find(h=>h.name.includes(a.service_name)||h.name.includes(a.service_name.replace("jarvis-","")));g?f.mutate(g.id,{onSuccess:()=>Me.success(`${a.service_name} is restarting...`),onError:h=>Me.error(`Restart failed: ${h.message}`)}):Me.error(`Could not find container for ${a.service_name}`)},[d,a.service_name,f]),v=N.useMemo(()=>{const g=new Map;for(const h of a.settings){const y=g.get(h.category)??[];g.set(h.category,[...y,h])}return g},[a]);return l.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsxs("button",{onClick:()=>i(g=>!g),className:"flex w-full items-center gap-3 px-4 py-3 text-left hover:bg-[var(--color-surface-alt)]",children:[o?l.jsx(Ld,{size:18,className:"text-[var(--color-text-muted)]"}):l.jsx(eg,{size:18,className:"text-[var(--color-text-muted)]"}),l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.service_name}),a.success?l.jsx(pt,{size:16,className:"text-[var(--color-secondary)]"}):l.jsx(xl,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a.success?`${a.settings.length} settings`:a.error??"Error"}),a.latency_ms!=null&&l.jsxs("span",{className:ae("ml-auto text-xs",a.latency_ms>500?"text-amber-500":"text-[var(--color-text-muted)]"),children:[Math.round(a.latency_ms),"ms"]})]}),o&&a.success&&l.jsx("div",{className:"space-y-2 border-t border-[var(--color-border)] px-2 py-3",children:[...v.entries()].map(([g,h])=>l.jsx(nE,{category:g,settings:h,serviceName:a.service_name,onRestartService:m},g))}),o&&!a.success&&l.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-3",children:l.jsx("p",{className:"text-sm text-red-500",children:a.error??"Failed to fetch settings"})})]})}function oE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=Pw(),[m,v]=N.useState(""),g=N.useMemo(()=>{if(!a)return[];if(!m.trim())return a.services;const h=m.toLowerCase();return a.services.map(y=>({...y,settings:y.settings.filter(x=>x.key.toLowerCase().includes(h)||x.category.toLowerCase().includes(h)||(x.description?.toLowerCase().includes(h)??!1))})).filter(y=>y.settings.length>0||y.service_name.toLowerCase().includes(h))},[a,m]);return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load settings"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Settings"}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[a&&l.jsxs("span",{children:[a.successful_services,"/",a.total_services," services"]}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),l.jsxs("div",{className:"relative",children:[l.jsx(kS,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),l.jsx("input",{type:"text",value:m,onChange:h=>v(h.target.value),placeholder:"Search settings...",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] py-2 pl-9 pr-3","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"space-y-3",children:[g.map((h,y)=>l.jsx(lE,{result:h,defaultExpanded:y===0},h.service_name)),g.length===0&&l.jsx("p",{className:"py-8 text-center text-sm text-[var(--color-text-muted)]",children:m?"No settings match your search":"No services found"})]})]})}async function iE(){const{data:a}=await xe.get("/api/services/registry");return a}async function cE(a){const{data:s}=await xe.post("/api/services/register",a);return s}async function uE(a){const{data:s}=await xe.post("/api/services/rotate-key",a);return s}async function dE(a){const{data:s}=await xe.post("/api/services/probe",a);return s}async function fE(a){const{data:s}=await xe.post("/api/services/register",{services:[{name:a.name,host:a.host,port:a.port,scheme:a.scheme,health_path:a.health_path,description:a.description}]});return s}async function mE(a){await xe.delete(`/api/services/${encodeURIComponent(a)}`)}async function hE(){const{data:a}=await xe.get("/api/services/suggestions");return a}function pE(){return yt({queryKey:["service-registry"],queryFn:iE,staleTime:3e4})}function xE(){const a=ct();return bt({mutationFn:cE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function vE(){const a=ct();return bt({mutationFn:uE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function gE(){const a=ct();return bt({mutationFn:fE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function yE(){const a=ct();return bt({mutationFn:mE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function bE(){return yt({queryKey:["service-suggestions"],queryFn:hE,staleTime:6e4})}function Lx({ok:a,label:s}){return l.jsxs("span",{className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[a?l.jsx(vi,{size:12}):l.jsx(Fd,{size:12}),s]})}function NE({status:a,error:s,latency:o}){return a==="idle"?null:a==="probing"?l.jsx("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:l.jsx(Ct,{size:12,className:"animate-spin"})}):a==="healthy"?l.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 dark:text-green-400",children:[l.jsx(os,{size:8,fill:"currentColor"}),o!=null&&`${o}ms`]}):l.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",title:s,children:[l.jsx(os,{size:8,fill:"currentColor"}),s||"Unreachable"]})}function jE({entry:a,checked:s,host:o,port:i,scheme:d,onToggle:f,onHostChange:m,onPortChange:v,onSchemeChange:g,onHostBlur:h,onPortBlur:y,onRotateKey:x,onDelete:j,disabled:M,rotating:w,deleting:E,healthStatus:_,healthError:O,healthLatency:k}){return l.jsxs("div",{className:ae("flex flex-wrap items-center gap-3 rounded-lg border border-[var(--color-border)] p-3","bg-[var(--color-surface)] transition-colors",s&&"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5"),children:[l.jsx("input",{type:"checkbox",checked:s,onChange:f,disabled:M,className:"h-4 w-4 rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),l.jsxs("div",{className:"min-w-[180px] flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-[var(--color-text)]",children:[a.name,a.custom&&l.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"custom"})]}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:a.description})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Lx,{ok:a.config_registered,label:"Config"}),l.jsx(Lx,{ok:a.auth_registered,label:"Auth"}),a.custom&&j&&l.jsxs("button",{onClick:j,disabled:M||E,className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium","bg-red-500/10 text-red-600 dark:text-red-400","hover:bg-red-500/20","disabled:opacity-50"),title:"Remove custom service",children:[l.jsx(bi,{size:12,className:E?"animate-spin":""}),"Remove"]}),a.auth_registered&&l.jsxs("button",{onClick:x,disabled:M||w,className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium","bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]","hover:bg-[var(--color-primary)]/10 hover:text-[var(--color-primary)]","disabled:opacity-50"),title:"Rotate app key",children:[l.jsx(Qd,{size:12,className:w?"animate-spin":""}),"Rotate Key"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{value:d,onChange:G=>g(G.target.value),disabled:M,className:ae("rounded border px-1.5 py-1 text-xs font-mono",d==="https"?"border-green-500/40 bg-green-500/10 text-green-600 dark:text-green-400":d==="mqtt"||d==="mqtts"?"border-purple-500/40 bg-purple-500/10 text-purple-600 dark:text-purple-400":d==="ws"||d==="wss"?"border-blue-500/40 bg-blue-500/10 text-blue-600 dark:text-blue-400":"border-[var(--color-border)] bg-[var(--color-background)] text-[var(--color-text-muted)]","disabled:opacity-50"),title:"Scheme",children:[l.jsx("option",{value:"http",children:"http"}),l.jsx("option",{value:"https",children:"https"}),l.jsx("option",{value:"mqtt",children:"mqtt"}),l.jsx("option",{value:"mqtts",children:"mqtts"}),l.jsx("option",{value:"ws",children:"ws"}),l.jsx("option",{value:"wss",children:"wss"})]}),l.jsx("input",{type:"text",value:o,onChange:G=>m(G.target.value),onBlur:h,disabled:M,placeholder:"host",className:ae("w-36 rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1","text-xs text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]","disabled:opacity-50")}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:":"}),l.jsx("input",{type:"number",value:i,onChange:G=>v(Number(G.target.value)),onBlur:y,disabled:M,className:ae("w-20 rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1","text-xs text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]","disabled:opacity-50")}),l.jsx(NE,{status:_,error:O,latency:k})]})]})}const Bx={name:"",host:"localhost",port:"",scheme:"http",health_path:"/health",description:""};function SE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=pE(),m=xE(),v=vE(),g=gE(),h=yE(),{data:y}=bE(),[x,j]=N.useState({}),[M,w]=N.useState(null),[E,_]=N.useState(null),[O,k]=N.useState(null),[G,$]=N.useState(null),[W,te]=N.useState(null),[H,z]=N.useState({}),[oe,be]=N.useState(!1),[se,ie]=N.useState(Bx),[Ee,Re]=N.useState(!1),ne=N.useRef(null),C=N.useMemo(()=>new Set(a?.services.map(L=>L.name)??[]),[a]),X=N.useMemo(()=>{const D=(y?.suggestions??[]).filter(pe=>!C.has(pe.id));if(!se.name.trim())return D;const Se=se.name.toLowerCase();return D.filter(pe=>pe.id.toLowerCase().includes(Se)||pe.name.toLowerCase().includes(Se)||pe.description.toLowerCase().includes(Se))},[y,C,se.name]),K=N.useCallback(L=>{ie({name:L.id,description:L.description,host:"localhost",port:String(L.port),scheme:"http",health_path:L.healthCheck}),Re(!1)},[]);N.useEffect(()=>{const L=D=>{ne.current&&!ne.current.contains(D.target)&&Re(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const ve=N.useCallback(L=>{if(x[L])return x[L];const D=a?.services.find(Se=>Se.name===L);return D?{checked:D.config_registered,host:D.current_host??"localhost",port:D.current_port??D.default_port,scheme:D.current_scheme??"http"}:{checked:!1,host:"localhost",port:0,scheme:"http"}},[x,a]),ee=N.useCallback((L,D)=>{j(Se=>{const pe=Se[L]??{checked:!1,host:"localhost",port:0};return{...Se,[L]:{...pe,...D}}})},[]),S=N.useCallback(async(L,D,Se,pe,Ut="http")=>{if(!(!D||!Se)){z(ut=>({...ut,[L]:{status:"probing"}}));try{const ut=await dE({host:D,port:Se,health_path:pe,scheme:Ut});z(Dn=>({...Dn,[L]:{status:ut.healthy?"healthy":"unhealthy",error:ut.error??void 0,latency:ut.latency_ms??void 0}}))}catch{z(ut=>({...ut,[L]:{status:"unhealthy",error:"Request failed"}}))}}},[]),U=N.useCallback(()=>{if(!a)return;const L=a.services.filter(D=>ve(D.name).checked).map(D=>{const Se=ve(D.name);return{name:D.name,host:Se.host,port:Se.port,scheme:Se.scheme}});if(L.length===0){Me.error("No services selected");return}w(null),_(null),m.mutate({services:L},{onSuccess:D=>{w(D.results);const Se=D.results.filter(Ut=>Ut.config_ok&&Ut.auth_ok).length,pe=D.results.length;Se===pe?Me.success(`All ${pe} services registered`):Me.warning(`${Se}/${pe} services registered successfully`)},onError:D=>{Me.error(`Registration failed: ${D.message}`)}})},[a,ve,m]),V=N.useCallback(L=>{k(L),_(null),v.mutate({service_name:L},{onSuccess:D=>{_(D),k(null),Me.success(`Key rotated for ${L}`)},onError:D=>{k(null),Me.error(`Key rotation failed: ${D.message}`)}})},[v]),J=N.useCallback(L=>{$(L),h.mutate(L,{onSuccess:()=>{$(null),Me.success(`Removed ${L}`)},onError:D=>{$(null),Me.error(`Failed to remove: ${D.message}`)}})},[h]),re=N.useCallback(()=>{const L=parseInt(se.port,10);if(!se.name.trim()){Me.error("Service name is required");return}if(!L||L<1||L>65535){Me.error("Port must be between 1 and 65535");return}g.mutate({name:se.name.trim(),host:se.host.trim()||"localhost",port:L,scheme:se.scheme,health_path:se.health_path.trim()||"/health",description:se.description.trim()},{onSuccess:D=>{const Se=D.results[0];Se?.config_ok?(Me.success(`Added ${se.name.trim()}`),ie(Bx),be(!1)):Me.error(`Failed to add: ${Se?.error??"Unknown error"}`)},onError:D=>{Me.error(`Failed to add service: ${D.message}`)}})},[se,g]),me=N.useCallback(L=>{navigator.clipboard.writeText(L).then(()=>{te(L),setTimeout(()=>te(null),2e3)})},[]),ue=a?.services.filter(L=>ve(L.name).checked).length??0,je=M?.some(L=>L.env_written)||E?.env_written===!0;return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load service registry"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Services"}),l.jsx("span",{className:"rounded-full bg-[var(--color-surface-alt)] px-2.5 py-0.5 text-xs font-medium text-[var(--color-text-muted)]",children:a?.services.length??0})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>be(L=>!L),className:ae("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium",oe?"bg-[var(--color-surface-alt)] text-[var(--color-text)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[oe?l.jsx(Fd,{size:14}):l.jsx(ai,{size:14}),oe?"Cancel":"Add Service"]}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),oe&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Add Service"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{ref:ne,className:"relative",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Service"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:"text",value:se.name,onChange:L=>{ie(D=>({...D,name:L.target.value})),Re(!0)},onFocus:()=>Re(!0),placeholder:"Select or type a service name...",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5 pr-8","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")}),l.jsx("button",{type:"button",onClick:()=>Re(L=>!L),className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:l.jsx(Ld,{size:14})})]}),Ee&&X.length>0&&l.jsx("div",{className:"absolute z-10 mt-1 max-h-48 w-full overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] shadow-lg",children:X.map(L=>l.jsxs("button",{type:"button",onClick:()=>K(L),className:"flex w-full flex-col px-3 py-2 text-left hover:bg-[var(--color-surface-alt)]",children:[l.jsxs("span",{className:"text-sm font-medium text-[var(--color-text)]",children:[L.name,l.jsxs("span",{className:"ml-2 font-normal text-[var(--color-text-muted)]",children:[":",L.port]})]}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:L.description})]},L.id))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Description"}),l.jsx("input",{type:"text",value:se.description,onChange:L=>ie(D=>({...D,description:L.target.value})),placeholder:"e.g. Camera streaming via WebRTC",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Host"}),l.jsx("input",{type:"text",value:se.host,onChange:L=>ie(D=>({...D,host:L.target.value})),placeholder:"localhost",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Port"}),l.jsx("input",{type:"number",value:se.port,onChange:L=>ie(D=>({...D,port:L.target.value})),placeholder:"e.g. 1984",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"w-20",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Scheme"}),l.jsxs("select",{value:se.scheme,onChange:L=>ie(D=>({...D,scheme:L.target.value})),className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]"),children:[l.jsx("option",{value:"http",children:"http"}),l.jsx("option",{value:"https",children:"https"}),l.jsx("option",{value:"mqtt",children:"mqtt"}),l.jsx("option",{value:"mqtts",children:"mqtts"}),l.jsx("option",{value:"ws",children:"ws"}),l.jsx("option",{value:"wss",children:"wss"})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Health Path"}),l.jsx("input",{type:"text",value:se.health_path,onChange:L=>ie(D=>({...D,health_path:L.target.value})),placeholder:"/health",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]})]}),l.jsx("div",{className:"mt-3 flex justify-end",children:l.jsx("button",{onClick:re,disabled:g.isPending||!se.name.trim()||!se.port,className:ae("rounded-lg bg-[var(--color-primary)] px-4 py-1.5 text-sm font-medium text-white","hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"),children:g.isPending?"Adding...":"Add Service"})})]}),l.jsx("div",{className:"space-y-2",children:a?.services.map(L=>{const D=ve(L.name),Se=H[L.name]??{status:"idle"};return l.jsx(jE,{entry:L,checked:D.checked,host:D.host,port:D.port,scheme:D.scheme,onToggle:()=>{const pe=!D.checked;ee(L.name,{...D,checked:pe}),pe?S(L.name,D.host,D.port,L.health_path,D.scheme):z(Ut=>({...Ut,[L.name]:{status:"idle"}}))},onHostChange:pe=>ee(L.name,{...D,host:pe}),onPortChange:pe=>ee(L.name,{...D,port:pe}),onSchemeChange:pe=>ee(L.name,{...D,scheme:pe}),onHostBlur:()=>{D.checked&&S(L.name,D.host,D.port,L.health_path,D.scheme)},onPortBlur:()=>{D.checked&&S(L.name,D.host,D.port,L.health_path,D.scheme)},onRotateKey:()=>V(L.name),onDelete:()=>J(L.name),disabled:m.isPending,rotating:O===L.name,deleting:G===L.name,healthStatus:Se.status,healthError:Se.error,healthLatency:Se.latency},L.name)})}),l.jsx("button",{onClick:U,disabled:m.isPending||ue===0,className:ae("rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white","hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"),children:m.isPending?"Registering...":`Register Selected (${ue})`}),E&&l.jsx(wE,{serviceName:E.service_name,appKey:E.app_key,envWritten:E.env_written,copiedKey:W,onCopy:me,label:"Rotated Key"}),M&&l.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Registration Results"}),M.map(L=>l.jsxs("div",{className:ae("flex flex-wrap items-center gap-3 rounded-lg border p-3 text-sm",L.config_ok&&L.auth_ok?"border-green-500/20 bg-green-500/5":"border-yellow-500/20 bg-yellow-500/5"),children:[l.jsx("span",{className:"min-w-[180px] font-medium text-[var(--color-text)]",children:L.name}),l.jsxs("span",{className:ae("text-xs",L.config_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Config: ",L.config_ok?"OK":"Failed"]}),l.jsxs("span",{className:ae("text-xs",L.auth_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Auth: ",L.auth_ok?L.auth_created?"Created":"Exists":"Failed"]}),L.env_written!==null&&l.jsxs("span",{className:ae("text-xs",L.env_written?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",L.env_written?"Written":"Failed"]}),L.error&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),L.error]}),L.auth_created&&L.app_key&&l.jsxs("div",{className:"mt-1 w-full",children:[l.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),"App key (shown once only):"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"flex-1 overflow-x-auto rounded bg-[var(--color-background)] px-2 py-1 font-mono text-xs text-[var(--color-text)]",children:L.app_key}),l.jsx("button",{onClick:()=>me(L.app_key),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:W===L.app_key?l.jsx(vi,{size:14,className:"text-green-500"}):l.jsx(Hd,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]},L.name))]}),je&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-blue-500/20 bg-blue-500/5 p-3",children:[l.jsx(rS,{size:16,className:"mt-0.5 shrink-0 text-blue-500"}),l.jsx("p",{className:"text-sm text-[var(--color-text)]",children:"Services whose .env files were updated need to be restarted to pick up the new credentials. Restart each affected service's container or process."})]})]})}function wE({serviceName:a,appKey:s,envWritten:o,copiedKey:i,onCopy:d,label:f}){return l.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:[f,": ",a]}),l.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-3",children:[o!==null&&l.jsxs("span",{className:ae("mb-2 inline-block text-xs",o?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",o?"Written":"Failed"]}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),"New app key (shown once only):"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"flex-1 overflow-x-auto rounded bg-[var(--color-background)] px-2 py-1 font-mono text-xs text-[var(--color-text)]",children:s}),l.jsx("button",{onClick:()=>d(s),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:i===s?l.jsx(vi,{size:14,className:"text-green-500"}):l.jsx(Hd,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]})]})}async function EE(){const{data:a}=await xe.get("/api/llm-setup/status");return a}async function CE(a){const{data:s}=await xe.post("/api/llm-setup/configure",{settings:a});return s}async function TE(a,s,o){const{data:i}=await xe.post("/api/llm-setup/download",{repo:a,filename:s,token:o});return i}function _E(){return yt({queryKey:["llm-status"],queryFn:EE,staleTime:3e4,retry:1})}function yg(){const a=ct();return bt({mutationFn:s=>CE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function RE(){return bt({mutationFn:({repo:a,filename:s,token:o})=>TE(a,s,o)})}async function Xd(){const{data:a}=await xe.get("/api/install/status");return a}async function kE(a){const s=a?.length?{services:a.join(",")}:{},{data:o}=await xe.get("/api/install/preflight",{params:s});return o}async function ME(){const{data:a}=await xe.get("/api/install/hardware");return a}async function qx(a){const{data:s}=await xe.post("/api/install/generate",a);return s}async function bg(){const{data:a}=await xe.get("/api/install/registry");return a}async function AE(){const{data:a}=await xe.get("/api/install/defaults");return a}const OE={running:"bg-emerald-500",exited:"bg-red-500",restarting:"bg-amber-500",paused:"bg-amber-500",created:"bg-gray-400",dead:"bg-red-700"};function zE(a){return a.match(/^Up (.+)$/)?.[1]??null}function Hx({container:a,onRestart:s,isRestarting:o}){const i=zE(a.status),d=a.ports.find(f=>f.public)?.public;return l.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[l.jsx("div",{className:ae("h-2.5 w-2.5 rounded-full",OE[a.state]??"bg-gray-400")}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:a.displayName??a.name}),a.description&&l.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:a.description})]}),l.jsx("span",{className:ae("rounded-full px-2 py-0.5 text-xs font-medium",a.state==="running"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-red-500/10 text-red-600 dark:text-red-400"),children:a.state})]}),l.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-2",children:l.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-text-muted)]",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[i&&l.jsxs("span",{children:["Up ",i]}),d&&l.jsxs("span",{children:[":",d]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[d&&l.jsx("a",{href:`http://localhost:${d}/health`,target:"_blank",rel:"noopener noreferrer",className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Open health endpoint",children:l.jsx(Pj,{size:13})}),l.jsx("button",{onClick:()=>s(a.id),disabled:o,className:ae("rounded p-1 hover:bg-[var(--color-surface-alt)]",o&&"animate-spin"),title:"Restart",children:l.jsx(Qd,{size:13})})]})]})})]})}async function DE(){const{data:a}=await xe.get("/api/update/check");return a}async function UE(){const{data:a}=await xe.get("/api/update/status");return a}async function LE(a){const{data:s}=await xe.post("/api/update/settings",{allowUpdates:a});return s}function Ng(){return yt({queryKey:["update-check"],queryFn:DE,staleTime:300*1e3,retry:1,refetchOnWindowFocus:!1})}const Gx="jarvis-update-dismissed-version";function Qx(){const a=wa(),{data:s}=Ng(),[o,i]=N.useState(()=>s?.latestVersion?localStorage.getItem(Gx)===s.latestVersion:!1);return!s?.updateAvailable||o?null:l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(qd,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Jarvis v",s.latestVersion," available"]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["You have v",s.currentVersion]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[s.releaseUrl&&l.jsx("a",{href:s.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Release notes"}),l.jsx("button",{onClick:()=>{localStorage.setItem(Gx,s.latestVersion),i(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/update"),className:"rounded-lg bg-green-600 px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Update"})]})]})}const $u="jarvis-admin:llm-setup-dismissed";function BE(){const a=wa(),[s,o]=N.useState(!1),{data:i,isLoading:d,isError:f,error:m,refetch:v,isFetching:g}=vg(),h=gg(),y=_E(),[x,j]=N.useState(()=>!!localStorage.getItem($u));N.useEffect(()=>{Xd().then(k=>{k.deployMode==="compose-export"&&o(!0)}).catch(()=>{})},[]);const M=!!y.data&&!y.data.configured&&!x,w=k=>{h.mutate(k,{onSuccess:()=>Me.success("Container restart initiated"),onError:G=>Me.error(`Restart failed: ${G.message}`)})};if(s)return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),l.jsx(Qx,{}),M&&l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(pd,{size:20,className:"text-[var(--color-primary)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem($u,"true"),j(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/llm-setup"),className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Set up LLM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xd,{size:20,className:"text-[var(--color-text-muted)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Sync compose to latest registry"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Regenerate docker-compose.yml, apply changes, and re-register services with config-service"})]})]}),l.jsx("button",{onClick:()=>a("/reconcile"),className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:"Sync now"})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-8 text-center",children:[l.jsx(Vd,{size:32,className:"mx-auto mb-3 text-[var(--color-text-muted)]"}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Running in Docker Compose mode"}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Container management is handled by your Docker environment (TrueNAS, Portainer, etc.). Use your platform's tools to view container status, logs, and restarts."})]})]});if(d)return l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})});if(f)return l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load containers"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:m?.message??"Unknown error"}),l.jsx("button",{onClick:()=>v(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]});const E=i?.containers??[],_=E.filter(k=>k.state==="running"),O=E.filter(k=>k.state!=="running");return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("span",{children:[_.length,"/",E.length," running"]}),l.jsx("button",{onClick:()=>v(),disabled:g,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",g&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),l.jsx(Qx,{}),M&&l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(pd,{size:20,className:"text-[var(--color-primary)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem($u,"true"),j(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/llm-setup"),className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Set up LLM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xd,{size:20,className:"text-[var(--color-text-muted)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Sync compose to latest registry"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Regenerate docker-compose.yml and apply changes — adds new background workers and services without recreating unchanged containers"})]})]}),l.jsx("button",{onClick:()=>a("/reconcile"),className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:"Sync now"})]}),E.length===0&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:i?.error?i.error:"No Jarvis containers found. Is Docker running?"})}),_.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Running"}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:_.map(k=>l.jsx(Hx,{container:k,onRestart:w,isRestarting:h.isPending&&h.variables===k.id},k.id))})]}),O.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Stopped"}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:O.map(k=>l.jsx(Hx,{container:k,onRestart:w,isRestarting:h.isPending&&h.variables===k.id},k.id))})]})]})}async function qE(){const{data:a}=await xe.get("/api/nodes");return a}async function HE(a){const{data:s}=await xe.get(`/api/nodes/${a}/nodes`);return s}async function GE(a){const{data:s}=await xe.post(`/api/nodes/${a}/train-adapter`);return s}function QE(){return yt({queryKey:["households"],queryFn:qE,staleTime:3e4})}function VE(a){return yt({queryKey:["household-nodes",a],queryFn:()=>HE(a),enabled:!!a,staleTime:3e4})}function FE(){const a=ct();return bt({mutationFn:GE,onSuccess:()=>{a.invalidateQueries({queryKey:["household-nodes"]})}})}function YE({node:a,onTrain:s,isTraining:o}){return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(On,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.name})]}),l.jsxs("span",{className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a.is_active?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-500"),children:[a.is_active?l.jsx(ii,{size:10}):l.jsx(ZS,{size:10}),a.is_active?"Active":"Inactive"]})]}),l.jsxs("div",{className:"mt-3 space-y-1 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"ID:"})," ",a.node_id]}),a.services.length>0&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Services:"})," ",a.services.join(", ")]})]}),l.jsx("div",{className:"mt-4",children:l.jsx("button",{onClick:()=>s(a.node_id),disabled:o||!a.is_active,className:ae("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",o||!a.is_active?"cursor-not-allowed bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:o?l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(it,{size:12,className:"animate-spin"}),"Training..."]}):"Train Adapter"})})]})}function XE({householdId:a,householdName:s}){const{data:o,isLoading:i,isError:d}=VE(a),f=FE(),m=v=>{f.mutate(v,{onSuccess:g=>Me.success(`Training triggered for ${v} (request: ${g.request_id.slice(0,8)}...)`),onError:g=>Me.error(`Training failed: ${g.message}`)})};return l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:s}),i&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:18})}),d&&l.jsx("p",{className:"py-4 text-center text-sm text-red-500",children:"Failed to load nodes"}),o&&o.length===0&&l.jsx("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:"No nodes registered in this household"}),o&&o.length>0&&l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:o.map(v=>l.jsx(YE,{node:v,onTrain:m,isTraining:f.isPending&&f.variables===v.node_id},v.node_id))})]})}function KE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=QE();return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load households"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Nodes"}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14,className:"text-[var(--color-text-muted)]"})})]}),(!a||a.length===0)&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No households found. Register a household in jarvis-auth first."})}),a?.map(m=>l.jsx(XE,{householdId:m.id,householdName:m.name},m.id))]})}async function $E(){const{data:a}=await xe.get("/api/admin/households");return a}async function ZE(){const{data:a}=await xe.get("/api/admin/nodes");return a}async function JE(){const{data:a}=await xe.get("/api/admin/users");return a}async function PE(a,s={}){const{data:o}=await xe.post(`/api/admin/users/${a}/temp-password`,s);return o}function IE(){return yt({queryKey:["admin-users"],queryFn:JE,staleTime:3e4})}function WE(){const a=ct();return bt({mutationFn:({userId:s,options:o})=>PE(s,o),onSuccess:()=>{a.invalidateQueries({queryKey:["admin-users"]})}})}function Zu({tone:a,children:s}){const o={green:"bg-green-500/10 text-green-500",red:"bg-red-500/10 text-red-500",amber:"bg-amber-500/10 text-amber-500",blue:"bg-blue-500/10 text-blue-500"};return l.jsx("span",{className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",o[a]),children:s})}function e4({result:a,email:s,onDismiss:o}){const i=async()=>{try{await navigator.clipboard.writeText(a.temp_password),Me.success("Temporary password copied")}catch{Me.error("Copy failed — select it manually")}};return l.jsxs("div",{className:"rounded-lg border border-amber-500/40 bg-amber-500/5 p-4",children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Temporary password for ",s]}),l.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-[var(--color-surface-alt)] px-3 py-1.5 font-mono text-base tracking-wide text-[var(--color-text)]",children:a.temp_password}),l.jsx("button",{onClick:i,className:"rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:l.jsx(Hd,{size:14,className:"text-[var(--color-text-muted)]"})})]}),l.jsxs("p",{className:"mt-2 text-xs text-[var(--color-text-muted)]",children:["Shown once — it is not stored anywhere. Valid until"," ",new Date(a.expires_at).toLocaleString(),". All of the user's sessions were signed out; on their next login they'll be asked to set a new password."]}),l.jsx("button",{onClick:o,className:"mt-3 rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs font-medium text-white hover:opacity-90",children:"Done"})]})}function t4({user:a,onCancel:s,onConfirm:o,isPending:i}){const[d,f]=N.useState(""),m=d.length>0&&d.length<8;return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("p",{className:"text-sm text-[var(--color-text)]",children:["Reset the password for ",l.jsx("span",{className:"font-medium",children:a.email}),"? This signs the user out everywhere and replaces their password with a temporary one they must change at next login."]}),l.jsxs("div",{className:"mt-3",children:[l.jsx("input",{type:"text",value:d,onChange:v=>f(v.target.value),placeholder:"Custom temp password (optional — leave blank to generate)",className:"w-full max-w-md rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"}),m&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Must be at least 8 characters"})]}),l.jsxs("div",{className:"mt-3 flex gap-2",children:[l.jsx("button",{onClick:()=>o(d||null),disabled:i||m,className:ae("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",i||m?"cursor-not-allowed bg-[var(--color-surface)] text-[var(--color-text-muted)]":"bg-red-500 text-white hover:opacity-90"),children:i?l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(it,{size:12,className:"animate-spin"}),"Resetting..."]}):"Reset password"}),l.jsx("button",{onClick:s,disabled:i,className:"rounded-lg px-3 py-1.5 text-xs font-medium text-[var(--color-text-muted)] hover:bg-[var(--color-surface)]",children:"Cancel"})]})]})}function a4({user:a}){const[s,o]=N.useState("idle"),[i,d]=N.useState(null),f=WE(),m=v=>{f.mutate({userId:a.id,options:v?{temp_password:v}:{}},{onSuccess:g=>{o("idle"),d(g)},onError:g=>Me.error(`Reset failed: ${g.message}`)})};return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.email}),a.is_superuser&&l.jsxs(Zu,{tone:"blue",children:[l.jsx(zS,{size:10}),"Superuser"]}),!a.is_active&&l.jsxs(Zu,{tone:"red",children:[l.jsx(FS,{size:10}),"Deactivated"]}),a.must_change_password&&l.jsxs(Zu,{tone:"amber",children:[l.jsx(Fj,{size:10}),"Temp password"]})]}),l.jsxs("div",{className:"mt-1 space-y-0.5 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Username:"})," ",a.username]}),a.households.length>0&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Households:"})," ",a.households.map(v=>`${v.household_name} (${v.role})`).join(", ")]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Created:"})," ",new Date(a.created_at).toLocaleDateString()]})]})]}),s==="idle"&&!i&&l.jsxs("button",{onClick:()=>o("confirm"),disabled:!a.is_active,title:a.is_active?void 0:"Reactivate the account first",className:ae("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",a.is_active?"bg-[var(--color-surface-alt)] text-[var(--color-text)] hover:bg-[var(--color-primary)]/10 hover:text-[var(--color-primary)]":"cursor-not-allowed bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[l.jsx(lS,{size:12}),"Reset password"]})]}),s==="confirm"&&l.jsx("div",{className:"mt-3",children:l.jsx(t4,{user:a,onCancel:()=>o("idle"),onConfirm:m,isPending:f.isPending})}),i&&l.jsx("div",{className:"mt-3",children:l.jsx(e4,{result:i,email:a.email,onDismiss:()=>d(null)})})]})}function n4(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=IE();return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load users"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Users"}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14,className:"text-[var(--color-text-muted)]"})})]}),a&&a.length===0&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No users found."})}),l.jsx("div",{className:"space-y-3",children:a?.map(m=>l.jsx(a4,{user:m},m.id))})]})}async function r4(){const{data:a}=await xe.get("/api/native-services");return a}async function s4(a){const{data:s}=await xe.post(`/api/native-services/${a}/restart`);return s}async function l4(a){const{data:s}=await xe.post(`/api/native-services/${a}/stop`);return s}async function o4(a){const{data:s}=await xe.post(`/api/native-services/${a}/uninstall`);return s}async function i4(a,s="stderr",o=200){const{data:i}=await xe.get(`/api/native-services/${a}/logs`,{params:{stream:s,lines:o}});return i}const Ni=["native-services"];function c4(){return yt({queryKey:Ni,queryFn:r4,staleTime:5e3,refetchInterval:5e3})}function jg(){const a=ct();return bt({mutationFn:s=>s4(s),onSuccess:()=>a.invalidateQueries({queryKey:Ni})})}function u4(){const a=ct();return bt({mutationFn:s=>l4(s),onSuccess:()=>a.invalidateQueries({queryKey:Ni})})}function d4(){const a=ct();return bt({mutationFn:s=>o4(s),onSuccess:()=>a.invalidateQueries({queryKey:Ni})})}function f4(a,s,o){return yt({queryKey:["native-services-logs",a,s],queryFn:()=>i4(a,s,200),enabled:o,staleTime:3e3,refetchInterval:o?3e3:!1})}function m4(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=c4();return s?l.jsx("div",{className:"p-6",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading native services…"})}):o?l.jsx("div",{className:"p-6",children:l.jsx(p4,{message:i instanceof Error?i.message:String(i)})}):a?a.supported?l.jsxs("div",{className:"p-6",children:[l.jsxs("header",{className:"mb-4 flex items-start justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Native Services"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["macOS LaunchAgents — these services run outside Docker so they can use the Apple GPU (MLX / Metal / MPS). Status reflects ",l.jsx("code",{children:"launchctl print"}),"."]})]}),l.jsxs("button",{type:"button",onClick:()=>d(),disabled:f,className:ae("flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors",f&&"opacity-50"),children:[l.jsx(it,{size:14,className:f?"animate-spin":""}),"Refresh"]})]}),a.services.length===0?l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No native-capable services are registered. Re-run the install wizard to add them."})}):l.jsx("div",{className:"space-y-3",children:a.services.map(m=>l.jsx(h4,{service:m},m.id))})]}):l.jsxs("div",{className:"p-6",children:[l.jsxs("header",{className:"mb-4",children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Native Services"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Manage Jarvis services running as macOS LaunchAgents."})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Native services are only available on macOS. On Linux all services run in Docker."})})]}):null}function h4({service:a}){const s=jg(),o=u4(),i=d4(),[d,f]=N.useState(!1),[m,v]=N.useState("stderr"),g=f4(a.id,m,d),{status:h}=a;async function y(w,E){try{await w,Me.success(E)}catch(_){Me.error(_ instanceof Error?_.message:String(_))}}async function x(){confirm(`Uninstall ${a.id}? The LaunchAgent will be removed; source files at ${h.sourceDir??"~/.jarvis/native"} stay on disk.`)&&await y(i.mutateAsync(a.id),`${a.id} uninstalled`)}const j=h.installed?h.running?`Running (pid ${h.pid??"?"})`:"Installed, stopped":"Not installed",M=h.installed?h.running?"bg-green-500":"bg-amber-500":"bg-[var(--color-text-muted)]/30";return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:ae("h-2.5 w-2.5 shrink-0 rounded-full",M)}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:a.name}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",h.port??a.port]}),l.jsx("code",{className:"text-xs text-[var(--color-text-muted)]",children:h.label})]}),l.jsxs("p",{className:"ml-5 mt-0.5 text-xs text-[var(--color-text-muted)]",children:[j,h.sourceDir&&l.jsxs("span",{className:"ml-2 opacity-60",children:["· ",h.sourceDir]})]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.installed&&l.jsxs(l.Fragment,{children:[h.running?l.jsx(pl,{icon:BS,label:"Stop",onClick:()=>y(o.mutateAsync(a.id),`${a.id} stopped`),disabled:o.isPending}):l.jsx(pl,{icon:ag,label:"Start",onClick:()=>y(s.mutateAsync(a.id),`${a.id} started`),disabled:s.isPending}),h.running&&l.jsx(pl,{icon:Qd,label:"Restart",onClick:()=>y(s.mutateAsync(a.id),`${a.id} restarted`),disabled:s.isPending}),l.jsx(pl,{icon:tg,label:d?"Hide logs":"Logs",onClick:()=>f(w=>!w)}),l.jsx(pl,{icon:bi,label:"Uninstall",onClick:x,disabled:i.isPending,danger:!0})]}),!h.installed&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:[l.jsx(On,{size:12})," Re-run install wizard to enable"]})]})]}),d&&h.installed&&l.jsxs("div",{className:"border-t border-[var(--color-border)] bg-[var(--color-background)] p-3",children:[l.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[l.jsx(Vx,{active:m==="stderr",onClick:()=>v("stderr"),children:"stderr"}),l.jsx(Vx,{active:m==="stdout",onClick:()=>v("stdout"),children:"stdout"}),l.jsx("code",{className:"ml-2 text-xs text-[var(--color-text-muted)] opacity-60",children:g.data?.file})]}),l.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap rounded bg-[var(--color-surface-alt)] p-2 text-xs font-mono text-[var(--color-text)]",children:g.isLoading?"Loading…":g.isError?`Failed to load logs: ${g.error instanceof Error?g.error.message:String(g.error)}`:g.data?.content||"(empty)"})]})]})}function pl({icon:a,label:s,onClick:o,disabled:i,danger:d}){return l.jsxs("button",{type:"button",onClick:o,disabled:i,className:ae("flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs","transition-colors disabled:cursor-not-allowed disabled:opacity-50",d?"border-red-500/30 text-red-500 hover:bg-red-500/10":"border-[var(--color-border)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-text)]"),children:[l.jsx(a,{size:12}),s]})}function Vx({active:a,onClick:s,children:o}){return l.jsx("button",{type:"button",onClick:s,className:ae("rounded px-2 py-0.5 text-xs",a?"bg-[var(--color-primary)] text-white":"border border-[var(--color-border)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:o})}function p4({message:a}){return l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-500",children:[l.jsx(Bd,{size:14}),a]})}async function x4(){const{data:a}=await xe.get("/api/models/installed");return a.models}async function v4(a){const{data:s}=await xe.post("/api/models/download",a);return s}async function g4(a){await xe.delete(`/api/models/${encodeURIComponent(a)}`)}async function y4(a){const{data:s}=await xe.post("/api/models/whisper-autodownload",{enabled:a});return s}function Sg(){return yt({queryKey:["models","installed"],queryFn:x4,staleTime:1e4})}function wg(){const a=ct();return bt({mutationFn:s=>v4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}function b4(){const a=ct();return bt({mutationFn:s=>g4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}const ss=[{id:"qwen3-4b",displayName:"Qwen 3 4B",hfRepoVllm:"Qwen/Qwen3-4B-AWQ",hfRepoGguf:"Qwen/Qwen3-4B-GGUF",ggufFilename:"Qwen3-4B-Q4_K_M.gguf",chatFormat:"chatml",contextWindow:40960,sizeVllm:"2.5GB",sizeGguf:"2.5GB",vramMb:4096,gated:!1,quantization:"awq",promptProvider:"Qwen3_8B_Compressed"},{id:"qwen3-8b",displayName:"Qwen 3 8B",hfRepoVllm:"Qwen/Qwen3-8B-AWQ",hfRepoGguf:"Qwen/Qwen3-8B-GGUF",ggufFilename:"Qwen3-8B-Q4_K_M.gguf",chatFormat:"chatml",contextWindow:40960,sizeVllm:"5.7GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Qwen3_8B_Compressed"},{id:"qwen3-14b",displayName:"Qwen 3 14B",hfRepoVllm:"Qwen/Qwen3-14B-AWQ",hfRepoGguf:"Qwen/Qwen3-14B-GGUF",ggufFilename:"Qwen3-14B-Q4_K_M.gguf",chatFormat:"chatml",contextWindow:40960,sizeVllm:"9.4GB",sizeGguf:"9GB",vramMb:12288,gated:!1,quantization:"awq",promptProvider:"Qwen3LargeUntrained"},{id:"qwen25-7b",displayName:"Qwen 2.5 7B Instruct",hfRepoVllm:"Qwen/Qwen2.5-7B-Instruct-AWQ",hfRepoGguf:"Qwen/Qwen2.5-7B-Instruct-GGUF",ggufFilename:"qwen2.5-7b-instruct-q4_k_m.gguf",chatFormat:"chatml",contextWindow:32768,sizeVllm:"4.7GB",sizeGguf:"4.7GB",vramMb:6144,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{id:"llama-3.1-8b",displayName:"Llama 3.1 8B Instruct",hfRepoVllm:"hugging-quants/Meta-Llama-3.1-8B-Instruct-AWQ-INT4",hfRepoGguf:"lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF",ggufFilename:"Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf",chatFormat:"llama-3",contextWindow:131072,sizeVllm:"5.4GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Llama31MediumUntrained"},{id:"hermes-3-8b",displayName:"Hermes 3 Llama 3.1 8B",hfRepoVllm:"solidrust/Hermes-3-Llama-3.1-8B-AWQ",hfRepoGguf:"NousResearch/Hermes-3-Llama-3.1-8B-GGUF",ggufFilename:"Hermes-3-Llama-3.1-8B.Q4_K_M.gguf",chatFormat:"chatml",contextWindow:131072,sizeVllm:"5.4GB",sizeGguf:"4.9GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"HermesMediumUntrained"}];function N4(){const[a,s]=N.useState(""),[o,i]=N.useState(""),[d,f]=N.useState(""),[m,v]=N.useState(null),{data:g,isLoading:h}=Sg(),y=wg(),x=b4();function j(E,_){const O=`${E}/${_??""}`;v(O),y.mutate({repo:E,filename:_||void 0,token:a||void 0},{onSuccess:k=>{Me.success(k.message),v(null)},onError:k=>{Me.error(k instanceof Error?k.message:"Download failed"),v(null)}})}function M(E){confirm(`Delete ${E}?`)&&x.mutate(E,{onSuccess:()=>Me.success(`Deleted ${E}`),onError:()=>Me.error("Failed to delete")})}function w(){o&&j(o,d)}return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Manage LLM models on the inference server"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(iS,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Token"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"(optional, for gated models)"})]}),l.jsx("input",{type:"password",value:a,onChange:E=>s(E.target.value),placeholder:"hf_...",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Gd,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Installed Models"})]}),h?l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading..."}):g?.length?l.jsx("div",{className:"space-y-2",children:g.map(E=>l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-3 py-2",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:E.name}),l.jsx("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:E.sizeFormatted})]}),l.jsx("button",{onClick:()=>M(E.name),disabled:x.isPending,className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",children:l.jsx(bi,{size:14})})]},E.name))}):l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No models installed yet"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(US,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Suggested Models"})]}),l.jsx("div",{className:"space-y-3",children:ss.map(E=>{const _=g?.some(O=>O.name===E.ggufFilename||O.name.includes(E.ggufFilename));return l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-4 py-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:E.displayName}),l.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:["~",E.sizeGguf]}),_&&l.jsx("span",{className:"rounded bg-green-500/10 px-1.5 py-0.5 text-xs text-green-500",children:"installed"})]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[E.hfRepoGguf," / ",E.ggufFilename]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Prompt provider: ",l.jsx("code",{className:"text-[var(--color-primary)]",children:E.promptProvider})]})]}),l.jsxs("button",{onClick:()=>j(E.hfRepoGguf,E.ggufFilename),disabled:m!==null,className:ae("ml-4 flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",_?"border border-[var(--color-border)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[l.jsx(za,{size:14}),m===`${E.hfRepoGguf}/${E.ggufFilename}`?"Downloading...":_?"Re-download":"Download"]})]},E.id)})})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(za,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Download from HuggingFace"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Repository (e.g. Qwen/Qwen3-14B-GGUF)"}),l.jsx("input",{value:o,onChange:E=>i(E.target.value),placeholder:"owner/repo-name",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Filename (optional — downloads specific file instead of full repo)"}),l.jsx("input",{value:d,onChange:E=>f(E.target.value),placeholder:"model-name.gguf",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("button",{onClick:w,disabled:!o||m!==null,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[l.jsx(za,{size:14}),m===`${o}/${d}`?"Downloading...":"Download"]})]})]})]})}async function j4(){const{data:a}=await xe.get("/api/quick-sets");return a}async function S4(a){const{data:s}=await xe.post("/api/quick-sets/apply",a);return s}async function w4(a){const{data:s}=await xe.post("/api/quick-sets/custom",a);return s}async function E4(a){const{data:s}=await xe.delete(`/api/quick-sets/custom/${a}`);return s}function C4(){return yt({queryKey:["quick-sets"],queryFn:j4,staleTime:6e4})}function T4(){const a=ct();return bt({mutationFn:s=>S4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]}),a.invalidateQueries({queryKey:["settings"]}),a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function _4(){const a=ct();return bt({mutationFn:s=>w4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}function R4(){const a=ct();return bt({mutationFn:s=>E4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}const Fx=["GGUF","MLX","VLLM","TRANSFORMERS","REST"];function k4(){const{data:a,isLoading:s,error:o}=C4(),i=T4(),d=_4(),f=R4(),{data:m}=Sg(),v=N.useMemo(()=>(m??[]).map(D=>`.models/${D.name}`),[m]),[g,h]=N.useState(null),[y,x]=N.useState(""),[j,M]=N.useState(!1),[w,E]=N.useState(""),[_,O]=N.useState(""),[k,G]=N.useState(""),[$,W]=N.useState(""),[te,H]=N.useState(new Set(["live"])),[z,oe]=N.useState(!1),[be,se]=N.useState(""),[ie,Ee]=N.useState(""),[Re,ne]=N.useState(""),[C,X]=N.useState(""),[K,ve]=N.useState("GGUF"),[ee,S]=N.useState(8192),U=a?.presets,V=N.useMemo(()=>{if(!U)return new Map;const D=new Map;for(const Se of U){const pe=Se.family||"Custom",Ut=D.get(pe)??[];Ut.push(Se),D.set(pe,Ut)}return D},[U]);function J(D){if(g===D.id){h(null);return}h(D.id),x(a?.currentValues.modelName??""),M(!1),O(D.defaultBackend),G(D.chatFormat),W(D.promptProvider);const Se=a?.currentValues.contextWindow;E(Se&&Se>0?Se:D.defaultContextWindow)}function re(D){H(Se=>{const pe=new Set(Se);return pe.has(D)?pe.size>1&&pe.delete(D):pe.add(D),pe})}function me(){!g||!y.trim()||i.mutate({presetId:g,modelName:y.trim(),contextWindow:w?Number(w):void 0,backend:_,chatFormat:k,promptProvider:$,targets:Array.from(te)},{onSuccess:D=>{D.success?Me.success(D.message):Me.warning(D.message),h(null)},onError:D=>{Me.error(D.message||"Failed to apply preset")}})}function ue(){!be.trim()||!Re.trim()||!C.trim()||d.mutate({name:be.trim(),family:ie.trim()||"Custom",chatFormat:Re.trim(),promptProvider:C.trim(),defaultBackend:K,defaultContextWindow:ee?Number(ee):8192},{onSuccess:()=>{Me.success(`Created preset "${be.trim()}"`),oe(!1),se(""),Ee(""),ne(""),X(""),ve("GGUF"),S(8192)},onError:D=>{Me.error(D.message||"Failed to create preset")}})}function je(D){f.mutate(D.id,{onSuccess:()=>{Me.success(`Deleted "${D.name}"`),g===D.id&&h(null)},onError:()=>Me.error("Failed to delete preset")})}const L=a?.presets.find(D=>D.id===g);return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Quick Sets"}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Select a model preset to auto-configure chat format, prompt provider, and backend"})]}),a?.currentValues.modelName&&l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3",children:[l.jsx(On,{size:16,className:"text-[var(--color-primary)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Current model"}),l.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:a.currentValues.modelName})]}),a.currentValues.contextWindow>0&&l.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-2 py-0.5 text-xs text-[var(--color-text-muted)]",children:[a.currentValues.contextWindow.toLocaleString()," ctx"]})]}),s&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(it,{size:20,className:"animate-spin text-[var(--color-text-muted)]"})}),o&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-4 py-3",children:[l.jsx(ra,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:"Failed to load presets"})]}),!s&&Array.from(V.entries()).map(([D,Se])=>l.jsxs("section",{children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text-muted)]",children:D}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:Se.map(pe=>l.jsxs("div",{className:ae("relative rounded-lg border px-4 py-3 transition-colors",g===pe.id?"border-[var(--color-primary)] bg-[var(--color-primary)]/5":"border-[var(--color-border)] bg-[var(--color-surface)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("button",{onClick:()=>J(pe),className:"w-full text-left",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:pe.name}),g===pe.id&&l.jsx(vi,{size:16,className:"text-[var(--color-primary)]"})]}),pe.description&&l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:pe.description}),l.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[l.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:pe.chatFormat}),l.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:pe.defaultBackend})]})]}),pe.isCustom&&l.jsx("button",{onClick:()=>je(pe),disabled:f.isPending,className:"absolute right-2 top-2 rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",title:"Delete custom preset",children:l.jsx(bi,{size:14})})]},pe.id))})]},D)),!s&&!z&&l.jsxs("button",{onClick:()=>oe(!0),className:"flex items-center gap-2 rounded-lg border border-dashed border-[var(--color-border)] px-4 py-3 text-sm text-[var(--color-text-muted)] transition-colors hover:border-[var(--color-primary)] hover:text-[var(--color-primary)]",children:[l.jsx(ai,{size:16}),"Create custom preset"]}),z&&l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ai,{size:16,className:"text-[var(--color-primary)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"New Custom Preset"})]}),l.jsx("button",{onClick:()=>oe(!1),className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:l.jsx(Fd,{size:16})})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Name *"}),l.jsx("input",{type:"text",value:be,onChange:D=>se(D.target.value),placeholder:"My Custom Model",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Family"}),l.jsx("input",{type:"text",value:ie,onChange:D=>Ee(D.target.value),placeholder:"Custom",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format *"}),l.jsx("input",{type:"text",value:Re,onChange:D=>ne(D.target.value),placeholder:"chatml",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider *"}),l.jsx("input",{type:"text",value:C,onChange:D=>X(D.target.value),placeholder:"Qwen25MediumUntrained",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default backend"}),l.jsx("select",{value:K,onChange:D=>ve(D.target.value),className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:Fx.map(D=>l.jsx("option",{value:D,children:D},D))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default context window"}),l.jsx("input",{type:"number",value:ee,onChange:D=>S(D.target.value?parseInt(D.target.value,10):""),placeholder:"8192",min:1,className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[l.jsxs("button",{onClick:ue,disabled:!be.trim()||!Re.trim()||!C.trim()||d.isPending,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[d.isPending?l.jsx(it,{size:14,className:"animate-spin"}):l.jsx(ai,{size:14}),d.isPending?"Creating...":"Create Preset"]}),l.jsx("button",{onClick:()=>oe(!1),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]}),L&&l.jsxs("section",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx(ii,{size:16,className:"text-[var(--color-primary)]"}),l.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:["Apply: ",L.name]})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("span",{className:"mb-2 block text-xs font-medium text-[var(--color-text-muted)]",children:"Apply to"}),l.jsx("div",{className:"flex items-center gap-4",children:["live","background"].map(D=>l.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[l.jsx("input",{type:"checkbox",checked:te.has(D),onChange:()=>re(D),className:"rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),l.jsx("span",{className:"capitalize",children:D})]},D))})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Model file path"}),v.length>0&&l.jsxs("select",{value:j||y!==""&&!v.includes(y)?"__other__":y,onChange:D=>{D.target.value==="__other__"?M(!0):(M(!1),x(D.target.value))},className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"",disabled:!0,children:"Select a model…"}),v.map(D=>l.jsx("option",{value:D,children:D.replace(/^\.models\//,"")},D)),l.jsx("option",{value:"__other__",children:"Other (custom path / HF ID)…"})]}),(v.length===0||j||y!==""&&!v.includes(y))&&l.jsx("input",{type:"text",value:y,onChange:D=>x(D.target.value),placeholder:".models/model-name.gguf",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format"}),l.jsx("input",{type:"text",value:k,onChange:D=>G(D.target.value),placeholder:"chatml",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider"}),l.jsx("input",{type:"text",value:$,onChange:D=>W(D.target.value),placeholder:"Qwen25MediumUntrained",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Context window (tokens)"}),l.jsx("input",{type:"number",value:w,onChange:D=>E(D.target.value?parseInt(D.target.value,10):""),placeholder:String(L.defaultContextWindow),min:1,className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Backend"}),l.jsx("select",{value:_,onChange:D=>O(D.target.value),className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:Fx.map(D=>l.jsx("option",{value:D,children:D},D))})]})]})]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[l.jsxs("button",{onClick:me,disabled:!y.trim()||i.isPending,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[i.isPending?l.jsx(it,{size:14,className:"animate-spin"}):l.jsx(ii,{size:14}),i.isPending?"Applying...":"Apply Settings"]}),l.jsx("button",{onClick:()=>h(null),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]})}const $o={preflight:"Checking prerequisites",download:"Downloading update",binary:"Updating binary",restarting:"Restarting admin server",compose:"Updating configuration",pull:"Pulling images",restart:"Restarting services",verify:"Verifying health",done:"Complete"};function M4(){const a=wa(),s=ct(),{data:o,isLoading:i}=Ng(),[d,f]=N.useState("idle"),[m,v]=N.useState([]),[g,h]=N.useState(null),[y,x]=N.useState(!1),j=N.useRef(null),M=o?.updatesEnabled,w=N.useCallback(async G=>{x(!0),h(null);try{await LE(G),await s.invalidateQueries({queryKey:["update-check"]})}catch{h(G?"Could not turn on update checks. You need to be signed in as an admin.":"Could not turn off update checks.")}finally{x(!1)}},[s]),E=N.useCallback(G=>{v($=>[...$,G])},[]);N.useEffect(()=>{j.current&&(j.current.scrollTop=j.current.scrollHeight)},[m]);const _=N.useCallback(async()=>{const G=Date.now()+12e5;let $="";for(;Date.now()<G;){try{const W=await UE();if(W.phase==="error"){const te=W.error??"Upgrade failed after restart";h(te),f("error"),E({text:`Error: ${te}`});return}if(!W.inProgress){f("done"),E({text:"Upgrade complete!"}),await s.invalidateQueries({queryKey:["update-check"]});return}if(W.phase&&W.phase!==$){$=W.phase;const te=$o[W.phase];te&&E({text:`${te}...`}),f(W.phase==="binary-updated"?"compose":W.phase)}}catch{}await new Promise(W=>setTimeout(W,3e3))}h("Upgrade is taking longer than expected — check the admin logs."),f("error")},[E,s]);async function O(){f("preflight"),v([]),h(null);try{const G=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),$=await fetch("/api/update/apply",{method:"POST",headers:{Authorization:`Bearer ${G}`}});if(!$.ok||!$.body){const z=await $.text();throw new Error(z||`HTTP ${$.status}`)}const W=$.body.getReader(),te=new TextDecoder;let H="";for(;;){const{done:z,value:oe}=await W.read();if(z)break;H+=te.decode(oe,{stream:!0});const be=H.split(`
17
- `);H=be.pop()??"";for(const se of be)if(se.startsWith("data: "))try{const ie=JSON.parse(se.slice(6));if(ie.phase&&f(ie.phase),ie.message&&E({text:ie.message,phase:ie.phase}),ie.stream&&ie.text&&E({text:ie.text.trim()}),ie.restart){f("restarting"),E({text:"Admin server restarting with new version..."}),await A4(o?.latestVersion??""),E({text:"Admin back up. Finishing upgrade (configuration, images, services)..."}),await _();return}if(ie.done&&ie.code!==0)throw new Error(ie.error??"Upgrade failed");ie.done&&ie.code===0&&f("done")}catch(ie){if(ie instanceof SyntaxError)continue;throw ie}}}catch(G){const $=G instanceof Error?G.message:String(G);h($),f("error"),E({text:`Error: ${$}`})}}if(i)return l.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:l.jsx(Ct,{size:24,className:"animate-spin text-[var(--color-primary)]"})});const k=Object.keys($o).filter(G=>{const $=Object.keys($o),W=$.indexOf(d);return $.indexOf(G)<W});return l.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Update Jarvis"}),M===!1?l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["Update checks are off — currently running v",o?.currentVersion??"?"]}):o?.updateAvailable?l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["v",o.currentVersion," → v",o.latestVersion]}):l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["You're running the latest version (v",o?.currentVersion??"?",")"]})]}),l.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(za,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Check for updates"})]}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Lets Jarvis contact GitHub to see if a new release is available. This is the only outbound connection it makes — turn it off to stay fully offline."})]}),l.jsx("button",{role:"switch","aria-checked":M===!0,"aria-label":"Check for updates",disabled:y||M===void 0,onClick:()=>w(!M),className:ae("relative mt-1 h-6 w-11 shrink-0 rounded-full transition-colors disabled:opacity-50",M?"bg-green-600":"bg-[var(--color-border)]"),children:l.jsx("span",{className:ae("absolute top-0.5 h-5 w-5 rounded-full bg-white transition-transform",M?"translate-x-[22px]":"translate-x-0.5")})})]}),d!=="idle"&&l.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries($o).map(([G,$])=>{const W=G===d,te=k.includes(G),H=G===d&&d==="error";return l.jsxs("div",{className:"flex items-center gap-2",children:[te?l.jsx(pt,{size:16,className:"text-green-500"}):H?l.jsx(ra,{size:16,className:"text-red-500"}):W?l.jsx(Ct,{size:16,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),l.jsx("span",{className:ae("text-sm",W?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",te&&"text-green-500"),children:$})]},G)})}),m.length>0&&l.jsx("div",{ref:j,className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[#0d1117] p-3 font-mono text-xs text-gray-300",children:m.map((G,$)=>l.jsx("div",{children:G.text},$))}),g&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(ra,{size:14,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:g})]}),l.jsxs("div",{className:"flex gap-3",children:[d==="idle"&&o?.updateAvailable&&l.jsxs("button",{onClick:O,className:"flex items-center gap-2 rounded-lg bg-green-600 px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(qd,{size:16}),"Update to v",o.latestVersion]}),d==="done"&&l.jsxs("button",{onClick:()=>a("/dashboard"),className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(pt,{size:16}),"Go to Dashboard"]}),d==="error"&&l.jsxs("button",{onClick:O,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(it,{size:16}),"Retry"]})]})]})}async function A4(a,s=6e4){const o=Date.now()+s;for(;Date.now()<o;){await new Promise(i=>setTimeout(i,2e3));try{const i=await fetch("/health");if(i.ok){const d=await i.json();if(d.version&&d.version!=="0.0.0-dev")return}}catch{}}throw new Error("Admin server did not restart within 60 seconds")}const Ju={regenerate:"Regenerating compose from registry",pull:"Pulling images for new release track",apply:"Applying changes (docker compose up)",done:"Complete"};function O4(){const a=wa(),s=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),[o,i]=N.useState("loading_options"),[d,f]=N.useState([]),[m,v]=N.useState(null),g=N.useRef(null),[h,y]=N.useState([]),[x,j]=N.useState(!1),[M,w]=N.useState("https://relay.jarvisautomation.io"),[E,_]=N.useState("/whisper-models/ggml-base.en.bin"),[O,k]=N.useState("cpu"),[G,$]=N.useState("cpu"),[W,te]=N.useState(!1),[H,z]=N.useState("stable"),[oe,be]=N.useState(null),[se,ie]=N.useState(!1),Ee=N.useCallback(ee=>{f(S=>[...S,ee])},[]);N.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[d]),N.useEffect(()=>{async function ee(){try{const S=await fetch("/api/install/reconcile/options",{headers:{Authorization:`Bearer ${s}`}});if(!S.ok)throw new Error(`HTTP ${S.status}`);const U=await S.json();y(U.services),j(U.relayEnabled),w(U.relayUrl||"https://relay.jarvisautomation.io"),_(U.whisperModelPath||"/whisper-models/ggml-base.en.bin"),k(U.whisperBackend??"cpu"),$(U.ttsBackend??"cpu"),te(U.pinImages??!1),z(U.releaseTrack??"stable"),i("options")}catch(S){v(S instanceof Error?S.message:"Failed to load options"),i("error")}}ee()},[s]);function Re(ee){y(S=>S.map(U=>U.id===ee?{...U,enabled:!U.enabled}:U))}async function ne(){i("regenerate"),f([]),v(null);const ee=h.filter(S=>S.enabled).map(S=>S.id);try{const S=await fetch("/api/install/reconcile",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({enabledModules:ee,relayEnabled:x,relayUrl:M,whisperModelPath:E,whisperBackend:O,ttsBackend:G,pinImages:W,releaseTrack:H})});if(!S.ok||!S.body){const re=await S.text();throw new Error(re||`HTTP ${S.status}`)}const U=S.body.getReader(),V=new TextDecoder;let J="";for(;;){const{done:re,value:me}=await U.read();if(re)break;J+=V.decode(me,{stream:!0});const ue=J.split(`
18
- `);J=ue.pop()??"";for(const je of ue)if(je.startsWith("data: "))try{const L=JSON.parse(je.slice(6));if(L.phase&&i(L.phase),L.message&&Ee({text:L.message,phase:L.phase}),L.stream&&L.text&&Ee({text:L.text.trim()}),L.done&&L.code!==0)throw new Error(L.message??"Reconcile failed")}catch(L){if(L instanceof SyntaxError)continue;throw L}}}catch(S){const U=S instanceof Error?S.message:String(S);v(U),i("error"),Ee({text:`Error: ${U}`})}}function C(){return{enabledModules:h.filter(ee=>ee.enabled).map(ee=>ee.id),relayEnabled:x,relayUrl:M,whisperModelPath:E,whisperBackend:O,ttsBackend:G,pinImages:W,releaseTrack:H}}async function X(ee){ie(!0),v(null),be(null);try{const{latest:S,...U}=ee??{},J=await fetch(`/api/install/regenerate-download${S?"?latest=true":""}`,{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({...C(),...U})});if(!J.ok){const me=await J.text();throw new Error(me||`HTTP ${J.status}`)}const re=await J.json();be({compose:re.compose,env:re.env,initDb:re.initDb})}catch(S){v(S instanceof Error?S.message:String(S))}finally{ie(!1)}}function K(ee,S){const U=new Blob([S],{type:"text/plain;charset=utf-8"}),V=URL.createObjectURL(U),J=document.createElement("a");J.href=V,J.download=ee,document.body.appendChild(J),J.click(),J.remove(),URL.revokeObjectURL(V)}const ve=Object.keys(Ju).filter(ee=>{const S=Object.keys(Ju),U=S.indexOf(o);return S.indexOf(ee)<U||o==="done"&&ee==="done"});return l.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Sync Compose"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Regenerate ",l.jsx("code",{className:"rounded bg-[var(--color-surface)] px-1.5 py-0.5 text-xs",children:"docker-compose.yml"})," from the latest service registry, preserving your secrets. ",l.jsx("strong",{className:"text-[var(--color-text)]",children:"Sync now"})," applies it to the running stack;",l.jsx("strong",{className:"text-[var(--color-text)]",children:" Download"})," hands you the files to review and apply by hand (",l.jsx("code",{className:"rounded bg-[var(--color-surface)] px-1 text-xs",children:"docker compose up -d"}),")."," ",l.jsx("strong",{className:"text-[var(--color-text)]",children:"Update stack to latest"})," downloads the same, pinned to the newest published images."]})]}),o==="loading_options"&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})}),o==="options"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Services"}),l.jsx("div",{className:"space-y-2",children:h.map(ee=>l.jsxs("button",{onClick:()=>Re(ee.id),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left hover:bg-[var(--color-bg-secondary)] transition-colors",children:[ee.enabled?l.jsx(pt,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:ee.name}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:ee.description})]})]},ee.id))})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Release Track"}),l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:H==="dev"?"Dev":"Stable"}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:H==="dev"?"Using latest main branch builds (may be unstable)":"Using tagged releases"})]}),l.jsx("button",{type:"button",role:"switch","aria-checked":H==="dev",onClick:()=>z(H==="dev"?"stable":"dev"),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${H==="dev"?"bg-amber-500":"bg-[var(--color-surface-alt)]"}`,children:l.jsx("span",{className:`absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform ${H==="dev"?"translate-x-5":"translate-x-0"}`})})]}),H==="dev"&&l.jsx("div",{className:"mx-3 mt-1 rounded-lg border border-amber-300 bg-amber-500/10 px-3 py-2 text-xs text-amber-400",children:"Switching tracks will pull all images and force-recreate containers."})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Integrations"}),l.jsxs("button",{onClick:()=>j(!x),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left hover:bg-[var(--color-bg-secondary)] transition-colors",children:[x?l.jsx(pt,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]}),x&&l.jsxs("div",{className:"mt-2 px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Relay URL"}),l.jsx("input",{type:"url",value:M,onChange:ee=>w(ee.target.value),placeholder:"https://relay.jarvisautomation.io",className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),h.some(ee=>ee.id==="jarvis-whisper-api"&&ee.enabled)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Whisper"}),l.jsxs("div",{className:"px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Model path"}),l.jsx("input",{type:"text",value:E,onChange:ee=>_(ee.target.value),placeholder:"/whisper-models/ggml-base.en.bin",className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm font-mono text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Path inside the container. Place model files in ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"./whisper-models/"})," next to your compose file."]}),l.jsx("label",{className:"mt-3 block text-xs font-medium text-[var(--color-text-muted)]",children:"GPU backend"}),l.jsxs("select",{value:O,onChange:ee=>k(ee.target.value),className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"cpu",children:"CPU (default)"}),l.jsx("option",{value:"cuda",children:"NVIDIA (CUDA)"}),l.jsx("option",{value:"vulkan",children:"AMD / generic (Vulkan)"}),l.jsx("option",{value:"rocm",children:"AMD (ROCm)"})]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Where speech-to-text runs. CPU leaves the GPU for the LLM; pick a GPU backend to run Whisper on the GPU."})]})]}),h.some(ee=>ee.id==="jarvis-tts"&&ee.enabled)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Text-to-speech"}),l.jsxs("div",{className:"px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Inference device"}),l.jsxs("select",{value:G,onChange:ee=>$(ee.target.value),className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"cpu",children:"CPU (default)"}),l.jsx("option",{value:"cuda",children:"NVIDIA (CUDA)"})]}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Where Kokoro synthesis runs. CPU is fine for most installs; CUDA gives the fastest first-audio. On multi-GPU hosts set ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"TTS_GPU_DEVICE"})," in .env to pick which GPU (default 0)."]})]})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:l.jsxs("label",{className:"flex items-start gap-3 text-sm",children:[l.jsx("input",{type:"checkbox",checked:W,onChange:ee=>te(ee.target.checked),className:"mt-0.5","data-testid":"pin-images-checkbox"}),l.jsxs("span",{children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:"Pin images by digest"}),l.jsxs("span",{className:"mt-1 block text-xs text-[var(--color-text-muted)]",children:["Advanced supply-chain hardening: locks every image to an exact build. Leave OFF for normal use — with pinning on, ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"docker compose pull"})," will never update anything and services only change via this page."]})]})]})})]}),oe&&o==="options"&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-primary)]/40 bg-[var(--color-surface)] p-4",children:[l.jsxs("h2",{className:"mb-1 flex items-center gap-2 text-sm font-semibold text-[var(--color-text)]",children:[l.jsx(pt,{size:16,className:"text-green-500"}),"Updated files ready"]}),l.jsxs("p",{className:"mb-3 text-xs text-[var(--color-text-muted)]",children:["Your existing secrets and settings are carried over. Download, replace the files next to your compose, then run ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"docker compose up -d"}),". Nothing on the server was changed."]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsxs("button",{onClick:()=>K("docker-compose.yml",oe.compose),className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-3 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(za,{size:15}),"docker-compose.yml"]}),l.jsxs("button",{onClick:()=>K(".env",oe.env),className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:[l.jsx(za,{size:15}),".env"]}),l.jsxs("button",{onClick:()=>K("init-db.sh",oe.initDb),className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:[l.jsx(za,{size:15}),"init-db.sh"]})]}),l.jsxs("p",{className:"mt-3 text-xs text-[var(--color-text-muted)]",children:["The ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:".env"})," merges new keys into your existing values, and ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"init-db.sh"})," covers any new databases — replace all three to be safe. Diff them against your current files first if you want to eyeball the changes."]})]}),o!=="loading_options"&&o!=="options"&&l.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries(Ju).map(([ee,S])=>{const U=ee===o,V=ve.includes(ee),J=ee===o&&o==="error";return l.jsxs("div",{className:"flex items-center gap-2",children:[V?l.jsx(pt,{size:16,className:"text-green-500"}):J?l.jsx(ra,{size:16,className:"text-red-500"}):U?l.jsx(Ct,{size:16,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),l.jsx("span",{className:ae("text-sm",U?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",V&&"text-green-500"),children:S})]},ee)})}),d.length>0&&l.jsx("div",{ref:g,className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[#0d1117] p-3 font-mono text-xs text-gray-300",children:d.map((ee,S)=>l.jsx("div",{children:ee.text},S))}),m&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(ra,{size:14,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:m})]}),l.jsxs("div",{className:"flex gap-3",children:[o==="options"&&l.jsxs("button",{onClick:ne,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(xd,{size:16}),"Sync now"]}),o==="options"&&l.jsxs("button",{onClick:()=>X(),disabled:se,title:"Regenerate the compose and download it to apply by hand — doesn't touch the running stack",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[se?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(za,{size:16}),"Download updated compose"]}),o==="options"&&l.jsxs("button",{onClick:()=>X({latest:!0}),disabled:se,title:"Download a compose pinned to the LATEST published images (digests refreshed from the registry). Apply it yourself on the host — docker compose pull && docker compose up -d — which also updates jarvis-admin.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[se?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(it,{size:16}),"Update stack to latest"]}),o==="options"&&l.jsxs("button",{onClick:()=>X({mqttAllowAnon:!1}),disabled:se,title:"Download a compose with the MQTT broker locked (allow_anonymous=false). Do this only after every node has authenticated, or un-migrated nodes will drop off.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[se?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(gi,{size:16}),"Download + lock broker"]}),o==="options"&&l.jsxs("button",{onClick:()=>X({mqttAllowAnon:!0}),disabled:se,title:"Download a compose that re-opens the MQTT broker to anonymous clients (allow_anonymous=true) — the transition/rollback state.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[se?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(mS,{size:16}),"Download + unlock broker"]}),(o==="options"||o==="regenerate"||o==="apply"||o==="done")&&l.jsxs("button",{onClick:()=>a("/dashboard"),disabled:o==="regenerate"||o==="apply",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",children:[l.jsx(pt,{size:16}),"Back to dashboard"]}),o==="error"&&l.jsxs("button",{onClick:ne,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(it,{size:16}),"Retry"]})]})]})}async function z4(a={}){const{data:s}=await xe.get("/api/traces",{params:a});return s}async function D4(a){const{data:s}=await xe.get(`/api/traces/${a}`);return s}function Yx(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function Xx(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function U4(a){const s=new Map;for(const o of a){const i=s.get(o.conversation_id);if(!i){s.set(o.conversation_id,{conversation_id:o.conversation_id,traces:[o],newest_at:o.created_at,user_command:o.user_command,assistant_message:o.assistant_message,source:o.source,node_id:o.node_id,household_id:o.household_id,total_duration_ms:o.total_duration_ms,status:o.status});continue}i.traces.push(o),i.total_duration_ms+=o.total_duration_ms,o.created_at>i.newest_at&&(i.newest_at=o.created_at),!i.user_command&&o.user_command&&(i.user_command=o.user_command),!i.assistant_message&&o.assistant_message&&(i.assistant_message=o.assistant_message),o.status!=="ok"&&(i.status=o.status)}return Array.from(s.values()).sort((o,i)=>o.newest_at<i.newest_at?1:-1)}function L4(a){return a==="mobile"?"📱":"🔊"}function B4(){const a=wa(),[s,o]=N.useState(""),[i,d]=N.useState(""),[f,m]=N.useState(""),[v,g]=N.useState(""),[h,y]=N.useState(new Set),x=yt({queryKey:["admin","households"],queryFn:$E,staleTime:6e4}),j=yt({queryKey:["admin","nodes"],queryFn:ZE,staleTime:6e4}),{data:M,isLoading:w,error:E}=yt({queryKey:["traces",s,i,f,v],queryFn:()=>z4({limit:100,...s?{status:s}:{},...i?{source:i}:{},...f?{household_id:f}:{},...v?{node_id:v}:{}}),refetchInterval:1e4}),_=N.useMemo(()=>{const H=j.data??[];return f?H.filter(z=>z.household_id===f):H},[j.data,f]),O=N.useMemo(()=>{const H=new Map;for(const z of j.data??[])H.set(z.node_id,z.name);return H},[j.data]),k=N.useMemo(()=>{const H=new Map;for(const z of x.data??[])H.set(z.id,z.name);return H},[x.data]),G=N.useMemo(()=>M?U4(M.traces):[],[M]);function $(H){y(z=>{const oe=new Set(z);return oe.has(H)?oe.delete(H):oe.add(H),oe})}function W(H){if(m(H),H&&v){const z=(j.data??[]).find(oe=>oe.node_id===v);z&&z.household_id!==H&&g("")}}const te="rounded border border-[var(--color-border)] bg-[var(--color-surface)] px-2 py-1 text-sm text-[var(--color-text)]";return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Request Traces"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("select",{className:te,value:f,onChange:H=>W(H.target.value),disabled:x.isLoading,children:[l.jsx("option",{value:"",children:"All households"}),(x.data??[]).map(H=>l.jsx("option",{value:H.id,children:H.name},H.id))]}),l.jsxs("select",{className:te,value:v,onChange:H=>g(H.target.value),disabled:j.isLoading,children:[l.jsx("option",{value:"",children:"All nodes"}),_.map(H=>l.jsx("option",{value:H.node_id,children:H.name},H.node_id))]}),l.jsxs("select",{className:te,value:s,onChange:H=>o(H.target.value),children:[l.jsx("option",{value:"",children:"All statuses"}),l.jsx("option",{value:"ok",children:"OK"}),l.jsx("option",{value:"error",children:"Error"})]}),l.jsxs("select",{className:te,value:i,onChange:H=>d(H.target.value),children:[l.jsx("option",{value:"",children:"All sources"}),l.jsx("option",{value:"node",children:"Node"}),l.jsx("option",{value:"mobile",children:"Mobile"})]})]})]}),w&&l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}),E&&l.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 p-4 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:"Failed to load traces"}),M&&l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[M.total," traces in ",G.length," conversation",G.length===1?"":"s"]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--color-border)]",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)]",children:[l.jsx("th",{className:"w-8 px-2 py-2"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Time"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Source"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Node"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"User said"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Jarvis said"}),l.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Duration"}),l.jsx("th",{className:"px-3 py-2 text-center font-medium text-[var(--color-text-muted)]",children:"Status"}),l.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Traces"})]})}),l.jsxs("tbody",{children:[G.map(H=>{const z=h.has(H.conversation_id),oe=H.traces.length,be=H.node_id?O.get(H.node_id)??H.node_id.slice(0,8):"-";return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>$(H.conversation_id),children:[l.jsx("td",{className:"px-2 py-2 text-center text-[var(--color-text-muted)]",children:oe>1?z?"▼":"▶":""}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] whitespace-nowrap",children:Xx(H.newest_at)}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)]",children:l.jsxs("span",{className:"inline-flex items-center gap-1",children:[L4(H.source),H.source]})}),l.jsxs("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap",children:[be,H.household_id&&l.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["· ",k.get(H.household_id)??""]})]}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:H.user_command??"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] max-w-xs truncate",children:H.assistant_message??"-"}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:Yx(H.total_duration_ms)}),l.jsx("td",{className:"px-3 py-2 text-center",children:l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${H.status==="ok"?"bg-green-500":"bg-red-500"}`})}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text-muted)] tabular-nums",children:oe})]}),z&&H.traces.slice().sort((se,ie)=>se.created_at<ie.created_at?-1:1).map(se=>l.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer bg-[var(--color-surface-alt)]/40 transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>a(`/traces/${se.id}`),children:[l.jsx("td",{className:"px-2 py-2"}),l.jsxs("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap",children:[l.jsx("span",{className:"inline-block w-3"}),Xx(se.created_at)]}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] text-xs",children:se.request_type}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap text-xs",children:se.node_id?O.get(se.node_id)??se.node_id.slice(0,8):"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:se.user_command??"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] max-w-xs truncate",children:se.assistant_message??"-"}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:Yx(se.total_duration_ms)}),l.jsx("td",{className:"px-3 py-2 text-center",children:l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${se.status==="ok"?"bg-green-500":"bg-red-500"}`})}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text-muted)] tabular-nums",children:se.span_count})]},se.id))]},H.conversation_id)}),G.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:9,className:"px-3 py-8 text-center text-[var(--color-text-muted)]",children:"No traces yet"})})]})]})})]})]})}function ns(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}const Kx={cc:"#9e9e9e",llm_proxy:"#42a5f5",node:"#66bb6a",tts:"#ffa726",whisper:"#ab47bc"},$x={cc:"Command Center",llm_proxy:"LLM Proxy",node:"Node",tts:"TTS",whisper:"Whisper"};function q4(a){const s=a.filter(d=>d.duration_ms>0),o=s.filter(d=>!s.some(f=>f!==d&&d.start_ms<=f.start_ms&&d.end_ms>=f.end_ms&&f.duration_ms>0));o.sort((d,f)=>d.start_ms-f.start_ms);const i=[];for(const d of o){const f=i[i.length-1];f&&f.service===d.service?(f.duration_ms=Math.round((f.duration_ms+d.duration_ms)*10)/10,f.steps.push(d.name),d.status==="error"&&(f.status="error")):i.push({service:d.service,duration_ms:d.duration_ms,status:d.status,steps:[d.name]})}return i}function H4(){const{id:a}=k0(),s=wa(),[o,i]=N.useState(!1),[d,f]=N.useState(null),{data:m,isLoading:v,error:g}=yt({queryKey:["trace",a],queryFn:()=>D4(a),enabled:!!a}),h=N.useMemo(()=>m?q4(m.spans):[],[m]);return v?l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}):g||!m?l.jsxs("div",{className:"space-y-4",children:[l.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>s("/traces"),children:"Back to traces"}),l.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 p-4 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:"Trace not found"})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>s("/traces"),children:"Back to traces"}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-[var(--color-text)]",children:m.user_command??"Request Trace"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[m.source==="mobile"?"📱 Mobile":"🔊 Node",m.node_id&&` (${m.node_id})`," · ",m.request_type," · ",m.created_at?new Date(m.created_at).toLocaleString():""]})]}),l.jsxs("div",{className:"text-right",children:[l.jsx("div",{className:"text-2xl font-bold tabular-nums text-[var(--color-text)]",children:ns(m.total_duration_ms)}),l.jsxs("div",{className:"flex items-center justify-end gap-1 mt-1",children:[l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${m.status==="ok"?"bg-green-500":"bg-red-500"}`}),l.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:m.status})]})]})]}),m.error_message&&l.jsx("div",{className:"mt-3 rounded border border-red-300 bg-red-50 p-2 text-sm text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:m.error_message}),l.jsx("p",{className:"mt-2 text-xs text-[var(--color-text-muted)] font-mono",children:m.conversation_id})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-muted)]",children:"Service Flow"}),l.jsx("p",{className:"mb-4 text-xs text-[var(--color-text-muted)] opacity-60",children:h.map(y=>$x[y.service]??y.service).join(" → ")}),l.jsx("div",{className:"space-y-2",children:h.map((y,x)=>{const j=Math.min(y.duration_ms/m.total_duration_ms*100,100),M=y.status==="error"?"#ef4444":Kx[y.service]??"#9e9e9e",w=$x[y.service]??y.service;return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:M}}),l.jsx("span",{className:"w-32 text-sm text-[var(--color-text)] shrink-0",children:w}),l.jsxs("div",{className:"flex-1 h-6 rounded bg-[var(--color-surface-alt)] relative",children:[l.jsx("div",{className:"absolute top-0 left-0 h-full rounded",style:{width:`${Math.max(j,1)}%`,backgroundColor:M,opacity:.7}}),l.jsx("span",{className:"absolute inset-0 flex items-center px-2 text-xs text-[var(--color-text)] opacity-70",children:y.steps.join(", ")})]}),l.jsx("span",{className:"w-16 text-sm text-[var(--color-text)] text-right tabular-nums shrink-0",children:ns(y.duration_ms)})]},`${y.service}-${x}`)})})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("button",{className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>{i(y=>!y),f(null)},children:[o?"Hide":"Show"," raw spans (",m.spans.length,")"]}),o&&l.jsx("div",{className:"mt-3 space-y-1",children:m.spans.map((y,x)=>{const j=Math.min(y.duration_ms/m.total_duration_ms*100,100),M=y.start_ms/m.total_duration_ms*100,w=y.status==="error"?"#ef4444":Kx[y.service]??"#9e9e9e",E=d===y;return l.jsxs("div",{className:`flex items-center gap-2 cursor-pointer rounded px-1 py-0.5 ${E?"bg-[var(--color-surface-alt)]":""}`,onClick:()=>f(E?null:y),children:[l.jsx("span",{className:"w-36 truncate text-xs text-[var(--color-text-muted)] text-right shrink-0",children:y.name}),l.jsx("div",{className:"flex-1 relative h-4 rounded bg-[var(--color-surface-alt)]",children:l.jsx("div",{className:"absolute top-0 h-full rounded",style:{left:`${M}%`,width:`${Math.max(j,.5)}%`,backgroundColor:w,minWidth:"2px"}})}),l.jsx("span",{className:"w-14 text-xs text-[var(--color-text-muted)] text-right shrink-0 tabular-nums",children:ns(y.duration_ms)}),l.jsx("span",{className:"w-16 text-xs text-[var(--color-text-muted)] opacity-60 shrink-0",children:y.service})]},`${y.name}-${x}`)})}),d&&o&&l.jsx("div",{className:"mt-3 border-t border-[var(--color-border)] pt-3",children:l.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm max-w-md",children:[l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Service"}),l.jsx("dd",{className:"text-[var(--color-text)]",children:d.service}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Duration"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.duration_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Start"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.start_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"End"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.end_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Status"}),l.jsx("dd",{className:d.status==="ok"?"text-green-600":"text-red-600",children:d.status}),Object.entries(d.metadata||{}).map(([y,x])=>l.jsxs("div",{className:"contents",children:[l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:y}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:String(x)})]},y))]})})]})]})}function G4(){return l.jsxs("div",{className:"flex min-h-[60vh] flex-col items-center justify-center",children:[l.jsx("h1",{className:"mb-2 text-4xl font-bold text-[var(--color-text)]",children:"404"}),l.jsx("p",{className:"mb-4 text-[var(--color-text-muted)]",children:"Page not found"}),l.jsx(Cd,{to:"/settings",className:"text-[var(--color-primary)] underline hover:opacity-80",children:"Go to Settings"})]})}const Q4=7,V4={currentStep:0,totalSteps:Q4,enabledModules:[],portOverrides:{},infraPortOverrides:{},secrets:{},dbUser:"jarvis",whisperModel:"base.en",whisperModelPath:"/whisper-models/ggml-base.en.bin",llmInterface:"Qwen25MediumUntrained",deploymentMode:"local",deploymentTarget:"standard",remoteLlmUrl:"",remoteWhisperUrl:"",platform:"linux",hardware:null,relayEnabled:!1,installRunning:!1,installComplete:!1,nativeServices:[]};function F4(a,s,o){return Math.max(s,Math.min(o,a))}function Y4(a,s){switch(s.type){case"SET_STEP":return{...a,currentStep:F4(s.step,0,a.totalSteps-1)};case"NEXT_STEP":return{...a,currentStep:Math.min(a.currentStep+1,a.totalSteps-1)};case"PREV_STEP":return{...a,currentStep:Math.max(a.currentStep-1,0)};case"SET_ENABLED_MODULES":return{...a,enabledModules:s.modules};case"TOGGLE_MODULE":{if(s.enabled){const o=a.enabledModules.includes(s.serviceId)?a.enabledModules:[...a.enabledModules,s.serviceId];return{...a,enabledModules:o}}return{...a,enabledModules:a.enabledModules.filter(o=>o!==s.serviceId)}}case"SET_PORT_OVERRIDE":return{...a,portOverrides:{...a.portOverrides,[s.serviceId]:s.port}};case"SET_INFRA_PORT_OVERRIDE":return{...a,infraPortOverrides:{...a.infraPortOverrides,[s.infraId]:s.port}};case"SET_SECRET":return{...a,secrets:{...a.secrets,[s.name]:s.value}};case"SET_SECRETS":return{...a,secrets:s.secrets};case"SET_DB_USER":return{...a,dbUser:s.user};case"SET_WHISPER_MODEL":return{...a,whisperModel:s.model};case"SET_WHISPER_BACKEND":return{...a,whisperBackend:s.backend};case"SET_LLM_INTERFACE":return{...a,llmInterface:s.interfaceId};case"SET_DEPLOYMENT_MODE":return{...a,deploymentMode:s.mode};case"SET_DEPLOYMENT_TARGET":return{...a,deploymentTarget:s.target};case"SET_REMOTE_LLM_URL":return{...a,remoteLlmUrl:s.url};case"SET_REMOTE_WHISPER_URL":return{...a,remoteWhisperUrl:s.url};case"SET_PLATFORM":return{...a,platform:s.platform};case"SET_HARDWARE":return{...a,hardware:s.hardware,platform:s.hardware.platform};case"SET_RELAY_ENABLED":return{...a,relayEnabled:s.enabled};case"SET_INSTALL_RUNNING":return{...a,installRunning:s.running};case"SET_INSTALL_COMPLETE":return{...a,installRunning:!1,installComplete:!0};case"SET_NATIVE_SERVICES":return{...a,nativeServices:s.services};case"TOGGLE_NATIVE_SERVICE":{if(s.enabled){const o=a.nativeServices.includes(s.serviceId)?a.nativeServices:[...a.nativeServices,s.serviceId];return{...a,nativeServices:o}}return{...a,nativeServices:a.nativeServices.filter(o=>o!==s.serviceId)}}default:return a}}const Eg=N.createContext(null);function X4({children:a}){const[s,o]=N.useReducer(Y4,V4);return l.jsx(Eg.Provider,{value:{state:s,dispatch:o},children:a})}function fr(){const a=N.useContext(Eg);if(!a)throw new Error("useWizard must be used within a WizardProvider");return a}function K4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(null),[d,f]=N.useState(!0),[m,v]=N.useState(!1);function g(){f(!0),v(!1),Xd().then(y=>{i(y);const x=y.reason==="docker_not_found";v(x),s(x?{type:"SET_INSTALL_RUNNING",running:!0}:{type:"SET_INSTALL_RUNNING",running:!1})}).catch(()=>{i({configured:!1,reason:"error"}),v(!0),s({type:"SET_INSTALL_RUNNING",running:!0})}).finally(()=>f(!1))}N.useEffect(()=>{g()},[]);const h=o&&o.reason!=="docker_not_found";return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Let's get your personal voice assistant up and running. This wizard will guide you through selecting services, configuring hardware, and starting everything up."})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsxs("div",{className:"flex items-center gap-3",children:[d?l.jsx(Ct,{size:20,className:"animate-spin text-[var(--color-primary)]"}):h?l.jsx(pt,{size:20,className:"text-green-500"}):l.jsx(Bd,{size:20,className:"text-red-500"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:d?"Checking Docker...":h?"Docker is running":"Docker not found"}),!d&&!h&&l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("p",{className:"text-xs text-red-400",children:"Docker is required to run Jarvis services."}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Install"," ",l.jsx("a",{href:"https://www.docker.com/products/docker-desktop/",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-primary)] underline hover:no-underline",children:"Docker Desktop"})," ","for your platform, start it, then click Retry."]})]})]}),m&&!d&&l.jsxs("button",{type:"button",onClick:g,className:"flex items-center gap-1 rounded-md border border-[var(--color-border)] px-2 py-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[l.jsx(yi,{size:12}),"Retry"]})]})}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-2 block text-sm font-medium text-[var(--color-text)]",children:"Deployment Mode"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_DEPLOYMENT_MODE",mode:"local"}),className:ae("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",a.deploymentMode==="local"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[l.jsx(yS,{size:24,className:"text-[var(--color-primary)]"}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Local"}),l.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"Everything on this machine"})]}),l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"}),className:ae("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",a.deploymentMode==="remote-llm"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[l.jsx(Vd,{size:24,className:"text-[var(--color-primary)]"}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM"}),l.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"LLM on separate GPU machine"})]})]})]})]})}const Zo=[{label:"None / CPU only",gpu:null,gpuType:"none",vramMb:null,backends:["gguf"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4090 (24 GB)",gpu:"NVIDIA RTX 4090",gpuType:"nvidia",vramMb:24576,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4080 (16 GB)",gpu:"NVIDIA RTX 4080",gpuType:"nvidia",vramMb:16384,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4070 Ti (12 GB)",gpu:"NVIDIA RTX 4070 Ti",gpuType:"nvidia",vramMb:12288,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3090 (24 GB)",gpu:"NVIDIA RTX 3090",gpuType:"nvidia",vramMb:24576,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3080 (10 GB)",gpu:"NVIDIA RTX 3080",gpuType:"nvidia",vramMb:10240,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3070 (8 GB)",gpu:"NVIDIA RTX 3070",gpuType:"nvidia",vramMb:8192,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA A100 (80 GB)",gpu:"NVIDIA A100",gpuType:"nvidia",vramMb:81920,backends:["gguf","vllm"],defaultBackend:"vllm"},{label:"NVIDIA A100 (40 GB)",gpu:"NVIDIA A100",gpuType:"nvidia",vramMb:40960,backends:["gguf","vllm"],defaultBackend:"vllm"},{label:"NVIDIA Tesla T4 (16 GB)",gpu:"NVIDIA Tesla T4",gpuType:"nvidia",vramMb:16384,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"AMD RX 9070 XT — Vulkan (16 GB)",gpu:"AMD RX 9070 XT",gpuType:"amd",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 — Vulkan (12 GB)",gpu:"AMD RX 9070",gpuType:"amd",vramMb:12288,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XTX — Vulkan (24 GB)",gpu:"AMD RX 7900 XTX",gpuType:"amd",vramMb:24576,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XT — Vulkan (20 GB)",gpu:"AMD RX 7900 XT",gpuType:"amd",vramMb:20480,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7800 XT — Vulkan (16 GB)",gpu:"AMD RX 7800 XT",gpuType:"amd",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7600 — Vulkan (8 GB)",gpu:"AMD RX 7600",gpuType:"amd",vramMb:8192,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 XT — ROCm (16 GB)",gpu:"AMD RX 9070 XT",gpuType:"amd-rocm",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 — ROCm (12 GB)",gpu:"AMD RX 9070",gpuType:"amd-rocm",vramMb:12288,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XTX — ROCm (24 GB)",gpu:"AMD RX 7900 XTX",gpuType:"amd-rocm",vramMb:24576,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XT — ROCm (20 GB)",gpu:"AMD RX 7900 XT",gpuType:"amd-rocm",vramMb:20480,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7800 XT — ROCm (16 GB)",gpu:"AMD RX 7800 XT",gpuType:"amd-rocm",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"Apple M4 Max (128 GB unified)",gpu:"Apple M4 Max",gpuType:"apple",vramMb:131072,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Max (64 GB unified)",gpu:"Apple M4 Max",gpuType:"apple",vramMb:65536,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Pro (48 GB unified)",gpu:"Apple M4 Pro",gpuType:"apple",vramMb:49152,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Pro (24 GB unified)",gpu:"Apple M4 Pro",gpuType:"apple",vramMb:24576,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M2 Max (32 GB unified)",gpu:"Apple M2 Max",gpuType:"apple",vramMb:32768,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M2 Pro (16 GB unified)",gpu:"Apple M2 Pro",gpuType:"apple",vramMb:16384,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M1 (16 GB unified)",gpu:"Apple M1",gpuType:"apple",vramMb:16384,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M1 (8 GB unified)",gpu:"Apple M1",gpuType:"apple",vramMb:8192,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Other (enter VRAM manually)",gpu:"Other",gpuType:"none",vramMb:null,backends:["gguf"],defaultBackend:"gguf"}];function $4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(!a.hardware),[d,f]=N.useState(!1),[m,v]=N.useState(0),[g,h]=N.useState("");N.useEffect(()=>{a.hardware||ME().then(j=>{s({type:"SET_HARDWARE",hardware:j}),j.recommendedBackend==="remote"&&a.deploymentMode==="local"&&s({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"})}).catch(()=>{}).finally(()=>i(!1))},[]);function y(j,M){const w=Zo[j];if(!a.hardware)return;const E=w.gpu==="Other"?(parseInt(M??g,10)||0)*1024:w.vramMb,_={...a.hardware,gpuName:w.gpu,gpuVramMb:E||null,gpuType:w.gpuType,recommendedBackends:[...w.backends],recommendedBackend:w.defaultBackend};s({type:"SET_HARDWARE",hardware:_})}const x=a.hardware;return o?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"}),l.jsx("p",{className:"mt-3 text-sm text-[var(--color-text-muted)]",children:"Detecting hardware..."})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Hardware Detection"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"We detected the following hardware. This determines which LLM backend to use."})]}),x&&l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(On,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"Platform"})]}),l.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[x.platform==="darwin"?"macOS":"Linux"," (",x.arch,")"]})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(Gd,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"Memory"})]}),l.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[x.totalMemoryGb," GB RAM"]})]}),l.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(On,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"GPU"})]}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:x.gpuName??"No GPU detected"}),x.gpuVramMb!=null&&x.gpuVramMb>0&&l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[Math.round(x.gpuVramMb/1024)," GB VRAM"]})]}),l.jsx("button",{type:"button",onClick:()=>f(!d),className:"text-xs font-medium text-[var(--color-primary)] hover:underline",children:d?"Cancel":"Override"})]}),d&&l.jsxs("div",{className:"mt-3 space-y-3 border-t border-[var(--color-border)] pt-3",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"gpu-select",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Select GPU"}),l.jsx("select",{id:"gpu-select",value:m,onChange:j=>{const M=parseInt(j.target.value,10);v(M),Zo[M].gpu!=="Other"&&(y(M),f(!1))},className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]"),children:Zo.map((j,M)=>l.jsx("option",{value:M,children:j.label},`${j.label}-${M}`))})]}),Zo[m].gpu==="Other"&&l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{htmlFor:"custom-vram",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"VRAM (GB)"}),l.jsx("input",{id:"custom-vram",type:"number",min:1,max:512,value:g,onChange:j=>h(j.target.value),placeholder:"e.g. 24",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsx("button",{type:"button",disabled:!g||parseInt(g,10)<=0,onClick:()=>{y(m,g),f(!1)},className:ae("rounded-lg px-4 py-2 text-sm font-medium","bg-[var(--color-primary)] text-white","disabled:cursor-not-allowed disabled:opacity-50"),children:"Apply"})]})]})]}),l.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Recommended: ",l.jsx("span",{className:"text-[var(--color-primary)]",children:x.recommendedBackend.toUpperCase()})]}),x.recommendedBackends.length>1&&l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["Available backends: ",x.recommendedBackends.join(", ")]})]})]}),a.deploymentMode==="remote-llm"&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote Service URLs"}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"remote-llm",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"LLM Proxy URL"}),l.jsx("input",{id:"remote-llm",type:"url",value:a.remoteLlmUrl,onChange:j=>s({type:"SET_REMOTE_LLM_URL",url:j.target.value}),placeholder:"http://192.168.1.100:7704",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"remote-whisper",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Whisper URL (optional)"}),l.jsx("input",{id:"remote-whisper",type:"url",value:a.remoteWhisperUrl,onChange:j=>s({type:"SET_REMOTE_WHISPER_URL",url:j.target.value}),placeholder:"http://192.168.1.100:7706",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]})]})]})}function Z4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(null),[d,f]=N.useState(!0);if(N.useEffect(()=>{Promise.all([bg(),AE()]).then(([h,y])=>{if(i(h),a.enabledModules.length===0&&s({type:"SET_ENABLED_MODULES",modules:y.enabledModules}),a.platform==="darwin"&&a.nativeServices.length===0){const x=h.services.filter(j=>j.nativeCapable).map(j=>j.id);x.length>0&&s({type:"SET_NATIVE_SERVICES",services:x})}}).catch(()=>{}).finally(()=>f(!1))},[]),d||!o)return l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const{core:m,recommended:v,optional:g}=J4(o.services);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Select Services"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Core services are always included. Toggle recommended and optional services.",a.platform==="darwin"&&l.jsxs(l.Fragment,{children:[" Services marked ",l.jsx("em",{children:"Native"})," can run as macOS LaunchAgents to use the Apple GPU."]})]})]}),l.jsx(Pu,{title:"Core",subtitle:"Always included",services:m,enabled:m.map(h=>h.id),nativeServices:a.nativeServices,platform:a.platform,locked:!0}),l.jsx(Pu,{title:"Recommended",subtitle:"Enabled by default",services:v,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(h,y)=>s({type:"TOGGLE_MODULE",serviceId:h,enabled:y}),onToggleNative:(h,y)=>s({type:"TOGGLE_NATIVE_SERVICE",serviceId:h,enabled:y})}),g.length>0&&l.jsx(Pu,{title:"Optional",subtitle:"Off by default",services:g,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(h,y)=>s({type:"TOGGLE_MODULE",serviceId:h,enabled:y}),onToggleNative:(h,y)=>s({type:"TOGGLE_NATIVE_SERVICE",serviceId:h,enabled:y})}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Integrations"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Cloud services"})]}),l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_RELAY_ENABLED",enabled:!a.relayEnabled}),className:ae("flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors",a.relayEnabled?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)] hover:border-[var(--color-primary)]/30"),children:[a.relayEnabled?l.jsx(pt,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),l.jsx(tS,{size:12,className:"text-[var(--color-text-muted)]"})]}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]})]})]})}function J4(a){return{core:a.filter(s=>s.category==="core"),recommended:a.filter(s=>s.category==="recommended"),optional:a.filter(s=>s.category==="optional")}}function Pu({title:a,subtitle:s,services:o,enabled:i,nativeServices:d,locked:f,onToggle:m,onToggleNative:v,platform:g}){return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:a}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:s})]}),l.jsx("div",{className:"space-y-1",children:o.map(h=>{const y=i.includes(h.id),x=h.nativeCapable&&g==="darwin"&&y,j=d.includes(h.id);return l.jsxs("div",{className:ae("rounded-lg border transition-colors",y?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)]",!f&&!y&&"hover:border-[var(--color-primary)]/30"),children:[l.jsxs("button",{type:"button",disabled:f,onClick:()=>m?.(h.id,!y),className:ae("flex w-full items-center gap-3 px-3 py-2.5 text-left",f&&"cursor-default"),children:[f?l.jsx(gi,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}):y?l.jsx(pt,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:h.name}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",h.port]}),h.nativeCapable&&g==="darwin"&&l.jsx("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-500",children:"Native"})]}),l.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:h.description})]})]}),x&&l.jsxs("button",{type:"button",onClick:()=>v?.(h.id,!j),className:ae("flex w-full items-center gap-2 border-t border-[var(--color-border)]/50 px-3 py-2 text-left text-xs","hover:bg-[var(--color-surface-alt)] transition-colors"),children:[l.jsx(On,{size:12,className:j?"text-amber-500":"text-[var(--color-text-muted)]"}),l.jsx("span",{className:j?"text-[var(--color-text)]":"text-[var(--color-text-muted)]",children:"Run natively via LaunchAgent"}),l.jsx("span",{className:"ml-auto text-[var(--color-text-muted)]",children:j?"On (uses Apple GPU)":"Off (runs in Docker)"})]})]},h.id)})})]})}function P4(){const{state:a}=fr(),[s,o]=N.useState(null);if(N.useEffect(()=>{bg().then(o).catch(()=>{})},[]),!s)return l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const i=s.services.filter(x=>x.category==="core"),d=s.services.filter(x=>x.category!=="core"&&a.enabledModules.includes(x.id)),f=[...i,...d],m=new Map;for(const x of f){const j=a.portOverrides[x.id]??x.port,M=m.get(j)??[];m.set(j,[...M,x.name])}const v=[...m.entries()].filter(([,x])=>x.length>1),g=f.filter(x=>x.database).length,h=f.filter(x=>a.nativeServices.includes(x.id)),y=f.filter(x=>!a.nativeServices.includes(x.id));return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Review Configuration"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Review your selections before installing."})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsx(Iu,{label:"Docker Services",value:y.length}),l.jsx(Iu,{label:"Native Services",value:h.length}),l.jsx(Iu,{label:"Databases",value:g})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Deployment Mode"}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:a.deploymentMode==="local"?"Local (all services on this machine)":"Remote LLM"}),a.deploymentMode==="remote-llm"&&a.remoteLlmUrl&&l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["LLM: ",a.remoteLlmUrl]})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsxs("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:["Services (",f.length,")"]})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:f.map(x=>l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pt,{size:14,className:"text-green-500"}),l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:x.name})]}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",a.portOverrides[x.id]??x.port]})]},x.id))})]}),a.relayEnabled&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Jarvis Relay"}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:"Enabled"}),l.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:"https://relay.jarvisautomation.io"})]}),v.length>0&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ra,{size:16,className:"text-amber-500"}),l.jsx("span",{className:"text-sm font-medium text-amber-500",children:"Port Conflicts"})]}),v.map(([x,j])=>l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Port ",x,": ",j.join(", ")]},x))]})]})}function Iu({label:a,value:s}){return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-3 text-center",children:[l.jsx("p",{className:"text-2xl font-bold text-[var(--color-primary)]",children:s}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a})]})}function Wu(){const[a,s]=N.useState({lines:[],running:!1,done:!1,exitCode:null,error:null,redirect:null}),o=N.useRef(null),i=N.useCallback((f,m)=>(o.current?.close(),s({lines:[],running:!0,done:!1,exitCode:null,error:null,redirect:null}),new Promise((v,g)=>{const h=new EventSource(f);o.current=h,h.onmessage=y=>{try{const x=JSON.parse(y.data);if(m&&m(x),"done"in x){if(s(j=>({...j,running:!1,done:!0,exitCode:x.code,redirect:x.redirect??null})),h.close(),x.code===0)v(x.code);else{const j=x.error?String(x.error):`Process exited with code ${x.code}`;g(new Error(j))}return}if("stream"in x&&"text"in x){const j={stream:x.stream,text:x.text,timestamp:Date.now()};s(M=>({...M,lines:[...M.lines,j]}))}}catch{}},h.onerror=()=>{const y=o.current===null;s(x=>({...x,running:!1,error:x.done?null:"Connection lost"})),h.close(),y||g(new Error("Connection lost"))}})),[]),d=N.useCallback(()=>{o.current?.close(),o.current=null,s(f=>({...f,running:!1}))},[]);return{...a,run:i,stop:d}}function ed({lines:a,running:s,title:o,className:i}){const d=N.useRef(null),f=N.useRef(!0);N.useEffect(()=>{const v=d.current;!v||!f.current||(v.scrollTop=v.scrollHeight)},[a]);function m(){const v=d.current;if(!v)return;const g=v.scrollHeight-v.scrollTop-v.clientHeight;f.current=g<50}return l.jsxs("div",{className:ae("flex flex-col rounded-lg border border-[var(--color-border)] overflow-hidden",i),children:[o&&l.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2",children:[l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:o}),s&&l.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-green-500"})]}),l.jsxs("div",{ref:d,onScroll:m,className:"h-64 overflow-y-auto bg-[#0d1117] p-3 font-mono text-xs leading-5",children:[a.length===0&&!s&&l.jsx("span",{className:"text-gray-500",children:"Waiting for output..."}),a.map((v,g)=>l.jsx("div",{className:ae("whitespace-pre-wrap break-all",v.stream==="stderr"?"text-yellow-400":"text-gray-300"),children:v.text},g)),s&&l.jsx("span",{className:"inline-block h-4 w-1.5 animate-pulse bg-gray-400"})]})]})}function I4(){const{state:a,dispatch:s}=fr(),o=Wu(),i=Wu(),d=Wu(),[f,m]=N.useState("idle"),[v,g]=N.useState(null),[h,y]=N.useState(null),[x,j]=N.useState({}),[M,w]=N.useState({}),[E,_]=N.useState(null),[O,k]=N.useState(null),[G,$]=N.useState(null),[W,te]=N.useState({});N.useEffect(()=>{const ne=i.redirect;if(f!=="done"||!ne||a.platform==="darwin")return;k(5);const C=setInterval(()=>{k(X=>X===null||X<=1?(clearInterval(C),window.location.href=ne,0):X-1)},1e3);return()=>clearInterval(C)},[f,i.redirect]);const H=N.useCallback(async()=>{m("preflight"),y(null),g(null);try{const ne=await kE(a.enabledModules);return y(ne),ne.canProceed?!0:(g("Pre-flight checks failed. Fix the issues above and retry."),m("error"),_("preflight"),!1)}catch(ne){return g(`Pre-flight check failed: ${ne instanceof Error?ne.message:String(ne)}`),m("error"),_("preflight"),!1}},[a.enabledModules]);async function z(){if(a.nativeServices.length!==0){m("native");for(const ne of a.nativeServices){$(ne);try{await d.run(`/api/native-services/${ne}/install`),te(C=>({...C,[ne]:{ok:!0}}))}catch(C){const X=C instanceof Error?C.message:String(C);te(K=>({...K,[ne]:{ok:!1,error:X}}))}}$(null)}}async function oe(){g(null),j({}),_(null),te({}),s({type:"SET_INSTALL_RUNNING",running:!0});try{if(!await H()){s({type:"SET_INSTALL_RUNNING",running:!1});return}m("generating"),await qx(a),m("pulling"),await o.run("/api/install/pull"),m("starting"),await i.run("/api/install/start",C=>{if(C.phase==="health"&&typeof C.service=="string"&&j(X=>({...X,[C.service]:{healthy:C.healthy,error:C.error}})),C.serviceHealth&&typeof C.serviceHealth=="object"){const X=C.serviceHealth;j(K=>({...K,...X}))}}),await z(),m("done"),s({type:"SET_INSTALL_COMPLETE"})}catch(ne){g(ne instanceof Error?ne.message:String(ne)),m("error"),_(f),s({type:"SET_INSTALL_RUNNING",running:!1})}}async function be(){if(E==="preflight"){if(g(null),s({type:"SET_INSTALL_RUNNING",running:!0}),!await H()){s({type:"SET_INSTALL_RUNNING",running:!1});return}try{m("generating"),await qx(a),m("pulling"),await o.run("/api/install/pull"),m("starting"),await i.run("/api/install/start",C=>{if(C.phase==="health"&&typeof C.service=="string"&&j(X=>({...X,[C.service]:{healthy:C.healthy,error:C.error}})),C.serviceHealth&&typeof C.serviceHealth=="object"){const X=C.serviceHealth;j(K=>({...K,...X}))}}),await z(),m("done"),s({type:"SET_INSTALL_COMPLETE"})}catch(C){g(C instanceof Error?C.message:String(C)),m("error"),s({type:"SET_INSTALL_RUNNING",running:!1})}}else oe()}async function se(ne){try{const C=await fetch(`/api/containers/${ne}/logs`);if(C.ok){const X=await C.text();w(K=>({...K,[ne]:X}))}else w(X=>({...X,[ne]:`Failed to fetch logs: HTTP ${C.status}`}))}catch(C){w(X=>({...X,[ne]:`Failed to fetch logs: ${C instanceof Error?C.message:String(C)}`}))}}const ie=[{key:"preflight",label:"Pre-flight checks"},{key:"generating",label:"Generate configuration"},{key:"pulling",label:"Pull Docker images"},{key:"starting",label:"Start services"},...a.nativeServices.length>0?[{key:"native",label:`Install ${a.nativeServices.length} native service${a.nativeServices.length===1?"":"s"}`}]:[]],Re=ie.map(ne=>ne.key).indexOf(f);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Install"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:f==="idle"?"Ready to install. This will pull Docker images and start all services.":f==="done"?i.redirect&&a.platform!=="darwin"?`Installation complete! Redirecting to your admin dashboard in ${O??"..."}s...`:"Installation complete! Click Next to create your account and choose your models.":f==="error"?"Installation encountered an error.":"Installing..."})]}),h&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Pre-flight Checks"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:h.checks.map(ne=>l.jsx("div",{className:"flex items-center justify-between px-3 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[ne.status==="pass"?l.jsx(pt,{size:14,className:"text-green-500"}):ne.status==="warn"?l.jsx(ra,{size:14,className:"text-amber-500"}):l.jsx(xl,{size:14,className:"text-red-500"}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ne.name}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:ne.message}),ne.details&&ne.status!=="pass"&&l.jsx("p",{className:"text-xs text-[var(--color-text-muted)] opacity-60",children:ne.details})]})]})},ne.name))})]}),l.jsx("div",{className:"space-y-2",children:ie.map((ne,C)=>{const X=ne.key===f,K=Re>C||f==="done",ve=f==="error"&&ne.key===E;return l.jsxs("div",{className:"flex items-center gap-3",children:[K?l.jsx(pt,{size:18,className:"text-green-500"}):ve?l.jsx(xl,{size:18,className:"text-red-500"}):X?l.jsx(Ct,{size:18,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-[18px] w-[18px] rounded-full border-2 border-[var(--color-border)]"}),l.jsx("span",{className:ae("text-sm",K?"text-green-500":X?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:ne.label})]},ne.key)})}),(f==="starting"||f==="done"||f==="error")&&Object.keys(x).length>0&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Service Status"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:Object.entries(x).map(([ne,C])=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ne}),l.jsxs("div",{className:"flex items-center gap-2",children:[!C.healthy&&l.jsxs("button",{type:"button",onClick:()=>se(ne),className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[l.jsx(tg,{size:12}),"Logs"]}),C.healthy?l.jsx(pt,{size:14,className:"text-green-500"}):l.jsx(xl,{size:14,className:"text-red-500"})]})]}),C.error&&l.jsx("p",{className:"px-3 pb-2 text-xs text-red-400",children:C.error}),M[ne]&&l.jsx("div",{className:"mx-3 mb-2 max-h-32 overflow-auto rounded bg-[var(--color-background)] p-2 text-xs font-mono text-[var(--color-text-muted)]",children:l.jsx("pre",{className:"whitespace-pre-wrap",children:M[ne]})})]},ne))})]}),(o.lines.length>0||o.running)&&l.jsx(ed,{lines:o.lines,running:o.running,title:"docker compose pull"}),(i.lines.length>0||i.running)&&l.jsx(ed,{lines:i.lines,running:i.running,title:"docker compose up -d"}),(f==="native"||Object.keys(W).length>0)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Native Services (LaunchAgents)"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:a.nativeServices.map(ne=>{const C=W[ne],X=G===ne&&f==="native";return l.jsxs("div",{className:"px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ne}),C?.ok?l.jsx(pt,{size:14,className:"text-green-500"}):C?l.jsx(xl,{size:14,className:"text-red-500"}):X?l.jsx(Ct,{size:14,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-3 w-3 rounded-full border border-[var(--color-border)]"})]}),C?.error&&l.jsx("p",{className:"mt-1 text-xs text-red-400",children:C.error})]},ne)})})]}),(d.lines.length>0||d.running)&&l.jsx(ed,{lines:d.lines,running:d.running,title:G?`deploy-launchd.sh (${G})`:"deploy-launchd.sh"}),v&&l.jsx("div",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:v}),(f==="idle"||f==="error")&&l.jsxs("button",{type:"button",onClick:f==="error"?be:oe,className:ae("flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-3 font-medium text-white","hover:opacity-90 transition-opacity"),children:[f==="error"?l.jsx(yi,{size:18}):l.jsx(ag,{size:18}),f==="error"?"Retry Installation":"Start Installation"]})]})}const W4="jarvis-llm-proxy-api";function e3(){const{state:a,dispatch:s}=fr(),o=yg(),i=wg(),d=jg(),f=a.platform==="darwin",[m,v]=N.useState("select"),[g,h]=N.useState(null),[y,x]=N.useState("GGUF"),[j,M]=N.useState(""),[w,E]=N.useState(!0),[_,O]=N.useState(null);if(a.deploymentMode==="remote-llm")return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Your LLM is configured to use a remote server."})]}),l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(pt,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a.remoteLlmUrl})]})]})]});const k=z=>{h(z),O(null),z.gated&&!j.trim()?v("token"):$(z,j.trim())},G=()=>{if(!j.trim()){O("HuggingFace token is required for gated models");return}g&&$(g,j)},$=async(z,oe)=>{O(null),v("downloading");const be=y==="GGUF"?z.hfRepoGguf:z.hfRepoVllm,se=y==="GGUF"?z.ggufFilename:void 0;try{await i.mutateAsync({repo:be,filename:se,token:oe||void 0})}catch(Ee){O(`Download failed: ${Ee.message}`),v("select");return}if(await W(z)){if(w){v("whisper");try{await y4(!0)}catch(Ee){console.warn("[models] whisper auto-download setup failed:",Ee)}}v("done")}},W=async z=>{v("configuring");const be={"model.live.name":y==="GGUF"?`.models/${z.ggufFilename}`:`.models/${z.hfRepoVllm.split("/").pop()}`,"model.live.backend":y,"model.live.chat_format":z.chatFormat,"model.live.context_window":z.contextWindow,"llm.interface":z.promptProvider};y==="GGUF"&&(be["inference.gguf.n_gpu_layers"]=-1),y==="VLLM"&&z.quantization&&(be["inference.vllm.quantization"]=z.quantization);try{if(await o.mutateAsync(be),f)try{await d.mutateAsync(W4)}catch(se){console.warn("[models] llm-proxy restart failed (KeepAlive will retry):",se)}return s({type:"SET_LLM_INTERFACE",interfaceId:z.promptProvider}),!0}catch(se){return O(`Configuration failed: ${se.message}`),v("select"),!1}},te=a.hardware?.gpuVramMb,H=te?ss.filter(z=>z.vramMb<=te):ss;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:m==="done"?"Models configured. Services are restarting to load them.":"Choose a language model, and optionally fetch the speech-to-text model."})]}),_&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-500",children:[l.jsx(ra,{size:16,className:"mt-0.5 shrink-0"}),_]}),g&&l.jsxs("button",{type:"button",onClick:()=>$(g,j),className:ae("flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors"),children:[l.jsx(yi,{size:14}),"Retry"]})]}),m==="select"&&l.jsxs(l.Fragment,{children:[!f&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Backend"}),l.jsx("div",{className:"flex gap-2",children:["GGUF","VLLM"].map(z=>l.jsx("button",{type:"button",onClick:()=>x(z),className:ae("rounded-md px-3 py-1 text-xs font-medium transition-colors",y===z?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:z==="VLLM"?"vLLM":z},z))})]}),l.jsxs("label",{className:ae("flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors",w?"border-[var(--color-primary)] bg-[var(--color-primary)]/5":"border-[var(--color-border)]"),children:[l.jsx("input",{type:"checkbox",checked:w,onChange:z=>E(z.target.checked),className:"mt-0.5"}),l.jsxs("span",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[l.jsx(Mx,{size:15,className:"shrink-0 text-[var(--color-primary)]"}),l.jsxs("span",{children:["Auto-download the speech-to-text model",l.jsxs("span",{className:"block text-xs text-[var(--color-text-muted)]",children:["Whisper ",l.jsx("code",{children:"base.en"})," (~150 MB, no token needed). Required for voice."]})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"hf-token",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"HuggingFace Token (optional — speeds up downloads, required for gated models)"}),l.jsx("input",{id:"hf-token",type:"password",value:j,onChange:z=>M(z.target.value),placeholder:"hf_...",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Language model"}),H.map(z=>l.jsxs("button",{type:"button",onClick:()=>k(z),className:ae("flex w-full items-center justify-between rounded-lg border border-[var(--color-border)] p-3 text-left transition-colors","hover:border-[var(--color-primary)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:z.displayName}),z.gated&&l.jsxs("span",{className:"flex items-center gap-0.5 rounded bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(gi,{size:10}),"Gated"]})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[z.promptProvider," · ",z.contextWindow.toLocaleString()," ctx"]})]}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["~",y==="GGUF"?z.sizeGguf:z.sizeVllm]})]},z.id)),H.length===0&&l.jsxs("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:["No models fit your available memory (",te?Math.round(te/1024)+" GB":"unknown",")."]}),te&&H.length<ss.length&&l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Showing ",H.length," of ",ss.length," models that fit your ",Math.round(te/1024)," GB."]})]})]}),m==="token"&&g&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[l.jsx("strong",{children:g.displayName})," is a gated model. Accept the license on HuggingFace and paste your access token below."]}),l.jsx("input",{type:"password",value:j,onChange:z=>M(z.target.value),placeholder:"hf_...",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")}),l.jsxs("div",{className:"flex justify-between",children:[l.jsx("button",{type:"button",onClick:()=>{v("select"),O(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),l.jsx("button",{type:"button",onClick:G,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Download"})]})]}),m==="whisper"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(Mx,{className:"mb-4 animate-pulse text-[var(--color-primary)]",size:32}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Enabling speech-to-text model download..."}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Whisper will fetch ggml-base.en on restart"})]}),m==="downloading"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(za,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Downloading ",g?.displayName,"..."]}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["~",y==="GGUF"?g?.sizeGguf:g?.sizeVllm," · This may take several minutes"]})]}),m==="configuring"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(Ct,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Configuring model and prompt provider..."})]}),m==="done"&&g&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(pt,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:[g.displayName," configured"]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Backend: ",y," · Prompt provider: ",g.promptProvider,w&&" · Whisper auto-download enabled"]})]})]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["The LLM proxy is restarting with the new model",w&&", and whisper is fetching its model",". This may take a few minutes to finish loading. Command Center will use the"," ",l.jsx("strong",{children:g.promptProvider})," prompt provider."]})]})]})}function t3(){const[a,s]=N.useState(""),[o,i]=N.useState(""),[d,f]=N.useState(""),[m,v]=N.useState(""),[g,h]=N.useState(!1),[y,x]=N.useState(!1),[j,M]=N.useState(null),w=o===d,E=a&&o&&d&&m&&w&&!g;async function _(){if(E){h(!0),M(null);try{const k=await Pv(a,o,m);rs(k.access_token),localStorage.setItem("access_token",k.access_token),localStorage.setItem("refresh_token",k.refresh_token),x(!0)}catch(k){const G=k?.response?.data?.error??(k instanceof Error?k.message:"Failed to create account");M(G)}finally{h(!1)}}}if(y)return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Account Created"})}),l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(pt,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Superuser account created"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a})]})]}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:`You're logged in. Click "Next" to configure your LLM model.`})]});const O=ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Create Account"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Create your superuser account. This will be the admin for your Jarvis instance."})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"display-name",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Display Name"}),l.jsx("input",{id:"display-name",type:"text",value:m,onChange:k=>v(k.target.value),className:O,placeholder:"Alex"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",value:a,onChange:k=>s(k.target.value),className:O,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",value:o,onChange:k=>i(k.target.value),className:O,placeholder:"Choose a strong password"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),l.jsx("input",{id:"confirm-password",type:"password",value:d,onChange:k=>f(k.target.value),className:ae(O,d&&!w&&"ring-2 ring-red-500"),placeholder:"Confirm password"}),d&&!w&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Passwords don't match"})]})]}),j&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(Bd,{size:14,className:"text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm text-red-500",children:j})]}),l.jsxs("button",{type:"button",onClick:_,disabled:!E,className:ae("flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors","disabled:opacity-50"),children:[l.jsx(yi,{size:14}),"Retry"]})]}),!j&&l.jsx("button",{type:"button",onClick:_,disabled:!E,className:ae("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50 transition-opacity"),children:g?"Creating...":"Create Superuser Account"})]})}const Jo=[{label:"Welcome",component:K4},{label:"Hardware",component:$4},{label:"Services",component:Z4},{label:"Review",component:P4},{label:"Install",component:I4},{label:"Account",component:t3},{label:"Models",component:e3}],a3=5;function n3({skipToAccount:a}){const{state:s,dispatch:o}=fr();N.useEffect(()=>{a&&o({type:"SET_STEP",step:a3})},[a,o]);const i=wa(),d=Jo[s.currentStep].component,f=s.currentStep===0,m=s.currentStep===Jo.length-1,h=s.currentStep===4&&!s.installComplete,y=s.installRunning||h;function x(){m?i("/login"):o({type:"NEXT_STEP"})}function j(){o({type:"PREV_STEP"})}return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)] p-4",children:l.jsxs("div",{className:"w-full max-w-2xl",children:[l.jsx("div",{className:"mb-6 flex items-center justify-center gap-1",children:Jo.map((M,w)=>l.jsxs("button",{type:"button",onClick:()=>!y&&o({type:"SET_STEP",step:w}),disabled:y,className:ae("flex items-center gap-1",y&&"cursor-not-allowed"),children:[l.jsx("div",{className:ae("flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium transition-colors",w===s.currentStep?"bg-[var(--color-primary)] text-white":w<s.currentStep?"bg-[var(--color-primary)]/20 text-[var(--color-primary)]":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:w+1}),l.jsx("span",{className:ae("hidden text-xs sm:inline",w===s.currentStep?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:M.label}),w<Jo.length-1&&l.jsx("div",{className:ae("mx-1 h-px w-4 sm:w-6",w<s.currentStep?"bg-[var(--color-primary)]/30":"bg-[var(--color-border)]")})]},M.label))}),l.jsx("div",{className:"rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-6 shadow-lg",children:l.jsx(d,{})}),l.jsxs("div",{className:"mt-4 flex justify-between",children:[l.jsx("button",{type:"button",onClick:j,disabled:f||y,className:ae("rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors","disabled:invisible"),children:"Back"}),l.jsx("button",{type:"button",onClick:x,disabled:y,className:ae("rounded-lg bg-[var(--color-primary)] px-6 py-2 text-sm font-medium text-white","hover:opacity-90 transition-opacity","disabled:opacity-50 disabled:cursor-not-allowed"),children:m?"Finish":"Next"})]})]})})}function r3({skipToAccount:a}){return l.jsx(X4,{children:l.jsx(n3,{skipToAccount:a})})}function s3(){const a=wa(),s=yg(),o=RE(),[i,d]=N.useState("select"),[f,m]=N.useState(null),[v,g]=N.useState("GGUF"),[h,y]=N.useState(""),[x,j]=N.useState(null),M=k=>{m(k),k.gated?d("token"):E(k,"")},w=()=>{if(!h.trim()){j("HuggingFace token is required for gated models");return}j(null),f&&E(f,h)},E=async(k,G)=>{d("download"),j(null);const $=v==="GGUF"?k.hfRepoGguf:k.hfRepoVllm,W=v==="GGUF"?k.ggufFilename:void 0;try{await o.mutateAsync({repo:$,filename:W,token:G||void 0}),_(k)}catch(te){j(`Download failed: ${te.message}`),d("select")}},_=async k=>{d("configure"),j(null);const $={"model.live.name":v==="GGUF"?`.models/${k.ggufFilename}`:`.models/${k.hfRepoVllm.split("/").pop()}`,"model.live.backend":v,"model.live.chat_format":k.chatFormat,"model.live.context_window":k.contextWindow};v==="GGUF"&&($["inference.gguf.n_gpu_layers"]=-1),v==="VLLM"&&k.quantization&&($["inference.vllm.quantization"]=k.quantization);try{await s.mutateAsync($),d("done"),Me.success("LLM configured successfully")}catch(W){j(`Configuration failed: ${W.message}`),d("select")}},O=()=>{a("/dashboard")};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-bg)] p-4",children:l.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:[l.jsxs("div",{className:"mb-8 text-center",children:[l.jsx(pd,{className:"mx-auto mb-3 text-[var(--color-primary)]",size:40}),l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"LLM Setup"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Configure a local language model for Jarvis"})]}),l.jsx("div",{className:"mb-8 flex items-center justify-center gap-2",children:["select","download","configure","done"].map((k,G)=>{const $=i==="token"?"select":i,W=["select","download","configure","done"];return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:ae("h-2 w-2 rounded-full",$===k?"bg-[var(--color-primary)]":W.indexOf($)>G?"bg-green-500":"bg-[var(--color-border)]")}),G<3&&l.jsx("div",{className:"h-px w-8 bg-[var(--color-border)]"})]},k)})}),x&&l.jsxs("div",{className:"mb-6 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-500",children:[l.jsx(ra,{size:16,className:"mt-0.5 shrink-0"}),x]}),i==="select"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Select a model"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>g("GGUF"),className:ae("rounded-md px-3 py-1 text-xs font-medium transition-colors",v==="GGUF"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"GGUF"}),l.jsx("button",{onClick:()=>g("VLLM"),className:ae("rounded-md px-3 py-1 text-xs font-medium transition-colors",v==="VLLM"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"vLLM"})]})]}),l.jsx("div",{className:"grid gap-3",children:ss.map(k=>l.jsxs("button",{onClick:()=>M(k),className:ae("flex items-center justify-between rounded-lg border border-[var(--color-border)] p-4 text-left transition-colors","hover:border-[var(--color-primary)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:k.displayName}),k.gated&&l.jsxs("span",{className:"flex items-center gap-1 rounded bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(gi,{size:10}),"Gated"]})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[k.quantization?`${k.quantization.toUpperCase()} 4-bit`:k.chatFormat," · ",k.contextWindow.toLocaleString()," ctx"]})]}),l.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["~",v==="GGUF"?k.sizeGguf:k.sizeVllm]})]},k.id))}),l.jsx("div",{className:"flex justify-end pt-2",children:l.jsx("button",{onClick:O,className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Skip for now"})})]}),i==="token"&&f&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Access Required"}),l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[l.jsx("strong",{children:f.displayName})," is a gated model. You need to:"]}),l.jsxs("ol",{className:"list-inside list-decimal space-y-1 text-sm text-[var(--color-text-muted)]",children:[l.jsx("li",{children:"Visit the model page on huggingface.co and accept the license agreement"}),l.jsx("li",{children:"Create an access token at huggingface.co/settings/tokens"}),l.jsx("li",{children:"Paste your token below"})]}),l.jsx("input",{type:"password",value:h,onChange:k=>y(k.target.value),placeholder:"hf_...",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")}),l.jsxs("div",{className:"flex justify-between",children:[l.jsx("button",{onClick:()=>{d("select"),j(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),l.jsx("button",{onClick:w,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Continue"})]})]}),i==="download"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(za,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Downloading model..."}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," ","(~",v==="GGUF"?f?.sizeGguf:f?.sizeVllm,")"]}),l.jsx("p",{className:"mt-4 text-xs text-[var(--color-text-muted)]",children:"This may take several minutes depending on your connection"})]}),i==="configure"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(ng,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Configuring..."}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Writing settings and restarting LLM proxy"})]}),i==="done"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(qj,{className:"mb-4 text-green-500",size:40}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"LLM Ready"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," configured on ",v]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"The model service is restarting. It may take a minute to load the model."}),l.jsx("button",{onClick:()=>a("/dashboard"),className:"mt-6 rounded-lg bg-[var(--color-primary)] px-6 py-2 text-sm text-white hover:opacity-90",children:"Go to Dashboard"})]}),(o.isPending||s.isPending)&&i!=="download"&&i!=="configure"&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:l.jsx(Ct,{className:"animate-spin text-white",size:32})})]})})}const l3=new J1;function o3(){const[a,s]=N.useState(!0),[o,i]=N.useState(!1),[d,f]=N.useState(!1);return N.useEffect(()=>{Xd().then(m=>{m.state==="deployed-needs-account"?(f(!0),i(!0)):i(!m.configured)}).catch(()=>{i(!1)}).finally(()=>s(!1))},[]),a?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-primary)] border-t-transparent"})}):l.jsxs(X0,{children:[l.jsx(mt,{path:"/setup",element:l.jsx(r3,{skipToAccount:d})}),l.jsx(mt,{path:"/login",element:l.jsx($w,{})}),l.jsx(mt,{path:"/llm-setup",element:l.jsx(s3,{})}),l.jsxs(mt,{element:l.jsx(Kw,{}),children:[l.jsx(mt,{path:"/dashboard",element:l.jsx(BE,{})}),l.jsx(mt,{path:"/settings",element:l.jsx(oE,{})}),l.jsx(mt,{path:"/services",element:l.jsx(SE,{})}),l.jsx(mt,{path:"/models",element:l.jsx(N4,{})}),l.jsx(mt,{path:"/quick-sets",element:l.jsx(k4,{})}),l.jsx(mt,{path:"/traces",element:l.jsx(B4,{})}),l.jsx(mt,{path:"/traces/:id",element:l.jsx(H4,{})}),l.jsx(mt,{path:"/update",element:l.jsx(M4,{})}),l.jsx(mt,{path:"/reconcile",element:l.jsx(O4,{})}),l.jsx(mt,{path:"/nodes",element:l.jsx(KE,{})}),l.jsx(mt,{path:"/users",element:l.jsx(n4,{})}),l.jsx(mt,{path:"/native-services",element:l.jsx(m4,{})}),l.jsx(mt,{path:"/",element:o?l.jsx(ri,{to:"/setup",replace:!0}):l.jsx(ri,{to:"/dashboard",replace:!0})}),l.jsx(mt,{path:"*",element:l.jsx(G4,{})})]})]})}function i3(){return l.jsx(L2,{children:l.jsx(P1,{client:l3,children:l.jsxs(bj,{children:[l.jsx(x1,{children:l.jsx(o3,{})}),l.jsx(D2,{position:"bottom-right",richColors:!0})]})})})}Yb.createRoot(document.getElementById("root")).render(l.jsx(N.StrictMode,{children:l.jsx(i3,{})}));
15
+ `):" "+Tx(m[0]):"as no adapter specified";throw new Ce("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return d}const Xv={getAdapter:cj,adapters:Dd};function Yu(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new El(null,a)}function _x(a){return Yu(a),a.headers=Zt.from(a.headers),a.data=Fu.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),Xv.getAdapter(a.adapter||wl.adapter,a)(a).then(function(i){return Yu(a),i.data=Fu.call(a,a.transformResponse,i),i.headers=Zt.from(i.headers),i},function(i){return Gv(i)||(Yu(a),i&&i.response&&(i.response.data=Fu.call(a,a.transformResponse,i.response),i.response.headers=Zt.from(i.response.headers))),Promise.reject(i)})}const Kv="1.13.4",xi={};["object","boolean","number","function","string","symbol"].forEach((a,s)=>{xi[a]=function(i){return typeof i===a||"a"+(s<1?"n ":" ")+a}});const Rx={};xi.transitional=function(s,o,i){function d(f,m){return"[Axios v"+Kv+"] Transitional option '"+f+"'"+m+(i?". "+i:"")}return(f,m,v)=>{if(s===!1)throw new Ce(d(m," has been removed"+(o?" in "+o:"")),Ce.ERR_DEPRECATED);return o&&!Rx[m]&&(Rx[m]=!0,console.warn(d(m," has been deprecated since v"+o+" and will be removed in the near future"))),s?s(f,m,v):!0}};xi.spelling=function(s){return(o,i)=>(console.warn(`${i} is likely a misspelling of ${s}`),!0)};function uj(a,s,o){if(typeof a!="object")throw new Ce("options must be an object",Ce.ERR_BAD_OPTION_VALUE);const i=Object.keys(a);let d=i.length;for(;d-- >0;){const f=i[d],m=s[f];if(m){const v=a[f],g=v===void 0||m(v,f,a);if(g!==!0)throw new Ce("option "+f+" must be "+g,Ce.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new Ce("Unknown option "+f,Ce.ERR_BAD_OPTION)}}const ti={assertOptions:uj,validators:xi},Oa=ti.validators;let ir=class{constructor(s){this.defaults=s||{},this.interceptors={request:new vx,response:new vx}}async request(s,o){try{return await this._request(s,o)}catch(i){if(i instanceof Error){let d={};Error.captureStackTrace?Error.captureStackTrace(d):d=new Error;const f=d.stack?d.stack.replace(/^.+\n/,""):"";try{i.stack?f&&!String(i.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(i.stack+=`
16
+ `+f):i.stack=f}catch{}}throw i}}_request(s,o){typeof s=="string"?(o=o||{},o.url=s):o=s||{},o=dr(this.defaults,o);const{transitional:i,paramsSerializer:d,headers:f}=o;i!==void 0&&ti.assertOptions(i,{silentJSONParsing:Oa.transitional(Oa.boolean),forcedJSONParsing:Oa.transitional(Oa.boolean),clarifyTimeoutError:Oa.transitional(Oa.boolean)},!1),d!=null&&(F.isFunction(d)?o.paramsSerializer={serialize:d}:ti.assertOptions(d,{encode:Oa.function,serialize:Oa.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),ti.assertOptions(o,{baseUrl:Oa.spelling("baseURL"),withXsrfToken:Oa.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let m=f&&F.merge(f.common,f[o.method]);f&&F.forEach(["delete","get","head","post","put","patch","common"],w=>{delete f[w]}),o.headers=Zt.concat(m,f);const v=[];let g=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(o)===!1||(g=g&&E.synchronous,v.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let y,x=0,j;if(!g){const w=[_x.bind(this),void 0];for(w.unshift(...v),w.push(...h),j=w.length,y=Promise.resolve(o);x<j;)y=y.then(w[x++],w[x++]);return y}j=v.length;let M=o;for(;x<j;){const w=v[x++],E=v[x++];try{M=w(M)}catch(_){E.call(this,_);break}}try{y=_x.call(this,M)}catch(w){return Promise.reject(w)}for(x=0,j=h.length;x<j;)y=y.then(h[x++],h[x++]);return y}getUri(s){s=dr(this.defaults,s);const o=Vv(s.baseURL,s.url,s.allowAbsoluteUrls);return Bv(o,s.params,s.paramsSerializer)}};F.forEach(["delete","get","head","options"],function(s){ir.prototype[s]=function(o,i){return this.request(dr(i||{},{method:s,url:o,data:(i||{}).data}))}});F.forEach(["post","put","patch"],function(s){function o(i){return function(f,m,v){return this.request(dr(v||{},{method:s,headers:i?{"Content-Type":"multipart/form-data"}:{},url:f,data:m}))}}ir.prototype[s]=o(),ir.prototype[s+"Form"]=o(!0)});let dj=class $v{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(f){o=f});const i=this;this.promise.then(d=>{if(!i._listeners)return;let f=i._listeners.length;for(;f-- >0;)i._listeners[f](d);i._listeners=null}),this.promise.then=d=>{let f;const m=new Promise(v=>{i.subscribe(v),f=v}).then(d);return m.cancel=function(){i.unsubscribe(f)},m},s(function(f,m,v){i.reason||(i.reason=new El(f,m,v),o(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const o=this._listeners.indexOf(s);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const s=new AbortController,o=i=>{s.abort(i)};return this.subscribe(o),s.signal.unsubscribe=()=>this.unsubscribe(o),s.signal}static source(){let s;return{token:new $v(function(d){s=d}),cancel:s}}};function fj(a){return function(o){return a.apply(null,o)}}function mj(a){return F.isObject(a)&&a.isAxiosError===!0}const md={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(md).forEach(([a,s])=>{md[s]=a});function Zv(a){const s=new ir(a),o=Tv(ir.prototype.request,s);return F.extend(o,ir.prototype,s,{allOwnKeys:!0}),F.extend(o,s,null,{allOwnKeys:!0}),o.create=function(d){return Zv(dr(a,d))},o}const nt=Zv(wl);nt.Axios=ir;nt.CanceledError=El;nt.CancelToken=dj;nt.isCancel=Gv;nt.VERSION=Kv;nt.toFormData=pi;nt.AxiosError=Ce;nt.Cancel=nt.CanceledError;nt.all=function(s){return Promise.all(s)};nt.spread=fj;nt.isAxiosError=mj;nt.mergeConfig=dr;nt.AxiosHeaders=Zt;nt.formToJSON=a=>Hv(F.isHTMLForm(a)?new FormData(a):a);nt.getAdapter=Xv.getAdapter;nt.HttpStatusCode=md;nt.default=nt;const{Axios:m3,AxiosError:h3,CanceledError:p3,isCancel:x3,CancelToken:v3,VERSION:g3,all:y3,Cancel:b3,isAxiosError:N3,spread:j3,toFormData:S3,AxiosHeaders:w3,HttpStatusCode:E3,formToJSON:C3,getAdapter:T3,mergeConfig:_3}=nt,ve=nt.create({baseURL:""});function rs(a){a?ve.defaults.headers.common.Authorization=`Bearer ${a}`:delete ve.defaults.headers.common.Authorization}let hd=null;function hj(a){hd=a}let Jv=null;function pj(a){Jv=a}ve.interceptors.request.use(a=>{if(!a.headers.Authorization){const s=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token");s&&(a.headers.Authorization=`Bearer ${s}`)}return a});ve.interceptors.response.use(a=>a,async a=>{const s=a.config;if(s.url?.startsWith("/api/auth/"))return Promise.reject(a);if(a.response?.status===401&&!s._retry&&hd){s._retry=!0;const o=await hd();if(o)return s.headers.Authorization=`Bearer ${o}`,ve(s);Jv?.()}return Promise.reject(a)});async function xj(){const{data:a}=await ve.get("/api/auth/setup-status");return a}async function Pv(a,s,o){const{data:i}=await ve.post("/api/auth/setup",{email:a,password:s,username:o});return i}async function vj(a,s){const{data:o}=await ve.post("/api/auth/login",{email:a,password:s});return o}async function gj(a){const{data:s}=await ve.post("/api/auth/refresh",{refresh_token:a});return s}const Iv=N.createContext(void 0),ml="jarvis-admin:access_token",ts="jarvis-admin:refresh_token",Yo="jarvis-admin:user",yj=600*1e3;function bj({children:a}){const[s,o]=N.useState(()=>{const g=localStorage.getItem(ml),h=localStorage.getItem(ts),y=localStorage.getItem(Yo);if(g&&h&&y)try{const x=JSON.parse(y);return rs(g),{user:x,accessToken:g,refreshToken:h,isAuthenticated:!0,isLoading:!1,error:null}}catch{}return{user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null}}),i=N.useCallback(()=>{localStorage.removeItem(ml),localStorage.removeItem(ts),localStorage.removeItem(Yo),rs(null),o({user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null})},[]),d=N.useCallback(async()=>{const g=localStorage.getItem(ts);if(!g)return null;try{const h=await gj(g),y=h.access_token,x=h.refresh_token??g;return localStorage.setItem(ml,y),localStorage.setItem(ts,x),rs(y),o(j=>({...j,accessToken:y,refreshToken:x})),y}catch{return i(),null}},[i]);N.useEffect(()=>{hj(d),pj(i)},[d,i]),N.useEffect(()=>{if(!s.isAuthenticated)return;const g=setInterval(()=>{d()},yj);return()=>clearInterval(g)},[s.isAuthenticated,d]);const f=N.useCallback(async(g,h)=>{o(y=>({...y,error:null,isLoading:!0}));try{const y=await vj(g,h);if(!y.user.is_superuser){o(x=>({...x,isLoading:!1,error:"Admin access required. This account is not a superuser."}));return}localStorage.setItem(ml,y.access_token),localStorage.setItem(ts,y.refresh_token),localStorage.setItem(Yo,JSON.stringify(y.user)),rs(y.access_token),o({user:y.user,accessToken:y.access_token,refreshToken:y.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(y){const x=y?.response?.data?.detail??"Login failed";o(j=>({...j,isLoading:!1,error:x}))}},[]),m=N.useCallback(async(g,h,y)=>{o(x=>({...x,error:null,isLoading:!0}));try{const x=await Pv(g,h,y);localStorage.setItem(ml,x.access_token),localStorage.setItem(ts,x.refresh_token),localStorage.setItem(Yo,JSON.stringify(x.user)),rs(x.access_token),o({user:x.user,accessToken:x.access_token,refreshToken:x.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(x){const j=x?.response?.data?.detail??"Setup failed";o(M=>({...M,isLoading:!1,error:j}))}},[]),v=N.useMemo(()=>({state:s,login:f,setup:m,logout:i}),[s,f,m,i]);return l.jsx(Iv.Provider,{value:v,children:a})}function Ud(){const a=N.useContext(Iv);if(!a)throw new Error("useAuth must be used within AuthProvider");return a}const Wv=(...a)=>a.filter((s,o,i)=>!!s&&s.trim()!==""&&i.indexOf(s)===o).join(" ").trim();const Nj=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const jj=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,o,i)=>i?i.toUpperCase():o.toLowerCase());const kx=a=>{const s=jj(a);return s.charAt(0).toUpperCase()+s.slice(1)};var Sj={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"};const wj=a=>{for(const s in a)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1};const Ej=N.forwardRef(({color:a="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:d="",children:f,iconNode:m,...v},g)=>N.createElement("svg",{ref:g,...Sj,width:s,height:s,stroke:a,strokeWidth:i?Number(o)*24/Number(s):o,className:Wv("lucide",d),...!f&&!wj(v)&&{"aria-hidden":"true"},...v},[...m.map(([h,y])=>N.createElement(h,y)),...Array.isArray(f)?f:[f]]));const Ne=(a,s)=>{const o=N.forwardRef(({className:i,...d},f)=>N.createElement(Ej,{ref:f,iconNode:s,className:Wv(`lucide-${Nj(kx(a))}`,`lucide-${a}`,i),...d}));return o.displayName=kx(a),o};const Cj=[["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"}]],Tj=Ne("activity",Cj);const _j=[["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"}]],Rj=Ne("box",_j);const kj=[["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"}]],Mj=Ne("boxes",kj);const Aj=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],pd=Ne("brain",Aj);const Oj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vi=Ne("check",Oj);const zj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ld=Ne("chevron-down",zj);const Dj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eg=Ne("chevron-right",Dj);const Uj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Bd=Ne("circle-alert",Uj);const Lj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],qd=Ne("circle-arrow-up",Lj);const Bj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],qj=Ne("circle-check-big",Bj);const Hj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],pt=Ne("circle-check",Hj);const Gj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],xl=Ne("circle-x",Gj);const Qj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],os=Ne("circle",Qj);const Vj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fj=Ne("clock",Vj);const Yj=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Hd=Ne("copy",Yj);const Xj=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],On=Ne("cpu",Xj);const Kj=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$j=Ne("database",Kj);const Zj=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],za=Ne("download",Zj);const Jj=[["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"}]],Pj=Ne("external-link",Jj);const Ij=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],tg=Ne("file-text",Ij);const Wj=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],xd=Ne("git-merge",Wj);const eS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],tS=Ne("globe",eS);const aS=[["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"}]],Gd=Ne("hard-drive",aS);const nS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],rS=Ne("info",nS);const sS=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],lS=Ne("key-round",sS);const oS=[["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"}]],iS=Ne("key",oS);const cS=[["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"}]],uS=Ne("layout-dashboard",cS);const dS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ct=Ne("loader-circle",dS);const fS=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],mS=Ne("lock-open",fS);const hS=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],gi=Ne("lock",hS);const pS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],xS=Ne("log-out",pS);const vS=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Mx=Ne("mic",vS);const gS=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],yS=Ne("monitor",gS);const bS=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],NS=Ne("moon",bS);const jS=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],SS=Ne("pencil",jS);const wS=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ag=Ne("play",wS);const ES=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ai=Ne("plus",ES);const CS=[["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"}]],it=Ne("refresh-cw",CS);const TS=[["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"}]],yi=Ne("rotate-ccw",TS);const _S=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Qd=Ne("rotate-cw",_S);const RS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],kS=Ne("search",RS);const MS=[["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"}]],Vd=Ne("server",MS);const AS=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ng=Ne("settings",AS);const OS=[["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"}]],zS=Ne("shield-check",OS);const DS=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],US=Ne("sparkles",DS);const LS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],BS=Ne("square",LS);const qS=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],HS=Ne("sun",qS);const GS=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],bi=Ne("trash-2",GS);const QS=[["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"}]],ra=Ne("triangle-alert",QS);const VS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],FS=Ne("user-x",VS);const YS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],XS=Ne("users",YS);const KS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fd=Ne("x",KS);const $S=[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ZS=Ne("zap-off",$S);const JS=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ii=Ne("zap",JS);function rg(a){var s,o,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var d=a.length;for(s=0;s<d;s++)a[s]&&(o=rg(a[s]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function PS(){for(var a,s,o=0,i="",d=arguments.length;o<d;o++)(a=arguments[o])&&(s=rg(a))&&(i&&(i+=" "),i+=s);return i}const IS=(a,s)=>{const o=new Array(a.length+s.length);for(let i=0;i<a.length;i++)o[i]=a[i];for(let i=0;i<s.length;i++)o[a.length+i]=s[i];return o},WS=(a,s)=>({classGroupId:a,validator:s}),sg=(a=new Map,s=null,o)=>({nextPart:a,validators:s,classGroupId:o}),ci="-",Ax=[],ew="arbitrary..",tw=a=>{const s=nw(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return aw(m);const v=m.split(ci),g=v[0]===""&&v.length>1?1:0;return lg(v,g,s)},getConflictingClassGroupIds:(m,v)=>{if(v){const g=i[m],h=o[m];return g?h?IS(h,g):g:h||Ax}return o[m]||Ax}}},lg=(a,s,o)=>{if(a.length-s===0)return o.classGroupId;const d=a[s],f=o.nextPart.get(d);if(f){const h=lg(a,s+1,f);if(h)return h}const m=o.validators;if(m===null)return;const v=s===0?a.join(ci):a.slice(s).join(ci),g=m.length;for(let h=0;h<g;h++){const y=m[h];if(y.validator(v))return y.classGroupId}},aw=a=>a.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=a.slice(1,-1),o=s.indexOf(":"),i=s.slice(0,o);return i?ew+i:void 0})(),nw=a=>{const{theme:s,classGroups:o}=a;return rw(o,s)},rw=(a,s)=>{const o=sg();for(const i in a){const d=a[i];Yd(d,o,i,s)}return o},Yd=(a,s,o,i)=>{const d=a.length;for(let f=0;f<d;f++){const m=a[f];sw(m,s,o,i)}},sw=(a,s,o,i)=>{if(typeof a=="string"){lw(a,s,o);return}if(typeof a=="function"){ow(a,s,o,i);return}iw(a,s,o,i)},lw=(a,s,o)=>{const i=a===""?s:og(s,a);i.classGroupId=o},ow=(a,s,o,i)=>{if(cw(a)){Yd(a(i),s,o,i);return}s.validators===null&&(s.validators=[]),s.validators.push(WS(o,a))},iw=(a,s,o,i)=>{const d=Object.entries(a),f=d.length;for(let m=0;m<f;m++){const[v,g]=d[m];Yd(g,og(s,v),o,i)}},og=(a,s)=>{let o=a;const i=s.split(ci),d=i.length;for(let f=0;f<d;f++){const m=i[f];let v=o.nextPart.get(m);v||(v=sg(),o.nextPart.set(m,v)),o=v}return o},cw=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,uw=a=>{if(a<1)return{get:()=>{},set:()=>{}};let s=0,o=Object.create(null),i=Object.create(null);const d=(f,m)=>{o[f]=m,s++,s>a&&(s=0,i=o,o=Object.create(null))};return{get(f){let m=o[f];if(m!==void 0)return m;if((m=i[f])!==void 0)return d(f,m),m},set(f,m){f in o?o[f]=m:d(f,m)}}},vd="!",Ox=":",dw=[],zx=(a,s,o,i,d)=>({modifiers:a,hasImportantModifier:s,baseClassName:o,maybePostfixModifierPosition:i,isExternal:d}),fw=a=>{const{prefix:s,experimentalParseClassName:o}=a;let i=d=>{const f=[];let m=0,v=0,g=0,h;const y=d.length;for(let E=0;E<y;E++){const _=d[E];if(m===0&&v===0){if(_===Ox){f.push(d.slice(g,E)),g=E+1;continue}if(_==="/"){h=E;continue}}_==="["?m++:_==="]"?m--:_==="("?v++:_===")"&&v--}const x=f.length===0?d:d.slice(g);let j=x,M=!1;x.endsWith(vd)?(j=x.slice(0,-1),M=!0):x.startsWith(vd)&&(j=x.slice(1),M=!0);const w=h&&h>g?h-g:void 0;return zx(f,M,j,w)};if(s){const d=s+Ox,f=i;i=m=>m.startsWith(d)?f(m.slice(d.length)):zx(dw,!1,m,void 0,!0)}if(o){const d=i;i=f=>o({className:f,parseClassName:d})}return i},mw=a=>{const s=new Map;return a.orderSensitiveModifiers.forEach((o,i)=>{s.set(o,1e6+i)}),o=>{const i=[];let d=[];for(let f=0;f<o.length;f++){const m=o[f],v=m[0]==="[",g=s.has(m);v||g?(d.length>0&&(d.sort(),i.push(...d),d=[]),i.push(m)):d.push(m)}return d.length>0&&(d.sort(),i.push(...d)),i}},hw=a=>({cache:uw(a.cacheSize),parseClassName:fw(a),sortModifiers:mw(a),...tw(a)}),pw=/\s+/,xw=(a,s)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:d,sortModifiers:f}=s,m=[],v=a.trim().split(pw);let g="";for(let h=v.length-1;h>=0;h-=1){const y=v[h],{isExternal:x,modifiers:j,hasImportantModifier:M,baseClassName:w,maybePostfixModifierPosition:E}=o(y);if(x){g=y+(g.length>0?" "+g:g);continue}let _=!!E,A=i(_?w.substring(0,E):w);if(!A){if(!_){g=y+(g.length>0?" "+g:g);continue}if(A=i(w),!A){g=y+(g.length>0?" "+g:g);continue}_=!1}const k=j.length===0?"":j.length===1?j[0]:f(j).join(":"),X=M?k+vd:k,I=X+A;if(m.indexOf(I)>-1)continue;m.push(I);const W=d(A,_);for(let ee=0;ee<W.length;++ee){const D=W[ee];m.push(X+D)}g=y+(g.length>0?" "+g:g)}return g},vw=(...a)=>{let s=0,o,i,d="";for(;s<a.length;)(o=a[s++])&&(i=ig(o))&&(d&&(d+=" "),d+=i);return d},ig=a=>{if(typeof a=="string")return a;let s,o="";for(let i=0;i<a.length;i++)a[i]&&(s=ig(a[i]))&&(o&&(o+=" "),o+=s);return o},gw=(a,...s)=>{let o,i,d,f;const m=g=>{const h=s.reduce((y,x)=>x(y),a());return o=hw(h),i=o.cache.get,d=o.cache.set,f=v,v(g)},v=g=>{const h=i(g);if(h)return h;const y=xw(g,o);return d(g,y),y};return f=m,(...g)=>f(vw(...g))},yw=[],ft=a=>{const s=o=>o[a]||yw;return s.isThemeGetter=!0,s},cg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ug=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bw=/^\d+\/\d+$/,Nw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jw=/\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$/,Sw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ww=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ew=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,as=a=>bw.test(a),Ae=a=>!!a&&!Number.isNaN(Number(a)),Mn=a=>!!a&&Number.isInteger(Number(a)),Xu=a=>a.endsWith("%")&&Ae(a.slice(0,-1)),en=a=>Nw.test(a),Cw=()=>!0,Tw=a=>jw.test(a)&&!Sw.test(a),dg=()=>!1,_w=a=>ww.test(a),Rw=a=>Ew.test(a),kw=a=>!ue(a)&&!de(a),Mw=a=>ms(a,hg,dg),ue=a=>cg.test(a),sr=a=>ms(a,pg,Tw),Ku=a=>ms(a,Uw,Ae),Dx=a=>ms(a,fg,dg),Aw=a=>ms(a,mg,Rw),Xo=a=>ms(a,xg,_w),de=a=>ug.test(a),hl=a=>hs(a,pg),Ow=a=>hs(a,Lw),Ux=a=>hs(a,fg),zw=a=>hs(a,hg),Dw=a=>hs(a,mg),Ko=a=>hs(a,xg,!0),ms=(a,s,o)=>{const i=cg.exec(a);return i?i[1]?s(i[1]):o(i[2]):!1},hs=(a,s,o=!1)=>{const i=ug.exec(a);return i?i[1]?s(i[1]):o:!1},fg=a=>a==="position"||a==="percentage",mg=a=>a==="image"||a==="url",hg=a=>a==="length"||a==="size"||a==="bg-size",pg=a=>a==="length",Uw=a=>a==="number",Lw=a=>a==="family-name",xg=a=>a==="shadow",Bw=()=>{const a=ft("color"),s=ft("font"),o=ft("text"),i=ft("font-weight"),d=ft("tracking"),f=ft("leading"),m=ft("breakpoint"),v=ft("container"),g=ft("spacing"),h=ft("radius"),y=ft("shadow"),x=ft("inset-shadow"),j=ft("text-shadow"),M=ft("drop-shadow"),w=ft("blur"),E=ft("perspective"),_=ft("aspect"),A=ft("ease"),k=ft("animate"),X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...I(),de,ue],ee=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],z=()=>[de,ue,g],oe=()=>[as,"full","auto",...z()],be=()=>[Mn,"none","subgrid",de,ue],se=()=>["auto",{span:["full",Mn,de,ue]},Mn,de,ue],pe=()=>[Mn,"auto",de,ue],Ee=()=>["auto","min","max","fr",de,ue],he=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...z()],Y=()=>[as,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],K=()=>[a,de,ue],ge=()=>[...I(),Ux,Dx,{position:[de,ue]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],S=()=>["auto","cover","contain",zw,Mw,{size:[de,ue]}],L=()=>[Xu,hl,sr],Q=()=>["","none","full",h,de,ue],Z=()=>["",Ae,hl,sr],re=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>[Ae,Xu,Ux,Dx],Se=()=>["","none",w,de,ue],B=()=>["none",Ae,de,ue],U=()=>["none",Ae,de,ue],we=()=>[Ae,de,ue],xe=()=>[as,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[en],breakpoint:[en],color:[Cw],container:[en],"drop-shadow":[en],ease:["in","out","in-out"],font:[kw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[en],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[en],shadow:[en],spacing:["px",Ae],text:[en],"text-shadow":[en],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",as,ue,de,_]}],container:["container"],columns:[{columns:[Ae,ue,de,v]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:W()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{start:oe()}],end:[{end:oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[Mn,"auto",de,ue]}],basis:[{basis:[as,"full","auto",v,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,as,"auto","initial","none",ue]}],grow:[{grow:["",Ae,de,ue]}],shrink:[{shrink:["",Ae,de,ue]}],order:[{order:[Mn,"first","last","none",de,ue]}],"grid-cols":[{"grid-cols":be()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":pe()}],"col-end":[{"col-end":pe()}],"grid-rows":[{"grid-rows":be()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":pe()}],"row-end":[{"row-end":pe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ee()}],"auto-rows":[{"auto-rows":Ee()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...he(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...he()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":he()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[v,"screen",...Y()]}],"min-w":[{"min-w":[v,"screen","none",...Y()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[m]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",o,hl,sr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,de,Ku]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xu,ue]}],"font-family":[{font:[Ow,ue,s]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,de,ue]}],"line-clamp":[{"line-clamp":[Ae,"none",de,Ku]}],leading:[{leading:[f,...z()]}],"list-image":[{"list-image":["none",de,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",de,sr]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[Ae,"auto",de,ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ge()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mn,de,ue],radial:["",de,ue],conic:[Mn,de,ue]},Dw,Aw]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,de,ue]}],"outline-w":[{outline:["",Ae,hl,sr]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",y,Ko,Xo]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",x,Ko,Xo]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[Ae,sr]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",j,Ko,Xo]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[Ae,de,ue]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[de,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ge()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ue]}],filter:[{filter:["","none",de,ue]}],blur:[{blur:Se()}],brightness:[{brightness:[Ae,de,ue]}],contrast:[{contrast:[Ae,de,ue]}],"drop-shadow":[{"drop-shadow":["","none",M,Ko,Xo]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",Ae,de,ue]}],"hue-rotate":[{"hue-rotate":[Ae,de,ue]}],invert:[{invert:["",Ae,de,ue]}],saturate:[{saturate:[Ae,de,ue]}],sepia:[{sepia:["",Ae,de,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ue]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,de,ue]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,de,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,de,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,de,ue]}],"backdrop-invert":[{"backdrop-invert":["",Ae,de,ue]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,de,ue]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,de,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,de,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",de,ue]}],ease:[{ease:["linear","initial",A,de,ue]}],delay:[{delay:[Ae,de,ue]}],animate:[{animate:["none",k,de,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,de,ue]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:B()}],"rotate-x":[{"rotate-x":B()}],"rotate-y":[{"rotate-y":B()}],"rotate-z":[{"rotate-z":B()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[de,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",de,ue]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[Ae,hl,sr,Ku]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},qw=gw(Bw);function ae(...a){return qw(PS(a))}async function Hw(){const{data:a}=await ve.get("/api/system/info");return a}function Gw(){return yt({queryKey:["system-info"],queryFn:Hw,staleTime:6e4})}function Qw(a){const s=Math.floor(a/86400),o=Math.floor(a%86400/3600);if(s>0)return`${s}d ${o}h`;const i=Math.floor(a%3600/60);return o>0?`${o}h ${i}m`:`${i}m`}function Vw(){const{data:a}=Gw();return a?l.jsxs("div",{className:"border-t border-[var(--color-border)] px-3 py-2 text-[10px] text-[var(--color-text-muted)]",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(On,{size:10}),l.jsxs("span",{children:[a.cpuCount," cores"]}),l.jsx("span",{className:"mx-0.5",children:"|"}),l.jsx(Gd,{size:10}),l.jsxs("span",{children:[Math.round(a.totalMemoryMb/1024),"GB"]})]}),l.jsxs("div",{className:"mt-0.5",children:[a.hostname," · up ",Qw(a.uptime)," · v",a.version]})]}):null}const Fw=[{label:"Dashboard",icon:uS,path:"/dashboard"},{label:"Settings",icon:ng,path:"/settings"},{label:"Services",icon:Vd,path:"/services"},{label:"Models",icon:Rj,path:"/models"},{label:"Quick Sets",icon:ii,path:"/quick-sets"},{label:"Traces",icon:Tj,path:"/traces"},{label:"Nodes",icon:On,path:"/nodes"},{label:"Users",icon:XS,path:"/users"},{label:"Native",icon:Mj,path:"/native-services"},{label:"Updates",icon:qd,path:"/update"}];function Yw(){return l.jsxs("aside",{className:"flex w-56 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsx("div",{className:"flex h-14 items-center border-b border-[var(--color-border)] px-4",children:l.jsx("span",{className:"text-lg font-bold text-[var(--color-primary)]",children:"Jarvis"})}),l.jsx("nav",{className:"flex-1 space-y-1 p-2",children:Fw.map(a=>l.jsxs(mv,{to:a.path,className:({isActive:s})=>ae("flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",s?"bg-[var(--color-primary)]/10 text-[var(--color-primary)]":"text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-text)]"),children:[l.jsx(a.icon,{size:18}),a.label]},a.path))}),l.jsx(Vw,{})]})}function Xw(){const{state:a,logout:s}=Ud(),{theme:o,toggleTheme:i}=B2();return l.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-[var(--color-border)] bg-[var(--color-surface)] px-6",children:[l.jsx("h2",{className:"text-sm font-medium text-[var(--color-text-muted)]",children:"Admin Dashboard"}),l.jsxs("div",{className:"flex items-center gap-3",children:[a.user&&l.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:a.user.email}),l.jsx("button",{onClick:i,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",title:`Switch to ${o==="dark"?"light":"dark"} mode`,children:o==="dark"?l.jsx(HS,{size:18}):l.jsx(NS,{size:18})}),l.jsx("button",{onClick:s,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-red-500",title:"Logout",children:l.jsx(xS,{size:18})})]})]})}function Kw(){const{state:a}=Ud();return a.isLoading?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading..."})}):a.isAuthenticated?l.jsxs("div",{className:"flex h-screen bg-[var(--color-background)]",children:[l.jsx(Yw,{}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx(Xw,{}),l.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:l.jsx(F0,{})})]})]}):l.jsx(ri,{to:"/login",replace:!0})}function $w(){const{state:a,login:s,setup:o}=Ud(),i=wa(),[d,f]=N.useState("loading"),[m,v]=N.useState(""),[g,h]=N.useState(""),[y,x]=N.useState(""),[j,M]=N.useState(""),[w,E]=N.useState(null);if(N.useEffect(()=>{let I=!1;async function W(){try{const{data:ee}=await ve.get("/api/setup/status");if(!I&&!ee.configured){i("/setup",{replace:!0});return}}catch{if(!I){i("/setup",{replace:!0});return}}try{const ee=await xj();I||f(ee.needs_setup?"setup":"login")}catch{I||f("login")}}return W(),()=>{I=!0}},[i]),a.isAuthenticated)return l.jsx(ri,{to:"/settings",replace:!0});const _=I=>{I.preventDefault(),s(m,y)},A=I=>{if(I.preventDefault(),E(null),y!==j){E("Passwords do not match");return}if(y.length<8){E("Password must be at least 8 characters");return}o(m,y,g||void 0)},k=ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]"),X=w??a.error;return d==="loading"?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-border)] border-t-[var(--color-primary)]"})})})}):l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:d==="setup"?l.jsxs(l.Fragment,{children:[l.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),l.jsx("p",{className:"mb-6 text-center text-sm text-[var(--color-text-muted)]",children:"Set up your first administrator account to get started."}),l.jsxs("form",{onSubmit:A,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:I=>v(I.target.value),className:k,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"username",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Username"}),l.jsx("input",{id:"username",type:"text",required:!0,autoComplete:"username",value:g,onChange:I=>h(I.target.value),className:k,placeholder:"admin"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:y,onChange:I=>x(I.target.value),className:k})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),l.jsx("input",{id:"confirm-password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:j,onChange:I=>M(I.target.value),className:k})]}),X&&l.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:X}),l.jsx("button",{type:"submit",disabled:a.isLoading,className:ae("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50","transition-opacity"),children:a.isLoading?"Creating account...":"Create Admin Account"})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("h1",{className:"mb-6 text-center text-2xl font-bold text-[var(--color-text)]",children:"Jarvis Admin"}),l.jsxs("form",{onSubmit:_,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:I=>v(I.target.value),className:k,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",required:!0,autoComplete:"current-password",value:y,onChange:I=>x(I.target.value),className:k})]}),X&&l.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:X}),l.jsx("button",{type:"submit",disabled:a.isLoading,className:ae("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50","transition-opacity"),children:a.isLoading?"Signing in...":"Sign in"})]})]})})})}async function Zw(){const{data:a}=await ve.get("/api/settings/");return a}async function Jw(a,s,o){const{data:i}=await ve.put(`/api/settings/${encodeURIComponent(a)}/${s}`,{value:o});return i}function Pw(){return yt({queryKey:["settings"],queryFn:Zw,staleTime:3e4})}function Iw(){const a=ct();return bt({mutationFn:({serviceName:s,key:o,value:i})=>Jw(s,o,i),onSuccess:()=>{a.invalidateQueries({queryKey:["settings"]})}})}function Ww({setting:a,onSave:s,onCancel:o,isSaving:i}){const[d,f]=N.useState(()=>a.value_type==="json"?JSON.stringify(a.value,null,2):a.value_type==="bool"?"":String(a.value??"")),[m,v]=N.useState(()=>!!a.value),[g,h]=N.useState(null),y=!!a.options?.length,x=y&&!a.options.includes(d),[j,M]=N.useState(x),w=_=>{_.preventDefault();let A;switch(a.value_type){case"bool":A=m;break;case"int":if(A=parseInt(d,10),isNaN(A)){h("Must be a whole number");return}h(null);break;case"float":if(A=parseFloat(d),isNaN(A)){h("Must be a number");return}h(null);break;case"json":try{A=JSON.parse(d),h(null)}catch{h("Invalid JSON");return}break;default:A=d}s(A)},E=ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-2 focus:ring-[var(--color-primary)]");return l.jsxs("form",{onSubmit:w,className:"flex items-center gap-2",children:[y?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{value:j?"__other__":d,onChange:_=>{_.target.value==="__other__"?(M(!0),f("")):(M(!1),f(_.target.value))},className:ae(E,"max-w-xs"),children:[a.options.map(_=>l.jsx("option",{value:String(_),children:String(_)},String(_))),l.jsx("option",{value:"__other__",children:"Other..."})]}),j&&l.jsx("input",{type:"text",value:d,onChange:_=>f(_.target.value),placeholder:"Custom value",className:ae(E,"max-w-xs"),autoFocus:!0})]}):a.value_type==="bool"?l.jsx("button",{type:"button",onClick:()=>v(_=>!_),className:ae("relative h-6 w-11 rounded-full transition-colors",m?"bg-[var(--color-primary)]":"bg-[var(--color-border)]"),children:l.jsx("span",{className:ae("absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform",m&&"translate-x-5")})}):a.value_type==="json"?l.jsxs("div",{className:"flex-1",children:[l.jsx("textarea",{value:d,onChange:_=>{f(_.target.value),h(null)},rows:4,className:ae(E,"font-mono text-xs")}),g&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:g})]}):l.jsxs("div",{children:[l.jsx("input",{type:a.value_type==="int"||a.value_type==="float"?"number":a.is_secret?"password":"text",step:a.value_type==="float"?"any":void 0,value:d,onChange:_=>{f(_.target.value),h(null)},className:ae(E,"max-w-xs")}),g&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:g})]}),l.jsx("button",{type:"submit",disabled:i,className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:i?"Saving...":"Save"}),l.jsx("button",{type:"button",onClick:o,className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})}function eE(a){return a.is_secret?"********":a.value===null||a.value===void 0?"(not set)":a.value_type==="json"?JSON.stringify(a.value):String(a.value)}const tE={string:"bg-blue-500/10 text-blue-500",int:"bg-emerald-500/10 text-emerald-500",float:"bg-emerald-500/10 text-emerald-500",bool:"bg-amber-500/10 text-amber-500",json:"bg-purple-500/10 text-purple-500"};function aE({setting:a,serviceName:s,onRestartService:o}){const[i,d]=N.useState(!1),f=Iw(),m=v=>{f.mutate({serviceName:s,key:a.key,value:v},{onSuccess:g=>{d(!1),g.requires_reload?Me.warning(`Setting updated. ${s} requires a restart to apply.`,o?{action:{label:"Restart",onClick:o}}:void 0):Me.success("Setting updated")},onError:g=>{Me.error(`Failed to update: ${g.message}`)}})};return l.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg px-3 py-2 hover:bg-[var(--color-surface-alt)]",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"text-sm font-medium text-[var(--color-text)]",children:a.key}),l.jsx("span",{className:ae("rounded px-1.5 py-0.5 text-[10px] font-medium",tE[a.value_type]??"bg-gray-500/10 text-gray-500"),children:a.value_type}),a.from_db&&l.jsx("span",{title:"Stored in database",children:l.jsx($j,{size:12,className:"text-[var(--color-tertiary)]"})}),a.requires_reload&&l.jsx("span",{title:"Requires service restart",children:l.jsx(ra,{size:12,className:"text-amber-500"})})]}),a.description&&l.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:a.description}),i?l.jsx("div",{className:"mt-2",children:l.jsx(Ww,{setting:a,onSave:m,onCancel:()=>d(!1),isSaving:f.isPending})}):l.jsx("p",{className:"mt-1 font-mono text-xs text-[var(--color-text-muted)]",children:eE(a)})]}),!i&&l.jsx("button",{onClick:()=>d(!0),className:"shrink-0 rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-primary)]",title:"Edit",children:l.jsx(SS,{size:14})})]})}function nE({category:a,settings:s,serviceName:o,onRestartService:i}){const[d,f]=N.useState(!0);return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>f(m=>!m),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[d?l.jsx(Ld,{size:14}):l.jsx(eg,{size:14}),a,l.jsxs("span",{className:"font-normal",children:["(",s.length,")"]})]}),d&&l.jsx("div",{className:"space-y-0.5",children:s.map(m=>l.jsx(aE,{setting:m,serviceName:o,onRestartService:i},m.key))})]})}async function rE(){const{data:a}=await ve.get("/api/containers");return a}async function sE(a){const{data:s}=await ve.post(`/api/containers/${a}/restart`);return s}function vg(){return yt({queryKey:["containers"],queryFn:rE,staleTime:1e4,refetchInterval:1e4})}function gg(){const a=ct();return bt({mutationFn:s=>sE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["containers"]})}})}function lE({result:a,defaultExpanded:s=!1}){const[o,i]=N.useState(s),{data:d}=vg(),f=gg(),m=N.useCallback(()=>{const g=d?.containers.find(h=>h.name.includes(a.service_name)||h.name.includes(a.service_name.replace("jarvis-","")));g?f.mutate(g.id,{onSuccess:()=>Me.success(`${a.service_name} is restarting...`),onError:h=>Me.error(`Restart failed: ${h.message}`)}):Me.error(`Could not find container for ${a.service_name}`)},[d,a.service_name,f]),v=N.useMemo(()=>{const g=new Map;for(const h of a.settings){const y=g.get(h.category)??[];g.set(h.category,[...y,h])}return g},[a]);return l.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsxs("button",{onClick:()=>i(g=>!g),className:"flex w-full items-center gap-3 px-4 py-3 text-left hover:bg-[var(--color-surface-alt)]",children:[o?l.jsx(Ld,{size:18,className:"text-[var(--color-text-muted)]"}):l.jsx(eg,{size:18,className:"text-[var(--color-text-muted)]"}),l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.service_name}),a.success?l.jsx(pt,{size:16,className:"text-[var(--color-secondary)]"}):l.jsx(xl,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a.success?`${a.settings.length} settings`:a.error??"Error"}),a.latency_ms!=null&&l.jsxs("span",{className:ae("ml-auto text-xs",a.latency_ms>500?"text-amber-500":"text-[var(--color-text-muted)]"),children:[Math.round(a.latency_ms),"ms"]})]}),o&&a.success&&l.jsx("div",{className:"space-y-2 border-t border-[var(--color-border)] px-2 py-3",children:[...v.entries()].map(([g,h])=>l.jsx(nE,{category:g,settings:h,serviceName:a.service_name,onRestartService:m},g))}),o&&!a.success&&l.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-3",children:l.jsx("p",{className:"text-sm text-red-500",children:a.error??"Failed to fetch settings"})})]})}function oE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=Pw(),[m,v]=N.useState(""),g=N.useMemo(()=>{if(!a)return[];if(!m.trim())return a.services;const h=m.toLowerCase();return a.services.map(y=>({...y,settings:y.settings.filter(x=>x.key.toLowerCase().includes(h)||x.category.toLowerCase().includes(h)||(x.description?.toLowerCase().includes(h)??!1))})).filter(y=>y.settings.length>0||y.service_name.toLowerCase().includes(h))},[a,m]);return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load settings"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Settings"}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[a&&l.jsxs("span",{children:[a.successful_services,"/",a.total_services," services"]}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),l.jsxs("div",{className:"relative",children:[l.jsx(kS,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),l.jsx("input",{type:"text",value:m,onChange:h=>v(h.target.value),placeholder:"Search settings...",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] py-2 pl-9 pr-3","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"space-y-3",children:[g.map((h,y)=>l.jsx(lE,{result:h,defaultExpanded:y===0},h.service_name)),g.length===0&&l.jsx("p",{className:"py-8 text-center text-sm text-[var(--color-text-muted)]",children:m?"No settings match your search":"No services found"})]})]})}async function iE(){const{data:a}=await ve.get("/api/services/registry");return a}async function cE(a){const{data:s}=await ve.post("/api/services/register",a);return s}async function uE(a){const{data:s}=await ve.post("/api/services/rotate-key",a);return s}async function dE(a){const{data:s}=await ve.post("/api/services/probe",a);return s}async function fE(a){const{data:s}=await ve.post("/api/services/register",{services:[{name:a.name,host:a.host,port:a.port,scheme:a.scheme,health_path:a.health_path,description:a.description}]});return s}async function mE(a){await ve.delete(`/api/services/${encodeURIComponent(a)}`)}async function hE(){const{data:a}=await ve.get("/api/services/suggestions");return a}function pE(){return yt({queryKey:["service-registry"],queryFn:iE,staleTime:3e4})}function xE(){const a=ct();return bt({mutationFn:cE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function vE(){const a=ct();return bt({mutationFn:uE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function gE(){const a=ct();return bt({mutationFn:fE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function yE(){const a=ct();return bt({mutationFn:mE,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function bE(){return yt({queryKey:["service-suggestions"],queryFn:hE,staleTime:6e4})}function Lx({ok:a,label:s}){return l.jsxs("span",{className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[a?l.jsx(vi,{size:12}):l.jsx(Fd,{size:12}),s]})}function NE({status:a,error:s,latency:o}){return a==="idle"?null:a==="probing"?l.jsx("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:l.jsx(Ct,{size:12,className:"animate-spin"})}):a==="healthy"?l.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 dark:text-green-400",children:[l.jsx(os,{size:8,fill:"currentColor"}),o!=null&&`${o}ms`]}):l.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",title:s,children:[l.jsx(os,{size:8,fill:"currentColor"}),s||"Unreachable"]})}function jE({entry:a,checked:s,host:o,port:i,scheme:d,onToggle:f,onHostChange:m,onPortChange:v,onSchemeChange:g,onHostBlur:h,onPortBlur:y,onRotateKey:x,onDelete:j,disabled:M,rotating:w,deleting:E,healthStatus:_,healthError:A,healthLatency:k}){return l.jsxs("div",{className:ae("flex flex-wrap items-center gap-3 rounded-lg border border-[var(--color-border)] p-3","bg-[var(--color-surface)] transition-colors",s&&"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5"),children:[l.jsx("input",{type:"checkbox",checked:s,onChange:f,disabled:M,className:"h-4 w-4 rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),l.jsxs("div",{className:"min-w-[180px] flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-[var(--color-text)]",children:[a.name,a.custom&&l.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"custom"})]}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:a.description})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Lx,{ok:a.config_registered,label:"Config"}),l.jsx(Lx,{ok:a.auth_registered,label:"Auth"}),a.custom&&j&&l.jsxs("button",{onClick:j,disabled:M||E,className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium","bg-red-500/10 text-red-600 dark:text-red-400","hover:bg-red-500/20","disabled:opacity-50"),title:"Remove custom service",children:[l.jsx(bi,{size:12,className:E?"animate-spin":""}),"Remove"]}),a.auth_registered&&l.jsxs("button",{onClick:x,disabled:M||w,className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium","bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]","hover:bg-[var(--color-primary)]/10 hover:text-[var(--color-primary)]","disabled:opacity-50"),title:"Rotate app key",children:[l.jsx(Qd,{size:12,className:w?"animate-spin":""}),"Rotate Key"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{value:d,onChange:X=>g(X.target.value),disabled:M,className:ae("rounded border px-1.5 py-1 text-xs font-mono",d==="https"?"border-green-500/40 bg-green-500/10 text-green-600 dark:text-green-400":d==="mqtt"||d==="mqtts"?"border-purple-500/40 bg-purple-500/10 text-purple-600 dark:text-purple-400":d==="ws"||d==="wss"?"border-blue-500/40 bg-blue-500/10 text-blue-600 dark:text-blue-400":"border-[var(--color-border)] bg-[var(--color-background)] text-[var(--color-text-muted)]","disabled:opacity-50"),title:"Scheme",children:[l.jsx("option",{value:"http",children:"http"}),l.jsx("option",{value:"https",children:"https"}),l.jsx("option",{value:"mqtt",children:"mqtt"}),l.jsx("option",{value:"mqtts",children:"mqtts"}),l.jsx("option",{value:"ws",children:"ws"}),l.jsx("option",{value:"wss",children:"wss"})]}),l.jsx("input",{type:"text",value:o,onChange:X=>m(X.target.value),onBlur:h,disabled:M,placeholder:"host",className:ae("w-36 rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1","text-xs text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]","disabled:opacity-50")}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:":"}),l.jsx("input",{type:"number",value:i,onChange:X=>v(Number(X.target.value)),onBlur:y,disabled:M,className:ae("w-20 rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1","text-xs text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]","disabled:opacity-50")}),l.jsx(NE,{status:_,error:A,latency:k})]})]})}const Bx={name:"",host:"localhost",port:"",scheme:"http",health_path:"/health",description:""};function SE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=pE(),m=xE(),v=vE(),g=gE(),h=yE(),{data:y}=bE(),[x,j]=N.useState({}),[M,w]=N.useState(null),[E,_]=N.useState(null),[A,k]=N.useState(null),[X,I]=N.useState(null),[W,ee]=N.useState(null),[D,z]=N.useState({}),[oe,be]=N.useState(!1),[se,pe]=N.useState(Bx),[Ee,he]=N.useState(!1),ne=N.useRef(null),C=N.useMemo(()=>new Set(a?.services.map(B=>B.name)??[]),[a]),Y=N.useMemo(()=>{const U=(y?.suggestions??[]).filter(xe=>!C.has(xe.id));if(!se.name.trim())return U;const we=se.name.toLowerCase();return U.filter(xe=>xe.id.toLowerCase().includes(we)||xe.name.toLowerCase().includes(we)||xe.description.toLowerCase().includes(we))},[y,C,se.name]),K=N.useCallback(B=>{pe({name:B.id,description:B.description,host:"localhost",port:String(B.port),scheme:"http",health_path:B.healthCheck}),he(!1)},[]);N.useEffect(()=>{const B=U=>{ne.current&&!ne.current.contains(U.target)&&he(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const ge=N.useCallback(B=>{if(x[B])return x[B];const U=a?.services.find(we=>we.name===B);return U?{checked:U.config_registered,host:U.current_host??"localhost",port:U.current_port??U.default_port,scheme:U.current_scheme??"http"}:{checked:!1,host:"localhost",port:0,scheme:"http"}},[x,a]),te=N.useCallback((B,U)=>{j(we=>{const xe=we[B]??{checked:!1,host:"localhost",port:0};return{...we,[B]:{...xe,...U}}})},[]),S=N.useCallback(async(B,U,we,xe,Ut="http")=>{if(!(!U||!we)){z(ut=>({...ut,[B]:{status:"probing"}}));try{const ut=await dE({host:U,port:we,health_path:xe,scheme:Ut});z(Dn=>({...Dn,[B]:{status:ut.healthy?"healthy":"unhealthy",error:ut.error??void 0,latency:ut.latency_ms??void 0}}))}catch{z(ut=>({...ut,[B]:{status:"unhealthy",error:"Request failed"}}))}}},[]),L=N.useCallback(()=>{if(!a)return;const B=a.services.filter(U=>ge(U.name).checked).map(U=>{const we=ge(U.name);return{name:U.name,host:we.host,port:we.port,scheme:we.scheme}});if(B.length===0){Me.error("No services selected");return}w(null),_(null),m.mutate({services:B},{onSuccess:U=>{w(U.results);const we=U.results.filter(Ut=>Ut.config_ok&&Ut.auth_ok).length,xe=U.results.length;we===xe?Me.success(`All ${xe} services registered`):Me.warning(`${we}/${xe} services registered successfully`)},onError:U=>{Me.error(`Registration failed: ${U.message}`)}})},[a,ge,m]),Q=N.useCallback(B=>{k(B),_(null),v.mutate({service_name:B},{onSuccess:U=>{_(U),k(null),Me.success(`Key rotated for ${B}`)},onError:U=>{k(null),Me.error(`Key rotation failed: ${U.message}`)}})},[v]),Z=N.useCallback(B=>{I(B),h.mutate(B,{onSuccess:()=>{I(null),Me.success(`Removed ${B}`)},onError:U=>{I(null),Me.error(`Failed to remove: ${U.message}`)}})},[h]),re=N.useCallback(()=>{const B=parseInt(se.port,10);if(!se.name.trim()){Me.error("Service name is required");return}if(!B||B<1||B>65535){Me.error("Port must be between 1 and 65535");return}g.mutate({name:se.name.trim(),host:se.host.trim()||"localhost",port:B,scheme:se.scheme,health_path:se.health_path.trim()||"/health",description:se.description.trim()},{onSuccess:U=>{const we=U.results[0];we?.config_ok?(Me.success(`Added ${se.name.trim()}`),pe(Bx),be(!1)):Me.error(`Failed to add: ${we?.error??"Unknown error"}`)},onError:U=>{Me.error(`Failed to add service: ${U.message}`)}})},[se,g]),fe=N.useCallback(B=>{navigator.clipboard.writeText(B).then(()=>{ee(B),setTimeout(()=>ee(null),2e3)})},[]),ce=a?.services.filter(B=>ge(B.name).checked).length??0,Se=M?.some(B=>B.env_written)||E?.env_written===!0;return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load service registry"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Services"}),l.jsx("span",{className:"rounded-full bg-[var(--color-surface-alt)] px-2.5 py-0.5 text-xs font-medium text-[var(--color-text-muted)]",children:a?.services.length??0})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>be(B=>!B),className:ae("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium",oe?"bg-[var(--color-surface-alt)] text-[var(--color-text)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[oe?l.jsx(Fd,{size:14}):l.jsx(ai,{size:14}),oe?"Cancel":"Add Service"]}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),oe&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Add Service"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{ref:ne,className:"relative",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Service"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:"text",value:se.name,onChange:B=>{pe(U=>({...U,name:B.target.value})),he(!0)},onFocus:()=>he(!0),placeholder:"Select or type a service name...",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5 pr-8","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")}),l.jsx("button",{type:"button",onClick:()=>he(B=>!B),className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:l.jsx(Ld,{size:14})})]}),Ee&&Y.length>0&&l.jsx("div",{className:"absolute z-10 mt-1 max-h-48 w-full overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] shadow-lg",children:Y.map(B=>l.jsxs("button",{type:"button",onClick:()=>K(B),className:"flex w-full flex-col px-3 py-2 text-left hover:bg-[var(--color-surface-alt)]",children:[l.jsxs("span",{className:"text-sm font-medium text-[var(--color-text)]",children:[B.name,l.jsxs("span",{className:"ml-2 font-normal text-[var(--color-text-muted)]",children:[":",B.port]})]}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:B.description})]},B.id))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Description"}),l.jsx("input",{type:"text",value:se.description,onChange:B=>pe(U=>({...U,description:B.target.value})),placeholder:"e.g. Camera streaming via WebRTC",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Host"}),l.jsx("input",{type:"text",value:se.host,onChange:B=>pe(U=>({...U,host:B.target.value})),placeholder:"localhost",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Port"}),l.jsx("input",{type:"number",value:se.port,onChange:B=>pe(U=>({...U,port:B.target.value})),placeholder:"e.g. 1984",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"w-20",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Scheme"}),l.jsxs("select",{value:se.scheme,onChange:B=>pe(U=>({...U,scheme:B.target.value})),className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]"),children:[l.jsx("option",{value:"http",children:"http"}),l.jsx("option",{value:"https",children:"https"}),l.jsx("option",{value:"mqtt",children:"mqtt"}),l.jsx("option",{value:"mqtts",children:"mqtts"}),l.jsx("option",{value:"ws",children:"ws"}),l.jsx("option",{value:"wss",children:"wss"})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Health Path"}),l.jsx("input",{type:"text",value:se.health_path,onChange:B=>pe(U=>({...U,health_path:B.target.value})),placeholder:"/health",className:ae("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]})]}),l.jsx("div",{className:"mt-3 flex justify-end",children:l.jsx("button",{onClick:re,disabled:g.isPending||!se.name.trim()||!se.port,className:ae("rounded-lg bg-[var(--color-primary)] px-4 py-1.5 text-sm font-medium text-white","hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"),children:g.isPending?"Adding...":"Add Service"})})]}),l.jsx("div",{className:"space-y-2",children:a?.services.map(B=>{const U=ge(B.name),we=D[B.name]??{status:"idle"};return l.jsx(jE,{entry:B,checked:U.checked,host:U.host,port:U.port,scheme:U.scheme,onToggle:()=>{const xe=!U.checked;te(B.name,{...U,checked:xe}),xe?S(B.name,U.host,U.port,B.health_path,U.scheme):z(Ut=>({...Ut,[B.name]:{status:"idle"}}))},onHostChange:xe=>te(B.name,{...U,host:xe}),onPortChange:xe=>te(B.name,{...U,port:xe}),onSchemeChange:xe=>te(B.name,{...U,scheme:xe}),onHostBlur:()=>{U.checked&&S(B.name,U.host,U.port,B.health_path,U.scheme)},onPortBlur:()=>{U.checked&&S(B.name,U.host,U.port,B.health_path,U.scheme)},onRotateKey:()=>Q(B.name),onDelete:()=>Z(B.name),disabled:m.isPending,rotating:A===B.name,deleting:X===B.name,healthStatus:we.status,healthError:we.error,healthLatency:we.latency},B.name)})}),l.jsx("button",{onClick:L,disabled:m.isPending||ce===0,className:ae("rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white","hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"),children:m.isPending?"Registering...":`Register Selected (${ce})`}),E&&l.jsx(wE,{serviceName:E.service_name,appKey:E.app_key,envWritten:E.env_written,copiedKey:W,onCopy:fe,label:"Rotated Key"}),M&&l.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Registration Results"}),M.map(B=>l.jsxs("div",{className:ae("flex flex-wrap items-center gap-3 rounded-lg border p-3 text-sm",B.config_ok&&B.auth_ok?"border-green-500/20 bg-green-500/5":"border-yellow-500/20 bg-yellow-500/5"),children:[l.jsx("span",{className:"min-w-[180px] font-medium text-[var(--color-text)]",children:B.name}),l.jsxs("span",{className:ae("text-xs",B.config_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Config: ",B.config_ok?"OK":"Failed"]}),l.jsxs("span",{className:ae("text-xs",B.auth_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Auth: ",B.auth_ok?B.auth_created?"Created":"Exists":"Failed"]}),B.env_written!==null&&l.jsxs("span",{className:ae("text-xs",B.env_written?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",B.env_written?"Written":"Failed"]}),B.error&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),B.error]}),B.auth_created&&B.app_key&&l.jsxs("div",{className:"mt-1 w-full",children:[l.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),"App key (shown once only):"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"flex-1 overflow-x-auto rounded bg-[var(--color-background)] px-2 py-1 font-mono text-xs text-[var(--color-text)]",children:B.app_key}),l.jsx("button",{onClick:()=>fe(B.app_key),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:W===B.app_key?l.jsx(vi,{size:14,className:"text-green-500"}):l.jsx(Hd,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]},B.name))]}),Se&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-blue-500/20 bg-blue-500/5 p-3",children:[l.jsx(rS,{size:16,className:"mt-0.5 shrink-0 text-blue-500"}),l.jsx("p",{className:"text-sm text-[var(--color-text)]",children:"Services whose .env files were updated need to be restarted to pick up the new credentials. Restart each affected service's container or process."})]})]})}function wE({serviceName:a,appKey:s,envWritten:o,copiedKey:i,onCopy:d,label:f}){return l.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:[f,": ",a]}),l.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-3",children:[o!==null&&l.jsxs("span",{className:ae("mb-2 inline-block text-xs",o?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",o?"Written":"Failed"]}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(ra,{size:12}),"New app key (shown once only):"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"flex-1 overflow-x-auto rounded bg-[var(--color-background)] px-2 py-1 font-mono text-xs text-[var(--color-text)]",children:s}),l.jsx("button",{onClick:()=>d(s),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:i===s?l.jsx(vi,{size:14,className:"text-green-500"}):l.jsx(Hd,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]})]})}async function EE(){const{data:a}=await ve.get("/api/llm-setup/status");return a}async function CE(a){const{data:s}=await ve.post("/api/llm-setup/configure",{settings:a});return s}async function TE(a,s,o){const{data:i}=await ve.post("/api/llm-setup/download",{repo:a,filename:s,token:o});return i}function _E(){return yt({queryKey:["llm-status"],queryFn:EE,staleTime:3e4,retry:1})}function yg(){const a=ct();return bt({mutationFn:s=>CE(s),onSuccess:()=>{a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function RE(){return bt({mutationFn:({repo:a,filename:s,token:o})=>TE(a,s,o)})}async function Xd(){const{data:a}=await ve.get("/api/install/status");return a}async function kE(a){const s=a?.length?{services:a.join(",")}:{},{data:o}=await ve.get("/api/install/preflight",{params:s});return o}async function ME(){const{data:a}=await ve.get("/api/install/hardware");return a}async function qx(a){const{data:s}=await ve.post("/api/install/generate",a);return s}async function bg(){const{data:a}=await ve.get("/api/install/registry");return a}async function AE(){const{data:a}=await ve.get("/api/install/defaults");return a}const OE={running:"bg-emerald-500",exited:"bg-red-500",restarting:"bg-amber-500",paused:"bg-amber-500",created:"bg-gray-400",dead:"bg-red-700"};function zE(a){return a.match(/^Up (.+)$/)?.[1]??null}function Hx({container:a,onRestart:s,isRestarting:o}){const i=zE(a.status),d=a.ports.find(f=>f.public)?.public;return l.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[l.jsx("div",{className:ae("h-2.5 w-2.5 rounded-full",OE[a.state]??"bg-gray-400")}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:a.displayName??a.name}),a.description&&l.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:a.description})]}),l.jsx("span",{className:ae("rounded-full px-2 py-0.5 text-xs font-medium",a.state==="running"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-red-500/10 text-red-600 dark:text-red-400"),children:a.state})]}),l.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-2",children:l.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-text-muted)]",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[i&&l.jsxs("span",{children:["Up ",i]}),d&&l.jsxs("span",{children:[":",d]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[d&&l.jsx("a",{href:`http://localhost:${d}/health`,target:"_blank",rel:"noopener noreferrer",className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Open health endpoint",children:l.jsx(Pj,{size:13})}),l.jsx("button",{onClick:()=>s(a.id),disabled:o,className:ae("rounded p-1 hover:bg-[var(--color-surface-alt)]",o&&"animate-spin"),title:"Restart",children:l.jsx(Qd,{size:13})})]})]})})]})}async function DE(){const{data:a}=await ve.get("/api/update/check");return a}async function UE(){const{data:a}=await ve.get("/api/update/status");return a}async function LE(a){const{data:s}=await ve.post("/api/update/settings",{allowUpdates:a});return s}function Ng(){return yt({queryKey:["update-check"],queryFn:DE,staleTime:300*1e3,retry:1,refetchOnWindowFocus:!1})}const Gx="jarvis-update-dismissed-version";function Qx(){const a=wa(),{data:s}=Ng(),[o,i]=N.useState(()=>s?.latestVersion?localStorage.getItem(Gx)===s.latestVersion:!1);return!s?.updateAvailable||o?null:l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(qd,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Jarvis v",s.latestVersion," available"]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["You have v",s.currentVersion]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[s.releaseUrl&&l.jsx("a",{href:s.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Release notes"}),l.jsx("button",{onClick:()=>{localStorage.setItem(Gx,s.latestVersion),i(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/update"),className:"rounded-lg bg-green-600 px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Update"})]})]})}const $u="jarvis-admin:llm-setup-dismissed";function BE(){const a=wa(),[s,o]=N.useState(!1),{data:i,isLoading:d,isError:f,error:m,refetch:v,isFetching:g}=vg(),h=gg(),y=_E(),[x,j]=N.useState(()=>!!localStorage.getItem($u));N.useEffect(()=>{Xd().then(k=>{k.deployMode==="compose-export"&&o(!0)}).catch(()=>{})},[]);const M=!!y.data&&!y.data.configured&&!x,w=k=>{h.mutate(k,{onSuccess:()=>Me.success("Container restart initiated"),onError:X=>Me.error(`Restart failed: ${X.message}`)})};if(s)return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),l.jsx(Qx,{}),M&&l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(pd,{size:20,className:"text-[var(--color-primary)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem($u,"true"),j(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/llm-setup"),className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Set up LLM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xd,{size:20,className:"text-[var(--color-text-muted)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Sync compose to latest registry"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Regenerate docker-compose.yml, apply changes, and re-register services with config-service"})]})]}),l.jsx("button",{onClick:()=>a("/reconcile"),className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:"Sync now"})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-8 text-center",children:[l.jsx(Vd,{size:32,className:"mx-auto mb-3 text-[var(--color-text-muted)]"}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Running in Docker Compose mode"}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Container management is handled by your Docker environment (TrueNAS, Portainer, etc.). Use your platform's tools to view container status, logs, and restarts."})]})]});if(d)return l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})});if(f)return l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load containers"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:m?.message??"Unknown error"}),l.jsx("button",{onClick:()=>v(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]});const E=i?.containers??[],_=E.filter(k=>k.state==="running"),A=E.filter(k=>k.state!=="running");return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("span",{children:[_.length,"/",E.length," running"]}),l.jsx("button",{onClick:()=>v(),disabled:g,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",g&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14})})]})]}),l.jsx(Qx,{}),M&&l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(pd,{size:20,className:"text-[var(--color-primary)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem($u,"true"),j(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),l.jsx("button",{onClick:()=>a("/llm-setup"),className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Set up LLM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xd,{size:20,className:"text-[var(--color-text-muted)]"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Sync compose to latest registry"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Regenerate docker-compose.yml and apply changes — adds new background workers and services without recreating unchanged containers"})]})]}),l.jsx("button",{onClick:()=>a("/reconcile"),className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:"Sync now"})]}),E.length===0&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:i?.error?i.error:"No Jarvis containers found. Is Docker running?"})}),_.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Running"}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:_.map(k=>l.jsx(Hx,{container:k,onRestart:w,isRestarting:h.isPending&&h.variables===k.id},k.id))})]}),A.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Stopped"}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:A.map(k=>l.jsx(Hx,{container:k,onRestart:w,isRestarting:h.isPending&&h.variables===k.id},k.id))})]})]})}async function qE(){const{data:a}=await ve.get("/api/nodes");return a}async function HE(a){const{data:s}=await ve.get(`/api/nodes/${a}/nodes`);return s}async function GE(a){const{data:s}=await ve.post(`/api/nodes/${a}/train-adapter`);return s}function QE(){return yt({queryKey:["households"],queryFn:qE,staleTime:3e4})}function VE(a){return yt({queryKey:["household-nodes",a],queryFn:()=>HE(a),enabled:!!a,staleTime:3e4})}function FE(){const a=ct();return bt({mutationFn:GE,onSuccess:()=>{a.invalidateQueries({queryKey:["household-nodes"]})}})}function YE({node:a,onTrain:s,isTraining:o}){return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(On,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.name})]}),l.jsxs("span",{className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a.is_active?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-500"),children:[a.is_active?l.jsx(ii,{size:10}):l.jsx(ZS,{size:10}),a.is_active?"Active":"Inactive"]})]}),l.jsxs("div",{className:"mt-3 space-y-1 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"ID:"})," ",a.node_id]}),a.services.length>0&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Services:"})," ",a.services.join(", ")]})]}),l.jsx("div",{className:"mt-4",children:l.jsx("button",{onClick:()=>s(a.node_id),disabled:o||!a.is_active,className:ae("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",o||!a.is_active?"cursor-not-allowed bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:o?l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(it,{size:12,className:"animate-spin"}),"Training..."]}):"Train Adapter"})})]})}function XE({householdId:a,householdName:s}){const{data:o,isLoading:i,isError:d}=VE(a),f=FE(),m=v=>{f.mutate(v,{onSuccess:g=>Me.success(`Training triggered for ${v} (request: ${g.request_id.slice(0,8)}...)`),onError:g=>Me.error(`Training failed: ${g.message}`)})};return l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:s}),i&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:18})}),d&&l.jsx("p",{className:"py-4 text-center text-sm text-red-500",children:"Failed to load nodes"}),o&&o.length===0&&l.jsx("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:"No nodes registered in this household"}),o&&o.length>0&&l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:o.map(v=>l.jsx(YE,{node:v,onTrain:m,isTraining:f.isPending&&f.variables===v.node_id},v.node_id))})]})}function KE(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=QE();return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load households"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Nodes"}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14,className:"text-[var(--color-text-muted)]"})})]}),(!a||a.length===0)&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No households found. Register a household in jarvis-auth first."})}),a?.map(m=>l.jsx(XE,{householdId:m.id,householdName:m.name},m.id))]})}async function $E(){const{data:a}=await ve.get("/api/admin/households");return a}async function ZE(){const{data:a}=await ve.get("/api/admin/nodes");return a}async function JE(){const{data:a}=await ve.get("/api/admin/users");return a}async function PE(a,s={}){const{data:o}=await ve.post(`/api/admin/users/${a}/temp-password`,s);return o}function IE(){return yt({queryKey:["admin-users"],queryFn:JE,staleTime:3e4})}function WE(){const a=ct();return bt({mutationFn:({userId:s,options:o})=>PE(s,o),onSuccess:()=>{a.invalidateQueries({queryKey:["admin-users"]})}})}function Zu({tone:a,children:s}){const o={green:"bg-green-500/10 text-green-500",red:"bg-red-500/10 text-red-500",amber:"bg-amber-500/10 text-amber-500",blue:"bg-blue-500/10 text-blue-500"};return l.jsx("span",{className:ae("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",o[a]),children:s})}function e4({result:a,email:s,onDismiss:o}){const i=async()=>{try{await navigator.clipboard.writeText(a.temp_password),Me.success("Temporary password copied")}catch{Me.error("Copy failed — select it manually")}};return l.jsxs("div",{className:"rounded-lg border border-amber-500/40 bg-amber-500/5 p-4",children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Temporary password for ",s]}),l.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-[var(--color-surface-alt)] px-3 py-1.5 font-mono text-base tracking-wide text-[var(--color-text)]",children:a.temp_password}),l.jsx("button",{onClick:i,className:"rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:l.jsx(Hd,{size:14,className:"text-[var(--color-text-muted)]"})})]}),l.jsxs("p",{className:"mt-2 text-xs text-[var(--color-text-muted)]",children:["Shown once — it is not stored anywhere. Valid until"," ",new Date(a.expires_at).toLocaleString(),". All of the user's sessions were signed out; on their next login they'll be asked to set a new password."]}),l.jsx("button",{onClick:o,className:"mt-3 rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs font-medium text-white hover:opacity-90",children:"Done"})]})}function t4({user:a,onCancel:s,onConfirm:o,isPending:i}){const[d,f]=N.useState(""),m=d.length>0&&d.length<8;return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("p",{className:"text-sm text-[var(--color-text)]",children:["Reset the password for ",l.jsx("span",{className:"font-medium",children:a.email}),"? This signs the user out everywhere and replaces their password with a temporary one they must change at next login."]}),l.jsxs("div",{className:"mt-3",children:[l.jsx("input",{type:"text",value:d,onChange:v=>f(v.target.value),placeholder:"Custom temp password (optional — leave blank to generate)",className:"w-full max-w-md rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"}),m&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Must be at least 8 characters"})]}),l.jsxs("div",{className:"mt-3 flex gap-2",children:[l.jsx("button",{onClick:()=>o(d||null),disabled:i||m,className:ae("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",i||m?"cursor-not-allowed bg-[var(--color-surface)] text-[var(--color-text-muted)]":"bg-red-500 text-white hover:opacity-90"),children:i?l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(it,{size:12,className:"animate-spin"}),"Resetting..."]}):"Reset password"}),l.jsx("button",{onClick:s,disabled:i,className:"rounded-lg px-3 py-1.5 text-xs font-medium text-[var(--color-text-muted)] hover:bg-[var(--color-surface)]",children:"Cancel"})]})]})}function a4({user:a}){const[s,o]=N.useState("idle"),[i,d]=N.useState(null),f=WE(),m=v=>{f.mutate({userId:a.id,options:v?{temp_password:v}:{}},{onSuccess:g=>{o("idle"),d(g)},onError:g=>Me.error(`Reset failed: ${g.message}`)})};return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.email}),a.is_superuser&&l.jsxs(Zu,{tone:"blue",children:[l.jsx(zS,{size:10}),"Superuser"]}),!a.is_active&&l.jsxs(Zu,{tone:"red",children:[l.jsx(FS,{size:10}),"Deactivated"]}),a.must_change_password&&l.jsxs(Zu,{tone:"amber",children:[l.jsx(Fj,{size:10}),"Temp password"]})]}),l.jsxs("div",{className:"mt-1 space-y-0.5 text-xs text-[var(--color-text-muted)]",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Username:"})," ",a.username]}),a.households.length>0&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Households:"})," ",a.households.map(v=>`${v.household_name} (${v.role})`).join(", ")]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Created:"})," ",new Date(a.created_at).toLocaleDateString()]})]})]}),s==="idle"&&!i&&l.jsxs("button",{onClick:()=>o("confirm"),disabled:!a.is_active,title:a.is_active?void 0:"Reactivate the account first",className:ae("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",a.is_active?"bg-[var(--color-surface-alt)] text-[var(--color-text)] hover:bg-[var(--color-primary)]/10 hover:text-[var(--color-primary)]":"cursor-not-allowed bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[l.jsx(lS,{size:12}),"Reset password"]})]}),s==="confirm"&&l.jsx("div",{className:"mt-3",children:l.jsx(t4,{user:a,onCancel:()=>o("idle"),onConfirm:m,isPending:f.isPending})}),i&&l.jsx("div",{className:"mt-3",children:l.jsx(e4,{result:i,email:a.email,onDismiss:()=>d(null)})})]})}function n4(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=IE();return s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(it,{className:"animate-spin text-[var(--color-primary)]",size:24})}):o?l.jsxs("div",{className:"py-20 text-center",children:[l.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load users"}),l.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),l.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):l.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Users"}),l.jsx("button",{onClick:()=>d(),disabled:f,className:ae("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:l.jsx(it,{size:14,className:"text-[var(--color-text-muted)]"})})]}),a&&a.length===0&&l.jsx("div",{className:"py-12 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No users found."})}),l.jsx("div",{className:"space-y-3",children:a?.map(m=>l.jsx(a4,{user:m},m.id))})]})}async function r4(){const{data:a}=await ve.get("/api/native-services");return a}async function s4(a){const{data:s}=await ve.post(`/api/native-services/${a}/restart`);return s}async function l4(a){const{data:s}=await ve.post(`/api/native-services/${a}/stop`);return s}async function o4(a){const{data:s}=await ve.post(`/api/native-services/${a}/uninstall`);return s}async function i4(a,s="stderr",o=200){const{data:i}=await ve.get(`/api/native-services/${a}/logs`,{params:{stream:s,lines:o}});return i}const Ni=["native-services"];function c4(){return yt({queryKey:Ni,queryFn:r4,staleTime:5e3,refetchInterval:5e3})}function jg(){const a=ct();return bt({mutationFn:s=>s4(s),onSuccess:()=>a.invalidateQueries({queryKey:Ni})})}function u4(){const a=ct();return bt({mutationFn:s=>l4(s),onSuccess:()=>a.invalidateQueries({queryKey:Ni})})}function d4(){const a=ct();return bt({mutationFn:s=>o4(s),onSuccess:()=>a.invalidateQueries({queryKey:Ni})})}function f4(a,s,o){return yt({queryKey:["native-services-logs",a,s],queryFn:()=>i4(a,s,200),enabled:o,staleTime:3e3,refetchInterval:o?3e3:!1})}function m4(){const{data:a,isLoading:s,isError:o,error:i,refetch:d,isFetching:f}=c4();return s?l.jsx("div",{className:"p-6",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading native services…"})}):o?l.jsx("div",{className:"p-6",children:l.jsx(p4,{message:i instanceof Error?i.message:String(i)})}):a?a.supported?l.jsxs("div",{className:"p-6",children:[l.jsxs("header",{className:"mb-4 flex items-start justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Native Services"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["macOS LaunchAgents — these services run outside Docker so they can use the Apple GPU (MLX / Metal / MPS). Status reflects ",l.jsx("code",{children:"launchctl print"}),"."]})]}),l.jsxs("button",{type:"button",onClick:()=>d(),disabled:f,className:ae("flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors",f&&"opacity-50"),children:[l.jsx(it,{size:14,className:f?"animate-spin":""}),"Refresh"]})]}),a.services.length===0?l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No native-capable services are registered. Re-run the install wizard to add them."})}):l.jsx("div",{className:"space-y-3",children:a.services.map(m=>l.jsx(h4,{service:m},m.id))})]}):l.jsxs("div",{className:"p-6",children:[l.jsxs("header",{className:"mb-4",children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Native Services"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Manage Jarvis services running as macOS LaunchAgents."})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Native services are only available on macOS. On Linux all services run in Docker."})})]}):null}function h4({service:a}){const s=jg(),o=u4(),i=d4(),[d,f]=N.useState(!1),[m,v]=N.useState("stderr"),g=f4(a.id,m,d),{status:h}=a;async function y(w,E){try{await w,Me.success(E)}catch(_){Me.error(_ instanceof Error?_.message:String(_))}}async function x(){confirm(`Uninstall ${a.id}? The LaunchAgent will be removed; source files at ${h.sourceDir??"~/.jarvis/native"} stay on disk.`)&&await y(i.mutateAsync(a.id),`${a.id} uninstalled`)}const j=h.installed?h.running?`Running (pid ${h.pid??"?"})`:"Installed, stopped":"Not installed",M=h.installed?h.running?"bg-green-500":"bg-amber-500":"bg-[var(--color-text-muted)]/30";return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:ae("h-2.5 w-2.5 shrink-0 rounded-full",M)}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:a.name}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",h.port??a.port]}),l.jsx("code",{className:"text-xs text-[var(--color-text-muted)]",children:h.label})]}),l.jsxs("p",{className:"ml-5 mt-0.5 text-xs text-[var(--color-text-muted)]",children:[j,h.sourceDir&&l.jsxs("span",{className:"ml-2 opacity-60",children:["· ",h.sourceDir]})]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.installed&&l.jsxs(l.Fragment,{children:[h.running?l.jsx(pl,{icon:BS,label:"Stop",onClick:()=>y(o.mutateAsync(a.id),`${a.id} stopped`),disabled:o.isPending}):l.jsx(pl,{icon:ag,label:"Start",onClick:()=>y(s.mutateAsync(a.id),`${a.id} started`),disabled:s.isPending}),h.running&&l.jsx(pl,{icon:Qd,label:"Restart",onClick:()=>y(s.mutateAsync(a.id),`${a.id} restarted`),disabled:s.isPending}),l.jsx(pl,{icon:tg,label:d?"Hide logs":"Logs",onClick:()=>f(w=>!w)}),l.jsx(pl,{icon:bi,label:"Uninstall",onClick:x,disabled:i.isPending,danger:!0})]}),!h.installed&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:[l.jsx(On,{size:12})," Re-run install wizard to enable"]})]})]}),d&&h.installed&&l.jsxs("div",{className:"border-t border-[var(--color-border)] bg-[var(--color-background)] p-3",children:[l.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[l.jsx(Vx,{active:m==="stderr",onClick:()=>v("stderr"),children:"stderr"}),l.jsx(Vx,{active:m==="stdout",onClick:()=>v("stdout"),children:"stdout"}),l.jsx("code",{className:"ml-2 text-xs text-[var(--color-text-muted)] opacity-60",children:g.data?.file})]}),l.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap rounded bg-[var(--color-surface-alt)] p-2 text-xs font-mono text-[var(--color-text)]",children:g.isLoading?"Loading…":g.isError?`Failed to load logs: ${g.error instanceof Error?g.error.message:String(g.error)}`:g.data?.content||"(empty)"})]})]})}function pl({icon:a,label:s,onClick:o,disabled:i,danger:d}){return l.jsxs("button",{type:"button",onClick:o,disabled:i,className:ae("flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs","transition-colors disabled:cursor-not-allowed disabled:opacity-50",d?"border-red-500/30 text-red-500 hover:bg-red-500/10":"border-[var(--color-border)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-text)]"),children:[l.jsx(a,{size:12}),s]})}function Vx({active:a,onClick:s,children:o}){return l.jsx("button",{type:"button",onClick:s,className:ae("rounded px-2 py-0.5 text-xs",a?"bg-[var(--color-primary)] text-white":"border border-[var(--color-border)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:o})}function p4({message:a}){return l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-500",children:[l.jsx(Bd,{size:14}),a]})}async function x4(){const{data:a}=await ve.get("/api/models/installed");return a.models}async function v4(a){const{data:s}=await ve.post("/api/models/download",a);return s}async function g4(a){await ve.delete(`/api/models/${encodeURIComponent(a)}`)}async function y4(a){const{data:s}=await ve.post("/api/models/whisper-autodownload",{enabled:a});return s}function Sg(){return yt({queryKey:["models","installed"],queryFn:x4,staleTime:1e4})}function wg(){const a=ct();return bt({mutationFn:s=>v4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}function b4(){const a=ct();return bt({mutationFn:s=>g4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}const ss=[{id:"qwen3-4b",displayName:"Qwen 3 4B",hfRepoVllm:"Qwen/Qwen3-4B-AWQ",hfRepoGguf:"Qwen/Qwen3-4B-GGUF",ggufFilename:"Qwen3-4B-Q4_K_M.gguf",chatFormat:"chatml",contextWindow:40960,sizeVllm:"2.5GB",sizeGguf:"2.5GB",vramMb:4096,gated:!1,quantization:"awq",promptProvider:"Qwen3_8B_Compressed"},{id:"qwen3-8b",displayName:"Qwen 3 8B",hfRepoVllm:"Qwen/Qwen3-8B-AWQ",hfRepoGguf:"Qwen/Qwen3-8B-GGUF",ggufFilename:"Qwen3-8B-Q4_K_M.gguf",chatFormat:"chatml",contextWindow:40960,sizeVllm:"5.7GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Qwen3_8B_Compressed"},{id:"qwen3-14b",displayName:"Qwen 3 14B",hfRepoVllm:"Qwen/Qwen3-14B-AWQ",hfRepoGguf:"Qwen/Qwen3-14B-GGUF",ggufFilename:"Qwen3-14B-Q4_K_M.gguf",chatFormat:"chatml",contextWindow:40960,sizeVllm:"9.4GB",sizeGguf:"9GB",vramMb:12288,gated:!1,quantization:"awq",promptProvider:"Qwen3LargeUntrained"},{id:"qwen25-7b",displayName:"Qwen 2.5 7B Instruct",hfRepoVllm:"Qwen/Qwen2.5-7B-Instruct-AWQ",hfRepoGguf:"Qwen/Qwen2.5-7B-Instruct-GGUF",ggufFilename:"qwen2.5-7b-instruct-q4_k_m.gguf",chatFormat:"chatml",contextWindow:32768,sizeVllm:"4.7GB",sizeGguf:"4.7GB",vramMb:6144,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{id:"llama-3.1-8b",displayName:"Llama 3.1 8B Instruct",hfRepoVllm:"hugging-quants/Meta-Llama-3.1-8B-Instruct-AWQ-INT4",hfRepoGguf:"lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF",ggufFilename:"Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf",chatFormat:"llama-3",contextWindow:131072,sizeVllm:"5.4GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Llama31MediumUntrained"},{id:"hermes-3-8b",displayName:"Hermes 3 Llama 3.1 8B",hfRepoVllm:"solidrust/Hermes-3-Llama-3.1-8B-AWQ",hfRepoGguf:"NousResearch/Hermes-3-Llama-3.1-8B-GGUF",ggufFilename:"Hermes-3-Llama-3.1-8B.Q4_K_M.gguf",chatFormat:"chatml",contextWindow:131072,sizeVllm:"5.4GB",sizeGguf:"4.9GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"HermesMediumUntrained"}];function N4(){const[a,s]=N.useState(""),[o,i]=N.useState(""),[d,f]=N.useState(""),[m,v]=N.useState(null),{data:g,isLoading:h}=Sg(),y=wg(),x=b4();function j(E,_){const A=`${E}/${_??""}`;v(A),y.mutate({repo:E,filename:_||void 0,token:a||void 0},{onSuccess:k=>{Me.success(k.message),v(null)},onError:k=>{Me.error(k instanceof Error?k.message:"Download failed"),v(null)}})}function M(E){confirm(`Delete ${E}?`)&&x.mutate(E,{onSuccess:()=>Me.success(`Deleted ${E}`),onError:()=>Me.error("Failed to delete")})}function w(){o&&j(o,d)}return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Manage LLM models on the inference server"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(iS,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Token"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"(optional, for gated models)"})]}),l.jsx("input",{type:"password",value:a,onChange:E=>s(E.target.value),placeholder:"hf_...",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Gd,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Installed Models"})]}),h?l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading..."}):g?.length?l.jsx("div",{className:"space-y-2",children:g.map(E=>l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-3 py-2",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:E.name}),l.jsx("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:E.sizeFormatted})]}),l.jsx("button",{onClick:()=>M(E.name),disabled:x.isPending,className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",children:l.jsx(bi,{size:14})})]},E.name))}):l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No models installed yet"})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(US,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Suggested Models"})]}),l.jsx("div",{className:"space-y-3",children:ss.map(E=>{const _=g?.some(A=>A.name===E.ggufFilename||A.name.includes(E.ggufFilename));return l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-4 py-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:E.displayName}),l.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:["~",E.sizeGguf]}),_&&l.jsx("span",{className:"rounded bg-green-500/10 px-1.5 py-0.5 text-xs text-green-500",children:"installed"})]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[E.hfRepoGguf," / ",E.ggufFilename]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Prompt provider: ",l.jsx("code",{className:"text-[var(--color-primary)]",children:E.promptProvider})]})]}),l.jsxs("button",{onClick:()=>j(E.hfRepoGguf,E.ggufFilename),disabled:m!==null,className:ae("ml-4 flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",_?"border border-[var(--color-border)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[l.jsx(za,{size:14}),m===`${E.hfRepoGguf}/${E.ggufFilename}`?"Downloading...":_?"Re-download":"Download"]})]},E.id)})})]}),l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(za,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Download from HuggingFace"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Repository (e.g. Qwen/Qwen3-14B-GGUF)"}),l.jsx("input",{value:o,onChange:E=>i(E.target.value),placeholder:"owner/repo-name",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Filename (optional — downloads specific file instead of full repo)"}),l.jsx("input",{value:d,onChange:E=>f(E.target.value),placeholder:"model-name.gguf",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("button",{onClick:w,disabled:!o||m!==null,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[l.jsx(za,{size:14}),m===`${o}/${d}`?"Downloading...":"Download"]})]})]})]})}async function j4(){const{data:a}=await ve.get("/api/quick-sets");return a}async function S4(a){const{data:s}=await ve.post("/api/quick-sets/apply",a);return s}async function w4(a){const{data:s}=await ve.post("/api/quick-sets/custom",a);return s}async function E4(a){const{data:s}=await ve.delete(`/api/quick-sets/custom/${a}`);return s}function C4(){return yt({queryKey:["quick-sets"],queryFn:j4,staleTime:6e4})}function T4(){const a=ct();return bt({mutationFn:s=>S4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]}),a.invalidateQueries({queryKey:["settings"]}),a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function _4(){const a=ct();return bt({mutationFn:s=>w4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}function R4(){const a=ct();return bt({mutationFn:s=>E4(s),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}const Fx=["GGUF","MLX","VLLM","TRANSFORMERS","REST"];function k4(){const{data:a,isLoading:s,error:o}=C4(),i=T4(),d=_4(),f=R4(),{data:m}=Sg(),v=N.useMemo(()=>(m??[]).map(U=>`.models/${U.name}`),[m]),[g,h]=N.useState(null),[y,x]=N.useState(""),[j,M]=N.useState(!1),[w,E]=N.useState(""),[_,A]=N.useState(""),[k,X]=N.useState(""),[I,W]=N.useState(""),[ee,D]=N.useState(new Set(["live"])),[z,oe]=N.useState(!1),[be,se]=N.useState(""),[pe,Ee]=N.useState(""),[he,ne]=N.useState(""),[C,Y]=N.useState(""),[K,ge]=N.useState("GGUF"),[te,S]=N.useState(8192),L=a?.presets,Q=N.useMemo(()=>{if(!L)return new Map;const U=new Map;for(const we of L){const xe=we.family||"Custom",Ut=U.get(xe)??[];Ut.push(we),U.set(xe,Ut)}return U},[L]);function Z(U){if(g===U.id){h(null);return}h(U.id),x(a?.currentValues.modelName??""),M(!1),A(U.defaultBackend),X(U.chatFormat),W(U.promptProvider);const we=a?.currentValues.contextWindow;E(we&&we>0?we:U.defaultContextWindow)}function re(U){D(we=>{const xe=new Set(we);return xe.has(U)?xe.size>1&&xe.delete(U):xe.add(U),xe})}function fe(){!g||!y.trim()||i.mutate({presetId:g,modelName:y.trim(),contextWindow:w?Number(w):void 0,backend:_,chatFormat:k,promptProvider:I,targets:Array.from(ee)},{onSuccess:U=>{U.success?Me.success(U.message):Me.warning(U.message),h(null)},onError:U=>{Me.error(U.message||"Failed to apply preset")}})}function ce(){!be.trim()||!he.trim()||!C.trim()||d.mutate({name:be.trim(),family:pe.trim()||"Custom",chatFormat:he.trim(),promptProvider:C.trim(),defaultBackend:K,defaultContextWindow:te?Number(te):8192},{onSuccess:()=>{Me.success(`Created preset "${be.trim()}"`),oe(!1),se(""),Ee(""),ne(""),Y(""),ge("GGUF"),S(8192)},onError:U=>{Me.error(U.message||"Failed to create preset")}})}function Se(U){f.mutate(U.id,{onSuccess:()=>{Me.success(`Deleted "${U.name}"`),g===U.id&&h(null)},onError:()=>Me.error("Failed to delete preset")})}const B=a?.presets.find(U=>U.id===g);return l.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Quick Sets"}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Select a model preset to auto-configure chat format, prompt provider, and backend"})]}),a?.currentValues.modelName&&l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3",children:[l.jsx(On,{size:16,className:"text-[var(--color-primary)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Current model"}),l.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:a.currentValues.modelName})]}),a.currentValues.contextWindow>0&&l.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-2 py-0.5 text-xs text-[var(--color-text-muted)]",children:[a.currentValues.contextWindow.toLocaleString()," ctx"]})]}),s&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(it,{size:20,className:"animate-spin text-[var(--color-text-muted)]"})}),o&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-4 py-3",children:[l.jsx(ra,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:"Failed to load presets"})]}),!s&&Array.from(Q.entries()).map(([U,we])=>l.jsxs("section",{children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text-muted)]",children:U}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:we.map(xe=>l.jsxs("div",{className:ae("relative rounded-lg border px-4 py-3 transition-colors",g===xe.id?"border-[var(--color-primary)] bg-[var(--color-primary)]/5":"border-[var(--color-border)] bg-[var(--color-surface)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("button",{onClick:()=>Z(xe),className:"w-full text-left",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:xe.name}),g===xe.id&&l.jsx(vi,{size:16,className:"text-[var(--color-primary)]"})]}),xe.description&&l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:xe.description}),l.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[l.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:xe.chatFormat}),l.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:xe.defaultBackend})]})]}),xe.isCustom&&l.jsx("button",{onClick:()=>Se(xe),disabled:f.isPending,className:"absolute right-2 top-2 rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",title:"Delete custom preset",children:l.jsx(bi,{size:14})})]},xe.id))})]},U)),!s&&!z&&l.jsxs("button",{onClick:()=>oe(!0),className:"flex items-center gap-2 rounded-lg border border-dashed border-[var(--color-border)] px-4 py-3 text-sm text-[var(--color-text-muted)] transition-colors hover:border-[var(--color-primary)] hover:text-[var(--color-primary)]",children:[l.jsx(ai,{size:16}),"Create custom preset"]}),z&&l.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ai,{size:16,className:"text-[var(--color-primary)]"}),l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"New Custom Preset"})]}),l.jsx("button",{onClick:()=>oe(!1),className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:l.jsx(Fd,{size:16})})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Name *"}),l.jsx("input",{type:"text",value:be,onChange:U=>se(U.target.value),placeholder:"My Custom Model",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Family"}),l.jsx("input",{type:"text",value:pe,onChange:U=>Ee(U.target.value),placeholder:"Custom",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format *"}),l.jsx("input",{type:"text",value:he,onChange:U=>ne(U.target.value),placeholder:"chatml",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider *"}),l.jsx("input",{type:"text",value:C,onChange:U=>Y(U.target.value),placeholder:"Qwen25MediumUntrained",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default backend"}),l.jsx("select",{value:K,onChange:U=>ge(U.target.value),className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:Fx.map(U=>l.jsx("option",{value:U,children:U},U))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default context window"}),l.jsx("input",{type:"number",value:te,onChange:U=>S(U.target.value?parseInt(U.target.value,10):""),placeholder:"8192",min:1,className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[l.jsxs("button",{onClick:ce,disabled:!be.trim()||!he.trim()||!C.trim()||d.isPending,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[d.isPending?l.jsx(it,{size:14,className:"animate-spin"}):l.jsx(ai,{size:14}),d.isPending?"Creating...":"Create Preset"]}),l.jsx("button",{onClick:()=>oe(!1),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]}),B&&l.jsxs("section",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx(ii,{size:16,className:"text-[var(--color-primary)]"}),l.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:["Apply: ",B.name]})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("span",{className:"mb-2 block text-xs font-medium text-[var(--color-text-muted)]",children:"Apply to"}),l.jsx("div",{className:"flex items-center gap-4",children:["live","background"].map(U=>l.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[l.jsx("input",{type:"checkbox",checked:ee.has(U),onChange:()=>re(U),className:"rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),l.jsx("span",{className:"capitalize",children:U})]},U))})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Model file path"}),v.length>0&&l.jsxs("select",{value:j||y!==""&&!v.includes(y)?"__other__":y,onChange:U=>{U.target.value==="__other__"?M(!0):(M(!1),x(U.target.value))},className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"",disabled:!0,children:"Select a model…"}),v.map(U=>l.jsx("option",{value:U,children:U.replace(/^\.models\//,"")},U)),l.jsx("option",{value:"__other__",children:"Other (custom path / HF ID)…"})]}),(v.length===0||j||y!==""&&!v.includes(y))&&l.jsx("input",{type:"text",value:y,onChange:U=>x(U.target.value),placeholder:".models/model-name.gguf",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format"}),l.jsx("input",{type:"text",value:k,onChange:U=>X(U.target.value),placeholder:"chatml",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider"}),l.jsx("input",{type:"text",value:I,onChange:U=>W(U.target.value),placeholder:"Qwen25MediumUntrained",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Context window (tokens)"}),l.jsx("input",{type:"number",value:w,onChange:U=>E(U.target.value?parseInt(U.target.value,10):""),placeholder:String(B.defaultContextWindow),min:1,className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Backend"}),l.jsx("select",{value:_,onChange:U=>A(U.target.value),className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:Fx.map(U=>l.jsx("option",{value:U,children:U},U))})]})]})]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[l.jsxs("button",{onClick:fe,disabled:!y.trim()||i.isPending,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[i.isPending?l.jsx(it,{size:14,className:"animate-spin"}):l.jsx(ii,{size:14}),i.isPending?"Applying...":"Apply Settings"]}),l.jsx("button",{onClick:()=>h(null),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]})}const $o={preflight:"Checking prerequisites",download:"Downloading update",binary:"Updating binary",restarting:"Restarting admin server",compose:"Updating configuration",pull:"Pulling images",restart:"Restarting services",native:"Updating native services",verify:"Verifying health",done:"Complete"};function M4(){const a=wa(),s=ct(),{data:o,isLoading:i}=Ng(),[d,f]=N.useState("idle"),[m,v]=N.useState([]),[g,h]=N.useState(null),[y,x]=N.useState(!1),[j,M]=N.useState(!1),w=N.useRef(null),E=o?.updatesEnabled,_=N.useCallback(async W=>{x(!0),h(null);try{await LE(W),await s.invalidateQueries({queryKey:["update-check"]})}catch{h(W?"Could not turn on update checks. You need to be signed in as an admin.":"Could not turn off update checks.")}finally{x(!1)}},[s]),A=N.useCallback(W=>{v(ee=>[...ee,W])},[]);N.useEffect(()=>{w.current&&(w.current.scrollTop=w.current.scrollHeight)},[m]);const k=N.useCallback(async()=>{const W=Date.now()+12e5;let ee="";for(;Date.now()<W;){try{const D=await UE();if(D.phase==="error"){const z=D.error??"Upgrade failed after restart";h(z),f("error"),A({text:`Error: ${z}`});return}if(!D.inProgress){f("done"),A({text:"Upgrade complete!"}),await s.invalidateQueries({queryKey:["update-check"]});return}if(D.phase&&D.phase!==ee){ee=D.phase;const z=$o[D.phase];z&&A({text:`${z}...`}),D.phase==="native"&&M(!0),f(D.phase==="binary-updated"?"compose":D.phase)}}catch{}await new Promise(D=>setTimeout(D,3e3))}h("Upgrade is taking longer than expected — check the admin logs."),f("error")},[A,s]);async function X(){f("preflight"),v([]),h(null);try{const W=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),ee=await fetch("/api/update/apply",{method:"POST",headers:{Authorization:`Bearer ${W}`}});if(!ee.ok||!ee.body){const be=await ee.text();throw new Error(be||`HTTP ${ee.status}`)}const D=ee.body.getReader(),z=new TextDecoder;let oe="";for(;;){const{done:be,value:se}=await D.read();if(be)break;oe+=z.decode(se,{stream:!0});const pe=oe.split(`
17
+ `);oe=pe.pop()??"";for(const Ee of pe)if(Ee.startsWith("data: "))try{const he=JSON.parse(Ee.slice(6));if(he.phase==="native"&&M(!0),he.phase&&f(he.phase),he.message&&A({text:he.message,phase:he.phase}),he.stream&&he.text&&A({text:he.text.trim()}),he.restart){f("restarting"),A({text:"Admin server restarting with new version..."}),await A4(o?.latestVersion??""),A({text:"Admin back up. Finishing upgrade (configuration, images, services)..."}),await k();return}if(he.done&&he.code!==0)throw new Error(he.error??"Upgrade failed");he.done&&he.code===0&&f("done")}catch(he){if(he instanceof SyntaxError)continue;throw he}}}catch(W){const ee=W instanceof Error?W.message:String(W);h(ee),f("error"),A({text:`Error: ${ee}`})}}if(i)return l.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:l.jsx(Ct,{size:24,className:"animate-spin text-[var(--color-primary)]"})});const I=Object.keys($o).filter(W=>{const ee=Object.keys($o),D=ee.indexOf(d);return ee.indexOf(W)<D});return l.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Update Jarvis"}),E===!1?l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["Update checks are off — currently running v",o?.currentVersion??"?"]}):o?.updateAvailable?l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["v",o.currentVersion," → v",o.latestVersion]}):l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["You're running the latest version (v",o?.currentVersion??"?",")"]})]}),l.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(za,{size:16,className:"text-[var(--color-text-muted)]"}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Check for updates"})]}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Lets Jarvis contact GitHub to see if a new release is available. This is the only outbound connection it makes — turn it off to stay fully offline."})]}),l.jsx("button",{role:"switch","aria-checked":E===!0,"aria-label":"Check for updates",disabled:y||E===void 0,onClick:()=>_(!E),className:ae("relative mt-1 h-6 w-11 shrink-0 rounded-full border-0 p-0 transition-colors disabled:opacity-50",E?"bg-green-600":"bg-[var(--color-border)]"),children:l.jsx("span",{className:ae("absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white shadow-sm transition-transform",E?"translate-x-5":"translate-x-0")})})]}),d!=="idle"&&l.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries($o).filter(([W])=>W!=="native"||j).map(([W,ee])=>{const D=W===d,z=I.includes(W),oe=W===d&&d==="error";return l.jsxs("div",{className:"flex items-center gap-2",children:[z?l.jsx(pt,{size:16,className:"text-green-500"}):oe?l.jsx(ra,{size:16,className:"text-red-500"}):D?l.jsx(Ct,{size:16,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),l.jsx("span",{className:ae("text-sm",D?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",z&&"text-green-500"),children:ee})]},W)})}),m.length>0&&l.jsx("div",{ref:w,className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[#0d1117] p-3 font-mono text-xs text-gray-300",children:m.map((W,ee)=>l.jsx("div",{children:W.text},ee))}),g&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(ra,{size:14,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:g})]}),l.jsxs("div",{className:"flex gap-3",children:[d==="idle"&&o?.updateAvailable&&l.jsxs("button",{onClick:X,className:"flex items-center gap-2 rounded-lg bg-green-600 px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(qd,{size:16}),"Update to v",o.latestVersion]}),d==="done"&&l.jsxs("button",{onClick:()=>a("/dashboard"),className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(pt,{size:16}),"Go to Dashboard"]}),d==="error"&&l.jsxs("button",{onClick:X,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(it,{size:16}),"Retry"]})]})]})}async function A4(a,s=6e4){const o=Date.now()+s;for(;Date.now()<o;){await new Promise(i=>setTimeout(i,2e3));try{const i=await fetch("/health");if(i.ok){const d=await i.json();if(d.version&&d.version!=="0.0.0-dev")return}}catch{}}throw new Error("Admin server did not restart within 60 seconds")}const Ju={regenerate:"Regenerating compose from registry",pull:"Pulling images for new release track",apply:"Applying changes (docker compose up)",done:"Complete"};function O4(){const a=wa(),s=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),[o,i]=N.useState("loading_options"),[d,f]=N.useState([]),[m,v]=N.useState(null),g=N.useRef(null),[h,y]=N.useState([]),[x,j]=N.useState(!1),[M,w]=N.useState("https://relay.jarvisautomation.io"),[E,_]=N.useState("/whisper-models/ggml-base.en.bin"),[A,k]=N.useState("cpu"),[X,I]=N.useState("cpu"),[W,ee]=N.useState(!1),[D,z]=N.useState("stable"),[oe,be]=N.useState(null),[se,pe]=N.useState(!1),Ee=N.useCallback(te=>{f(S=>[...S,te])},[]);N.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[d]),N.useEffect(()=>{async function te(){try{const S=await fetch("/api/install/reconcile/options",{headers:{Authorization:`Bearer ${s}`}});if(!S.ok)throw new Error(`HTTP ${S.status}`);const L=await S.json();y(L.services),j(L.relayEnabled),w(L.relayUrl||"https://relay.jarvisautomation.io"),_(L.whisperModelPath||"/whisper-models/ggml-base.en.bin"),k(L.whisperBackend??"cpu"),I(L.ttsBackend??"cpu"),ee(L.pinImages??!1),z(L.releaseTrack??"stable"),i("options")}catch(S){v(S instanceof Error?S.message:"Failed to load options"),i("error")}}te()},[s]);function he(te){y(S=>S.map(L=>L.id===te?{...L,enabled:!L.enabled}:L))}async function ne(){i("regenerate"),f([]),v(null);const te=h.filter(S=>S.enabled).map(S=>S.id);try{const S=await fetch("/api/install/reconcile",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({enabledModules:te,relayEnabled:x,relayUrl:M,whisperModelPath:E,whisperBackend:A,ttsBackend:X,pinImages:W,releaseTrack:D})});if(!S.ok||!S.body){const re=await S.text();throw new Error(re||`HTTP ${S.status}`)}const L=S.body.getReader(),Q=new TextDecoder;let Z="";for(;;){const{done:re,value:fe}=await L.read();if(re)break;Z+=Q.decode(fe,{stream:!0});const ce=Z.split(`
18
+ `);Z=ce.pop()??"";for(const Se of ce)if(Se.startsWith("data: "))try{const B=JSON.parse(Se.slice(6));if(B.phase&&i(B.phase),B.message&&Ee({text:B.message,phase:B.phase}),B.stream&&B.text&&Ee({text:B.text.trim()}),B.done&&B.code!==0)throw new Error(B.message??"Reconcile failed")}catch(B){if(B instanceof SyntaxError)continue;throw B}}}catch(S){const L=S instanceof Error?S.message:String(S);v(L),i("error"),Ee({text:`Error: ${L}`})}}function C(){return{enabledModules:h.filter(te=>te.enabled).map(te=>te.id),relayEnabled:x,relayUrl:M,whisperModelPath:E,whisperBackend:A,ttsBackend:X,pinImages:W,releaseTrack:D}}async function Y(te){pe(!0),v(null),be(null);try{const{latest:S,...L}=te??{},Z=await fetch(`/api/install/regenerate-download${S?"?latest=true":""}`,{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({...C(),...L})});if(!Z.ok){const fe=await Z.text();throw new Error(fe||`HTTP ${Z.status}`)}const re=await Z.json();be({compose:re.compose,env:re.env,initDb:re.initDb})}catch(S){v(S instanceof Error?S.message:String(S))}finally{pe(!1)}}function K(te,S){const L=new Blob([S],{type:"text/plain;charset=utf-8"}),Q=URL.createObjectURL(L),Z=document.createElement("a");Z.href=Q,Z.download=te,document.body.appendChild(Z),Z.click(),Z.remove(),URL.revokeObjectURL(Q)}const ge=Object.keys(Ju).filter(te=>{const S=Object.keys(Ju),L=S.indexOf(o);return S.indexOf(te)<L||o==="done"&&te==="done"});return l.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Sync Compose"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Regenerate ",l.jsx("code",{className:"rounded bg-[var(--color-surface)] px-1.5 py-0.5 text-xs",children:"docker-compose.yml"})," from the latest service registry, preserving your secrets. ",l.jsx("strong",{className:"text-[var(--color-text)]",children:"Sync now"})," applies it to the running stack;",l.jsx("strong",{className:"text-[var(--color-text)]",children:" Download"})," hands you the files to review and apply by hand (",l.jsx("code",{className:"rounded bg-[var(--color-surface)] px-1 text-xs",children:"docker compose up -d"}),")."," ",l.jsx("strong",{className:"text-[var(--color-text)]",children:"Update stack to latest"})," downloads the same, pinned to the newest published images."]})]}),o==="loading_options"&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})}),o==="options"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Services"}),l.jsx("div",{className:"space-y-2",children:h.map(te=>l.jsxs("button",{onClick:()=>he(te.id),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left hover:bg-[var(--color-bg-secondary)] transition-colors",children:[te.enabled?l.jsx(pt,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:te.name}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:te.description})]})]},te.id))})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Release Track"}),l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:D==="dev"?"Dev":"Stable"}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:D==="dev"?"Using latest main branch builds (may be unstable)":"Using tagged releases"})]}),l.jsx("button",{type:"button",role:"switch","aria-checked":D==="dev",onClick:()=>z(D==="dev"?"stable":"dev"),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${D==="dev"?"bg-amber-500":"bg-[var(--color-surface-alt)]"}`,children:l.jsx("span",{className:`absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform ${D==="dev"?"translate-x-5":"translate-x-0"}`})})]}),D==="dev"&&l.jsx("div",{className:"mx-3 mt-1 rounded-lg border border-amber-300 bg-amber-500/10 px-3 py-2 text-xs text-amber-400",children:"Switching tracks will pull all images and force-recreate containers."})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Integrations"}),l.jsxs("button",{onClick:()=>j(!x),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left hover:bg-[var(--color-bg-secondary)] transition-colors",children:[x?l.jsx(pt,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),l.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]}),x&&l.jsxs("div",{className:"mt-2 px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Relay URL"}),l.jsx("input",{type:"url",value:M,onChange:te=>w(te.target.value),placeholder:"https://relay.jarvisautomation.io",className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),h.some(te=>te.id==="jarvis-whisper-api"&&te.enabled)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Whisper"}),l.jsxs("div",{className:"px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Model path"}),l.jsx("input",{type:"text",value:E,onChange:te=>_(te.target.value),placeholder:"/whisper-models/ggml-base.en.bin",className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm font-mono text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Path inside the container. Place model files in ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"./whisper-models/"})," next to your compose file."]}),l.jsx("label",{className:"mt-3 block text-xs font-medium text-[var(--color-text-muted)]",children:"GPU backend"}),l.jsxs("select",{value:A,onChange:te=>k(te.target.value),className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"cpu",children:"CPU (default)"}),l.jsx("option",{value:"cuda",children:"NVIDIA (CUDA)"}),l.jsx("option",{value:"vulkan",children:"AMD / generic (Vulkan)"}),l.jsx("option",{value:"rocm",children:"AMD (ROCm)"})]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Where speech-to-text runs. CPU leaves the GPU for the LLM; pick a GPU backend to run Whisper on the GPU."})]})]}),h.some(te=>te.id==="jarvis-tts"&&te.enabled)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Text-to-speech"}),l.jsxs("div",{className:"px-3",children:[l.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Inference device"}),l.jsxs("select",{value:X,onChange:te=>I(te.target.value),className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)]",children:[l.jsx("option",{value:"cpu",children:"CPU (default)"}),l.jsx("option",{value:"cuda",children:"NVIDIA (CUDA)"})]}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Where Kokoro synthesis runs. CPU is fine for most installs; CUDA gives the fastest first-audio. On multi-GPU hosts set ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"TTS_GPU_DEVICE"})," in .env to pick which GPU (default 0)."]})]})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:l.jsxs("label",{className:"flex items-start gap-3 text-sm",children:[l.jsx("input",{type:"checkbox",checked:W,onChange:te=>ee(te.target.checked),className:"mt-0.5","data-testid":"pin-images-checkbox"}),l.jsxs("span",{children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:"Pin images by digest"}),l.jsxs("span",{className:"mt-1 block text-xs text-[var(--color-text-muted)]",children:["Advanced supply-chain hardening: locks every image to an exact build. Leave OFF for normal use — with pinning on, ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"docker compose pull"})," will never update anything and services only change via this page."]})]})]})})]}),oe&&o==="options"&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-primary)]/40 bg-[var(--color-surface)] p-4",children:[l.jsxs("h2",{className:"mb-1 flex items-center gap-2 text-sm font-semibold text-[var(--color-text)]",children:[l.jsx(pt,{size:16,className:"text-green-500"}),"Updated files ready"]}),l.jsxs("p",{className:"mb-3 text-xs text-[var(--color-text-muted)]",children:["Your existing secrets and settings are carried over. Download, replace the files next to your compose, then run ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"docker compose up -d"}),". Nothing on the server was changed."]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsxs("button",{onClick:()=>K("docker-compose.yml",oe.compose),className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-3 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(za,{size:15}),"docker-compose.yml"]}),l.jsxs("button",{onClick:()=>K(".env",oe.env),className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:[l.jsx(za,{size:15}),".env"]}),l.jsxs("button",{onClick:()=>K("init-db.sh",oe.initDb),className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:[l.jsx(za,{size:15}),"init-db.sh"]})]}),l.jsxs("p",{className:"mt-3 text-xs text-[var(--color-text-muted)]",children:["The ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:".env"})," merges new keys into your existing values, and ",l.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"init-db.sh"})," covers any new databases — replace all three to be safe. Diff them against your current files first if you want to eyeball the changes."]})]}),o!=="loading_options"&&o!=="options"&&l.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries(Ju).map(([te,S])=>{const L=te===o,Q=ge.includes(te),Z=te===o&&o==="error";return l.jsxs("div",{className:"flex items-center gap-2",children:[Q?l.jsx(pt,{size:16,className:"text-green-500"}):Z?l.jsx(ra,{size:16,className:"text-red-500"}):L?l.jsx(Ct,{size:16,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),l.jsx("span",{className:ae("text-sm",L?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",Q&&"text-green-500"),children:S})]},te)})}),d.length>0&&l.jsx("div",{ref:g,className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[#0d1117] p-3 font-mono text-xs text-gray-300",children:d.map((te,S)=>l.jsx("div",{children:te.text},S))}),m&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(ra,{size:14,className:"text-red-500"}),l.jsx("span",{className:"text-sm text-red-500",children:m})]}),l.jsxs("div",{className:"flex gap-3",children:[o==="options"&&l.jsxs("button",{onClick:ne,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(xd,{size:16}),"Sync now"]}),o==="options"&&l.jsxs("button",{onClick:()=>Y(),disabled:se,title:"Regenerate the compose and download it to apply by hand — doesn't touch the running stack",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[se?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(za,{size:16}),"Download updated compose"]}),o==="options"&&l.jsxs("button",{onClick:()=>Y({latest:!0}),disabled:se,title:"Download a compose pinned to the LATEST published images (digests refreshed from the registry). Apply it yourself on the host — docker compose pull && docker compose up -d — which also updates jarvis-admin.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[se?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(it,{size:16}),"Update stack to latest"]}),o==="options"&&l.jsxs("button",{onClick:()=>Y({mqttAllowAnon:!1}),disabled:se,title:"Download a compose with the MQTT broker locked (allow_anonymous=false). Do this only after every node has authenticated, or un-migrated nodes will drop off.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[se?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(gi,{size:16}),"Download + lock broker"]}),o==="options"&&l.jsxs("button",{onClick:()=>Y({mqttAllowAnon:!0}),disabled:se,title:"Download a compose that re-opens the MQTT broker to anonymous clients (allow_anonymous=true) — the transition/rollback state.",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50",children:[se?l.jsx(Ct,{size:16,className:"animate-spin"}):l.jsx(mS,{size:16}),"Download + unlock broker"]}),(o==="options"||o==="regenerate"||o==="apply"||o==="done")&&l.jsxs("button",{onClick:()=>a("/dashboard"),disabled:o==="regenerate"||o==="apply",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",children:[l.jsx(pt,{size:16}),"Back to dashboard"]}),o==="error"&&l.jsxs("button",{onClick:ne,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[l.jsx(it,{size:16}),"Retry"]})]})]})}async function z4(a={}){const{data:s}=await ve.get("/api/traces",{params:a});return s}async function D4(a){const{data:s}=await ve.get(`/api/traces/${a}`);return s}function Yx(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function Xx(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function U4(a){const s=new Map;for(const o of a){const i=s.get(o.conversation_id);if(!i){s.set(o.conversation_id,{conversation_id:o.conversation_id,traces:[o],newest_at:o.created_at,user_command:o.user_command,assistant_message:o.assistant_message,source:o.source,node_id:o.node_id,household_id:o.household_id,total_duration_ms:o.total_duration_ms,status:o.status});continue}i.traces.push(o),i.total_duration_ms+=o.total_duration_ms,o.created_at>i.newest_at&&(i.newest_at=o.created_at),!i.user_command&&o.user_command&&(i.user_command=o.user_command),!i.assistant_message&&o.assistant_message&&(i.assistant_message=o.assistant_message),o.status!=="ok"&&(i.status=o.status)}return Array.from(s.values()).sort((o,i)=>o.newest_at<i.newest_at?1:-1)}function L4(a){return a==="mobile"?"📱":"🔊"}function B4(){const a=wa(),[s,o]=N.useState(""),[i,d]=N.useState(""),[f,m]=N.useState(""),[v,g]=N.useState(""),[h,y]=N.useState(new Set),x=yt({queryKey:["admin","households"],queryFn:$E,staleTime:6e4}),j=yt({queryKey:["admin","nodes"],queryFn:ZE,staleTime:6e4}),{data:M,isLoading:w,error:E}=yt({queryKey:["traces",s,i,f,v],queryFn:()=>z4({limit:100,...s?{status:s}:{},...i?{source:i}:{},...f?{household_id:f}:{},...v?{node_id:v}:{}}),refetchInterval:1e4}),_=N.useMemo(()=>{const D=j.data??[];return f?D.filter(z=>z.household_id===f):D},[j.data,f]),A=N.useMemo(()=>{const D=new Map;for(const z of j.data??[])D.set(z.node_id,z.name);return D},[j.data]),k=N.useMemo(()=>{const D=new Map;for(const z of x.data??[])D.set(z.id,z.name);return D},[x.data]),X=N.useMemo(()=>M?U4(M.traces):[],[M]);function I(D){y(z=>{const oe=new Set(z);return oe.has(D)?oe.delete(D):oe.add(D),oe})}function W(D){if(m(D),D&&v){const z=(j.data??[]).find(oe=>oe.node_id===v);z&&z.household_id!==D&&g("")}}const ee="rounded border border-[var(--color-border)] bg-[var(--color-surface)] px-2 py-1 text-sm text-[var(--color-text)]";return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Request Traces"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("select",{className:ee,value:f,onChange:D=>W(D.target.value),disabled:x.isLoading,children:[l.jsx("option",{value:"",children:"All households"}),(x.data??[]).map(D=>l.jsx("option",{value:D.id,children:D.name},D.id))]}),l.jsxs("select",{className:ee,value:v,onChange:D=>g(D.target.value),disabled:j.isLoading,children:[l.jsx("option",{value:"",children:"All nodes"}),_.map(D=>l.jsx("option",{value:D.node_id,children:D.name},D.node_id))]}),l.jsxs("select",{className:ee,value:s,onChange:D=>o(D.target.value),children:[l.jsx("option",{value:"",children:"All statuses"}),l.jsx("option",{value:"ok",children:"OK"}),l.jsx("option",{value:"error",children:"Error"})]}),l.jsxs("select",{className:ee,value:i,onChange:D=>d(D.target.value),children:[l.jsx("option",{value:"",children:"All sources"}),l.jsx("option",{value:"node",children:"Node"}),l.jsx("option",{value:"mobile",children:"Mobile"})]})]})]}),w&&l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}),E&&l.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 p-4 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:"Failed to load traces"}),M&&l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[M.total," traces in ",X.length," conversation",X.length===1?"":"s"]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--color-border)]",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)]",children:[l.jsx("th",{className:"w-8 px-2 py-2"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Time"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Source"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Node"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"User said"}),l.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Jarvis said"}),l.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Duration"}),l.jsx("th",{className:"px-3 py-2 text-center font-medium text-[var(--color-text-muted)]",children:"Status"}),l.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Traces"})]})}),l.jsxs("tbody",{children:[X.map(D=>{const z=h.has(D.conversation_id),oe=D.traces.length,be=D.node_id?A.get(D.node_id)??D.node_id.slice(0,8):"-";return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>I(D.conversation_id),children:[l.jsx("td",{className:"px-2 py-2 text-center text-[var(--color-text-muted)]",children:oe>1?z?"▼":"▶":""}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] whitespace-nowrap",children:Xx(D.newest_at)}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)]",children:l.jsxs("span",{className:"inline-flex items-center gap-1",children:[L4(D.source),D.source]})}),l.jsxs("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap",children:[be,D.household_id&&l.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["· ",k.get(D.household_id)??""]})]}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:D.user_command??"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] max-w-xs truncate",children:D.assistant_message??"-"}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:Yx(D.total_duration_ms)}),l.jsx("td",{className:"px-3 py-2 text-center",children:l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${D.status==="ok"?"bg-green-500":"bg-red-500"}`})}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text-muted)] tabular-nums",children:oe})]}),z&&D.traces.slice().sort((se,pe)=>se.created_at<pe.created_at?-1:1).map(se=>l.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer bg-[var(--color-surface-alt)]/40 transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>a(`/traces/${se.id}`),children:[l.jsx("td",{className:"px-2 py-2"}),l.jsxs("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap",children:[l.jsx("span",{className:"inline-block w-3"}),Xx(se.created_at)]}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] text-xs",children:se.request_type}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] whitespace-nowrap text-xs",children:se.node_id?A.get(se.node_id)??se.node_id.slice(0,8):"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:se.user_command??"-"}),l.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)] max-w-xs truncate",children:se.assistant_message??"-"}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:Yx(se.total_duration_ms)}),l.jsx("td",{className:"px-3 py-2 text-center",children:l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${se.status==="ok"?"bg-green-500":"bg-red-500"}`})}),l.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text-muted)] tabular-nums",children:se.span_count})]},se.id))]},D.conversation_id)}),X.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:9,className:"px-3 py-8 text-center text-[var(--color-text-muted)]",children:"No traces yet"})})]})]})})]})]})}function ns(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}const Kx={cc:"#9e9e9e",llm_proxy:"#42a5f5",node:"#66bb6a",tts:"#ffa726",whisper:"#ab47bc"},$x={cc:"Command Center",llm_proxy:"LLM Proxy",node:"Node",tts:"TTS",whisper:"Whisper"};function q4(a){const s=a.filter(d=>d.duration_ms>0),o=s.filter(d=>!s.some(f=>f!==d&&d.start_ms<=f.start_ms&&d.end_ms>=f.end_ms&&f.duration_ms>0));o.sort((d,f)=>d.start_ms-f.start_ms);const i=[];for(const d of o){const f=i[i.length-1];f&&f.service===d.service?(f.duration_ms=Math.round((f.duration_ms+d.duration_ms)*10)/10,f.steps.push(d.name),d.status==="error"&&(f.status="error")):i.push({service:d.service,duration_ms:d.duration_ms,status:d.status,steps:[d.name]})}return i}function H4(){const{id:a}=k0(),s=wa(),[o,i]=N.useState(!1),[d,f]=N.useState(null),{data:m,isLoading:v,error:g}=yt({queryKey:["trace",a],queryFn:()=>D4(a),enabled:!!a}),h=N.useMemo(()=>m?q4(m.spans):[],[m]);return v?l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}):g||!m?l.jsxs("div",{className:"space-y-4",children:[l.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>s("/traces"),children:"Back to traces"}),l.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 p-4 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:"Trace not found"})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>s("/traces"),children:"Back to traces"}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-[var(--color-text)]",children:m.user_command??"Request Trace"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[m.source==="mobile"?"📱 Mobile":"🔊 Node",m.node_id&&` (${m.node_id})`," · ",m.request_type," · ",m.created_at?new Date(m.created_at).toLocaleString():""]})]}),l.jsxs("div",{className:"text-right",children:[l.jsx("div",{className:"text-2xl font-bold tabular-nums text-[var(--color-text)]",children:ns(m.total_duration_ms)}),l.jsxs("div",{className:"flex items-center justify-end gap-1 mt-1",children:[l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${m.status==="ok"?"bg-green-500":"bg-red-500"}`}),l.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:m.status})]})]})]}),m.error_message&&l.jsx("div",{className:"mt-3 rounded border border-red-300 bg-red-50 p-2 text-sm text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:m.error_message}),l.jsx("p",{className:"mt-2 text-xs text-[var(--color-text-muted)] font-mono",children:m.conversation_id})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsx("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-muted)]",children:"Service Flow"}),l.jsx("p",{className:"mb-4 text-xs text-[var(--color-text-muted)] opacity-60",children:h.map(y=>$x[y.service]??y.service).join(" → ")}),l.jsx("div",{className:"space-y-2",children:h.map((y,x)=>{const j=Math.min(y.duration_ms/m.total_duration_ms*100,100),M=y.status==="error"?"#ef4444":Kx[y.service]??"#9e9e9e",w=$x[y.service]??y.service;return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:M}}),l.jsx("span",{className:"w-32 text-sm text-[var(--color-text)] shrink-0",children:w}),l.jsxs("div",{className:"flex-1 h-6 rounded bg-[var(--color-surface-alt)] relative",children:[l.jsx("div",{className:"absolute top-0 left-0 h-full rounded",style:{width:`${Math.max(j,1)}%`,backgroundColor:M,opacity:.7}}),l.jsx("span",{className:"absolute inset-0 flex items-center px-2 text-xs text-[var(--color-text)] opacity-70",children:y.steps.join(", ")})]}),l.jsx("span",{className:"w-16 text-sm text-[var(--color-text)] text-right tabular-nums shrink-0",children:ns(y.duration_ms)})]},`${y.service}-${x}`)})})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[l.jsxs("button",{className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>{i(y=>!y),f(null)},children:[o?"Hide":"Show"," raw spans (",m.spans.length,")"]}),o&&l.jsx("div",{className:"mt-3 space-y-1",children:m.spans.map((y,x)=>{const j=Math.min(y.duration_ms/m.total_duration_ms*100,100),M=y.start_ms/m.total_duration_ms*100,w=y.status==="error"?"#ef4444":Kx[y.service]??"#9e9e9e",E=d===y;return l.jsxs("div",{className:`flex items-center gap-2 cursor-pointer rounded px-1 py-0.5 ${E?"bg-[var(--color-surface-alt)]":""}`,onClick:()=>f(E?null:y),children:[l.jsx("span",{className:"w-36 truncate text-xs text-[var(--color-text-muted)] text-right shrink-0",children:y.name}),l.jsx("div",{className:"flex-1 relative h-4 rounded bg-[var(--color-surface-alt)]",children:l.jsx("div",{className:"absolute top-0 h-full rounded",style:{left:`${M}%`,width:`${Math.max(j,.5)}%`,backgroundColor:w,minWidth:"2px"}})}),l.jsx("span",{className:"w-14 text-xs text-[var(--color-text-muted)] text-right shrink-0 tabular-nums",children:ns(y.duration_ms)}),l.jsx("span",{className:"w-16 text-xs text-[var(--color-text-muted)] opacity-60 shrink-0",children:y.service})]},`${y.name}-${x}`)})}),d&&o&&l.jsx("div",{className:"mt-3 border-t border-[var(--color-border)] pt-3",children:l.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm max-w-md",children:[l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Service"}),l.jsx("dd",{className:"text-[var(--color-text)]",children:d.service}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Duration"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.duration_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Start"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.start_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"End"}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:ns(d.end_ms)}),l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Status"}),l.jsx("dd",{className:d.status==="ok"?"text-green-600":"text-red-600",children:d.status}),Object.entries(d.metadata||{}).map(([y,x])=>l.jsxs("div",{className:"contents",children:[l.jsx("dt",{className:"text-[var(--color-text-muted)]",children:y}),l.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:String(x)})]},y))]})})]})]})}function G4(){return l.jsxs("div",{className:"flex min-h-[60vh] flex-col items-center justify-center",children:[l.jsx("h1",{className:"mb-2 text-4xl font-bold text-[var(--color-text)]",children:"404"}),l.jsx("p",{className:"mb-4 text-[var(--color-text-muted)]",children:"Page not found"}),l.jsx(Cd,{to:"/settings",className:"text-[var(--color-primary)] underline hover:opacity-80",children:"Go to Settings"})]})}const Q4=7,V4={currentStep:0,totalSteps:Q4,enabledModules:[],portOverrides:{},infraPortOverrides:{},secrets:{},dbUser:"jarvis",whisperModel:"base.en",whisperModelPath:"/whisper-models/ggml-base.en.bin",llmInterface:"Qwen25MediumUntrained",deploymentMode:"local",deploymentTarget:"standard",remoteLlmUrl:"",remoteWhisperUrl:"",platform:"linux",hardware:null,relayEnabled:!1,installRunning:!1,installComplete:!1,nativeServices:[]};function F4(a,s,o){return Math.max(s,Math.min(o,a))}function Y4(a,s){switch(s.type){case"SET_STEP":return{...a,currentStep:F4(s.step,0,a.totalSteps-1)};case"NEXT_STEP":return{...a,currentStep:Math.min(a.currentStep+1,a.totalSteps-1)};case"PREV_STEP":return{...a,currentStep:Math.max(a.currentStep-1,0)};case"SET_ENABLED_MODULES":return{...a,enabledModules:s.modules};case"TOGGLE_MODULE":{if(s.enabled){const o=a.enabledModules.includes(s.serviceId)?a.enabledModules:[...a.enabledModules,s.serviceId];return{...a,enabledModules:o}}return{...a,enabledModules:a.enabledModules.filter(o=>o!==s.serviceId)}}case"SET_PORT_OVERRIDE":return{...a,portOverrides:{...a.portOverrides,[s.serviceId]:s.port}};case"SET_INFRA_PORT_OVERRIDE":return{...a,infraPortOverrides:{...a.infraPortOverrides,[s.infraId]:s.port}};case"SET_SECRET":return{...a,secrets:{...a.secrets,[s.name]:s.value}};case"SET_SECRETS":return{...a,secrets:s.secrets};case"SET_DB_USER":return{...a,dbUser:s.user};case"SET_WHISPER_MODEL":return{...a,whisperModel:s.model};case"SET_WHISPER_BACKEND":return{...a,whisperBackend:s.backend};case"SET_LLM_INTERFACE":return{...a,llmInterface:s.interfaceId};case"SET_DEPLOYMENT_MODE":return{...a,deploymentMode:s.mode};case"SET_DEPLOYMENT_TARGET":return{...a,deploymentTarget:s.target};case"SET_REMOTE_LLM_URL":return{...a,remoteLlmUrl:s.url};case"SET_REMOTE_WHISPER_URL":return{...a,remoteWhisperUrl:s.url};case"SET_PLATFORM":return{...a,platform:s.platform};case"SET_HARDWARE":return{...a,hardware:s.hardware,platform:s.hardware.platform};case"SET_RELAY_ENABLED":return{...a,relayEnabled:s.enabled};case"SET_INSTALL_RUNNING":return{...a,installRunning:s.running};case"SET_INSTALL_COMPLETE":return{...a,installRunning:!1,installComplete:!0};case"SET_NATIVE_SERVICES":return{...a,nativeServices:s.services};case"TOGGLE_NATIVE_SERVICE":{if(s.enabled){const o=a.nativeServices.includes(s.serviceId)?a.nativeServices:[...a.nativeServices,s.serviceId];return{...a,nativeServices:o}}return{...a,nativeServices:a.nativeServices.filter(o=>o!==s.serviceId)}}default:return a}}const Eg=N.createContext(null);function X4({children:a}){const[s,o]=N.useReducer(Y4,V4);return l.jsx(Eg.Provider,{value:{state:s,dispatch:o},children:a})}function fr(){const a=N.useContext(Eg);if(!a)throw new Error("useWizard must be used within a WizardProvider");return a}function K4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(null),[d,f]=N.useState(!0),[m,v]=N.useState(!1);function g(){f(!0),v(!1),Xd().then(y=>{i(y);const x=y.reason==="docker_not_found";v(x),s(x?{type:"SET_INSTALL_RUNNING",running:!0}:{type:"SET_INSTALL_RUNNING",running:!1})}).catch(()=>{i({configured:!1,reason:"error"}),v(!0),s({type:"SET_INSTALL_RUNNING",running:!0})}).finally(()=>f(!1))}N.useEffect(()=>{g()},[]);const h=o&&o.reason!=="docker_not_found";return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Let's get your personal voice assistant up and running. This wizard will guide you through selecting services, configuring hardware, and starting everything up."})]}),l.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:l.jsxs("div",{className:"flex items-center gap-3",children:[d?l.jsx(Ct,{size:20,className:"animate-spin text-[var(--color-primary)]"}):h?l.jsx(pt,{size:20,className:"text-green-500"}):l.jsx(Bd,{size:20,className:"text-red-500"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:d?"Checking Docker...":h?"Docker is running":"Docker not found"}),!d&&!h&&l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("p",{className:"text-xs text-red-400",children:"Docker is required to run Jarvis services."}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Install"," ",l.jsx("a",{href:"https://www.docker.com/products/docker-desktop/",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-primary)] underline hover:no-underline",children:"Docker Desktop"})," ","for your platform, start it, then click Retry."]})]})]}),m&&!d&&l.jsxs("button",{type:"button",onClick:g,className:"flex items-center gap-1 rounded-md border border-[var(--color-border)] px-2 py-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[l.jsx(yi,{size:12}),"Retry"]})]})}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-2 block text-sm font-medium text-[var(--color-text)]",children:"Deployment Mode"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_DEPLOYMENT_MODE",mode:"local"}),className:ae("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",a.deploymentMode==="local"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[l.jsx(yS,{size:24,className:"text-[var(--color-primary)]"}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Local"}),l.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"Everything on this machine"})]}),l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"}),className:ae("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",a.deploymentMode==="remote-llm"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[l.jsx(Vd,{size:24,className:"text-[var(--color-primary)]"}),l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM"}),l.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"LLM on separate GPU machine"})]})]})]})]})}const Zo=[{label:"None / CPU only",gpu:null,gpuType:"none",vramMb:null,backends:["gguf"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4090 (24 GB)",gpu:"NVIDIA RTX 4090",gpuType:"nvidia",vramMb:24576,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4080 (16 GB)",gpu:"NVIDIA RTX 4080",gpuType:"nvidia",vramMb:16384,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4070 Ti (12 GB)",gpu:"NVIDIA RTX 4070 Ti",gpuType:"nvidia",vramMb:12288,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3090 (24 GB)",gpu:"NVIDIA RTX 3090",gpuType:"nvidia",vramMb:24576,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3080 (10 GB)",gpu:"NVIDIA RTX 3080",gpuType:"nvidia",vramMb:10240,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3070 (8 GB)",gpu:"NVIDIA RTX 3070",gpuType:"nvidia",vramMb:8192,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA A100 (80 GB)",gpu:"NVIDIA A100",gpuType:"nvidia",vramMb:81920,backends:["gguf","vllm"],defaultBackend:"vllm"},{label:"NVIDIA A100 (40 GB)",gpu:"NVIDIA A100",gpuType:"nvidia",vramMb:40960,backends:["gguf","vllm"],defaultBackend:"vllm"},{label:"NVIDIA Tesla T4 (16 GB)",gpu:"NVIDIA Tesla T4",gpuType:"nvidia",vramMb:16384,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"AMD RX 9070 XT — Vulkan (16 GB)",gpu:"AMD RX 9070 XT",gpuType:"amd",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 — Vulkan (12 GB)",gpu:"AMD RX 9070",gpuType:"amd",vramMb:12288,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XTX — Vulkan (24 GB)",gpu:"AMD RX 7900 XTX",gpuType:"amd",vramMb:24576,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XT — Vulkan (20 GB)",gpu:"AMD RX 7900 XT",gpuType:"amd",vramMb:20480,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7800 XT — Vulkan (16 GB)",gpu:"AMD RX 7800 XT",gpuType:"amd",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7600 — Vulkan (8 GB)",gpu:"AMD RX 7600",gpuType:"amd",vramMb:8192,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 XT — ROCm (16 GB)",gpu:"AMD RX 9070 XT",gpuType:"amd-rocm",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 — ROCm (12 GB)",gpu:"AMD RX 9070",gpuType:"amd-rocm",vramMb:12288,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XTX — ROCm (24 GB)",gpu:"AMD RX 7900 XTX",gpuType:"amd-rocm",vramMb:24576,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XT — ROCm (20 GB)",gpu:"AMD RX 7900 XT",gpuType:"amd-rocm",vramMb:20480,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7800 XT — ROCm (16 GB)",gpu:"AMD RX 7800 XT",gpuType:"amd-rocm",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"Apple M4 Max (128 GB unified)",gpu:"Apple M4 Max",gpuType:"apple",vramMb:131072,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Max (64 GB unified)",gpu:"Apple M4 Max",gpuType:"apple",vramMb:65536,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Pro (48 GB unified)",gpu:"Apple M4 Pro",gpuType:"apple",vramMb:49152,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Pro (24 GB unified)",gpu:"Apple M4 Pro",gpuType:"apple",vramMb:24576,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M2 Max (32 GB unified)",gpu:"Apple M2 Max",gpuType:"apple",vramMb:32768,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M2 Pro (16 GB unified)",gpu:"Apple M2 Pro",gpuType:"apple",vramMb:16384,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M1 (16 GB unified)",gpu:"Apple M1",gpuType:"apple",vramMb:16384,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M1 (8 GB unified)",gpu:"Apple M1",gpuType:"apple",vramMb:8192,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Other (enter VRAM manually)",gpu:"Other",gpuType:"none",vramMb:null,backends:["gguf"],defaultBackend:"gguf"}];function $4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(!a.hardware),[d,f]=N.useState(!1),[m,v]=N.useState(0),[g,h]=N.useState("");N.useEffect(()=>{a.hardware||ME().then(j=>{s({type:"SET_HARDWARE",hardware:j}),j.recommendedBackend==="remote"&&a.deploymentMode==="local"&&s({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"})}).catch(()=>{}).finally(()=>i(!1))},[]);function y(j,M){const w=Zo[j];if(!a.hardware)return;const E=w.gpu==="Other"?(parseInt(M??g,10)||0)*1024:w.vramMb,_={...a.hardware,gpuName:w.gpu,gpuVramMb:E||null,gpuType:w.gpuType,recommendedBackends:[...w.backends],recommendedBackend:w.defaultBackend};s({type:"SET_HARDWARE",hardware:_})}const x=a.hardware;return o?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"}),l.jsx("p",{className:"mt-3 text-sm text-[var(--color-text-muted)]",children:"Detecting hardware..."})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Hardware Detection"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"We detected the following hardware. This determines which LLM backend to use."})]}),x&&l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(On,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"Platform"})]}),l.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[x.platform==="darwin"?"macOS":"Linux"," (",x.arch,")"]})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(Gd,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"Memory"})]}),l.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[x.totalMemoryGb," GB RAM"]})]}),l.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[l.jsx(On,{size:16}),l.jsx("span",{className:"text-xs font-medium uppercase",children:"GPU"})]}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:x.gpuName??"No GPU detected"}),x.gpuVramMb!=null&&x.gpuVramMb>0&&l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[Math.round(x.gpuVramMb/1024)," GB VRAM"]})]}),l.jsx("button",{type:"button",onClick:()=>f(!d),className:"text-xs font-medium text-[var(--color-primary)] hover:underline",children:d?"Cancel":"Override"})]}),d&&l.jsxs("div",{className:"mt-3 space-y-3 border-t border-[var(--color-border)] pt-3",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"gpu-select",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Select GPU"}),l.jsx("select",{id:"gpu-select",value:m,onChange:j=>{const M=parseInt(j.target.value,10);v(M),Zo[M].gpu!=="Other"&&(y(M),f(!1))},className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]"),children:Zo.map((j,M)=>l.jsx("option",{value:M,children:j.label},`${j.label}-${M}`))})]}),Zo[m].gpu==="Other"&&l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{htmlFor:"custom-vram",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"VRAM (GB)"}),l.jsx("input",{id:"custom-vram",type:"number",min:1,max:512,value:g,onChange:j=>h(j.target.value),placeholder:"e.g. 24",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsx("button",{type:"button",disabled:!g||parseInt(g,10)<=0,onClick:()=>{y(m,g),f(!1)},className:ae("rounded-lg px-4 py-2 text-sm font-medium","bg-[var(--color-primary)] text-white","disabled:cursor-not-allowed disabled:opacity-50"),children:"Apply"})]})]})]}),l.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Recommended: ",l.jsx("span",{className:"text-[var(--color-primary)]",children:x.recommendedBackend.toUpperCase()})]}),x.recommendedBackends.length>1&&l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["Available backends: ",x.recommendedBackends.join(", ")]})]})]}),a.deploymentMode==="remote-llm"&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote Service URLs"}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"remote-llm",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"LLM Proxy URL"}),l.jsx("input",{id:"remote-llm",type:"url",value:a.remoteLlmUrl,onChange:j=>s({type:"SET_REMOTE_LLM_URL",url:j.target.value}),placeholder:"http://192.168.1.100:7704",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"remote-whisper",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Whisper URL (optional)"}),l.jsx("input",{id:"remote-whisper",type:"url",value:a.remoteWhisperUrl,onChange:j=>s({type:"SET_REMOTE_WHISPER_URL",url:j.target.value}),placeholder:"http://192.168.1.100:7706",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]})]})]})}function Z4(){const{state:a,dispatch:s}=fr(),[o,i]=N.useState(null),[d,f]=N.useState(!0);if(N.useEffect(()=>{Promise.all([bg(),AE()]).then(([h,y])=>{if(i(h),a.enabledModules.length===0&&s({type:"SET_ENABLED_MODULES",modules:y.enabledModules}),a.platform==="darwin"&&a.nativeServices.length===0){const x=h.services.filter(j=>j.nativeCapable).map(j=>j.id);x.length>0&&s({type:"SET_NATIVE_SERVICES",services:x})}}).catch(()=>{}).finally(()=>f(!1))},[]),d||!o)return l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const{core:m,recommended:v,optional:g}=J4(o.services);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Select Services"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Core services are always included. Toggle recommended and optional services.",a.platform==="darwin"&&l.jsxs(l.Fragment,{children:[" Services marked ",l.jsx("em",{children:"Native"})," can run as macOS LaunchAgents to use the Apple GPU."]})]})]}),l.jsx(Pu,{title:"Core",subtitle:"Always included",services:m,enabled:m.map(h=>h.id),nativeServices:a.nativeServices,platform:a.platform,locked:!0}),l.jsx(Pu,{title:"Recommended",subtitle:"Enabled by default",services:v,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(h,y)=>s({type:"TOGGLE_MODULE",serviceId:h,enabled:y}),onToggleNative:(h,y)=>s({type:"TOGGLE_NATIVE_SERVICE",serviceId:h,enabled:y})}),g.length>0&&l.jsx(Pu,{title:"Optional",subtitle:"Off by default",services:g,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(h,y)=>s({type:"TOGGLE_MODULE",serviceId:h,enabled:y}),onToggleNative:(h,y)=>s({type:"TOGGLE_NATIVE_SERVICE",serviceId:h,enabled:y})}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Integrations"}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Cloud services"})]}),l.jsxs("button",{type:"button",onClick:()=>s({type:"SET_RELAY_ENABLED",enabled:!a.relayEnabled}),className:ae("flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors",a.relayEnabled?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)] hover:border-[var(--color-primary)]/30"),children:[a.relayEnabled?l.jsx(pt,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),l.jsx(tS,{size:12,className:"text-[var(--color-text-muted)]"})]}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]})]})]})}function J4(a){return{core:a.filter(s=>s.category==="core"),recommended:a.filter(s=>s.category==="recommended"),optional:a.filter(s=>s.category==="optional")}}function Pu({title:a,subtitle:s,services:o,enabled:i,nativeServices:d,locked:f,onToggle:m,onToggleNative:v,platform:g}){return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:a}),l.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:s})]}),l.jsx("div",{className:"space-y-1",children:o.map(h=>{const y=i.includes(h.id),x=h.nativeCapable&&g==="darwin"&&y,j=d.includes(h.id);return l.jsxs("div",{className:ae("rounded-lg border transition-colors",y?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)]",!f&&!y&&"hover:border-[var(--color-primary)]/30"),children:[l.jsxs("button",{type:"button",disabled:f,onClick:()=>m?.(h.id,!y),className:ae("flex w-full items-center gap-3 px-3 py-2.5 text-left",f&&"cursor-default"),children:[f?l.jsx(gi,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}):y?l.jsx(pt,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):l.jsx(os,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:h.name}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",h.port]}),h.nativeCapable&&g==="darwin"&&l.jsx("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-500",children:"Native"})]}),l.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:h.description})]})]}),x&&l.jsxs("button",{type:"button",onClick:()=>v?.(h.id,!j),className:ae("flex w-full items-center gap-2 border-t border-[var(--color-border)]/50 px-3 py-2 text-left text-xs","hover:bg-[var(--color-surface-alt)] transition-colors"),children:[l.jsx(On,{size:12,className:j?"text-amber-500":"text-[var(--color-text-muted)]"}),l.jsx("span",{className:j?"text-[var(--color-text)]":"text-[var(--color-text-muted)]",children:"Run natively via LaunchAgent"}),l.jsx("span",{className:"ml-auto text-[var(--color-text-muted)]",children:j?"On (uses Apple GPU)":"Off (runs in Docker)"})]})]},h.id)})})]})}function P4(){const{state:a}=fr(),[s,o]=N.useState(null);if(N.useEffect(()=>{bg().then(o).catch(()=>{})},[]),!s)return l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(Ct,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const i=s.services.filter(x=>x.category==="core"),d=s.services.filter(x=>x.category!=="core"&&a.enabledModules.includes(x.id)),f=[...i,...d],m=new Map;for(const x of f){const j=a.portOverrides[x.id]??x.port,M=m.get(j)??[];m.set(j,[...M,x.name])}const v=[...m.entries()].filter(([,x])=>x.length>1),g=f.filter(x=>x.database).length,h=f.filter(x=>a.nativeServices.includes(x.id)),y=f.filter(x=>!a.nativeServices.includes(x.id));return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Review Configuration"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Review your selections before installing."})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsx(Iu,{label:"Docker Services",value:y.length}),l.jsx(Iu,{label:"Native Services",value:h.length}),l.jsx(Iu,{label:"Databases",value:g})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Deployment Mode"}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:a.deploymentMode==="local"?"Local (all services on this machine)":"Remote LLM"}),a.deploymentMode==="remote-llm"&&a.remoteLlmUrl&&l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["LLM: ",a.remoteLlmUrl]})]}),l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsxs("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:["Services (",f.length,")"]})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:f.map(x=>l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pt,{size:14,className:"text-green-500"}),l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:x.name})]}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",a.portOverrides[x.id]??x.port]})]},x.id))})]}),a.relayEnabled&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[l.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Jarvis Relay"}),l.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:"Enabled"}),l.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:"https://relay.jarvisautomation.io"})]}),v.length>0&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ra,{size:16,className:"text-amber-500"}),l.jsx("span",{className:"text-sm font-medium text-amber-500",children:"Port Conflicts"})]}),v.map(([x,j])=>l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Port ",x,": ",j.join(", ")]},x))]})]})}function Iu({label:a,value:s}){return l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-3 text-center",children:[l.jsx("p",{className:"text-2xl font-bold text-[var(--color-primary)]",children:s}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a})]})}function Wu(){const[a,s]=N.useState({lines:[],running:!1,done:!1,exitCode:null,error:null,redirect:null}),o=N.useRef(null),i=N.useCallback((f,m)=>(o.current?.close(),s({lines:[],running:!0,done:!1,exitCode:null,error:null,redirect:null}),new Promise((v,g)=>{const h=new EventSource(f);o.current=h,h.onmessage=y=>{try{const x=JSON.parse(y.data);if(m&&m(x),"done"in x){if(s(j=>({...j,running:!1,done:!0,exitCode:x.code,redirect:x.redirect??null})),h.close(),x.code===0)v(x.code);else{const j=x.error?String(x.error):`Process exited with code ${x.code}`;g(new Error(j))}return}if("stream"in x&&"text"in x){const j={stream:x.stream,text:x.text,timestamp:Date.now()};s(M=>({...M,lines:[...M.lines,j]}))}}catch{}},h.onerror=()=>{const y=o.current===null;s(x=>({...x,running:!1,error:x.done?null:"Connection lost"})),h.close(),y||g(new Error("Connection lost"))}})),[]),d=N.useCallback(()=>{o.current?.close(),o.current=null,s(f=>({...f,running:!1}))},[]);return{...a,run:i,stop:d}}function ed({lines:a,running:s,title:o,className:i}){const d=N.useRef(null),f=N.useRef(!0);N.useEffect(()=>{const v=d.current;!v||!f.current||(v.scrollTop=v.scrollHeight)},[a]);function m(){const v=d.current;if(!v)return;const g=v.scrollHeight-v.scrollTop-v.clientHeight;f.current=g<50}return l.jsxs("div",{className:ae("flex flex-col rounded-lg border border-[var(--color-border)] overflow-hidden",i),children:[o&&l.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2",children:[l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:o}),s&&l.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-green-500"})]}),l.jsxs("div",{ref:d,onScroll:m,className:"h-64 overflow-y-auto bg-[#0d1117] p-3 font-mono text-xs leading-5",children:[a.length===0&&!s&&l.jsx("span",{className:"text-gray-500",children:"Waiting for output..."}),a.map((v,g)=>l.jsx("div",{className:ae("whitespace-pre-wrap break-all",v.stream==="stderr"?"text-yellow-400":"text-gray-300"),children:v.text},g)),s&&l.jsx("span",{className:"inline-block h-4 w-1.5 animate-pulse bg-gray-400"})]})]})}function I4(){const{state:a,dispatch:s}=fr(),o=Wu(),i=Wu(),d=Wu(),[f,m]=N.useState("idle"),[v,g]=N.useState(null),[h,y]=N.useState(null),[x,j]=N.useState({}),[M,w]=N.useState({}),[E,_]=N.useState(null),[A,k]=N.useState(null),[X,I]=N.useState(null),[W,ee]=N.useState({});N.useEffect(()=>{const ne=i.redirect;if(f!=="done"||!ne||a.platform==="darwin")return;k(5);const C=setInterval(()=>{k(Y=>Y===null||Y<=1?(clearInterval(C),window.location.href=ne,0):Y-1)},1e3);return()=>clearInterval(C)},[f,i.redirect]);const D=N.useCallback(async()=>{m("preflight"),y(null),g(null);try{const ne=await kE(a.enabledModules);return y(ne),ne.canProceed?!0:(g("Pre-flight checks failed. Fix the issues above and retry."),m("error"),_("preflight"),!1)}catch(ne){return g(`Pre-flight check failed: ${ne instanceof Error?ne.message:String(ne)}`),m("error"),_("preflight"),!1}},[a.enabledModules]);async function z(){if(a.nativeServices.length!==0){m("native");for(const ne of a.nativeServices){I(ne);try{await d.run(`/api/native-services/${ne}/install`),ee(C=>({...C,[ne]:{ok:!0}}))}catch(C){const Y=C instanceof Error?C.message:String(C);ee(K=>({...K,[ne]:{ok:!1,error:Y}}))}}I(null)}}async function oe(){g(null),j({}),_(null),ee({}),s({type:"SET_INSTALL_RUNNING",running:!0});try{if(!await D()){s({type:"SET_INSTALL_RUNNING",running:!1});return}m("generating"),await qx(a),m("pulling"),await o.run("/api/install/pull"),m("starting"),await i.run("/api/install/start",C=>{if(C.phase==="health"&&typeof C.service=="string"&&j(Y=>({...Y,[C.service]:{healthy:C.healthy,error:C.error}})),C.serviceHealth&&typeof C.serviceHealth=="object"){const Y=C.serviceHealth;j(K=>({...K,...Y}))}}),await z(),m("done"),s({type:"SET_INSTALL_COMPLETE"})}catch(ne){g(ne instanceof Error?ne.message:String(ne)),m("error"),_(f),s({type:"SET_INSTALL_RUNNING",running:!1})}}async function be(){if(E==="preflight"){if(g(null),s({type:"SET_INSTALL_RUNNING",running:!0}),!await D()){s({type:"SET_INSTALL_RUNNING",running:!1});return}try{m("generating"),await qx(a),m("pulling"),await o.run("/api/install/pull"),m("starting"),await i.run("/api/install/start",C=>{if(C.phase==="health"&&typeof C.service=="string"&&j(Y=>({...Y,[C.service]:{healthy:C.healthy,error:C.error}})),C.serviceHealth&&typeof C.serviceHealth=="object"){const Y=C.serviceHealth;j(K=>({...K,...Y}))}}),await z(),m("done"),s({type:"SET_INSTALL_COMPLETE"})}catch(C){g(C instanceof Error?C.message:String(C)),m("error"),s({type:"SET_INSTALL_RUNNING",running:!1})}}else oe()}async function se(ne){try{const C=await fetch(`/api/containers/${ne}/logs`);if(C.ok){const Y=await C.text();w(K=>({...K,[ne]:Y}))}else w(Y=>({...Y,[ne]:`Failed to fetch logs: HTTP ${C.status}`}))}catch(C){w(Y=>({...Y,[ne]:`Failed to fetch logs: ${C instanceof Error?C.message:String(C)}`}))}}const pe=[{key:"preflight",label:"Pre-flight checks"},{key:"generating",label:"Generate configuration"},{key:"pulling",label:"Pull Docker images"},{key:"starting",label:"Start services"},...a.nativeServices.length>0?[{key:"native",label:`Install ${a.nativeServices.length} native service${a.nativeServices.length===1?"":"s"}`}]:[]],he=pe.map(ne=>ne.key).indexOf(f);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Install"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:f==="idle"?"Ready to install. This will pull Docker images and start all services.":f==="done"?i.redirect&&a.platform!=="darwin"?`Installation complete! Redirecting to your admin dashboard in ${A??"..."}s...`:"Installation complete! Click Next to create your account and choose your models.":f==="error"?"Installation encountered an error.":"Installing..."})]}),h&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Pre-flight Checks"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:h.checks.map(ne=>l.jsx("div",{className:"flex items-center justify-between px-3 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[ne.status==="pass"?l.jsx(pt,{size:14,className:"text-green-500"}):ne.status==="warn"?l.jsx(ra,{size:14,className:"text-amber-500"}):l.jsx(xl,{size:14,className:"text-red-500"}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ne.name}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:ne.message}),ne.details&&ne.status!=="pass"&&l.jsx("p",{className:"text-xs text-[var(--color-text-muted)] opacity-60",children:ne.details})]})]})},ne.name))})]}),l.jsx("div",{className:"space-y-2",children:pe.map((ne,C)=>{const Y=ne.key===f,K=he>C||f==="done",ge=f==="error"&&ne.key===E;return l.jsxs("div",{className:"flex items-center gap-3",children:[K?l.jsx(pt,{size:18,className:"text-green-500"}):ge?l.jsx(xl,{size:18,className:"text-red-500"}):Y?l.jsx(Ct,{size:18,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-[18px] w-[18px] rounded-full border-2 border-[var(--color-border)]"}),l.jsx("span",{className:ae("text-sm",K?"text-green-500":Y?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:ne.label})]},ne.key)})}),(f==="starting"||f==="done"||f==="error")&&Object.keys(x).length>0&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Service Status"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:Object.entries(x).map(([ne,C])=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ne}),l.jsxs("div",{className:"flex items-center gap-2",children:[!C.healthy&&l.jsxs("button",{type:"button",onClick:()=>se(ne),className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[l.jsx(tg,{size:12}),"Logs"]}),C.healthy?l.jsx(pt,{size:14,className:"text-green-500"}):l.jsx(xl,{size:14,className:"text-red-500"})]})]}),C.error&&l.jsx("p",{className:"px-3 pb-2 text-xs text-red-400",children:C.error}),M[ne]&&l.jsx("div",{className:"mx-3 mb-2 max-h-32 overflow-auto rounded bg-[var(--color-background)] p-2 text-xs font-mono text-[var(--color-text-muted)]",children:l.jsx("pre",{className:"whitespace-pre-wrap",children:M[ne]})})]},ne))})]}),(o.lines.length>0||o.running)&&l.jsx(ed,{lines:o.lines,running:o.running,title:"docker compose pull"}),(i.lines.length>0||i.running)&&l.jsx(ed,{lines:i.lines,running:i.running,title:"docker compose up -d"}),(f==="native"||Object.keys(W).length>0)&&l.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[l.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:l.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Native Services (LaunchAgents)"})}),l.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:a.nativeServices.map(ne=>{const C=W[ne],Y=X===ne&&f==="native";return l.jsxs("div",{className:"px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ne}),C?.ok?l.jsx(pt,{size:14,className:"text-green-500"}):C?l.jsx(xl,{size:14,className:"text-red-500"}):Y?l.jsx(Ct,{size:14,className:"animate-spin text-[var(--color-primary)]"}):l.jsx("div",{className:"h-3 w-3 rounded-full border border-[var(--color-border)]"})]}),C?.error&&l.jsx("p",{className:"mt-1 text-xs text-red-400",children:C.error})]},ne)})})]}),(d.lines.length>0||d.running)&&l.jsx(ed,{lines:d.lines,running:d.running,title:X?`deploy-launchd.sh (${X})`:"deploy-launchd.sh"}),v&&l.jsx("div",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:v}),(f==="idle"||f==="error")&&l.jsxs("button",{type:"button",onClick:f==="error"?be:oe,className:ae("flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-3 font-medium text-white","hover:opacity-90 transition-opacity"),children:[f==="error"?l.jsx(yi,{size:18}):l.jsx(ag,{size:18}),f==="error"?"Retry Installation":"Start Installation"]})]})}const W4="jarvis-llm-proxy-api";function e3(){const{state:a,dispatch:s}=fr(),o=yg(),i=wg(),d=jg(),f=a.platform==="darwin",[m,v]=N.useState("select"),[g,h]=N.useState(null),[y,x]=N.useState("GGUF"),[j,M]=N.useState(""),[w,E]=N.useState(!0),[_,A]=N.useState(null);if(a.deploymentMode==="remote-llm")return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Your LLM is configured to use a remote server."})]}),l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(pt,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM configured"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a.remoteLlmUrl})]})]})]});const k=z=>{h(z),A(null),z.gated&&!j.trim()?v("token"):I(z,j.trim())},X=()=>{if(!j.trim()){A("HuggingFace token is required for gated models");return}g&&I(g,j)},I=async(z,oe)=>{A(null),v("downloading");const be=y==="GGUF"?z.hfRepoGguf:z.hfRepoVllm,se=y==="GGUF"?z.ggufFilename:void 0;try{await i.mutateAsync({repo:be,filename:se,token:oe||void 0})}catch(Ee){A(`Download failed: ${Ee.message}`),v("select");return}if(await W(z)){if(w){v("whisper");try{await y4(!0)}catch(Ee){console.warn("[models] whisper auto-download setup failed:",Ee)}}v("done")}},W=async z=>{v("configuring");const be={"model.live.name":y==="GGUF"?`.models/${z.ggufFilename}`:`.models/${z.hfRepoVllm.split("/").pop()}`,"model.live.backend":y,"model.live.chat_format":z.chatFormat,"model.live.context_window":z.contextWindow,"llm.interface":z.promptProvider};y==="GGUF"&&(be["inference.gguf.n_gpu_layers"]=-1),y==="VLLM"&&z.quantization&&(be["inference.vllm.quantization"]=z.quantization);try{if(await o.mutateAsync(be),f)try{await d.mutateAsync(W4)}catch(se){console.warn("[models] llm-proxy restart failed (KeepAlive will retry):",se)}return s({type:"SET_LLM_INTERFACE",interfaceId:z.promptProvider}),!0}catch(se){return A(`Configuration failed: ${se.message}`),v("select"),!1}},ee=a.hardware?.gpuVramMb,D=ee?ss.filter(z=>z.vramMb<=ee):ss;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Models"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:m==="done"?"Models configured. Services are restarting to load them.":"Choose a language model, and optionally fetch the speech-to-text model."})]}),_&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-500",children:[l.jsx(ra,{size:16,className:"mt-0.5 shrink-0"}),_]}),g&&l.jsxs("button",{type:"button",onClick:()=>I(g,j),className:ae("flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors"),children:[l.jsx(yi,{size:14}),"Retry"]})]}),m==="select"&&l.jsxs(l.Fragment,{children:[!f&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Backend"}),l.jsx("div",{className:"flex gap-2",children:["GGUF","VLLM"].map(z=>l.jsx("button",{type:"button",onClick:()=>x(z),className:ae("rounded-md px-3 py-1 text-xs font-medium transition-colors",y===z?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:z==="VLLM"?"vLLM":z},z))})]}),l.jsxs("label",{className:ae("flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors",w?"border-[var(--color-primary)] bg-[var(--color-primary)]/5":"border-[var(--color-border)]"),children:[l.jsx("input",{type:"checkbox",checked:w,onChange:z=>E(z.target.checked),className:"mt-0.5"}),l.jsxs("span",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[l.jsx(Mx,{size:15,className:"shrink-0 text-[var(--color-primary)]"}),l.jsxs("span",{children:["Auto-download the speech-to-text model",l.jsxs("span",{className:"block text-xs text-[var(--color-text-muted)]",children:["Whisper ",l.jsx("code",{children:"base.en"})," (~150 MB, no token needed). Required for voice."]})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"hf-token",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"HuggingFace Token (optional — speeds up downloads, required for gated models)"}),l.jsx("input",{id:"hf-token",type:"password",value:j,onChange:z=>M(z.target.value),placeholder:"hf_...",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Language model"}),D.map(z=>l.jsxs("button",{type:"button",onClick:()=>k(z),className:ae("flex w-full items-center justify-between rounded-lg border border-[var(--color-border)] p-3 text-left transition-colors","hover:border-[var(--color-primary)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:z.displayName}),z.gated&&l.jsxs("span",{className:"flex items-center gap-0.5 rounded bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(gi,{size:10}),"Gated"]})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[z.promptProvider," · ",z.contextWindow.toLocaleString()," ctx"]})]}),l.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["~",y==="GGUF"?z.sizeGguf:z.sizeVllm]})]},z.id)),D.length===0&&l.jsxs("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:["No models fit your available memory (",ee?Math.round(ee/1024)+" GB":"unknown",")."]}),ee&&D.length<ss.length&&l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Showing ",D.length," of ",ss.length," models that fit your ",Math.round(ee/1024)," GB."]})]})]}),m==="token"&&g&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[l.jsx("strong",{children:g.displayName})," is a gated model. Accept the license on HuggingFace and paste your access token below."]}),l.jsx("input",{type:"password",value:j,onChange:z=>M(z.target.value),placeholder:"hf_...",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")}),l.jsxs("div",{className:"flex justify-between",children:[l.jsx("button",{type:"button",onClick:()=>{v("select"),A(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),l.jsx("button",{type:"button",onClick:X,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Download"})]})]}),m==="whisper"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(Mx,{className:"mb-4 animate-pulse text-[var(--color-primary)]",size:32}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Enabling speech-to-text model download..."}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Whisper will fetch ggml-base.en on restart"})]}),m==="downloading"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(za,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Downloading ",g?.displayName,"..."]}),l.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["~",y==="GGUF"?g?.sizeGguf:g?.sizeVllm," · This may take several minutes"]})]}),m==="configuring"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(Ct,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Configuring model and prompt provider..."})]}),m==="done"&&g&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(pt,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:[g.displayName," configured"]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Backend: ",y," · Prompt provider: ",g.promptProvider,w&&" · Whisper auto-download enabled"]})]})]}),l.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["The LLM proxy is restarting with the new model",w&&", and whisper is fetching its model",". This may take a few minutes to finish loading. Command Center will use the"," ",l.jsx("strong",{children:g.promptProvider})," prompt provider."]})]})]})}function t3(){const[a,s]=N.useState(""),[o,i]=N.useState(""),[d,f]=N.useState(""),[m,v]=N.useState(""),[g,h]=N.useState(!1),[y,x]=N.useState(!1),[j,M]=N.useState(null),w=o===d,E=a&&o&&d&&m&&w&&!g;async function _(){if(E){h(!0),M(null);try{const k=await Pv(a,o,m);rs(k.access_token),localStorage.setItem("access_token",k.access_token),localStorage.setItem("refresh_token",k.refresh_token),x(!0)}catch(k){const X=k?.response?.data?.error??(k instanceof Error?k.message:"Failed to create account");M(X)}finally{h(!1)}}}if(y)return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Account Created"})}),l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[l.jsx(pt,{size:20,className:"text-green-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Superuser account created"}),l.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a})]})]}),l.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:`You're logged in. Click "Next" to configure your LLM model.`})]});const A=ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Create Account"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Create your superuser account. This will be the admin for your Jarvis instance."})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"display-name",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Display Name"}),l.jsx("input",{id:"display-name",type:"text",value:m,onChange:k=>v(k.target.value),className:A,placeholder:"Alex"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),l.jsx("input",{id:"email",type:"email",value:a,onChange:k=>s(k.target.value),className:A,placeholder:"admin@example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),l.jsx("input",{id:"password",type:"password",value:o,onChange:k=>i(k.target.value),className:A,placeholder:"Choose a strong password"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),l.jsx("input",{id:"confirm-password",type:"password",value:d,onChange:k=>f(k.target.value),className:ae(A,d&&!w&&"ring-2 ring-red-500"),placeholder:"Confirm password"}),d&&!w&&l.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Passwords don't match"})]})]}),j&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[l.jsx(Bd,{size:14,className:"text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm text-red-500",children:j})]}),l.jsxs("button",{type:"button",onClick:_,disabled:!E,className:ae("flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors","disabled:opacity-50"),children:[l.jsx(yi,{size:14}),"Retry"]})]}),!j&&l.jsx("button",{type:"button",onClick:_,disabled:!E,className:ae("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50 transition-opacity"),children:g?"Creating...":"Create Superuser Account"})]})}const Jo=[{label:"Welcome",component:K4},{label:"Hardware",component:$4},{label:"Services",component:Z4},{label:"Review",component:P4},{label:"Install",component:I4},{label:"Account",component:t3},{label:"Models",component:e3}],a3=5;function n3({skipToAccount:a}){const{state:s,dispatch:o}=fr();N.useEffect(()=>{a&&o({type:"SET_STEP",step:a3})},[a,o]);const i=wa(),d=Jo[s.currentStep].component,f=s.currentStep===0,m=s.currentStep===Jo.length-1,h=s.currentStep===4&&!s.installComplete,y=s.installRunning||h;function x(){m?i("/login"):o({type:"NEXT_STEP"})}function j(){o({type:"PREV_STEP"})}return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)] p-4",children:l.jsxs("div",{className:"w-full max-w-2xl",children:[l.jsx("div",{className:"mb-6 flex items-center justify-center gap-1",children:Jo.map((M,w)=>l.jsxs("button",{type:"button",onClick:()=>!y&&o({type:"SET_STEP",step:w}),disabled:y,className:ae("flex items-center gap-1",y&&"cursor-not-allowed"),children:[l.jsx("div",{className:ae("flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium transition-colors",w===s.currentStep?"bg-[var(--color-primary)] text-white":w<s.currentStep?"bg-[var(--color-primary)]/20 text-[var(--color-primary)]":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:w+1}),l.jsx("span",{className:ae("hidden text-xs sm:inline",w===s.currentStep?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:M.label}),w<Jo.length-1&&l.jsx("div",{className:ae("mx-1 h-px w-4 sm:w-6",w<s.currentStep?"bg-[var(--color-primary)]/30":"bg-[var(--color-border)]")})]},M.label))}),l.jsx("div",{className:"rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-6 shadow-lg",children:l.jsx(d,{})}),l.jsxs("div",{className:"mt-4 flex justify-between",children:[l.jsx("button",{type:"button",onClick:j,disabled:f||y,className:ae("rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors","disabled:invisible"),children:"Back"}),l.jsx("button",{type:"button",onClick:x,disabled:y,className:ae("rounded-lg bg-[var(--color-primary)] px-6 py-2 text-sm font-medium text-white","hover:opacity-90 transition-opacity","disabled:opacity-50 disabled:cursor-not-allowed"),children:m?"Finish":"Next"})]})]})})}function r3({skipToAccount:a}){return l.jsx(X4,{children:l.jsx(n3,{skipToAccount:a})})}function s3(){const a=wa(),s=yg(),o=RE(),[i,d]=N.useState("select"),[f,m]=N.useState(null),[v,g]=N.useState("GGUF"),[h,y]=N.useState(""),[x,j]=N.useState(null),M=k=>{m(k),k.gated?d("token"):E(k,"")},w=()=>{if(!h.trim()){j("HuggingFace token is required for gated models");return}j(null),f&&E(f,h)},E=async(k,X)=>{d("download"),j(null);const I=v==="GGUF"?k.hfRepoGguf:k.hfRepoVllm,W=v==="GGUF"?k.ggufFilename:void 0;try{await o.mutateAsync({repo:I,filename:W,token:X||void 0}),_(k)}catch(ee){j(`Download failed: ${ee.message}`),d("select")}},_=async k=>{d("configure"),j(null);const I={"model.live.name":v==="GGUF"?`.models/${k.ggufFilename}`:`.models/${k.hfRepoVllm.split("/").pop()}`,"model.live.backend":v,"model.live.chat_format":k.chatFormat,"model.live.context_window":k.contextWindow};v==="GGUF"&&(I["inference.gguf.n_gpu_layers"]=-1),v==="VLLM"&&k.quantization&&(I["inference.vllm.quantization"]=k.quantization);try{await s.mutateAsync(I),d("done"),Me.success("LLM configured successfully")}catch(W){j(`Configuration failed: ${W.message}`),d("select")}},A=()=>{a("/dashboard")};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-bg)] p-4",children:l.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:[l.jsxs("div",{className:"mb-8 text-center",children:[l.jsx(pd,{className:"mx-auto mb-3 text-[var(--color-primary)]",size:40}),l.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"LLM Setup"}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Configure a local language model for Jarvis"})]}),l.jsx("div",{className:"mb-8 flex items-center justify-center gap-2",children:["select","download","configure","done"].map((k,X)=>{const I=i==="token"?"select":i,W=["select","download","configure","done"];return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:ae("h-2 w-2 rounded-full",I===k?"bg-[var(--color-primary)]":W.indexOf(I)>X?"bg-green-500":"bg-[var(--color-border)]")}),X<3&&l.jsx("div",{className:"h-px w-8 bg-[var(--color-border)]"})]},k)})}),x&&l.jsxs("div",{className:"mb-6 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-500",children:[l.jsx(ra,{size:16,className:"mt-0.5 shrink-0"}),x]}),i==="select"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Select a model"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>g("GGUF"),className:ae("rounded-md px-3 py-1 text-xs font-medium transition-colors",v==="GGUF"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"GGUF"}),l.jsx("button",{onClick:()=>g("VLLM"),className:ae("rounded-md px-3 py-1 text-xs font-medium transition-colors",v==="VLLM"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"vLLM"})]})]}),l.jsx("div",{className:"grid gap-3",children:ss.map(k=>l.jsxs("button",{onClick:()=>M(k),className:ae("flex items-center justify-between rounded-lg border border-[var(--color-border)] p-4 text-left transition-colors","hover:border-[var(--color-primary)] hover:bg-[var(--color-surface-alt)]"),children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-[var(--color-text)]",children:k.displayName}),k.gated&&l.jsxs("span",{className:"flex items-center gap-1 rounded bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:[l.jsx(gi,{size:10}),"Gated"]})]}),l.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[k.quantization?`${k.quantization.toUpperCase()} 4-bit`:k.chatFormat," · ",k.contextWindow.toLocaleString()," ctx"]})]}),l.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["~",v==="GGUF"?k.sizeGguf:k.sizeVllm]})]},k.id))}),l.jsx("div",{className:"flex justify-end pt-2",children:l.jsx("button",{onClick:A,className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Skip for now"})})]}),i==="token"&&f&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Access Required"}),l.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[l.jsx("strong",{children:f.displayName})," is a gated model. You need to:"]}),l.jsxs("ol",{className:"list-inside list-decimal space-y-1 text-sm text-[var(--color-text-muted)]",children:[l.jsx("li",{children:"Visit the model page on huggingface.co and accept the license agreement"}),l.jsx("li",{children:"Create an access token at huggingface.co/settings/tokens"}),l.jsx("li",{children:"Paste your token below"})]}),l.jsx("input",{type:"password",value:h,onChange:k=>y(k.target.value),placeholder:"hf_...",className:ae("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")}),l.jsxs("div",{className:"flex justify-between",children:[l.jsx("button",{onClick:()=>{d("select"),j(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),l.jsx("button",{onClick:w,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Continue"})]})]}),i==="download"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(za,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Downloading model..."}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," ","(~",v==="GGUF"?f?.sizeGguf:f?.sizeVllm,")"]}),l.jsx("p",{className:"mt-4 text-xs text-[var(--color-text-muted)]",children:"This may take several minutes depending on your connection"})]}),i==="configure"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(ng,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Configuring..."}),l.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Writing settings and restarting LLM proxy"})]}),i==="done"&&l.jsxs("div",{className:"flex flex-col items-center py-8",children:[l.jsx(qj,{className:"mb-4 text-green-500",size:40}),l.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"LLM Ready"}),l.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," configured on ",v]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"The model service is restarting. It may take a minute to load the model."}),l.jsx("button",{onClick:()=>a("/dashboard"),className:"mt-6 rounded-lg bg-[var(--color-primary)] px-6 py-2 text-sm text-white hover:opacity-90",children:"Go to Dashboard"})]}),(o.isPending||s.isPending)&&i!=="download"&&i!=="configure"&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:l.jsx(Ct,{className:"animate-spin text-white",size:32})})]})})}const l3=new J1;function o3(){const[a,s]=N.useState(!0),[o,i]=N.useState(!1),[d,f]=N.useState(!1);return N.useEffect(()=>{Xd().then(m=>{m.state==="deployed-needs-account"?(f(!0),i(!0)):i(!m.configured)}).catch(()=>{i(!1)}).finally(()=>s(!1))},[]),a?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:l.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-primary)] border-t-transparent"})}):l.jsxs(X0,{children:[l.jsx(mt,{path:"/setup",element:l.jsx(r3,{skipToAccount:d})}),l.jsx(mt,{path:"/login",element:l.jsx($w,{})}),l.jsx(mt,{path:"/llm-setup",element:l.jsx(s3,{})}),l.jsxs(mt,{element:l.jsx(Kw,{}),children:[l.jsx(mt,{path:"/dashboard",element:l.jsx(BE,{})}),l.jsx(mt,{path:"/settings",element:l.jsx(oE,{})}),l.jsx(mt,{path:"/services",element:l.jsx(SE,{})}),l.jsx(mt,{path:"/models",element:l.jsx(N4,{})}),l.jsx(mt,{path:"/quick-sets",element:l.jsx(k4,{})}),l.jsx(mt,{path:"/traces",element:l.jsx(B4,{})}),l.jsx(mt,{path:"/traces/:id",element:l.jsx(H4,{})}),l.jsx(mt,{path:"/update",element:l.jsx(M4,{})}),l.jsx(mt,{path:"/reconcile",element:l.jsx(O4,{})}),l.jsx(mt,{path:"/nodes",element:l.jsx(KE,{})}),l.jsx(mt,{path:"/users",element:l.jsx(n4,{})}),l.jsx(mt,{path:"/native-services",element:l.jsx(m4,{})}),l.jsx(mt,{path:"/",element:o?l.jsx(ri,{to:"/setup",replace:!0}):l.jsx(ri,{to:"/dashboard",replace:!0})}),l.jsx(mt,{path:"*",element:l.jsx(G4,{})})]})]})}function i3(){return l.jsx(L2,{children:l.jsx(P1,{client:l3,children:l.jsxs(bj,{children:[l.jsx(x1,{children:l.jsx(o3,{})}),l.jsx(D2,{position:"bottom-right",richColors:!0})]})})})}Yb.createRoot(document.getElementById("root")).render(l.jsx(N.StrictMode,{children:l.jsx(i3,{})}));