@alexberardi/jarvis-admin 0.1.47 → 0.1.49

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.
@@ -0,0 +1,18 @@
1
+ (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.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 s(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=s(d);fetch(d.href,f)}})();function Lx(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _u={exports:{}},is={};var _p;function Tb(){if(_p)return is;_p=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(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 x in d)x!=="key"&&(f[x]=d[x])}else f=d;return d=f.ref,{$$typeof:n,type:i,key:m,ref:d!==void 0?d:null,props:f}}return is.Fragment=l,is.jsx=s,is.jsxs=s,is}var Mp;function Rb(){return Mp||(Mp=1,_u.exports=Tb()),_u.exports}var o=Rb(),Mu={exports:{}},je={};var Ap;function Cb(){if(Ap)return je;Ap=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=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"),x=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),j=Symbol.iterator;function M(T){return T===null||typeof T!="object"?null:(T=j&&T[j]||T["@@iterator"],typeof T=="function"?T:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,R={};function O(T,Q,V){this.props=T,this.context=Q,this.refs=R,this.updater=V||N}O.prototype.isReactComponent={},O.prototype.setState=function(T,Q){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,Q,"setState")},O.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function _(){}_.prototype=O.prototype;function Y(T,Q,V){this.props=T,this.context=Q,this.refs=R,this.updater=V||N}var L=Y.prototype=new _;L.constructor=Y,w(L,O.prototype),L.isPureReactComponent=!0;var $=Array.isArray;function F(){}var W={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(T,Q,V){var I=V.ref;return{$$typeof:n,type:T,key:Q,ref:I!==void 0?I:null,props:V}}function le(T,Q){return te(T.type,Q,T.props)}function oe(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function fe(T){var Q={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(V){return Q[V]})}var Ee=/\/+/g;function ge(T,Q){return typeof T=="object"&&T!==null&&T.key!=null?fe(""+T.key):Q.toString(36)}function Le(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(F,F):(T.status="pending",T.then(function(Q){T.status==="pending"&&(T.status="fulfilled",T.value=Q)},function(Q){T.status==="pending"&&(T.status="rejected",T.reason=Q)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function k(T,Q,V,I,B){var ie=typeof T;(ie==="undefined"||ie==="boolean")&&(T=null);var se=!1;if(T===null)se=!0;else switch(ie){case"bigint":case"string":case"number":se=!0;break;case"object":switch(T.$$typeof){case n:case l:se=!0;break;case y:return se=T._init,k(se(T._payload),Q,V,I,B)}}if(se)return B=B(T),se=I===""?"."+ge(T,0):I,$(B)?(V="",se!=null&&(V=se.replace(Ee,"$&/")+"/"),k(B,Q,V,"",function(ae){return ae})):B!=null&&(oe(B)&&(B=le(B,V+(B.key==null||T&&T.key===B.key?"":(""+B.key).replace(Ee,"$&/")+"/")+se)),Q.push(B)),1;se=0;var ye=I===""?".":I+":";if($(T))for(var q=0;q<T.length;q++)I=T[q],ie=ye+ge(I,q),se+=k(I,Q,V,ie,B);else if(q=M(T),typeof q=="function")for(T=q.call(T),q=0;!(I=T.next()).done;)I=I.value,ie=ye+ge(I,q++),se+=k(I,Q,V,ie,B);else if(ie==="object"){if(typeof T.then=="function")return k(Le(T),Q,V,I,B);throw Q=String(T),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return se}function P(T,Q,V){if(T==null)return T;var I=[],B=0;return k(T,I,"","",function(ie){return Q.call(V,ie,B++)}),I}function Z(T){if(T._status===-1){var Q=T._result;Q=Q(),Q.then(function(V){(T._status===0||T._status===-1)&&(T._status=1,T._result=V)},function(V){(T._status===0||T._status===-1)&&(T._status=2,T._result=V)}),T._status===-1&&(T._status=0,T._result=Q)}if(T._status===1)return T._result.default;throw T._result}var ve=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},pe={map:P,forEach:function(T,Q,V){P(T,function(){Q.apply(this,arguments)},V)},count:function(T){var Q=0;return P(T,function(){Q++}),Q},toArray:function(T){return P(T,function(Q){return Q})||[]},only:function(T){if(!oe(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return je.Activity=p,je.Children=pe,je.Component=O,je.Fragment=s,je.Profiler=d,je.PureComponent=Y,je.StrictMode=i,je.Suspense=v,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,je.__COMPILER_RUNTIME={__proto__:null,c:function(T){return W.H.useMemoCache(T)}},je.cache=function(T){return function(){return T.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(T,Q,V){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var I=w({},T.props),B=T.key;if(Q!=null)for(ie in Q.key!==void 0&&(B=""+Q.key),Q)!ee.call(Q,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&Q.ref===void 0||(I[ie]=Q[ie]);var ie=arguments.length-2;if(ie===1)I.children=V;else if(1<ie){for(var se=Array(ie),ye=0;ye<ie;ye++)se[ye]=arguments[ye+2];I.children=se}return te(T.type,B,I)},je.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:f,_context:T},T},je.createElement=function(T,Q,V){var I,B={},ie=null;if(Q!=null)for(I in Q.key!==void 0&&(ie=""+Q.key),Q)ee.call(Q,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(B[I]=Q[I]);var se=arguments.length-2;if(se===1)B.children=V;else if(1<se){for(var ye=Array(se),q=0;q<se;q++)ye[q]=arguments[q+2];B.children=ye}if(T&&T.defaultProps)for(I in se=T.defaultProps,se)B[I]===void 0&&(B[I]=se[I]);return te(T,ie,B)},je.createRef=function(){return{current:null}},je.forwardRef=function(T){return{$$typeof:x,render:T}},je.isValidElement=oe,je.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:Z}},je.memo=function(T,Q){return{$$typeof:g,type:T,compare:Q===void 0?null:Q}},je.startTransition=function(T){var Q=W.T,V={};W.T=V;try{var I=T(),B=W.S;B!==null&&B(V,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(F,ve)}catch(ie){ve(ie)}finally{Q!==null&&V.types!==null&&(Q.types=V.types),W.T=Q}},je.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},je.use=function(T){return W.H.use(T)},je.useActionState=function(T,Q,V){return W.H.useActionState(T,Q,V)},je.useCallback=function(T,Q){return W.H.useCallback(T,Q)},je.useContext=function(T){return W.H.useContext(T)},je.useDebugValue=function(){},je.useDeferredValue=function(T,Q){return W.H.useDeferredValue(T,Q)},je.useEffect=function(T,Q){return W.H.useEffect(T,Q)},je.useEffectEvent=function(T){return W.H.useEffectEvent(T)},je.useId=function(){return W.H.useId()},je.useImperativeHandle=function(T,Q,V){return W.H.useImperativeHandle(T,Q,V)},je.useInsertionEffect=function(T,Q){return W.H.useInsertionEffect(T,Q)},je.useLayoutEffect=function(T,Q){return W.H.useLayoutEffect(T,Q)},je.useMemo=function(T,Q){return W.H.useMemo(T,Q)},je.useOptimistic=function(T,Q){return W.H.useOptimistic(T,Q)},je.useReducer=function(T,Q,V){return W.H.useReducer(T,Q,V)},je.useRef=function(T){return W.H.useRef(T)},je.useState=function(T){return W.H.useState(T)},je.useSyncExternalStore=function(T,Q,V){return W.H.useSyncExternalStore(T,Q,V)},je.useTransition=function(){return W.H.useTransition()},je.version="19.2.4",je}var kp;function ud(){return kp||(kp=1,Mu.exports=Cb()),Mu.exports}var S=ud();const ne=Lx(S);var Au={exports:{}},cs={},ku={exports:{}},Ou={};var Op;function _b(){return Op||(Op=1,(function(n){function l(k,P){var Z=k.length;k.push(P);e:for(;0<Z;){var ve=Z-1>>>1,pe=k[ve];if(0<d(pe,P))k[ve]=P,k[Z]=pe,Z=ve;else break e}}function s(k){return k.length===0?null:k[0]}function i(k){if(k.length===0)return null;var P=k[0],Z=k.pop();if(Z!==P){k[0]=Z;e:for(var ve=0,pe=k.length,T=pe>>>1;ve<T;){var Q=2*(ve+1)-1,V=k[Q],I=Q+1,B=k[I];if(0>d(V,Z))I<pe&&0>d(B,V)?(k[ve]=B,k[I]=Z,ve=I):(k[ve]=V,k[Q]=Z,ve=Q);else if(I<pe&&0>d(B,Z))k[ve]=B,k[I]=Z,ve=I;else break e}}return P}function d(k,P){var Z=k.sortIndex-P.sortIndex;return Z!==0?Z:k.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,x=m.now();n.unstable_now=function(){return m.now()-x}}var v=[],g=[],y=1,p=null,j=3,M=!1,N=!1,w=!1,R=!1,O=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function L(k){for(var P=s(g);P!==null;){if(P.callback===null)i(g);else if(P.startTime<=k)i(g),P.sortIndex=P.expirationTime,l(v,P);else break;P=s(g)}}function $(k){if(w=!1,L(k),!N)if(s(v)!==null)N=!0,F||(F=!0,fe());else{var P=s(g);P!==null&&Le($,P.startTime-k)}}var F=!1,W=-1,ee=5,te=-1;function le(){return R?!0:!(n.unstable_now()-te<ee)}function oe(){if(R=!1,F){var k=n.unstable_now();te=k;var P=!0;try{e:{N=!1,w&&(w=!1,_(W),W=-1),M=!0;var Z=j;try{t:{for(L(k),p=s(v);p!==null&&!(p.expirationTime>k&&le());){var ve=p.callback;if(typeof ve=="function"){p.callback=null,j=p.priorityLevel;var pe=ve(p.expirationTime<=k);if(k=n.unstable_now(),typeof pe=="function"){p.callback=pe,L(k),P=!0;break t}p===s(v)&&i(v),L(k)}else i(v);p=s(v)}if(p!==null)P=!0;else{var T=s(g);T!==null&&Le($,T.startTime-k),P=!1}}break e}finally{p=null,j=Z,M=!1}P=void 0}}finally{P?fe():F=!1}}}var fe;if(typeof Y=="function")fe=function(){Y(oe)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,ge=Ee.port2;Ee.port1.onmessage=oe,fe=function(){ge.postMessage(null)}}else fe=function(){O(oe,0)};function Le(k,P){W=O(function(){k(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return j},n.unstable_next=function(k){switch(j){case 1:case 2:case 3:var P=3;break;default:P=j}var Z=j;j=P;try{return k()}finally{j=Z}},n.unstable_requestPaint=function(){R=!0},n.unstable_runWithPriority=function(k,P){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var Z=j;j=k;try{return P()}finally{j=Z}},n.unstable_scheduleCallback=function(k,P,Z){var ve=n.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?ve+Z:ve):Z=ve,k){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=Z+pe,k={id:y++,callback:P,priorityLevel:k,startTime:Z,expirationTime:pe,sortIndex:-1},Z>ve?(k.sortIndex=Z,l(g,k),s(v)===null&&k===s(g)&&(w?(_(W),W=-1):w=!0,Le($,Z-ve))):(k.sortIndex=pe,l(v,k),N||M||(N=!0,F||(F=!0,fe()))),k},n.unstable_shouldYield=le,n.unstable_wrapCallback=function(k){var P=j;return function(){var Z=j;j=P;try{return k.apply(this,arguments)}finally{j=Z}}}})(Ou)),Ou}var zp;function Mb(){return zp||(zp=1,ku.exports=_b()),ku.exports}var zu={exports:{}},wt={};var Dp;function Ab(){if(Dp)return wt;Dp=1;var n=ud();function l(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+v+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(v,g,y){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:p==null?null:""+p,children:v,containerInfo:g,implementation:y}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,wt.createPortal=function(v,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return f(v,g,null,y)},wt.flushSync=function(v){var g=m.T,y=i.p;try{if(m.T=null,i.p=2,v)return v()}finally{m.T=g,i.p=y,i.d.f()}},wt.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(v,g))},wt.prefetchDNS=function(v){typeof v=="string"&&i.d.D(v)},wt.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var y=g.as,p=x(y,g.crossOrigin),j=typeof g.integrity=="string"?g.integrity:void 0,M=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?i.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:p,integrity:j,fetchPriority:M}):y==="script"&&i.d.X(v,{crossOrigin:p,integrity:j,fetchPriority:M,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},wt.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=x(g.as,g.crossOrigin);i.d.M(v,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(v)},wt.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,p=x(y,g.crossOrigin);i.d.L(v,y,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},wt.preloadModule=function(v,g){if(typeof v=="string")if(g){var y=x(g.as,g.crossOrigin);i.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(v)},wt.requestFormReset=function(v){i.d.r(v)},wt.unstable_batchedUpdates=function(v,g){return v(g)},wt.useFormState=function(v,g,y){return m.H.useFormState(v,g,y)},wt.useFormStatus=function(){return m.H.useHostTransitionStatus()},wt.version="19.2.4",wt}var Up;function Bx(){if(Up)return zu.exports;Up=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),zu.exports=Ab(),zu.exports}var Lp;function kb(){if(Lp)return cs;Lp=1;var n=Mb(),l=ud(),s=Bx();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(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 v(e){if(f(e)!==e)throw Error(i(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,r=t;;){var c=a.return;if(c===null)break;var u=c.alternate;if(u===null){if(r=c.return,r!==null){a=r;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===a)return v(c),e;if(u===r)return v(c),t;u=u.sibling}throw Error(i(188))}if(a.return!==r.return)a=c,r=u;else{for(var h=!1,b=c.child;b;){if(b===a){h=!0,a=c,r=u;break}if(b===r){h=!0,r=c,a=u;break}b=b.sibling}if(!h){for(b=u.child;b;){if(b===a){h=!0,a=u,r=c;break}if(b===r){h=!0,r=u,a=c;break}b=b.sibling}if(!h)throw Error(i(189))}}if(a.alternate!==r)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?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 p=Object.assign,j=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function ge(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 w:return"Fragment";case O:return"Profiler";case R:return"StrictMode";case $:return"Suspense";case F:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case Y:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case L:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return t=e.displayName||null,t!==null?t:ge(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var Le=Array.isArray,k=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},ve=[],pe=-1;function T(e){return{current:e}}function Q(e){0>pe||(e.current=ve[pe],ve[pe]=null,pe--)}function V(e,t){pe++,ve[pe]=e.current,e.current=t}var I=T(null),B=T(null),ie=T(null),se=T(null);function ye(e,t){switch(V(ie,t),V(B,e),V(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ih(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ih(t),e=Wh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Q(I),V(I,e)}function q(){Q(I),Q(B),Q(ie)}function ae(e){e.memoizedState!==null&&V(se,e);var t=I.current,a=Wh(t,e.type);t!==a&&(V(B,e),V(I,a))}function Ce(e){B.current===e&&(Q(I),Q(B)),se.current===e&&(Q(se),rs._currentValue=Z)}var Me,ga;function it(e){if(Me===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||"",ga=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Me+e+ga}var On=!1;function dr(e,t){if(!e||On)return"";On=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(H){var U=H}Reflect.construct(e,[],J)}else{try{J.call()}catch(H){U=H}e.call(J.prototype)}}else{try{throw Error()}catch(H){U=H}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(H){if(H&&U&&typeof H.stack=="string")return[H.stack,U.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(),h=u[0],b=u[1];if(h&&b){var E=h.split(`
4
+ `),D=b.split(`
5
+ `);for(c=r=0;r<E.length&&!E[r].includes("DetermineComponentFrameRoot");)r++;for(;c<D.length&&!D[c].includes("DetermineComponentFrameRoot");)c++;if(r===E.length||c===D.length)for(r=E.length-1,c=D.length-1;1<=r&&0<=c&&E[r]!==D[c];)c--;for(;1<=r&&0<=c;r--,c--)if(E[r]!==D[c]){if(r!==1||c!==1)do if(r--,c--,0>c||E[r]!==D[c]){var X=`
6
+ `+E[r].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=r&&0<=c);break}}}finally{On=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?it(a):""}function zn(e,t){switch(e.tag){case 26:case 27:case 5:return it(e.type);case 16:return it("Lazy");case 13:return e.child!==t&&t!==null?it("Suspense Fallback"):it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return dr(e.type,!1);case 11:return dr(e.type.render,!1);case 1:return dr(e.type,!0);case 31:return it("Activity");default:return""}}function hl(e){try{var t="",a=null;do t+=zn(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var Kt=Object.prototype.hasOwnProperty,pl=n.unstable_scheduleCallback,xl=n.unstable_cancelCallback,Tt=n.unstable_shouldYield,an=n.unstable_requestPaint,Rt=n.unstable_now,gi=n.unstable_getCurrentPriorityLevel,Dn=n.unstable_ImmediatePriority,ws=n.unstable_UserBlockingPriority,Un=n.unstable_NormalPriority,gl=n.unstable_LowPriority,za=n.unstable_IdlePriority,Es=n.log,nn=n.unstable_setDisableYieldValue,Ln=null,Ct=null;function va(e){if(typeof Es=="function"&&nn(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Ln,e)}catch{}}var Nt=Math.clz32?Math.clz32:Ta,vi=Math.log,vl=Math.LN2;function Ta(e){return e>>>=0,e===0?32:31-(vi(e)/vl|0)|0}var fr=256,mr=262144,Bn=4194304;function Ra(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 Se(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var c=0,u=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var b=r&134217727;return b!==0?(r=b&~u,r!==0?c=Ra(r):(h&=b,h!==0?c=Ra(h):a||(a=b&~e,a!==0&&(c=Ra(a))))):(b=r&~u,b!==0?c=Ra(b):h!==0?c=Ra(h):a||(a=r&~e,a!==0&&(c=Ra(a)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:c}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(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 jt(){var e=Bn;return Bn<<=1,(Bn&62914560)===0&&(Bn=4194304),e}function rn(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ot(e,t,a,r,c,u){var h=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,E=e.expirationTimes,D=e.hiddenUpdates;for(a=h&~a;0<a;){var X=31-Nt(a),J=1<<X;b[X]=0,E[X]=-1;var U=D[X];if(U!==null)for(D[X]=null,X=0;X<U.length;X++){var H=U[X];H!==null&&(H.lane&=-536870913)}a&=~J}r!==0&&qn(e,r,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(h&~t))}function qn(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Nt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function zt(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Nt(a),c=1<<r;c&t|e[r]&t&&(e[r]|=t),a&=~c}}function Dt(e,t){var a=t&-t;return a=(a&42)!==0?1:hr(a),(a&(e.suspendedLanes|t))!==0?0:a}function hr(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 yi(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:Np(e.type))}function Ld(e,t){var a=P.p;try{return P.p=e,t()}finally{P.p=a}}var ln=Math.random().toString(36).slice(2),pt="__reactFiber$"+ln,Ut="__reactProps$"+ln,pr="__reactContainer$"+ln,bi="__reactEvents$"+ln,pv="__reactListeners$"+ln,xv="__reactHandles$"+ln,Bd="__reactResources$"+ln,yl="__reactMarker$"+ln;function Si(e){delete e[pt],delete e[Ut],delete e[bi],delete e[pv],delete e[xv]}function xr(e){var t=e[pt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[pr]||a[pt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=sp(e);e!==null;){if(a=e[pt])return a;e=sp(e)}return t}e=a,a=e.parentNode}return null}function gr(e){if(e=e[pt]||e[pr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vr(e){var t=e[Bd];return t||(t=e[Bd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[yl]=!0}var qd=new Set,Hd={};function Hn(e,t){yr(e,t),yr(e+"Capture",t)}function yr(e,t){for(Hd[e]=t,e=0;e<t.length;e++)qd.add(t[e])}var gv=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]*$"),Gd={},Qd={};function vv(e){return Kt.call(Qd,e)?!0:Kt.call(Gd,e)?!1:gv.test(e)?Qd[e]=!0:(Gd[e]=!0,!1)}function Ts(e,t,a){if(vv(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){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,""+a)}}function Rs(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Da(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function ra(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yv(e,t,a){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(h){a=""+h,u.call(this,h)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ni(e){if(!e._valueTracker){var t=Vd(e)?"checked":"value";e._valueTracker=yv(e,t,""+e[t])}}function Yd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Vd(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Cs(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 bv=/[\n"\\]/g;function la(e){return e.replace(bv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ji(e,t,a,r,c,u,h,b){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ra(t)):e.value!==""+ra(t)&&(e.value=""+ra(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?wi(e,h,ra(t)):a!=null?wi(e,h,ra(a)):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=""+ra(b):e.removeAttribute("name")}function Fd(e,t,a,r,c,u,h,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ni(e);return}a=a!=null?""+ra(a):"",t=t!=null?""+ra(t):a,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,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Ni(e)}function wi(e,t,a){t==="number"&&Cs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function br(e,t,a,r){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&r&&(e[a].defaultSelected=!0)}else{for(a=""+ra(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Xd(e,t,a){if(t!=null&&(t=""+ra(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ra(a):""}function Kd(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(Le(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=ra(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Ni(e)}function Sr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Sv=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 Zd(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||Sv.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Jd(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var r in a)!a.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)&&a[c]!==r&&Zd(e,c,r)}else for(var u in t)t.hasOwnProperty(u)&&Zd(e,u,t[u])}function Ei(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 Nv=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"]]),jv=/^[\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 _s(e){return jv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ua(){}var Ti=null;function Ri(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nr=null,jr=null;function $d(e){var t=gr(e);if(t&&(e=t.stateNode)){var a=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(ji(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+la(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[Ut]||null;if(!c)throw Error(i(90));ji(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Yd(r)}break e;case"textarea":Xd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&br(e,!!a.multiple,t,!1)}}}var Ci=!1;function Pd(e,t,a){if(Ci)return e(t,a);Ci=!0;try{var r=e(t);return r}finally{if(Ci=!1,(Nr!==null||jr!==null)&&(go(),Nr&&(t=Nr,e=jr,jr=Nr=null,$d(t),e)))for(t=0;t<e.length;t++)$d(e[t])}}function Sl(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Ut]||null;if(r===null)return null;a=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(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var La=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_i=!1;if(La)try{var Nl={};Object.defineProperty(Nl,"passive",{get:function(){_i=!0}}),window.addEventListener("test",Nl,Nl),window.removeEventListener("test",Nl,Nl)}catch{_i=!1}var sn=null,Mi=null,Ms=null;function Id(){if(Ms)return Ms;var e,t=Mi,a=t.length,r,c="value"in sn?sn.value:sn.textContent,u=c.length;for(e=0;e<a&&t[e]===c[e];e++);var h=a-e;for(r=1;r<=h&&t[a-r]===c[u-r];r++);return Ms=c.slice(e,1<r?1-r:void 0)}function As(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 ks(){return!0}function Wd(){return!1}function Lt(e){function t(a,r,c,u,h){this._reactName=a,this._targetInst=c,this.type=r,this.nativeEvent=u,this.target=h,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?ks:Wd,this.isPropagationStopped=Wd,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ks)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ks)},persist:function(){},isPersistent:ks}),t}var Gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Os=Lt(Gn),jl=p({},Gn,{view:0,detail:0}),wv=Lt(jl),Ai,ki,wl,zs=p({},jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zi,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!==wl&&(wl&&e.type==="mousemove"?(Ai=e.screenX-wl.screenX,ki=e.screenY-wl.screenY):ki=Ai=0,wl=e),Ai)},movementY:function(e){return"movementY"in e?e.movementY:ki}}),ef=Lt(zs),Ev=p({},zs,{dataTransfer:0}),Tv=Lt(Ev),Rv=p({},jl,{relatedTarget:0}),Oi=Lt(Rv),Cv=p({},Gn,{animationName:0,elapsedTime:0,pseudoElement:0}),_v=Lt(Cv),Mv=p({},Gn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Av=Lt(Mv),kv=p({},Gn,{data:0}),tf=Lt(kv),Ov={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zv={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"},Dv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dv[e])?!!t[e]:!1}function zi(){return Uv}var Lv=p({},jl,{key:function(e){if(e.key){var t=Ov[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=As(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zi,charCode:function(e){return e.type==="keypress"?As(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?As(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bv=Lt(Lv),qv=p({},zs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),af=Lt(qv),Hv=p({},jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zi}),Gv=Lt(Hv),Qv=p({},Gn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vv=Lt(Qv),Yv=p({},zs,{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}),Fv=Lt(Yv),Xv=p({},Gn,{newState:0,oldState:0}),Kv=Lt(Xv),Zv=[9,13,27,32],Di=La&&"CompositionEvent"in window,El=null;La&&"documentMode"in document&&(El=document.documentMode);var Jv=La&&"TextEvent"in window&&!El,nf=La&&(!Di||El&&8<El&&11>=El),rf=" ",lf=!1;function sf(e,t){switch(e){case"keyup":return Zv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function of(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wr=!1;function $v(e,t){switch(e){case"compositionend":return of(t);case"keypress":return t.which!==32?null:(lf=!0,rf);case"textInput":return e=t.data,e===rf&&lf?null:e;default:return null}}function Pv(e,t){if(wr)return e==="compositionend"||!Di&&sf(e,t)?(e=Id(),Ms=Mi=sn=null,wr=!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 nf&&t.locale!=="ko"?null:t.data;default:return null}}var Iv={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 cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Iv[e.type]:t==="textarea"}function uf(e,t,a,r){Nr?jr?jr.push(r):jr=[r]:Nr=r,t=wo(t,"onChange"),0<t.length&&(a=new Os("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Tl=null,Rl=null;function Wv(e){Xh(e,0)}function Ds(e){var t=bl(e);if(Yd(t))return e}function df(e,t){if(e==="change")return t}var ff=!1;if(La){var Ui;if(La){var Li="oninput"in document;if(!Li){var mf=document.createElement("div");mf.setAttribute("oninput","return;"),Li=typeof mf.oninput=="function"}Ui=Li}else Ui=!1;ff=Ui&&(!document.documentMode||9<document.documentMode)}function hf(){Tl&&(Tl.detachEvent("onpropertychange",pf),Rl=Tl=null)}function pf(e){if(e.propertyName==="value"&&Ds(Rl)){var t=[];uf(t,Rl,e,Ri(e)),Pd(Wv,t)}}function ey(e,t,a){e==="focusin"?(hf(),Tl=t,Rl=a,Tl.attachEvent("onpropertychange",pf)):e==="focusout"&&hf()}function ty(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ds(Rl)}function ay(e,t){if(e==="click")return Ds(t)}function ny(e,t){if(e==="input"||e==="change")return Ds(t)}function ry(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:ry;function Cl(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var c=a[r];if(!Kt.call(t,c)||!Zt(e[c],t[c]))return!1}return!0}function xf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gf(e,t){var a=xf(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=xf(a)}}function vf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Cs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Cs(e.document)}return t}function Bi(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 ly=La&&"documentMode"in document&&11>=document.documentMode,Er=null,qi=null,_l=null,Hi=!1;function bf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Hi||Er==null||Er!==Cs(r)||(r=Er,"selectionStart"in r&&Bi(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}),_l&&Cl(_l,r)||(_l=r,r=wo(qi,"onSelect"),0<r.length&&(t=new Os("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Er)))}function Qn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Tr={animationend:Qn("Animation","AnimationEnd"),animationiteration:Qn("Animation","AnimationIteration"),animationstart:Qn("Animation","AnimationStart"),transitionrun:Qn("Transition","TransitionRun"),transitionstart:Qn("Transition","TransitionStart"),transitioncancel:Qn("Transition","TransitionCancel"),transitionend:Qn("Transition","TransitionEnd")},Gi={},Sf={};La&&(Sf=document.createElement("div").style,"AnimationEvent"in window||(delete Tr.animationend.animation,delete Tr.animationiteration.animation,delete Tr.animationstart.animation),"TransitionEvent"in window||delete Tr.transitionend.transition);function Vn(e){if(Gi[e])return Gi[e];if(!Tr[e])return e;var t=Tr[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Sf)return Gi[e]=t[a];return e}var Nf=Vn("animationend"),jf=Vn("animationiteration"),wf=Vn("animationstart"),sy=Vn("transitionrun"),oy=Vn("transitionstart"),iy=Vn("transitioncancel"),Ef=Vn("transitionend"),Tf=new Map,Qi="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(" ");Qi.push("scrollEnd");function ba(e,t){Tf.set(e,t),Hn(t,[e])}var Us=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)},sa=[],Rr=0,Vi=0;function Ls(){for(var e=Rr,t=Vi=Rr=0;t<e;){var a=sa[t];sa[t++]=null;var r=sa[t];sa[t++]=null;var c=sa[t];sa[t++]=null;var u=sa[t];if(sa[t++]=null,r!==null&&c!==null){var h=r.pending;h===null?c.next=c:(c.next=h.next,h.next=c),r.pending=c}u!==0&&Rf(a,c,u)}}function Bs(e,t,a,r){sa[Rr++]=e,sa[Rr++]=t,sa[Rr++]=a,sa[Rr++]=r,Vi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yi(e,t,a,r){return Bs(e,t,a,r),qs(e)}function Yn(e,t){return Bs(e,null,null,t),qs(e)}function Rf(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var c=!1,u=e.return;u!==null;)u.childLanes|=a,r=u.alternate,r!==null&&(r.childLanes|=a),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-Nt(a),e=u.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),u):null}function qs(e){if(50<Pl)throw Pl=0,Wc=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Cr={};function cy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(e,t,a,r){return new cy(e,t,a,r)}function Fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ba(e,t){var a=e.alternate;return a===null?(a=Jt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Cf(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hs(e,t,a,r,c,u){var h=0;if(r=e,typeof e=="function")Fi(e)&&(h=1);else if(typeof e=="string")h=hb(e,a,I.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Jt(31,a,t,c),e.elementType=te,e.lanes=u,e;case w:return Fn(a.children,c,u,t);case R:h=8,c|=24;break;case O:return e=Jt(12,a,t,c|2),e.elementType=O,e.lanes=u,e;case $:return e=Jt(13,a,t,c),e.elementType=$,e.lanes=u,e;case F:return e=Jt(19,a,t,c),e.elementType=F,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:h=10;break e;case _:h=9;break e;case L:h=11;break e;case W:h=14;break e;case ee:h=16,r=null;break e}h=29,a=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=Jt(h,a,t,c),t.elementType=e,t.type=r,t.lanes=u,t}function Fn(e,t,a,r){return e=Jt(7,e,r,t),e.lanes=a,e}function Xi(e,t,a){return e=Jt(6,e,null,t),e.lanes=a,e}function _f(e){var t=Jt(18,null,null,0);return t.stateNode=e,t}function Ki(e,t,a){return t=Jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Mf=new WeakMap;function oa(e,t){if(typeof e=="object"&&e!==null){var a=Mf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:hl(t)},Mf.set(e,t),t)}return{value:e,source:t,stack:hl(t)}}var _r=[],Mr=0,Gs=null,Ml=0,ia=[],ca=0,on=null,Ca=1,_a="";function qa(e,t){_r[Mr++]=Ml,_r[Mr++]=Gs,Gs=e,Ml=t}function Af(e,t,a){ia[ca++]=Ca,ia[ca++]=_a,ia[ca++]=on,on=e;var r=Ca;e=_a;var c=32-Nt(r)-1;r&=~(1<<c),a+=1;var u=32-Nt(t)+c;if(30<u){var h=c-c%5;u=(r&(1<<h)-1).toString(32),r>>=h,c-=h,Ca=1<<32-Nt(t)+c|a<<c|r,_a=u+e}else Ca=1<<u|a<<c|r,_a=e}function Zi(e){e.return!==null&&(qa(e,1),Af(e,1,0))}function Ji(e){for(;e===Gs;)Gs=_r[--Mr],_r[Mr]=null,Ml=_r[--Mr],_r[Mr]=null;for(;e===on;)on=ia[--ca],ia[ca]=null,_a=ia[--ca],ia[ca]=null,Ca=ia[--ca],ia[ca]=null}function kf(e,t){ia[ca++]=Ca,ia[ca++]=_a,ia[ca++]=on,Ca=t.id,_a=t.overflow,on=e}var xt=null,Ke=null,De=!1,cn=null,ua=!1,$i=Error(i(519));function un(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Al(oa(t,e)),$i}function Of(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[pt]=e,t[Ut]=r,a){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(a=0;a<Wl.length;a++)ke(Wl[a],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),Fd(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),Kd(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||$h(t.textContent,a)?(r.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),r.onScroll!=null&&ke("scroll",t),r.onScrollEnd!=null&&ke("scrollend",t),r.onClick!=null&&(t.onclick=Ua),t=!0):t=!1,t||un(e,!0)}function zf(e){for(xt=e.return;xt;)switch(xt.tag){case 5:case 31:case 13:ua=!1;return;case 27:case 3:ua=!0;return;default:xt=xt.return}}function Ar(e){if(e!==xt)return!1;if(!De)return zf(e),De=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||hu(e.type,e.memoizedProps)),a=!a),a&&Ke&&un(e),zf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=lp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ke=lp(e)}else t===27?(t=Ke,wn(e.type)?(e=yu,yu=null,Ke=e):Ke=t):Ke=xt?fa(e.stateNode.nextSibling):null;return!0}function Xn(){Ke=xt=null,De=!1}function Pi(){var e=cn;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),cn=null),e}function Al(e){cn===null?cn=[e]:cn.push(e)}var Ii=T(null),Kn=null,Ha=null;function dn(e,t,a){V(Ii,t._currentValue),t._currentValue=a}function Ga(e){e._currentValue=Ii.current,Q(Ii)}function Wi(e,t,a){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===a)break;e=e.return}}function ec(e,t,a,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var h=c.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=c;for(var E=0;E<t.length;E++)if(b.context===t[E]){u.lanes|=a,b=u.alternate,b!==null&&(b.lanes|=a),Wi(u.return,a,e),r||(h=null);break e}u=b.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(i(341));h.lanes|=a,u=h.alternate,u!==null&&(u.lanes|=a),Wi(h,a,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function kr(e,t,a,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 h=c.alternate;if(h===null)throw Error(i(387));if(h=h.memoizedProps,h!==null){var b=c.type;Zt(c.pendingProps.value,h.value)||(e!==null?e.push(b):e=[b])}}else if(c===se.current){if(h=c.alternate,h===null)throw Error(i(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(rs):e=[rs])}c=c.return}e!==null&&ec(t,e,a,r),t.flags|=262144}function Qs(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zn(e){Kn=e,Ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function gt(e){return Df(Kn,e)}function Vs(e,t){return Kn===null&&Zn(e),Df(e,t)}function Df(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ha===null){if(e===null)throw Error(i(308));Ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ha=Ha.next=t;return a}var uy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},dy=n.unstable_scheduleCallback,fy=n.unstable_NormalPriority,rt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tc(){return{controller:new uy,data:new Map,refCount:0}}function kl(e){e.refCount--,e.refCount===0&&dy(fy,function(){e.controller.abort()})}var Ol=null,ac=0,Or=0,zr=null;function my(e,t){if(Ol===null){var a=Ol=[];ac=0,Or=lu(),zr={status:"pending",value:void 0,then:function(r){a.push(r)}}}return ac++,t.then(Uf,Uf),t}function Uf(){if(--ac===0&&Ol!==null){zr!==null&&(zr.status="fulfilled");var e=Ol;Ol=null,Or=0,zr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function hy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),r}var Lf=k.S;k.S=function(e,t){bh=Rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&my(e,t),Lf!==null&&Lf(e,t)};var Jn=T(null);function nc(){var e=Jn.current;return e!==null?e:Xe.pooledCache}function Ys(e,t){t===null?V(Jn,Jn.current):V(Jn,t.pool)}function Bf(){var e=nc();return e===null?null:{parent:rt._currentValue,pool:e}}var Dr=Error(i(460)),rc=Error(i(474)),Fs=Error(i(542)),Xs={then:function(){}};function qf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Hf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ua,Ua),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Qf(e),e;default:if(typeof t.status=="string")t.then(Ua,Ua);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,Qf(e),e}throw Pn=t,Dr}}function $n(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Pn=a,Dr):a}}var Pn=null;function Gf(){if(Pn===null)throw Error(i(459));var e=Pn;return Pn=null,e}function Qf(e){if(e===Dr||e===Fs)throw Error(i(483))}var Ur=null,zl=0;function Ks(e){var t=zl;return zl+=1,Ur===null&&(Ur=[]),Hf(Ur,e,t)}function Dl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Zs(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 Vf(e){function t(A,C){if(e){var z=A.deletions;z===null?(A.deletions=[C],A.flags|=16):z.push(C)}}function a(A,C){if(!e)return null;for(;C!==null;)t(A,C),C=C.sibling;return null}function r(A){for(var C=new Map;A!==null;)A.key!==null?C.set(A.key,A):C.set(A.index,A),A=A.sibling;return C}function c(A,C){return A=Ba(A,C),A.index=0,A.sibling=null,A}function u(A,C,z){return A.index=z,e?(z=A.alternate,z!==null?(z=z.index,z<C?(A.flags|=67108866,C):z):(A.flags|=67108866,C)):(A.flags|=1048576,C)}function h(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function b(A,C,z,K){return C===null||C.tag!==6?(C=Xi(z,A.mode,K),C.return=A,C):(C=c(C,z),C.return=A,C)}function E(A,C,z,K){var he=z.type;return he===w?X(A,C,z.props.children,K,z.key):C!==null&&(C.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===ee&&$n(he)===C.type)?(C=c(C,z.props),Dl(C,z),C.return=A,C):(C=Hs(z.type,z.key,z.props,null,A.mode,K),Dl(C,z),C.return=A,C)}function D(A,C,z,K){return C===null||C.tag!==4||C.stateNode.containerInfo!==z.containerInfo||C.stateNode.implementation!==z.implementation?(C=Ki(z,A.mode,K),C.return=A,C):(C=c(C,z.children||[]),C.return=A,C)}function X(A,C,z,K,he){return C===null||C.tag!==7?(C=Fn(z,A.mode,K,he),C.return=A,C):(C=c(C,z),C.return=A,C)}function J(A,C,z){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=Xi(""+C,A.mode,z),C.return=A,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case M:return z=Hs(C.type,C.key,C.props,null,A.mode,z),Dl(z,C),z.return=A,z;case N:return C=Ki(C,A.mode,z),C.return=A,C;case ee:return C=$n(C),J(A,C,z)}if(Le(C)||fe(C))return C=Fn(C,A.mode,z,null),C.return=A,C;if(typeof C.then=="function")return J(A,Ks(C),z);if(C.$$typeof===Y)return J(A,Vs(A,C),z);Zs(A,C)}return null}function U(A,C,z,K){var he=C!==null?C.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return he!==null?null:b(A,C,""+z,K);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case M:return z.key===he?E(A,C,z,K):null;case N:return z.key===he?D(A,C,z,K):null;case ee:return z=$n(z),U(A,C,z,K)}if(Le(z)||fe(z))return he!==null?null:X(A,C,z,K,null);if(typeof z.then=="function")return U(A,C,Ks(z),K);if(z.$$typeof===Y)return U(A,C,Vs(A,z),K);Zs(A,z)}return null}function H(A,C,z,K,he){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return A=A.get(z)||null,b(C,A,""+K,he);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case M:return A=A.get(K.key===null?z:K.key)||null,E(C,A,K,he);case N:return A=A.get(K.key===null?z:K.key)||null,D(C,A,K,he);case ee:return K=$n(K),H(A,C,z,K,he)}if(Le(K)||fe(K))return A=A.get(z)||null,X(C,A,K,he,null);if(typeof K.then=="function")return H(A,C,z,Ks(K),he);if(K.$$typeof===Y)return H(A,C,z,Vs(C,K),he);Zs(C,K)}return null}function ce(A,C,z,K){for(var he=null,Be=null,me=C,Re=C=0,ze=null;me!==null&&Re<z.length;Re++){me.index>Re?(ze=me,me=null):ze=me.sibling;var qe=U(A,me,z[Re],K);if(qe===null){me===null&&(me=ze);break}e&&me&&qe.alternate===null&&t(A,me),C=u(qe,C,Re),Be===null?he=qe:Be.sibling=qe,Be=qe,me=ze}if(Re===z.length)return a(A,me),De&&qa(A,Re),he;if(me===null){for(;Re<z.length;Re++)me=J(A,z[Re],K),me!==null&&(C=u(me,C,Re),Be===null?he=me:Be.sibling=me,Be=me);return De&&qa(A,Re),he}for(me=r(me);Re<z.length;Re++)ze=H(me,A,Re,z[Re],K),ze!==null&&(e&&ze.alternate!==null&&me.delete(ze.key===null?Re:ze.key),C=u(ze,C,Re),Be===null?he=ze:Be.sibling=ze,Be=ze);return e&&me.forEach(function(_n){return t(A,_n)}),De&&qa(A,Re),he}function xe(A,C,z,K){if(z==null)throw Error(i(151));for(var he=null,Be=null,me=C,Re=C=0,ze=null,qe=z.next();me!==null&&!qe.done;Re++,qe=z.next()){me.index>Re?(ze=me,me=null):ze=me.sibling;var _n=U(A,me,qe.value,K);if(_n===null){me===null&&(me=ze);break}e&&me&&_n.alternate===null&&t(A,me),C=u(_n,C,Re),Be===null?he=_n:Be.sibling=_n,Be=_n,me=ze}if(qe.done)return a(A,me),De&&qa(A,Re),he;if(me===null){for(;!qe.done;Re++,qe=z.next())qe=J(A,qe.value,K),qe!==null&&(C=u(qe,C,Re),Be===null?he=qe:Be.sibling=qe,Be=qe);return De&&qa(A,Re),he}for(me=r(me);!qe.done;Re++,qe=z.next())qe=H(me,A,Re,qe.value,K),qe!==null&&(e&&qe.alternate!==null&&me.delete(qe.key===null?Re:qe.key),C=u(qe,C,Re),Be===null?he=qe:Be.sibling=qe,Be=qe);return e&&me.forEach(function(Eb){return t(A,Eb)}),De&&qa(A,Re),he}function Fe(A,C,z,K){if(typeof z=="object"&&z!==null&&z.type===w&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case M:e:{for(var he=z.key;C!==null;){if(C.key===he){if(he=z.type,he===w){if(C.tag===7){a(A,C.sibling),K=c(C,z.props.children),K.return=A,A=K;break e}}else if(C.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===ee&&$n(he)===C.type){a(A,C.sibling),K=c(C,z.props),Dl(K,z),K.return=A,A=K;break e}a(A,C);break}else t(A,C);C=C.sibling}z.type===w?(K=Fn(z.props.children,A.mode,K,z.key),K.return=A,A=K):(K=Hs(z.type,z.key,z.props,null,A.mode,K),Dl(K,z),K.return=A,A=K)}return h(A);case N:e:{for(he=z.key;C!==null;){if(C.key===he)if(C.tag===4&&C.stateNode.containerInfo===z.containerInfo&&C.stateNode.implementation===z.implementation){a(A,C.sibling),K=c(C,z.children||[]),K.return=A,A=K;break e}else{a(A,C);break}else t(A,C);C=C.sibling}K=Ki(z,A.mode,K),K.return=A,A=K}return h(A);case ee:return z=$n(z),Fe(A,C,z,K)}if(Le(z))return ce(A,C,z,K);if(fe(z)){if(he=fe(z),typeof he!="function")throw Error(i(150));return z=he.call(z),xe(A,C,z,K)}if(typeof z.then=="function")return Fe(A,C,Ks(z),K);if(z.$$typeof===Y)return Fe(A,C,Vs(A,z),K);Zs(A,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,C!==null&&C.tag===6?(a(A,C.sibling),K=c(C,z),K.return=A,A=K):(a(A,C),K=Xi(z,A.mode,K),K.return=A,A=K),h(A)):a(A,C)}return function(A,C,z,K){try{zl=0;var he=Fe(A,C,z,K);return Ur=null,he}catch(me){if(me===Dr||me===Fs)throw me;var Be=Jt(29,me,null,A.mode);return Be.lanes=K,Be.return=A,Be}}}var In=Vf(!0),Yf=Vf(!1),fn=!1;function lc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sc(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 mn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hn(e,t,a){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=qs(e),Rf(e,null,a),t}return Bs(e,r,t,a),qs(e)}function Ul(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,zt(e,a)}}function oc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var c=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var h={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?c=u=h:u=u.next=h,a=a.next}while(a!==null);u===null?c=u=t:u=u.next=t}else c=u=t;a={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var ic=!1;function Ll(){if(ic){var e=zr;if(e!==null)throw e}}function Bl(e,t,a,r){ic=!1;var c=e.updateQueue;fn=!1;var u=c.firstBaseUpdate,h=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var E=b,D=E.next;E.next=null,h===null?u=D:h.next=D,h=E;var X=e.alternate;X!==null&&(X=X.updateQueue,b=X.lastBaseUpdate,b!==h&&(b===null?X.firstBaseUpdate=D:b.next=D,X.lastBaseUpdate=E))}if(u!==null){var J=c.baseState;h=0,X=D=E=null,b=u;do{var U=b.lane&-536870913,H=U!==b.lane;if(H?(Oe&U)===U:(r&U)===U){U!==0&&U===Or&&(ic=!0),X!==null&&(X=X.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ce=e,xe=b;U=t;var Fe=a;switch(xe.tag){case 1:if(ce=xe.payload,typeof ce=="function"){J=ce.call(Fe,J,U);break e}J=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=xe.payload,U=typeof ce=="function"?ce.call(Fe,J,U):ce,U==null)break e;J=p({},J,U);break e;case 2:fn=!0}}U=b.callback,U!==null&&(e.flags|=64,H&&(e.flags|=8192),H=c.callbacks,H===null?c.callbacks=[U]:H.push(U))}else H={lane:U,tag:b.tag,payload:b.payload,callback:b.callback,next:null},X===null?(D=X=H,E=J):X=X.next=H,h|=U;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;H=b,b=H.next,H.next=null,c.lastBaseUpdate=H,c.shared.pending=null}}while(!0);X===null&&(E=J),c.baseState=E,c.firstBaseUpdate=D,c.lastBaseUpdate=X,u===null&&(c.shared.lanes=0),yn|=h,e.lanes=h,e.memoizedState=J}}function Ff(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Xf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Ff(a[e],t)}var Lr=T(null),Js=T(0);function Kf(e,t){e=$a,V(Js,e),V(Lr,t),$a=e|t.baseLanes}function cc(){V(Js,$a),V(Lr,Lr.current)}function uc(){$a=Js.current,Q(Lr),Q(Js)}var $t=T(null),da=null;function pn(e){var t=e.alternate;V(tt,tt.current&1),V($t,e),da===null&&(t===null||Lr.current!==null||t.memoizedState!==null)&&(da=e)}function dc(e){V(tt,tt.current),V($t,e),da===null&&(da=e)}function Zf(e){e.tag===22?(V(tt,tt.current),V($t,e),da===null&&(da=e)):xn()}function xn(){V(tt,tt.current),V($t,$t.current)}function Pt(e){Q($t),da===e&&(da=null),Q(tt)}var tt=T(0);function $s(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||gu(a)||vu(a)))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 Qa=0,Te=null,Ve=null,lt=null,Ps=!1,Br=!1,Wn=!1,Is=0,ql=0,qr=null,py=0;function We(){throw Error(i(321))}function fc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Zt(e[a],t[a]))return!1;return!0}function mc(e,t,a,r,c,u){return Qa=u,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Am:Cc,Wn=!1,u=a(r,c),Wn=!1,Br&&(u=$f(t,a,r,c)),Jf(e),u}function Jf(e){k.H=Ql;var t=Ve!==null&&Ve.next!==null;if(Qa=0,lt=Ve=Te=null,Ps=!1,ql=0,qr=null,t)throw Error(i(300));e===null||st||(e=e.dependencies,e!==null&&Qs(e)&&(st=!0))}function $f(e,t,a,r){Te=e;var c=0;do{if(Br&&(qr=null),ql=0,Br=!1,25<=c)throw Error(i(301));if(c+=1,lt=Ve=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}k.H=km,u=t(a,r)}while(Br);return u}function xy(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Hl(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Te.flags|=1024),t}function hc(){var e=Is!==0;return Is=0,e}function pc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function xc(e){if(Ps){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ps=!1}Qa=0,lt=Ve=Te=null,Br=!1,ql=Is=0,qr=null}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?Te.memoizedState=lt=e:lt=lt.next=e,lt}function at(){if(Ve===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=lt===null?Te.memoizedState:lt.next;if(t!==null)lt=t,Ve=e;else{if(e===null)throw Te.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},lt===null?Te.memoizedState=lt=e:lt=lt.next=e}return lt}function Ws(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hl(e){var t=ql;return ql+=1,qr===null&&(qr=[]),e=Hf(qr,e,t),t=Te,(lt===null?t.memoizedState:lt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Am:Cc),e}function eo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Hl(e);if(e.$$typeof===Y)return gt(e)}throw Error(i(438,String(e)))}function gc(e){var t=null,a=Te.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=Te.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}),a===null&&(a=Ws(),Te.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=le;return t.index++,a}function Va(e,t){return typeof t=="function"?t(e):t}function to(e){var t=at();return vc(t,Ve,e)}function vc(e,t,a){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=a;var c=e.baseQueue,u=r.pending;if(u!==null){if(c!==null){var h=c.next;c.next=u.next,u.next=h}t.baseQueue=c=u,r.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var b=h=null,E=null,D=t,X=!1;do{var J=D.lane&-536870913;if(J!==D.lane?(Oe&J)===J:(Qa&J)===J){var U=D.revertLane;if(U===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),J===Or&&(X=!0);else if((Qa&U)===U){D=D.next,U===Or&&(X=!0);continue}else J={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},E===null?(b=E=J,h=u):E=E.next=J,Te.lanes|=U,yn|=U;J=D.action,Wn&&a(u,J),u=D.hasEagerState?D.eagerState:a(u,J)}else U={lane:J,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},E===null?(b=E=U,h=u):E=E.next=U,Te.lanes|=J,yn|=J;D=D.next}while(D!==null&&D!==t);if(E===null?h=u:E.next=b,!Zt(u,e.memoizedState)&&(st=!0,X&&(a=zr,a!==null)))throw a;e.memoizedState=u,e.baseState=h,e.baseQueue=E,r.lastRenderedState=u}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function yc(e){var t=at(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var r=a.dispatch,c=a.pending,u=t.memoizedState;if(c!==null){a.pending=null;var h=c=c.next;do u=e(u,h.action),h=h.next;while(h!==c);Zt(u,t.memoizedState)||(st=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,r]}function Pf(e,t,a){var r=Te,c=at(),u=De;if(u){if(a===void 0)throw Error(i(407));a=a()}else a=t();var h=!Zt((Ve||c).memoizedState,a);if(h&&(c.memoizedState=a,st=!0),c=c.queue,Nc(em.bind(null,r,c,e),[e]),c.getSnapshot!==t||h||lt!==null&&lt.memoizedState.tag&1){if(r.flags|=2048,Hr(9,{destroy:void 0},Wf.bind(null,r,c,a,t),null),Xe===null)throw Error(i(349));u||(Qa&127)!==0||If(r,t,a)}return a}function If(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Te.updateQueue,t===null?(t=Ws(),Te.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Wf(e,t,a,r){t.value=a,t.getSnapshot=r,tm(t)&&am(e)}function em(e,t,a){return a(function(){tm(t)&&am(e)})}function tm(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Zt(e,a)}catch{return!0}}function am(e){var t=Yn(e,2);t!==null&&Qt(t,e,2)}function bc(e){var t=_t();if(typeof e=="function"){var a=e;if(e=a(),Wn){va(!0);try{a()}finally{va(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:e},t}function nm(e,t,a,r){return e.baseState=a,vc(e,Ve,typeof r=="function"?r:Va)}function gy(e,t,a,r,c){if(ro(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(h){u.listeners.push(h)}};k.T!==null?a(!0):u.isTransition=!1,r(u),a=t.pending,a===null?(u.next=t.pending=u,rm(t,u)):(u.next=a.next,t.pending=a.next=u)}}function rm(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var u=k.T,h={};k.T=h;try{var b=a(c,r),E=k.S;E!==null&&E(h,b),lm(e,t,b)}catch(D){Sc(e,t,D)}finally{u!==null&&h.types!==null&&(u.types=h.types),k.T=u}}else try{u=a(c,r),lm(e,t,u)}catch(D){Sc(e,t,D)}}function lm(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){sm(e,t,r)},function(r){return Sc(e,t,r)}):sm(e,t,a)}function sm(e,t,a){t.status="fulfilled",t.value=a,om(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,rm(e,a)))}function Sc(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,om(t),t=t.next;while(t!==r)}e.action=null}function om(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function im(e,t){return t}function cm(e,t){if(De){var a=Xe.formState;if(a!==null){e:{var r=Te;if(De){if(Ke){t:{for(var c=Ke,u=ua;c.nodeType!==8;){if(!u){c=null;break t}if(c=fa(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ke=fa(c.nextSibling),r=c.data==="F!";break e}}un(r)}r=!1}r&&(t=a[0])}}return a=_t(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:im,lastRenderedState:t},a.queue=r,a=Cm.bind(null,Te,r),r.dispatch=a,r=bc(!1),u=Rc.bind(null,Te,!1,r.queue),r=_t(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=gy.bind(null,Te,c,u,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function um(e){var t=at();return dm(t,Ve,e)}function dm(e,t,a){if(t=vc(e,t,im)[0],e=to(Va)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Hl(t)}catch(h){throw h===Dr?Fs:h}else r=t;t=at();var c=t.queue,u=c.dispatch;return a!==t.memoizedState&&(Te.flags|=2048,Hr(9,{destroy:void 0},vy.bind(null,c,a),null)),[r,u,e]}function vy(e,t){e.action=t}function fm(e){var t=at(),a=Ve;if(a!==null)return dm(t,a,e);at(),t=t.memoizedState,a=at();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function Hr(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Ws(),Te.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function mm(){return at().memoizedState}function ao(e,t,a,r){var c=_t();Te.flags|=e,c.memoizedState=Hr(1|t,{destroy:void 0},a,r===void 0?null:r)}function no(e,t,a,r){var c=at();r=r===void 0?null:r;var u=c.memoizedState.inst;Ve!==null&&r!==null&&fc(r,Ve.memoizedState.deps)?c.memoizedState=Hr(t,u,a,r):(Te.flags|=e,c.memoizedState=Hr(1|t,u,a,r))}function hm(e,t){ao(8390656,8,e,t)}function Nc(e,t){no(2048,8,e,t)}function yy(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=Ws(),Te.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function pm(e){var t=at().memoizedState;return yy({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function xm(e,t){return no(4,2,e,t)}function gm(e,t){return no(4,4,e,t)}function vm(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ym(e,t,a){a=a!=null?a.concat([e]):null,no(4,4,vm.bind(null,t,e),a)}function jc(){}function bm(e,t){var a=at();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&fc(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Sm(e,t){var a=at();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&fc(t,r[1]))return r[0];if(r=e(),Wn){va(!0);try{e()}finally{va(!1)}}return a.memoizedState=[r,t],r}function wc(e,t,a){return a===void 0||(Qa&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Nh(),Te.lanes|=e,yn|=e,a)}function Nm(e,t,a,r){return Zt(a,t)?a:Lr.current!==null?(e=wc(e,a,r),Zt(e,t)||(st=!0),e):(Qa&42)===0||(Qa&1073741824)!==0&&(Oe&261930)===0?(st=!0,e.memoizedState=a):(e=Nh(),Te.lanes|=e,yn|=e,t)}function jm(e,t,a,r,c){var u=P.p;P.p=u!==0&&8>u?u:8;var h=k.T,b={};k.T=b,Rc(e,!1,t,a);try{var E=c(),D=k.S;if(D!==null&&D(b,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var X=hy(E,r);Gl(e,t,X,ea(e))}else Gl(e,t,r,ea(e))}catch(J){Gl(e,t,{then:function(){},status:"rejected",reason:J},ea())}finally{P.p=u,h!==null&&b.types!==null&&(h.types=b.types),k.T=h}}function by(){}function Ec(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=wm(e).queue;jm(e,c,t,Z,a===null?by:function(){return Em(e),a(r)})}function wm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:Z},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Em(e){var t=wm(e);t.next===null&&(t=e.alternate.memoizedState),Gl(e,t.next.queue,{},ea())}function Tc(){return gt(rs)}function Tm(){return at().memoizedState}function Rm(){return at().memoizedState}function Sy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ea();e=mn(a);var r=hn(t,e,a);r!==null&&(Qt(r,t,a),Ul(r,t,a)),t={cache:tc()},e.payload=t;return}t=t.return}}function Ny(e,t,a){var r=ea();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ro(e)?_m(t,a):(a=Yi(e,t,a,r),a!==null&&(Qt(a,e,r),Mm(a,t,r)))}function Cm(e,t,a){var r=ea();Gl(e,t,a,r)}function Gl(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ro(e))_m(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var h=t.lastRenderedState,b=u(h,a);if(c.hasEagerState=!0,c.eagerState=b,Zt(b,h))return Bs(e,t,c,0),Xe===null&&Ls(),!1}catch{}if(a=Yi(e,t,c,r),a!==null)return Qt(a,e,r),Mm(a,t,r),!0}return!1}function Rc(e,t,a,r){if(r={lane:2,revertLane:lu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ro(e)){if(t)throw Error(i(479))}else t=Yi(e,a,r,2),t!==null&&Qt(t,e,2)}function ro(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function _m(e,t){Br=Ps=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Mm(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,zt(e,a)}}var Ql={readContext:gt,use:eo,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};Ql.useEffectEvent=We;var Am={readContext:gt,use:eo,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:hm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ao(4194308,4,vm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ao(4194308,4,e,t)},useInsertionEffect:function(e,t){ao(4,2,e,t)},useMemo:function(e,t){var a=_t();t=t===void 0?null:t;var r=e();if(Wn){va(!0);try{e()}finally{va(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=_t();if(a!==void 0){var c=a(t);if(Wn){va(!0);try{a(t)}finally{va(!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=Ny.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:function(e){e=bc(e);var t=e.queue,a=Cm.bind(null,Te,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:jc,useDeferredValue:function(e,t){var a=_t();return wc(a,e,t)},useTransition:function(){var e=bc(!1);return e=jm.bind(null,Te,e.queue,!0,!1),_t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=Te,c=_t();if(De){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),Xe===null)throw Error(i(349));(Oe&127)!==0||If(r,t,a)}c.memoizedState=a;var u={value:a,getSnapshot:t};return c.queue=u,hm(em.bind(null,r,u,e),[e]),r.flags|=2048,Hr(9,{destroy:void 0},Wf.bind(null,r,u,a,t),null),a},useId:function(){var e=_t(),t=Xe.identifierPrefix;if(De){var a=_a,r=Ca;a=(r&~(1<<32-Nt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Is++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=py++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Tc,useFormState:cm,useActionState:cm,useOptimistic:function(e){var t=_t();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Rc.bind(null,Te,!0,a),a.dispatch=t,[e,t]},useMemoCache:gc,useCacheRefresh:function(){return _t().memoizedState=Sy.bind(null,Te)},useEffectEvent:function(e){var t=_t(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Cc={readContext:gt,use:eo,useCallback:bm,useContext:gt,useEffect:Nc,useImperativeHandle:ym,useInsertionEffect:xm,useLayoutEffect:gm,useMemo:Sm,useReducer:to,useRef:mm,useState:function(){return to(Va)},useDebugValue:jc,useDeferredValue:function(e,t){var a=at();return Nm(a,Ve.memoizedState,e,t)},useTransition:function(){var e=to(Va)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Hl(e),t]},useSyncExternalStore:Pf,useId:Tm,useHostTransitionStatus:Tc,useFormState:um,useActionState:um,useOptimistic:function(e,t){var a=at();return nm(a,Ve,e,t)},useMemoCache:gc,useCacheRefresh:Rm};Cc.useEffectEvent=pm;var km={readContext:gt,use:eo,useCallback:bm,useContext:gt,useEffect:Nc,useImperativeHandle:ym,useInsertionEffect:xm,useLayoutEffect:gm,useMemo:Sm,useReducer:yc,useRef:mm,useState:function(){return yc(Va)},useDebugValue:jc,useDeferredValue:function(e,t){var a=at();return Ve===null?wc(a,e,t):Nm(a,Ve.memoizedState,e,t)},useTransition:function(){var e=yc(Va)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Hl(e),t]},useSyncExternalStore:Pf,useId:Tm,useHostTransitionStatus:Tc,useFormState:fm,useActionState:fm,useOptimistic:function(e,t){var a=at();return Ve!==null?nm(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:gc,useCacheRefresh:Rm};km.useEffectEvent=pm;function _c(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:p({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Mc={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=ea(),c=mn(r);c.payload=t,a!=null&&(c.callback=a),t=hn(e,c,r),t!==null&&(Qt(t,e,r),Ul(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=ea(),c=mn(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=hn(e,c,r),t!==null&&(Qt(t,e,r),Ul(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ea(),r=mn(a);r.tag=2,t!=null&&(r.callback=t),t=hn(e,r,a),t!==null&&(Qt(t,e,a),Ul(t,e,a))}};function Om(e,t,a,r,c,u,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,h):t.prototype&&t.prototype.isPureReactComponent?!Cl(a,r)||!Cl(c,u):!0}function zm(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Mc.enqueueReplaceState(t,t.state,null)}function er(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=p({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Dm(e){Us(e)}function Um(e){console.error(e)}function Lm(e){Us(e)}function lo(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Bm(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Ac(e,t,a){return a=mn(a),a.tag=3,a.payload={element:null},a.callback=function(){lo(e,t)},a}function qm(e){return e=mn(e),e.tag=3,e}function Hm(e,t,a,r){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var u=r.value;e.payload=function(){return c(u)},e.callback=function(){Bm(t,a,r)}}var h=a.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){Bm(t,a,r),typeof c!="function"&&(bn===null?bn=new Set([this]):bn.add(this));var b=r.stack;this.componentDidCatch(r.value,{componentStack:b!==null?b:""})})}function jy(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&kr(t,a,c,!0),a=$t.current,a!==null){switch(a.tag){case 31:case 13:return da===null?vo():a.alternate===null&&et===0&&(et=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===Xs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),au(e,r,c)),!1;case 22:return a.flags|=65536,r===Xs?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),au(e,r,c)),!1}throw Error(i(435,a.tag))}return au(e,r,c),vo(),!1}if(De)return t=$t.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==$i&&(e=Error(i(422),{cause:r}),Al(oa(e,a)))):(r!==$i&&(t=Error(i(423),{cause:r}),Al(oa(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=oa(r,a),c=Ac(e.stateNode,r,c),oc(e,c),et!==4&&(et=2)),!1;var u=Error(i(520),{cause:r});if(u=oa(u,a),$l===null?$l=[u]:$l.push(u),et!==4&&(et=2),t===null)return!0;r=oa(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Ac(a.stateNode,r,e),oc(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(bn===null||!bn.has(u))))return a.flags|=65536,c&=-c,a.lanes|=c,c=qm(c),Hm(c,e,a,r),oc(a,c),!1}a=a.return}while(a!==null);return!1}var kc=Error(i(461)),st=!1;function vt(e,t,a,r){t.child=e===null?Yf(t,null,a,r):In(t,e.child,a,r)}function Gm(e,t,a,r,c){a=a.render;var u=t.ref;if("ref"in r){var h={};for(var b in r)b!=="ref"&&(h[b]=r[b])}else h=r;return Zn(t),r=mc(e,t,a,h,u,c),b=hc(),e!==null&&!st?(pc(e,t,c),Ya(e,t,c)):(De&&b&&Zi(t),t.flags|=1,vt(e,t,r,c),t.child)}function Qm(e,t,a,r,c){if(e===null){var u=a.type;return typeof u=="function"&&!Fi(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,Vm(e,t,u,r,c)):(e=Hs(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Hc(e,c)){var h=u.memoizedProps;if(a=a.compare,a=a!==null?a:Cl,a(h,r)&&e.ref===t.ref)return Ya(e,t,c)}return t.flags|=1,e=Ba(u,r),e.ref=t.ref,e.return=t,t.child=e}function Vm(e,t,a,r,c){if(e!==null){var u=e.memoizedProps;if(Cl(u,r)&&e.ref===t.ref)if(st=!1,t.pendingProps=r=u,Hc(e,c))(e.flags&131072)!==0&&(st=!0);else return t.lanes=e.lanes,Ya(e,t,c)}return Oc(e,t,a,r,c)}function Ym(e,t,a,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|a:a,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 Fm(e,t,u,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ys(t,u!==null?u.cachePool:null),u!==null?Kf(t,u):cc(),Zf(t);else return r=t.lanes=536870912,Fm(e,t,u!==null?u.baseLanes|a:a,a,r)}else u!==null?(Ys(t,u.cachePool),Kf(t,u),xn(),t.memoizedState=null):(e!==null&&Ys(t,null),cc(),xn());return vt(e,t,c,a),t.child}function Vl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fm(e,t,a,r,c){var u=nc();return u=u===null?null:{parent:rt._currentValue,pool:u},t.memoizedState={baseLanes:a,cachePool:u},e!==null&&Ys(t,null),cc(),Zf(t),e!==null&&kr(e,t,r,!0),t.childLanes=c,null}function so(e,t){return t=io({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xm(e,t,a){return In(t,e.child,null,a),e=so(t,t.pendingProps),e.flags|=2,Pt(t),t.memoizedState=null,e}function wy(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(r.mode==="hidden")return e=so(t,r),t.lanes=536870912,Vl(null,e);if(dc(t),(e=Ke)?(e=rp(e,ua),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:on!==null?{id:Ca,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},a=_f(e),a.return=t,t.child=a,xt=t,Ke=null)):e=null,e===null)throw un(t);return t.lanes=536870912,null}return so(t,r)}var u=e.memoizedState;if(u!==null){var h=u.dehydrated;if(dc(t),c)if(t.flags&256)t.flags&=-257,t=Xm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(st||kr(e,t,a,!1),c=(a&e.childLanes)!==0,st||c){if(r=Xe,r!==null&&(h=Dt(r,a),h!==0&&h!==u.retryLane))throw u.retryLane=h,Yn(e,h),Qt(r,e,h),kc;vo(),t=Xm(e,t,a)}else e=u.treeContext,Ke=fa(h.nextSibling),xt=t,De=!0,cn=null,ua=!1,e!==null&&kf(t,e),t=so(t,r),t.flags|=4096;return t}return e=Ba(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function oo(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Oc(e,t,a,r,c){return Zn(t),a=mc(e,t,a,r,void 0,c),r=hc(),e!==null&&!st?(pc(e,t,c),Ya(e,t,c)):(De&&r&&Zi(t),t.flags|=1,vt(e,t,a,c),t.child)}function Km(e,t,a,r,c,u){return Zn(t),t.updateQueue=null,a=$f(t,r,a,c),Jf(e),r=hc(),e!==null&&!st?(pc(e,t,u),Ya(e,t,u)):(De&&r&&Zi(t),t.flags|=1,vt(e,t,a,u),t.child)}function Zm(e,t,a,r,c){if(Zn(t),t.stateNode===null){var u=Cr,h=a.contextType;typeof h=="object"&&h!==null&&(u=gt(h)),u=new a(r,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Mc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=r,u.state=t.memoizedState,u.refs={},lc(t),h=a.contextType,u.context=typeof h=="object"&&h!==null?gt(h):Cr,u.state=t.memoizedState,h=a.getDerivedStateFromProps,typeof h=="function"&&(_c(t,a,h,r),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(h=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),h!==u.state&&Mc.enqueueReplaceState(u,u.state,null),Bl(t,r,u,c),Ll(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,E=er(a,b);u.props=E;var D=u.context,X=a.contextType;h=Cr,typeof X=="object"&&X!==null&&(h=gt(X));var J=a.getDerivedStateFromProps;X=typeof J=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,X||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||D!==h)&&zm(t,u,r,h),fn=!1;var U=t.memoizedState;u.state=U,Bl(t,r,u,c),Ll(),D=t.memoizedState,b||U!==D||fn?(typeof J=="function"&&(_c(t,a,J,r),D=t.memoizedState),(E=fn||Om(t,a,E,r,U,D,h))?(X||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=D),u.props=r,u.state=D,u.context=h,r=E):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,sc(e,t),h=t.memoizedProps,X=er(a,h),u.props=X,J=t.pendingProps,U=u.context,D=a.contextType,E=Cr,typeof D=="object"&&D!==null&&(E=gt(D)),b=a.getDerivedStateFromProps,(D=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(h!==J||U!==E)&&zm(t,u,r,E),fn=!1,U=t.memoizedState,u.state=U,Bl(t,r,u,c),Ll();var H=t.memoizedState;h!==J||U!==H||fn||e!==null&&e.dependencies!==null&&Qs(e.dependencies)?(typeof b=="function"&&(_c(t,a,b,r),H=t.memoizedState),(X=fn||Om(t,a,X,r,U,H,E)||e!==null&&e.dependencies!==null&&Qs(e.dependencies))?(D||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,H,E),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,H,E)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=H),u.props=r,u.state=H,u.context=E,r=X):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),r=!1)}return u=r,oo(e,t),r=(t.flags&128)!==0,u||r?(u=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&r?(t.child=In(t,e.child,null,c),t.child=In(t,null,a,c)):vt(e,t,a,c),t.memoizedState=u.state,e=t.child):e=Ya(e,t,c),e}function Jm(e,t,a,r){return Xn(),t.flags|=256,vt(e,t,a,r),t.child}var zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dc(e){return{baseLanes:e,cachePool:Bf()}}function Uc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Wt),e}function $m(e,t,a){var r=t.pendingProps,c=!1,u=(t.flags&128)!==0,h;if((h=u)||(h=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(c?pn(t):xn(),(e=Ke)?(e=rp(e,ua),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:on!==null?{id:Ca,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},a=_f(e),a.return=t,t.child=a,xt=t,Ke=null)):e=null,e===null)throw un(t);return vu(e)?t.lanes=32:t.lanes=536870912,null}var b=r.children;return r=r.fallback,c?(xn(),c=t.mode,b=io({mode:"hidden",children:b},c),r=Fn(r,c,a,null),b.return=t,r.return=t,b.sibling=r,t.child=b,r=t.child,r.memoizedState=Dc(a),r.childLanes=Uc(e,h,a),t.memoizedState=zc,Vl(null,r)):(pn(t),Lc(t,b))}var E=e.memoizedState;if(E!==null&&(b=E.dehydrated,b!==null)){if(u)t.flags&256?(pn(t),t.flags&=-257,t=Bc(e,t,a)):t.memoizedState!==null?(xn(),t.child=e.child,t.flags|=128,t=null):(xn(),b=r.fallback,c=t.mode,r=io({mode:"visible",children:r.children},c),b=Fn(b,c,a,null),b.flags|=2,r.return=t,b.return=t,r.sibling=b,t.child=r,In(t,e.child,null,a),r=t.child,r.memoizedState=Dc(a),r.childLanes=Uc(e,h,a),t.memoizedState=zc,t=Vl(null,r));else if(pn(t),vu(b)){if(h=b.nextSibling&&b.nextSibling.dataset,h)var D=h.dgst;h=D,r=Error(i(419)),r.stack="",r.digest=h,Al({value:r,source:null,stack:null}),t=Bc(e,t,a)}else if(st||kr(e,t,a,!1),h=(a&e.childLanes)!==0,st||h){if(h=Xe,h!==null&&(r=Dt(h,a),r!==0&&r!==E.retryLane))throw E.retryLane=r,Yn(e,r),Qt(h,e,r),kc;gu(b)||vo(),t=Bc(e,t,a)}else gu(b)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,Ke=fa(b.nextSibling),xt=t,De=!0,cn=null,ua=!1,e!==null&&kf(t,e),t=Lc(t,r.children),t.flags|=4096);return t}return c?(xn(),b=r.fallback,c=t.mode,E=e.child,D=E.sibling,r=Ba(E,{mode:"hidden",children:r.children}),r.subtreeFlags=E.subtreeFlags&65011712,D!==null?b=Ba(D,b):(b=Fn(b,c,a,null),b.flags|=2),b.return=t,r.return=t,r.sibling=b,t.child=r,Vl(null,r),r=t.child,b=e.child.memoizedState,b===null?b=Dc(a):(c=b.cachePool,c!==null?(E=rt._currentValue,c=c.parent!==E?{parent:E,pool:E}:c):c=Bf(),b={baseLanes:b.baseLanes|a,cachePool:c}),r.memoizedState=b,r.childLanes=Uc(e,h,a),t.memoizedState=zc,Vl(e.child,r)):(pn(t),a=e.child,e=a.sibling,a=Ba(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=a,t.memoizedState=null,a)}function Lc(e,t){return t=io({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function io(e,t){return e=Jt(22,e,null,t),e.lanes=0,e}function Bc(e,t,a){return In(t,e.child,null,a),e=Lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pm(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,a)}function qc(e,t,a,r,c,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:c,treeForkCount:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=r,h.tail=a,h.tailMode=c,h.treeForkCount=u)}function Im(e,t,a){var r=t.pendingProps,c=r.revealOrder,u=r.tail;r=r.children;var h=tt.current,b=(h&2)!==0;if(b?(h=h&1|2,t.flags|=128):h&=1,V(tt,h),vt(e,t,r,a),r=De?Ml:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pm(e,a,t);else if(e.tag===19)Pm(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&$s(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),qc(t,!1,c,a,u,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&$s(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}qc(t,!0,a,null,u,r);break;case"together":qc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ya(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),yn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(kr(e,t,a,!1),(a&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,a=Ba(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ba(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Hc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Qs(e)))}function Ey(e,t,a){switch(t.tag){case 3:ye(t,t.stateNode.containerInfo),dn(t,rt,e.memoizedState.cache),Xn();break;case 27:case 5:ae(t);break;case 4:ye(t,t.stateNode.containerInfo);break;case 10:dn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,dc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(pn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?$m(e,t,a):(pn(t),e=Ya(e,t,a),e!==null?e.sibling:null);pn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(kr(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return Im(e,t,a);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,Ym(e,t,a,t.pendingProps);case 24:dn(t,rt,e.memoizedState.cache)}return Ya(e,t,a)}function Wm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)st=!0;else{if(!Hc(e,a)&&(t.flags&128)===0)return st=!1,Ey(e,t,a);st=(e.flags&131072)!==0}else st=!1,De&&(t.flags&1048576)!==0&&Af(t,Ml,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=$n(t.elementType),t.type=e,typeof e=="function")Fi(e)?(r=er(e,r),t.tag=1,t=Zm(null,t,e,r,a)):(t.tag=0,t=Oc(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===L){t.tag=11,t=Gm(null,t,e,r,a);break e}else if(c===W){t.tag=14,t=Qm(null,t,e,r,a);break e}}throw t=ge(e)||e,Error(i(306,t,""))}}return t;case 0:return Oc(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=er(r,t.pendingProps),Zm(e,t,r,c,a);case 3:e:{if(ye(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var u=t.memoizedState;c=u.element,sc(e,t),Bl(t,r,null,a);var h=t.memoizedState;if(r=h.cache,dn(t,rt,r),r!==u.cache&&ec(t,[rt],a,!0),Ll(),r=h.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Jm(e,t,r,a);break e}else if(r!==c){c=oa(Error(i(424)),t),Al(c),t=Jm(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ke=fa(e.firstChild),xt=t,De=!0,cn=null,ua=!0,a=Yf(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Xn(),r===c){t=Ya(e,t,a);break e}vt(e,t,r,a)}t=t.child}return t;case 26:return oo(e,t),e===null?(a=up(t.type,null,t.pendingProps,null))?t.memoizedState=a:De||(a=t.type,e=t.pendingProps,r=Eo(ie.current).createElement(a),r[pt]=t,r[Ut]=e,yt(r,a,e),mt(r),t.stateNode=r):t.memoizedState=up(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ae(t),e===null&&De&&(r=t.stateNode=op(t.type,t.pendingProps,ie.current),xt=t,ua=!0,c=Ke,wn(t.type)?(yu=c,Ke=fa(r.firstChild)):Ke=c),vt(e,t,t.pendingProps.children,a),oo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((c=r=Ke)&&(r=tb(r,t.type,t.pendingProps,ua),r!==null?(t.stateNode=r,xt=t,Ke=fa(r.firstChild),ua=!1,c=!0):c=!1),c||un(t)),ae(t),c=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,r=u.children,hu(c,u)?r=null:h!==null&&hu(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=mc(e,t,xy,null,null,a),rs._currentValue=c),oo(e,t),vt(e,t,r,a),t.child;case 6:return e===null&&De&&((e=a=Ke)&&(a=ab(a,t.pendingProps,ua),a!==null?(t.stateNode=a,xt=t,Ke=null,e=!0):e=!1),e||un(t)),null;case 13:return $m(e,t,a);case 4:return ye(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=In(t,null,r,a):vt(e,t,r,a),t.child;case 11:return Gm(e,t,t.type,t.pendingProps,a);case 7:return vt(e,t,t.pendingProps,a),t.child;case 8:return vt(e,t,t.pendingProps.children,a),t.child;case 12:return vt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,dn(t,t.type,r.value),vt(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Zn(t),c=gt(c),r=r(c),t.flags|=1,vt(e,t,r,a),t.child;case 14:return Qm(e,t,t.type,t.pendingProps,a);case 15:return Vm(e,t,t.type,t.pendingProps,a);case 19:return Im(e,t,a);case 31:return wy(e,t,a);case 22:return Ym(e,t,a,t.pendingProps);case 24:return Zn(t),r=gt(rt),e===null?(c=nc(),c===null&&(c=Xe,u=tc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=a),c=u),t.memoizedState={parent:r,cache:c},lc(t),dn(t,rt,c)):((e.lanes&a)!==0&&(sc(e,t),Bl(t,null,null,a),Ll()),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),dn(t,rt,r)):(r=u.cache,dn(t,rt,r),r!==c.cache&&ec(t,[rt],a,!0))),vt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Fa(e){e.flags|=4}function Gc(e,t,a,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(Th())e.flags|=8192;else throw Pn=Xs,rc}else e.flags&=-16777217}function eh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!pp(t))if(Th())e.flags|=8192;else throw Pn=Xs,rc}function co(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?jt():536870912,e.lanes|=t,Yr|=t)}function Yl(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var c=e.child;c!==null;)a|=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;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Ty(e,t,a){var r=t.pendingProps;switch(Ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ga(rt),q(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ar(t)?Fa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Pi())),Ze(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Fa(t),u!==null?(Ze(t),eh(t,u)):(Ze(t),Gc(t,c,null,r,a))):u?u!==e.memoizedState?(Fa(t),Ze(t),eh(t,u)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Fa(t),Ze(t),Gc(t,c,e,r,a)),null;case 27:if(Ce(t),a=ie.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fa(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}e=I.current,Ar(t)?Of(t):(e=op(c,r,a),t.stateNode=e,Fa(t))}return Ze(t),null;case 5:if(Ce(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fa(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}if(u=I.current,Ar(t))Of(t);else{var h=Eo(ie.current);switch(u){case 1:u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=h.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?h.createElement("select",{is:r.is}):h.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?h.createElement(c,{is:r.is}):h.createElement(c)}}u[pt]=t,u[Ut]=r;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)u.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=u;e:switch(yt(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&&Fa(t)}}return Ze(t),Gc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=ie.current,Ar(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=xt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[pt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||$h(e.nodeValue,a)),e||un(t,!0)}else e=Eo(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Ze(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ar(t),a!==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[pt]=t}else Xn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else a=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Pt(t),t):(Pt(t),null);if((t.flags&128)!==0)throw Error(i(558))}return Ze(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ar(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[pt]=t}else Xn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),c=!1}else c=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Pt(t),t):(Pt(t),null)}return Pt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(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)),a!==e&&a&&(t.child.flags|=8192),co(t,t.updateQueue),Ze(t),null);case 4:return q(),e===null&&cu(t.stateNode.containerInfo),Ze(t),null;case 10:return Ga(t.type),Ze(t),null;case 19:if(Q(tt),r=t.memoizedState,r===null)return Ze(t),null;if(c=(t.flags&128)!==0,u=r.rendering,u===null)if(c)Yl(r,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=$s(e),u!==null){for(t.flags|=128,Yl(r,!1),e=u.updateQueue,t.updateQueue=e,co(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Cf(a,e),a=a.sibling;return V(tt,tt.current&1|2),De&&qa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Rt()>po&&(t.flags|=128,c=!0,Yl(r,!1),t.lanes=4194304)}else{if(!c)if(e=$s(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,co(t,e),Yl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!De)return Ze(t),null}else 2*Rt()-r.renderingStartTime>po&&a!==536870912&&(t.flags|=128,c=!0,Yl(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=Rt(),e.sibling=null,a=tt.current,V(tt,c?a&1|2:a&1),De&&qa(t,r.treeForkCount),e):(Ze(t),null);case 22:case 23:return Pt(t),uc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),a=t.updateQueue,a!==null&&co(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&Q(Jn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ga(rt),Ze(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ry(e,t){switch(Ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ga(rt),q(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(Pt(t),t.alternate===null)throw Error(i(340));Xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Q(tt),null;case 4:return q(),null;case 10:return Ga(t.type),null;case 22:case 23:return Pt(t),uc(),e!==null&&Q(Jn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ga(rt),null;case 25:return null;default:return null}}function th(e,t){switch(Ji(t),t.tag){case 3:Ga(rt),q();break;case 26:case 27:case 5:Ce(t);break;case 4:q();break;case 31:t.memoizedState!==null&&Pt(t);break;case 13:Pt(t);break;case 19:Q(tt);break;case 10:Ga(t.type);break;case 22:case 23:Pt(t),uc(),e!==null&&Q(Jn);break;case 24:Ga(rt)}}function Fl(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var c=r.next;a=c;do{if((a.tag&e)===e){r=void 0;var u=a.create,h=a.inst;r=u(),h.destroy=r}a=a.next}while(a!==c)}}catch(b){Qe(t,t.return,b)}}function gn(e,t,a){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 h=r.inst,b=h.destroy;if(b!==void 0){h.destroy=void 0,c=t;var E=a,D=b;try{D()}catch(X){Qe(c,E,X)}}}r=r.next}while(r!==u)}}catch(X){Qe(t,t.return,X)}}function ah(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Xf(t,a)}catch(r){Qe(e,e.return,r)}}}function nh(e,t,a){a.props=er(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Qe(e,t,r)}}function Xl(e,t){try{var a=e.ref;if(a!==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 a=="function"?e.refCleanup=a(r):a.current=r}}catch(c){Qe(e,t,c)}}function Ma(e,t){var a=e.ref,r=e.refCleanup;if(a!==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 a=="function")try{a(null)}catch(c){Qe(e,t,c)}else a.current=null}function rh(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(c){Qe(e,e.return,c)}}function Qc(e,t,a){try{var r=e.stateNode;Jy(r,e.type,a,t),r[Ut]=t}catch(c){Qe(e,e.return,c)}}function lh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wn(e.type)||e.tag===4}function Vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lh(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&&wn(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 Yc(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ua));else if(r!==4&&(r===27&&wn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,a),e=e.sibling;e!==null;)Yc(e,t,a),e=e.sibling}function uo(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&wn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(uo(e,t,a),e=e.sibling;e!==null;)uo(e,t,a),e=e.sibling}function sh(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);yt(t,r,a),t[pt]=e,t[Ut]=a}catch(u){Qe(e,e.return,u)}}var Xa=!1,ot=!1,Fc=!1,oh=typeof WeakSet=="function"?WeakSet:Set,ht=null;function Cy(e,t){if(e=e.containerInfo,fu=ko,e=yf(e),Bi(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var c=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var h=0,b=-1,E=-1,D=0,X=0,J=e,U=null;t:for(;;){for(var H;J!==a||c!==0&&J.nodeType!==3||(b=h+c),J!==u||r!==0&&J.nodeType!==3||(E=h+r),J.nodeType===3&&(h+=J.nodeValue.length),(H=J.firstChild)!==null;)U=J,J=H;for(;;){if(J===e)break t;if(U===a&&++D===c&&(b=h),U===u&&++X===r&&(E=h),(H=J.nextSibling)!==null)break;J=U,U=J.parentNode}J=H}a=b===-1||E===-1?null:{start:b,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(mu={focusedElem:e,selectionRange:a},ko=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){switch(t=ht,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(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,c=u.memoizedProps,u=u.memoizedState,r=a.stateNode;try{var ce=er(a.type,c);e=r.getSnapshotBeforeUpdate(ce,u),r.__reactInternalSnapshotBeforeUpdate=e}catch(xe){Qe(a,a.return,xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)xu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xu(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,ht=e;break}ht=t.return}}function ih(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Za(e,a),r&4&&Fl(5,a);break;case 1:if(Za(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(h){Qe(a,a.return,h)}else{var c=er(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Qe(a,a.return,h)}}r&64&&ah(a),r&512&&Xl(a,a.return);break;case 3:if(Za(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Xf(e,t)}catch(h){Qe(a,a.return,h)}}break;case 27:t===null&&r&4&&sh(a);case 26:case 5:Za(e,a),t===null&&r&4&&rh(a),r&512&&Xl(a,a.return);break;case 12:Za(e,a);break;case 31:Za(e,a),r&4&&dh(e,a);break;case 13:Za(e,a),r&4&&fh(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Ly.bind(null,a),nb(e,a))));break;case 22:if(r=a.memoizedState!==null||Xa,!r){t=t!==null&&t.memoizedState!==null||ot,c=Xa;var u=ot;Xa=r,(ot=t)&&!u?Ja(e,a,(a.subtreeFlags&8772)!==0):Za(e,a),Xa=c,ot=u}break;case 30:break;default:Za(e,a)}}function ch(e){var t=e.alternate;t!==null&&(e.alternate=null,ch(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Si(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 $e=null,Bt=!1;function Ka(e,t,a){for(a=a.child;a!==null;)uh(e,t,a),a=a.sibling}function uh(e,t,a){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Ln,a)}catch{}switch(a.tag){case 26:ot||Ma(a,t),Ka(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ot||Ma(a,t);var r=$e,c=Bt;wn(a.type)&&($e=a.stateNode,Bt=!1),Ka(e,t,a),ts(a.stateNode),$e=r,Bt=c;break;case 5:ot||Ma(a,t);case 6:if(r=$e,c=Bt,$e=null,Ka(e,t,a),$e=r,Bt=c,$e!==null)if(Bt)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(a.stateNode)}catch(u){Qe(a,t,u)}else try{$e.removeChild(a.stateNode)}catch(u){Qe(a,t,u)}break;case 18:$e!==null&&(Bt?(e=$e,ap(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ir(e)):ap($e,a.stateNode));break;case 4:r=$e,c=Bt,$e=a.stateNode.containerInfo,Bt=!0,Ka(e,t,a),$e=r,Bt=c;break;case 0:case 11:case 14:case 15:gn(2,a,t),ot||gn(4,a,t),Ka(e,t,a);break;case 1:ot||(Ma(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&nh(a,t,r)),Ka(e,t,a);break;case 21:Ka(e,t,a);break;case 22:ot=(r=ot)||a.memoizedState!==null,Ka(e,t,a),ot=r;break;default:Ka(e,t,a)}}function dh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ir(e)}catch(a){Qe(t,t.return,a)}}}function fh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ir(e)}catch(a){Qe(t,t.return,a)}}function _y(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new oh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new oh),t;default:throw Error(i(435,e.tag))}}function fo(e,t){var a=_y(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=By.bind(null,e,r);r.then(c,c)}})}function qt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var c=a[r],u=e,h=t,b=h;e:for(;b!==null;){switch(b.tag){case 27:if(wn(b.type)){$e=b.stateNode,Bt=!1;break e}break;case 5:$e=b.stateNode,Bt=!1;break e;case 3:case 4:$e=b.stateNode.containerInfo,Bt=!0;break e}b=b.return}if($e===null)throw Error(i(160));uh(u,h,c),$e=null,Bt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)mh(t,e),t=t.sibling}var Sa=null;function mh(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:qt(t,e),Ht(e),r&4&&(gn(3,e,e.return),Fl(3,e),gn(5,e,e.return));break;case 1:qt(t,e),Ht(e),r&512&&(ot||a===null||Ma(a,a.return)),r&64&&Xa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var c=Sa;if(qt(t,e),Ht(e),r&512&&(ot||a===null||Ma(a,a.return)),r&4){var u=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":u=c.getElementsByTagName("title")[0],(!u||u[yl]||u[pt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(r),c.head.insertBefore(u,c.querySelector("head > title"))),yt(u,r,a),u[pt]=e,mt(u),r=u;break e;case"link":var h=mp("link","href",c).get(r+(a.href||""));if(h){for(var b=0;b<h.length;b++)if(u=h[b],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){h.splice(b,1);break t}}u=c.createElement(r),yt(u,r,a),c.head.appendChild(u);break;case"meta":if(h=mp("meta","content",c).get(r+(a.content||""))){for(b=0;b<h.length;b++)if(u=h[b],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){h.splice(b,1);break t}}u=c.createElement(r),yt(u,r,a),c.head.appendChild(u);break;default:throw Error(i(468,r))}u[pt]=e,mt(u),r=u}e.stateNode=r}else hp(c,e.type,e.stateNode);else e.stateNode=fp(c,r,e.memoizedProps);else u!==r?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,r===null?hp(c,e.type,e.stateNode):fp(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,a.memoizedProps)}break;case 27:qt(t,e),Ht(e),r&512&&(ot||a===null||Ma(a,a.return)),a!==null&&r&4&&Qc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(qt(t,e),Ht(e),r&512&&(ot||a===null||Ma(a,a.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,Qc(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Fc=!0);break;case 6:if(qt(t,e),Ht(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(ce){Qe(e,e.return,ce)}}break;case 3:if(Co=null,c=Sa,Sa=To(t.containerInfo),qt(t,e),Sa=c,Ht(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Ir(t.containerInfo)}catch(ce){Qe(e,e.return,ce)}Fc&&(Fc=!1,hh(e));break;case 4:r=Sa,Sa=To(e.stateNode.containerInfo),qt(t,e),Ht(e),Sa=r;break;case 12:qt(t,e),Ht(e);break;case 31:qt(t,e),Ht(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fo(e,r)));break;case 13:qt(t,e),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(ho=Rt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fo(e,r)));break;case 22:c=e.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,D=Xa,X=ot;if(Xa=D||c,ot=X||E,qt(t,e),ot=X,Xa=D,Ht(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||E||Xa||ot||tr(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){E=a=t;try{if(u=E.stateNode,c)h=u.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{b=E.stateNode;var J=E.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null;b.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(ce){Qe(E,E.return,ce)}}}else if(t.tag===6){if(a===null){E=t;try{E.stateNode.nodeValue=c?"":E.memoizedProps}catch(ce){Qe(E,E.return,ce)}}}else if(t.tag===18){if(a===null){E=t;try{var H=E.stateNode;c?np(H,!0):np(E.stateNode,!1)}catch(ce){Qe(E,E.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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,fo(e,a))));break;case 19:qt(t,e),Ht(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fo(e,r)));break;case 30:break;case 21:break;default:qt(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(lh(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,u=Vc(e);uo(e,u,c);break;case 5:var h=a.stateNode;a.flags&32&&(Sr(h,""),a.flags&=-33);var b=Vc(e);uo(e,b,h);break;case 3:case 4:var E=a.stateNode.containerInfo,D=Vc(e);Yc(e,D,E);break;default:throw Error(i(161))}}catch(X){Qe(e,e.return,X)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hh(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;)ih(e,t.alternate,t),t=t.sibling}function tr(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),tr(t);break;case 1:Ma(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&nh(t,t.return,a),tr(t);break;case 27:ts(t.stateNode);case 26:case 5:Ma(t,t.return),tr(t);break;case 22:t.memoizedState===null&&tr(t);break;case 30:tr(t);break;default:tr(t)}e=e.sibling}}function Ja(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,u=t,h=u.flags;switch(u.tag){case 0:case 11:case 15:Ja(c,u,a),Fl(4,u);break;case 1:if(Ja(c,u,a),r=u,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(D){Qe(r,r.return,D)}if(r=u,c=r.updateQueue,c!==null){var b=r.stateNode;try{var E=c.shared.hiddenCallbacks;if(E!==null)for(c.shared.hiddenCallbacks=null,c=0;c<E.length;c++)Ff(E[c],b)}catch(D){Qe(r,r.return,D)}}a&&h&64&&ah(u),Xl(u,u.return);break;case 27:sh(u);case 26:case 5:Ja(c,u,a),a&&r===null&&h&4&&rh(u),Xl(u,u.return);break;case 12:Ja(c,u,a);break;case 31:Ja(c,u,a),a&&h&4&&dh(c,u);break;case 13:Ja(c,u,a),a&&h&4&&fh(c,u);break;case 22:u.memoizedState===null&&Ja(c,u,a),Xl(u,u.return);break;case 30:break;default:Ja(c,u,a)}t=t.sibling}}function Xc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&kl(a))}function Kc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&kl(e))}function Na(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ph(e,t,a,r),t=t.sibling}function ph(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Na(e,t,a,r),c&2048&&Fl(9,t);break;case 1:Na(e,t,a,r);break;case 3:Na(e,t,a,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&kl(e)));break;case 12:if(c&2048){Na(e,t,a,r),e=t.stateNode;try{var u=t.memoizedProps,h=u.id,b=u.onPostCommit;typeof b=="function"&&b(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Qe(t,t.return,E)}}else Na(e,t,a,r);break;case 31:Na(e,t,a,r);break;case 13:Na(e,t,a,r);break;case 23:break;case 22:u=t.stateNode,h=t.alternate,t.memoizedState!==null?u._visibility&2?Na(e,t,a,r):Kl(e,t):u._visibility&2?Na(e,t,a,r):(u._visibility|=2,Gr(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Xc(h,t);break;case 24:Na(e,t,a,r),c&2048&&Kc(t.alternate,t);break;default:Na(e,t,a,r)}}function Gr(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,h=t,b=a,E=r,D=h.flags;switch(h.tag){case 0:case 11:case 15:Gr(u,h,b,E,c),Fl(8,h);break;case 23:break;case 22:var X=h.stateNode;h.memoizedState!==null?X._visibility&2?Gr(u,h,b,E,c):Kl(u,h):(X._visibility|=2,Gr(u,h,b,E,c)),c&&D&2048&&Xc(h.alternate,h);break;case 24:Gr(u,h,b,E,c),c&&D&2048&&Kc(h.alternate,h);break;default:Gr(u,h,b,E,c)}t=t.sibling}}function Kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,c=r.flags;switch(r.tag){case 22:Kl(a,r),c&2048&&Xc(r.alternate,r);break;case 24:Kl(a,r),c&2048&&Kc(r.alternate,r);break;default:Kl(a,r)}t=t.sibling}}var Zl=8192;function Qr(e,t,a){if(e.subtreeFlags&Zl)for(e=e.child;e!==null;)xh(e,t,a),e=e.sibling}function xh(e,t,a){switch(e.tag){case 26:Qr(e,t,a),e.flags&Zl&&e.memoizedState!==null&&pb(a,Sa,e.memoizedState,e.memoizedProps);break;case 5:Qr(e,t,a);break;case 3:case 4:var r=Sa;Sa=To(e.stateNode.containerInfo),Qr(e,t,a),Sa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zl,Zl=16777216,Qr(e,t,a),Zl=r):Qr(e,t,a));break;default:Qr(e,t,a)}}function gh(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 Jl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];ht=r,yh(r,e)}gh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vh(e),e=e.sibling}function vh(e){switch(e.tag){case 0:case 11:case 15:Jl(e),e.flags&2048&&gn(9,e,e.return);break;case 3:Jl(e);break;case 12:Jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,mo(e)):Jl(e);break;default:Jl(e)}}function mo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];ht=r,yh(r,e)}gh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gn(8,t,t.return),mo(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,mo(t));break;default:mo(t)}e=e.sibling}}function yh(e,t){for(;ht!==null;){var a=ht;switch(a.tag){case 0:case 11:case 15:gn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:kl(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ht=r;else e:for(a=e;ht!==null;){r=ht;var c=r.sibling,u=r.return;if(ch(r),r===a){ht=null;break e}if(c!==null){c.return=u,ht=c;break e}ht=u}}}var My={getCacheForType:function(e){var t=gt(rt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return gt(rt).controller.signal}},Ay=typeof WeakMap=="function"?WeakMap:Map,He=0,Xe=null,Ae=null,Oe=0,Ge=0,It=null,vn=!1,Vr=!1,Zc=!1,$a=0,et=0,yn=0,ar=0,Jc=0,Wt=0,Yr=0,$l=null,Gt=null,$c=!1,ho=0,bh=0,po=1/0,xo=null,bn=null,ct=0,Sn=null,Fr=null,Pa=0,Pc=0,Ic=null,Sh=null,Pl=0,Wc=null;function ea(){return(He&2)!==0&&Oe!==0?Oe&-Oe:k.T!==null?lu():yi()}function Nh(){if(Wt===0)if((Oe&536870912)===0||De){var e=mr;mr<<=1,(mr&3932160)===0&&(mr=262144),Wt=e}else Wt=536870912;return e=$t.current,e!==null&&(e.flags|=32),Wt}function Qt(e,t,a){(e===Xe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(Xr(e,0),Nn(e,Oe,Wt,!1)),Ie(e,a),((He&2)===0||e!==Xe)&&(e===Xe&&((He&2)===0&&(ar|=a),et===4&&Nn(e,Oe,Wt,!1)),Aa(e))}function jh(e,t,a){if((He&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Je(e,t),c=r?zy(e,t):tu(e,t,!0),u=r;do{if(c===0){Vr&&!r&&Nn(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!ky(a)){c=tu(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var b=e;c=$l;var E=b.current.memoizedState.isDehydrated;if(E&&(Xr(b,h).flags|=256),h=tu(b,h,!1),h!==2){if(Zc&&!E){b.errorRecoveryDisabledLanes|=u,ar|=u,c=4;break e}u=Gt,Gt=c,u!==null&&(Gt===null?Gt=u:Gt.push.apply(Gt,u))}c=h}if(u=!1,c!==2)continue}}if(c===1){Xr(e,0),Nn(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:Nn(r,t,Wt,!vn);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=ho+300-Rt(),10<c)){if(Nn(r,t,Wt,!vn),Se(r,0,!0)!==0)break e;Pa=t,r.timeoutHandle=ep(wh.bind(null,r,a,Gt,xo,$c,t,Wt,ar,Yr,vn,u,"Throttled",-0,0),c);break e}wh(r,a,Gt,xo,$c,t,Wt,ar,Yr,vn,u,null,-0,0)}}break}while(!0);Aa(e)}function wh(e,t,a,r,c,u,h,b,E,D,X,J,U,H){if(e.timeoutHandle=-1,J=t.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ua},xh(t,u,J);var ce=(u&62914560)===u?ho-Rt():(u&4194048)===u?bh-Rt():0;if(ce=xb(J,ce),ce!==null){Pa=u,e.cancelPendingCommit=ce(kh.bind(null,e,t,u,a,r,c,h,b,E,X,J,null,U,H)),Nn(e,u,h,!D);return}}kh(e,t,u,a,r,c,h,b,E)}function ky(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var c=a[r],u=c.getSnapshot;c=c.value;try{if(!Zt(u(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Nn(e,t,a,r){t&=~Jc,t&=~ar,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var u=31-Nt(c),h=1<<u;r[u]=-1,c&=~h}a!==0&&qn(e,a,t)}function go(){return(He&6)===0?(Il(0),!1):!0}function eu(){if(Ae!==null){if(Ge===0)var e=Ae.return;else e=Ae,Ha=Kn=null,xc(e),Ur=null,zl=0,e=Ae;for(;e!==null;)th(e.alternate,e),e=e.return;Ae=null}}function Xr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Iy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Pa=0,eu(),Xe=e,Ae=a=Ba(e.current,null),Oe=t,Ge=0,It=null,vn=!1,Vr=Je(e,t),Zc=!1,Yr=Wt=Jc=ar=yn=et=0,Gt=$l=null,$c=!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-Nt(r),u=1<<c;t|=e[c],r&=~u}return $a=t,Ls(),a}function Eh(e,t){Te=null,k.H=Ql,t===Dr||t===Fs?(t=Gf(),Ge=3):t===rc?(t=Gf(),Ge=4):Ge=t===kc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,Ae===null&&(et=1,lo(e,oa(t,e.current)))}function Th(){var e=$t.current;return e===null?!0:(Oe&4194048)===Oe?da===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===da:!1}function Rh(){var e=k.H;return k.H=Ql,e===null?Ql:e}function Ch(){var e=k.A;return k.A=My,e}function vo(){et=4,vn||(Oe&4194048)!==Oe&&$t.current!==null||(Vr=!0),(yn&134217727)===0&&(ar&134217727)===0||Xe===null||Nn(Xe,Oe,Wt,!1)}function tu(e,t,a){var r=He;He|=2;var c=Rh(),u=Ch();(Xe!==e||Oe!==t)&&(xo=null,Xr(e,t)),t=!1;var h=et;e:do try{if(Ge!==0&&Ae!==null){var b=Ae,E=It;switch(Ge){case 8:eu(),h=6;break e;case 3:case 2:case 9:case 6:$t.current===null&&(t=!0);var D=Ge;if(Ge=0,It=null,Kr(e,b,E,D),a&&Vr){h=0;break e}break;default:D=Ge,Ge=0,It=null,Kr(e,b,E,D)}}Oy(),h=et;break}catch(X){Eh(e,X)}while(!0);return t&&e.shellSuspendCounter++,Ha=Kn=null,He=r,k.H=c,k.A=u,Ae===null&&(Xe=null,Oe=0,Ls()),h}function Oy(){for(;Ae!==null;)_h(Ae)}function zy(e,t){var a=He;He|=2;var r=Rh(),c=Ch();Xe!==e||Oe!==t?(xo=null,po=Rt()+500,Xr(e,t)):Vr=Je(e,t);e:do try{if(Ge!==0&&Ae!==null){t=Ae;var u=It;t:switch(Ge){case 1:Ge=0,It=null,Kr(e,t,u,1);break;case 2:case 9:if(qf(u)){Ge=0,It=null,Mh(t);break}t=function(){Ge!==2&&Ge!==9||Xe!==e||(Ge=7),Aa(e)},u.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:qf(u)?(Ge=0,It=null,Mh(t)):(Ge=0,It=null,Kr(e,t,u,7));break;case 5:var h=null;switch(Ae.tag){case 26:h=Ae.memoizedState;case 5:case 27:var b=Ae;if(h?pp(h):b.stateNode.complete){Ge=0,It=null;var E=b.sibling;if(E!==null)Ae=E;else{var D=b.return;D!==null?(Ae=D,yo(D)):Ae=null}break t}}Ge=0,It=null,Kr(e,t,u,5);break;case 6:Ge=0,It=null,Kr(e,t,u,6);break;case 8:eu(),et=6;break e;default:throw Error(i(462))}}Dy();break}catch(X){Eh(e,X)}while(!0);return Ha=Kn=null,k.H=r,k.A=c,He=a,Ae!==null?0:(Xe=null,Oe=0,Ls(),et)}function Dy(){for(;Ae!==null&&!Tt();)_h(Ae)}function _h(e){var t=Wm(e.alternate,e,$a);e.memoizedProps=e.pendingProps,t===null?yo(e):Ae=t}function Mh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Km(a,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=Km(a,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:xc(t);default:th(a,t),t=Ae=Cf(t,$a),t=Wm(a,t,$a)}e.memoizedProps=e.pendingProps,t===null?yo(e):Ae=t}function Kr(e,t,a,r){Ha=Kn=null,xc(t),Ur=null,zl=0;var c=t.return;try{if(jy(e,c,t,a,Oe)){et=1,lo(e,oa(a,e.current)),Ae=null;return}}catch(u){if(c!==null)throw Ae=c,u;et=1,lo(e,oa(a,e.current)),Ae=null;return}t.flags&32768?(De||r===1?e=!0:Vr||(Oe&536870912)!==0?e=!1:(vn=e=!0,(r===2||r===9||r===3||r===6)&&(r=$t.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ah(t,e)):yo(t)}function yo(e){var t=e;do{if((t.flags&32768)!==0){Ah(t,vn);return}e=t.return;var a=Ty(t.alternate,t,$a);if(a!==null){Ae=a;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);et===0&&(et=5)}function Ah(e,t){do{var a=Ry(e.alternate,e);if(a!==null){a.flags&=32767,Ae=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=a}while(e!==null);et=6,Ae=null}function kh(e,t,a,r,c,u,h,b,E){e.cancelPendingCommit=null;do bo();while(ct!==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|=Vi,Ot(e,a,u,h,b,E),e===Xe&&(Ae=Xe=null,Oe=0),Fr=t,Sn=e,Pa=a,Pc=u,Ic=c,Sh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,qy(Un,function(){return Lh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=k.T,k.T=null,c=P.p,P.p=2,h=He,He|=4;try{Cy(e,t,a)}finally{He=h,P.p=c,k.T=r}}ct=1,Oh(),zh(),Dh()}}function Oh(){if(ct===1){ct=0;var e=Sn,t=Fr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var r=P.p;P.p=2;var c=He;He|=4;try{mh(t,e);var u=mu,h=yf(e.containerInfo),b=u.focusedElem,E=u.selectionRange;if(h!==b&&b&&b.ownerDocument&&vf(b.ownerDocument.documentElement,b)){if(E!==null&&Bi(b)){var D=E.start,X=E.end;if(X===void 0&&(X=D),"selectionStart"in b)b.selectionStart=D,b.selectionEnd=Math.min(X,b.value.length);else{var J=b.ownerDocument||document,U=J&&J.defaultView||window;if(U.getSelection){var H=U.getSelection(),ce=b.textContent.length,xe=Math.min(E.start,ce),Fe=E.end===void 0?xe:Math.min(E.end,ce);!H.extend&&xe>Fe&&(h=Fe,Fe=xe,xe=h);var A=gf(b,xe),C=gf(b,Fe);if(A&&C&&(H.rangeCount!==1||H.anchorNode!==A.node||H.anchorOffset!==A.offset||H.focusNode!==C.node||H.focusOffset!==C.offset)){var z=J.createRange();z.setStart(A.node,A.offset),H.removeAllRanges(),xe>Fe?(H.addRange(z),H.extend(C.node,C.offset)):(z.setEnd(C.node,C.offset),H.addRange(z))}}}}for(J=[],H=b;H=H.parentNode;)H.nodeType===1&&J.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<J.length;b++){var K=J[b];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}ko=!!fu,mu=fu=null}finally{He=c,P.p=r,k.T=a}}e.current=t,ct=2}}function zh(){if(ct===2){ct=0;var e=Sn,t=Fr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var r=P.p;P.p=2;var c=He;He|=4;try{ih(e,t.alternate,t)}finally{He=c,P.p=r,k.T=a}}ct=3}}function Dh(){if(ct===4||ct===3){ct=0,an();var e=Sn,t=Fr,a=Pa,r=Sh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ct=5:(ct=0,Fr=Sn=null,Uh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(bn=null),ya(a),t=t.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Ln,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=k.T,c=P.p,P.p=2,k.T=null;try{for(var u=e.onRecoverableError,h=0;h<r.length;h++){var b=r[h];u(b.value,{componentStack:b.stack})}}finally{k.T=t,P.p=c}}(Pa&3)!==0&&bo(),Aa(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===Wc?Pl++:(Pl=0,Wc=e):Pl=0,Il(0)}}function Uh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,kl(t)))}function bo(){return Oh(),zh(),Dh(),Lh()}function Lh(){if(ct!==5)return!1;var e=Sn,t=Pc;Pc=0;var a=ya(Pa),r=k.T,c=P.p;try{P.p=32>a?32:a,k.T=null,a=Ic,Ic=null;var u=Sn,h=Pa;if(ct=0,Fr=Sn=null,Pa=0,(He&6)!==0)throw Error(i(331));var b=He;if(He|=4,vh(u.current),ph(u,u.current,h,a),He=b,Il(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Ln,u)}catch{}return!0}finally{P.p=c,k.T=r,Uh(e,t)}}function Bh(e,t,a){t=oa(a,t),t=Ac(e.stateNode,t,2),e=hn(e,t,2),e!==null&&(Ie(e,2),Aa(e))}function Qe(e,t,a){if(e.tag===3)Bh(e,e,a);else for(;t!==null;){if(t.tag===3){Bh(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(bn===null||!bn.has(r))){e=oa(a,e),a=qm(2),r=hn(t,a,2),r!==null&&(Hm(a,r,t,e),Ie(r,2),Aa(r));break}}t=t.return}}function au(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Ay;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(a)||(Zc=!0,c.add(a),e=Uy.bind(null,e,t,a),t.then(e,e))}function Uy(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Xe===e&&(Oe&a)===a&&(et===4||et===3&&(Oe&62914560)===Oe&&300>Rt()-ho?(He&2)===0&&Xr(e,0):Jc|=a,Yr===Oe&&(Yr=0)),Aa(e)}function qh(e,t){t===0&&(t=jt()),e=Yn(e,t),e!==null&&(Ie(e,t),Aa(e))}function Ly(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),qh(e,a)}function By(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(a=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),qh(e,a)}function qy(e,t){return pl(e,t)}var So=null,Zr=null,nu=!1,No=!1,ru=!1,jn=0;function Aa(e){e!==Zr&&e.next===null&&(Zr===null?So=Zr=e:Zr=Zr.next=e),No=!0,nu||(nu=!0,Gy())}function Il(e,t){if(!ru&&No){ru=!0;do for(var a=!1,r=So;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var u=0;else{var h=r.suspendedLanes,b=r.pingedLanes;u=(1<<31-Nt(42|e)+1)-1,u&=c&~(h&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Vh(r,u))}else u=Oe,u=Se(r,r===Xe?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||Je(r,u)||(a=!0,Vh(r,u));r=r.next}while(a);ru=!1}}function Hy(){Hh()}function Hh(){No=nu=!1;var e=0;jn!==0&&Py()&&(e=jn);for(var t=Rt(),a=null,r=So;r!==null;){var c=r.next,u=Gh(r,t);u===0?(r.next=null,a===null?So=c:a.next=c,c===null&&(Zr=a)):(a=r,(e!==0||(u&3)!==0)&&(No=!0)),r=c}ct!==0&&ct!==5||Il(e),jn!==0&&(jn=0)}function Gh(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var h=31-Nt(u),b=1<<h,E=c[h];E===-1?((b&a)===0||(b&r)!==0)&&(c[h]=ft(b,t)):E<=t&&(e.expiredLanes|=b),u&=~b}if(t=Xe,a=Oe,a=Se(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xl(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Je(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&xl(r),ya(a)){case 2:case 8:a=ws;break;case 32:a=Un;break;case 268435456:a=za;break;default:a=Un}return r=Qh.bind(null,e),a=pl(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&xl(r),e.callbackPriority=2,e.callbackNode=null,2}function Qh(e,t){if(ct!==0&&ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(bo()&&e.callbackNode!==a)return null;var r=Oe;return r=Se(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(jh(e,r,t),Gh(e,Rt()),e.callbackNode!=null&&e.callbackNode===a?Qh.bind(null,e):null)}function Vh(e,t){if(bo())return null;jh(e,t,!0)}function Gy(){Wy(function(){(He&6)!==0?pl(Dn,Hy):Hh()})}function lu(){if(jn===0){var e=Or;e===0&&(e=fr,fr<<=1,(fr&261888)===0&&(fr=256)),jn=e}return jn}function Yh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_s(""+e)}function Fh(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Qy(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var u=Yh((c[Ut]||null).action),h=r.submitter;h&&(t=(t=h[Ut]||null)?Yh(t.formAction):h.getAttribute("formAction"),t!==null&&(u=t,h=null));var b=new Os("action","action",null,r,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jn!==0){var E=h?Fh(c,h):new FormData(c);Ec(a,{pending:!0,data:E,method:c.method,action:u},null,E)}}else typeof u=="function"&&(b.preventDefault(),E=h?Fh(c,h):new FormData(c),Ec(a,{pending:!0,data:E,method:c.method,action:u},u,E))},currentTarget:c}]})}}for(var su=0;su<Qi.length;su++){var ou=Qi[su],Vy=ou.toLowerCase(),Yy=ou[0].toUpperCase()+ou.slice(1);ba(Vy,"on"+Yy)}ba(Nf,"onAnimationEnd"),ba(jf,"onAnimationIteration"),ba(wf,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(sy,"onTransitionRun"),ba(oy,"onTransitionStart"),ba(iy,"onTransitionCancel"),ba(Ef,"onTransitionEnd"),yr("onMouseEnter",["mouseout","mouseover"]),yr("onMouseLeave",["mouseout","mouseover"]),yr("onPointerEnter",["pointerout","pointerover"]),yr("onPointerLeave",["pointerout","pointerover"]),Hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),Fy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wl));function Xh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],c=r.event;r=r.listeners;e:{var u=void 0;if(t)for(var h=r.length-1;0<=h;h--){var b=r[h],E=b.instance,D=b.currentTarget;if(b=b.listener,E!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=D;try{u(c)}catch(X){Us(X)}c.currentTarget=null,u=E}else for(h=0;h<r.length;h++){if(b=r[h],E=b.instance,D=b.currentTarget,b=b.listener,E!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=D;try{u(c)}catch(X){Us(X)}c.currentTarget=null,u=E}}}}function ke(e,t){var a=t[bi];a===void 0&&(a=t[bi]=new Set);var r=e+"__bubble";a.has(r)||(Kh(t,e,2,!1),a.add(r))}function iu(e,t,a){var r=0;t&&(r|=4),Kh(a,e,r,t)}var jo="_reactListening"+Math.random().toString(36).slice(2);function cu(e){if(!e[jo]){e[jo]=!0,qd.forEach(function(a){a!=="selectionchange"&&(Fy.has(a)||iu(a,!1,e),iu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jo]||(t[jo]=!0,iu("selectionchange",!1,t))}}function Kh(e,t,a,r){switch(Np(t)){case 2:var c=yb;break;case 8:c=bb;break;default:c=wu}a=c.bind(null,t,a,e),c=void 0,!_i||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function uu(e,t,a,r,c){var u=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var h=r.tag;if(h===3||h===4){var b=r.stateNode.containerInfo;if(b===c)break;if(h===4)for(h=r.return;h!==null;){var E=h.tag;if((E===3||E===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;b!==null;){if(h=xr(b),h===null)return;if(E=h.tag,E===5||E===6||E===26||E===27){r=u=h;continue e}b=b.parentNode}}r=r.return}Pd(function(){var D=u,X=Ri(a),J=[];e:{var U=Tf.get(e);if(U!==void 0){var H=Os,ce=e;switch(e){case"keypress":if(As(a)===0)break e;case"keydown":case"keyup":H=Bv;break;case"focusin":ce="focus",H=Oi;break;case"focusout":ce="blur",H=Oi;break;case"beforeblur":case"afterblur":H=Oi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=ef;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=Tv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=Gv;break;case Nf:case jf:case wf:H=_v;break;case Ef:H=Vv;break;case"scroll":case"scrollend":H=wv;break;case"wheel":H=Fv;break;case"copy":case"cut":case"paste":H=Av;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=af;break;case"toggle":case"beforetoggle":H=Kv}var xe=(t&4)!==0,Fe=!xe&&(e==="scroll"||e==="scrollend"),A=xe?U!==null?U+"Capture":null:U;xe=[];for(var C=D,z;C!==null;){var K=C;if(z=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||z===null||A===null||(K=Sl(C,A),K!=null&&xe.push(es(C,K,z))),Fe)break;C=C.return}0<xe.length&&(U=new H(U,ce,null,a,X),J.push({event:U,listeners:xe}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",U&&a!==Ti&&(ce=a.relatedTarget||a.fromElement)&&(xr(ce)||ce[pr]))break e;if((H||U)&&(U=X.window===X?X:(U=X.ownerDocument)?U.defaultView||U.parentWindow:window,H?(ce=a.relatedTarget||a.toElement,H=D,ce=ce?xr(ce):null,ce!==null&&(Fe=f(ce),xe=ce.tag,ce!==Fe||xe!==5&&xe!==27&&xe!==6)&&(ce=null)):(H=null,ce=D),H!==ce)){if(xe=ef,K="onMouseLeave",A="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(xe=af,K="onPointerLeave",A="onPointerEnter",C="pointer"),Fe=H==null?U:bl(H),z=ce==null?U:bl(ce),U=new xe(K,C+"leave",H,a,X),U.target=Fe,U.relatedTarget=z,K=null,xr(X)===D&&(xe=new xe(A,C+"enter",ce,a,X),xe.target=z,xe.relatedTarget=Fe,K=xe),Fe=K,H&&ce)t:{for(xe=Xy,A=H,C=ce,z=0,K=A;K;K=xe(K))z++;K=0;for(var he=C;he;he=xe(he))K++;for(;0<z-K;)A=xe(A),z--;for(;0<K-z;)C=xe(C),K--;for(;z--;){if(A===C||C!==null&&A===C.alternate){xe=A;break t}A=xe(A),C=xe(C)}xe=null}else xe=null;H!==null&&Zh(J,U,H,xe,!1),ce!==null&&Fe!==null&&Zh(J,Fe,ce,xe,!0)}}e:{if(U=D?bl(D):window,H=U.nodeName&&U.nodeName.toLowerCase(),H==="select"||H==="input"&&U.type==="file")var Be=df;else if(cf(U))if(ff)Be=ny;else{Be=ty;var me=ey}else H=U.nodeName,!H||H.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?D&&Ei(D.elementType)&&(Be=df):Be=ay;if(Be&&(Be=Be(e,D))){uf(J,Be,a,X);break e}me&&me(e,U,D),e==="focusout"&&D&&U.type==="number"&&D.memoizedProps.value!=null&&wi(U,"number",U.value)}switch(me=D?bl(D):window,e){case"focusin":(cf(me)||me.contentEditable==="true")&&(Er=me,qi=D,_l=null);break;case"focusout":_l=qi=Er=null;break;case"mousedown":Hi=!0;break;case"contextmenu":case"mouseup":case"dragend":Hi=!1,bf(J,a,X);break;case"selectionchange":if(ly)break;case"keydown":case"keyup":bf(J,a,X)}var Re;if(Di)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else wr?sf(e,a)&&(ze="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ze="onCompositionStart");ze&&(nf&&a.locale!=="ko"&&(wr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&wr&&(Re=Id()):(sn=X,Mi="value"in sn?sn.value:sn.textContent,wr=!0)),me=wo(D,ze),0<me.length&&(ze=new tf(ze,e,null,a,X),J.push({event:ze,listeners:me}),Re?ze.data=Re:(Re=of(a),Re!==null&&(ze.data=Re)))),(Re=Jv?$v(e,a):Pv(e,a))&&(ze=wo(D,"onBeforeInput"),0<ze.length&&(me=new tf("onBeforeInput","beforeinput",null,a,X),J.push({event:me,listeners:ze}),me.data=Re)),Qy(J,e,D,a,X)}Xh(J,t)})}function es(e,t,a){return{instance:e,listener:t,currentTarget:a}}function wo(e,t){for(var a=t+"Capture",r=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=Sl(e,a),c!=null&&r.unshift(es(e,c,u)),c=Sl(e,t),c!=null&&r.push(es(e,c,u))),e.tag===3)return r;e=e.return}return[]}function Xy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zh(e,t,a,r,c){for(var u=t._reactName,h=[];a!==null&&a!==r;){var b=a,E=b.alternate,D=b.stateNode;if(b=b.tag,E!==null&&E===r)break;b!==5&&b!==26&&b!==27||D===null||(E=D,c?(D=Sl(a,u),D!=null&&h.unshift(es(a,D,E))):c||(D=Sl(a,u),D!=null&&h.push(es(a,D,E)))),a=a.return}h.length!==0&&e.push({event:t,listeners:h})}var Ky=/\r\n?/g,Zy=/\u0000|\uFFFD/g;function Jh(e){return(typeof e=="string"?e:""+e).replace(Ky,`
9
+ `).replace(Zy,"")}function $h(e,t){return t=Jh(t),Jh(e)===t}function Ye(e,t,a,r,c,u){switch(a){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":Rs(e,"class",r);break;case"tabIndex":Rs(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Rs(e,a,r);break;case"style":Jd(e,r,u);break;case"data":if(t!=="object"){Rs(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=_s(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(a==="formAction"?(t!=="input"&&Ye(e,t,"name",c.name,c,null),Ye(e,t,"formEncType",c.formEncType,c,null),Ye(e,t,"formMethod",c.formMethod,c,null),Ye(e,t,"formTarget",c.formTarget,c,null)):(Ye(e,t,"encType",c.encType,c,null),Ye(e,t,"method",c.method,c,null),Ye(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=_s(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=Ua);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}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}a=_s(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":ke("beforetoggle",e),ke("toggle",e),Ts(e,"popover",r);break;case"xlinkActuate":Da(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Da(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Da(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Da(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Da(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Da(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Da(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Da(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Da(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Ts(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Nv.get(a)||a,Ts(e,a,r))}}function du(e,t,a,r,c,u){switch(a){case"style":Jd(e,r,u);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof r=="string"?Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&Sr(e,""+r);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ua);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Hd.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),u=e[Ut]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof r=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,c);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Ts(e,a,r)}}}function yt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var r=!1,c=!1,u;for(u in a)if(a.hasOwnProperty(u)){var h=a[u];if(h!=null)switch(u){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ye(e,t,u,h,a,null)}}c&&Ye(e,t,"srcSet",a.srcSet,a,null),r&&Ye(e,t,"src",a.src,a,null);return;case"input":ke("invalid",e);var b=u=h=c=null,E=null,D=null;for(r in a)if(a.hasOwnProperty(r)){var X=a[r];if(X!=null)switch(r){case"name":c=X;break;case"type":h=X;break;case"checked":E=X;break;case"defaultChecked":D=X;break;case"value":u=X;break;case"defaultValue":b=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,t));break;default:Ye(e,t,r,X,a,null)}}Fd(e,u,b,E,D,h,c,!1);return;case"select":ke("invalid",e),r=h=u=null;for(c in a)if(a.hasOwnProperty(c)&&(b=a[c],b!=null))switch(c){case"value":u=b;break;case"defaultValue":h=b;break;case"multiple":r=b;default:Ye(e,t,c,b,a,null)}t=u,a=h,e.multiple=!!r,t!=null?br(e,!!r,t,!1):a!=null&&br(e,!!r,a,!0);return;case"textarea":ke("invalid",e),u=c=r=null;for(h in a)if(a.hasOwnProperty(h)&&(b=a[h],b!=null))switch(h){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:Ye(e,t,h,b,a,null)}Kd(e,r,c,u);return;case"option":for(E in a)a.hasOwnProperty(E)&&(r=a[E],r!=null)&&(E==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Ye(e,t,E,r,a,null));return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(r=0;r<Wl.length;r++)ke(Wl[r],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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(D in a)if(a.hasOwnProperty(D)&&(r=a[D],r!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ye(e,t,D,r,a,null)}return;default:if(Ei(t)){for(X in a)a.hasOwnProperty(X)&&(r=a[X],r!==void 0&&du(e,t,X,r,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(r=a[b],r!=null&&Ye(e,t,b,r,a,null))}function Jy(e,t,a,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,h=null,b=null,E=null,D=null,X=null;for(H in a){var J=a[H];if(a.hasOwnProperty(H)&&J!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":E=J;default:r.hasOwnProperty(H)||Ye(e,t,H,null,r,J)}}for(var U in r){var H=r[U];if(J=a[U],r.hasOwnProperty(U)&&(H!=null||J!=null))switch(U){case"type":u=H;break;case"name":c=H;break;case"checked":D=H;break;case"defaultChecked":X=H;break;case"value":h=H;break;case"defaultValue":b=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(i(137,t));break;default:H!==J&&Ye(e,t,U,H,r,J)}}ji(e,h,b,E,D,X,u,c);return;case"select":H=h=b=U=null;for(u in a)if(E=a[u],a.hasOwnProperty(u)&&E!=null)switch(u){case"value":break;case"multiple":H=E;default:r.hasOwnProperty(u)||Ye(e,t,u,null,r,E)}for(c in r)if(u=r[c],E=a[c],r.hasOwnProperty(c)&&(u!=null||E!=null))switch(c){case"value":U=u;break;case"defaultValue":b=u;break;case"multiple":h=u;default:u!==E&&Ye(e,t,c,u,r,E)}t=b,a=h,r=H,U!=null?br(e,!!a,U,!1):!!r!=!!a&&(t!=null?br(e,!!a,t,!0):br(e,!!a,a?[]:"",!1));return;case"textarea":H=U=null;for(b in a)if(c=a[b],a.hasOwnProperty(b)&&c!=null&&!r.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Ye(e,t,b,null,r,c)}for(h in r)if(c=r[h],u=a[h],r.hasOwnProperty(h)&&(c!=null||u!=null))switch(h){case"value":U=c;break;case"defaultValue":H=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==u&&Ye(e,t,h,c,r,u)}Xd(e,U,H);return;case"option":for(var ce in a)U=a[ce],a.hasOwnProperty(ce)&&U!=null&&!r.hasOwnProperty(ce)&&(ce==="selected"?e.selected=!1:Ye(e,t,ce,null,r,U));for(E in r)U=r[E],H=a[E],r.hasOwnProperty(E)&&U!==H&&(U!=null||H!=null)&&(E==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":Ye(e,t,E,U,r,H));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 xe in a)U=a[xe],a.hasOwnProperty(xe)&&U!=null&&!r.hasOwnProperty(xe)&&Ye(e,t,xe,null,r,U);for(D in r)if(U=r[D],H=a[D],r.hasOwnProperty(D)&&U!==H&&(U!=null||H!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,t));break;default:Ye(e,t,D,U,r,H)}return;default:if(Ei(t)){for(var Fe in a)U=a[Fe],a.hasOwnProperty(Fe)&&U!==void 0&&!r.hasOwnProperty(Fe)&&du(e,t,Fe,void 0,r,U);for(X in r)U=r[X],H=a[X],!r.hasOwnProperty(X)||U===H||U===void 0&&H===void 0||du(e,t,X,U,r,H);return}}for(var A in a)U=a[A],a.hasOwnProperty(A)&&U!=null&&!r.hasOwnProperty(A)&&Ye(e,t,A,null,r,U);for(J in r)U=r[J],H=a[J],!r.hasOwnProperty(J)||U===H||U==null&&H==null||Ye(e,t,J,U,r,H)}function Ph(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $y(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var c=a[r],u=c.transferSize,h=c.initiatorType,b=c.duration;if(u&&b&&Ph(h)){for(h=0,b=c.responseEnd,r+=1;r<a.length;r++){var E=a[r],D=E.startTime;if(D>b)break;var X=E.transferSize,J=E.initiatorType;X&&Ph(J)&&(E=E.responseEnd,h+=X*(E<b?1:(b-D)/(E-D)))}if(--r,t+=8*(u+h)/(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 fu=null,mu=null;function Eo(e){return e.nodeType===9?e:e.ownerDocument}function Ih(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 Wh(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 hu(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 pu=null;function Py(){var e=window.event;return e&&e.type==="popstate"?e===pu?!1:(pu=e,!0):(pu=null,!1)}var ep=typeof setTimeout=="function"?setTimeout:void 0,Iy=typeof clearTimeout=="function"?clearTimeout:void 0,tp=typeof Promise=="function"?Promise:void 0,Wy=typeof queueMicrotask=="function"?queueMicrotask:typeof tp<"u"?function(e){return tp.resolve(null).then(e).catch(eb)}:ep;function eb(e){setTimeout(function(){throw e})}function wn(e){return e==="head"}function ap(e,t){var a=t,r=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(c),Ir(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")ts(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ts(a);for(var u=a.firstChild;u;){var h=u.nextSibling,b=u.nodeName;u[yl]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&u.rel.toLowerCase()==="stylesheet"||a.removeChild(u),u=h}}else a==="body"&&ts(e.ownerDocument.body);a=c}while(a);Ir(t)}function np(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function xu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":xu(a),Si(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function tb(e,t,a,r){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[yl])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=fa(e.nextSibling),e===null)break}return null}function ab(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=fa(e.nextSibling),e===null))return null;return e}function rp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=fa(e.nextSibling),e===null))return null;return e}function gu(e){return e.data==="$?"||e.data==="$~"}function vu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function nb(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function fa(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 yu=null;function lp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return fa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function sp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function op(e,t,a){switch(t=Eo(a),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 ts(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Si(e)}var ma=new Map,ip=new Set;function To(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ia=P.d;P.d={f:rb,r:lb,D:sb,C:ob,L:ib,m:cb,X:db,S:ub,M:fb};function rb(){var e=Ia.f(),t=go();return e||t}function lb(e){var t=gr(e);t!==null&&t.tag===5&&t.type==="form"?Em(t):Ia.r(e)}var Jr=typeof document>"u"?null:document;function cp(e,t,a){var r=Jr;if(r&&typeof t=="string"&&t){var c=la(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),ip.has(c)||(ip.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),yt(t,"link",e),mt(t),r.head.appendChild(t)))}}function sb(e){Ia.D(e),cp("dns-prefetch",e,null)}function ob(e,t){Ia.C(e,t),cp("preconnect",e,t)}function ib(e,t,a){Ia.L(e,t,a);var r=Jr;if(r&&e&&t){var c='link[rel="preload"][as="'+la(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+la(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+la(a.imageSizes)+'"]')):c+='[href="'+la(e)+'"]';var u=c;switch(t){case"style":u=$r(e);break;case"script":u=Pr(e)}ma.has(u)||(e=p({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ma.set(u,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(as(u))||t==="script"&&r.querySelector(ns(u))||(t=r.createElement("link"),yt(t,"link",e),mt(t),r.head.appendChild(t)))}}function cb(e,t){Ia.m(e,t);var a=Jr;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+la(r)+'"][href="'+la(e)+'"]',u=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Pr(e)}if(!ma.has(u)&&(e=p({rel:"modulepreload",href:e},t),ma.set(u,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ns(u)))return}r=a.createElement("link"),yt(r,"link",e),mt(r),a.head.appendChild(r)}}}function ub(e,t,a){Ia.S(e,t,a);var r=Jr;if(r&&e){var c=vr(r).hoistableStyles,u=$r(e);t=t||"default";var h=c.get(u);if(!h){var b={loading:0,preload:null};if(h=r.querySelector(as(u)))b.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ma.get(u))&&bu(e,a);var E=h=r.createElement("link");mt(E),yt(E,"link",e),E._p=new Promise(function(D,X){E.onload=D,E.onerror=X}),E.addEventListener("load",function(){b.loading|=1}),E.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Ro(h,t,r)}h={type:"stylesheet",instance:h,count:1,state:b},c.set(u,h)}}}function db(e,t){Ia.X(e,t);var a=Jr;if(a&&e){var r=vr(a).hoistableScripts,c=Pr(e),u=r.get(c);u||(u=a.querySelector(ns(c)),u||(e=p({src:e,async:!0},t),(t=ma.get(c))&&Su(e,t),u=a.createElement("script"),mt(u),yt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function fb(e,t){Ia.M(e,t);var a=Jr;if(a&&e){var r=vr(a).hoistableScripts,c=Pr(e),u=r.get(c);u||(u=a.querySelector(ns(c)),u||(e=p({src:e,async:!0,type:"module"},t),(t=ma.get(c))&&Su(e,t),u=a.createElement("script"),mt(u),yt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function up(e,t,a,r){var c=(c=ie.current)?To(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=$r(a.href),a=vr(c).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=$r(a.href);var u=vr(c).hoistableStyles,h=u.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,h),(u=c.querySelector(as(e)))&&!u._p&&(h.instance=u,h.state.loading=5),ma.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ma.set(e,a),u||mb(c,e,a,h.state))),t&&r===null)throw Error(i(528,""));return h}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Pr(a),a=vr(c).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function $r(e){return'href="'+la(e)+'"'}function as(e){return'link[rel="stylesheet"]['+e+"]"}function dp(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function mb(e,t,a,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}),yt(t,"link",a),mt(t),e.head.appendChild(t))}function Pr(e){return'[src="'+la(e)+'"]'}function ns(e){return"script[async]"+e}function fp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+la(a.href)+'"]');if(r)return t.instance=r,mt(r),r;var c=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),mt(r),yt(r,"style",c),Ro(r,a.precedence,e),t.instance=r;case"stylesheet":c=$r(a.href);var u=e.querySelector(as(c));if(u)return t.state.loading|=4,t.instance=u,mt(u),u;r=dp(a),(c=ma.get(c))&&bu(r,c),u=(e.ownerDocument||e).createElement("link"),mt(u);var h=u;return h._p=new Promise(function(b,E){h.onload=b,h.onerror=E}),yt(u,"link",r),t.state.loading|=4,Ro(u,a.precedence,e),t.instance=u;case"script":return u=Pr(a.src),(c=e.querySelector(ns(u)))?(t.instance=c,mt(c),c):(r=a,(c=ma.get(u))&&(r=p({},a),Su(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),mt(c),yt(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,a.precedence,e));return t.instance}function Ro(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,u=c,h=0;h<r.length;h++){var b=r[h];if(b.dataset.precedence===t)u=b;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function bu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Co=null;function mp(e,t,a){if(Co===null){var r=new Map,c=Co=new Map;c.set(a,r)}else c=Co,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var u=a[c];if(!(u[yl]||u[pt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var h=u.getAttribute(t)||"";h=e+h;var b=r.get(h);b?b.push(u):r.set(h,[u])}}return r}function hp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function hb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;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 pp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pb(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=$r(r.href),u=t.querySelector(as(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_o.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=u,mt(u);return}u=t.ownerDocument||t,r=dp(r),(c=ma.get(c))&&bu(r,c),u=u.createElement("link"),mt(u);var h=u;h._p=new Promise(function(b,E){h.onload=b,h.onerror=E}),yt(u,"link",r),a.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=_o.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Nu=0;function xb(e,t){return e.stylesheets&&e.count===0&&Ao(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Ao(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Nu===0&&(Nu=62500*$y());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ao(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Nu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function _o(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ao(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Mo=null;function Ao(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Mo=new Map,t.forEach(gb,e),Mo=null,_o.call(e))}function gb(e,t){if(!(t.state.loading&4)){var a=Mo.get(e);if(a)var r=a.get(null);else{a=new Map,Mo.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var h=c[u];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(a.set(h.dataset.precedence,h),r=h)}r&&a.set(null,r)}c=t.instance,h=c.getAttribute("data-precedence"),u=a.get(h)||r,u===r&&a.set(null,c),a.set(h,c),this.count++,r=_o.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 rs={$$typeof:Y,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function vb(e,t,a,r,c,u,h,b,E){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=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function xp(e,t,a,r,c,u,h,b,E,D,X,J){return e=new vb(e,t,a,h,E,D,X,J,b),t=1,u===!0&&(t|=24),u=Jt(3,null,null,t),e.current=u,u.stateNode=e,t=tc(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:r,isDehydrated:a,cache:t},lc(u),e}function gp(e){return e?(e=Cr,e):Cr}function vp(e,t,a,r,c,u){c=gp(c),r.context===null?r.context=c:r.pendingContext=c,r=mn(t),r.payload={element:a},u=u===void 0?null:u,u!==null&&(r.callback=u),a=hn(e,r,t),a!==null&&(Qt(a,e,t),Ul(a,e,t))}function yp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function ju(e,t){yp(e,t),(e=e.alternate)&&yp(e,t)}function bp(e){if(e.tag===13||e.tag===31){var t=Yn(e,67108864);t!==null&&Qt(t,e,67108864),ju(e,67108864)}}function Sp(e){if(e.tag===13||e.tag===31){var t=ea();t=hr(t);var a=Yn(e,t);a!==null&&Qt(a,e,t),ju(e,t)}}var ko=!0;function yb(e,t,a,r){var c=k.T;k.T=null;var u=P.p;try{P.p=2,wu(e,t,a,r)}finally{P.p=u,k.T=c}}function bb(e,t,a,r){var c=k.T;k.T=null;var u=P.p;try{P.p=8,wu(e,t,a,r)}finally{P.p=u,k.T=c}}function wu(e,t,a,r){if(ko){var c=Eu(r);if(c===null)uu(e,t,r,Oo,a),jp(e,r);else if(Nb(c,e,t,a,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Sb.indexOf(e)){for(;c!==null;){var u=gr(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var h=Ra(u.pendingLanes);if(h!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;h;){var E=1<<31-Nt(h);b.entanglements[1]|=E,h&=~E}Aa(u),(He&6)===0&&(po=Rt()+500,Il(0))}}break;case 31:case 13:b=Yn(u,2),b!==null&&Qt(b,u,2),go(),ju(u,2)}if(u=Eu(r),u===null&&uu(e,t,r,Oo,a),u===c)break;c=u}c!==null&&r.stopPropagation()}else uu(e,t,r,null,a)}}function Eu(e){return e=Ri(e),Tu(e)}var Oo=null;function Tu(e){if(Oo=null,e=xr(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=x(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oo=e,null}function Np(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(gi()){case Dn:return 2;case ws:return 8;case Un:case gl:return 32;case za:return 268435456;default:return 32}default:return 32}}var Ru=!1,En=null,Tn=null,Rn=null,ls=new Map,ss=new Map,Cn=[],Sb="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 jp(e,t){switch(e){case"focusin":case"focusout":En=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":ls.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ss.delete(t.pointerId)}}function os(e,t,a,r,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:u,targetContainers:[c]},t!==null&&(t=gr(t),t!==null&&bp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Nb(e,t,a,r,c){switch(t){case"focusin":return En=os(En,e,t,a,r,c),!0;case"dragenter":return Tn=os(Tn,e,t,a,r,c),!0;case"mouseover":return Rn=os(Rn,e,t,a,r,c),!0;case"pointerover":var u=c.pointerId;return ls.set(u,os(ls.get(u)||null,e,t,a,r,c)),!0;case"gotpointercapture":return u=c.pointerId,ss.set(u,os(ss.get(u)||null,e,t,a,r,c)),!0}return!1}function wp(e){var t=xr(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,Ld(e.priority,function(){Sp(a)});return}}else if(t===31){if(t=x(a),t!==null){e.blockedOn=t,Ld(e.priority,function(){Sp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Eu(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Ti=r,a.target.dispatchEvent(r),Ti=null}else return t=gr(a),t!==null&&bp(t),e.blockedOn=a,!1;t.shift()}return!0}function Ep(e,t,a){zo(e)&&a.delete(t)}function jb(){Ru=!1,En!==null&&zo(En)&&(En=null),Tn!==null&&zo(Tn)&&(Tn=null),Rn!==null&&zo(Rn)&&(Rn=null),ls.forEach(Ep),ss.forEach(Ep)}function Do(e,t){e.blockedOn===t&&(e.blockedOn=null,Ru||(Ru=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,jb)))}var Uo=null;function Tp(e){Uo!==e&&(Uo=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Uo===e&&(Uo=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Tu(r||a)===null)continue;break}var u=gr(a);u!==null&&(e.splice(t,3),t-=3,Ec(u,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function Ir(e){function t(E){return Do(E,e)}En!==null&&Do(En,e),Tn!==null&&Do(Tn,e),Rn!==null&&Do(Rn,e),ls.forEach(t),ss.forEach(t);for(var a=0;a<Cn.length;a++){var r=Cn[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cn.length&&(a=Cn[0],a.blockedOn===null);)wp(a),a.blockedOn===null&&Cn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var c=a[r],u=a[r+1],h=c[Ut]||null;if(typeof u=="function")h||Tp(a);else if(h){var b=null;if(u&&u.hasAttribute("formAction")){if(c=u,h=u[Ut]||null)b=h.formAction;else if(Tu(c)!==null)continue}else b=h.action;typeof b=="function"?a[r+1]=b:(a.splice(r,3),r-=3),Tp(a)}}}function Rp(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(a,20)}function a(){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(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Cu(e){this._internalRoot=e}Lo.prototype.render=Cu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=ea();vp(a,r,e,t,null,null)},Lo.prototype.unmount=Cu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vp(e.current,2,null,e,null,null),go(),t[pr]=null}};function Lo(e){this._internalRoot=e}Lo.prototype.unstable_scheduleHydration=function(e){if(e){var t=yi();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Cn.length&&t!==0&&t<Cn[a].priority;a++);Cn.splice(a,0,e),a===0&&wp(e)}};var Cp=l.version;if(Cp!=="19.2.4")throw Error(i(527,Cp,"19.2.4"));P.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=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var wb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bo.isDisabled&&Bo.supportsFiber)try{Ln=Bo.inject(wb),Ct=Bo}catch{}}return cs.createRoot=function(e,t){if(!d(e))throw Error(i(299));var a=!1,r="",c=Dm,u=Um,h=Lm;return t!=null&&(t.unstable_strictMode===!0&&(a=!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&&(h=t.onRecoverableError)),t=xp(e,1,!1,null,null,a,r,null,c,u,h,Rp),e[pr]=t.current,cu(e),new Cu(t)},cs.hydrateRoot=function(e,t,a){if(!d(e))throw Error(i(299));var r=!1,c="",u=Dm,h=Um,b=Lm,E=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=xp(e,1,!0,t,a??null,r,c,E,u,h,b,Rp),t.context=gp(null),a=t.current,r=ea(),r=hr(r),c=mn(r),c.callback=null,hn(a,c,r),a=r,t.current.lanes=a,Ie(t,a),Aa(t),e[pr]=t.current,cu(e),new Lo(t)},cs.version="19.2.4",cs}var Bp;function Ob(){if(Bp)return Au.exports;Bp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Au.exports=kb(),Au.exports}var zb=Ob();var qp="popstate";function Db(n={}){function l(i,d){let{pathname:f,search:m,hash:x}=i.location;return Zu("",{pathname:f,search:m,hash:x},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function s(i,d){return typeof d=="string"?d:ps(d)}return Lb(l,s,null,n)}function Pe(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function ja(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Ub(){return Math.random().toString(36).substring(2,10)}function Hp(n,l){return{usr:n.state,key:n.key,idx:l}}function Zu(n,l,s=null,i){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?ol(l):l,state:s,key:l&&l.key||i||Ub()}}function ps({pathname:n="/",search:l="",hash:s=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function ol(n){let l={};if(n){let s=n.indexOf("#");s>=0&&(l.hash=n.substring(s),n=n.substring(0,s));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function Lb(n,l,s,i={}){let{window:d=document.defaultView,v5Compat:f=!1}=i,m=d.history,x="POP",v=null,g=y();g==null&&(g=0,m.replaceState({...m.state,idx:g},""));function y(){return(m.state||{idx:null}).idx}function p(){x="POP";let R=y(),O=R==null?null:R-g;g=R,v&&v({action:x,location:w.location,delta:O})}function j(R,O){x="PUSH";let _=Zu(w.location,R,O);g=y()+1;let Y=Hp(_,g),L=w.createHref(_);try{m.pushState(Y,"",L)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;d.location.assign(L)}f&&v&&v({action:x,location:w.location,delta:1})}function M(R,O){x="REPLACE";let _=Zu(w.location,R,O);g=y();let Y=Hp(_,g),L=w.createHref(_);m.replaceState(Y,"",L),f&&v&&v({action:x,location:w.location,delta:0})}function N(R){return Bb(R)}let w={get action(){return x},get location(){return n(d,m)},listen(R){if(v)throw new Error("A history only accepts one active listener");return d.addEventListener(qp,p),v=R,()=>{d.removeEventListener(qp,p),v=null}},createHref(R){return l(d,R)},createURL:N,encodeLocation(R){let O=N(R);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:j,replace:M,go(R){return m.go(R)}};return w}function Bb(n,l=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),Pe(s,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:ps(n);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=s+i),new URL(i,s)}function qx(n,l,s="/"){return qb(n,l,s,!1)}function qb(n,l,s,i){let d=typeof l=="string"?ol(l):l,f=tn(d.pathname||"/",s);if(f==null)return null;let m=Hx(n);Hb(m);let x=null;for(let v=0;x==null&&v<m.length;++v){let g=Pb(f);x=Jb(m[v],g,i)}return x}function Hx(n,l=[],s=[],i="",d=!1){let f=(m,x,v=d,g)=>{let y={relativePath:g===void 0?m.path||"":g,caseSensitive:m.caseSensitive===!0,childrenIndex:x,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&v)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 p=en([i,y.relativePath]),j=s.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 "${p}".`),Hx(m.children,l,j,p,v)),!(m.path==null&&!m.index)&&l.push({path:p,score:Kb(p,m.index),routesMeta:j})};return n.forEach((m,x)=>{if(m.path===""||!m.path?.includes("?"))f(m,x);else for(let v of Gx(m.path))f(m,x,!0,v)}),l}function Gx(n){let l=n.split("/");if(l.length===0)return[];let[s,...i]=l,d=s.endsWith("?"),f=s.replace(/\?$/,"");if(i.length===0)return d?[f,""]:[f];let m=Gx(i.join("/")),x=[];return x.push(...m.map(v=>v===""?f:[f,v].join("/"))),d&&x.push(...m),x.map(v=>n.startsWith("/")&&v===""?"/":v)}function Hb(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:Zb(l.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var Gb=/^:[\w-]+$/,Qb=3,Vb=2,Yb=1,Fb=10,Xb=-2,Gp=n=>n==="*";function Kb(n,l){let s=n.split("/"),i=s.length;return s.some(Gp)&&(i+=Xb),l&&(i+=Vb),s.filter(d=>!Gp(d)).reduce((d,f)=>d+(Gb.test(f)?Qb:f===""?Yb:Fb),i)}function Zb(n,l){return n.length===l.length&&n.slice(0,-1).every((i,d)=>i===l[d])?n[n.length-1]-l[l.length-1]:0}function Jb(n,l,s=!1){let{routesMeta:i}=n,d={},f="/",m=[];for(let x=0;x<i.length;++x){let v=i[x],g=x===i.length-1,y=f==="/"?l:l.slice(f.length)||"/",p=ti({path:v.relativePath,caseSensitive:v.caseSensitive,end:g},y),j=v.route;if(!p&&g&&s&&!i[i.length-1].route.index&&(p=ti({path:v.relativePath,caseSensitive:v.caseSensitive,end:!1},y)),!p)return null;Object.assign(d,p.params),m.push({params:d,pathname:en([f,p.pathname]),pathnameBase:t0(en([f,p.pathnameBase])),route:j}),p.pathnameBase!=="/"&&(f=en([f,p.pathnameBase]))}return m}function ti(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=$b(n.path,n.caseSensitive,n.end),d=l.match(s);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),x=d.slice(1);return{params:i.reduce((g,{paramName:y,isOptional:p},j)=>{if(y==="*"){let N=x[j]||"";m=f.slice(0,f.length-N.length).replace(/(.)\/+$/,"$1")}const M=x[j];return p&&!M?g[y]=void 0:g[y]=(M||"").replace(/%2F/g,"/"),g},{}),pathname:f,pathnameBase:m,pattern:n}}function $b(n,l=!1,s=!0){ja(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],d="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,x,v)=>(i.push({paramName:x,isOptional:v!=null}),v?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,l?void 0:"i"),i]}function Pb(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return ja(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function tn(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,i=n.charAt(s);return i&&i!=="/"?null:n.slice(s)||"/"}var Ib=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Wb(n,l="/"){let{pathname:s,search:i="",hash:d=""}=typeof n=="string"?ol(n):n,f;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?f=Qp(s.substring(1),"/"):f=Qp(s,l)):f=l,{pathname:f,search:a0(i),hash:n0(d)}}function Qp(n,l){let s=l.replace(/\/+$/,"").split("/");return n.split("/").forEach(d=>{d===".."?s.length>1&&s.pop():d!=="."&&s.push(d)}),s.length>1?s.join("/"):"/"}function Du(n,l,s,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function e0(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function dd(n){let l=e0(n);return l.map((s,i)=>i===l.length-1?s.pathname:s.pathnameBase)}function fd(n,l,s,i=!1){let d;typeof n=="string"?d=ol(n):(d={...n},Pe(!d.pathname||!d.pathname.includes("?"),Du("?","pathname","search",d)),Pe(!d.pathname||!d.pathname.includes("#"),Du("#","pathname","hash",d)),Pe(!d.search||!d.search.includes("#"),Du("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,x;if(m==null)x=s;else{let p=l.length-1;if(!i&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),p-=1;d.pathname=j.join("/")}x=p>=0?l[p]:"/"}let v=Wb(d,x),g=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&s.endsWith("/");return!v.pathname.endsWith("/")&&(g||y)&&(v.pathname+="/"),v}var en=n=>n.join("/").replace(/\/\/+/g,"/"),t0=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),a0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,n0=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,r0=class{constructor(n,l,s,i=!1){this.status=n,this.statusText=l||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function l0(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function s0(n){return n.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Qx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Vx(n,l){let s=n;if(typeof s!="string"||!Ib.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,d=!1;if(Qx)try{let f=new URL(window.location.href),m=s.startsWith("//")?new URL(f.protocol+s):new URL(s),x=tn(m.pathname,l);m.origin===f.origin&&x!=null?s=x+m.search+m.hash:d=!0}catch{ja(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:d,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Yx=["POST","PUT","PATCH","DELETE"];new Set(Yx);var o0=["GET",...Yx];new Set(o0);var il=S.createContext(null);il.displayName="DataRouter";var ii=S.createContext(null);ii.displayName="DataRouterState";var i0=S.createContext(!1),Fx=S.createContext({isTransitioning:!1});Fx.displayName="ViewTransition";var c0=S.createContext(new Map);c0.displayName="Fetchers";var u0=S.createContext(null);u0.displayName="Await";var aa=S.createContext(null);aa.displayName="Navigation";var gs=S.createContext(null);gs.displayName="Location";var xa=S.createContext({outlet:null,matches:[],isDataRoute:!1});xa.displayName="Route";var md=S.createContext(null);md.displayName="RouteError";var Xx="REACT_ROUTER_ERROR",d0="REDIRECT",f0="ROUTE_ERROR_RESPONSE";function m0(n){if(n.startsWith(`${Xx}:${d0}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function h0(n){if(n.startsWith(`${Xx}:${f0}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new r0(l.status,l.statusText,l.data)}catch{}}function p0(n,{relative:l}={}){Pe(cl(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=S.useContext(aa),{hash:d,pathname:f,search:m}=vs(n,{relative:l}),x=f;return s!=="/"&&(x=f==="/"?s:en([s,f])),i.createHref({pathname:x,search:m,hash:d})}function cl(){return S.useContext(gs)!=null}function kn(){return Pe(cl(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(gs).location}var Kx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zx(n){S.useContext(aa).static||S.useLayoutEffect(n)}function wa(){let{isDataRoute:n}=S.useContext(xa);return n?A0():x0()}function x0(){Pe(cl(),"useNavigate() may be used only in the context of a <Router> component.");let n=S.useContext(il),{basename:l,navigator:s}=S.useContext(aa),{matches:i}=S.useContext(xa),{pathname:d}=kn(),f=JSON.stringify(dd(i)),m=S.useRef(!1);return Zx(()=>{m.current=!0}),S.useCallback((v,g={})=>{if(ja(m.current,Kx),!m.current)return;if(typeof v=="number"){s.go(v);return}let y=fd(v,JSON.parse(f),d,g.relative==="path");n==null&&l!=="/"&&(y.pathname=y.pathname==="/"?l:en([l,y.pathname])),(g.replace?s.replace:s.push)(y,g.state,g)},[l,s,f,d,n])}var g0=S.createContext(null);function v0(n){let l=S.useContext(xa).outlet;return S.useMemo(()=>l&&S.createElement(g0.Provider,{value:n},l),[l,n])}function y0(){let{matches:n}=S.useContext(xa),l=n[n.length-1];return l?l.params:{}}function vs(n,{relative:l}={}){let{matches:s}=S.useContext(xa),{pathname:i}=kn(),d=JSON.stringify(dd(s));return S.useMemo(()=>fd(n,JSON.parse(d),i,l==="path"),[n,d,i,l])}function b0(n,l){return Jx(n,l)}function Jx(n,l,s,i,d){Pe(cl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=S.useContext(aa),{matches:m}=S.useContext(xa),x=m[m.length-1],v=x?x.params:{},g=x?x.pathname:"/",y=x?x.pathnameBase:"/",p=x&&x.route;{let _=p&&p.path||"";Px(g,!p||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${_}">) 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
+
11
+ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let j=kn(),M;if(l){let _=typeof l=="string"?ol(l):l;Pe(y==="/"||_.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 "${_.pathname}" was given in the \`location\` prop.`),M=_}else M=j;let N=M.pathname||"/",w=N;if(y!=="/"){let _=y.replace(/^\//,"").split("/");w="/"+N.replace(/^\//,"").split("/").slice(_.length).join("/")}let R=qx(n,{pathname:w});ja(p||R!=null,`No routes matched location "${M.pathname}${M.search}${M.hash}" `),ja(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.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=E0(R&&R.map(_=>Object.assign({},_,{params:Object.assign({},v,_.params),pathname:en([y,f.encodeLocation?f.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?y:en([y,f.encodeLocation?f.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),m,s,i,d);return l&&O?S.createElement(gs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...M},navigationType:"POP"}},O):O}function S0(){let n=M0(),l=l0(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.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:",n),m=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:f},"ErrorBoundary")," or"," ",S.createElement("code",{style:f},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},l),s?S.createElement("pre",{style:d},s):null,m)}var N0=S.createElement(S0,null),$x=class extends S.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=h0(n.digest);s&&(n=s)}let l=n!==void 0?S.createElement(xa.Provider,{value:this.props.routeContext},S.createElement(md.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?S.createElement(j0,{error:n},l):l}};$x.contextType=i0;var Uu=new WeakMap;function j0({children:n,error:l}){let{basename:s}=S.useContext(aa);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=m0(l.digest);if(i){let d=Uu.get(l);if(d)throw d;let f=Vx(i.location,s);if(Qx&&!Uu.get(l))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 Uu.set(l,m),m}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return n}function w0({routeContext:n,match:l,children:s}){let i=S.useContext(il);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),S.createElement(xa.Provider,{value:n},s)}function E0(n,l=[],s=null,i=null,d=null){if(n==null){if(!s)return null;if(s.errors)n=s.matches;else if(l.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let f=n,m=s?.errors;if(m!=null){let y=f.findIndex(p=>p.route.id&&m?.[p.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 x=!1,v=-1;if(s)for(let y=0;y<f.length;y++){let p=f[y];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(v=y),p.route.id){let{loaderData:j,errors:M}=s,N=p.route.loader&&!j.hasOwnProperty(p.route.id)&&(!M||M[p.route.id]===void 0);if(p.route.lazy||N){x=!0,v>=0?f=f.slice(0,v+1):f=[f[0]];break}}}let g=s&&i?(y,p)=>{i(y,{location:s.location,params:s.matches?.[0]?.params??{},unstable_pattern:s0(s.matches),errorInfo:p})}:void 0;return f.reduceRight((y,p,j)=>{let M,N=!1,w=null,R=null;s&&(M=m&&p.route.id?m[p.route.id]:void 0,w=p.route.errorElement||N0,x&&(v<0&&j===0?(Px("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,R=null):v===j&&(N=!0,R=p.route.hydrateFallbackElement||null)));let O=l.concat(f.slice(0,j+1)),_=()=>{let Y;return M?Y=w:N?Y=R:p.route.Component?Y=S.createElement(p.route.Component,null):p.route.element?Y=p.route.element:Y=y,S.createElement(w0,{match:p,routeContext:{outlet:y,matches:O,isDataRoute:s!=null},children:Y})};return s&&(p.route.ErrorBoundary||p.route.errorElement||j===0)?S.createElement($x,{location:s.location,revalidation:s.revalidation,component:w,error:M,children:_(),routeContext:{outlet:null,matches:O,isDataRoute:!0},onError:g}):_()},null)}function hd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function T0(n){let l=S.useContext(il);return Pe(l,hd(n)),l}function R0(n){let l=S.useContext(ii);return Pe(l,hd(n)),l}function C0(n){let l=S.useContext(xa);return Pe(l,hd(n)),l}function pd(n){let l=C0(n),s=l.matches[l.matches.length-1];return Pe(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function _0(){return pd("useRouteId")}function M0(){let n=S.useContext(md),l=R0("useRouteError"),s=pd("useRouteError");return n!==void 0?n:l.errors?.[s]}function A0(){let{router:n}=T0("useNavigate"),l=pd("useNavigate"),s=S.useRef(!1);return Zx(()=>{s.current=!0}),S.useCallback(async(d,f={})=>{ja(s.current,Kx),s.current&&(typeof d=="number"?await n.navigate(d):await n.navigate(d,{fromRouteId:l,...f}))},[n,l])}var Vp={};function Px(n,l,s){!l&&!Vp[n]&&(Vp[n]=!0,ja(!1,s))}S.memo(k0);function k0({routes:n,future:l,state:s,onError:i}){return Jx(n,void 0,s,i,l)}function ai({to:n,replace:l,state:s,relative:i}){Pe(cl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=S.useContext(aa);ja(!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}=S.useContext(xa),{pathname:m}=kn(),x=wa(),v=fd(n,dd(f),m,i==="path"),g=JSON.stringify(v);return S.useEffect(()=>{x(JSON.parse(g),{replace:l,state:s,relative:i})},[x,g,i,l,s]),null}function O0(n){return v0(n.context)}function bt(n){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 z0({basename:n="/",children:l=null,location:s,navigationType:i="POP",navigator:d,static:f=!1,unstable_useTransitions:m}){Pe(!cl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=n.replace(/^\/*/,"/"),v=S.useMemo(()=>({basename:x,navigator:d,static:f,unstable_useTransitions:m,future:{}}),[x,d,f,m]);typeof s=="string"&&(s=ol(s));let{pathname:g="/",search:y="",hash:p="",state:j=null,key:M="default"}=s,N=S.useMemo(()=>{let w=tn(g,x);return w==null?null:{location:{pathname:w,search:y,hash:p,state:j,key:M},navigationType:i}},[x,g,y,p,j,M,i]);return ja(N!=null,`<Router basename="${x}"> is not able to match the URL "${g}${y}${p}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:S.createElement(aa.Provider,{value:v},S.createElement(gs.Provider,{children:l,value:N}))}function D0({children:n,location:l}){return b0(Ju(n),l)}function Ju(n,l=[]){let s=[];return S.Children.forEach(n,(i,d)=>{if(!S.isValidElement(i))return;let f=[...l,d];if(i.type===S.Fragment){s.push.apply(s,Ju(i.props.children,f));return}Pe(i.type===bt,`[${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=Ju(i.props.children,f)),s.push(m)}),s}var Zo="get",Jo="application/x-www-form-urlencoded";function ci(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function U0(n){return ci(n)&&n.tagName.toLowerCase()==="button"}function L0(n){return ci(n)&&n.tagName.toLowerCase()==="form"}function B0(n){return ci(n)&&n.tagName.toLowerCase()==="input"}function q0(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function H0(n,l){return n.button===0&&(!l||l==="_self")&&!q0(n)}var qo=null;function G0(){if(qo===null)try{new FormData(document.createElement("form"),0),qo=!1}catch{qo=!0}return qo}var Q0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Lu(n){return n!=null&&!Q0.has(n)?(ja(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jo}"`),null):n}function V0(n,l){let s,i,d,f,m;if(L0(n)){let x=n.getAttribute("action");i=x?tn(x,l):null,s=n.getAttribute("method")||Zo,d=Lu(n.getAttribute("enctype"))||Jo,f=new FormData(n)}else if(U0(n)||B0(n)&&(n.type==="submit"||n.type==="image")){let x=n.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let v=n.getAttribute("formaction")||x.getAttribute("action");if(i=v?tn(v,l):null,s=n.getAttribute("formmethod")||x.getAttribute("method")||Zo,d=Lu(n.getAttribute("formenctype"))||Lu(x.getAttribute("enctype"))||Jo,f=new FormData(x,n),!G0()){let{name:g,type:y,value:p}=n;if(y==="image"){let j=g?`${g}.`:"";f.append(`${j}x`,"0"),f.append(`${j}y`,"0")}else g&&f.append(g,p)}}else{if(ci(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Zo,i=null,d=Jo,m=n}return f&&d==="text/plain"&&(m=f,f=void 0),{action:i,method:s.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xd(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Y0(n,l,s,i){let d=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${i}`:d.pathname=`${d.pathname}.${i}`:d.pathname==="/"?d.pathname=`_root.${i}`:l&&tn(d.pathname,l)==="/"?d.pathname=`${l.replace(/\/$/,"")}/_root.${i}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${i}`,d}async function F0(n,l){if(n.id in l)return l[n.id];try{let s=await import(n.module);return l[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function X0(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function K0(n,l,s){let i=await Promise.all(n.map(async d=>{let f=l.routes[d.route.id];if(f){let m=await F0(f,s);return m.links?m.links():[]}return[]}));return P0(i.flat(1).filter(X0).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Yp(n,l,s,i,d,f){let m=(v,g)=>s[g]?v.route.id!==s[g].route.id:!0,x=(v,g)=>s[g].pathname!==v.pathname||s[g].route.path?.endsWith("*")&&s[g].params["*"]!==v.params["*"];return f==="assets"?l.filter((v,g)=>m(v,g)||x(v,g)):f==="data"?l.filter((v,g)=>{let y=i.routes[v.route.id];if(!y||!y.hasLoader)return!1;if(m(v,g)||x(v,g))return!0;if(v.route.shouldRevalidate){let p=v.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:v.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function Z0(n,l,{includeHydrateFallback:s}={}){return J0(n.map(i=>{let d=l.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)),s&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function J0(n){return[...new Set(n)]}function $0(n){let l={},s=Object.keys(n).sort();for(let i of s)l[i]=n[i];return l}function P0(n,l){let s=new Set;return new Set(l),n.reduce((i,d)=>{let f=JSON.stringify($0(d));return s.has(f)||(s.add(f),i.push({key:f,link:d})),i},[])}function Ix(){let n=S.useContext(il);return xd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function I0(){let n=S.useContext(ii);return xd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var gd=S.createContext(void 0);gd.displayName="FrameworkContext";function Wx(){let n=S.useContext(gd);return xd(n,"You must render this element inside a <HydratedRouter> element"),n}function W0(n,l){let s=S.useContext(gd),[i,d]=S.useState(!1),[f,m]=S.useState(!1),{onFocus:x,onBlur:v,onMouseEnter:g,onMouseLeave:y,onTouchStart:p}=l,j=S.useRef(null);S.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let w=O=>{O.forEach(_=>{m(_.isIntersecting)})},R=new IntersectionObserver(w,{threshold:.5});return j.current&&R.observe(j.current),()=>{R.disconnect()}}},[n]),S.useEffect(()=>{if(i){let w=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(w)}}},[i]);let M=()=>{d(!0)},N=()=>{d(!1),m(!1)};return s?n!=="intent"?[f,j,{}]:[f,j,{onFocus:us(x,M),onBlur:us(v,N),onMouseEnter:us(g,M),onMouseLeave:us(y,N),onTouchStart:us(p,M)}]:[!1,j,{}]}function us(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function e1({page:n,...l}){let{router:s}=Ix(),i=S.useMemo(()=>qx(s.routes,n,s.basename),[s.routes,n,s.basename]);return i?S.createElement(a1,{page:n,matches:i,...l}):null}function t1(n){let{manifest:l,routeModules:s}=Wx(),[i,d]=S.useState([]);return S.useEffect(()=>{let f=!1;return K0(n,l,s).then(m=>{f||d(m)}),()=>{f=!0}},[n,l,s]),i}function a1({page:n,matches:l,...s}){let i=kn(),{future:d,manifest:f,routeModules:m}=Wx(),{basename:x}=Ix(),{loaderData:v,matches:g}=I0(),y=S.useMemo(()=>Yp(n,l,g,f,i,"data"),[n,l,g,f,i]),p=S.useMemo(()=>Yp(n,l,g,f,i,"assets"),[n,l,g,f,i]),j=S.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let w=new Set,R=!1;if(l.forEach(_=>{let Y=f.routes[_.route.id];!Y||!Y.hasLoader||(!y.some(L=>L.route.id===_.route.id)&&_.route.id in v&&m[_.route.id]?.shouldRevalidate||Y.hasClientLoader?R=!0:w.add(_.route.id))}),w.size===0)return[];let O=Y0(n,x,d.unstable_trailingSlashAwareDataRequests,"data");return R&&w.size>0&&O.searchParams.set("_routes",l.filter(_=>w.has(_.route.id)).map(_=>_.route.id).join(",")),[O.pathname+O.search]},[x,d.unstable_trailingSlashAwareDataRequests,v,i,f,y,l,n,m]),M=S.useMemo(()=>Z0(p,f),[p,f]),N=t1(p);return S.createElement(S.Fragment,null,j.map(w=>S.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...s})),M.map(w=>S.createElement("link",{key:w,rel:"modulepreload",href:w,...s})),N.map(({key:w,link:R})=>S.createElement("link",{key:w,nonce:s.nonce,...R,crossOrigin:R.crossOrigin??s.crossOrigin})))}function n1(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var r1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{r1&&(window.__reactRouterVersion="7.13.0")}catch{}function l1({basename:n,children:l,unstable_useTransitions:s,window:i}){let d=S.useRef();d.current==null&&(d.current=Db({window:i,v5Compat:!0}));let f=d.current,[m,x]=S.useState({action:f.action,location:f.location}),v=S.useCallback(g=>{s===!1?x(g):S.startTransition(()=>x(g))},[s]);return S.useLayoutEffect(()=>f.listen(v),[f,v]),S.createElement(z0,{basename:n,children:l,location:m.location,navigationType:m.action,navigator:f,unstable_useTransitions:s})}var eg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vd=S.forwardRef(function({onClick:l,discover:s="render",prefetch:i="none",relative:d,reloadDocument:f,replace:m,state:x,target:v,to:g,preventScrollReset:y,viewTransition:p,unstable_defaultShouldRevalidate:j,...M},N){let{basename:w,unstable_useTransitions:R}=S.useContext(aa),O=typeof g=="string"&&eg.test(g),_=Vx(g,w);g=_.to;let Y=p0(g,{relative:d}),[L,$,F]=W0(i,M),W=i1(g,{replace:m,state:x,target:v,preventScrollReset:y,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:j,unstable_useTransitions:R});function ee(le){l&&l(le),le.defaultPrevented||W(le)}let te=S.createElement("a",{...M,...F,href:_.absoluteURL||Y,onClick:_.isExternal||f?l:ee,ref:n1(N,$),target:v,"data-discover":!O&&s==="render"?"true":void 0});return L&&!O?S.createElement(S.Fragment,null,te,S.createElement(e1,{page:Y})):te});vd.displayName="Link";var tg=S.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:i="",end:d=!1,style:f,to:m,viewTransition:x,children:v,...g},y){let p=vs(m,{relative:g.relative}),j=kn(),M=S.useContext(ii),{navigator:N,basename:w}=S.useContext(aa),R=M!=null&&m1(p)&&x===!0,O=N.encodeLocation?N.encodeLocation(p).pathname:p.pathname,_=j.pathname,Y=M&&M.navigation&&M.navigation.location?M.navigation.location.pathname:null;s||(_=_.toLowerCase(),Y=Y?Y.toLowerCase():null,O=O.toLowerCase()),Y&&w&&(Y=tn(Y,w)||Y);const L=O!=="/"&&O.endsWith("/")?O.length-1:O.length;let $=_===O||!d&&_.startsWith(O)&&_.charAt(L)==="/",F=Y!=null&&(Y===O||!d&&Y.startsWith(O)&&Y.charAt(O.length)==="/"),W={isActive:$,isPending:F,isTransitioning:R},ee=$?l:void 0,te;typeof i=="function"?te=i(W):te=[i,$?"active":null,F?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let le=typeof f=="function"?f(W):f;return S.createElement(vd,{...g,"aria-current":ee,className:te,ref:y,style:le,to:m,viewTransition:x},typeof v=="function"?v(W):v)});tg.displayName="NavLink";var s1=S.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:i,replace:d,state:f,method:m=Zo,action:x,onSubmit:v,relative:g,preventScrollReset:y,viewTransition:p,unstable_defaultShouldRevalidate:j,...M},N)=>{let{unstable_useTransitions:w}=S.useContext(aa),R=d1(),O=f1(x,{relative:g}),_=m.toLowerCase()==="get"?"get":"post",Y=typeof x=="string"&&eg.test(x),L=$=>{if(v&&v($),$.defaultPrevented)return;$.preventDefault();let F=$.nativeEvent.submitter,W=F?.getAttribute("formmethod")||m,ee=()=>R(F||$.currentTarget,{fetcherKey:l,method:W,navigate:s,replace:d,state:f,relative:g,preventScrollReset:y,viewTransition:p,unstable_defaultShouldRevalidate:j});w&&s!==!1?S.startTransition(()=>ee()):ee()};return S.createElement("form",{ref:N,method:_,action:O,onSubmit:i?v:L,...M,"data-discover":!Y&&n==="render"?"true":void 0})});s1.displayName="Form";function o1(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ag(n){let l=S.useContext(il);return Pe(l,o1(n)),l}function i1(n,{target:l,replace:s,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:x,unstable_useTransitions:v}={}){let g=wa(),y=kn(),p=vs(n,{relative:f});return S.useCallback(j=>{if(H0(j,l)){j.preventDefault();let M=s!==void 0?s:ps(y)===ps(p),N=()=>g(n,{replace:M,state:i,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:x});v?S.startTransition(()=>N()):N()}},[y,g,p,s,i,l,n,d,f,m,x,v])}var c1=0,u1=()=>`__${String(++c1)}__`;function d1(){let{router:n}=ag("useSubmit"),{basename:l}=S.useContext(aa),s=_0(),i=n.fetch,d=n.navigate;return S.useCallback(async(f,m={})=>{let{action:x,method:v,encType:g,formData:y,body:p}=V0(f,l);if(m.navigate===!1){let j=m.fetcherKey||u1();await i(j,s,m.action||x,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:p,formMethod:m.method||v,formEncType:m.encType||g,flushSync:m.flushSync})}else await d(m.action||x,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:p,formMethod:m.method||v,formEncType:m.encType||g,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,d,l,s])}function f1(n,{relative:l}={}){let{basename:s}=S.useContext(aa),i=S.useContext(xa);Pe(i,"useFormAction must be used inside a RouteContext");let[d]=i.matches.slice(-1),f={...vs(n||".",{relative:l})},m=kn();if(n==null){f.search=m.search;let x=new URLSearchParams(f.search),v=x.getAll("index");if(v.some(y=>y==="")){x.delete("index"),v.filter(p=>p).forEach(p=>x.append("index",p));let y=x.toString();f.search=y?`?${y}`:""}}return(!n||n===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(f.pathname=f.pathname==="/"?s:en([s,f.pathname])),ps(f)}function m1(n,{relative:l}={}){let s=S.useContext(Fx);Pe(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=ag("useViewTransitionState"),d=vs(n,{relative:l});if(!s.isTransitioning)return!1;let f=tn(s.currentLocation.pathname,i)||s.currentLocation.pathname,m=tn(s.nextLocation.pathname,i)||s.nextLocation.pathname;return ti(d.pathname,m)!=null||ti(d.pathname,f)!=null}var h1=Bx();const p1=Lx(h1);var ul=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},x1={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)},g1=class{#e=x1;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,l){return this.#e.setTimeout(n,l)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,l){return this.#e.setInterval(n,l)}clearInterval(n){this.#e.clearInterval(n)}},rr=new g1;function v1(n){setTimeout(n,0)}var or=typeof window>"u"||"Deno"in globalThis;function Mt(){}function y1(n,l){return typeof n=="function"?n(l):n}function $u(n){return typeof n=="number"&&n>=0&&n!==1/0}function ng(n,l){return Math.max(n+(l||0)-Date.now(),0)}function An(n,l){return typeof n=="function"?n(l):n}function ha(n,l){return typeof n=="function"?n(l):n}function Fp(n,l){const{type:s="all",exact:i,fetchStatus:d,predicate:f,queryKey:m,stale:x}=n;if(m){if(i){if(l.queryHash!==yd(m,l.options))return!1}else if(!xs(l.queryKey,m))return!1}if(s!=="all"){const v=l.isActive();if(s==="active"&&!v||s==="inactive"&&v)return!1}return!(typeof x=="boolean"&&l.isStale()!==x||d&&d!==l.state.fetchStatus||f&&!f(l))}function Xp(n,l){const{exact:s,status:i,predicate:d,mutationKey:f}=n;if(f){if(!l.options.mutationKey)return!1;if(s){if(ir(l.options.mutationKey)!==ir(f))return!1}else if(!xs(l.options.mutationKey,f))return!1}return!(i&&l.state.status!==i||d&&!d(l))}function yd(n,l){return(l?.queryKeyHashFn||ir)(n)}function ir(n){return JSON.stringify(n,(l,s)=>Pu(s)?Object.keys(s).sort().reduce((i,d)=>(i[d]=s[d],i),{}):s)}function xs(n,l){return n===l?!0:typeof n!=typeof l?!1:n&&l&&typeof n=="object"&&typeof l=="object"?Object.keys(l).every(s=>xs(n[s],l[s])):!1}var b1=Object.prototype.hasOwnProperty;function rg(n,l,s=0){if(n===l)return n;if(s>500)return l;const i=Kp(n)&&Kp(l);if(!i&&!(Pu(n)&&Pu(l)))return l;const f=(i?n:Object.keys(n)).length,m=i?l:Object.keys(l),x=m.length,v=i?new Array(x):{};let g=0;for(let y=0;y<x;y++){const p=i?y:m[y],j=n[p],M=l[p];if(j===M){v[p]=j,(i?y<f:b1.call(n,p))&&g++;continue}if(j===null||M===null||typeof j!="object"||typeof M!="object"){v[p]=M;continue}const N=rg(j,M,s+1);v[p]=N,N===j&&g++}return f===x&&g===f?n:v}function ni(n,l){if(!l||Object.keys(n).length!==Object.keys(l).length)return!1;for(const s in n)if(n[s]!==l[s])return!1;return!0}function Kp(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Pu(n){if(!Zp(n))return!1;const l=n.constructor;if(l===void 0)return!0;const s=l.prototype;return!(!Zp(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function Zp(n){return Object.prototype.toString.call(n)==="[object Object]"}function S1(n){return new Promise(l=>{rr.setTimeout(l,n)})}function Iu(n,l,s){return typeof s.structuralSharing=="function"?s.structuralSharing(n,l):s.structuralSharing!==!1?rg(n,l):l}function N1(n,l,s=0){const i=[...n,l];return s&&i.length>s?i.slice(1):i}function j1(n,l,s=0){const i=[l,...n];return s&&i.length>s?i.slice(0,-1):i}var bd=Symbol();function lg(n,l){return!n.queryFn&&l?.initialPromise?()=>l.initialPromise:!n.queryFn||n.queryFn===bd?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Sd(n,l){return typeof n=="function"?n(...l):!!n}function w1(n,l,s){let i=!1,d;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(d??=l(),i||(i=!0,d.aborted?s():d.addEventListener("abort",s,{once:!0})),d)}),n}var E1=class extends ul{#e;#t;#a;constructor(){super(),this.#a=n=>{if(!or&&window.addEventListener){const l=()=>n();return window.addEventListener("visibilitychange",l,!1),()=>{window.removeEventListener("visibilitychange",l)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#a=n,this.#t?.(),this.#t=n(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(l=>{l(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Nd=new E1;function Wu(){let n,l;const s=new Promise((d,f)=>{n=d,l=f});s.status="pending",s.catch(()=>{});function i(d){Object.assign(s,d),delete s.resolve,delete s.reject}return s.resolve=d=>{i({status:"fulfilled",value:d}),n(d)},s.reject=d=>{i({status:"rejected",reason:d}),l(d)},s}var T1=v1;function R1(){let n=[],l=0,s=x=>{x()},i=x=>{x()},d=T1;const f=x=>{l?n.push(x):d(()=>{s(x)})},m=()=>{const x=n;n=[],x.length&&d(()=>{i(()=>{x.forEach(v=>{s(v)})})})};return{batch:x=>{let v;l++;try{v=x()}finally{l--,l||m()}return v},batchCalls:x=>(...v)=>{f(()=>{x(...v)})},schedule:f,setNotifyFunction:x=>{s=x},setBatchNotifyFunction:x=>{i=x},setScheduler:x=>{d=x}}}var dt=R1(),C1=class extends ul{#e=!0;#t;#a;constructor(){super(),this.#a=n=>{if(!or&&window.addEventListener){const l=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",l,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",l),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#a=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(s=>{s(n)}))}isOnline(){return this.#e}},ri=new C1;function _1(n){return Math.min(1e3*2**n,3e4)}function sg(n){return(n??"online")==="online"?ri.isOnline():!0}var ed=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function og(n){let l=!1,s=0,i;const d=Wu(),f=()=>d.status!=="pending",m=w=>{if(!f()){const R=new ed(w);j(R),n.onCancel?.(R)}},x=()=>{l=!0},v=()=>{l=!1},g=()=>Nd.isFocused()&&(n.networkMode==="always"||ri.isOnline())&&n.canRun(),y=()=>sg(n.networkMode)&&n.canRun(),p=w=>{f()||(i?.(),d.resolve(w))},j=w=>{f()||(i?.(),d.reject(w))},M=()=>new Promise(w=>{i=R=>{(f()||g())&&w(R)},n.onPause?.()}).then(()=>{i=void 0,f()||n.onContinue?.()}),N=()=>{if(f())return;let w;const R=s===0?n.initialPromise:void 0;try{w=R??n.fn()}catch(O){w=Promise.reject(O)}Promise.resolve(w).then(p).catch(O=>{if(f())return;const _=n.retry??(or?0:3),Y=n.retryDelay??_1,L=typeof Y=="function"?Y(s,O):Y,$=_===!0||typeof _=="number"&&s<_||typeof _=="function"&&_(s,O);if(l||!$){j(O);return}s++,n.onFail?.(s,O),S1(L).then(()=>g()?void 0:M()).then(()=>{l?j(O):N()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(i?.(),d),cancelRetry:x,continueRetry:v,canStart:y,start:()=>(y()?N():M().then(N),d)}}var ig=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$u(this.gcTime)&&(this.#e=rr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(or?1/0:300*1e3))}clearGcTimeout(){this.#e&&(rr.clearTimeout(this.#e),this.#e=void 0)}},M1=class extends ig{#e;#t;#a;#r;#n;#s;#o;constructor(n){super(),this.#o=!1,this.#s=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#r=n.client,this.#a=this.#r.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#e=$p(this.options),this.state=n.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(n){if(this.options={...this.#s,...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const l=$p(this.options);l.data!==void 0&&(this.setState(Jp(l.data,l.dataUpdatedAt)),this.#e=l)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(n,l){const s=Iu(this.state.data,n,this.options);return this.#l({data:s,type:"success",dataUpdatedAt:l?.updatedAt,manual:l?.manual}),s}setState(n,l){this.#l({type:"setState",state:n,setStateOptions:l})}cancel(n){const l=this.#n?.promise;return this.#n?.cancel(n),l?l.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(n=>ha(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>An(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!ng(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(l=>l.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(l=>l.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(l=>l!==n),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:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(n,l){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&l?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(n&&this.setOptions(n),!this.options.queryFn){const x=this.observers.find(v=>v.options.queryFn);x&&this.setOptions(x.options)}const s=new AbortController,i=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},d=()=>{const x=lg(this.options,l),g=(()=>{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(x,g,this):x(g)},m=(()=>{const x={fetchOptions:l,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:d};return i(x),x})();this.options.behavior?.onFetch(m,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#l({type:"fetch",meta:m.fetchOptions?.meta}),this.#n=og({initialPromise:l?.initialPromise,fn:m.fetchFn,onCancel:x=>{x instanceof ed&&x.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(x,v)=>{this.#l({type:"failed",failureCount:x,error:v})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const x=await this.#n.start();if(x===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(x),this.#a.config.onSuccess?.(x,this),this.#a.config.onSettled?.(x,this.state.error,this),x}catch(x){if(x instanceof ed){if(x.silent)return this.#n.promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw this.#l({type:"error",error:x}),this.#a.config.onError?.(x,this),this.#a.config.onSettled?.(this.state.data,x,this),x}finally{this.scheduleGc()}}#l(n){const l=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...cg(s.data,this.options),fetchMeta:n.meta??null};case"success":const i={...s,...Jp(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=n.manual?i:void 0,i;case"error":const d=n.error;return{...s,error:d,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=l(this.state),dt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:n})})}};function cg(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sg(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Jp(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function $p(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,s=l!==void 0,i=s?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var A1=class extends ul{constructor(n,l){super(),this.options=l,this.#e=n,this.#l=null,this.#o=Wu(),this.bindMethods(),this.setOptions(l)}#e;#t=void 0;#a=void 0;#r=void 0;#n;#s;#o;#l;#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),Pp(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return td(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return td(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(n){const l=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ha(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#N(),this.#t.setOptions(this.options),l._defaulted&&!ni(this.options,l)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&Ip(this.#t,s,this.options,l)&&this.#d(),this.updateResult(),i&&(this.#t!==s||ha(this.options.enabled,this.#t)!==ha(l.enabled,this.#t)||An(this.options.staleTime,this.#t)!==An(l.staleTime,this.#t))&&this.#x();const d=this.#g();i&&(this.#t!==s||ha(this.options.enabled,this.#t)!==ha(l.enabled,this.#t)||d!==this.#i)&&this.#v(d)}getOptimisticResult(n){const l=this.#e.getQueryCache().build(this.#e,n),s=this.createResult(l,n);return O1(this,s)&&(this.#r=s,this.#s=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#r}trackResult(n,l){return new Proxy(n,{get:(s,i)=>(this.trackProp(i),l?.(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(s,i))})}trackProp(n){this.#h.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const l=this.#e.defaultQueryOptions(n),s=this.#e.getQueryCache().build(this.#e,l);return s.fetch().then(()=>this.createResult(s,l))}fetch(n){return this.#d({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(n){this.#N();let l=this.#t.fetch(this.options,n);return n?.throwOnError||(l=l.catch(Mt)),l}#x(){this.#b();const n=An(this.options.staleTime,this.#t);if(or||this.#r.isStale||!$u(n))return;const s=ng(this.#r.dataUpdatedAt,n)+1;this.#c=rr.setTimeout(()=>{this.#r.isStale||this.updateResult()},s)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(n){this.#S(),this.#i=n,!(or||ha(this.options.enabled,this.#t)===!1||!$u(this.#i)||this.#i===0)&&(this.#u=rr.setInterval(()=>{(this.options.refetchIntervalInBackground||Nd.isFocused())&&this.#d()},this.#i))}#y(){this.#x(),this.#v(this.#g())}#b(){this.#c&&(rr.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(rr.clearInterval(this.#u),this.#u=void 0)}createResult(n,l){const s=this.#t,i=this.options,d=this.#r,f=this.#n,m=this.#s,v=n!==s?n.state:this.#a,{state:g}=n;let y={...g},p=!1,j;if(l._optimisticResults){const ee=this.hasListeners(),te=!ee&&Pp(n,l),le=ee&&Ip(n,s,l,i);(te||le)&&(y={...y,...cg(g.data,n.options)}),l._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:M,errorUpdatedAt:N,status:w}=y;j=y.data;let R=!1;if(l.placeholderData!==void 0&&j===void 0&&w==="pending"){let ee;d?.isPlaceholderData&&l.placeholderData===m?.placeholderData?(ee=d.data,R=!0):ee=typeof l.placeholderData=="function"?l.placeholderData(this.#m?.state.data,this.#m):l.placeholderData,ee!==void 0&&(w="success",j=Iu(d?.data,ee,l),p=!0)}if(l.select&&j!==void 0&&!R)if(d&&j===f?.data&&l.select===this.#p)j=this.#f;else try{this.#p=l.select,j=l.select(j),j=Iu(d?.data,j,l),this.#f=j,this.#l=null}catch(ee){this.#l=ee}this.#l&&(M=this.#l,j=this.#f,N=Date.now(),w="error");const O=y.fetchStatus==="fetching",_=w==="pending",Y=w==="error",L=_&&O,$=j!==void 0,W={status:w,fetchStatus:y.fetchStatus,isPending:_,isSuccess:w==="success",isError:Y,isInitialLoading:L,isLoading:L,data:j,dataUpdatedAt:y.dataUpdatedAt,error:M,errorUpdatedAt:N,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>v.dataUpdateCount||y.errorUpdateCount>v.errorUpdateCount,isFetching:O,isRefetching:O&&!_,isLoadingError:Y&&!$,isPaused:y.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:Y&&$,isStale:jd(n,l),refetch:this.refetch,promise:this.#o,isEnabled:ha(l.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const ee=W.data!==void 0,te=W.status==="error"&&!ee,le=Ee=>{te?Ee.reject(W.error):ee&&Ee.resolve(W.data)},oe=()=>{const Ee=this.#o=W.promise=Wu();le(Ee)},fe=this.#o;switch(fe.status){case"pending":n.queryHash===s.queryHash&&le(fe);break;case"fulfilled":(te||W.data!==fe.value)&&oe();break;case"rejected":(!te||W.error!==fe.reason)&&oe();break}}return W}updateResult(){const n=this.#r,l=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#s=this.options,this.#n.data!==void 0&&(this.#m=this.#t),ni(l,n))return;this.#r=l;const s=()=>{if(!n)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 x=m;return this.#r[x]!==n[x]&&f.has(x)})};this.#j({listeners:s()})}#N(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const l=this.#t;this.#t=n,this.#a=n.state,this.hasListeners()&&(l?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#j(n){dt.batch(()=>{n.listeners&&this.listeners.forEach(l=>{l(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function k1(n,l){return ha(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&l.retryOnMount===!1)}function Pp(n,l){return k1(n,l)||n.state.data!==void 0&&td(n,l,l.refetchOnMount)}function td(n,l,s){if(ha(l.enabled,n)!==!1&&An(l.staleTime,n)!=="static"){const i=typeof s=="function"?s(n):s;return i==="always"||i!==!1&&jd(n,l)}return!1}function Ip(n,l,s,i){return(n!==l||ha(i.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&jd(n,s)}function jd(n,l){return ha(l.enabled,n)!==!1&&n.isStaleByTime(An(l.staleTime,n))}function O1(n,l){return!ni(n.getCurrentResult(),l)}function Wp(n){return{onFetch:(l,s)=>{const i=l.options,d=l.fetchOptions?.meta?.fetchMore?.direction,f=l.state.data?.pages||[],m=l.state.data?.pageParams||[];let x={pages:[],pageParams:[]},v=0;const g=async()=>{let y=!1;const p=N=>{w1(N,()=>l.signal,()=>y=!0)},j=lg(l.options,l.fetchOptions),M=async(N,w,R)=>{if(y)return Promise.reject();if(w==null&&N.pages.length)return Promise.resolve(N);const _=(()=>{const F={client:l.client,queryKey:l.queryKey,pageParam:w,direction:R?"backward":"forward",meta:l.options.meta};return p(F),F})(),Y=await j(_),{maxPages:L}=l.options,$=R?j1:N1;return{pages:$(N.pages,Y,L),pageParams:$(N.pageParams,w,L)}};if(d&&f.length){const N=d==="backward",w=N?z1:ex,R={pages:f,pageParams:m},O=w(i,R);x=await M(R,O,N)}else{const N=n??f.length;do{const w=v===0?m[0]??i.initialPageParam:ex(i,x);if(v>0&&w==null)break;x=await M(x,w),v++}while(v<N)}return x};l.options.persister?l.fetchFn=()=>l.options.persister?.(g,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},s):l.fetchFn=g}}}function ex(n,{pages:l,pageParams:s}){const i=l.length-1;return l.length>0?n.getNextPageParam(l[i],l,s[i],s):void 0}function z1(n,{pages:l,pageParams:s}){return l.length>0?n.getPreviousPageParam?.(l[0],l,s[0],s):void 0}var D1=class extends ig{#e;#t;#a;#r;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#a=n.mutationCache,this.#t=[],this.state=n.state||ug(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(l=>l!==n),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:n})}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(n){const l=()=>{this.#n({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=og({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(f,m)=>{this.#n({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#n({type:"pause"})},onContinue:l,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)l();else{this.#n({type:"pending",variables:n,isPaused:d}),this.#a.config.onMutate&&await this.#a.config.onMutate(n,this,s);const m=await this.options.onMutate?.(n,s);m!==this.state.context&&this.#n({type:"pending",context:m,variables:n,isPaused:d})}const f=await this.#r.start();return await this.#a.config.onSuccess?.(f,n,this.state.context,this,s),await this.options.onSuccess?.(f,n,this.state.context,s),await this.#a.config.onSettled?.(f,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(f,null,n,this.state.context,s),this.#n({type:"success",data:f}),f}catch(f){try{await this.#a.config.onError?.(f,n,this.state.context,this,s)}catch(m){Promise.reject(m)}try{await this.options.onError?.(f,n,this.state.context,s)}catch(m){Promise.reject(m)}try{await this.#a.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,s)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,f,n,this.state.context,s)}catch(m){Promise.reject(m)}throw this.#n({type:"error",error:f}),f}finally{this.#a.runNext(this)}}#n(n){const l=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=l(this.state),dt.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(n)}),this.#a.notify({mutation:this,type:"updated",action:n})})}};function ug(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var U1=class extends ul{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#a=0}#e;#t;#a;build(n,l,s){const i=new D1({client:n,mutationCache:this,mutationId:++this.#a,options:n.defaultMutationOptions(l),state:s});return this.add(i),i}add(n){this.#e.add(n);const l=Ho(n);if(typeof l=="string"){const s=this.#t.get(l);s?s.push(n):this.#t.set(l,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const l=Ho(n);if(typeof l=="string"){const s=this.#t.get(l);if(s)if(s.length>1){const i=s.indexOf(n);i!==-1&&s.splice(i,1)}else s[0]===n&&this.#t.delete(l)}}this.notify({type:"removed",mutation:n})}canRun(n){const l=Ho(n);if(typeof l=="string"){const i=this.#t.get(l)?.find(d=>d.state.status==="pending");return!i||i===n}else return!0}runNext(n){const l=Ho(n);return typeof l=="string"?this.#t.get(l)?.find(i=>i!==n&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){dt.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const l={exact:!0,...n};return this.getAll().find(s=>Xp(l,s))}findAll(n={}){return this.getAll().filter(l=>Xp(n,l))}notify(n){dt.batch(()=>{this.listeners.forEach(l=>{l(n)})})}resumePausedMutations(){const n=this.getAll().filter(l=>l.state.isPaused);return dt.batch(()=>Promise.all(n.map(l=>l.continue().catch(Mt))))}};function Ho(n){return n.options.scope?.id}var L1=class extends ul{#e;#t=void 0;#a;#r;constructor(l,s){super(),this.#e=l,this.setOptions(s),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(l){const s=this.options;this.options=this.#e.defaultMutationOptions(l),ni(this.options,s)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),s?.mutationKey&&this.options.mutationKey&&ir(s.mutationKey)!==ir(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(l){this.#n(),this.#s(l)}getCurrentResult(){return this.#t}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#n(),this.#s()}mutate(l,s){return this.#r=s,this.#a?.removeObserver(this),this.#a=this.#e.getMutationCache().build(this.#e,this.options),this.#a.addObserver(this),this.#a.execute(l)}#n(){const l=this.#a?.state??ug();this.#t={...l,isPending:l.status==="pending",isSuccess:l.status==="success",isError:l.status==="error",isIdle:l.status==="idle",mutate:this.mutate,reset:this.reset}}#s(l){dt.batch(()=>{if(this.#r&&this.hasListeners()){const s=this.#t.variables,i=this.#t.context,d={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(l?.type==="success"){try{this.#r.onSuccess?.(l.data,s,i,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(l.data,null,s,i,d)}catch(f){Promise.reject(f)}}else if(l?.type==="error"){try{this.#r.onError?.(l.error,s,i,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(void 0,l.error,s,i,d)}catch(f){Promise.reject(f)}}}this.listeners.forEach(s=>{s(this.#t)})})}},B1=class extends ul{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,l,s){const i=l.queryKey,d=l.queryHash??yd(i,l);let f=this.get(d);return f||(f=new M1({client:n,queryKey:i,queryHash:d,options:n.defaultQueryOptions(l),state:s,defaultOptions:n.getQueryDefaults(i)}),this.add(f)),f}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const l=this.#e.get(n.queryHash);l&&(n.destroy(),l===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){dt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const l={exact:!0,...n};return this.getAll().find(s=>Fp(l,s))}findAll(n={}){const l=this.getAll();return Object.keys(n).length>0?l.filter(s=>Fp(n,s)):l}notify(n){dt.batch(()=>{this.listeners.forEach(l=>{l(n)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},q1=class{#e;#t;#a;#r;#n;#s;#o;#l;constructor(n={}){this.#e=n.queryCache||new B1,this.#t=n.mutationCache||new U1,this.#a=n.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=Nd.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=ri.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const l=this.defaultQueryOptions({queryKey:n});return this.#e.get(l.queryHash)?.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),s=this.#e.build(this,l),i=s.state.data;return i===void 0?this.fetchQuery(n):(n.revalidateIfStale&&s.isStaleByTime(An(l.staleTime,s))&&this.prefetchQuery(l),Promise.resolve(i))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:l,state:s})=>{const i=s.data;return[l,i]})}setQueryData(n,l,s){const i=this.defaultQueryOptions({queryKey:n}),f=this.#e.get(i.queryHash)?.state.data,m=y1(l,f);if(m!==void 0)return this.#e.build(this,i).setData(m,{...s,manual:!0})}setQueriesData(n,l,s){return dt.batch(()=>this.#e.findAll(n).map(({queryKey:i})=>[i,this.setQueryData(i,l,s)]))}getQueryState(n){const l=this.defaultQueryOptions({queryKey:n});return this.#e.get(l.queryHash)?.state}removeQueries(n){const l=this.#e;dt.batch(()=>{l.findAll(n).forEach(s=>{l.remove(s)})})}resetQueries(n,l){const s=this.#e;return dt.batch(()=>(s.findAll(n).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...n},l)))}cancelQueries(n,l={}){const s={revert:!0,...l},i=dt.batch(()=>this.#e.findAll(n).map(d=>d.cancel(s)));return Promise.all(i).then(Mt).catch(Mt)}invalidateQueries(n,l={}){return dt.batch(()=>(this.#e.findAll(n).forEach(s=>{s.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},l)))}refetchQueries(n,l={}){const s={...l,cancelRefetch:l.cancelRefetch??!0},i=dt.batch(()=>this.#e.findAll(n).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,s);return s.throwOnError||(f=f.catch(Mt)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(i).then(Mt)}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const s=this.#e.build(this,l);return s.isStaleByTime(An(l.staleTime,s))?s.fetch(l):Promise.resolve(s.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Mt).catch(Mt)}fetchInfiniteQuery(n){return n.behavior=Wp(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Mt).catch(Mt)}ensureInfiniteQueryData(n){return n.behavior=Wp(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return ri.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#a}setDefaultOptions(n){this.#a=n}setQueryDefaults(n,l){this.#r.set(ir(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...this.#r.values()],s={};return l.forEach(i=>{xs(n,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(n,l){this.#n.set(ir(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...this.#n.values()],s={};return l.forEach(i=>{xs(n,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(n){if(n._defaulted)return n;const l={...this.#a.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=yd(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===bd&&(l.enabled=!1),l}defaultMutationOptions(n){return n?._defaulted?n:{...this.#a.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},dg=S.createContext(void 0),kt=n=>{const l=S.useContext(dg);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},H1=({client:n,children:l})=>(S.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),o.jsx(dg.Provider,{value:n,children:l})),fg=S.createContext(!1),G1=()=>S.useContext(fg);fg.Provider;function Q1(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var V1=S.createContext(Q1()),Y1=()=>S.useContext(V1),F1=(n,l,s)=>{const i=s?.state.error&&typeof n.throwOnError=="function"?Sd(n.throwOnError,[s.state.error,s]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||i)&&(l.isReset()||(n.retryOnMount=!1))},X1=n=>{S.useEffect(()=>{n.clearReset()},[n])},K1=({result:n,errorResetBoundary:l,throwOnError:s,query:i,suspense:d})=>n.isError&&!l.isReset()&&!n.isFetching&&i&&(d&&n.data===void 0||Sd(s,[n.error,i])),Z1=n=>{if(n.suspense){const s=d=>d==="static"?d:Math.max(d??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...d)=>s(i(...d)):s(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},J1=(n,l)=>n.isLoading&&n.isFetching&&!l,$1=(n,l)=>n?.suspense&&l.isPending,tx=(n,l,s)=>l.fetchOptimistic(n).catch(()=>{s.clearReset()});function P1(n,l,s){const i=G1(),d=Y1(),f=kt(),m=f.defaultQueryOptions(n);f.getDefaultOptions().queries?._experimental_beforeQuery?.(m);const x=f.getQueryCache().get(m.queryHash);m._optimisticResults=i?"isRestoring":"optimistic",Z1(m),F1(m,d,x),X1(d);const v=!f.getQueryCache().get(m.queryHash),[g]=S.useState(()=>new l(f,m)),y=g.getOptimisticResult(m),p=!i&&n.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(j=>{const M=p?g.subscribe(dt.batchCalls(j)):Mt;return g.updateResult(),M},[g,p]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),S.useEffect(()=>{g.setOptions(m)},[m,g]),$1(m,y))throw tx(m,g,d);if(K1({result:y,errorResetBoundary:d,throwOnError:m.throwOnError,query:x,suspense:m.suspense}))throw y.error;return f.getDefaultOptions().queries?._experimental_afterQuery?.(m,y),m.experimental_prefetchInRender&&!or&&J1(y,i)&&(v?tx(m,g,d):x?.promise)?.catch(Mt).finally(()=>{g.updateResult()}),m.notifyOnChangeProps?y:g.trackResult(y)}function na(n,l){return P1(n,A1)}function Xt(n,l){const s=kt(),[i]=S.useState(()=>new L1(s,n));S.useEffect(()=>{i.setOptions(n)},[i,n]);const d=S.useSyncExternalStore(S.useCallback(m=>i.subscribe(dt.batchCalls(m)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),f=S.useCallback((m,x)=>{i.mutate(m,x).catch(Mt)},[i]);if(d.error&&Sd(i.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}function I1(n){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",l.appendChild(s),s.styleSheet?s.styleSheet.cssText=n:s.appendChild(document.createTextNode(n))}const W1=n=>{switch(n){case"success":return a2;case"info":return r2;case"warning":return n2;case"error":return l2;default:return null}},e2=Array(12).fill(0),t2=({visible:n,className:l})=>ne.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":n},ne.createElement("div",{className:"sonner-spinner"},e2.map((s,i)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),a2=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),n2=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.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"})),r2=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),l2=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),s2=ne.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"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),o2=()=>{const[n,l]=ne.useState(document.hidden);return ne.useEffect(()=>{const s=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),n};let ad=1;class i2{constructor(){this.subscribe=l=>(this.subscribers.push(l),()=>{const s=this.subscribers.indexOf(l);this.subscribers.splice(s,1)}),this.publish=l=>{this.subscribers.forEach(s=>s(l))},this.addToast=l=>{this.publish(l),this.toasts=[...this.toasts,l]},this.create=l=>{var s;const{message:i,...d}=l,f=typeof l?.id=="number"||((s=l.id)==null?void 0:s.length)>0?l.id:ad++,m=this.toasts.find(v=>v.id===f),x=l.dismissible===void 0?!0:l.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),m?this.toasts=this.toasts.map(v=>v.id===f?(this.publish({...v,...l,id:f,title:i}),{...v,...l,id:f,dismissible:x,title:i}):v):this.addToast({title:i,...d,dismissible:x,id:f}),f},this.dismiss=l=>(l?(this.dismissedToasts.add(l),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:l,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(i=>i({id:s.id,dismiss:!0}))}),l),this.message=(l,s)=>this.create({...s,message:l}),this.error=(l,s)=>this.create({...s,message:l,type:"error"}),this.success=(l,s)=>this.create({...s,type:"success",message:l}),this.info=(l,s)=>this.create({...s,type:"info",message:l}),this.warning=(l,s)=>this.create({...s,type:"warning",message:l}),this.loading=(l,s)=>this.create({...s,type:"loading",message:l}),this.promise=(l,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:l,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const d=Promise.resolve(l instanceof Function?l():l);let f=i!==void 0,m;const x=d.then(async g=>{if(m=["resolve",g],ne.isValidElement(g))f=!1,this.create({id:i,type:"default",message:g});else if(u2(g)&&!g.ok){f=!1;const p=typeof s.error=="function"?await s.error(`HTTP error! status: ${g.status}`):s.error,j=typeof s.description=="function"?await s.description(`HTTP error! status: ${g.status}`):s.description,N=typeof p=="object"&&!ne.isValidElement(p)?p:{message:p};this.create({id:i,type:"error",description:j,...N})}else if(g instanceof Error){f=!1;const p=typeof s.error=="function"?await s.error(g):s.error,j=typeof s.description=="function"?await s.description(g):s.description,N=typeof p=="object"&&!ne.isValidElement(p)?p:{message:p};this.create({id:i,type:"error",description:j,...N})}else if(s.success!==void 0){f=!1;const p=typeof s.success=="function"?await s.success(g):s.success,j=typeof s.description=="function"?await s.description(g):s.description,N=typeof p=="object"&&!ne.isValidElement(p)?p:{message:p};this.create({id:i,type:"success",description:j,...N})}}).catch(async g=>{if(m=["reject",g],s.error!==void 0){f=!1;const y=typeof s.error=="function"?await s.error(g):s.error,p=typeof s.description=="function"?await s.description(g):s.description,M=typeof y=="object"&&!ne.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:p,...M})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),s.finally==null||s.finally.call(s)}),v=()=>new Promise((g,y)=>x.then(()=>m[0]==="reject"?y(m[1]):g(m[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:v}:Object.assign(i,{unwrap:v})},this.custom=(l,s)=>{const i=s?.id||ad++;return this.create({jsx:l(i),id:i,...s}),i},this.getActiveToasts=()=>this.toasts.filter(l=>!this.dismissedToasts.has(l.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Vt=new i2,c2=(n,l)=>{const s=l?.id||ad++;return Vt.addToast({title:n,...l,id:s}),s},u2=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",d2=c2,f2=()=>Vt.toasts,m2=()=>Vt.getActiveToasts(),Ue=Object.assign(d2,{success:Vt.success,info:Vt.info,warning:Vt.warning,error:Vt.error,custom:Vt.custom,message:Vt.message,promise:Vt.promise,dismiss:Vt.dismiss,loading:Vt.loading},{getHistory:f2,getToasts:m2});I1("[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 Go(n){return n.label!==void 0}const h2=3,p2="24px",x2="16px",ax=4e3,g2=356,v2=14,y2=45,b2=200;function ka(...n){return n.filter(Boolean).join(" ")}function S2(n){const[l,s]=n.split("-"),i=[];return l&&i.push(l),s&&i.push(s),i}const N2=n=>{var l,s,i,d,f,m,x,v,g;const{invert:y,toast:p,unstyled:j,interacting:M,setHeights:N,visibleToasts:w,heights:R,index:O,toasts:_,expanded:Y,removeToast:L,defaultRichColors:$,closeButton:F,style:W,cancelButtonStyle:ee,actionButtonStyle:te,className:le="",descriptionClassName:oe="",duration:fe,position:Ee,gap:ge,expandByDefault:Le,classNames:k,icons:P,closeButtonAriaLabel:Z="Close toast"}=n,[ve,pe]=ne.useState(null),[T,Q]=ne.useState(null),[V,I]=ne.useState(!1),[B,ie]=ne.useState(!1),[se,ye]=ne.useState(!1),[q,ae]=ne.useState(!1),[Ce,Me]=ne.useState(!1),[ga,it]=ne.useState(0),[On,dr]=ne.useState(0),zn=ne.useRef(p.duration||fe||ax),hl=ne.useRef(null),Kt=ne.useRef(null),pl=O===0,xl=O+1<=w,Tt=p.type,an=p.dismissible!==!1,Rt=p.className||"",gi=p.descriptionClassName||"",Dn=ne.useMemo(()=>R.findIndex(Se=>Se.toastId===p.id)||0,[R,p.id]),ws=ne.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:F},[p.closeButton,F]),Un=ne.useMemo(()=>p.duration||fe||ax,[p.duration,fe]),gl=ne.useRef(0),za=ne.useRef(0),Es=ne.useRef(0),nn=ne.useRef(null),[Ln,Ct]=Ee.split("-"),va=ne.useMemo(()=>R.reduce((Se,Je,ft)=>ft>=Dn?Se:Se+Je.height,0),[R,Dn]),Nt=o2(),vi=p.invert||y,vl=Tt==="loading";za.current=ne.useMemo(()=>Dn*ge+va,[Dn,va]),ne.useEffect(()=>{zn.current=Un},[Un]),ne.useEffect(()=>{I(!0)},[]),ne.useEffect(()=>{const Se=Kt.current;if(Se){const Je=Se.getBoundingClientRect().height;return dr(Je),N(ft=>[{toastId:p.id,height:Je,position:p.position},...ft]),()=>N(ft=>ft.filter(jt=>jt.toastId!==p.id))}},[N,p.id]),ne.useLayoutEffect(()=>{if(!V)return;const Se=Kt.current,Je=Se.style.height;Se.style.height="auto";const ft=Se.getBoundingClientRect().height;Se.style.height=Je,dr(ft),N(jt=>jt.find(Ie=>Ie.toastId===p.id)?jt.map(Ie=>Ie.toastId===p.id?{...Ie,height:ft}:Ie):[{toastId:p.id,height:ft,position:p.position},...jt])},[V,p.title,p.description,N,p.id,p.jsx,p.action,p.cancel]);const Ta=ne.useCallback(()=>{ie(!0),it(za.current),N(Se=>Se.filter(Je=>Je.toastId!==p.id)),setTimeout(()=>{L(p)},b2)},[p,L,N,za]);ne.useEffect(()=>{if(p.promise&&Tt==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return Y||M||Nt?(()=>{if(Es.current<gl.current){const jt=new Date().getTime()-gl.current;zn.current=zn.current-jt}Es.current=new Date().getTime()})():zn.current!==1/0&&(gl.current=new Date().getTime(),Se=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Ta()},zn.current)),()=>clearTimeout(Se)},[Y,M,p,Tt,Nt,Ta]),ne.useEffect(()=>{p.delete&&(Ta(),p.onDismiss==null||p.onDismiss.call(p,p))},[Ta,p.delete]);function fr(){var Se;if(P?.loading){var Je;return ne.createElement("div",{className:ka(k?.loader,p==null||(Je=p.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":Tt==="loading"},P.loading)}return ne.createElement(t2,{className:ka(k?.loader,p==null||(Se=p.classNames)==null?void 0:Se.loader),visible:Tt==="loading"})}const mr=p.icon||P?.[Tt]||W1(Tt);var Bn,Ra;return ne.createElement("li",{tabIndex:0,ref:Kt,className:ka(le,Rt,k?.toast,p==null||(l=p.classNames)==null?void 0:l.toast,k?.default,k?.[Tt],p==null||(s=p.classNames)==null?void 0:s[Tt]),"data-sonner-toast":"","data-rich-colors":(Bn=p.richColors)!=null?Bn:$,"data-styled":!(p.jsx||p.unstyled||j),"data-mounted":V,"data-promise":!!p.promise,"data-swiped":Ce,"data-removed":B,"data-visible":xl,"data-y-position":Ln,"data-x-position":Ct,"data-index":O,"data-front":pl,"data-swiping":se,"data-dismissible":an,"data-type":Tt,"data-invert":vi,"data-swipe-out":q,"data-swipe-direction":T,"data-expanded":!!(Y||Le&&V),"data-testid":p.testId,style:{"--index":O,"--toasts-before":O,"--z-index":_.length-O,"--offset":`${B?ga:za.current}px`,"--initial-height":Le?"auto":`${On}px`,...W,...p.style},onDragEnd:()=>{ye(!1),pe(null),nn.current=null},onPointerDown:Se=>{Se.button!==2&&(vl||!an||(hl.current=new Date,it(za.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(ye(!0),nn.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,Je,ft;if(q||!an)return;nn.current=null;const jt=Number(((Se=Kt.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),rn=Number(((Je=Kt.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ie=new Date().getTime()-((ft=hl.current)==null?void 0:ft.getTime()),Ot=ve==="x"?jt:rn,qn=Math.abs(Ot)/Ie;if(Math.abs(Ot)>=y2||qn>.11){it(za.current),p.onDismiss==null||p.onDismiss.call(p,p),Q(ve==="x"?jt>0?"right":"left":rn>0?"down":"up"),Ta(),ae(!0);return}else{var zt,Dt;(zt=Kt.current)==null||zt.style.setProperty("--swipe-amount-x","0px"),(Dt=Kt.current)==null||Dt.style.setProperty("--swipe-amount-y","0px")}Me(!1),ye(!1),pe(null)},onPointerMove:Se=>{var Je,ft,jt;if(!nn.current||!an||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const Ie=Se.clientY-nn.current.y,Ot=Se.clientX-nn.current.x;var qn;const zt=(qn=n.swipeDirections)!=null?qn:S2(Ee);!ve&&(Math.abs(Ot)>1||Math.abs(Ie)>1)&&pe(Math.abs(Ot)>Math.abs(Ie)?"x":"y");let Dt={x:0,y:0};const hr=ya=>1/(1.5+Math.abs(ya)/20);if(ve==="y"){if(zt.includes("top")||zt.includes("bottom"))if(zt.includes("top")&&Ie<0||zt.includes("bottom")&&Ie>0)Dt.y=Ie;else{const ya=Ie*hr(Ie);Dt.y=Math.abs(ya)<Math.abs(Ie)?ya:Ie}}else if(ve==="x"&&(zt.includes("left")||zt.includes("right")))if(zt.includes("left")&&Ot<0||zt.includes("right")&&Ot>0)Dt.x=Ot;else{const ya=Ot*hr(Ot);Dt.x=Math.abs(ya)<Math.abs(Ot)?ya:Ot}(Math.abs(Dt.x)>0||Math.abs(Dt.y)>0)&&Me(!0),(ft=Kt.current)==null||ft.style.setProperty("--swipe-amount-x",`${Dt.x}px`),(jt=Kt.current)==null||jt.style.setProperty("--swipe-amount-y",`${Dt.y}px`)}},ws&&!p.jsx&&Tt!=="loading"?ne.createElement("button",{"aria-label":Z,"data-disabled":vl,"data-close-button":!0,onClick:vl||!an?()=>{}:()=>{Ta(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ka(k?.closeButton,p==null||(i=p.classNames)==null?void 0:i.closeButton)},(Ra=P?.close)!=null?Ra:s2):null,(Tt||p.icon||p.promise)&&p.icon!==null&&(P?.[Tt]!==null||p.icon)?ne.createElement("div",{"data-icon":"",className:ka(k?.icon,p==null||(d=p.classNames)==null?void 0:d.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||fr():null,p.type!=="loading"?mr:null):null,ne.createElement("div",{"data-content":"",className:ka(k?.content,p==null||(f=p.classNames)==null?void 0:f.content)},ne.createElement("div",{"data-title":"",className:ka(k?.title,p==null||(m=p.classNames)==null?void 0:m.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ne.createElement("div",{"data-description":"",className:ka(oe,gi,k?.description,p==null||(x=p.classNames)==null?void 0:x.description)},typeof p.description=="function"?p.description():p.description):null),ne.isValidElement(p.cancel)?p.cancel:p.cancel&&Go(p.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||ee,onClick:Se=>{Go(p.cancel)&&an&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Se),Ta())},className:ka(k?.cancelButton,p==null||(v=p.classNames)==null?void 0:v.cancelButton)},p.cancel.label):null,ne.isValidElement(p.action)?p.action:p.action&&Go(p.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||te,onClick:Se=>{Go(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Se),!Se.defaultPrevented&&Ta())},className:ka(k?.actionButton,p==null||(g=p.classNames)==null?void 0:g.actionButton)},p.action.label):null)};function nx(){if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function j2(n,l){const s={};return[n,l].forEach((i,d)=>{const f=d===1,m=f?"--mobile-offset":"--offset",x=f?x2:p2;function v(g){["top","right","bottom","left"].forEach(y=>{s[`${m}-${y}`]=typeof g=="number"?`${g}px`:g})}typeof i=="number"||typeof i=="string"?v(i):typeof i=="object"?["top","right","bottom","left"].forEach(g=>{i[g]===void 0?s[`${m}-${g}`]=x:s[`${m}-${g}`]=typeof i[g]=="number"?`${i[g]}px`:i[g]}):v(x)}),s}const w2=ne.forwardRef(function(l,s){const{id:i,invert:d,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:x,closeButton:v,className:g,offset:y,mobileOffset:p,theme:j="light",richColors:M,duration:N,style:w,visibleToasts:R=h2,toastOptions:O,dir:_=nx(),gap:Y=v2,icons:L,containerAriaLabel:$="Notifications"}=l,[F,W]=ne.useState([]),ee=ne.useMemo(()=>i?F.filter(V=>V.toasterId===i):F.filter(V=>!V.toasterId),[F,i]),te=ne.useMemo(()=>Array.from(new Set([f].concat(ee.filter(V=>V.position).map(V=>V.position)))),[ee,f]),[le,oe]=ne.useState([]),[fe,Ee]=ne.useState(!1),[ge,Le]=ne.useState(!1),[k,P]=ne.useState(j!=="system"?j:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=ne.useRef(null),ve=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),pe=ne.useRef(null),T=ne.useRef(!1),Q=ne.useCallback(V=>{W(I=>{var B;return(B=I.find(ie=>ie.id===V.id))!=null&&B.delete||Vt.dismiss(V.id),I.filter(({id:ie})=>ie!==V.id)})},[]);return ne.useEffect(()=>Vt.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{W(I=>I.map(B=>B.id===V.id?{...B,delete:!0}:B))});return}setTimeout(()=>{p1.flushSync(()=>{W(I=>{const B=I.findIndex(ie=>ie.id===V.id);return B!==-1?[...I.slice(0,B),{...I[B],...V},...I.slice(B+1)]:[V,...I]})})})}),[F]),ne.useEffect(()=>{if(j!=="system"){P(j);return}if(j==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:I})=>{P(I?"dark":"light")})}catch{V.addListener(({matches:B})=>{try{P(B?"dark":"light")}catch(ie){console.error(ie)}})}},[j]),ne.useEffect(()=>{F.length<=1&&Ee(!1)},[F]),ne.useEffect(()=>{const V=I=>{var B;if(m.every(ye=>I[ye]||I.code===ye)){var se;Ee(!0),(se=Z.current)==null||se.focus()}I.code==="Escape"&&(document.activeElement===Z.current||(B=Z.current)!=null&&B.contains(document.activeElement))&&Ee(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[m]),ne.useEffect(()=>{if(Z.current)return()=>{pe.current&&(pe.current.focus({preventScroll:!0}),pe.current=null,T.current=!1)}},[Z.current]),ne.createElement("section",{ref:s,"aria-label":`${$} ${ve}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},te.map((V,I)=>{var B;const[ie,se]=V.split("-");return ee.length?ne.createElement("ol",{key:V,dir:_==="auto"?nx():_,tabIndex:-1,ref:Z,className:g,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":ie,"data-x-position":se,style:{"--front-toast-height":`${((B=le[0])==null?void 0:B.height)||0}px`,"--width":`${g2}px`,"--gap":`${Y}px`,...w,...j2(y,p)},onBlur:ye=>{T.current&&!ye.currentTarget.contains(ye.relatedTarget)&&(T.current=!1,pe.current&&(pe.current.focus({preventScroll:!0}),pe.current=null))},onFocus:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||T.current||(T.current=!0,pe.current=ye.relatedTarget)},onMouseEnter:()=>Ee(!0),onMouseMove:()=>Ee(!0),onMouseLeave:()=>{ge||Ee(!1)},onDragEnd:()=>Ee(!1),onPointerDown:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||Le(!0)},onPointerUp:()=>Le(!1)},ee.filter(ye=>!ye.position&&I===0||ye.position===V).map((ye,q)=>{var ae,Ce;return ne.createElement(N2,{key:ye.id,icons:L,index:q,toast:ye,defaultRichColors:M,duration:(ae=O?.duration)!=null?ae:N,className:O?.className,descriptionClassName:O?.descriptionClassName,invert:d,visibleToasts:R,closeButton:(Ce=O?.closeButton)!=null?Ce:v,interacting:ge,position:V,style:O?.style,unstyled:O?.unstyled,classNames:O?.classNames,cancelButtonStyle:O?.cancelButtonStyle,actionButtonStyle:O?.actionButtonStyle,closeButtonAriaLabel:O?.closeButtonAriaLabel,removeToast:Q,toasts:ee.filter(Me=>Me.position==ye.position),heights:le.filter(Me=>Me.position==ye.position),setHeights:oe,expandByDefault:x,gap:Y,expanded:fe,swipeDirections:l.swipeDirections})})):null}))}),mg=S.createContext(void 0),hg="jarvis-admin-theme";function E2(){const n=localStorage.getItem(hg);return n==="light"||n==="dark"?n:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function T2({children:n}){const[l,s]=S.useState(E2);S.useEffect(()=>{document.documentElement.classList.toggle("dark",l==="dark"),localStorage.setItem(hg,l)},[l]);const i=S.useCallback(()=>{s(d=>d==="dark"?"light":"dark")},[]);return o.jsx(mg.Provider,{value:{theme:l,toggleTheme:i},children:n})}function R2(){const n=S.useContext(mg);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}function pg(n,l){return function(){return n.apply(l,arguments)}}const{toString:C2}=Object.prototype,{getPrototypeOf:wd}=Object,{iterator:ui,toStringTag:xg}=Symbol,di=(n=>l=>{const s=C2.call(l);return n[s]||(n[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Ea=n=>(n=n.toLowerCase(),l=>di(l)===n),fi=n=>l=>typeof l===n,{isArray:dl}=Array,rl=fi("undefined");function ys(n){return n!==null&&!rl(n)&&n.constructor!==null&&!rl(n.constructor)&&Yt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const gg=Ea("ArrayBuffer");function _2(n){let l;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?l=ArrayBuffer.isView(n):l=n&&n.buffer&&gg(n.buffer),l}const M2=fi("string"),Yt=fi("function"),vg=fi("number"),bs=n=>n!==null&&typeof n=="object",A2=n=>n===!0||n===!1,$o=n=>{if(di(n)!=="object")return!1;const l=wd(n);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(xg in n)&&!(ui in n)},k2=n=>{if(!bs(n)||ys(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},O2=Ea("Date"),z2=Ea("File"),D2=Ea("Blob"),U2=Ea("FileList"),L2=n=>bs(n)&&Yt(n.pipe),B2=n=>{let l;return n&&(typeof FormData=="function"&&n instanceof FormData||Yt(n.append)&&((l=di(n))==="formdata"||l==="object"&&Yt(n.toString)&&n.toString()==="[object FormData]"))},q2=Ea("URLSearchParams"),[H2,G2,Q2,V2]=["ReadableStream","Request","Response","Headers"].map(Ea),Y2=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ss(n,l,{allOwnKeys:s=!1}={}){if(n===null||typeof n>"u")return;let i,d;if(typeof n!="object"&&(n=[n]),dl(n))for(i=0,d=n.length;i<d;i++)l.call(null,n[i],i,n);else{if(ys(n))return;const f=s?Object.getOwnPropertyNames(n):Object.keys(n),m=f.length;let x;for(i=0;i<m;i++)x=f[i],l.call(null,n[x],x,n)}}function yg(n,l){if(ys(n))return null;l=l.toLowerCase();const s=Object.keys(n);let i=s.length,d;for(;i-- >0;)if(d=s[i],l===d.toLowerCase())return d;return null}const lr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bg=n=>!rl(n)&&n!==lr;function nd(){const{caseless:n,skipUndefined:l}=bg(this)&&this||{},s={},i=(d,f)=>{const m=n&&yg(s,f)||f;$o(s[m])&&$o(d)?s[m]=nd(s[m],d):$o(d)?s[m]=nd({},d):dl(d)?s[m]=d.slice():(!l||!rl(d))&&(s[m]=d)};for(let d=0,f=arguments.length;d<f;d++)arguments[d]&&Ss(arguments[d],i);return s}const F2=(n,l,s,{allOwnKeys:i}={})=>(Ss(l,(d,f)=>{s&&Yt(d)?Object.defineProperty(n,f,{value:pg(d,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,f,{value:d,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),n),X2=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),K2=(n,l,s,i)=>{n.prototype=Object.create(l.prototype,i),Object.defineProperty(n.prototype,"constructor",{value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{value:l.prototype}),s&&Object.assign(n.prototype,s)},Z2=(n,l,s,i)=>{let d,f,m;const x={};if(l=l||{},n==null)return l;do{for(d=Object.getOwnPropertyNames(n),f=d.length;f-- >0;)m=d[f],(!i||i(m,n,l))&&!x[m]&&(l[m]=n[m],x[m]=!0);n=s!==!1&&wd(n)}while(n&&(!s||s(n,l))&&n!==Object.prototype);return l},J2=(n,l,s)=>{n=String(n),(s===void 0||s>n.length)&&(s=n.length),s-=l.length;const i=n.indexOf(l,s);return i!==-1&&i===s},$2=n=>{if(!n)return null;if(dl(n))return n;let l=n.length;if(!vg(l))return null;const s=new Array(l);for(;l-- >0;)s[l]=n[l];return s},P2=(n=>l=>n&&l instanceof n)(typeof Uint8Array<"u"&&wd(Uint8Array)),I2=(n,l)=>{const i=(n&&n[ui]).call(n);let d;for(;(d=i.next())&&!d.done;){const f=d.value;l.call(n,f[0],f[1])}},W2=(n,l)=>{let s;const i=[];for(;(s=n.exec(l))!==null;)i.push(s);return i},eS=Ea("HTMLFormElement"),tS=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,d){return i.toUpperCase()+d}),rx=(({hasOwnProperty:n})=>(l,s)=>n.call(l,s))(Object.prototype),aS=Ea("RegExp"),Sg=(n,l)=>{const s=Object.getOwnPropertyDescriptors(n),i={};Ss(s,(d,f)=>{let m;(m=l(d,f,n))!==!1&&(i[f]=m||d)}),Object.defineProperties(n,i)},nS=n=>{Sg(n,(l,s)=>{if(Yt(n)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const i=n[s];if(Yt(i)){if(l.enumerable=!1,"writable"in l){l.writable=!1;return}l.set||(l.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},rS=(n,l)=>{const s={},i=d=>{d.forEach(f=>{s[f]=!0})};return dl(n)?i(n):i(String(n).split(l)),s},lS=()=>{},sS=(n,l)=>n!=null&&Number.isFinite(n=+n)?n:l;function oS(n){return!!(n&&Yt(n.append)&&n[xg]==="FormData"&&n[ui])}const iS=n=>{const l=new Array(10),s=(i,d)=>{if(bs(i)){if(l.indexOf(i)>=0)return;if(ys(i))return i;if(!("toJSON"in i)){l[d]=i;const f=dl(i)?[]:{};return Ss(i,(m,x)=>{const v=s(m,d+1);!rl(v)&&(f[x]=v)}),l[d]=void 0,f}}return i};return s(n,0)},cS=Ea("AsyncFunction"),uS=n=>n&&(bs(n)||Yt(n))&&Yt(n.then)&&Yt(n.catch),Ng=((n,l)=>n?setImmediate:l?((s,i)=>(lr.addEventListener("message",({source:d,data:f})=>{d===lr&&f===s&&i.length&&i.shift()()},!1),d=>{i.push(d),lr.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",Yt(lr.postMessage)),dS=typeof queueMicrotask<"u"?queueMicrotask.bind(lr):typeof process<"u"&&process.nextTick||Ng,fS=n=>n!=null&&Yt(n[ui]),G={isArray:dl,isArrayBuffer:gg,isBuffer:ys,isFormData:B2,isArrayBufferView:_2,isString:M2,isNumber:vg,isBoolean:A2,isObject:bs,isPlainObject:$o,isEmptyObject:k2,isReadableStream:H2,isRequest:G2,isResponse:Q2,isHeaders:V2,isUndefined:rl,isDate:O2,isFile:z2,isBlob:D2,isRegExp:aS,isFunction:Yt,isStream:L2,isURLSearchParams:q2,isTypedArray:P2,isFileList:U2,forEach:Ss,merge:nd,extend:F2,trim:Y2,stripBOM:X2,inherits:K2,toFlatObject:Z2,kindOf:di,kindOfTest:Ea,endsWith:J2,toArray:$2,forEachEntry:I2,matchAll:W2,isHTMLForm:eS,hasOwnProperty:rx,hasOwnProp:rx,reduceDescriptors:Sg,freezeMethods:nS,toObjectSet:rS,toCamelCase:tS,noop:lS,toFiniteNumber:sS,findKey:yg,global:lr,isContextDefined:bg,isSpecCompliantForm:oS,toJSONObject:iS,isAsyncFn:cS,isThenable:uS,setImmediate:Ng,asap:dS,isIterable:fS};let be=class jg extends Error{static from(l,s,i,d,f,m){const x=new jg(l.message,s||l.code,i,d,f);return x.cause=l,x.name=l.name,m&&Object.assign(x,m),x}constructor(l,s,i,d,f){super(l),this.name="AxiosError",this.isAxiosError=!0,s&&(this.code=s),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:G.toJSONObject(this.config),code:this.code,status:this.status}}};be.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";be.ERR_BAD_OPTION="ERR_BAD_OPTION";be.ECONNABORTED="ECONNABORTED";be.ETIMEDOUT="ETIMEDOUT";be.ERR_NETWORK="ERR_NETWORK";be.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";be.ERR_DEPRECATED="ERR_DEPRECATED";be.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";be.ERR_BAD_REQUEST="ERR_BAD_REQUEST";be.ERR_CANCELED="ERR_CANCELED";be.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";be.ERR_INVALID_URL="ERR_INVALID_URL";const mS=null;function rd(n){return G.isPlainObject(n)||G.isArray(n)}function wg(n){return G.endsWith(n,"[]")?n.slice(0,-2):n}function lx(n,l,s){return n?n.concat(l).map(function(d,f){return d=wg(d),!s&&f?"["+d+"]":d}).join(s?".":""):l}function hS(n){return G.isArray(n)&&!n.some(rd)}const pS=G.toFlatObject(G,{},null,function(l){return/^is[A-Z]/.test(l)});function mi(n,l,s){if(!G.isObject(n))throw new TypeError("target must be an object");l=l||new FormData,s=G.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,R){return!G.isUndefined(R[w])});const i=s.metaTokens,d=s.visitor||y,f=s.dots,m=s.indexes,v=(s.Blob||typeof Blob<"u"&&Blob)&&G.isSpecCompliantForm(l);if(!G.isFunction(d))throw new TypeError("visitor must be a function");function g(N){if(N===null)return"";if(G.isDate(N))return N.toISOString();if(G.isBoolean(N))return N.toString();if(!v&&G.isBlob(N))throw new be("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(N)||G.isTypedArray(N)?v&&typeof Blob=="function"?new Blob([N]):Buffer.from(N):N}function y(N,w,R){let O=N;if(N&&!R&&typeof N=="object"){if(G.endsWith(w,"{}"))w=i?w:w.slice(0,-2),N=JSON.stringify(N);else if(G.isArray(N)&&hS(N)||(G.isFileList(N)||G.endsWith(w,"[]"))&&(O=G.toArray(N)))return w=wg(w),O.forEach(function(Y,L){!(G.isUndefined(Y)||Y===null)&&l.append(m===!0?lx([w],L,f):m===null?w:w+"[]",g(Y))}),!1}return rd(N)?!0:(l.append(lx(R,w,f),g(N)),!1)}const p=[],j=Object.assign(pS,{defaultVisitor:y,convertValue:g,isVisitable:rd});function M(N,w){if(!G.isUndefined(N)){if(p.indexOf(N)!==-1)throw Error("Circular reference detected in "+w.join("."));p.push(N),G.forEach(N,function(O,_){(!(G.isUndefined(O)||O===null)&&d.call(l,O,G.isString(_)?_.trim():_,w,j))===!0&&M(O,w?w.concat(_):[_])}),p.pop()}}if(!G.isObject(n))throw new TypeError("data must be an object");return M(n),l}function sx(n){const l={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return l[i]})}function Ed(n,l){this._pairs=[],n&&mi(n,this,l)}const Eg=Ed.prototype;Eg.append=function(l,s){this._pairs.push([l,s])};Eg.toString=function(l){const s=l?function(i){return l.call(this,i,sx)}:sx;return this._pairs.map(function(d){return s(d[0])+"="+s(d[1])},"").join("&")};function xS(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Tg(n,l,s){if(!l)return n;const i=s&&s.encode||xS,d=G.isFunction(s)?{serialize:s}:s,f=d&&d.serialize;let m;if(f?m=f(l,d):m=G.isURLSearchParams(l)?l.toString():new Ed(l,d).toString(i),m){const x=n.indexOf("#");x!==-1&&(n=n.slice(0,x)),n+=(n.indexOf("?")===-1?"?":"&")+m}return n}class ox{constructor(){this.handlers=[]}use(l,s,i){return this.handlers.push({fulfilled:l,rejected:s,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(l){this.handlers[l]&&(this.handlers[l]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(l){G.forEach(this.handlers,function(i){i!==null&&l(i)})}}const Rg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gS=typeof URLSearchParams<"u"?URLSearchParams:Ed,vS=typeof FormData<"u"?FormData:null,yS=typeof Blob<"u"?Blob:null,bS={isBrowser:!0,classes:{URLSearchParams:gS,FormData:vS,Blob:yS},protocols:["http","https","file","blob","url","data"]},Td=typeof window<"u"&&typeof document<"u",ld=typeof navigator=="object"&&navigator||void 0,SS=Td&&(!ld||["ReactNative","NativeScript","NS"].indexOf(ld.product)<0),NS=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jS=Td&&window.location.href||"http://localhost",wS=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Td,hasStandardBrowserEnv:SS,hasStandardBrowserWebWorkerEnv:NS,navigator:ld,origin:jS},Symbol.toStringTag,{value:"Module"})),Et={...wS,...bS};function ES(n,l){return mi(n,new Et.classes.URLSearchParams,{visitor:function(s,i,d,f){return Et.isNode&&G.isBuffer(s)?(this.append(i,s.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...l})}function TS(n){return G.matchAll(/\w+|\[(\w*)]/g,n).map(l=>l[0]==="[]"?"":l[1]||l[0])}function RS(n){const l={},s=Object.keys(n);let i;const d=s.length;let f;for(i=0;i<d;i++)f=s[i],l[f]=n[f];return l}function Cg(n){function l(s,i,d,f){let m=s[f++];if(m==="__proto__")return!0;const x=Number.isFinite(+m),v=f>=s.length;return m=!m&&G.isArray(d)?d.length:m,v?(G.hasOwnProp(d,m)?d[m]=[d[m],i]:d[m]=i,!x):((!d[m]||!G.isObject(d[m]))&&(d[m]=[]),l(s,i,d[m],f)&&G.isArray(d[m])&&(d[m]=RS(d[m])),!x)}if(G.isFormData(n)&&G.isFunction(n.entries)){const s={};return G.forEachEntry(n,(i,d)=>{l(TS(i),d,s,0)}),s}return null}function CS(n,l,s){if(G.isString(n))try{return(l||JSON.parse)(n),G.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(s||JSON.stringify)(n)}const Ns={transitional:Rg,adapter:["xhr","http","fetch"],transformRequest:[function(l,s){const i=s.getContentType()||"",d=i.indexOf("application/json")>-1,f=G.isObject(l);if(f&&G.isHTMLForm(l)&&(l=new FormData(l)),G.isFormData(l))return d?JSON.stringify(Cg(l)):l;if(G.isArrayBuffer(l)||G.isBuffer(l)||G.isStream(l)||G.isFile(l)||G.isBlob(l)||G.isReadableStream(l))return l;if(G.isArrayBufferView(l))return l.buffer;if(G.isURLSearchParams(l))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),l.toString();let x;if(f){if(i.indexOf("application/x-www-form-urlencoded")>-1)return ES(l,this.formSerializer).toString();if((x=G.isFileList(l))||i.indexOf("multipart/form-data")>-1){const v=this.env&&this.env.FormData;return mi(x?{"files[]":l}:l,v&&new v,this.formSerializer)}}return f||d?(s.setContentType("application/json",!1),CS(l)):l}],transformResponse:[function(l){const s=this.transitional||Ns.transitional,i=s&&s.forcedJSONParsing,d=this.responseType==="json";if(G.isResponse(l)||G.isReadableStream(l))return l;if(l&&G.isString(l)&&(i&&!this.responseType||d)){const m=!(s&&s.silentJSONParsing)&&d;try{return JSON.parse(l,this.parseReviver)}catch(x){if(m)throw x.name==="SyntaxError"?be.from(x,be.ERR_BAD_RESPONSE,this,null,this.response):x}}return l}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Et.classes.FormData,Blob:Et.classes.Blob},validateStatus:function(l){return l>=200&&l<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],n=>{Ns.headers[n]={}});const _S=G.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"]),MS=n=>{const l={};let s,i,d;return n&&n.split(`
12
+ `).forEach(function(m){d=m.indexOf(":"),s=m.substring(0,d).trim().toLowerCase(),i=m.substring(d+1).trim(),!(!s||l[s]&&_S[s])&&(s==="set-cookie"?l[s]?l[s].push(i):l[s]=[i]:l[s]=l[s]?l[s]+", "+i:i)}),l},ix=Symbol("internals");function ds(n){return n&&String(n).trim().toLowerCase()}function Po(n){return n===!1||n==null?n:G.isArray(n)?n.map(Po):String(n)}function AS(n){const l=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=s.exec(n);)l[i[1]]=i[2];return l}const kS=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Bu(n,l,s,i,d){if(G.isFunction(i))return i.call(this,l,s);if(d&&(l=s),!!G.isString(l)){if(G.isString(i))return l.indexOf(i)!==-1;if(G.isRegExp(i))return i.test(l)}}function OS(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(l,s,i)=>s.toUpperCase()+i)}function zS(n,l){const s=G.toCamelCase(" "+l);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+s,{value:function(d,f,m){return this[i].call(this,l,d,f,m)},configurable:!0})})}let Ft=class{constructor(l){l&&this.set(l)}set(l,s,i){const d=this;function f(x,v,g){const y=ds(v);if(!y)throw new Error("header name must be a non-empty string");const p=G.findKey(d,y);(!p||d[p]===void 0||g===!0||g===void 0&&d[p]!==!1)&&(d[p||v]=Po(x))}const m=(x,v)=>G.forEach(x,(g,y)=>f(g,y,v));if(G.isPlainObject(l)||l instanceof this.constructor)m(l,s);else if(G.isString(l)&&(l=l.trim())&&!kS(l))m(MS(l),s);else if(G.isObject(l)&&G.isIterable(l)){let x={},v,g;for(const y of l){if(!G.isArray(y))throw TypeError("Object iterator must return a key-value pair");x[g=y[0]]=(v=x[g])?G.isArray(v)?[...v,y[1]]:[v,y[1]]:y[1]}m(x,s)}else l!=null&&f(s,l,i);return this}get(l,s){if(l=ds(l),l){const i=G.findKey(this,l);if(i){const d=this[i];if(!s)return d;if(s===!0)return AS(d);if(G.isFunction(s))return s.call(this,d,i);if(G.isRegExp(s))return s.exec(d);throw new TypeError("parser must be boolean|regexp|function")}}}has(l,s){if(l=ds(l),l){const i=G.findKey(this,l);return!!(i&&this[i]!==void 0&&(!s||Bu(this,this[i],i,s)))}return!1}delete(l,s){const i=this;let d=!1;function f(m){if(m=ds(m),m){const x=G.findKey(i,m);x&&(!s||Bu(i,i[x],x,s))&&(delete i[x],d=!0)}}return G.isArray(l)?l.forEach(f):f(l),d}clear(l){const s=Object.keys(this);let i=s.length,d=!1;for(;i--;){const f=s[i];(!l||Bu(this,this[f],f,l,!0))&&(delete this[f],d=!0)}return d}normalize(l){const s=this,i={};return G.forEach(this,(d,f)=>{const m=G.findKey(i,f);if(m){s[m]=Po(d),delete s[f];return}const x=l?OS(f):String(f).trim();x!==f&&delete s[f],s[x]=Po(d),i[x]=!0}),this}concat(...l){return this.constructor.concat(this,...l)}toJSON(l){const s=Object.create(null);return G.forEach(this,(i,d)=>{i!=null&&i!==!1&&(s[d]=l&&G.isArray(i)?i.join(", "):i)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([l,s])=>l+": "+s).join(`
13
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(l){return l instanceof this?l:new this(l)}static concat(l,...s){const i=new this(l);return s.forEach(d=>i.set(d)),i}static accessor(l){const i=(this[ix]=this[ix]={accessors:{}}).accessors,d=this.prototype;function f(m){const x=ds(m);i[x]||(zS(d,m),i[x]=!0)}return G.isArray(l)?l.forEach(f):f(l),this}};Ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);G.reduceDescriptors(Ft.prototype,({value:n},l)=>{let s=l[0].toUpperCase()+l.slice(1);return{get:()=>n,set(i){this[s]=i}}});G.freezeMethods(Ft);function qu(n,l){const s=this||Ns,i=l||s,d=Ft.from(i.headers);let f=i.data;return G.forEach(n,function(x){f=x.call(s,f,d.normalize(),l?l.status:void 0)}),d.normalize(),f}function _g(n){return!!(n&&n.__CANCEL__)}let js=class extends be{constructor(l,s,i){super(l??"canceled",be.ERR_CANCELED,s,i),this.name="CanceledError",this.__CANCEL__=!0}};function Mg(n,l,s){const i=s.config.validateStatus;!s.status||!i||i(s.status)?n(s):l(new be("Request failed with status code "+s.status,[be.ERR_BAD_REQUEST,be.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function DS(n){const l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return l&&l[1]||""}function US(n,l){n=n||10;const s=new Array(n),i=new Array(n);let d=0,f=0,m;return l=l!==void 0?l:1e3,function(v){const g=Date.now(),y=i[f];m||(m=g),s[d]=v,i[d]=g;let p=f,j=0;for(;p!==d;)j+=s[p++],p=p%n;if(d=(d+1)%n,d===f&&(f=(f+1)%n),g-m<l)return;const M=y&&g-y;return M?Math.round(j*1e3/M):void 0}}function LS(n,l){let s=0,i=1e3/l,d,f;const m=(g,y=Date.now())=>{s=y,d=null,f&&(clearTimeout(f),f=null),n(...g)};return[(...g)=>{const y=Date.now(),p=y-s;p>=i?m(g,y):(d=g,f||(f=setTimeout(()=>{f=null,m(d)},i-p)))},()=>d&&m(d)]}const li=(n,l,s=3)=>{let i=0;const d=US(50,250);return LS(f=>{const m=f.loaded,x=f.lengthComputable?f.total:void 0,v=m-i,g=d(v),y=m<=x;i=m;const p={loaded:m,total:x,progress:x?m/x:void 0,bytes:v,rate:g||void 0,estimated:g&&x&&y?(x-m)/g:void 0,event:f,lengthComputable:x!=null,[l?"download":"upload"]:!0};n(p)},s)},cx=(n,l)=>{const s=n!=null;return[i=>l[0]({lengthComputable:s,total:n,loaded:i}),l[1]]},ux=n=>(...l)=>G.asap(()=>n(...l)),BS=Et.hasStandardBrowserEnv?((n,l)=>s=>(s=new URL(s,Et.origin),n.protocol===s.protocol&&n.host===s.host&&(l||n.port===s.port)))(new URL(Et.origin),Et.navigator&&/(msie|trident)/i.test(Et.navigator.userAgent)):()=>!0,qS=Et.hasStandardBrowserEnv?{write(n,l,s,i,d,f,m){if(typeof document>"u")return;const x=[`${n}=${encodeURIComponent(l)}`];G.isNumber(s)&&x.push(`expires=${new Date(s).toUTCString()}`),G.isString(i)&&x.push(`path=${i}`),G.isString(d)&&x.push(`domain=${d}`),f===!0&&x.push("secure"),G.isString(m)&&x.push(`SameSite=${m}`),document.cookie=x.join("; ")},read(n){if(typeof document>"u")return null;const l=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)"));return l?decodeURIComponent(l[1]):null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function HS(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function GS(n,l){return l?n.replace(/\/?\/$/,"")+"/"+l.replace(/^\/+/,""):n}function Ag(n,l,s){let i=!HS(l);return n&&(i||s==!1)?GS(n,l):l}const dx=n=>n instanceof Ft?{...n}:n;function cr(n,l){l=l||{};const s={};function i(g,y,p,j){return G.isPlainObject(g)&&G.isPlainObject(y)?G.merge.call({caseless:j},g,y):G.isPlainObject(y)?G.merge({},y):G.isArray(y)?y.slice():y}function d(g,y,p,j){if(G.isUndefined(y)){if(!G.isUndefined(g))return i(void 0,g,p,j)}else return i(g,y,p,j)}function f(g,y){if(!G.isUndefined(y))return i(void 0,y)}function m(g,y){if(G.isUndefined(y)){if(!G.isUndefined(g))return i(void 0,g)}else return i(void 0,y)}function x(g,y,p){if(p in l)return i(g,y);if(p in n)return i(void 0,g)}const v={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:x,headers:(g,y,p)=>d(dx(g),dx(y),p,!0)};return G.forEach(Object.keys({...n,...l}),function(y){const p=v[y]||d,j=p(n[y],l[y],y);G.isUndefined(j)&&p!==x||(s[y]=j)}),s}const kg=n=>{const l=cr({},n);let{data:s,withXSRFToken:i,xsrfHeaderName:d,xsrfCookieName:f,headers:m,auth:x}=l;if(l.headers=m=Ft.from(m),l.url=Tg(Ag(l.baseURL,l.url,l.allowAbsoluteUrls),n.params,n.paramsSerializer),x&&m.set("Authorization","Basic "+btoa((x.username||"")+":"+(x.password?unescape(encodeURIComponent(x.password)):""))),G.isFormData(s)){if(Et.hasStandardBrowserEnv||Et.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(G.isFunction(s.getHeaders)){const v=s.getHeaders(),g=["content-type","content-length"];Object.entries(v).forEach(([y,p])=>{g.includes(y.toLowerCase())&&m.set(y,p)})}}if(Et.hasStandardBrowserEnv&&(i&&G.isFunction(i)&&(i=i(l)),i||i!==!1&&BS(l.url))){const v=d&&f&&qS.read(f);v&&m.set(d,v)}return l},QS=typeof XMLHttpRequest<"u",VS=QS&&function(n){return new Promise(function(s,i){const d=kg(n);let f=d.data;const m=Ft.from(d.headers).normalize();let{responseType:x,onUploadProgress:v,onDownloadProgress:g}=d,y,p,j,M,N;function w(){M&&M(),N&&N(),d.cancelToken&&d.cancelToken.unsubscribe(y),d.signal&&d.signal.removeEventListener("abort",y)}let R=new XMLHttpRequest;R.open(d.method.toUpperCase(),d.url,!0),R.timeout=d.timeout;function O(){if(!R)return;const Y=Ft.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),$={data:!x||x==="text"||x==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:Y,config:n,request:R};Mg(function(W){s(W),w()},function(W){i(W),w()},$),R=null}"onloadend"in R?R.onloadend=O:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.indexOf("file:")===0)||setTimeout(O)},R.onabort=function(){R&&(i(new be("Request aborted",be.ECONNABORTED,n,R)),R=null)},R.onerror=function(L){const $=L&&L.message?L.message:"Network Error",F=new be($,be.ERR_NETWORK,n,R);F.event=L||null,i(F),R=null},R.ontimeout=function(){let L=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded";const $=d.transitional||Rg;d.timeoutErrorMessage&&(L=d.timeoutErrorMessage),i(new be(L,$.clarifyTimeoutError?be.ETIMEDOUT:be.ECONNABORTED,n,R)),R=null},f===void 0&&m.setContentType(null),"setRequestHeader"in R&&G.forEach(m.toJSON(),function(L,$){R.setRequestHeader($,L)}),G.isUndefined(d.withCredentials)||(R.withCredentials=!!d.withCredentials),x&&x!=="json"&&(R.responseType=d.responseType),g&&([j,N]=li(g,!0),R.addEventListener("progress",j)),v&&R.upload&&([p,M]=li(v),R.upload.addEventListener("progress",p),R.upload.addEventListener("loadend",M)),(d.cancelToken||d.signal)&&(y=Y=>{R&&(i(!Y||Y.type?new js(null,n,R):Y),R.abort(),R=null)},d.cancelToken&&d.cancelToken.subscribe(y),d.signal&&(d.signal.aborted?y():d.signal.addEventListener("abort",y)));const _=DS(d.url);if(_&&Et.protocols.indexOf(_)===-1){i(new be("Unsupported protocol "+_+":",be.ERR_BAD_REQUEST,n));return}R.send(f||null)})},YS=(n,l)=>{const{length:s}=n=n?n.filter(Boolean):[];if(l||s){let i=new AbortController,d;const f=function(g){if(!d){d=!0,x();const y=g instanceof Error?g:this.reason;i.abort(y instanceof be?y:new js(y instanceof Error?y.message:y))}};let m=l&&setTimeout(()=>{m=null,f(new be(`timeout of ${l}ms exceeded`,be.ETIMEDOUT))},l);const x=()=>{n&&(m&&clearTimeout(m),m=null,n.forEach(g=>{g.unsubscribe?g.unsubscribe(f):g.removeEventListener("abort",f)}),n=null)};n.forEach(g=>g.addEventListener("abort",f));const{signal:v}=i;return v.unsubscribe=()=>G.asap(x),v}},FS=function*(n,l){let s=n.byteLength;if(s<l){yield n;return}let i=0,d;for(;i<s;)d=i+l,yield n.slice(i,d),i=d},XS=async function*(n,l){for await(const s of KS(n))yield*FS(s,l)},KS=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const l=n.getReader();try{for(;;){const{done:s,value:i}=await l.read();if(s)break;yield i}}finally{await l.cancel()}},fx=(n,l,s,i)=>{const d=XS(n,l);let f=0,m,x=v=>{m||(m=!0,i&&i(v))};return new ReadableStream({async pull(v){try{const{done:g,value:y}=await d.next();if(g){x(),v.close();return}let p=y.byteLength;if(s){let j=f+=p;s(j)}v.enqueue(new Uint8Array(y))}catch(g){throw x(g),g}},cancel(v){return x(v),d.return()}},{highWaterMark:2})},mx=64*1024,{isFunction:Qo}=G,ZS=(({Request:n,Response:l})=>({Request:n,Response:l}))(G.global),{ReadableStream:hx,TextEncoder:px}=G.global,xx=(n,...l)=>{try{return!!n(...l)}catch{return!1}},JS=n=>{n=G.merge.call({skipUndefined:!0},ZS,n);const{fetch:l,Request:s,Response:i}=n,d=l?Qo(l):typeof fetch=="function",f=Qo(s),m=Qo(i);if(!d)return!1;const x=d&&Qo(hx),v=d&&(typeof px=="function"?(N=>w=>N.encode(w))(new px):async N=>new Uint8Array(await new s(N).arrayBuffer())),g=f&&x&&xx(()=>{let N=!1;const w=new s(Et.origin,{body:new hx,method:"POST",get duplex(){return N=!0,"half"}}).headers.has("Content-Type");return N&&!w}),y=m&&x&&xx(()=>G.isReadableStream(new i("").body)),p={stream:y&&(N=>N.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(N=>{!p[N]&&(p[N]=(w,R)=>{let O=w&&w[N];if(O)return O.call(w);throw new be(`Response type '${N}' is not supported`,be.ERR_NOT_SUPPORT,R)})});const j=async N=>{if(N==null)return 0;if(G.isBlob(N))return N.size;if(G.isSpecCompliantForm(N))return(await new s(Et.origin,{method:"POST",body:N}).arrayBuffer()).byteLength;if(G.isArrayBufferView(N)||G.isArrayBuffer(N))return N.byteLength;if(G.isURLSearchParams(N)&&(N=N+""),G.isString(N))return(await v(N)).byteLength},M=async(N,w)=>{const R=G.toFiniteNumber(N.getContentLength());return R??j(w)};return async N=>{let{url:w,method:R,data:O,signal:_,cancelToken:Y,timeout:L,onDownloadProgress:$,onUploadProgress:F,responseType:W,headers:ee,withCredentials:te="same-origin",fetchOptions:le}=kg(N),oe=l||fetch;W=W?(W+"").toLowerCase():"text";let fe=YS([_,Y&&Y.toAbortSignal()],L),Ee=null;const ge=fe&&fe.unsubscribe&&(()=>{fe.unsubscribe()});let Le;try{if(F&&g&&R!=="get"&&R!=="head"&&(Le=await M(ee,O))!==0){let T=new s(w,{method:"POST",body:O,duplex:"half"}),Q;if(G.isFormData(O)&&(Q=T.headers.get("content-type"))&&ee.setContentType(Q),T.body){const[V,I]=cx(Le,li(ux(F)));O=fx(T.body,mx,V,I)}}G.isString(te)||(te=te?"include":"omit");const k=f&&"credentials"in s.prototype,P={...le,signal:fe,method:R.toUpperCase(),headers:ee.normalize().toJSON(),body:O,duplex:"half",credentials:k?te:void 0};Ee=f&&new s(w,P);let Z=await(f?oe(Ee,le):oe(w,P));const ve=y&&(W==="stream"||W==="response");if(y&&($||ve&&ge)){const T={};["status","statusText","headers"].forEach(B=>{T[B]=Z[B]});const Q=G.toFiniteNumber(Z.headers.get("content-length")),[V,I]=$&&cx(Q,li(ux($),!0))||[];Z=new i(fx(Z.body,mx,V,()=>{I&&I(),ge&&ge()}),T)}W=W||"text";let pe=await p[G.findKey(p,W)||"text"](Z,N);return!ve&&ge&&ge(),await new Promise((T,Q)=>{Mg(T,Q,{data:pe,headers:Ft.from(Z.headers),status:Z.status,statusText:Z.statusText,config:N,request:Ee})})}catch(k){throw ge&&ge(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new be("Network Error",be.ERR_NETWORK,N,Ee),{cause:k.cause||k}):be.from(k,k&&k.code,N,Ee)}}},$S=new Map,Og=n=>{let l=n&&n.env||{};const{fetch:s,Request:i,Response:d}=l,f=[i,d,s];let m=f.length,x=m,v,g,y=$S;for(;x--;)v=f[x],g=y.get(v),g===void 0&&y.set(v,g=x?new Map:JS(l)),y=g;return g};Og();const Rd={http:mS,xhr:VS,fetch:{get:Og}};G.forEach(Rd,(n,l)=>{if(n){try{Object.defineProperty(n,"name",{value:l})}catch{}Object.defineProperty(n,"adapterName",{value:l})}});const gx=n=>`- ${n}`,PS=n=>G.isFunction(n)||n===null||n===!1;function IS(n,l){n=G.isArray(n)?n:[n];const{length:s}=n;let i,d;const f={};for(let m=0;m<s;m++){i=n[m];let x;if(d=i,!PS(i)&&(d=Rd[(x=String(i)).toLowerCase()],d===void 0))throw new be(`Unknown adapter '${x}'`);if(d&&(G.isFunction(d)||(d=d.get(l))))break;f[x||"#"+m]=d}if(!d){const m=Object.entries(f).map(([v,g])=>`adapter ${v} `+(g===!1?"is not supported by the environment":"is not available in the build"));let x=s?m.length>1?`since :
14
+ `+m.map(gx).join(`
15
+ `):" "+gx(m[0]):"as no adapter specified";throw new be("There is no suitable adapter to dispatch the request "+x,"ERR_NOT_SUPPORT")}return d}const zg={getAdapter:IS,adapters:Rd};function Hu(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new js(null,n)}function vx(n){return Hu(n),n.headers=Ft.from(n.headers),n.data=qu.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),zg.getAdapter(n.adapter||Ns.adapter,n)(n).then(function(i){return Hu(n),i.data=qu.call(n,n.transformResponse,i),i.headers=Ft.from(i.headers),i},function(i){return _g(i)||(Hu(n),i&&i.response&&(i.response.data=qu.call(n,n.transformResponse,i.response),i.response.headers=Ft.from(i.response.headers))),Promise.reject(i)})}const Dg="1.13.4",hi={};["object","boolean","number","function","string","symbol"].forEach((n,l)=>{hi[n]=function(i){return typeof i===n||"a"+(l<1?"n ":" ")+n}});const yx={};hi.transitional=function(l,s,i){function d(f,m){return"[Axios v"+Dg+"] Transitional option '"+f+"'"+m+(i?". "+i:"")}return(f,m,x)=>{if(l===!1)throw new be(d(m," has been removed"+(s?" in "+s:"")),be.ERR_DEPRECATED);return s&&!yx[m]&&(yx[m]=!0,console.warn(d(m," has been deprecated since v"+s+" and will be removed in the near future"))),l?l(f,m,x):!0}};hi.spelling=function(l){return(s,i)=>(console.warn(`${i} is likely a misspelling of ${l}`),!0)};function WS(n,l,s){if(typeof n!="object")throw new be("options must be an object",be.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let d=i.length;for(;d-- >0;){const f=i[d],m=l[f];if(m){const x=n[f],v=x===void 0||m(x,f,n);if(v!==!0)throw new be("option "+f+" must be "+v,be.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new be("Unknown option "+f,be.ERR_BAD_OPTION)}}const Io={assertOptions:WS,validators:hi},Oa=Io.validators;let sr=class{constructor(l){this.defaults=l||{},this.interceptors={request:new ox,response:new ox}}async request(l,s){try{return await this._request(l,s)}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(l,s){typeof l=="string"?(s=s||{},s.url=l):s=l||{},s=cr(this.defaults,s);const{transitional:i,paramsSerializer:d,headers:f}=s;i!==void 0&&Io.assertOptions(i,{silentJSONParsing:Oa.transitional(Oa.boolean),forcedJSONParsing:Oa.transitional(Oa.boolean),clarifyTimeoutError:Oa.transitional(Oa.boolean)},!1),d!=null&&(G.isFunction(d)?s.paramsSerializer={serialize:d}:Io.assertOptions(d,{encode:Oa.function,serialize:Oa.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),Io.assertOptions(s,{baseUrl:Oa.spelling("baseURL"),withXsrfToken:Oa.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let m=f&&G.merge(f.common,f[s.method]);f&&G.forEach(["delete","get","head","post","put","patch","common"],N=>{delete f[N]}),s.headers=Ft.concat(m,f);const x=[];let v=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(s)===!1||(v=v&&w.synchronous,x.unshift(w.fulfilled,w.rejected))});const g=[];this.interceptors.response.forEach(function(w){g.push(w.fulfilled,w.rejected)});let y,p=0,j;if(!v){const N=[vx.bind(this),void 0];for(N.unshift(...x),N.push(...g),j=N.length,y=Promise.resolve(s);p<j;)y=y.then(N[p++],N[p++]);return y}j=x.length;let M=s;for(;p<j;){const N=x[p++],w=x[p++];try{M=N(M)}catch(R){w.call(this,R);break}}try{y=vx.call(this,M)}catch(N){return Promise.reject(N)}for(p=0,j=g.length;p<j;)y=y.then(g[p++],g[p++]);return y}getUri(l){l=cr(this.defaults,l);const s=Ag(l.baseURL,l.url,l.allowAbsoluteUrls);return Tg(s,l.params,l.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(l){sr.prototype[l]=function(s,i){return this.request(cr(i||{},{method:l,url:s,data:(i||{}).data}))}});G.forEach(["post","put","patch"],function(l){function s(i){return function(f,m,x){return this.request(cr(x||{},{method:l,headers:i?{"Content-Type":"multipart/form-data"}:{},url:f,data:m}))}}sr.prototype[l]=s(),sr.prototype[l+"Form"]=s(!0)});let eN=class Ug{constructor(l){if(typeof l!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(f){s=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(x=>{i.subscribe(x),f=x}).then(d);return m.cancel=function(){i.unsubscribe(f)},m},l(function(f,m,x){i.reason||(i.reason=new js(f,m,x),s(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const s=this._listeners.indexOf(l);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const l=new AbortController,s=i=>{l.abort(i)};return this.subscribe(s),l.signal.unsubscribe=()=>this.unsubscribe(s),l.signal}static source(){let l;return{token:new Ug(function(d){l=d}),cancel:l}}};function tN(n){return function(s){return n.apply(null,s)}}function aN(n){return G.isObject(n)&&n.isAxiosError===!0}const sd={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(sd).forEach(([n,l])=>{sd[l]=n});function Lg(n){const l=new sr(n),s=pg(sr.prototype.request,l);return G.extend(s,sr.prototype,l,{allOwnKeys:!0}),G.extend(s,l,null,{allOwnKeys:!0}),s.create=function(d){return Lg(cr(n,d))},s}const nt=Lg(Ns);nt.Axios=sr;nt.CanceledError=js;nt.CancelToken=eN;nt.isCancel=_g;nt.VERSION=Dg;nt.toFormData=mi;nt.AxiosError=be;nt.Cancel=nt.CanceledError;nt.all=function(l){return Promise.all(l)};nt.spread=tN;nt.isAxiosError=aN;nt.mergeConfig=cr;nt.AxiosHeaders=Ft;nt.formToJSON=n=>Cg(G.isHTMLForm(n)?new FormData(n):n);nt.getAdapter=zg.getAdapter;nt.HttpStatusCode=sd;nt.default=nt;const{Axios:x4,AxiosError:g4,CanceledError:v4,isCancel:y4,CancelToken:b4,VERSION:S4,all:N4,Cancel:j4,isAxiosError:w4,spread:E4,toFormData:T4,AxiosHeaders:R4,HttpStatusCode:C4,formToJSON:_4,getAdapter:M4,mergeConfig:A4}=nt,we=nt.create({baseURL:""});function al(n){n?we.defaults.headers.common.Authorization=`Bearer ${n}`:delete we.defaults.headers.common.Authorization}let od=null;function nN(n){od=n}let Bg=null;function rN(n){Bg=n}we.interceptors.request.use(n=>{if(!n.headers.Authorization){const l=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token");l&&(n.headers.Authorization=`Bearer ${l}`)}return n});we.interceptors.response.use(n=>n,async n=>{const l=n.config;if(l.url?.startsWith("/api/auth/"))return Promise.reject(n);if(n.response?.status===401&&!l._retry&&od){l._retry=!0;const s=await od();if(s)return l.headers.Authorization=`Bearer ${s}`,we(l);Bg?.()}return Promise.reject(n)});async function lN(){const{data:n}=await we.get("/api/auth/setup-status");return n}async function qg(n,l,s){const{data:i}=await we.post("/api/auth/setup",{email:n,password:l,username:s});return i}async function sN(n,l){const{data:s}=await we.post("/api/auth/login",{email:n,password:l});return s}async function oN(n){const{data:l}=await we.post("/api/auth/refresh",{refresh_token:n});return l}const Hg=S.createContext(void 0),fs="jarvis-admin:access_token",Wr="jarvis-admin:refresh_token",Vo="jarvis-admin:user",iN=600*1e3;function cN({children:n}){const[l,s]=S.useState(()=>{const v=localStorage.getItem(fs),g=localStorage.getItem(Wr),y=localStorage.getItem(Vo);if(v&&g&&y)try{const p=JSON.parse(y);return al(v),{user:p,accessToken:v,refreshToken:g,isAuthenticated:!0,isLoading:!1,error:null}}catch{}return{user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null}}),i=S.useCallback(()=>{localStorage.removeItem(fs),localStorage.removeItem(Wr),localStorage.removeItem(Vo),al(null),s({user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null})},[]),d=S.useCallback(async()=>{const v=localStorage.getItem(Wr);if(!v)return null;try{const g=await oN(v),y=g.access_token,p=g.refresh_token??v;return localStorage.setItem(fs,y),localStorage.setItem(Wr,p),al(y),s(j=>({...j,accessToken:y,refreshToken:p})),y}catch{return i(),null}},[i]);S.useEffect(()=>{nN(d),rN(i)},[d,i]),S.useEffect(()=>{if(!l.isAuthenticated)return;const v=setInterval(()=>{d()},iN);return()=>clearInterval(v)},[l.isAuthenticated,d]);const f=S.useCallback(async(v,g)=>{s(y=>({...y,error:null,isLoading:!0}));try{const y=await sN(v,g);if(!y.user.is_superuser){s(p=>({...p,isLoading:!1,error:"Admin access required. This account is not a superuser."}));return}localStorage.setItem(fs,y.access_token),localStorage.setItem(Wr,y.refresh_token),localStorage.setItem(Vo,JSON.stringify(y.user)),al(y.access_token),s({user:y.user,accessToken:y.access_token,refreshToken:y.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(y){const p=y?.response?.data?.detail??"Login failed";s(j=>({...j,isLoading:!1,error:p}))}},[]),m=S.useCallback(async(v,g,y)=>{s(p=>({...p,error:null,isLoading:!0}));try{const p=await qg(v,g,y);localStorage.setItem(fs,p.access_token),localStorage.setItem(Wr,p.refresh_token),localStorage.setItem(Vo,JSON.stringify(p.user)),al(p.access_token),s({user:p.user,accessToken:p.access_token,refreshToken:p.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(p){const j=p?.response?.data?.detail??"Setup failed";s(M=>({...M,isLoading:!1,error:j}))}},[]),x=S.useMemo(()=>({state:l,login:f,setup:m,logout:i}),[l,f,m,i]);return o.jsx(Hg.Provider,{value:x,children:n})}function Cd(){const n=S.useContext(Hg);if(!n)throw new Error("useAuth must be used within AuthProvider");return n}const Gg=(...n)=>n.filter((l,s,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===s).join(" ").trim();const uN=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const dN=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,s,i)=>i?i.toUpperCase():s.toLowerCase());const bx=n=>{const l=dN(n);return l.charAt(0).toUpperCase()+l.slice(1)};var fN={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 mN=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const hN=S.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:d="",children:f,iconNode:m,...x},v)=>S.createElement("svg",{ref:v,...fN,width:l,height:l,stroke:n,strokeWidth:i?Number(s)*24/Number(l):s,className:Gg("lucide",d),...!f&&!mN(x)&&{"aria-hidden":"true"},...x},[...m.map(([g,y])=>S.createElement(g,y)),...Array.isArray(f)?f:[f]]));const Ne=(n,l)=>{const s=S.forwardRef(({className:i,...d},f)=>S.createElement(hN,{ref:f,iconNode:l,className:Gg(`lucide-${uN(bx(n))}`,`lucide-${n}`,i),...d}));return s.displayName=bx(n),s};const pN=[["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"}]],xN=Ne("activity",pN);const gN=[["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"}]],vN=Ne("box",gN);const yN=[["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"}]],id=Ne("brain",yN);const bN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],pi=Ne("check",bN);const SN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_d=Ne("chevron-down",SN);const NN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qg=Ne("chevron-right",NN);const jN=[["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"}]],Vg=Ne("circle-alert",jN);const wN=[["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"}]],Yg=Ne("circle-arrow-up",wN);const EN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],TN=Ne("circle-check-big",EN);const RN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],St=Ne("circle-check",RN);const CN=[["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"}]],Wo=Ne("circle-x",CN);const _N=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ll=Ne("circle",_N);const MN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Fg=Ne("copy",MN);const AN=[["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"}]],sl=Ne("cpu",AN);const kN=[["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"}]],ON=Ne("database",kN);const zN=[["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"}]],hs=Ne("download",zN);const DN=[["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"}]],UN=Ne("external-link",DN);const LN=[["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"}]],BN=Ne("file-text",LN);const qN=[["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"}]],Xg=Ne("git-merge",qN);const HN=[["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"}]],GN=Ne("globe",HN);const QN=[["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"}]],Md=Ne("hard-drive",QN);const VN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],YN=Ne("info",VN);const FN=[["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"}]],XN=Ne("key",FN);const KN=[["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"}]],ZN=Ne("layout-dashboard",KN);const JN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],pa=Ne("loader-circle",JN);const $N=[["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"}]],Ad=Ne("lock",$N);const PN=[["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"}]],IN=Ne("log-out",PN);const WN=[["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"}]],ej=Ne("monitor",WN);const tj=[["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"}]],aj=Ne("moon",tj);const nj=[["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"}]],rj=Ne("pencil",nj);const lj=[["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"}]],sj=Ne("play",lj);const oj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ei=Ne("plus",oj);const ij=[["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"}]],At=Ne("refresh-cw",ij);const cj=[["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"}]],xi=Ne("rotate-ccw",cj);const uj=[["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"}]],Kg=Ne("rotate-cw",uj);const dj=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fj=Ne("search",dj);const mj=[["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"}]],kd=Ne("server",mj);const hj=[["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"}]],Zg=Ne("settings",hj);const pj=[["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"}]],xj=Ne("sparkles",pj);const gj=[["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"}]],vj=Ne("sun",gj);const yj=[["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"}]],Od=Ne("trash-2",yj);const bj=[["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"}]],ta=Ne("triangle-alert",bj);const Sj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zd=Ne("x",Sj);const Nj=[["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"}]],jj=Ne("zap-off",Nj);const wj=[["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"}]],si=Ne("zap",wj);function Jg(n){var l,s,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var d=n.length;for(l=0;l<d;l++)n[l]&&(s=Jg(n[l]))&&(i&&(i+=" "),i+=s)}else for(s in n)n[s]&&(i&&(i+=" "),i+=s);return i}function Ej(){for(var n,l,s=0,i="",d=arguments.length;s<d;s++)(n=arguments[s])&&(l=Jg(n))&&(i&&(i+=" "),i+=l);return i}const Tj=(n,l)=>{const s=new Array(n.length+l.length);for(let i=0;i<n.length;i++)s[i]=n[i];for(let i=0;i<l.length;i++)s[n.length+i]=l[i];return s},Rj=(n,l)=>({classGroupId:n,validator:l}),$g=(n=new Map,l=null,s)=>({nextPart:n,validators:l,classGroupId:s}),oi="-",Sx=[],Cj="arbitrary..",_j=n=>{const l=Aj(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Mj(m);const x=m.split(oi),v=x[0]===""&&x.length>1?1:0;return Pg(x,v,l)},getConflictingClassGroupIds:(m,x)=>{if(x){const v=i[m],g=s[m];return v?g?Tj(g,v):v:g||Sx}return s[m]||Sx}}},Pg=(n,l,s)=>{if(n.length-l===0)return s.classGroupId;const d=n[l],f=s.nextPart.get(d);if(f){const g=Pg(n,l+1,f);if(g)return g}const m=s.validators;if(m===null)return;const x=l===0?n.join(oi):n.slice(l).join(oi),v=m.length;for(let g=0;g<v;g++){const y=m[g];if(y.validator(x))return y.classGroupId}},Mj=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=n.slice(1,-1),s=l.indexOf(":"),i=l.slice(0,s);return i?Cj+i:void 0})(),Aj=n=>{const{theme:l,classGroups:s}=n;return kj(s,l)},kj=(n,l)=>{const s=$g();for(const i in n){const d=n[i];Dd(d,s,i,l)}return s},Dd=(n,l,s,i)=>{const d=n.length;for(let f=0;f<d;f++){const m=n[f];Oj(m,l,s,i)}},Oj=(n,l,s,i)=>{if(typeof n=="string"){zj(n,l,s);return}if(typeof n=="function"){Dj(n,l,s,i);return}Uj(n,l,s,i)},zj=(n,l,s)=>{const i=n===""?l:Ig(l,n);i.classGroupId=s},Dj=(n,l,s,i)=>{if(Lj(n)){Dd(n(i),l,s,i);return}l.validators===null&&(l.validators=[]),l.validators.push(Rj(s,n))},Uj=(n,l,s,i)=>{const d=Object.entries(n),f=d.length;for(let m=0;m<f;m++){const[x,v]=d[m];Dd(v,Ig(l,x),s,i)}},Ig=(n,l)=>{let s=n;const i=l.split(oi),d=i.length;for(let f=0;f<d;f++){const m=i[f];let x=s.nextPart.get(m);x||(x=$g(),s.nextPart.set(m,x)),s=x}return s},Lj=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Bj=n=>{if(n<1)return{get:()=>{},set:()=>{}};let l=0,s=Object.create(null),i=Object.create(null);const d=(f,m)=>{s[f]=m,l++,l>n&&(l=0,i=s,s=Object.create(null))};return{get(f){let m=s[f];if(m!==void 0)return m;if((m=i[f])!==void 0)return d(f,m),m},set(f,m){f in s?s[f]=m:d(f,m)}}},cd="!",Nx=":",qj=[],jx=(n,l,s,i,d)=>({modifiers:n,hasImportantModifier:l,baseClassName:s,maybePostfixModifierPosition:i,isExternal:d}),Hj=n=>{const{prefix:l,experimentalParseClassName:s}=n;let i=d=>{const f=[];let m=0,x=0,v=0,g;const y=d.length;for(let w=0;w<y;w++){const R=d[w];if(m===0&&x===0){if(R===Nx){f.push(d.slice(v,w)),v=w+1;continue}if(R==="/"){g=w;continue}}R==="["?m++:R==="]"?m--:R==="("?x++:R===")"&&x--}const p=f.length===0?d:d.slice(v);let j=p,M=!1;p.endsWith(cd)?(j=p.slice(0,-1),M=!0):p.startsWith(cd)&&(j=p.slice(1),M=!0);const N=g&&g>v?g-v:void 0;return jx(f,M,j,N)};if(l){const d=l+Nx,f=i;i=m=>m.startsWith(d)?f(m.slice(d.length)):jx(qj,!1,m,void 0,!0)}if(s){const d=i;i=f=>s({className:f,parseClassName:d})}return i},Gj=n=>{const l=new Map;return n.orderSensitiveModifiers.forEach((s,i)=>{l.set(s,1e6+i)}),s=>{const i=[];let d=[];for(let f=0;f<s.length;f++){const m=s[f],x=m[0]==="[",v=l.has(m);x||v?(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}},Qj=n=>({cache:Bj(n.cacheSize),parseClassName:Hj(n),sortModifiers:Gj(n),..._j(n)}),Vj=/\s+/,Yj=(n,l)=>{const{parseClassName:s,getClassGroupId:i,getConflictingClassGroupIds:d,sortModifiers:f}=l,m=[],x=n.trim().split(Vj);let v="";for(let g=x.length-1;g>=0;g-=1){const y=x[g],{isExternal:p,modifiers:j,hasImportantModifier:M,baseClassName:N,maybePostfixModifierPosition:w}=s(y);if(p){v=y+(v.length>0?" "+v:v);continue}let R=!!w,O=i(R?N.substring(0,w):N);if(!O){if(!R){v=y+(v.length>0?" "+v:v);continue}if(O=i(N),!O){v=y+(v.length>0?" "+v:v);continue}R=!1}const _=j.length===0?"":j.length===1?j[0]:f(j).join(":"),Y=M?_+cd:_,L=Y+O;if(m.indexOf(L)>-1)continue;m.push(L);const $=d(O,R);for(let F=0;F<$.length;++F){const W=$[F];m.push(Y+W)}v=y+(v.length>0?" "+v:v)}return v},Fj=(...n)=>{let l=0,s,i,d="";for(;l<n.length;)(s=n[l++])&&(i=Wg(s))&&(d&&(d+=" "),d+=i);return d},Wg=n=>{if(typeof n=="string")return n;let l,s="";for(let i=0;i<n.length;i++)n[i]&&(l=Wg(n[i]))&&(s&&(s+=" "),s+=l);return s},Xj=(n,...l)=>{let s,i,d,f;const m=v=>{const g=l.reduce((y,p)=>p(y),n());return s=Qj(g),i=s.cache.get,d=s.cache.set,f=x,x(v)},x=v=>{const g=i(v);if(g)return g;const y=Yj(v,s);return d(v,y),y};return f=m,(...v)=>f(Fj(...v))},Kj=[],ut=n=>{const l=s=>s[n]||Kj;return l.isThemeGetter=!0,l},ev=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zj=/^\d+\/\d+$/,Jj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$j=/\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$/,Pj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ij=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,el=n=>Zj.test(n),_e=n=>!!n&&!Number.isNaN(Number(n)),Mn=n=>!!n&&Number.isInteger(Number(n)),Gu=n=>n.endsWith("%")&&_e(n.slice(0,-1)),Wa=n=>Jj.test(n),ew=()=>!0,tw=n=>$j.test(n)&&!Pj.test(n),av=()=>!1,aw=n=>Ij.test(n),nw=n=>Wj.test(n),rw=n=>!ue(n)&&!de(n),lw=n=>fl(n,lv,av),ue=n=>ev.test(n),nr=n=>fl(n,sv,tw),Qu=n=>fl(n,uw,_e),wx=n=>fl(n,nv,av),sw=n=>fl(n,rv,nw),Yo=n=>fl(n,ov,aw),de=n=>tv.test(n),ms=n=>ml(n,sv),ow=n=>ml(n,dw),Ex=n=>ml(n,nv),iw=n=>ml(n,lv),cw=n=>ml(n,rv),Fo=n=>ml(n,ov,!0),fl=(n,l,s)=>{const i=ev.exec(n);return i?i[1]?l(i[1]):s(i[2]):!1},ml=(n,l,s=!1)=>{const i=tv.exec(n);return i?i[1]?l(i[1]):s:!1},nv=n=>n==="position"||n==="percentage",rv=n=>n==="image"||n==="url",lv=n=>n==="length"||n==="size"||n==="bg-size",sv=n=>n==="length",uw=n=>n==="number",dw=n=>n==="family-name",ov=n=>n==="shadow",fw=()=>{const n=ut("color"),l=ut("font"),s=ut("text"),i=ut("font-weight"),d=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),x=ut("container"),v=ut("spacing"),g=ut("radius"),y=ut("shadow"),p=ut("inset-shadow"),j=ut("text-shadow"),M=ut("drop-shadow"),N=ut("blur"),w=ut("perspective"),R=ut("aspect"),O=ut("ease"),_=ut("animate"),Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],$=()=>[...L(),de,ue],F=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],ee=()=>[de,ue,v],te=()=>[el,"full","auto",...ee()],le=()=>[Mn,"none","subgrid",de,ue],oe=()=>["auto",{span:["full",Mn,de,ue]},Mn,de,ue],fe=()=>[Mn,"auto",de,ue],Ee=()=>["auto","min","max","fr",de,ue],ge=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Le=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...ee()],P=()=>[el,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ee()],Z=()=>[n,de,ue],ve=()=>[...L(),Ex,wx,{position:[de,ue]}],pe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",iw,lw,{size:[de,ue]}],Q=()=>[Gu,ms,nr],V=()=>["","none","full",g,de,ue],I=()=>["",_e,ms,nr],B=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[_e,Gu,Ex,wx],ye=()=>["","none",N,de,ue],q=()=>["none",_e,de,ue],ae=()=>["none",_e,de,ue],Ce=()=>[_e,de,ue],Me=()=>[el,"full",...ee()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wa],breakpoint:[Wa],color:[ew],container:[Wa],"drop-shadow":[Wa],ease:["in","out","in-out"],font:[rw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wa],shadow:[Wa],spacing:["px",_e],text:[Wa],"text-shadow":[Wa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",el,ue,de,R]}],container:["container"],columns:[{columns:[_e,ue,de,x]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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:$()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{start:te()}],end:[{end:te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[Mn,"auto",de,ue]}],basis:[{basis:[el,"full","auto",x,...ee()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,el,"auto","initial","none",ue]}],grow:[{grow:["",_e,de,ue]}],shrink:[{shrink:["",_e,de,ue]}],order:[{order:[Mn,"first","last","none",de,ue]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ee()}],"auto-rows":[{"auto-rows":Ee()}],gap:[{gap:ee()}],"gap-x":[{"gap-x":ee()}],"gap-y":[{"gap-y":ee()}],"justify-content":[{justify:[...ge(),"normal"]}],"justify-items":[{"justify-items":[...Le(),"normal"]}],"justify-self":[{"justify-self":["auto",...Le()]}],"align-content":[{content:["normal",...ge()]}],"align-items":[{items:[...Le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Le(),{baseline:["","last"]}]}],"place-content":[{"place-content":ge()}],"place-items":[{"place-items":[...Le(),"baseline"]}],"place-self":[{"place-self":["auto",...Le()]}],p:[{p:ee()}],px:[{px:ee()}],py:[{py:ee()}],ps:[{ps:ee()}],pe:[{pe:ee()}],pt:[{pt:ee()}],pr:[{pr:ee()}],pb:[{pb:ee()}],pl:[{pl:ee()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":ee()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ee()}],"space-y-reverse":["space-y-reverse"],size:[{size:P()}],w:[{w:[x,"screen",...P()]}],"min-w":[{"min-w":[x,"screen","none",...P()]}],"max-w":[{"max-w":[x,"screen","none","prose",{screen:[m]},...P()]}],h:[{h:["screen","lh",...P()]}],"min-h":[{"min-h":["screen","lh","none",...P()]}],"max-h":[{"max-h":["screen","lh",...P()]}],"font-size":[{text:["base",s,ms,nr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,de,Qu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gu,ue]}],"font-family":[{font:[ow,ue,l]}],"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":[_e,"none",de,Qu]}],leading:[{leading:[f,...ee()]}],"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:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",de,nr]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[_e,"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:ee()}],"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:ve()}],"bg-repeat":[{bg:pe()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mn,de,ue],radial:["",de,ue],conic:[Mn,de,ue]},cw,sw]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],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:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,de,ue]}],"outline-w":[{outline:["",_e,ms,nr]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",y,Fo,Yo]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",p,Fo,Yo]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[_e,nr]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",j,Fo,Yo]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[_e,de,ue]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"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":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[de,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":L()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ve()}],"mask-repeat":[{mask:pe()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ue]}],filter:[{filter:["","none",de,ue]}],blur:[{blur:ye()}],brightness:[{brightness:[_e,de,ue]}],contrast:[{contrast:[_e,de,ue]}],"drop-shadow":[{"drop-shadow":["","none",M,Fo,Yo]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",_e,de,ue]}],"hue-rotate":[{"hue-rotate":[_e,de,ue]}],invert:[{invert:["",_e,de,ue]}],saturate:[{saturate:[_e,de,ue]}],sepia:[{sepia:["",_e,de,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ue]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[_e,de,ue]}],"backdrop-contrast":[{"backdrop-contrast":[_e,de,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,de,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,de,ue]}],"backdrop-invert":[{"backdrop-invert":["",_e,de,ue]}],"backdrop-opacity":[{"backdrop-opacity":[_e,de,ue]}],"backdrop-saturate":[{"backdrop-saturate":[_e,de,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,de,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ee()}],"border-spacing-x":[{"border-spacing-x":ee()}],"border-spacing-y":[{"border-spacing-y":ee()}],"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:[_e,"initial",de,ue]}],ease:[{ease:["linear","initial",O,de,ue]}],delay:[{delay:[_e,de,ue]}],animate:[{animate:["none",_,de,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,de,ue]}],"perspective-origin":[{"perspective-origin":$()}],rotate:[{rotate:q()}],"rotate-x":[{"rotate-x":q()}],"rotate-y":[{"rotate-y":q()}],"rotate-z":[{"rotate-z":q()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[de,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:$()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Me()}],"translate-x":[{"translate-x":Me()}],"translate-y":[{"translate-y":Me()}],"translate-z":[{"translate-z":Me()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",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":ee()}],"scroll-mx":[{"scroll-mx":ee()}],"scroll-my":[{"scroll-my":ee()}],"scroll-ms":[{"scroll-ms":ee()}],"scroll-me":[{"scroll-me":ee()}],"scroll-mt":[{"scroll-mt":ee()}],"scroll-mr":[{"scroll-mr":ee()}],"scroll-mb":[{"scroll-mb":ee()}],"scroll-ml":[{"scroll-ml":ee()}],"scroll-p":[{"scroll-p":ee()}],"scroll-px":[{"scroll-px":ee()}],"scroll-py":[{"scroll-py":ee()}],"scroll-ps":[{"scroll-ps":ee()}],"scroll-pe":[{"scroll-pe":ee()}],"scroll-pt":[{"scroll-pt":ee()}],"scroll-pr":[{"scroll-pr":ee()}],"scroll-pb":[{"scroll-pb":ee()}],"scroll-pl":[{"scroll-pl":ee()}],"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",...Z()]}],"stroke-w":[{stroke:[_e,ms,nr,Qu]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},mw=Xj(fw);function re(...n){return mw(Ej(n))}async function hw(){const{data:n}=await we.get("/api/system/info");return n}function pw(){return na({queryKey:["system-info"],queryFn:hw,staleTime:6e4})}function xw(n){const l=Math.floor(n/86400),s=Math.floor(n%86400/3600);if(l>0)return`${l}d ${s}h`;const i=Math.floor(n%3600/60);return s>0?`${s}h ${i}m`:`${i}m`}function gw(){const{data:n}=pw();return n?o.jsxs("div",{className:"border-t border-[var(--color-border)] px-3 py-2 text-[10px] text-[var(--color-text-muted)]",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(sl,{size:10}),o.jsxs("span",{children:[n.cpuCount," cores"]}),o.jsx("span",{className:"mx-0.5",children:"|"}),o.jsx(Md,{size:10}),o.jsxs("span",{children:[Math.round(n.totalMemoryMb/1024),"GB"]})]}),o.jsxs("div",{className:"mt-0.5",children:[n.hostname," · up ",xw(n.uptime)," · v",n.version]})]}):null}const vw=[{label:"Dashboard",icon:ZN,path:"/dashboard"},{label:"Settings",icon:Zg,path:"/settings"},{label:"Services",icon:kd,path:"/services"},{label:"Models",icon:vN,path:"/models"},{label:"Quick Sets",icon:si,path:"/quick-sets"},{label:"Traces",icon:xN,path:"/traces"},{label:"Nodes",icon:sl,path:"/nodes"}];function yw(){return o.jsxs("aside",{className:"flex w-56 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface)]",children:[o.jsx("div",{className:"flex h-14 items-center border-b border-[var(--color-border)] px-4",children:o.jsx("span",{className:"text-lg font-bold text-[var(--color-primary)]",children:"Jarvis"})}),o.jsx("nav",{className:"flex-1 space-y-1 p-2",children:vw.map(n=>o.jsxs(tg,{to:n.path,className:({isActive:l})=>re("flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",l?"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:[o.jsx(n.icon,{size:18}),n.label]},n.path))}),o.jsx(gw,{})]})}function bw(){const{state:n,logout:l}=Cd(),{theme:s,toggleTheme:i}=R2();return o.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-[var(--color-border)] bg-[var(--color-surface)] px-6",children:[o.jsx("h2",{className:"text-sm font-medium text-[var(--color-text-muted)]",children:"Admin Dashboard"}),o.jsxs("div",{className:"flex items-center gap-3",children:[n.user&&o.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:n.user.email}),o.jsx("button",{onClick:i,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",title:`Switch to ${s==="dark"?"light":"dark"} mode`,children:s==="dark"?o.jsx(vj,{size:18}):o.jsx(aj,{size:18})}),o.jsx("button",{onClick:l,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-red-500",title:"Logout",children:o.jsx(IN,{size:18})})]})]})}function Sw(){const{state:n}=Cd();return n.isLoading?o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:o.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading..."})}):n.isAuthenticated?o.jsxs("div",{className:"flex h-screen bg-[var(--color-background)]",children:[o.jsx(yw,{}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsx(bw,{}),o.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:o.jsx(O0,{})})]})]}):o.jsx(ai,{to:"/login",replace:!0})}function Nw(){const{state:n,login:l,setup:s}=Cd(),i=wa(),[d,f]=S.useState("loading"),[m,x]=S.useState(""),[v,g]=S.useState(""),[y,p]=S.useState(""),[j,M]=S.useState(""),[N,w]=S.useState(null);if(S.useEffect(()=>{let L=!1;async function $(){try{const{data:F}=await we.get("/api/setup/status");if(!L&&!F.configured){i("/setup",{replace:!0});return}}catch{if(!L){i("/setup",{replace:!0});return}}try{const F=await lN();L||f(F.needs_setup?"setup":"login")}catch{L||f("login")}}return $(),()=>{L=!0}},[i]),n.isAuthenticated)return o.jsx(ai,{to:"/settings",replace:!0});const R=L=>{L.preventDefault(),l(m,y)},O=L=>{if(L.preventDefault(),w(null),y!==j){w("Passwords do not match");return}if(y.length<8){w("Password must be at least 8 characters");return}s(m,y,v||void 0)},_=re("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)]"),Y=N??n.error;return d==="loading"?o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:o.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:o.jsx("div",{className:"flex justify-center",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-border)] border-t-[var(--color-primary)]"})})})}):o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:o.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"?o.jsxs(o.Fragment,{children:[o.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),o.jsx("p",{className:"mb-6 text-center text-sm text-[var(--color-text-muted)]",children:"Set up your first administrator account to get started."}),o.jsxs("form",{onSubmit:O,className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),o.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:L=>x(L.target.value),className:_,placeholder:"admin@example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"username",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Username"}),o.jsx("input",{id:"username",type:"text",required:!0,autoComplete:"username",value:v,onChange:L=>g(L.target.value),className:_,placeholder:"admin"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),o.jsx("input",{id:"password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:y,onChange:L=>p(L.target.value),className:_})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),o.jsx("input",{id:"confirm-password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:j,onChange:L=>M(L.target.value),className:_})]}),Y&&o.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:Y}),o.jsx("button",{type:"submit",disabled:n.isLoading,className:re("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:n.isLoading?"Creating account...":"Create Admin Account"})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("h1",{className:"mb-6 text-center text-2xl font-bold text-[var(--color-text)]",children:"Jarvis Admin"}),o.jsxs("form",{onSubmit:R,className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),o.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:L=>x(L.target.value),className:_,placeholder:"admin@example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),o.jsx("input",{id:"password",type:"password",required:!0,autoComplete:"current-password",value:y,onChange:L=>p(L.target.value),className:_})]}),Y&&o.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:Y}),o.jsx("button",{type:"submit",disabled:n.isLoading,className:re("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:n.isLoading?"Signing in...":"Sign in"})]})]})})})}async function jw(){const{data:n}=await we.get("/api/settings/");return n}async function ww(n,l,s){const{data:i}=await we.put(`/api/settings/${encodeURIComponent(n)}/${l}`,{value:s});return i}function Ew(){return na({queryKey:["settings"],queryFn:jw,staleTime:3e4})}function Tw(){const n=kt();return Xt({mutationFn:({serviceName:l,key:s,value:i})=>ww(l,s,i),onSuccess:()=>{n.invalidateQueries({queryKey:["settings"]})}})}function Rw({setting:n,onSave:l,onCancel:s,isSaving:i}){const[d,f]=S.useState(()=>n.value_type==="json"?JSON.stringify(n.value,null,2):n.value_type==="bool"?"":String(n.value??"")),[m,x]=S.useState(()=>!!n.value),[v,g]=S.useState(null),y=!!n.options?.length,p=y&&!n.options.includes(d),[j,M]=S.useState(p),N=R=>{R.preventDefault();let O;switch(n.value_type){case"bool":O=m;break;case"int":if(O=parseInt(d,10),isNaN(O)){g("Must be a whole number");return}g(null);break;case"float":if(O=parseFloat(d),isNaN(O)){g("Must be a number");return}g(null);break;case"json":try{O=JSON.parse(d),g(null)}catch{g("Invalid JSON");return}break;default:O=d}l(O)},w=re("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 o.jsxs("form",{onSubmit:N,className:"flex items-center gap-2",children:[y?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("select",{value:j?"__other__":d,onChange:R=>{R.target.value==="__other__"?(M(!0),f("")):(M(!1),f(R.target.value))},className:re(w,"max-w-xs"),children:[n.options.map(R=>o.jsx("option",{value:String(R),children:String(R)},String(R))),o.jsx("option",{value:"__other__",children:"Other..."})]}),j&&o.jsx("input",{type:"text",value:d,onChange:R=>f(R.target.value),placeholder:"Custom value",className:re(w,"max-w-xs"),autoFocus:!0})]}):n.value_type==="bool"?o.jsx("button",{type:"button",onClick:()=>x(R=>!R),className:re("relative h-6 w-11 rounded-full transition-colors",m?"bg-[var(--color-primary)]":"bg-[var(--color-border)]"),children:o.jsx("span",{className:re("absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform",m&&"translate-x-5")})}):n.value_type==="json"?o.jsxs("div",{className:"flex-1",children:[o.jsx("textarea",{value:d,onChange:R=>{f(R.target.value),g(null)},rows:4,className:re(w,"font-mono text-xs")}),v&&o.jsx("p",{className:"mt-1 text-xs text-red-500",children:v})]}):o.jsxs("div",{children:[o.jsx("input",{type:n.value_type==="int"||n.value_type==="float"?"number":n.is_secret?"password":"text",step:n.value_type==="float"?"any":void 0,value:d,onChange:R=>{f(R.target.value),g(null)},className:re(w,"max-w-xs")}),v&&o.jsx("p",{className:"mt-1 text-xs text-red-500",children:v})]}),o.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"}),o.jsx("button",{type:"button",onClick:s,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 Cw(n){return n.is_secret?"********":n.value===null||n.value===void 0?"(not set)":n.value_type==="json"?JSON.stringify(n.value):String(n.value)}const _w={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 Mw({setting:n,serviceName:l,onRestartService:s}){const[i,d]=S.useState(!1),f=Tw(),m=x=>{f.mutate({serviceName:l,key:n.key,value:x},{onSuccess:v=>{d(!1),v.requires_reload?Ue.warning(`Setting updated. ${l} requires a restart to apply.`,s?{action:{label:"Restart",onClick:s}}:void 0):Ue.success("Setting updated")},onError:v=>{Ue.error(`Failed to update: ${v.message}`)}})};return o.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg px-3 py-2 hover:bg-[var(--color-surface-alt)]",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("code",{className:"text-sm font-medium text-[var(--color-text)]",children:n.key}),o.jsx("span",{className:re("rounded px-1.5 py-0.5 text-[10px] font-medium",_w[n.value_type]??"bg-gray-500/10 text-gray-500"),children:n.value_type}),n.from_db&&o.jsx("span",{title:"Stored in database",children:o.jsx(ON,{size:12,className:"text-[var(--color-tertiary)]"})}),n.requires_reload&&o.jsx("span",{title:"Requires service restart",children:o.jsx(ta,{size:12,className:"text-amber-500"})})]}),n.description&&o.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:n.description}),i?o.jsx("div",{className:"mt-2",children:o.jsx(Rw,{setting:n,onSave:m,onCancel:()=>d(!1),isSaving:f.isPending})}):o.jsx("p",{className:"mt-1 font-mono text-xs text-[var(--color-text-muted)]",children:Cw(n)})]}),!i&&o.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:o.jsx(rj,{size:14})})]})}function Aw({category:n,settings:l,serviceName:s,onRestartService:i}){const[d,f]=S.useState(!0);return o.jsxs("div",{children:[o.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?o.jsx(_d,{size:14}):o.jsx(Qg,{size:14}),n,o.jsxs("span",{className:"font-normal",children:["(",l.length,")"]})]}),d&&o.jsx("div",{className:"space-y-0.5",children:l.map(m=>o.jsx(Mw,{setting:m,serviceName:s,onRestartService:i},m.key))})]})}async function kw(){const{data:n}=await we.get("/api/containers");return n}async function Ow(n){const{data:l}=await we.post(`/api/containers/${n}/restart`);return l}function iv(){return na({queryKey:["containers"],queryFn:kw,staleTime:1e4,refetchInterval:1e4})}function cv(){const n=kt();return Xt({mutationFn:l=>Ow(l),onSuccess:()=>{n.invalidateQueries({queryKey:["containers"]})}})}function zw({result:n,defaultExpanded:l=!1}){const[s,i]=S.useState(l),{data:d}=iv(),f=cv(),m=S.useCallback(()=>{const v=d?.containers.find(g=>g.name.includes(n.service_name)||g.name.includes(n.service_name.replace("jarvis-","")));v?f.mutate(v.id,{onSuccess:()=>Ue.success(`${n.service_name} is restarting...`),onError:g=>Ue.error(`Restart failed: ${g.message}`)}):Ue.error(`Could not find container for ${n.service_name}`)},[d,n.service_name,f]),x=S.useMemo(()=>{const v=new Map;for(const g of n.settings){const y=v.get(g.category)??[];v.set(g.category,[...y,g])}return v},[n]);return o.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[o.jsxs("button",{onClick:()=>i(v=>!v),className:"flex w-full items-center gap-3 px-4 py-3 text-left hover:bg-[var(--color-surface-alt)]",children:[s?o.jsx(_d,{size:18,className:"text-[var(--color-text-muted)]"}):o.jsx(Qg,{size:18,className:"text-[var(--color-text-muted)]"}),o.jsx("span",{className:"font-medium text-[var(--color-text)]",children:n.service_name}),n.success?o.jsx(St,{size:16,className:"text-[var(--color-secondary)]"}):o.jsx(Wo,{size:16,className:"text-red-500"}),o.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:n.success?`${n.settings.length} settings`:n.error??"Error"}),n.latency_ms!=null&&o.jsxs("span",{className:re("ml-auto text-xs",n.latency_ms>500?"text-amber-500":"text-[var(--color-text-muted)]"),children:[Math.round(n.latency_ms),"ms"]})]}),s&&n.success&&o.jsx("div",{className:"space-y-2 border-t border-[var(--color-border)] px-2 py-3",children:[...x.entries()].map(([v,g])=>o.jsx(Aw,{category:v,settings:g,serviceName:n.service_name,onRestartService:m},v))}),s&&!n.success&&o.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-3",children:o.jsx("p",{className:"text-sm text-red-500",children:n.error??"Failed to fetch settings"})})]})}function Dw(){const{data:n,isLoading:l,isError:s,error:i,refetch:d,isFetching:f}=Ew(),[m,x]=S.useState(""),v=S.useMemo(()=>{if(!n)return[];if(!m.trim())return n.services;const g=m.toLowerCase();return n.services.map(y=>({...y,settings:y.settings.filter(p=>p.key.toLowerCase().includes(g)||p.category.toLowerCase().includes(g)||(p.description?.toLowerCase().includes(g)??!1))})).filter(y=>y.settings.length>0||y.service_name.toLowerCase().includes(g))},[n,m]);return l?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(At,{className:"animate-spin text-[var(--color-primary)]",size:24})}):s?o.jsxs("div",{className:"py-20 text-center",children:[o.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load settings"}),o.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),o.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):o.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Settings"}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[n&&o.jsxs("span",{children:[n.successful_services,"/",n.total_services," services"]}),o.jsx("button",{onClick:()=>d(),disabled:f,className:re("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:o.jsx(At,{size:14})})]})]}),o.jsxs("div",{className:"relative",children:[o.jsx(fj,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),o.jsx("input",{type:"text",value:m,onChange:g=>x(g.target.value),placeholder:"Search settings...",className:re("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)]")})]}),o.jsxs("div",{className:"space-y-3",children:[v.map((g,y)=>o.jsx(zw,{result:g,defaultExpanded:y===0},g.service_name)),v.length===0&&o.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 Uw(){const{data:n}=await we.get("/api/services/registry");return n}async function Lw(n){const{data:l}=await we.post("/api/services/register",n);return l}async function Bw(n){const{data:l}=await we.post("/api/services/rotate-key",n);return l}async function qw(n){const{data:l}=await we.post("/api/services/probe",n);return l}async function Hw(n){const{data:l}=await we.post("/api/services/register",{services:[{name:n.name,host:n.host,port:n.port,scheme:n.scheme,health_path:n.health_path,description:n.description}]});return l}async function Gw(n){await we.delete(`/api/services/${encodeURIComponent(n)}`)}async function Qw(){const{data:n}=await we.get("/api/services/suggestions");return n}function Vw(){return na({queryKey:["service-registry"],queryFn:Uw,staleTime:3e4})}function Yw(){const n=kt();return Xt({mutationFn:Lw,onSuccess:()=>{n.invalidateQueries({queryKey:["service-registry"]})}})}function Fw(){const n=kt();return Xt({mutationFn:Bw,onSuccess:()=>{n.invalidateQueries({queryKey:["service-registry"]})}})}function Xw(){const n=kt();return Xt({mutationFn:Hw,onSuccess:()=>{n.invalidateQueries({queryKey:["service-registry"]})}})}function Kw(){const n=kt();return Xt({mutationFn:Gw,onSuccess:()=>{n.invalidateQueries({queryKey:["service-registry"]})}})}function Zw(){return na({queryKey:["service-suggestions"],queryFn:Qw,staleTime:6e4})}function Tx({ok:n,label:l}){return o.jsxs("span",{className:re("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",n?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[n?o.jsx(pi,{size:12}):o.jsx(zd,{size:12}),l]})}function Jw({status:n,error:l,latency:s}){return n==="idle"?null:n==="probing"?o.jsx("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:o.jsx(pa,{size:12,className:"animate-spin"})}):n==="healthy"?o.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 dark:text-green-400",children:[o.jsx(ll,{size:8,fill:"currentColor"}),s!=null&&`${s}ms`]}):o.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",title:l,children:[o.jsx(ll,{size:8,fill:"currentColor"}),l||"Unreachable"]})}function $w({entry:n,checked:l,host:s,port:i,scheme:d,onToggle:f,onHostChange:m,onPortChange:x,onSchemeChange:v,onHostBlur:g,onPortBlur:y,onRotateKey:p,onDelete:j,disabled:M,rotating:N,deleting:w,healthStatus:R,healthError:O,healthLatency:_}){return o.jsxs("div",{className:re("flex flex-wrap items-center gap-3 rounded-lg border border-[var(--color-border)] p-3","bg-[var(--color-surface)] transition-colors",l&&"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5"),children:[o.jsx("input",{type:"checkbox",checked:l,onChange:f,disabled:M,className:"h-4 w-4 rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),o.jsxs("div",{className:"min-w-[180px] flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-[var(--color-text)]",children:[n.name,n.custom&&o.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"})]}),o.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:n.description})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Tx,{ok:n.config_registered,label:"Config"}),o.jsx(Tx,{ok:n.auth_registered,label:"Auth"}),n.custom&&j&&o.jsxs("button",{onClick:j,disabled:M||w,className:re("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:[o.jsx(Od,{size:12,className:w?"animate-spin":""}),"Remove"]}),n.auth_registered&&o.jsxs("button",{onClick:p,disabled:M||N,className:re("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:[o.jsx(Kg,{size:12,className:N?"animate-spin":""}),"Rotate Key"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("select",{value:d,onChange:Y=>v(Y.target.value),disabled:M,className:re("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:[o.jsx("option",{value:"http",children:"http"}),o.jsx("option",{value:"https",children:"https"}),o.jsx("option",{value:"mqtt",children:"mqtt"}),o.jsx("option",{value:"mqtts",children:"mqtts"}),o.jsx("option",{value:"ws",children:"ws"}),o.jsx("option",{value:"wss",children:"wss"})]}),o.jsx("input",{type:"text",value:s,onChange:Y=>m(Y.target.value),onBlur:g,disabled:M,placeholder:"host",className:re("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")}),o.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:":"}),o.jsx("input",{type:"number",value:i,onChange:Y=>x(Number(Y.target.value)),onBlur:y,disabled:M,className:re("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")}),o.jsx(Jw,{status:R,error:O,latency:_})]})]})}const Rx={name:"",host:"localhost",port:"",scheme:"http",health_path:"/health",description:""};function Pw(){const{data:n,isLoading:l,isError:s,error:i,refetch:d,isFetching:f}=Vw(),m=Yw(),x=Fw(),v=Xw(),g=Kw(),{data:y}=Zw(),[p,j]=S.useState({}),[M,N]=S.useState(null),[w,R]=S.useState(null),[O,_]=S.useState(null),[Y,L]=S.useState(null),[$,F]=S.useState(null),[W,ee]=S.useState({}),[te,le]=S.useState(!1),[oe,fe]=S.useState(Rx),[Ee,ge]=S.useState(!1),Le=S.useRef(null),k=S.useMemo(()=>new Set(n?.services.map(q=>q.name)??[]),[n]),P=S.useMemo(()=>{const ae=(y?.suggestions??[]).filter(Me=>!k.has(Me.id));if(!oe.name.trim())return ae;const Ce=oe.name.toLowerCase();return ae.filter(Me=>Me.id.toLowerCase().includes(Ce)||Me.name.toLowerCase().includes(Ce)||Me.description.toLowerCase().includes(Ce))},[y,k,oe.name]),Z=S.useCallback(q=>{fe({name:q.id,description:q.description,host:"localhost",port:String(q.port),scheme:"http",health_path:q.healthCheck}),ge(!1)},[]);S.useEffect(()=>{const q=ae=>{Le.current&&!Le.current.contains(ae.target)&&ge(!1)};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]);const ve=S.useCallback(q=>{if(p[q])return p[q];const ae=n?.services.find(Ce=>Ce.name===q);return ae?{checked:ae.config_registered,host:ae.current_host??"localhost",port:ae.current_port??ae.default_port,scheme:ae.current_scheme??"http"}:{checked:!1,host:"localhost",port:0,scheme:"http"}},[p,n]),pe=S.useCallback((q,ae)=>{j(Ce=>{const Me=Ce[q]??{checked:!1,host:"localhost",port:0};return{...Ce,[q]:{...Me,...ae}}})},[]),T=S.useCallback(async(q,ae,Ce,Me,ga="http")=>{if(!(!ae||!Ce)){ee(it=>({...it,[q]:{status:"probing"}}));try{const it=await qw({host:ae,port:Ce,health_path:Me,scheme:ga});ee(On=>({...On,[q]:{status:it.healthy?"healthy":"unhealthy",error:it.error??void 0,latency:it.latency_ms??void 0}}))}catch{ee(it=>({...it,[q]:{status:"unhealthy",error:"Request failed"}}))}}},[]),Q=S.useCallback(()=>{if(!n)return;const q=n.services.filter(ae=>ve(ae.name).checked).map(ae=>{const Ce=ve(ae.name);return{name:ae.name,host:Ce.host,port:Ce.port,scheme:Ce.scheme}});if(q.length===0){Ue.error("No services selected");return}N(null),R(null),m.mutate({services:q},{onSuccess:ae=>{N(ae.results);const Ce=ae.results.filter(ga=>ga.config_ok&&ga.auth_ok).length,Me=ae.results.length;Ce===Me?Ue.success(`All ${Me} services registered`):Ue.warning(`${Ce}/${Me} services registered successfully`)},onError:ae=>{Ue.error(`Registration failed: ${ae.message}`)}})},[n,ve,m]),V=S.useCallback(q=>{_(q),R(null),x.mutate({service_name:q},{onSuccess:ae=>{R(ae),_(null),Ue.success(`Key rotated for ${q}`)},onError:ae=>{_(null),Ue.error(`Key rotation failed: ${ae.message}`)}})},[x]),I=S.useCallback(q=>{L(q),g.mutate(q,{onSuccess:()=>{L(null),Ue.success(`Removed ${q}`)},onError:ae=>{L(null),Ue.error(`Failed to remove: ${ae.message}`)}})},[g]),B=S.useCallback(()=>{const q=parseInt(oe.port,10);if(!oe.name.trim()){Ue.error("Service name is required");return}if(!q||q<1||q>65535){Ue.error("Port must be between 1 and 65535");return}v.mutate({name:oe.name.trim(),host:oe.host.trim()||"localhost",port:q,scheme:oe.scheme,health_path:oe.health_path.trim()||"/health",description:oe.description.trim()},{onSuccess:ae=>{const Ce=ae.results[0];Ce?.config_ok?(Ue.success(`Added ${oe.name.trim()}`),fe(Rx),le(!1)):Ue.error(`Failed to add: ${Ce?.error??"Unknown error"}`)},onError:ae=>{Ue.error(`Failed to add service: ${ae.message}`)}})},[oe,v]),ie=S.useCallback(q=>{navigator.clipboard.writeText(q).then(()=>{F(q),setTimeout(()=>F(null),2e3)})},[]),se=n?.services.filter(q=>ve(q.name).checked).length??0,ye=M?.some(q=>q.env_written)||w?.env_written===!0;return l?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(At,{className:"animate-spin text-[var(--color-primary)]",size:24})}):s?o.jsxs("div",{className:"py-20 text-center",children:[o.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load service registry"}),o.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),o.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):o.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Services"}),o.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:n?.services.length??0})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>le(q=>!q),className:re("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium",te?"bg-[var(--color-surface-alt)] text-[var(--color-text)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[te?o.jsx(zd,{size:14}):o.jsx(ei,{size:14}),te?"Cancel":"Add Service"]}),o.jsx("button",{onClick:()=>d(),disabled:f,className:re("rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:o.jsx(At,{size:14})})]})]}),te&&o.jsxs("div",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[o.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Add Service"}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{ref:Le,className:"relative",children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Service"}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"text",value:oe.name,onChange:q=>{fe(ae=>({...ae,name:q.target.value})),ge(!0)},onFocus:()=>ge(!0),placeholder:"Select or type a service name...",className:re("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)]")}),o.jsx("button",{type:"button",onClick:()=>ge(q=>!q),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:o.jsx(_d,{size:14})})]}),Ee&&P.length>0&&o.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:P.map(q=>o.jsxs("button",{type:"button",onClick:()=>Z(q),className:"flex w-full flex-col px-3 py-2 text-left hover:bg-[var(--color-surface-alt)]",children:[o.jsxs("span",{className:"text-sm font-medium text-[var(--color-text)]",children:[q.name,o.jsxs("span",{className:"ml-2 font-normal text-[var(--color-text-muted)]",children:[":",q.port]})]}),o.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:q.description})]},q.id))})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Description"}),o.jsx("input",{type:"text",value:oe.description,onChange:q=>fe(ae=>({...ae,description:q.target.value})),placeholder:"e.g. Camera streaming via WebRTC",className:re("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)]")})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Host"}),o.jsx("input",{type:"text",value:oe.host,onChange:q=>fe(ae=>({...ae,host:q.target.value})),placeholder:"localhost",className:re("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)]")})]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Port"}),o.jsx("input",{type:"number",value:oe.port,onChange:q=>fe(ae=>({...ae,port:q.target.value})),placeholder:"e.g. 1984",className:re("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)]")})]}),o.jsxs("div",{className:"w-20",children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Scheme"}),o.jsxs("select",{value:oe.scheme,onChange:q=>fe(ae=>({...ae,scheme:q.target.value})),className:re("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:[o.jsx("option",{value:"http",children:"http"}),o.jsx("option",{value:"https",children:"https"}),o.jsx("option",{value:"mqtt",children:"mqtt"}),o.jsx("option",{value:"mqtts",children:"mqtts"}),o.jsx("option",{value:"ws",children:"ws"}),o.jsx("option",{value:"wss",children:"wss"})]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Health Path"}),o.jsx("input",{type:"text",value:oe.health_path,onChange:q=>fe(ae=>({...ae,health_path:q.target.value})),placeholder:"/health",className:re("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)]")})]})]}),o.jsx("div",{className:"mt-3 flex justify-end",children:o.jsx("button",{onClick:B,disabled:v.isPending||!oe.name.trim()||!oe.port,className:re("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:v.isPending?"Adding...":"Add Service"})})]}),o.jsx("div",{className:"space-y-2",children:n?.services.map(q=>{const ae=ve(q.name),Ce=W[q.name]??{status:"idle"};return o.jsx($w,{entry:q,checked:ae.checked,host:ae.host,port:ae.port,scheme:ae.scheme,onToggle:()=>{const Me=!ae.checked;pe(q.name,{...ae,checked:Me}),Me?T(q.name,ae.host,ae.port,q.health_path,ae.scheme):ee(ga=>({...ga,[q.name]:{status:"idle"}}))},onHostChange:Me=>pe(q.name,{...ae,host:Me}),onPortChange:Me=>pe(q.name,{...ae,port:Me}),onSchemeChange:Me=>pe(q.name,{...ae,scheme:Me}),onHostBlur:()=>{ae.checked&&T(q.name,ae.host,ae.port,q.health_path,ae.scheme)},onPortBlur:()=>{ae.checked&&T(q.name,ae.host,ae.port,q.health_path,ae.scheme)},onRotateKey:()=>V(q.name),onDelete:()=>I(q.name),disabled:m.isPending,rotating:O===q.name,deleting:Y===q.name,healthStatus:Ce.status,healthError:Ce.error,healthLatency:Ce.latency},q.name)})}),o.jsx("button",{onClick:Q,disabled:m.isPending||se===0,className:re("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 (${se})`}),w&&o.jsx(Iw,{serviceName:w.service_name,appKey:w.app_key,envWritten:w.env_written,copiedKey:$,onCopy:ie,label:"Rotated Key"}),M&&o.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Registration Results"}),M.map(q=>o.jsxs("div",{className:re("flex flex-wrap items-center gap-3 rounded-lg border p-3 text-sm",q.config_ok&&q.auth_ok?"border-green-500/20 bg-green-500/5":"border-yellow-500/20 bg-yellow-500/5"),children:[o.jsx("span",{className:"min-w-[180px] font-medium text-[var(--color-text)]",children:q.name}),o.jsxs("span",{className:re("text-xs",q.config_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Config: ",q.config_ok?"OK":"Failed"]}),o.jsxs("span",{className:re("text-xs",q.auth_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Auth: ",q.auth_ok?q.auth_created?"Created":"Exists":"Failed"]}),q.env_written!==null&&o.jsxs("span",{className:re("text-xs",q.env_written?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",q.env_written?"Written":"Failed"]}),q.error&&o.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-600 dark:text-yellow-400",children:[o.jsx(ta,{size:12}),q.error]}),q.auth_created&&q.app_key&&o.jsxs("div",{className:"mt-1 w-full",children:[o.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[o.jsx(ta,{size:12}),"App key (shown once only):"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.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:q.app_key}),o.jsx("button",{onClick:()=>ie(q.app_key),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:$===q.app_key?o.jsx(pi,{size:14,className:"text-green-500"}):o.jsx(Fg,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]},q.name))]}),ye&&o.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-blue-500/20 bg-blue-500/5 p-3",children:[o.jsx(YN,{size:16,className:"mt-0.5 shrink-0 text-blue-500"}),o.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 Iw({serviceName:n,appKey:l,envWritten:s,copiedKey:i,onCopy:d,label:f}){return o.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:[f,": ",n]}),o.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-3",children:[s!==null&&o.jsxs("span",{className:re("mb-2 inline-block text-xs",s?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",s?"Written":"Failed"]}),o.jsxs("div",{children:[o.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[o.jsx(ta,{size:12}),"New app key (shown once only):"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.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}),o.jsx("button",{onClick:()=>d(l),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:i===l?o.jsx(pi,{size:14,className:"text-green-500"}):o.jsx(Fg,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]})]})}async function Ww(){const{data:n}=await we.get("/api/llm-setup/status");return n}async function eE(n){const{data:l}=await we.post("/api/llm-setup/configure",{settings:n});return l}async function tE(n,l,s){const{data:i}=await we.post("/api/llm-setup/download",{repo:n,filename:l,token:s});return i}function aE(){return na({queryKey:["llm-status"],queryFn:Ww,staleTime:3e4,retry:1})}function uv(){const n=kt();return Xt({mutationFn:l=>eE(l),onSuccess:()=>{n.invalidateQueries({queryKey:["llm-status"]}),n.invalidateQueries({queryKey:["containers"]})}})}function nE(){return Xt({mutationFn:({repo:n,filename:l,token:s})=>tE(n,l,s)})}async function Ud(){const{data:n}=await we.get("/api/install/status");return n}async function rE(n){const l=n?.length?{services:n.join(",")}:{},{data:s}=await we.get("/api/install/preflight",{params:l});return s}async function lE(){const{data:n}=await we.get("/api/install/hardware");return n}async function Cx(n){const{data:l}=await we.post("/api/install/generate",n);return l}async function dv(){const{data:n}=await we.get("/api/install/registry");return n}async function sE(){const{data:n}=await we.get("/api/install/defaults");return n}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 iE(n){return n.match(/^Up (.+)$/)?.[1]??null}function _x({container:n,onRestart:l,isRestarting:s}){const i=iE(n.status),d=n.ports.find(f=>f.public)?.public;return o.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[o.jsx("div",{className:re("h-2.5 w-2.5 rounded-full",oE[n.state]??"bg-gray-400")}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:n.displayName??n.name}),n.description&&o.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:n.description})]}),o.jsx("span",{className:re("rounded-full px-2 py-0.5 text-xs font-medium",n.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:n.state})]}),o.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-2",children:o.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-text-muted)]",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[i&&o.jsxs("span",{children:["Up ",i]}),d&&o.jsxs("span",{children:[":",d]})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[d&&o.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:o.jsx(UN,{size:13})}),o.jsx("button",{onClick:()=>l(n.id),disabled:s,className:re("rounded p-1 hover:bg-[var(--color-surface-alt)]",s&&"animate-spin"),title:"Restart",children:o.jsx(Kg,{size:13})})]})]})})]})}async function cE(){const{data:n}=await we.get("/api/update/check");return n}function fv(){return na({queryKey:["update-check"],queryFn:cE,staleTime:300*1e3,retry:1,refetchOnWindowFocus:!1})}const Mx="jarvis-update-dismissed-version";function Ax(){const n=wa(),{data:l}=fv(),[s,i]=S.useState(()=>l?.latestVersion?localStorage.getItem(Mx)===l.latestVersion:!1);return!l?.updateAvailable||s?null:o.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Yg,{size:20,className:"text-green-500"}),o.jsxs("div",{children:[o.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Jarvis v",l.latestVersion," available"]}),o.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["You have v",l.currentVersion]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[l.releaseUrl&&o.jsx("a",{href:l.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Release notes"}),o.jsx("button",{onClick:()=>{localStorage.setItem(Mx,l.latestVersion),i(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),o.jsx("button",{onClick:()=>n("/update"),className:"rounded-lg bg-green-600 px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Update"})]})]})}const Vu="jarvis-admin:llm-setup-dismissed";function uE(){const n=wa(),[l,s]=S.useState(!1),{data:i,isLoading:d,isError:f,error:m,refetch:x,isFetching:v}=iv(),g=cv(),y=aE(),[p,j]=S.useState(()=>!!localStorage.getItem(Vu));S.useEffect(()=>{Ud().then(_=>{_.deployMode==="compose-export"&&s(!0)}).catch(()=>{})},[]);const M=!!y.data&&!y.data.configured&&!p,N=_=>{g.mutate(_,{onSuccess:()=>Ue.success("Container restart initiated"),onError:Y=>Ue.error(`Restart failed: ${Y.message}`)})};if(l)return o.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[o.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),o.jsx(Ax,{}),M&&o.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(id,{size:20,className:"text-[var(--color-primary)]"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),o.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:()=>{localStorage.setItem(Vu,"true"),j(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),o.jsx("button",{onClick:()=>n("/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"})]})]}),o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-8 text-center",children:[o.jsx(kd,{size:32,className:"mx-auto mb-3 text-[var(--color-text-muted)]"}),o.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Running in Docker Compose mode"}),o.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 o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(At,{className:"animate-spin text-[var(--color-primary)]",size:24})});if(f)return o.jsxs("div",{className:"py-20 text-center",children:[o.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load containers"}),o.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:m?.message??"Unknown error"}),o.jsx("button",{onClick:()=>x(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]});const w=i?.containers??[],R=w.filter(_=>_.state==="running"),O=w.filter(_=>_.state!=="running");return o.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[o.jsxs("span",{children:[R.length,"/",w.length," running"]}),o.jsx("button",{onClick:()=>x(),disabled:v,className:re("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",v&&"animate-spin"),title:"Refresh",children:o.jsx(At,{size:14})})]})]}),o.jsx(Ax,{}),M&&o.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(id,{size:20,className:"text-[var(--color-primary)]"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),o.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:()=>{localStorage.setItem(Vu,"true"),j(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),o.jsx("button",{onClick:()=>n("/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"})]})]}),o.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Xg,{size:20,className:"text-[var(--color-text-muted)]"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Sync compose to latest registry"}),o.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"})]})]}),o.jsx("button",{onClick:()=>n("/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"})]}),w.length===0&&o.jsx("div",{className:"py-12 text-center",children:o.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:i?.error?i.error:"No Jarvis containers found. Is Docker running?"})}),R.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Running"}),o.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:R.map(_=>o.jsx(_x,{container:_,onRestart:N,isRestarting:g.isPending&&g.variables===_.id},_.id))})]}),O.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Stopped"}),o.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:O.map(_=>o.jsx(_x,{container:_,onRestart:N,isRestarting:g.isPending&&g.variables===_.id},_.id))})]})]})}async function dE(){const{data:n}=await we.get("/api/nodes");return n}async function fE(n){const{data:l}=await we.get(`/api/nodes/${n}/nodes`);return l}async function mE(n){const{data:l}=await we.post(`/api/nodes/${n}/train-adapter`);return l}function hE(){return na({queryKey:["households"],queryFn:dE,staleTime:3e4})}function pE(n){return na({queryKey:["household-nodes",n],queryFn:()=>fE(n),enabled:!!n,staleTime:3e4})}function xE(){const n=kt();return Xt({mutationFn:mE,onSuccess:()=>{n.invalidateQueries({queryKey:["household-nodes"]})}})}function gE({node:n,onTrain:l,isTraining:s}){return o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(sl,{size:16,className:"text-[var(--color-text-muted)]"}),o.jsx("span",{className:"font-medium text-[var(--color-text)]",children:n.name})]}),o.jsxs("span",{className:re("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",n.is_active?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-500"),children:[n.is_active?o.jsx(si,{size:10}):o.jsx(jj,{size:10}),n.is_active?"Active":"Inactive"]})]}),o.jsxs("div",{className:"mt-3 space-y-1 text-xs text-[var(--color-text-muted)]",children:[o.jsxs("p",{children:[o.jsx("span",{className:"font-medium",children:"ID:"})," ",n.node_id]}),n.services.length>0&&o.jsxs("p",{children:[o.jsx("span",{className:"font-medium",children:"Services:"})," ",n.services.join(", ")]})]}),o.jsx("div",{className:"mt-4",children:o.jsx("button",{onClick:()=>l(n.node_id),disabled:s||!n.is_active,className:re("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",s||!n.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:s?o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(At,{size:12,className:"animate-spin"}),"Training..."]}):"Train Adapter"})})]})}function vE({householdId:n,householdName:l}){const{data:s,isLoading:i,isError:d}=pE(n),f=xE(),m=x=>{f.mutate(x,{onSuccess:v=>Ue.success(`Training triggered for ${x} (request: ${v.request_id.slice(0,8)}...)`),onError:v=>Ue.error(`Training failed: ${v.message}`)})};return o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:l}),i&&o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(At,{className:"animate-spin text-[var(--color-primary)]",size:18})}),d&&o.jsx("p",{className:"py-4 text-center text-sm text-red-500",children:"Failed to load nodes"}),s&&s.length===0&&o.jsx("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:"No nodes registered in this household"}),s&&s.length>0&&o.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:s.map(x=>o.jsx(gE,{node:x,onTrain:m,isTraining:f.isPending&&f.variables===x.node_id},x.node_id))})]})}function yE(){const{data:n,isLoading:l,isError:s,error:i,refetch:d,isFetching:f}=hE();return l?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(At,{className:"animate-spin text-[var(--color-primary)]",size:24})}):s?o.jsxs("div",{className:"py-20 text-center",children:[o.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load households"}),o.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:i?.message??"Unknown error"}),o.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):o.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Nodes"}),o.jsx("button",{onClick:()=>d(),disabled:f,className:re("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:o.jsx(At,{size:14,className:"text-[var(--color-text-muted)]"})})]}),(!n||n.length===0)&&o.jsx("div",{className:"py-12 text-center",children:o.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No households found. Register a household in jarvis-auth first."})}),n?.map(m=>o.jsx(vE,{householdId:m.id,householdName:m.name},m.id))]})}async function bE(){const{data:n}=await we.get("/api/models/installed");return n.models}async function SE(n){const{data:l}=await we.post("/api/models/download",n);return l}async function NE(n){await we.delete(`/api/models/${encodeURIComponent(n)}`)}function jE(){return na({queryKey:["models","installed"],queryFn:bE,staleTime:1e4})}function mv(){const n=kt();return Xt({mutationFn:l=>SE(l),onSuccess:()=>{n.invalidateQueries({queryKey:["models","installed"]})}})}function wE(){const n=kt();return Xt({mutationFn:l=>NE(l),onSuccess:()=>{n.invalidateQueries({queryKey:["models","installed"]})}})}const nl=[{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:"qwen3",contextWindow:40960,sizeVllm:"2.5GB",sizeGguf:"2.5GB",vramMb:4096,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{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:"qwen3",contextWindow:40960,sizeVllm:"5.7GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{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:"qwen3",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:"llama3",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 EE(){const[n,l]=S.useState(""),[s,i]=S.useState(""),[d,f]=S.useState(""),[m,x]=S.useState(null),{data:v,isLoading:g}=jE(),y=mv(),p=wE();function j(w,R){const O=`${w}/${R??""}`;x(O),y.mutate({repo:w,filename:R||void 0,token:n||void 0},{onSuccess:_=>{Ue.success(_.message),x(null)},onError:_=>{Ue.error(_ instanceof Error?_.message:"Download failed"),x(null)}})}function M(w){confirm(`Delete ${w}?`)&&p.mutate(w,{onSuccess:()=>Ue.success(`Deleted ${w}`),onError:()=>Ue.error("Failed to delete")})}function N(){s&&j(s,d)}return o.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Models"}),o.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Manage LLM models on the inference server"})]}),o.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(XN,{size:16,className:"text-[var(--color-text-muted)]"}),o.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Token"}),o.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"(optional, for gated models)"})]}),o.jsx("input",{type:"password",value:n,onChange:w=>l(w.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)]"})]}),o.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx(Md,{size:16,className:"text-[var(--color-text-muted)]"}),o.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Installed Models"})]}),g?o.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading..."}):v?.length?o.jsx("div",{className:"space-y-2",children:v.map(w=>o.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-3 py-2",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:w.name}),o.jsx("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:w.sizeFormatted})]}),o.jsx("button",{onClick:()=>M(w.name),disabled:p.isPending,className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",children:o.jsx(Od,{size:14})})]},w.name))}):o.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No models installed yet"})]}),o.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx(xj,{size:16,className:"text-[var(--color-text-muted)]"}),o.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Suggested Models"})]}),o.jsx("div",{className:"space-y-3",children:nl.map(w=>{const R=v?.some(O=>O.name===w.ggufFilename||O.name.includes(w.ggufFilename));return o.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-4 py-3",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:w.displayName}),o.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:["~",w.sizeGguf]}),R&&o.jsx("span",{className:"rounded bg-green-500/10 px-1.5 py-0.5 text-xs text-green-500",children:"installed"})]}),o.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[w.hfRepoGguf," / ",w.ggufFilename]}),o.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Prompt provider: ",o.jsx("code",{className:"text-[var(--color-primary)]",children:w.promptProvider})]})]}),o.jsxs("button",{onClick:()=>j(w.hfRepoGguf,w.ggufFilename),disabled:m!==null,className:re("ml-4 flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",R?"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:[o.jsx(hs,{size:14}),m===`${w.hfRepoGguf}/${w.ggufFilename}`?"Downloading...":R?"Re-download":"Download"]})]},w.id)})})]}),o.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx(hs,{size:16,className:"text-[var(--color-text-muted)]"}),o.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Download from HuggingFace"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Repository (e.g. Qwen/Qwen3-14B-GGUF)"}),o.jsx("input",{value:s,onChange:w=>i(w.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)]"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Filename (optional — downloads specific file instead of full repo)"}),o.jsx("input",{value:d,onChange:w=>f(w.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)]"})]}),o.jsxs("button",{onClick:N,disabled:!s||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:[o.jsx(hs,{size:14}),m===`${s}/${d}`?"Downloading...":"Download"]})]})]})]})}async function TE(){const{data:n}=await we.get("/api/quick-sets");return n}async function RE(n){const{data:l}=await we.post("/api/quick-sets/apply",n);return l}async function CE(n){const{data:l}=await we.post("/api/quick-sets/custom",n);return l}async function _E(n){const{data:l}=await we.delete(`/api/quick-sets/custom/${n}`);return l}function ME(){return na({queryKey:["quick-sets"],queryFn:TE,staleTime:6e4})}function AE(){const n=kt();return Xt({mutationFn:l=>RE(l),onSuccess:()=>{n.invalidateQueries({queryKey:["quick-sets"]}),n.invalidateQueries({queryKey:["settings"]}),n.invalidateQueries({queryKey:["llm-status"]}),n.invalidateQueries({queryKey:["containers"]})}})}function kE(){const n=kt();return Xt({mutationFn:l=>CE(l),onSuccess:()=>{n.invalidateQueries({queryKey:["quick-sets"]})}})}function OE(){const n=kt();return Xt({mutationFn:l=>_E(l),onSuccess:()=>{n.invalidateQueries({queryKey:["quick-sets"]})}})}const kx=["GGUF","MLX","VLLM","TRANSFORMERS","REST"];function zE(){const{data:n,isLoading:l,error:s}=ME(),i=AE(),d=kE(),f=OE(),[m,x]=S.useState(null),[v,g]=S.useState(""),[y,p]=S.useState(""),[j,M]=S.useState(""),[N,w]=S.useState(""),[R,O]=S.useState(""),[_,Y]=S.useState(new Set(["live"])),[L,$]=S.useState(!1),[F,W]=S.useState(""),[ee,te]=S.useState(""),[le,oe]=S.useState(""),[fe,Ee]=S.useState(""),[ge,Le]=S.useState("GGUF"),[k,P]=S.useState(8192),Z=S.useMemo(()=>{if(!n?.presets)return new Map;const B=new Map;for(const ie of n.presets){const se=ie.family||"Custom",ye=B.get(se)??[];ye.push(ie),B.set(se,ye)}return B},[n?.presets]);function ve(B){if(m===B.id){x(null);return}x(B.id),g(n?.currentValues.modelName??""),M(B.defaultBackend),w(B.chatFormat),O(B.promptProvider);const ie=n?.currentValues.contextWindow;p(ie&&ie>0?ie:B.defaultContextWindow)}function pe(B){Y(ie=>{const se=new Set(ie);return se.has(B)?se.size>1&&se.delete(B):se.add(B),se})}function T(){!m||!v.trim()||i.mutate({presetId:m,modelName:v.trim(),contextWindow:y?Number(y):void 0,backend:j,chatFormat:N,promptProvider:R,targets:Array.from(_)},{onSuccess:B=>{B.success?Ue.success(B.message):Ue.warning(B.message),x(null)},onError:B=>{Ue.error(B.message||"Failed to apply preset")}})}function Q(){!F.trim()||!le.trim()||!fe.trim()||d.mutate({name:F.trim(),family:ee.trim()||"Custom",chatFormat:le.trim(),promptProvider:fe.trim(),defaultBackend:ge,defaultContextWindow:k?Number(k):8192},{onSuccess:()=>{Ue.success(`Created preset "${F.trim()}"`),$(!1),W(""),te(""),oe(""),Ee(""),Le("GGUF"),P(8192)},onError:B=>{Ue.error(B.message||"Failed to create preset")}})}function V(B){f.mutate(B.id,{onSuccess:()=>{Ue.success(`Deleted "${B.name}"`),m===B.id&&x(null)},onError:()=>Ue.error("Failed to delete preset")})}const I=n?.presets.find(B=>B.id===m);return o.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Quick Sets"}),o.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Select a model preset to auto-configure chat format, prompt provider, and backend"})]}),n?.currentValues.modelName&&o.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3",children:[o.jsx(sl,{size:16,className:"text-[var(--color-primary)]"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Current model"}),o.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:n.currentValues.modelName})]}),n.currentValues.contextWindow>0&&o.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-2 py-0.5 text-xs text-[var(--color-text-muted)]",children:[n.currentValues.contextWindow.toLocaleString()," ctx"]})]}),l&&o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(At,{size:20,className:"animate-spin text-[var(--color-text-muted)]"})}),s&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-4 py-3",children:[o.jsx(ta,{size:16,className:"text-red-500"}),o.jsx("span",{className:"text-sm text-red-500",children:"Failed to load presets"})]}),!l&&Array.from(Z.entries()).map(([B,ie])=>o.jsxs("section",{children:[o.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text-muted)]",children:B}),o.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:ie.map(se=>o.jsxs("div",{className:re("relative rounded-lg border px-4 py-3 transition-colors",m===se.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:[o.jsxs("button",{onClick:()=>ve(se),className:"w-full text-left",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:se.name}),m===se.id&&o.jsx(pi,{size:16,className:"text-[var(--color-primary)]"})]}),se.description&&o.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:se.description}),o.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[o.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:se.chatFormat}),o.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:se.defaultBackend})]})]}),se.isCustom&&o.jsx("button",{onClick:()=>V(se),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:o.jsx(Od,{size:14})})]},se.id))})]},B)),!l&&!L&&o.jsxs("button",{onClick:()=>$(!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:[o.jsx(ei,{size:16}),"Create custom preset"]}),L&&o.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ei,{size:16,className:"text-[var(--color-primary)]"}),o.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"New Custom Preset"})]}),o.jsx("button",{onClick:()=>$(!1),className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:o.jsx(zd,{size:16})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Name *"}),o.jsx("input",{type:"text",value:F,onChange:B=>W(B.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)]"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Family"}),o.jsx("input",{type:"text",value:ee,onChange:B=>te(B.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)]"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format *"}),o.jsx("input",{type:"text",value:le,onChange:B=>oe(B.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)]"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider *"}),o.jsx("input",{type:"text",value:fe,onChange:B=>Ee(B.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)]"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default backend"}),o.jsx("select",{value:ge,onChange:B=>Le(B.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:kx.map(B=>o.jsx("option",{value:B,children:B},B))})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default context window"}),o.jsx("input",{type:"number",value:k,onChange:B=>P(B.target.value?parseInt(B.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)]"})]})]}),o.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[o.jsxs("button",{onClick:Q,disabled:!F.trim()||!le.trim()||!fe.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?o.jsx(At,{size:14,className:"animate-spin"}):o.jsx(ei,{size:14}),d.isPending?"Creating...":"Create Preset"]}),o.jsx("button",{onClick:()=>$(!1),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]}),I&&o.jsxs("section",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[o.jsx(si,{size:16,className:"text-[var(--color-primary)]"}),o.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:["Apply: ",I.name]})]}),o.jsxs("div",{className:"mb-4",children:[o.jsx("span",{className:"mb-2 block text-xs font-medium text-[var(--color-text-muted)]",children:"Apply to"}),o.jsx("div",{className:"flex items-center gap-4",children:["live","background"].map(B=>o.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[o.jsx("input",{type:"checkbox",checked:_.has(B),onChange:()=>pe(B),className:"rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),o.jsx("span",{className:"capitalize",children:B})]},B))})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Model file path"}),o.jsx("input",{type:"text",value:v,onChange:B=>g(B.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)]"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format"}),o.jsx("input",{type:"text",value:N,onChange:B=>w(B.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)]"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider"}),o.jsx("input",{type:"text",value:R,onChange:B=>O(B.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)]"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Context window (tokens)"}),o.jsx("input",{type:"number",value:y,onChange:B=>p(B.target.value?parseInt(B.target.value,10):""),placeholder:String(I.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)]"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Backend"}),o.jsx("select",{value:j,onChange:B=>M(B.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:kx.map(B=>o.jsx("option",{value:B,children:B},B))})]})]})]}),o.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[o.jsxs("button",{onClick:T,disabled:!v.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?o.jsx(At,{size:14,className:"animate-spin"}):o.jsx(si,{size:14}),i.isPending?"Applying...":"Apply Settings"]}),o.jsx("button",{onClick:()=>x(null),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]})}const Yu={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 DE(){const n=wa(),{data:l,isLoading:s}=fv(),[i,d]=S.useState("idle"),[f,m]=S.useState([]),[x,v]=S.useState(null),g=S.useRef(null),y=S.useCallback(M=>{m(N=>[...N,M])},[]);S.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[f]);async function p(){d("preflight"),m([]),v(null);try{const M=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),N=await fetch("/api/update/apply",{method:"POST",headers:{Authorization:`Bearer ${M}`}});if(!N.ok||!N.body){const _=await N.text();throw new Error(_||`HTTP ${N.status}`)}const w=N.body.getReader(),R=new TextDecoder;let O="";for(;;){const{done:_,value:Y}=await w.read();if(_)break;O+=R.decode(Y,{stream:!0});const L=O.split(`
17
+ `);O=L.pop()??"";for(const $ of L)if($.startsWith("data: "))try{const F=JSON.parse($.slice(6));if(F.phase&&d(F.phase),F.message&&y({text:F.message,phase:F.phase}),F.stream&&F.text&&y({text:F.text.trim()}),F.restart){d("restarting"),y({text:"Admin server restarting with new version..."}),await UE(l?.latestVersion??""),d("done"),y({text:"Upgrade complete!"});return}if(F.done&&F.code!==0)throw new Error(F.error??"Upgrade failed");F.done&&F.code===0&&d("done")}catch(F){if(F instanceof SyntaxError)continue;throw F}}}catch(M){const N=M instanceof Error?M.message:String(M);v(N),d("error"),y({text:`Error: ${N}`})}}if(s)return o.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:o.jsx(pa,{size:24,className:"animate-spin text-[var(--color-primary)]"})});const j=Object.keys(Yu).filter(M=>{const N=Object.keys(Yu),w=N.indexOf(i);return N.indexOf(M)<w});return o.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Update Jarvis"}),l?.updateAvailable?o.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["v",l.currentVersion," → v",l.latestVersion]}):o.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["You're running the latest version (v",l?.currentVersion??"?",")"]})]}),i!=="idle"&&o.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries(Yu).map(([M,N])=>{const w=M===i,R=j.includes(M),O=M===i&&i==="error";return o.jsxs("div",{className:"flex items-center gap-2",children:[R?o.jsx(St,{size:16,className:"text-green-500"}):O?o.jsx(ta,{size:16,className:"text-red-500"}):w?o.jsx(pa,{size:16,className:"animate-spin text-[var(--color-primary)]"}):o.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),o.jsx("span",{className:re("text-sm",w?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",R&&"text-green-500"),children:N})]},M)})}),f.length>0&&o.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:f.map((M,N)=>o.jsx("div",{children:M.text},N))}),x&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[o.jsx(ta,{size:14,className:"text-red-500"}),o.jsx("span",{className:"text-sm text-red-500",children:x})]}),o.jsxs("div",{className:"flex gap-3",children:[i==="idle"&&l?.updateAvailable&&o.jsxs("button",{onClick:p,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:[o.jsx(Yg,{size:16}),"Update to v",l.latestVersion]}),i==="done"&&o.jsxs("button",{onClick:()=>n("/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:[o.jsx(St,{size:16}),"Go to Dashboard"]}),i==="error"&&o.jsxs("button",{onClick:p,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:[o.jsx(At,{size:16}),"Retry"]})]})]})}async function UE(n,l=6e4){const s=Date.now()+l;for(;Date.now()<s;){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 Fu={regenerate:"Regenerating compose from registry",apply:"Applying changes (docker compose up)",done:"Complete"};function LE(){const n=wa(),l=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),[s,i]=S.useState("loading_options"),[d,f]=S.useState([]),[m,x]=S.useState(null),v=S.useRef(null),[g,y]=S.useState([]),[p,j]=S.useState(!1),[M,N]=S.useState("https://relay.jarvisautomation.io"),[w,R]=S.useState("/whisper-models/ggml-base.en.bin"),O=S.useCallback($=>{f(F=>[...F,$])},[]);S.useEffect(()=>{v.current&&(v.current.scrollTop=v.current.scrollHeight)},[d]),S.useEffect(()=>{async function $(){try{const F=await fetch("/api/install/reconcile/options",{headers:{Authorization:`Bearer ${l}`}});if(!F.ok)throw new Error(`HTTP ${F.status}`);const W=await F.json();y(W.services),j(W.relayEnabled),N(W.relayUrl||"https://relay.jarvisautomation.io"),R(W.whisperModelPath||"/whisper-models/ggml-base.en.bin"),i("options")}catch(F){x(F instanceof Error?F.message:"Failed to load options"),i("error")}}$()},[l]);function _($){y(F=>F.map(W=>W.id===$?{...W,enabled:!W.enabled}:W))}async function Y(){i("regenerate"),f([]),x(null);const $=g.filter(F=>F.enabled).map(F=>F.id);try{const F=await fetch("/api/install/reconcile",{method:"POST",headers:{Authorization:`Bearer ${l}`,"Content-Type":"application/json"},body:JSON.stringify({enabledModules:$,relayEnabled:p,relayUrl:M,whisperModelPath:w})});if(!F.ok||!F.body){const le=await F.text();throw new Error(le||`HTTP ${F.status}`)}const W=F.body.getReader(),ee=new TextDecoder;let te="";for(;;){const{done:le,value:oe}=await W.read();if(le)break;te+=ee.decode(oe,{stream:!0});const fe=te.split(`
18
+ `);te=fe.pop()??"";for(const Ee of fe)if(Ee.startsWith("data: "))try{const ge=JSON.parse(Ee.slice(6));if(ge.phase&&i(ge.phase),ge.message&&O({text:ge.message,phase:ge.phase}),ge.stream&&ge.text&&O({text:ge.text.trim()}),ge.done&&ge.code!==0)throw new Error(ge.message??"Reconcile failed")}catch(ge){if(ge instanceof SyntaxError)continue;throw ge}}}catch(F){const W=F instanceof Error?F.message:String(F);x(W),i("error"),O({text:`Error: ${W}`})}}const L=Object.keys(Fu).filter($=>{const F=Object.keys(Fu),W=F.indexOf(s);return F.indexOf($)<W||s==="done"&&$==="done"});return o.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Sync Compose"}),o.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Regenerate ",o.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 and apply changes to the running stack."]})]}),s==="loading_options"&&o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(pa,{size:32,className:"animate-spin text-[var(--color-primary)]"})}),s==="options"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Services"}),o.jsx("div",{className:"space-y-2",children:g.map($=>o.jsxs("button",{onClick:()=>_($.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:[$.enabled?o.jsx(St,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):o.jsx(ll,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:$.name}),o.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:$.description})]})]},$.id))})]}),o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Integrations"}),o.jsxs("button",{onClick:()=>j(!p),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:[p?o.jsx(St,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):o.jsx(ll,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),o.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]}),p&&o.jsxs("div",{className:"mt-2 px-3",children:[o.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Relay URL"}),o.jsx("input",{type:"url",value:M,onChange:$=>N($.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)]"})]})]}),g.some($=>$.id==="jarvis-whisper-api"&&$.enabled)&&o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Whisper"}),o.jsxs("div",{className:"px-3",children:[o.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Model path"}),o.jsx("input",{type:"text",value:w,onChange:$=>R($.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)]"}),o.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Path inside the container. Place model files in ",o.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"./whisper-models/"})," next to your compose file."]})]})]})]}),s!=="loading_options"&&s!=="options"&&o.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries(Fu).map(([$,F])=>{const W=$===s,ee=L.includes($),te=$===s&&s==="error";return o.jsxs("div",{className:"flex items-center gap-2",children:[ee?o.jsx(St,{size:16,className:"text-green-500"}):te?o.jsx(ta,{size:16,className:"text-red-500"}):W?o.jsx(pa,{size:16,className:"animate-spin text-[var(--color-primary)]"}):o.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),o.jsx("span",{className:re("text-sm",W?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",ee&&"text-green-500"),children:F})]},$)})}),d.length>0&&o.jsx("div",{ref:v,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(($,F)=>o.jsx("div",{children:$.text},F))}),m&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[o.jsx(ta,{size:14,className:"text-red-500"}),o.jsx("span",{className:"text-sm text-red-500",children:m})]}),o.jsxs("div",{className:"flex gap-3",children:[s==="options"&&o.jsxs("button",{onClick:Y,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:[o.jsx(Xg,{size:16}),"Sync now"]}),(s==="options"||s==="regenerate"||s==="apply"||s==="done")&&o.jsxs("button",{onClick:()=>n("/dashboard"),disabled:s==="regenerate"||s==="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:[o.jsx(St,{size:16}),"Back to dashboard"]}),s==="error"&&o.jsxs("button",{onClick:Y,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:[o.jsx(At,{size:16}),"Retry"]})]})]})}async function BE(n={}){const{data:l}=await we.get("/api/traces",{params:n});return l}async function qE(n){const{data:l}=await we.get(`/api/traces/${n}`);return l}function HE(n){return n<1e3?`${Math.round(n)}ms`:`${(n/1e3).toFixed(1)}s`}function GE(n){return new Date(n).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function QE(){const n=wa(),[l,s]=S.useState(""),[i,d]=S.useState(""),{data:f,isLoading:m,error:x}=na({queryKey:["traces",l,i],queryFn:()=>BE({limit:100,...l?{status:l}:{},...i?{source:i}:{}}),refetchInterval:1e4});return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Request Traces"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("select",{className:"rounded border border-[var(--color-border)] bg-[var(--color-surface)] px-2 py-1 text-sm text-[var(--color-text)]",value:l,onChange:v=>s(v.target.value),children:[o.jsx("option",{value:"",children:"All statuses"}),o.jsx("option",{value:"ok",children:"OK"}),o.jsx("option",{value:"error",children:"Error"})]}),o.jsxs("select",{className:"rounded border border-[var(--color-border)] bg-[var(--color-surface)] px-2 py-1 text-sm text-[var(--color-text)]",value:i,onChange:v=>d(v.target.value),children:[o.jsx("option",{value:"",children:"All sources"}),o.jsx("option",{value:"node",children:"Node"}),o.jsx("option",{value:"mobile",children:"Mobile"})]})]})]}),m&&o.jsx("div",{className:"flex justify-center py-12",children:o.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}),x&&o.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"}),f&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[f.total," traces"]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--color-border)]",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)]",children:[o.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Time"}),o.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Source"}),o.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Command"}),o.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Duration"}),o.jsx("th",{className:"px-3 py-2 text-center font-medium text-[var(--color-text-muted)]",children:"Status"}),o.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Spans"})]})}),o.jsxs("tbody",{children:[f.traces.map(v=>o.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>n(`/traces/${v.id}`),children:[o.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] whitespace-nowrap",children:v.created_at?GE(v.created_at):"-"}),o.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)]",children:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[v.source==="mobile"?"📱":"🔊",v.source]})}),o.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:v.user_command??"-"}),o.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:HE(v.total_duration_ms)}),o.jsx("td",{className:"px-3 py-2 text-center",children:o.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${v.status==="ok"?"bg-green-500":"bg-red-500"}`})}),o.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text-muted)] tabular-nums",children:v.span_count})]},v.id)),f.traces.length===0&&o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-3 py-8 text-center text-[var(--color-text-muted)]",children:"No traces yet"})})]})]})})]})]})}function tl(n){return n<1e3?`${Math.round(n)}ms`:`${(n/1e3).toFixed(1)}s`}const Ox={cc:"#9e9e9e",llm_proxy:"#42a5f5",node:"#66bb6a",tts:"#ffa726",whisper:"#ab47bc"},zx={cc:"Command Center",llm_proxy:"LLM Proxy",node:"Node",tts:"TTS",whisper:"Whisper"};function VE(n){const l=n.filter(d=>d.duration_ms>0),s=l.filter(d=>!l.some(f=>f!==d&&d.start_ms<=f.start_ms&&d.end_ms>=f.end_ms&&f.duration_ms>0));s.sort((d,f)=>d.start_ms-f.start_ms);const i=[];for(const d of s){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 YE(){const{id:n}=y0(),l=wa(),[s,i]=S.useState(!1),[d,f]=S.useState(null),{data:m,isLoading:x,error:v}=na({queryKey:["trace",n],queryFn:()=>qE(n),enabled:!!n}),g=S.useMemo(()=>m?VE(m.spans):[],[m]);return x?o.jsx("div",{className:"flex justify-center py-12",children:o.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}):v||!m?o.jsxs("div",{className:"space-y-4",children:[o.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>l("/traces"),children:"Back to traces"}),o.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"})]}):o.jsxs("div",{className:"space-y-6",children:[o.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>l("/traces"),children:"Back to traces"}),o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-lg font-bold text-[var(--color-text)]",children:m.user_command??"Request Trace"}),o.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():""]})]}),o.jsxs("div",{className:"text-right",children:[o.jsx("div",{className:"text-2xl font-bold tabular-nums text-[var(--color-text)]",children:tl(m.total_duration_ms)}),o.jsxs("div",{className:"flex items-center justify-end gap-1 mt-1",children:[o.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${m.status==="ok"?"bg-green-500":"bg-red-500"}`}),o.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:m.status})]})]})]}),m.error_message&&o.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}),o.jsx("p",{className:"mt-2 text-xs text-[var(--color-text-muted)] font-mono",children:m.conversation_id})]}),o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsx("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-muted)]",children:"Service Flow"}),o.jsx("p",{className:"mb-4 text-xs text-[var(--color-text-muted)] opacity-60",children:g.map(y=>zx[y.service]??y.service).join(" → ")}),o.jsx("div",{className:"space-y-2",children:g.map((y,p)=>{const j=Math.min(y.duration_ms/m.total_duration_ms*100,100),M=y.status==="error"?"#ef4444":Ox[y.service]??"#9e9e9e",N=zx[y.service]??y.service;return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:M}}),o.jsx("span",{className:"w-32 text-sm text-[var(--color-text)] shrink-0",children:N}),o.jsxs("div",{className:"flex-1 h-6 rounded bg-[var(--color-surface-alt)] relative",children:[o.jsx("div",{className:"absolute top-0 left-0 h-full rounded",style:{width:`${Math.max(j,1)}%`,backgroundColor:M,opacity:.7}}),o.jsx("span",{className:"absolute inset-0 flex items-center px-2 text-xs text-[var(--color-text)] opacity-70",children:y.steps.join(", ")})]}),o.jsx("span",{className:"w-16 text-sm text-[var(--color-text)] text-right tabular-nums shrink-0",children:tl(y.duration_ms)})]},`${y.service}-${p}`)})})]}),o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[o.jsxs("button",{className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>{i(y=>!y),f(null)},children:[s?"Hide":"Show"," raw spans (",m.spans.length,")"]}),s&&o.jsx("div",{className:"mt-3 space-y-1",children:m.spans.map((y,p)=>{const j=Math.min(y.duration_ms/m.total_duration_ms*100,100),M=y.start_ms/m.total_duration_ms*100,N=y.status==="error"?"#ef4444":Ox[y.service]??"#9e9e9e",w=d===y;return o.jsxs("div",{className:`flex items-center gap-2 cursor-pointer rounded px-1 py-0.5 ${w?"bg-[var(--color-surface-alt)]":""}`,onClick:()=>f(w?null:y),children:[o.jsx("span",{className:"w-36 truncate text-xs text-[var(--color-text-muted)] text-right shrink-0",children:y.name}),o.jsx("div",{className:"flex-1 relative h-4 rounded bg-[var(--color-surface-alt)]",children:o.jsx("div",{className:"absolute top-0 h-full rounded",style:{left:`${M}%`,width:`${Math.max(j,.5)}%`,backgroundColor:N,minWidth:"2px"}})}),o.jsx("span",{className:"w-14 text-xs text-[var(--color-text-muted)] text-right shrink-0 tabular-nums",children:tl(y.duration_ms)}),o.jsx("span",{className:"w-16 text-xs text-[var(--color-text-muted)] opacity-60 shrink-0",children:y.service})]},`${y.name}-${p}`)})}),d&&s&&o.jsx("div",{className:"mt-3 border-t border-[var(--color-border)] pt-3",children:o.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm max-w-md",children:[o.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Service"}),o.jsx("dd",{className:"text-[var(--color-text)]",children:d.service}),o.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Duration"}),o.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:tl(d.duration_ms)}),o.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Start"}),o.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:tl(d.start_ms)}),o.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"End"}),o.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:tl(d.end_ms)}),o.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Status"}),o.jsx("dd",{className:d.status==="ok"?"text-green-600":"text-red-600",children:d.status}),Object.entries(d.metadata||{}).map(([y,p])=>o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"text-[var(--color-text-muted)]",children:y}),o.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:String(p)})]},y))]})})]})]})}function FE(){return o.jsxs("div",{className:"flex min-h-[60vh] flex-col items-center justify-center",children:[o.jsx("h1",{className:"mb-2 text-4xl font-bold text-[var(--color-text)]",children:"404"}),o.jsx("p",{className:"mb-4 text-[var(--color-text-muted)]",children:"Page not found"}),o.jsx(vd,{to:"/settings",className:"text-[var(--color-primary)] underline hover:opacity-80",children:"Go to Settings"})]})}const XE=7,KE={currentStep:0,totalSteps:XE,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};function ZE(n,l,s){return Math.max(l,Math.min(s,n))}function JE(n,l){switch(l.type){case"SET_STEP":return{...n,currentStep:ZE(l.step,0,n.totalSteps-1)};case"NEXT_STEP":return{...n,currentStep:Math.min(n.currentStep+1,n.totalSteps-1)};case"PREV_STEP":return{...n,currentStep:Math.max(n.currentStep-1,0)};case"SET_ENABLED_MODULES":return{...n,enabledModules:l.modules};case"TOGGLE_MODULE":{if(l.enabled){const s=n.enabledModules.includes(l.serviceId)?n.enabledModules:[...n.enabledModules,l.serviceId];return{...n,enabledModules:s}}return{...n,enabledModules:n.enabledModules.filter(s=>s!==l.serviceId)}}case"SET_PORT_OVERRIDE":return{...n,portOverrides:{...n.portOverrides,[l.serviceId]:l.port}};case"SET_INFRA_PORT_OVERRIDE":return{...n,infraPortOverrides:{...n.infraPortOverrides,[l.infraId]:l.port}};case"SET_SECRET":return{...n,secrets:{...n.secrets,[l.name]:l.value}};case"SET_SECRETS":return{...n,secrets:l.secrets};case"SET_DB_USER":return{...n,dbUser:l.user};case"SET_WHISPER_MODEL":return{...n,whisperModel:l.model};case"SET_LLM_INTERFACE":return{...n,llmInterface:l.interfaceId};case"SET_DEPLOYMENT_MODE":return{...n,deploymentMode:l.mode};case"SET_DEPLOYMENT_TARGET":return{...n,deploymentTarget:l.target};case"SET_REMOTE_LLM_URL":return{...n,remoteLlmUrl:l.url};case"SET_REMOTE_WHISPER_URL":return{...n,remoteWhisperUrl:l.url};case"SET_PLATFORM":return{...n,platform:l.platform};case"SET_HARDWARE":return{...n,hardware:l.hardware,platform:l.hardware.platform};case"SET_RELAY_ENABLED":return{...n,relayEnabled:l.enabled};case"SET_INSTALL_RUNNING":return{...n,installRunning:l.running};case"SET_INSTALL_COMPLETE":return{...n,installRunning:!1,installComplete:!0};default:return n}}const hv=S.createContext(null);function $E({children:n}){const[l,s]=S.useReducer(JE,KE);return o.jsx(hv.Provider,{value:{state:l,dispatch:s},children:n})}function ur(){const n=S.useContext(hv);if(!n)throw new Error("useWizard must be used within a WizardProvider");return n}function PE(){const{state:n,dispatch:l}=ur(),[s,i]=S.useState(null),[d,f]=S.useState(!0),[m,x]=S.useState(!1);function v(){f(!0),x(!1),Ud().then(y=>{i(y);const p=y.reason==="docker_not_found";x(p),l(p?{type:"SET_INSTALL_RUNNING",running:!0}:{type:"SET_INSTALL_RUNNING",running:!1})}).catch(()=>{i({configured:!1,reason:"error"}),x(!0),l({type:"SET_INSTALL_RUNNING",running:!0})}).finally(()=>f(!1))}S.useEffect(()=>{v()},[]);const g=s&&s.reason!=="docker_not_found";return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),o.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."})]}),o.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:o.jsxs("div",{className:"flex items-center gap-3",children:[d?o.jsx(pa,{size:20,className:"animate-spin text-[var(--color-primary)]"}):g?o.jsx(St,{size:20,className:"text-green-500"}):o.jsx(Vg,{size:20,className:"text-red-500"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:d?"Checking Docker...":g?"Docker is running":"Docker not found"}),!d&&!g&&o.jsxs("div",{className:"mt-1 space-y-1",children:[o.jsx("p",{className:"text-xs text-red-400",children:"Docker is required to run Jarvis services."}),o.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Install"," ",o.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&&o.jsxs("button",{type:"button",onClick:v,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:[o.jsx(xi,{size:12}),"Retry"]})]})}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-[var(--color-text)]",children:"Deployment Mode"}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("button",{type:"button",onClick:()=>l({type:"SET_DEPLOYMENT_MODE",mode:"local"}),className:re("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",n.deploymentMode==="local"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[o.jsx(ej,{size:24,className:"text-[var(--color-primary)]"}),o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Local"}),o.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"Everything on this machine"})]}),o.jsxs("button",{type:"button",onClick:()=>l({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"}),className:re("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",n.deploymentMode==="remote-llm"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[o.jsx(kd,{size:24,className:"text-[var(--color-primary)]"}),o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM"}),o.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"LLM on separate GPU machine"})]})]})]})]})}const Xo=[{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 IE(){const{state:n,dispatch:l}=ur(),[s,i]=S.useState(!n.hardware),[d,f]=S.useState(!1),[m,x]=S.useState(0),[v,g]=S.useState("");S.useEffect(()=>{n.hardware||lE().then(j=>{l({type:"SET_HARDWARE",hardware:j}),j.recommendedBackend==="remote"&&n.deploymentMode==="local"&&l({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"})}).catch(()=>{}).finally(()=>i(!1))},[]);function y(j,M){const N=Xo[j];if(!n.hardware)return;const w=N.gpu==="Other"?(parseInt(M??v,10)||0)*1024:N.vramMb,R={...n.hardware,gpuName:N.gpu,gpuVramMb:w||null,gpuType:N.gpuType,recommendedBackends:[...N.backends],recommendedBackend:N.defaultBackend};l({type:"SET_HARDWARE",hardware:R})}const p=n.hardware;return s?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[o.jsx(pa,{size:32,className:"animate-spin text-[var(--color-primary)]"}),o.jsx("p",{className:"mt-3 text-sm text-[var(--color-text-muted)]",children:"Detecting hardware..."})]}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Hardware Detection"}),o.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."})]}),p&&o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[o.jsx(sl,{size:16}),o.jsx("span",{className:"text-xs font-medium uppercase",children:"Platform"})]}),o.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[p.platform==="darwin"?"macOS":"Linux"," (",p.arch,")"]})]}),o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[o.jsx(Md,{size:16}),o.jsx("span",{className:"text-xs font-medium uppercase",children:"Memory"})]}),o.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[p.totalMemoryGb," GB RAM"]})]}),o.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[o.jsx(sl,{size:16}),o.jsx("span",{className:"text-xs font-medium uppercase",children:"GPU"})]}),o.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:p.gpuName??"No GPU detected"}),p.gpuVramMb!=null&&p.gpuVramMb>0&&o.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[Math.round(p.gpuVramMb/1024)," GB VRAM"]})]}),o.jsx("button",{type:"button",onClick:()=>f(!d),className:"text-xs font-medium text-[var(--color-primary)] hover:underline",children:d?"Cancel":"Override"})]}),d&&o.jsxs("div",{className:"mt-3 space-y-3 border-t border-[var(--color-border)] pt-3",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"gpu-select",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Select GPU"}),o.jsx("select",{id:"gpu-select",value:m,onChange:j=>{const M=parseInt(j.target.value,10);x(M),Xo[M].gpu!=="Other"&&(y(M),f(!1))},className:re("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:Xo.map((j,M)=>o.jsx("option",{value:M,children:j.label},`${j.label}-${M}`))})]}),Xo[m].gpu==="Other"&&o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx("label",{htmlFor:"custom-vram",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"VRAM (GB)"}),o.jsx("input",{id:"custom-vram",type:"number",min:1,max:512,value:v,onChange:j=>g(j.target.value),placeholder:"e.g. 24",className:re("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)]")})]}),o.jsx("button",{type:"button",disabled:!v||parseInt(v,10)<=0,onClick:()=>{y(m,v),f(!1)},className:re("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"})]})]})]}),o.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[o.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Recommended: ",o.jsx("span",{className:"text-[var(--color-primary)]",children:p.recommendedBackend.toUpperCase()})]}),p.recommendedBackends.length>1&&o.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["Available backends: ",p.recommendedBackends.join(", ")]})]})]}),n.deploymentMode==="remote-llm"&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote Service URLs"}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"remote-llm",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"LLM Proxy URL"}),o.jsx("input",{id:"remote-llm",type:"url",value:n.remoteLlmUrl,onChange:j=>l({type:"SET_REMOTE_LLM_URL",url:j.target.value}),placeholder:"http://192.168.1.100:7704",className:re("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)]")})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"remote-whisper",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Whisper URL (optional)"}),o.jsx("input",{id:"remote-whisper",type:"url",value:n.remoteWhisperUrl,onChange:j=>l({type:"SET_REMOTE_WHISPER_URL",url:j.target.value}),placeholder:"http://192.168.1.100:7706",className:re("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 WE(){const{state:n,dispatch:l}=ur(),[s,i]=S.useState(null),[d,f]=S.useState(!0);if(S.useEffect(()=>{Promise.all([dv(),sE()]).then(([g,y])=>{i(g),n.enabledModules.length===0&&l({type:"SET_ENABLED_MODULES",modules:y.enabledModules})}).catch(()=>{}).finally(()=>f(!1))},[]),d||!s)return o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(pa,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const{core:m,recommended:x,optional:v}=e4(s.services);return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Select Services"}),o.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Core services are always included. Toggle recommended and optional services."})]}),o.jsx(Xu,{title:"Core",subtitle:"Always included",services:m,enabled:m.map(g=>g.id),locked:!0}),o.jsx(Xu,{title:"Recommended",subtitle:"Enabled by default",services:x,enabled:n.enabledModules,onToggle:(g,y)=>l({type:"TOGGLE_MODULE",serviceId:g,enabled:y}),platform:n.platform}),v.length>0&&o.jsx(Xu,{title:"Optional",subtitle:"Off by default",services:v,enabled:n.enabledModules,onToggle:(g,y)=>l({type:"TOGGLE_MODULE",serviceId:g,enabled:y})}),o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[o.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Integrations"}),o.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Cloud services"})]}),o.jsxs("button",{type:"button",onClick:()=>l({type:"SET_RELAY_ENABLED",enabled:!n.relayEnabled}),className:re("flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors",n.relayEnabled?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)] hover:border-[var(--color-primary)]/30"),children:[n.relayEnabled?o.jsx(St,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):o.jsx(ll,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),o.jsx(GN,{size:12,className:"text-[var(--color-text-muted)]"})]}),o.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 e4(n){return{core:n.filter(l=>l.category==="core"),recommended:n.filter(l=>l.category==="recommended"),optional:n.filter(l=>l.category==="optional")}}function Xu({title:n,subtitle:l,services:s,enabled:i,locked:d,onToggle:f,platform:m}){return o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[o.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:n}),o.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:l})]}),o.jsx("div",{className:"space-y-1",children:s.map(x=>{const v=i.includes(x.id),g=x.nativeOnly&&m==="darwin";return o.jsxs("button",{type:"button",disabled:d,onClick:()=>f?.(x.id,!v),className:re("flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors",v?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)] hover:border-[var(--color-primary)]/30",d&&"cursor-default"),children:[d?o.jsx(Ad,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}):v?o.jsx(St,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):o.jsx(ll,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:x.name}),o.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",x.port]}),g&&o.jsx("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-500",children:"Native"})]}),o.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:x.description})]})]},x.id)})})]})}function t4(){const{state:n}=ur(),[l,s]=S.useState(null);if(S.useEffect(()=>{dv().then(s).catch(()=>{})},[]),!l)return o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(pa,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const i=l.services.filter(p=>p.category==="core"),d=l.services.filter(p=>p.category!=="core"&&n.enabledModules.includes(p.id)),f=[...i,...d],m=new Map;for(const p of f){const j=n.portOverrides[p.id]??p.port,M=m.get(j)??[];m.set(j,[...M,p.name])}const x=[...m.entries()].filter(([,p])=>p.length>1),v=f.filter(p=>p.database).length,g=f.filter(p=>p.nativeOnly&&n.platform==="darwin"),y=f.filter(p=>!(p.nativeOnly&&n.platform==="darwin"));return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Review Configuration"}),o.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Review your selections before installing."})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsx(Ku,{label:"Docker Services",value:y.length}),o.jsx(Ku,{label:"Native Services",value:g.length}),o.jsx(Ku,{label:"Databases",value:v})]}),o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[o.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Deployment Mode"}),o.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:n.deploymentMode==="local"?"Local (all services on this machine)":"Remote LLM"}),n.deploymentMode==="remote-llm"&&n.remoteLlmUrl&&o.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["LLM: ",n.remoteLlmUrl]})]}),o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[o.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:o.jsxs("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:["Services (",f.length,")"]})}),o.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:f.map(p=>o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(St,{size:14,className:"text-green-500"}),o.jsx("span",{className:"text-sm text-[var(--color-text)]",children:p.name})]}),o.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",n.portOverrides[p.id]??p.port]})]},p.id))})]}),n.relayEnabled&&o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[o.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Jarvis Relay"}),o.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:"Enabled"}),o.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:"https://relay.jarvisautomation.io"})]}),x.length>0&&o.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ta,{size:16,className:"text-amber-500"}),o.jsx("span",{className:"text-sm font-medium text-amber-500",children:"Port Conflicts"})]}),x.map(([p,j])=>o.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Port ",p,": ",j.join(", ")]},p))]})]})}function Ku({label:n,value:l}){return o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-3 text-center",children:[o.jsx("p",{className:"text-2xl font-bold text-[var(--color-primary)]",children:l}),o.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:n})]})}function Dx(){const[n,l]=S.useState({lines:[],running:!1,done:!1,exitCode:null,error:null,redirect:null}),s=S.useRef(null),i=S.useCallback((f,m)=>(s.current?.close(),l({lines:[],running:!0,done:!1,exitCode:null,error:null,redirect:null}),new Promise((x,v)=>{const g=new EventSource(f);s.current=g,g.onmessage=y=>{try{const p=JSON.parse(y.data);if(m&&m(p),"done"in p){if(l(j=>({...j,running:!1,done:!0,exitCode:p.code,redirect:p.redirect??null})),g.close(),p.code===0)x(p.code);else{const j=p.error?String(p.error):`Process exited with code ${p.code}`;v(new Error(j))}return}if("stream"in p&&"text"in p){const j={stream:p.stream,text:p.text,timestamp:Date.now()};l(M=>({...M,lines:[...M.lines,j]}))}}catch{}},g.onerror=()=>{const y=s.current===null;l(p=>({...p,running:!1,error:p.done?null:"Connection lost"})),g.close(),y||v(new Error("Connection lost"))}})),[]),d=S.useCallback(()=>{s.current?.close(),s.current=null,l(f=>({...f,running:!1}))},[]);return{...n,run:i,stop:d}}function Ux({lines:n,running:l,title:s,className:i}){const d=S.useRef(null),f=S.useRef(!0);S.useEffect(()=>{const x=d.current;!x||!f.current||(x.scrollTop=x.scrollHeight)},[n]);function m(){const x=d.current;if(!x)return;const v=x.scrollHeight-x.scrollTop-x.clientHeight;f.current=v<50}return o.jsxs("div",{className:re("flex flex-col rounded-lg border border-[var(--color-border)] overflow-hidden",i),children:[s&&o.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2",children:[o.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:s}),l&&o.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-green-500"})]}),o.jsxs("div",{ref:d,onScroll:m,className:"h-64 overflow-y-auto bg-[#0d1117] p-3 font-mono text-xs leading-5",children:[n.length===0&&!l&&o.jsx("span",{className:"text-gray-500",children:"Waiting for output..."}),n.map((x,v)=>o.jsx("div",{className:re("whitespace-pre-wrap break-all",x.stream==="stderr"?"text-yellow-400":"text-gray-300"),children:x.text},v)),l&&o.jsx("span",{className:"inline-block h-4 w-1.5 animate-pulse bg-gray-400"})]})]})}function a4(){const{state:n,dispatch:l}=ur(),s=Dx(),i=Dx(),[d,f]=S.useState("idle"),[m,x]=S.useState(null),[v,g]=S.useState(null),[y,p]=S.useState({}),[j,M]=S.useState({}),[N,w]=S.useState(null),[R,O]=S.useState(null);S.useEffect(()=>{const te=i.redirect;if(d!=="done"||!te)return;O(5);const le=setInterval(()=>{O(oe=>oe===null||oe<=1?(clearInterval(le),window.location.href=te,0):oe-1)},1e3);return()=>clearInterval(le)},[d,i.redirect]);const _=S.useCallback(async()=>{f("preflight"),g(null),x(null);try{const te=await rE(n.enabledModules);return g(te),te.canProceed?!0:(x("Pre-flight checks failed. Fix the issues above and retry."),f("error"),w("preflight"),!1)}catch(te){return x(`Pre-flight check failed: ${te instanceof Error?te.message:String(te)}`),f("error"),w("preflight"),!1}},[n.enabledModules]);async function Y(){x(null),p({}),w(null),l({type:"SET_INSTALL_RUNNING",running:!0});try{if(!await _()){l({type:"SET_INSTALL_RUNNING",running:!1});return}f("generating"),await Cx(n),f("pulling"),await s.run("/api/install/pull"),f("starting"),await i.run("/api/install/start",le=>{if(le.phase==="health"&&typeof le.service=="string"&&p(oe=>({...oe,[le.service]:{healthy:le.healthy,error:le.error}})),le.serviceHealth&&typeof le.serviceHealth=="object"){const oe=le.serviceHealth;p(fe=>({...fe,...oe}))}}),f("done"),l({type:"SET_INSTALL_COMPLETE"})}catch(te){x(te instanceof Error?te.message:String(te)),f("error"),w(d),l({type:"SET_INSTALL_RUNNING",running:!1})}}async function L(){if(N==="preflight"){if(x(null),l({type:"SET_INSTALL_RUNNING",running:!0}),!await _()){l({type:"SET_INSTALL_RUNNING",running:!1});return}try{f("generating"),await Cx(n),f("pulling"),await s.run("/api/install/pull"),f("starting"),await i.run("/api/install/start",le=>{if(le.phase==="health"&&typeof le.service=="string"&&p(oe=>({...oe,[le.service]:{healthy:le.healthy,error:le.error}})),le.serviceHealth&&typeof le.serviceHealth=="object"){const oe=le.serviceHealth;p(fe=>({...fe,...oe}))}}),f("done"),l({type:"SET_INSTALL_COMPLETE"})}catch(le){x(le instanceof Error?le.message:String(le)),f("error"),l({type:"SET_INSTALL_RUNNING",running:!1})}}else Y()}async function $(te){try{const le=await fetch(`/api/containers/${te}/logs`);if(le.ok){const oe=await le.text();M(fe=>({...fe,[te]:oe}))}else M(oe=>({...oe,[te]:`Failed to fetch logs: HTTP ${le.status}`}))}catch(le){M(oe=>({...oe,[te]:`Failed to fetch logs: ${le instanceof Error?le.message:String(le)}`}))}}const F=[{key:"preflight",label:"Pre-flight checks"},{key:"generating",label:"Generate configuration"},{key:"pulling",label:"Pull Docker images"},{key:"starting",label:"Start services"}],ee=F.map(te=>te.key).indexOf(d);return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Install"}),o.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:d==="idle"?"Ready to install. This will pull Docker images and start all services.":d==="done"?i.redirect?`Installation complete! Redirecting to your admin dashboard in ${R??"..."}s...`:"Installation complete! All services are running.":d==="error"?"Installation encountered an error.":"Installing..."})]}),v&&o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[o.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:o.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Pre-flight Checks"})}),o.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:v.checks.map(te=>o.jsx("div",{className:"flex items-center justify-between px-3 py-2",children:o.jsxs("div",{className:"flex items-center gap-2",children:[te.status==="pass"?o.jsx(St,{size:14,className:"text-green-500"}):te.status==="warn"?o.jsx(ta,{size:14,className:"text-amber-500"}):o.jsx(Wo,{size:14,className:"text-red-500"}),o.jsxs("div",{children:[o.jsx("span",{className:"text-sm text-[var(--color-text)]",children:te.name}),o.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:te.message}),te.details&&te.status!=="pass"&&o.jsx("p",{className:"text-xs text-[var(--color-text-muted)] opacity-60",children:te.details})]})]})},te.name))})]}),o.jsx("div",{className:"space-y-2",children:F.map((te,le)=>{const oe=te.key===d,fe=ee>le||d==="done",Ee=d==="error"&&te.key===N;return o.jsxs("div",{className:"flex items-center gap-3",children:[fe?o.jsx(St,{size:18,className:"text-green-500"}):Ee?o.jsx(Wo,{size:18,className:"text-red-500"}):oe?o.jsx(pa,{size:18,className:"animate-spin text-[var(--color-primary)]"}):o.jsx("div",{className:"h-[18px] w-[18px] rounded-full border-2 border-[var(--color-border)]"}),o.jsx("span",{className:re("text-sm",fe?"text-green-500":oe?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:te.label})]},te.key)})}),(d==="starting"||d==="done"||d==="error")&&Object.keys(y).length>0&&o.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[o.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:o.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Service Status"})}),o.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:Object.entries(y).map(([te,le])=>o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-sm text-[var(--color-text)]",children:te}),o.jsxs("div",{className:"flex items-center gap-2",children:[!le.healthy&&o.jsxs("button",{type:"button",onClick:()=>$(te),className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[o.jsx(BN,{size:12}),"Logs"]}),le.healthy?o.jsx(St,{size:14,className:"text-green-500"}):o.jsx(Wo,{size:14,className:"text-red-500"})]})]}),le.error&&o.jsx("p",{className:"px-3 pb-2 text-xs text-red-400",children:le.error}),j[te]&&o.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:o.jsx("pre",{className:"whitespace-pre-wrap",children:j[te]})})]},te))})]}),(s.lines.length>0||s.running)&&o.jsx(Ux,{lines:s.lines,running:s.running,title:"docker compose pull"}),(i.lines.length>0||i.running)&&o.jsx(Ux,{lines:i.lines,running:i.running,title:"docker compose up -d"}),m&&o.jsx("div",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:m}),(d==="idle"||d==="error")&&o.jsxs("button",{type:"button",onClick:d==="error"?L:Y,className:re("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:[d==="error"?o.jsx(xi,{size:18}):o.jsx(sj,{size:18}),d==="error"?"Retry Installation":"Start Installation"]})]})}function n4(){const{state:n,dispatch:l}=ur(),s=uv(),i=mv(),[d,f]=S.useState("select"),[m,x]=S.useState(null),[v,g]=S.useState("GGUF"),[y,p]=S.useState(""),[j,M]=S.useState(null);if(n.deploymentMode==="remote-llm")return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"LLM Configuration"}),o.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Your LLM is configured to use a remote server."})]}),o.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[o.jsx(St,{size:20,className:"text-green-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM configured"}),o.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:n.remoteLlmUrl})]})]})]});if(n.platform==="darwin")return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"LLM Configuration"}),o.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"On macOS, the LLM proxy runs natively to access Metal/MLX. Configure it from the dashboard after setup, or run it directly from the jarvis-llm-proxy-api directory."})]}),o.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4 text-sm text-amber-500",children:"macOS native LLM proxy is not yet available as a pip package. Model download through this wizard requires the LLM proxy running in Docker."})]});const N=L=>{x(L),M(null),L.gated&&!y.trim()?f("token"):R(L,y.trim())},w=()=>{if(!y.trim()){M("HuggingFace token is required for gated models");return}m&&R(m,y)},R=async(L,$)=>{f("downloading"),M(null);const F=v==="GGUF"?L.hfRepoGguf:L.hfRepoVllm,W=v==="GGUF"?L.ggufFilename:void 0;try{await i.mutateAsync({repo:F,filename:W,token:$||void 0}),await O(L)}catch(ee){M(`Download failed: ${ee.message}`),f("select")}},O=async L=>{f("configuring");const F={"model.main.name":v==="GGUF"?`.models/${L.ggufFilename}`:`.models/${L.hfRepoVllm.split("/").pop()}`,"model.main.backend":v,"model.main.chat_format":L.chatFormat,"model.main.context_window":L.contextWindow,"llm.interface":L.promptProvider};v==="GGUF"&&(F["inference.gguf.n_gpu_layers"]=-1),v==="VLLM"&&L.quantization&&(F["inference.vllm.quantization"]=L.quantization);try{await s.mutateAsync(F),l({type:"SET_LLM_INTERFACE",interfaceId:L.promptProvider}),f("done")}catch(W){M(`Configuration failed: ${W.message}`),f("select")}},_=n.hardware?.gpuVramMb,Y=_?nl.filter(L=>L.vramMb<=_):nl;return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"LLM Setup"}),o.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:d==="done"?"Model configured. The LLM proxy is restarting with the new model.":"Select and download a language model for Jarvis."})]}),j&&o.jsxs("div",{className:"space-y-2",children:[o.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:[o.jsx(ta,{size:16,className:"mt-0.5 shrink-0"}),j]}),m&&o.jsxs("button",{type:"button",onClick:()=>R(m,y),className:re("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:[o.jsx(xi,{size:14}),"Retry Download"]})]}),d==="select"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Backend"}),o.jsx("div",{className:"flex gap-2",children:["GGUF","VLLM"].map(L=>o.jsx("button",{type:"button",onClick:()=>g(L),className:re("rounded-md px-3 py-1 text-xs font-medium transition-colors",v===L?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:L==="VLLM"?"vLLM":L},L))})]}),o.jsxs("div",{children:[o.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)"}),o.jsx("input",{id:"hf-token",type:"password",value:y,onChange:L=>p(L.target.value),placeholder:"hf_...",className:re("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)]")})]}),o.jsxs("div",{className:"space-y-2",children:[Y.map(L=>o.jsxs("button",{type:"button",onClick:()=>N(L),className:re("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:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:L.displayName}),L.gated&&o.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:[o.jsx(Ad,{size:10}),"Gated"]})]}),o.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[L.promptProvider," · ",L.contextWindow.toLocaleString()," ctx"]})]}),o.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["~",v==="GGUF"?L.sizeGguf:L.sizeVllm]})]},L.id)),Y.length===0&&o.jsxs("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:["No models fit your available VRAM (",_?Math.round(_/1024)+" GB":"unknown","). Consider using Remote LLM mode."]}),_&&Y.length<nl.length&&o.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Showing ",Y.length," of ",nl.length," models that fit your ",Math.round(_/1024)," GB VRAM."]})]})]}),d==="token"&&m&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[o.jsx("strong",{children:m.displayName})," is a gated model. Accept the license on HuggingFace and paste your access token below."]}),o.jsx("input",{type:"password",value:y,onChange:L=>p(L.target.value),placeholder:"hf_...",className:re("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)]")}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("button",{type:"button",onClick:()=>{f("select"),M(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),o.jsx("button",{type:"button",onClick:w,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Download"})]})]}),d==="downloading"&&o.jsxs("div",{className:"flex flex-col items-center py-8",children:[o.jsx(hs,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),o.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Downloading ",m?.displayName,"..."]}),o.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["~",v==="GGUF"?m?.sizeGguf:m?.sizeVllm," · This may take several minutes"]})]}),d==="configuring"&&o.jsxs("div",{className:"flex flex-col items-center py-8",children:[o.jsx(pa,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),o.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Configuring model and prompt provider..."})]}),d==="done"&&m&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[o.jsx(St,{size:20,className:"text-green-500"}),o.jsxs("div",{children:[o.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:[m.displayName," configured"]}),o.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Backend: ",v," · Prompt provider: ",m.promptProvider]})]})]}),o.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["The LLM proxy is restarting with the new model. It may take a minute to load. Command Center will automatically use the ",o.jsx("strong",{children:m.promptProvider})," prompt provider for optimized command parsing."]})]})]})}function r4(){const[n,l]=S.useState(""),[s,i]=S.useState(""),[d,f]=S.useState(""),[m,x]=S.useState(""),[v,g]=S.useState(!1),[y,p]=S.useState(!1),[j,M]=S.useState(null),N=s===d,w=n&&s&&d&&m&&N&&!v;async function R(){if(w){g(!0),M(null);try{const _=await qg(n,s,m);al(_.access_token),localStorage.setItem("access_token",_.access_token),localStorage.setItem("refresh_token",_.refresh_token),p(!0)}catch(_){const Y=_?.response?.data?.error??(_ instanceof Error?_.message:"Failed to create account");M(Y)}finally{g(!1)}}}if(y)return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{children:o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Account Created"})}),o.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[o.jsx(St,{size:20,className:"text-green-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Superuser account created"}),o.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:n})]})]}),o.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:`You're logged in. Click "Next" to configure your LLM model.`})]});const O=re("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 o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Create Account"}),o.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."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"display-name",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Display Name"}),o.jsx("input",{id:"display-name",type:"text",value:m,onChange:_=>x(_.target.value),className:O,placeholder:"Alex"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),o.jsx("input",{id:"email",type:"email",value:n,onChange:_=>l(_.target.value),className:O,placeholder:"admin@example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),o.jsx("input",{id:"password",type:"password",value:s,onChange:_=>i(_.target.value),className:O,placeholder:"Choose a strong password"})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),o.jsx("input",{id:"confirm-password",type:"password",value:d,onChange:_=>f(_.target.value),className:re(O,d&&!N&&"ring-2 ring-red-500"),placeholder:"Confirm password"}),d&&!N&&o.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Passwords don't match"})]})]}),j&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[o.jsx(Vg,{size:14,className:"text-red-500 shrink-0"}),o.jsx("span",{className:"text-sm text-red-500",children:j})]}),o.jsxs("button",{type:"button",onClick:R,disabled:!w,className:re("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:[o.jsx(xi,{size:14}),"Retry"]})]}),!j&&o.jsx("button",{type:"button",onClick:R,disabled:!w,className:re("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:v?"Creating...":"Create Superuser Account"})]})}const Ko=[{label:"Welcome",component:PE},{label:"Hardware",component:IE},{label:"Services",component:WE},{label:"Review",component:t4},{label:"Install",component:a4},{label:"Account",component:r4},{label:"LLM",component:n4}],l4=5;function s4({skipToAccount:n}){const{state:l,dispatch:s}=ur();S.useEffect(()=>{n&&s({type:"SET_STEP",step:l4})},[n,s]);const i=wa(),d=Ko[l.currentStep].component,f=l.currentStep===0,m=l.currentStep===Ko.length-1,g=l.currentStep===4&&!l.installComplete,y=l.installRunning||g;function p(){m?i("/login"):s({type:"NEXT_STEP"})}function j(){s({type:"PREV_STEP"})}return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)] p-4",children:o.jsxs("div",{className:"w-full max-w-2xl",children:[o.jsx("div",{className:"mb-6 flex items-center justify-center gap-1",children:Ko.map((M,N)=>o.jsxs("button",{type:"button",onClick:()=>!y&&s({type:"SET_STEP",step:N}),disabled:y,className:re("flex items-center gap-1",y&&"cursor-not-allowed"),children:[o.jsx("div",{className:re("flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium transition-colors",N===l.currentStep?"bg-[var(--color-primary)] text-white":N<l.currentStep?"bg-[var(--color-primary)]/20 text-[var(--color-primary)]":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:N+1}),o.jsx("span",{className:re("hidden text-xs sm:inline",N===l.currentStep?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:M.label}),N<Ko.length-1&&o.jsx("div",{className:re("mx-1 h-px w-4 sm:w-6",N<l.currentStep?"bg-[var(--color-primary)]/30":"bg-[var(--color-border)]")})]},M.label))}),o.jsx("div",{className:"rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-6 shadow-lg",children:o.jsx(d,{})}),o.jsxs("div",{className:"mt-4 flex justify-between",children:[o.jsx("button",{type:"button",onClick:j,disabled:f||y,className:re("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"}),o.jsx("button",{type:"button",onClick:p,disabled:y,className:re("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 o4({skipToAccount:n}){return o.jsx($E,{children:o.jsx(s4,{skipToAccount:n})})}function i4(){const n=wa(),l=uv(),s=nE(),[i,d]=S.useState("select"),[f,m]=S.useState(null),[x,v]=S.useState("GGUF"),[g,y]=S.useState(""),[p,j]=S.useState(null),M=_=>{m(_),_.gated?d("token"):w(_,"")},N=()=>{if(!g.trim()){j("HuggingFace token is required for gated models");return}j(null),f&&w(f,g)},w=async(_,Y)=>{d("download"),j(null);const L=x==="GGUF"?_.hfRepoGguf:_.hfRepoVllm,$=x==="GGUF"?_.ggufFilename:void 0;try{await s.mutateAsync({repo:L,filename:$,token:Y||void 0}),R(_)}catch(F){j(`Download failed: ${F.message}`),d("select")}},R=async _=>{d("configure"),j(null);const L={"model.main.name":x==="GGUF"?`.models/${_.ggufFilename}`:`.models/${_.hfRepoVllm.split("/").pop()}`,"model.main.backend":x,"model.main.chat_format":_.chatFormat,"model.main.context_window":_.contextWindow};x==="GGUF"&&(L["inference.gguf.n_gpu_layers"]=-1),x==="VLLM"&&_.quantization&&(L["inference.vllm.quantization"]=_.quantization);try{await l.mutateAsync(L),d("done"),Ue.success("LLM configured successfully")}catch($){j(`Configuration failed: ${$.message}`),d("select")}},O=()=>{n("/dashboard")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-bg)] p-4",children:o.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:[o.jsxs("div",{className:"mb-8 text-center",children:[o.jsx(id,{className:"mx-auto mb-3 text-[var(--color-primary)]",size:40}),o.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"LLM Setup"}),o.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Configure a local language model for Jarvis"})]}),o.jsx("div",{className:"mb-8 flex items-center justify-center gap-2",children:["select","download","configure","done"].map((_,Y)=>{const L=i==="token"?"select":i,$=["select","download","configure","done"];return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:re("h-2 w-2 rounded-full",L===_?"bg-[var(--color-primary)]":$.indexOf(L)>Y?"bg-green-500":"bg-[var(--color-border)]")}),Y<3&&o.jsx("div",{className:"h-px w-8 bg-[var(--color-border)]"})]},_)})}),p&&o.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:[o.jsx(ta,{size:16,className:"mt-0.5 shrink-0"}),p]}),i==="select"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Select a model"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>v("GGUF"),className:re("rounded-md px-3 py-1 text-xs font-medium transition-colors",x==="GGUF"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"GGUF"}),o.jsx("button",{onClick:()=>v("VLLM"),className:re("rounded-md px-3 py-1 text-xs font-medium transition-colors",x==="VLLM"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"vLLM"})]})]}),o.jsx("div",{className:"grid gap-3",children:nl.map(_=>o.jsxs("button",{onClick:()=>M(_),className:re("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:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium text-[var(--color-text)]",children:_.displayName}),_.gated&&o.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:[o.jsx(Ad,{size:10}),"Gated"]})]}),o.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[_.quantization?`${_.quantization.toUpperCase()} 4-bit`:_.chatFormat," · ",_.contextWindow.toLocaleString()," ctx"]})]}),o.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["~",x==="GGUF"?_.sizeGguf:_.sizeVllm]})]},_.id))}),o.jsx("div",{className:"flex justify-end pt-2",children:o.jsx("button",{onClick:O,className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Skip for now"})})]}),i==="token"&&f&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Access Required"}),o.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[o.jsx("strong",{children:f.displayName})," is a gated model. You need to:"]}),o.jsxs("ol",{className:"list-inside list-decimal space-y-1 text-sm text-[var(--color-text-muted)]",children:[o.jsx("li",{children:"Visit the model page on huggingface.co and accept the license agreement"}),o.jsx("li",{children:"Create an access token at huggingface.co/settings/tokens"}),o.jsx("li",{children:"Paste your token below"})]}),o.jsx("input",{type:"password",value:g,onChange:_=>y(_.target.value),placeholder:"hf_...",className:re("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)]")}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("button",{onClick:()=>{d("select"),j(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),o.jsx("button",{onClick:N,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Continue"})]})]}),i==="download"&&o.jsxs("div",{className:"flex flex-col items-center py-8",children:[o.jsx(hs,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),o.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Downloading model..."}),o.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," ","(~",x==="GGUF"?f?.sizeGguf:f?.sizeVllm,")"]}),o.jsx("p",{className:"mt-4 text-xs text-[var(--color-text-muted)]",children:"This may take several minutes depending on your connection"})]}),i==="configure"&&o.jsxs("div",{className:"flex flex-col items-center py-8",children:[o.jsx(Zg,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),o.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Configuring..."}),o.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Writing settings and restarting LLM proxy"})]}),i==="done"&&o.jsxs("div",{className:"flex flex-col items-center py-8",children:[o.jsx(TN,{className:"mb-4 text-green-500",size:40}),o.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"LLM Ready"}),o.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," configured on ",x]}),o.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."}),o.jsx("button",{onClick:()=>n("/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"})]}),(s.isPending||l.isPending)&&i!=="download"&&i!=="configure"&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:o.jsx(pa,{className:"animate-spin text-white",size:32})})]})})}const c4=new q1;function u4(){const[n,l]=S.useState(!0),[s,i]=S.useState(!1),[d,f]=S.useState(!1);return S.useEffect(()=>{Ud().then(m=>{m.state==="deployed-needs-account"?(f(!0),i(!0)):i(!m.configured)}).catch(()=>{i(!1)}).finally(()=>l(!1))},[]),n?o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-primary)] border-t-transparent"})}):o.jsxs(D0,{children:[o.jsx(bt,{path:"/setup",element:o.jsx(o4,{skipToAccount:d})}),o.jsx(bt,{path:"/login",element:o.jsx(Nw,{})}),o.jsx(bt,{path:"/llm-setup",element:o.jsx(i4,{})}),o.jsxs(bt,{element:o.jsx(Sw,{}),children:[o.jsx(bt,{path:"/dashboard",element:o.jsx(uE,{})}),o.jsx(bt,{path:"/settings",element:o.jsx(Dw,{})}),o.jsx(bt,{path:"/services",element:o.jsx(Pw,{})}),o.jsx(bt,{path:"/models",element:o.jsx(EE,{})}),o.jsx(bt,{path:"/quick-sets",element:o.jsx(zE,{})}),o.jsx(bt,{path:"/traces",element:o.jsx(QE,{})}),o.jsx(bt,{path:"/traces/:id",element:o.jsx(YE,{})}),o.jsx(bt,{path:"/update",element:o.jsx(DE,{})}),o.jsx(bt,{path:"/reconcile",element:o.jsx(LE,{})}),o.jsx(bt,{path:"/nodes",element:o.jsx(yE,{})}),o.jsx(bt,{path:"/",element:s?o.jsx(ai,{to:"/setup",replace:!0}):o.jsx(ai,{to:"/dashboard",replace:!0})}),o.jsx(bt,{path:"*",element:o.jsx(FE,{})})]})]})}function d4(){return o.jsx(T2,{children:o.jsx(H1,{client:c4,children:o.jsxs(cN,{children:[o.jsx(l1,{children:o.jsx(u4,{})}),o.jsx(w2,{position:"bottom-right",richColors:!0})]})})})}zb.createRoot(document.getElementById("root")).render(o.jsx(S.StrictMode,{children:o.jsx(d4,{})}));