easy-devops 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,442 +0,0 @@
1
- (function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))u(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&u(g)}).observe(document,{childList:!0,subtree:!0});function c(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function u(f){if(f.ep)return;f.ep=!0;const m=c(f);fetch(f.href,m)}})();var yd={exports:{}},Ei={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Lp;function A0(){if(Lp)return Ei;Lp=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function c(u,f,m){var g=null;if(m!==void 0&&(g=""+m),f.key!==void 0&&(g=""+f.key),"key"in f){m={};for(var h in f)h!=="key"&&(m[h]=f[h])}else m=f;return f=m.ref,{$$typeof:s,type:u,key:g,ref:f!==void 0?f:null,props:m}}return Ei.Fragment=o,Ei.jsx=c,Ei.jsxs=c,Ei}var Up;function D0(){return Up||(Up=1,yd.exports=A0()),yd.exports}var a=D0(),vd={exports:{}},Ee={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Hp;function _0(){if(Hp)return Ee;Hp=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),N=Symbol.for("react.view_transition"),E=Symbol.iterator;function U(T){return T===null||typeof T!="object"?null:(T=E&&T[E]||T["@@iterator"],typeof T=="function"?T:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,_={};function z(T,I,P){this.props=T,this.context=I,this.refs=_,this.updater=P||S}z.prototype.isReactComponent={},z.prototype.setState=function(T,I){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,I,"setState")},z.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function Q(){}Q.prototype=z.prototype;function A(T,I,P){this.props=T,this.context=I,this.refs=_,this.updater=P||S}var Y=A.prototype=new Q;Y.constructor=A,k(Y,z.prototype),Y.isPureReactComponent=!0;var ne=Array.isArray;function M(){}var L={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function Z(T,I,P){var F=P.ref;return{$$typeof:s,type:T,key:I,ref:F!==void 0?F:null,props:P}}function ae(T,I){return Z(T.type,I,T.props)}function H(T){return typeof T=="object"&&T!==null&&T.$$typeof===s}function W(T){var I={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(P){return I[P]})}var ve=/\/+/g;function xe(T,I){return typeof T=="object"&&T!==null&&T.key!=null?W(""+T.key):I.toString(36)}function ee(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(M,M):(T.status="pending",T.then(function(I){T.status==="pending"&&(T.status="fulfilled",T.value=I)},function(I){T.status==="pending"&&(T.status="rejected",T.reason=I)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function oe(T,I,P,F,Ne){var De=typeof T;(De==="undefined"||De==="boolean")&&(T=null);var Ce=!1;if(T===null)Ce=!0;else switch(De){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(T.$$typeof){case s:case o:Ce=!0;break;case j:return Ce=T._init,oe(Ce(T._payload),I,P,F,Ne)}}if(Ce)return Ne=Ne(T),Ce=F===""?"."+xe(T,0):F,ne(Ne)?(P="",Ce!=null&&(P=Ce.replace(ve,"$&/")+"/"),oe(Ne,I,P,"",function(Ht){return Ht})):Ne!=null&&(H(Ne)&&(Ne=ae(Ne,P+(Ne.key==null||T&&T.key===Ne.key?"":(""+Ne.key).replace(ve,"$&/")+"/")+Ce)),I.push(Ne)),1;Ce=0;var ce=F===""?".":F+":";if(ne(T))for(var ye=0;ye<T.length;ye++)F=T[ye],De=ce+xe(F,ye),Ce+=oe(F,I,P,De,Ne);else if(ye=U(T),typeof ye=="function")for(T=ye.call(T),ye=0;!(F=T.next()).done;)F=F.value,De=ce+xe(F,ye++),Ce+=oe(F,I,P,De,Ne);else if(De==="object"){if(typeof T.then=="function")return oe(ee(T),I,P,F,Ne);throw I=String(T),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function $(T,I,P){if(T==null)return T;var F=[],Ne=0;return oe(T,F,"","",function(De){return I.call(P,De,Ne++)}),F}function le(T){if(T._status===-1){var I=T._result,P=I();P.then(function(F){(T._status===0||T._status===-1)&&(T._status=1,T._result=F,P.status===void 0&&(P.status="fulfilled",P.value=F))},function(F){(T._status===0||T._status===-1)&&(T._status=2,T._result=F,P.status===void 0&&(P.status="rejected",P.reason=F))}),T._status===-1&&(T._status=0,T._result=P)}if(T._status===1)return T._result.default;throw T._result}var ke=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=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(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function Te(T){var I=L.T,P={};P.types=I!==null?I.types:null,L.T=P;try{var F=T(),Ne=L.S;Ne!==null&&Ne(P,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(M,ke)}catch(De){ke(De)}finally{I!==null&&P.types!==null&&(I.types=P.types),L.T=I}}function Ie(T){var I=L.T;if(I!==null){var P=I.types;P===null?I.types=[T]:P.indexOf(T)===-1&&P.push(T)}else Te(Ie.bind(null,T))}var qe={map:$,forEach:function(T,I,P){$(T,function(){I.apply(this,arguments)},P)},count:function(T){var I=0;return $(T,function(){I++}),I},toArray:function(T){return $(T,function(I){return I})||[]},only:function(T){if(!H(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Ee.Activity=y,Ee.Children=qe,Ee.Component=z,Ee.Fragment=c,Ee.Profiler=f,Ee.PureComponent=A,Ee.StrictMode=u,Ee.Suspense=x,Ee.ViewTransition=N,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(T){return L.H.useMemoCache(T)}},Ee.addTransitionType=Ie,Ee.cache=function(T){return function(){return T.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(T,I,P){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var F=k({},T.props),Ne=T.key;if(I!=null)for(De in I.key!==void 0&&(Ne=""+I.key),I)!X.call(I,De)||De==="key"||De==="__self"||De==="__source"||De==="ref"&&I.ref===void 0||(F[De]=I[De]);var De=arguments.length-2;if(De===1)F.children=P;else if(1<De){for(var Ce=Array(De),ce=0;ce<De;ce++)Ce[ce]=arguments[ce+2];F.children=Ce}return Z(T.type,Ne,F)},Ee.createContext=function(T){return T={$$typeof:g,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:m,_context:T},T},Ee.createElement=function(T,I,P){var F,Ne={},De=null;if(I!=null)for(F in I.key!==void 0&&(De=""+I.key),I)X.call(I,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(Ne[F]=I[F]);var Ce=arguments.length-2;if(Ce===1)Ne.children=P;else if(1<Ce){for(var ce=Array(Ce),ye=0;ye<Ce;ye++)ce[ye]=arguments[ye+2];Ne.children=ce}if(T&&T.defaultProps)for(F in Ce=T.defaultProps,Ce)Ne[F]===void 0&&(Ne[F]=Ce[F]);return Z(T,De,Ne)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(T){return{$$typeof:h,render:T}},Ee.isValidElement=H,Ee.lazy=function(T){return{$$typeof:j,_payload:{_status:-1,_result:T},_init:le}},Ee.memo=function(T,I){return{$$typeof:b,type:T,compare:I===void 0?null:I}},Ee.startTransition=Te,Ee.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ee.use=function(T){return L.H.use(T)},Ee.useActionState=function(T,I,P){return L.H.useActionState(T,I,P)},Ee.useCallback=function(T,I){return L.H.useCallback(T,I)},Ee.useContext=function(T){return L.H.useContext(T)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(T,I){return L.H.useDeferredValue(T,I)},Ee.useEffect=function(T,I){return L.H.useEffect(T,I)},Ee.useEffectEvent=function(T){return L.H.useEffectEvent(T)},Ee.useId=function(){return L.H.useId()},Ee.useImperativeHandle=function(T,I,P){return L.H.useImperativeHandle(T,I,P)},Ee.useInsertionEffect=function(T,I){return L.H.useInsertionEffect(T,I)},Ee.useLayoutEffect=function(T,I){return L.H.useLayoutEffect(T,I)},Ee.useMemo=function(T,I){return L.H.useMemo(T,I)},Ee.useOptimistic=function(T,I){return L.H.useOptimistic(T,I)},Ee.useReducer=function(T,I,P){return L.H.useReducer(T,I,P)},Ee.useRef=function(T){return L.H.useRef(T)},Ee.useState=function(T){return L.H.useState(T)},Ee.useSyncExternalStore=function(T,I,P){return L.H.useSyncExternalStore(T,I,P)},Ee.useTransition=function(){return L.H.useTransition()},Ee.version="19.3.1",Ee}var Bp;function Qd(){return Bp||(Bp=1,vd.exports=_0()),vd.exports}var p=Qd(),bd={exports:{}},zi={},jd={exports:{}},Nd={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var qp;function O0(){return qp||(qp=1,(function(s){function o(ee,oe){var $=ee.length;ee.push(oe);e:for(;0<$;){var le=$-1>>>1,ke=ee[le];if(0<f(ke,oe))ee[le]=oe,ee[$]=ke,$=le;else break e}}function c(ee){return ee.length===0?null:ee[0]}function u(ee){if(ee.length===0)return null;var oe=ee[0],$=ee.pop();if($!==oe){ee[0]=$;e:for(var le=0,ke=ee.length,Te=ke>>>1;le<Te;){var Ie=2*(le+1)-1,qe=ee[Ie],T=Ie+1,I=ee[T];if(0>f(qe,$))T<ke&&0>f(I,qe)?(ee[le]=I,ee[T]=$,le=T):(ee[le]=qe,ee[Ie]=$,le=Ie);else if(T<ke&&0>f(I,$))ee[le]=I,ee[T]=$,le=T;else break e}}return oe}function f(ee,oe){var $=ee.sortIndex-oe.sortIndex;return $!==0?$:ee.id-oe.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;s.unstable_now=function(){return m.now()}}else{var g=Date,h=g.now();s.unstable_now=function(){return g.now()-h}}var x=[],b=[],j=1,y=null,N=3,E=!1,U=!1,S=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function A(ee){for(var oe=c(b);oe!==null;){if(oe.callback===null)u(b);else if(oe.startTime<=ee)u(b),oe.sortIndex=oe.expirationTime,o(x,oe);else break;oe=c(b)}}function Y(ee){if(S=!1,A(ee),!U)if(c(x)!==null)U=!0,ne||(ne=!0,H());else{var oe=c(b);oe!==null&&xe(Y,oe.startTime-ee)}}var ne=!1,M=-1,L=5,X=-1;function Z(){return k?!0:!(s.unstable_now()-X<L)}function ae(){if(k=!1,ne){var ee=s.unstable_now();X=ee;var oe=!0;try{e:{U=!1,S&&(S=!1,z(M),M=-1),E=!0;var $=N;try{t:{for(A(ee),y=c(x);y!==null&&!(y.expirationTime>ee&&Z());){var le=y.callback;if(typeof le=="function"){y.callback=null,N=y.priorityLevel;var ke=le(y.expirationTime<=ee);if(ee=s.unstable_now(),typeof ke=="function"){y.callback=ke,A(ee),oe=!0;break t}y===c(x)&&u(x),A(ee)}else u(x);y=c(x)}if(y!==null)oe=!0;else{var Te=c(b);Te!==null&&xe(Y,Te.startTime-ee),oe=!1}}break e}finally{y=null,N=$,E=!1}oe=void 0}}finally{oe?H():ne=!1}}}var H;if(typeof Q=="function")H=function(){Q(ae)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ve=W.port2;W.port1.onmessage=ae,H=function(){ve.postMessage(null)}}else H=function(){_(ae,0)};function xe(ee,oe){M=_(function(){ee(s.unstable_now())},oe)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(ee){ee.callback=null},s.unstable_forceFrameRate=function(ee){0>ee||125<ee?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<ee?Math.floor(1e3/ee):5},s.unstable_getCurrentPriorityLevel=function(){return N},s.unstable_next=function(ee){switch(N){case 1:case 2:case 3:var oe=3;break;default:oe=N}var $=N;N=oe;try{return ee()}finally{N=$}},s.unstable_requestPaint=function(){k=!0},s.unstable_runWithPriority=function(ee,oe){switch(ee){case 1:case 2:case 3:case 4:case 5:break;default:ee=3}var $=N;N=ee;try{return oe()}finally{N=$}},s.unstable_scheduleCallback=function(ee,oe,$){var le=s.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?le+$:le):$=le,ee){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=$+ke,ee={id:j++,callback:oe,priorityLevel:ee,startTime:$,expirationTime:ke,sortIndex:-1},$>le?(ee.sortIndex=$,o(b,ee),c(x)===null&&ee===c(b)&&(S?(z(M),M=-1):S=!0,xe(Y,$-le))):(ee.sortIndex=ke,o(x,ee),U||E||(U=!0,ne||(ne=!0,H()))),ee},s.unstable_shouldYield=Z,s.unstable_wrapCallback=function(ee){var oe=N;return function(){var $=N;N=oe;try{return ee.apply(this,arguments)}finally{N=$}}}})(Nd)),Nd}var Gp;function M0(){return Gp||(Gp=1,jd.exports=O0()),jd.exports}var wd={exports:{}},_t={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Yp;function L0(){if(Yp)return _t;Yp=1;var s=Qd();function o(j){var y="https://react.dev/errors/"+j;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)y+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+j+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var u={d:{f:c,r:function(){throw Error(o(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},f=Symbol.for("react.portal"),m=Symbol.for("react.recoverable"),g=Symbol.for("react.optimistic_key");function h(j,y,N){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:E==null?null:E===g?g:""+E,children:j,containerInfo:y,implementation:N}}var x=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(j,y){if(j==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return _t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,_t.browser=function(j){return{$$typeof:m,_reason:j}},_t.createPortal=function(j,y){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(o(299));return h(j,y,null,N)},_t.flushSync=function(j){var y=x.T,N=u.p;try{if(x.T=null,u.p=2,j)return j()}finally{x.T=y,u.p=N,u.d.f()}},_t.preconnect=function(j,y){typeof j=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,u.d.C(j,y))},_t.prefetchDNS=function(j){typeof j=="string"&&u.d.D(j)},_t.preinit=function(j,y){if(typeof j=="string"&&y&&typeof y.as=="string"){var N=y.as,E=b(N,y.crossOrigin),U=typeof y.integrity=="string"?y.integrity:void 0,S=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;N==="style"?u.d.S(j,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:E,integrity:U,fetchPriority:S}):N==="script"&&u.d.X(j,{crossOrigin:E,integrity:U,fetchPriority:S,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},_t.preinitModule=function(j,y){if(typeof j=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var N=b(y.as,y.crossOrigin);u.d.M(j,{crossOrigin:N,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&u.d.M(j)},_t.preload=function(j,y){if(typeof j=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var N=y.as,E=b(N,y.crossOrigin);u.d.L(j,N,{crossOrigin:E,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},_t.preloadModule=function(j,y){if(typeof j=="string")if(y){var N=b(y.as,y.crossOrigin);u.d.m(j,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:N,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else u.d.m(j)},_t.requestFormReset=function(j){u.d.r(j)},_t.unstable_batchedUpdates=function(j,y){return j(y)},_t.useFormState=function(j,y,N){return x.H.useFormState(j,y,N)},_t.useFormStatus=function(){return x.H.useHostTransitionStatus()},_t.version="19.3.1",_t}var $p;function Ag(){if($p)return wd.exports;$p=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),wd.exports=L0(),wd.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var Vp;function U0(){if(Vp)return zi;Vp=1;var s=M0(),o=Qd(),c=Ag();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function g(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 h(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 x(e){if(m(e)!==e)throw Error(u(188))}function b(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return x(i),e;if(r===l)return x(i),t;r=r.sibling}throw Error(u(188))}if(n.return!==l.return)n=i,l=r;else{for(var d=!1,v=i.child;v;){if(v===n){d=!0,n=i,l=r;break}if(v===l){d=!0,l=i,n=r;break}v=v.sibling}if(!d){for(v=r.child;v;){if(v===n){d=!0,n=r,l=i;break}if(v===l){d=!0,l=r,n=i;break}v=v.sibling}if(!d)throw Error(u(189))}}if(n.alternate!==l)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function j(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=j(e),t!==null)return t;e=e.sibling}return null}function y(e,t,n,l,i,r){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,l,i,r)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&y(e.child,t,n,l,i,r))return!0;e=e.sibling}return!1}function N(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function E(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function U(e){var t=[null,null],n=N(e);return n===null||S(t,e,n.child,{foundSelf:!1}),t}function S(e,t,n,l){for(;n!==null;){if(n===t)l.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(l.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&S(e,t,n.child,l))return!0;n=n.sibling}return!1}function k(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(u(559))}}var _=null,z=null;function Q(e,t,n){return e===n?!0:e===t?(_=e,!0):!1}function A(e,t,n){return e===n?(z=e,!1):e===t?(z!==null&&(_=e),!0):!1}function Y(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ne(e,t,n){for(var l=0,i=e;i;i=n(i))l++;i=0;for(var r=t;r;r=n(r))i++;for(;0<l-i;)e=n(e),l--;for(;0<i-l;)t=n(t),i--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var M=Object.assign,L=Symbol.for("react.element"),X=Symbol.for("react.transitional.element"),Z=Symbol.for("react.portal"),ae=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),ve=Symbol.for("react.consumer"),xe=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),Ie=Symbol.for("react.legacy_hidden"),qe=Symbol.for("react.memo_cache_sentinel"),T=Symbol.for("react.view_transition"),I=Symbol.for("react.recoverable"),P=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Symbol.for("react.client.reference");function De(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ae:return"Fragment";case W:return"Profiler";case H:return"StrictMode";case oe:return"Suspense";case $:return"SuspenseList";case Te:return"Activity";case T:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Z:return"Portal";case xe:return e.displayName||"Context";case ve:return(e._context.displayName||"Context")+".Consumer";case ee:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return t=e.displayName||null,t!==null?t:De(e.type)||"Memo";case ke:t=e._payload,e=e._init;try{return De(e(t))}catch{}}return null}var Ce=Array.isArray,ce=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ht={pending:!1,data:null,method:null,action:null},Gn=[],It=-1;function Bt(e){return{current:e}}function V(e){0>It||(e.current=Gn[It],Gn[It]=null,It--)}function de(e,t){It++,Gn[It]=e.current,e.current=t}var be=Bt(null),nt=Bt(null),Ge=Bt(null),Ta=Bt(null);function na(e,t){switch(de(Ge,t),de(nt,e),de(be,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xx(t),e=Zx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(be),de(be,e)}function Rn(){V(be),V(nt),V(Ge)}function aa(e){var t=e.memoizedState;t!==null&&(gs._currentValue=t.memoizedState,de(Ta,e)),t=be.current;var n=Zx(t,e.type);t!==n&&(de(nt,e),de(be,n))}function Rl(e){nt.current===e&&(V(be),V(nt)),Ta.current===e&&(V(Ta),gs._currentValue=Ht)}var Ds,Ki;function An(e){if(Ds===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ds=t&&t[1]||"",Ki=-1<n.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Ds+e+Ki}var _s=!1;function Os(e,t){if(!e||_s)return"";_s=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={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(se){var R=se}Reflect.construct(e,[],J)}else{try{J.call()}catch(se){R=se}J=!1;try{var q=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),J=!0,new e}finally{J&&(q!==void 0?Object.defineProperty(e.prototype,"props",q):delete e.prototype.props)}}}else{try{throw Error()}catch(se){R=se}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(se){if(se&&R&&typeof se.stack=="string")return[se.stack,R.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=l.DetermineComponentFrameRoot(),d=r[0],v=r[1];if(d&&v){var w=d.split(`
44
- `),O=v.split(`
45
- `);for(i=l=0;l<w.length&&!w[l].includes("DetermineComponentFrameRoot");)l++;for(;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;if(l===w.length||i===O.length)for(l=w.length-1,i=O.length-1;1<=l&&0<=i&&w[l]!==O[i];)i--;for(;1<=l&&0<=i;l--,i--)if(w[l]!==O[i]){if(l!==1||i!==1)do if(l--,i--,0>i||w[l]!==O[i]){var G=`
46
- `+w[l].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=l&&0<=i);break}}}finally{_s=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?An(n):""}function Vo(e,t){switch(e.tag){case 26:case 27:case 5:return An(e.type);case 16:return An("Lazy");case 13:return e.child!==t&&t!==null?An("Suspense Fallback"):An("Suspense");case 19:return An("SuspenseList");case 0:case 15:return Os(e.type,!1);case 11:return Os(e.type.render,!1);case 1:return Os(e.type,!0);case 31:return An("Activity");case 30:return An("ViewTransition");default:return""}}function ge(e){try{var t="",n=null;do t+=Vo(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
47
- Error generating stack: `+l.message+`
48
- `+l.stack}}var it=Object.prototype.hasOwnProperty,Mt=s.unstable_scheduleCallback,ut=s.unstable_cancelCallback,rt=s.unstable_shouldYield,Wt=s.unstable_requestPaint,en=s.unstable_now,Hy=s.unstable_getCurrentPriorityLevel,mf=s.unstable_ImmediatePriority,xf=s.unstable_UserBlockingPriority,Ji=s.unstable_NormalPriority,By=s.unstable_LowPriority,pf=s.unstable_IdlePriority,qy=s.log,Gy=s.unstable_setDisableYieldValue,Ms=null,tn=null;function Ca(e){if(typeof qy=="function"&&Gy(e),tn&&typeof tn.setStrictMode=="function")try{tn.setStrictMode(Ms,e)}catch{}}var nn=Math.clz32?Math.clz32:Vy,Yy=Math.log,$y=Math.LN2;function Vy(e){return e>>>=0,e===0?32:31-(Yy(e)/$y|0)|0}var Pi=256,Fi=262144,Ii=4194304;function nl(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&-e;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 Wi(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,r=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var v=l&134217727;return v!==0?(l=v&~r,l!==0?i=nl(l):(d&=v,d!==0?i=nl(d):n||(n=v&~e,n!==0&&(i=nl(n))))):(v=l&~r,v!==0?i=nl(v):d!==0?i=nl(d):n||(n=l&~e,n!==0&&(i=nl(n)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function Ls(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gf(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-nn(n),i=1<<l;t|=e[l],n&=~i}return t}function Xy(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 yf(){var e=Ii;return Ii<<=1,(Ii&62914560)===0&&(Ii=4194304),e}function Xo(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Us(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Zy(e,t,n,l,i,r){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var v=e.entanglements,w=e.expirationTimes,O=e.hiddenUpdates;for(n=d&~n;0<n;){var G=31-nn(n),J=1<<G;v[G]=0,w[G]=-1;var R=O[G];if(R!==null)for(O[G]=null,G=0;G<R.length;G++){var q=R[G];q!==null&&(q.lane&=-536870913)}n&=~J}l!==0&&vf(e,l,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(d&~t))}function vf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-nn(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function bf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-nn(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function jf(e,t){var n=t&-t;return n=(n&42)!==0?1:Zo(n),(n&(e.suspendedLanes|t))!==0?0:n}function Zo(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 Qo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Nf(){var e=ye.p;return e!==0?e:(e=window.event,e===void 0?32:zp(e.type))}function wf(e,t){var n=ye.p;try{return ye.p=e,t()}finally{ye.p=n}}var la=Math.random().toString(36).slice(2),Ct="__reactFiber$"+la,Vt="__reactProps$"+la,Al="__reactContainer$"+la,Sf="__reactEvents$"+la,Qy="__reactListeners$"+la,Ky="__reactHandles$"+la,kf="__reactResources$"+la,Hs="__reactMarker$"+la,er="__reactLoad$"+la;function tr(e){delete e[Ct],delete e[Vt],delete e[Qy],delete e[Ky]}function al(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Al]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=cp(e);e!==null;){if(n=e[Ct])return n;e=cp(e)}return t}e=n,n=e.parentNode}return null}function Dl(e){if(e=e[Ct]||e[Al]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function _l(e){var t=e[kf];return t||(t=e[kf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function jt(e){e[Hs]=!0}function Tf(e){e[er]=void 0}var Cf=new Set,Ef={};function ll(e,t){Ol(e,t),Ol(e+"Capture",t)}function Ol(e,t){for(Ef[e]=t,e=0;e<t.length;e++)Cf.add(t[e])}var Jy=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]*$"),zf={},Rf={};function Py(e){return it.call(Rf,e)?!0:it.call(zf,e)?!1:Jy.test(e)?Rf[e]=!0:(zf[e]=!0,!1)}var Ye=!1;function Af(){var e=Ye;return Ye=!1,e}function nr(e,t,n){if(Py(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function ar(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function sa(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,l)}}function an(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Df(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fy(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,r=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(d){n=""+d,r.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ko(e){if(!e._valueTracker){var t=Df(e)?"checked":"value";e._valueTracker=Fy(e,t,""+e[t])}}function _f(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Df(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}var Iy=/[\n"\\]/g;function mn(e){return e.replace(Iy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Jo(e,t,n,l,i,r,d,v){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+an(t)):e.value!==""+an(t)&&(e.value=""+an(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?d==="number"&&e.value==t?Po(e,an(e.value)):Po(e,an(t)):n!=null?Po(e,an(n)):l!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+an(v):e.removeAttribute("name")}function Of(e,t,n,l,i,r,d,v){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Ko(e);return}n=n!=null?""+an(n):"",t=t!=null?""+an(t):n,v||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=v?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Ko(e)}function Po(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Ml(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+an(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Mf(e,t,n){if(t!=null&&(t=""+an(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+an(n):""}function Lf(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(u(92));if(Ce(l)){if(1<l.length)throw Error(u(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=an(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ko(e)}function Ll(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wy=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 Uf(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Wy.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Hf(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",Ye=!0);for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&(Uf(e,i,l),Ye=!0)}else for(var r in t)t.hasOwnProperty(r)&&Uf(e,r,t[r])}function Fo(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 ev=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"],["maskType","mask-type"],["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"]]),tv=/^[\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 lr(e){return tv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Yn(){}var Io=null;function Wo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ul=null,Hl=null;function Bf(e){var t=Dl(e);if(t&&(e=t.stateNode)){var n=e[Vt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Jo(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+mn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Vt]||null;if(!i)throw Error(u(90));Jo(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&_f(l)}break e;case"textarea":Mf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ml(e,!!n.multiple,t,!1)}}}var ec=!1;function qf(e,t,n){if(ec)return e(t,n);ec=!0;try{var l=e(t);return l}finally{if(ec=!1,(Ul!==null||Hl!==null)&&(lo(),Ul&&(t=Ul,e=Hl,Hl=Ul=null,Bf(t),e)))for(t=0;t<e.length;t++)Bf(e[t])}}function qs(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Vt]||null;if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tc=!1;if(ia)try{var Gs={};Object.defineProperty(Gs,"passive",{get:function(){tc=!0}}),window.addEventListener("test",Gs,Gs),window.removeEventListener("test",Gs,Gs)}catch{tc=!1}var Ea=null,nc=null,sr=null;function Gf(){if(sr)return sr;var e,t=nc,n=t.length,l,i="value"in Ea?Ea.value:Ea.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===i[r-l];l++);return sr=i.slice(e,1<l?1-l:void 0)}function ir(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 rr(){return!0}function Yf(){return!1}function qt(e){function t(n,l,i,r,d){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=r,this.target=d,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(n=e[v],this[v]=n?n(r):r[v]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?rr:Yf,this.isPropagationStopped=Yf,this}return M(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=rr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=rr)},persist:function(){},isPersistent:rr}),t}var za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},or=qt(za),Ys=M({},za,{view:0,detail:0}),nv=qt(Ys),ac,lc,$s,cr=M({},Ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ic,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!==$s&&($s&&e.type==="mousemove"?(ac=e.screenX-$s.screenX,lc=e.screenY-$s.screenY):lc=ac=0,$s=e),ac)},movementY:function(e){return"movementY"in e?e.movementY:lc}}),$f=qt(cr),av=M({},cr,{dataTransfer:0}),lv=qt(av),sv=M({},Ys,{relatedTarget:0}),sc=qt(sv),iv=M({},za,{animationName:0,elapsedTime:0,pseudoElement:0}),rv=qt(iv),ov=M({},za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cv=qt(ov),uv=M({},za,{data:0}),Vf=qt(uv),dv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fv={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"},hv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hv[e])?!!t[e]:!1}function ic(){return mv}var xv=M({},Ys,{key:function(e){if(e.key){var t=dv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ir(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ic,charCode:function(e){return e.type==="keypress"?ir(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ir(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pv=qt(xv),gv=M({},cr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xf=qt(gv),yv=M({},za,{submitter:0}),vv=qt(yv),bv=M({},Ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ic}),jv=qt(bv),Nv=M({},za,{propertyName:0,elapsedTime:0,pseudoElement:0}),wv=qt(Nv),Sv=M({},cr,{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}),kv=qt(Sv),Tv=M({},za,{newState:0,oldState:0,source:0}),Cv=qt(Tv),Ev=[9,13,27,32],rc=ia&&"CompositionEvent"in window,Vs=null;ia&&"documentMode"in document&&(Vs=document.documentMode);var zv=ia&&"TextEvent"in window&&!Vs,Zf=ia&&(!rc||Vs&&8<Vs&&11>=Vs),Qf=" ",Kf=!1;function Jf(e,t){switch(e){case"keyup":return Ev.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bl=!1;function Rv(e,t){switch(e){case"compositionend":return Pf(t);case"keypress":return t.which!==32?null:(Kf=!0,Qf);case"textInput":return e=t.data,e===Qf&&Kf?null:e;default:return null}}function Av(e,t){if(Bl)return e==="compositionend"||!rc&&Jf(e,t)?(e=Gf(),sr=nc=Ea=null,Bl=!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 Zf&&t.locale!=="ko"?null:t.data;default:return null}}var Dv={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 Ff(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Dv[e.type]:t==="textarea"}function If(e,t,n,l){Ul?Hl?Hl.push(l):Hl=[l]:Ul=l,t=uo(t,"onChange"),0<t.length&&(n=new or("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Xs=null,Zs=null;function _v(e){Bx(e,0)}function ur(e){var t=Bs(e);if(_f(t))return e}function Wf(e,t){if(e==="change")return t}var eh=!1;if(ia){var oc;if(ia){var cc="oninput"in document;if(!cc){var th=document.createElement("div");th.setAttribute("oninput","return;"),cc=typeof th.oninput=="function"}oc=cc}else oc=!1;eh=oc&&(!document.documentMode||9<document.documentMode)}function nh(){Xs&&(Xs.detachEvent("onpropertychange",ah),Zs=Xs=null)}function ah(e){if(e.propertyName==="value"&&ur(Zs)){var t=[];If(t,Zs,e,Wo(e)),qf(_v,t)}}function Ov(e,t,n){e==="focusin"?(nh(),Xs=t,Zs=n,Xs.attachEvent("onpropertychange",ah)):e==="focusout"&&nh()}function Mv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ur(Zs)}function Lv(e,t){if(e==="click")return ur(t)}function Uv(e,t){if(e==="input"||e==="change")return ur(t)}function Hv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ln=typeof Object.is=="function"?Object.is:Hv;function Qs(e,t){if(ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!it.call(t,i)||!ln(e[i],t[i]))return!1}return!0}function uc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sh(e,t){var n=lh(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=lh(n)}}function ih(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ih(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uc(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=uc(e.document)}return t}function dc(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 Bv=ia&&"documentMode"in document&&11>=document.documentMode,ql=null,fc=null,Ks=null,hc=!1;function oh(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;hc||ql==null||ql!==uc(l)||(l=ql,"selectionStart"in l&&dc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ks&&Qs(Ks,l)||(Ks=l,l=uo(fc,"onSelect"),0<l.length&&(t=new or("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=ql)))}function sl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Gl={animationend:sl("Animation","AnimationEnd"),animationiteration:sl("Animation","AnimationIteration"),animationstart:sl("Animation","AnimationStart"),transitionrun:sl("Transition","TransitionRun"),transitionstart:sl("Transition","TransitionStart"),transitioncancel:sl("Transition","TransitionCancel"),transitionend:sl("Transition","TransitionEnd")},mc={},ch={};ia&&(ch=document.createElement("div").style,"AnimationEvent"in window||(delete Gl.animationend.animation,delete Gl.animationiteration.animation,delete Gl.animationstart.animation),"TransitionEvent"in window||delete Gl.transitionend.transition);function il(e){if(mc[e])return mc[e];if(!Gl[e])return e;var t=Gl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ch)return mc[e]=t[n];return e}var uh=il("animationend"),dh=il("animationiteration"),fh=il("animationstart"),qv=il("transitionrun"),Gv=il("transitionstart"),Yv=il("transitioncancel"),hh=il("transitionend"),mh=new Map,xc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");xc.push("scrollEnd");function Dn(e,t){mh.set(e,t),ll(t,[e])}var $v=0;function ra(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Ln.identifierPrefix;var n=$v++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function xh(e){if(e==null||typeof e=="string")return e;var t=null,n=rs;if(n!==null)for(var l=0;l<n.length;l++){var i=e[n[l]];if(i!=null){if(i==="none")return"none";t=t==null?i:t+(" "+i)}}return t??e.default}function oa(e,t){return e=xh(e),t=xh(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var dr=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)},xn=[],Yl=0,pc=0;function fr(){for(var e=Yl,t=pc=Yl=0;t<e;){var n=xn[t];xn[t++]=null;var l=xn[t];xn[t++]=null;var i=xn[t];xn[t++]=null;var r=xn[t];if(xn[t++]=null,l!==null&&i!==null){var d=l.pending;d===null?i.next=i:(i.next=d.next,d.next=i),l.pending=i}r!==0&&ph(n,i,r)}}function hr(e,t,n,l){xn[Yl++]=e,xn[Yl++]=t,xn[Yl++]=n,xn[Yl++]=l,pc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function gc(e,t,n,l){return hr(e,t,n,l),mr(e)}function rl(e,t){return hr(e,null,null,t),mr(e)}function ph(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,r=e.return;r!==null;)r.childLanes|=n,l=r.alternate,l!==null&&(l.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-nn(n),e=r.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),r):null}function mr(e){if(50<pi)throw pi=0,ao=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $l={};function Vv(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,n,l){return new Vv(e,t,n,l)}function yc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ca(e,t){var n=e.alternate;return n===null?(n=Xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function gh(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function xr(e,t,n,l,i,r){var d=0;if(l=e,typeof l=="function")yc(l)&&(d=1);else if(typeof l=="string")d=y0(e,n,be.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case Te:return e=Xt(31,n,t,i),e.elementType=Te,e.lanes=r,e;case ae:return ol(n.children,i,r,t);case H:d=8,i|=24;break;case W:return e=Xt(12,n,t,i|2),e.elementType=W,e.lanes=r,e;case oe:return e=Xt(13,n,t,i),e.elementType=oe,e.lanes=r,e;case $:return e=Xt(19,n,t,i),e.elementType=$,e.lanes=r,e;case Ie:case T:return e=i|32,e=Xt(30,n,t,e),e.elementType=T,e.lanes=r,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case xe:d=10;break e;case ve:d=9;break e;case ee:d=11;break e;case le:d=14;break e;case ke:d=16,l=null;break e}d=29,n=Error(u(130,e===null?"null":typeof e,"")),l=null}return t=Xt(d,n,t,i),t.elementType=e,t.type=l,t.lanes=r,t}function ol(e,t,n,l){return e=Xt(7,e,l,t),e.lanes=n,e}function vc(e,t,n){return e=Xt(6,e,null,t),e.lanes=n,e}function yh(e){var t=Xt(18,null,null,0);return t.stateNode=e,t}function bc(e,t,n){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vh=new WeakMap;function pn(e,t){if(typeof e=="object"&&e!==null){var n=vh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ge(t)},vh.set(e,t),t)}return{value:e,source:t,stack:ge(t)}}var Vl=[],Xl=0,pr=null,Js=0,gn=[],yn=0,Ra=null,$n=1,Vn="";function ua(e,t){Vl[Xl++]=Js,Vl[Xl++]=pr,pr=e,Js=t}function bh(e,t,n){gn[yn++]=$n,gn[yn++]=Vn,gn[yn++]=Ra,Ra=e;var l=$n;e=Vn;var i=32-nn(l)-1;l&=~(1<<i),n+=1;var r=32-nn(t)+i;if(30<r){var d=i-i%5;r=(l&(1<<d)-1).toString(32),l>>=d,i-=d,$n=1<<32-nn(t)+i|n<<i|l,Vn=r+e}else $n=1<<r|n<<i|l,Vn=e}function gr(e){e.return!==null&&(ua(e,1),bh(e,1,0))}function jc(e){for(;e===pr;)pr=Vl[--Xl],Vl[Xl]=null,Js=Vl[--Xl],Vl[Xl]=null;for(;e===Ra;)Ra=gn[--yn],gn[yn]=null,Vn=gn[--yn],gn[yn]=null,$n=gn[--yn],gn[yn]=null}function jh(e,t){gn[yn++]=$n,gn[yn++]=Vn,gn[yn++]=Ra,$n=t.id,Vn=t.overflow,Ra=e}var Nt=null,et=null,_e=!1,Aa=null,vn=!1,Nc=Error(u(519));function Da(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ps(pn(t,e)),Nc}function Nh(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Ct]=e,t[Vt]=l,n){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(n=0;n<yi.length;n++)Me(yi[n],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),Of(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),Lf(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||$x(t.textContent,n)?(l.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),l.onScroll!=null&&Me("scroll",t),l.onScrollEnd!=null&&Me("scrollend",t),l.onClick!=null&&(t.onclick=Yn),t=!0):t=!1,t||Da(e,!0)}function yr(e){for(Nt=e.return;Nt;)switch(Nt.tag){case 5:case 31:case 13:vn=!1;return;case 27:case 3:vn=!0;return;default:Nt=Nt.return}}function Zl(e){if(e!==Nt)return!1;if(!_e)return yr(e),_e=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Iu(e.type,e.memoizedProps)),n=!n),n&&et&&Da(e),yr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));et=op(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));et=op(e)}else t===27?(t=et,Ka(e.type)?(e=rd,rd=null,et=e):et=t):et=Nt?jn(e.stateNode.nextSibling):null;return!0}function cl(){et=Nt=null,_e=!1}function wc(){var e=Aa;return e!==null&&(Kt===null?Kt=e:Kt.push.apply(Kt,e),Aa=null),e}function Ps(e){Aa===null?Aa=[e]:Aa.push(e)}var Sc=Bt(null),ul=null,da=null;function _a(e,t,n){de(Sc,t._currentValue),t._currentValue=n}function fa(e){e._currentValue=Sc.current,V(Sc)}function vr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function kc(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var d=i.child;r=r.firstContext;e:for(;r!==null;){var v=r;r=i;for(var w=0;w<t.length;w++)if(v.context===t[w]){r.lanes|=n,v=r.alternate,v!==null&&(v.lanes|=n),vr(r.return,n,e),l||(d=null);break e}r=v.next}}else if(i.tag===18){if(d=i.return,d===null)throw Error(u(341));d.lanes|=n,r=d.alternate,r!==null&&(r.lanes|=n),vr(d,n,e),d=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,d=i.alternate,d!==null&&(d.lanes|=n),vr(i.return,n,e),d=i.child,d=d!==null?d.sibling:null):d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===e){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}}function dl(e,t,n,l){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var d=i.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var v=i.type;ln(i.pendingProps.value,d.value)||(e!==null?e.push(v):e=[v])}}else if(i===Ta.current){if(d=i.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(gs):e=[gs])}i=i.return}return e!==null&&kc(t,e,n,l),t.flags|=262144,e!==null}function br(e){for(e=e.firstContext;e!==null;){if(!ln(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fl(e){ul=e,da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Et(e){return wh(ul,e)}function jr(e,t){return ul===null&&fl(e),wh(e,t)}function wh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},da===null){if(e===null)throw Error(u(308));da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else da=da.next=t;return n}var Xv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Zv=s.unstable_scheduleCallback,Qv=s.unstable_NormalPriority,ht={$$typeof:xe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tc(){return{controller:new Xv,data:new Map,refCount:0}}function Fs(e){e.refCount--,e.refCount===0&&Zv(Qv,function(){e.controller.abort()})}function Sh(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];n.indexOf(l)===-1&&n.push(l)}}}var Is=null;function Kv(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ws=null,Cc=0,hl=0,Ql=null;function Jv(e,t){if(Ws===null){var n=Ws=[];Cc=0,hl=$u(),Ql={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Cc++,t.then(kh,kh),t}function kh(){if(--Cc===0&&(Is=null,Ws!==null)){Ql!==null&&(Ql.status="fulfilled");var e=Ws;Ws=null,hl=0,Ql=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pv(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var Th=ce.S;ce.S=function(e,t){if(yx=en(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Jv(e,t),Is!==null)for(var n=ds;n!==null;)Sh(n,Is),n=n.next;if(n=e.types,n!==null){for(var l=ds;l!==null;)Sh(l,n),l=l.next;if(hl!==0){l=Is,l===null&&(l=Is=[]);for(var i=0;i<n.length;i++){var r=n[i];l.indexOf(r)===-1&&l.push(r)}}}Th!==null&&Th(e,t)};var ml=Bt(null);function Ec(){var e=ml.current;return e!==null?e:We.pooledCache}function Nr(e,t){t===null?de(ml,ml.current):de(ml,t.pool)}function Ch(){var e=Ec();return e===null?null:{parent:ht._currentValue,pool:e}}var Kl=Error(u(460)),zc=Error(u(474)),wr=Error(u(542)),Sr={then:function(){}};function Eh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function zh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yn,Yn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ah(e),e===void 0&&!("reason"in t)?Error(u(600)):e;default:if(typeof t.status=="string")t.then(Yn,Yn);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ah(e),e}throw pl=t,Kl}}function xl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(pl=n,Kl):n}}var pl=null;function Rh(){if(pl===null)throw Error(u(459));var e=pl;return pl=null,e}function Ah(e){if(e===Kl||e===wr)throw Error(u(483))}var Jl=null,ei=0;function kr(e){var t=ei;return ei+=1,Jl===null&&(Jl=[]),zh(Jl,e,t)}function Oa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Tr(e,t){throw t.$$typeof===L?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Dh(e){function t(D,C){if(e){var B=D.deletions;B===null?(D.deletions=[C],D.flags|=16):B.push(C)}}function n(D,C){if(!e)return null;for(;C!==null;)t(D,C),C=C.sibling;return null}function l(D){for(var C=new Map;D!==null;)D.key===null?C.set(D.index,D):C.set(D.key,D),D=D.sibling;return C}function i(D,C){return D=ca(D,C),D.index=0,D.sibling=null,D}function r(D,C,B){return D.index=B,e?(B=D.alternate,B!==null?(B=B.index,B<C?(D.flags|=2,C):B):(D.flags|=134217730,C)):(D.flags|=1048576,C)}function d(D){return e&&D.alternate===null&&(D.flags|=134217730),D}function v(D,C,B,K){return C===null||C.tag!==6?(C=vc(B,D.mode,K),C.return=D,C):(C=i(C,B),C.return=D,C)}function w(D,C,B,K){var fe=B.type;return fe===ae?(D=G(D,C,B.props.children,K,B.key),Oa(D,B),D):C!==null&&(C.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ke&&xl(fe)===C.type)?(C=i(C,B.props),Oa(C,B),C.return=D,C):(C=xr(B.type,B.key,B.props,null,D.mode,K),Oa(C,B),C.return=D,C)}function O(D,C,B,K){return C===null||C.tag!==4||C.stateNode.containerInfo!==B.containerInfo||C.stateNode.implementation!==B.implementation?(C=bc(B,D.mode,K),C.return=D,C):(C=i(C,B.children||[]),C.return=D,C)}function G(D,C,B,K,fe){return C===null||C.tag!==7?(C=ol(B,D.mode,K,fe),C.return=D,C):(C=i(C,B),C.return=D,C)}function J(D,C,B){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=vc(""+C,D.mode,B),C.return=D,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case X:return B=xr(C.type,C.key,C.props,null,D.mode,B),Oa(B,C),B.return=D,B;case Z:return C=bc(C,D.mode,B),C.return=D,C;case ke:return C=xl(C),J(D,C,B)}if(Ce(C)||F(C))return C=ol(C,D.mode,B,null),C.return=D,C;if(typeof C.then=="function")return J(D,kr(C),B);if(C.$$typeof===xe)return J(D,jr(D,C),B);Tr(D,C)}return null}function R(D,C,B,K){var fe=C!==null?C.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return fe!==null?null:v(D,C,""+B,K);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case X:return B.key===fe?w(D,C,B,K):null;case Z:return B.key===fe?O(D,C,B,K):null;case ke:return B=xl(B),R(D,C,B,K)}if(Ce(B)||F(B))return fe!==null?null:G(D,C,B,K,null);if(typeof B.then=="function")return R(D,C,kr(B),K);if(B.$$typeof===xe)return R(D,C,jr(D,B),K);Tr(D,B)}return null}function q(D,C,B,K,fe){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return D=D.get(B)||null,v(C,D,""+K,fe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case X:return D=D.get(K.key===null?B:K.key)||null,w(C,D,K,fe);case Z:return D=D.get(K.key===null?B:K.key)||null,O(C,D,K,fe);case ke:return K=xl(K),q(D,C,B,K,fe)}if(Ce(K)||F(K))return D=D.get(B)||null,G(C,D,K,fe,null);if(typeof K.then=="function")return q(D,C,B,kr(K),fe);if(K.$$typeof===xe)return q(D,C,B,jr(C,K),fe);Tr(C,K)}return null}function se(D,C,B,K){for(var fe=null,Ue=null,pe=C,we=C=0,pt=null;pe!==null&&we<B.length;we++){pe.index>we?(pt=pe,pe=null):pt=pe.sibling;var He=R(D,pe,B[we],K);if(He===null){pe===null&&(pe=pt);break}e&&pe&&He.alternate===null&&t(D,pe),C=r(He,C,we),Ue===null?fe=He:Ue.sibling=He,Ue=He,pe=pt}if(we===B.length)return n(D,pe),_e&&ua(D,we),fe;if(pe===null){for(;we<B.length;we++)pe=J(D,B[we],K),pe!==null&&(C=r(pe,C,we),Ue===null?fe=pe:Ue.sibling=pe,Ue=pe);return _e&&ua(D,we),fe}for(pe=l(pe);we<B.length;we++)pt=q(pe,D,we,B[we],K),pt!==null&&(e&&(He=pt.alternate,He!==null&&pe.delete(He.key===null?we:He.key)),C=r(pt,C,we),Ue===null?fe=pt:Ue.sibling=pt,Ue=pt);return e&&pe.forEach(function(Wa){return t(D,Wa)}),_e&&ua(D,we),fe}function me(D,C,B,K){if(B==null)throw Error(u(151));for(var fe=null,Ue=null,pe=C,we=C=0,pt=null,He=B.next();pe!==null&&!He.done;we++,He=B.next()){pe.index>we?(pt=pe,pe=null):pt=pe.sibling;var Wa=R(D,pe,He.value,K);if(Wa===null){pe===null&&(pe=pt);break}e&&pe&&Wa.alternate===null&&t(D,pe),C=r(Wa,C,we),Ue===null?fe=Wa:Ue.sibling=Wa,Ue=Wa,pe=pt}if(He.done)return n(D,pe),_e&&ua(D,we),fe;if(pe===null){for(;!He.done;we++,He=B.next())He=J(D,He.value,K),He!==null&&(C=r(He,C,we),Ue===null?fe=He:Ue.sibling=He,Ue=He);return _e&&ua(D,we),fe}for(pe=l(pe);!He.done;we++,He=B.next())He=q(pe,D,we,He.value,K),He!==null&&(e&&(pt=He.alternate,pt!==null&&pe.delete(pt.key===null?we:pt.key)),C=r(He,C,we),Ue===null?fe=He:Ue.sibling=He,Ue=He);return e&&pe.forEach(function(R0){return t(D,R0)}),_e&&ua(D,we),fe}function Ae(D,C,B,K){if(typeof B=="object"&&B!==null&&B.type===ae&&B.key===null&&B.props.ref===void 0&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case X:e:{for(var fe=B.key;C!==null;){if(C.key===fe){if(fe=B.type,fe===ae){if(C.tag===7){n(D,C.sibling),K=i(C,B.props.children),Oa(K,B),K.return=D,D=K;break e}}else if(C.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ke&&xl(fe)===C.type){n(D,C.sibling),K=i(C,B.props),Oa(K,B),K.return=D,D=K;break e}n(D,C);break}else t(D,C);C=C.sibling}B.type===ae?(K=ol(B.props.children,D.mode,K,B.key),Oa(K,B),K.return=D,D=K):(K=xr(B.type,B.key,B.props,null,D.mode,K),Oa(K,B),K.return=D,D=K)}return d(D);case Z:e:{for(fe=B.key;C!==null;){if(C.key===fe)if(C.tag===4&&C.stateNode.containerInfo===B.containerInfo&&C.stateNode.implementation===B.implementation){n(D,C.sibling),K=i(C,B.children||[]),K.return=D,D=K;break e}else{n(D,C);break}else t(D,C);C=C.sibling}K=bc(B,D.mode,K),K.return=D,D=K}return d(D);case ke:return B=xl(B),Ae(D,C,B,K)}if(Ce(B))return se(D,C,B,K);if(F(B)){if(fe=F(B),typeof fe!="function")throw Error(u(150));return B=fe.call(B),me(D,C,B,K)}if(typeof B.then=="function")return Ae(D,C,kr(B),K);if(B.$$typeof===xe)return Ae(D,C,jr(D,B),K);Tr(D,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,C!==null&&C.tag===6?(n(D,C.sibling),K=i(C,B),K.return=D,D=K):(n(D,C),K=vc(B,D.mode,K),K.return=D,D=K),d(D)):n(D,C)}return function(D,C,B,K){try{ei=0;var fe=Ae(D,C,B,K);return Jl=null,fe}catch(pe){if(pe===Kl||pe===wr)throw pe;var Ue=Xt(29,pe,null,D.mode);return Ue.lanes=K,Ue.return=D,Ue}finally{}}}var gl=Dh(!0),_h=Dh(!1),Ma=!1;function Rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ac(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 La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,($e&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=mr(e),ph(e,null,n),t}return hr(e,l,t,n),mr(e)}function ti(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,bf(e,n)}}function Dc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=d:r=r.next=d,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _c=!1;function ni(){if(_c){var e=Ql;if(e!==null)throw e}}function ai(e,t,n,l){_c=!1;var i=e.updateQueue;Ma=!1;var r=i.firstBaseUpdate,d=i.lastBaseUpdate,v=i.shared.pending;if(v!==null){i.shared.pending=null;var w=v,O=w.next;w.next=null,d===null?r=O:d.next=O,d=w;var G=e.alternate;G!==null&&(G=G.updateQueue,v=G.lastBaseUpdate,v!==d&&(v===null?G.firstBaseUpdate=O:v.next=O,G.lastBaseUpdate=w))}if(r!==null){var J=i.baseState;d=0,G=O=w=null,v=r;do{var R=v.lane&-536870913,q=R!==v.lane;if(q?(Le&R)===R:(l&R)===R){R!==0&&R===hl&&(_c=!0),G!==null&&(G=G.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var se=e,me=v;R=t;var Ae=n;switch(me.tag){case 1:if(se=me.payload,typeof se=="function"){J=se.call(Ae,J,R);break e}J=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=me.payload,R=typeof se=="function"?se.call(Ae,J,R):se,R==null)break e;J=M({},J,R);break e;case 2:Ma=!0}}R=v.callback,R!==null&&(e.flags|=64,q&&(e.flags|=8192),q=i.callbacks,q===null?i.callbacks=[R]:q.push(R))}else q={lane:R,tag:v.tag,payload:v.payload,callback:v.callback,next:null},G===null?(O=G=q,w=J):G=G.next=q,d|=R;if(v=v.next,v===null){if(v=i.shared.pending,v===null)break;q=v,v=q.next,q.next=null,i.lastBaseUpdate=q,i.shared.pending=null}}while(!0);G===null&&(w=J),i.baseState=w,i.firstBaseUpdate=O,i.lastBaseUpdate=G,r===null&&(i.shared.lanes=0),Va|=d,e.lanes=d,e.memoizedState=J}}function Oh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Mh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Oh(n[e],t)}var Ha=Bt(null),Cr=Bt(0);function Lh(e,t){e=ga,de(Cr,e),de(Ha,t),ga=e|t.baseLanes}function Oc(){de(Cr,ga),de(Ha,Ha.current)}function Mc(){ga=Cr.current,V(Ha),V(Cr)}var zt=Bt(null),Lt=null;function Ba(e){var t=e.alternate;de(Rt,Rt.current&1),de(zt,e),Lt===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(Lt=e)}function Lc(e){de(Rt,Rt.current),de(zt,e),Lt===null&&(Lt=e)}function Uh(e){e.tag===22?(de(Rt,Rt.current),de(zt,e),Lt===null&&(Lt=e)):qa()}function qa(){de(Rt,Rt.current),de(zt,zt.current)}function sn(e){V(zt),Lt===e&&(Lt=null),V(Rt)}var Rt=Bt(0);function li(e,t){de(zt,zt.current),de(Rt,t)}function Uc(e){V(Rt),V(zt),Lt===e&&(Lt=null)}function Er(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sd(n)||id(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 ha=0,Re=null,Fe=null,mt=null,zr=!1,Pl=!1,yl=!1,Rr=0,si=0,Fl=null,Fv=0;function ot(){throw Error(u(321))}function Hc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ln(e[n],t[n]))return!1;return!0}function Bc(e,t,n,l,i,r){return ha=r,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ce.H=e===null||e.memoizedState===null?bm:jm,yl=!1,r=n(l,i),yl=!1,Pl&&(r=Bh(t,n,l,i)),Hh(e),r}function Hh(e){ce.H=Ur;var t=Fe!==null&&Fe.next!==null;if(ha=0,mt=Fe=Re=null,zr=!1,si=0,Fl=null,t)throw Error(u(300));e===null||xt||(e=e.dependencies,e!==null&&br(e)&&(xt=!0))}function Bh(e,t,n,l){Re=e;var i=0;do{if(Pl&&(Fl=null),si=0,Pl=!1,25<=i)throw Error(u(301));if(i+=1,mt=Fe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}ce.H=sb,r=t(n,l)}while(Pl);return r}function Iv(){var e=ce.H,t=e.useState()[0];return t=typeof t.then=="function"?ii(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(Re.flags|=1024),t}function qc(){var e=Rr!==0;return Rr=0,e}function Gc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Yc(e){if(zr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}zr=!1}ha=0,mt=Fe=Re=null,Pl=!1,si=Rr=0,Fl=null}function Gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Re.memoizedState=mt=e:mt=mt.next=e,mt}function dt(){if(Fe===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=mt===null?Re.memoizedState:mt.next;if(t!==null)mt=t,Fe=e;else{if(e===null)throw Re.alternate===null?Error(u(467)):Error(u(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},mt===null?Re.memoizedState=mt=e:mt=mt.next=e}return mt}function Ar(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ii(e){var t=si;return si+=1,Fl===null&&(Fl=[]),e=zh(Fl,e,t),t=Re,(mt===null?t.memoizedState:mt.next)===null&&(t=t.alternate,ce.H=t===null||t.memoizedState===null?bm:jm),e}function Dr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ii(e);if(e.$$typeof===I)return;if(e.$$typeof===xe)return Et(e)}throw Error(u(438,String(e)))}function $c(e){var t=null,n=Re.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Re.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ar(),Re.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=qe;return t.index++,n}function ma(e,t){return typeof t=="function"?t(e):t}function _r(e){var t=dt();return Vc(t,Fe,e)}function Vc(e,t,n){var l=e.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=n;var i=e.baseQueue,r=l.pending;if(r!==null){if(i!==null){var d=i.next;i.next=r.next,r.next=d}t.baseQueue=i=r,l.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var v=d=null,w=null,O=t,G=!1;do{var J=O.lane&-536870913;if(J!==O.lane?(Le&J)===J:(ha&J)===J){var R=O.revertLane;if(R===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),J===hl&&(G=!0);else if((ha&R)===R){O=O.next,R===hl&&(G=!0);continue}else J={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},w===null?(v=w=J,d=r):w=w.next=J,Re.lanes|=R,Va|=R;J=O.action,yl&&n(r,J),r=O.hasEagerState?O.eagerState:n(r,J)}else R={lane:J,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},w===null?(v=w=R,d=r):w=w.next=R,Re.lanes|=J,Va|=J;O=O.next}while(O!==null&&O!==t);if(w===null?d=r:w.next=v,!ln(r,e.memoizedState)&&(xt=!0,G&&(n=Ql,n!==null)))throw n;e.memoizedState=r,e.baseState=d,e.baseQueue=w,l.lastRenderedState=r}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Xc(e){var t=dt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var d=i=i.next;do r=e(r,d.action),d=d.next;while(d!==i);ln(r,t.memoizedState)||(xt=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,l]}function qh(e,t,n){var l=Re,i=dt(),r=_e;if(r){if(n===void 0)throw Error(u(407));n=n()}else n=t();var d=!ln((Fe||i).memoizedState,n);if(d&&(i.memoizedState=n,xt=!0),i=i.queue,Kc($h.bind(null,l,i,e),[e]),e=i.getSnapshot!==t||d||mt!==null&&(mt.memoizedState.tag&1)!==0,Il(e?9:8,{destroy:void 0},Yh.bind(null,l,i,n,t),null),e){if(l.flags|=2048,We===null)throw Error(u(349));r||(ha&127)!==0||Gh(l,t,n)}return n}function Gh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t=Ar(),Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Yh(e,t,n,l){t.value=n,t.getSnapshot=l,Vh(t)&&Xh(e)}function $h(e,t,n){return n(function(){Vh(t)&&Xh(e)})}function Vh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ln(e,n)}catch{return!0}}function Xh(e){var t=rl(e,2);t!==null&&Jt(t,e,2)}function Zc(e){var t=Gt();if(typeof e=="function"){var n=e;if(e=n(),yl){Ca(!0);try{n()}finally{Ca(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:e},t}function Zh(e,t,n,l){return e.baseState=n,Vc(e,Fe,typeof l=="function"?l:ma)}function Wv(e,t,n,l,i){if(Lr(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){r.listeners.push(d)}};ce.T!==null?n(!0):r.isTransition=!1,l(r),n=t.pending,n===null?(r.next=t.pending=r,Qh(t,r)):(r.next=n.next,t.pending=n.next=r)}}function Qh(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var r=ce.T,d={};d.types=r!==null?r.types:null,ce.T=d;try{var v=n(i,l),w=ce.S;w!==null&&w(d,v),Kh(e,t,v)}catch(O){Qc(e,t,O)}finally{r!==null&&d.types!==null&&(r.types=d.types),ce.T=r}}else try{r=n(i,l),Kh(e,t,r)}catch(O){Qc(e,t,O)}}function Kh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Jh(e,t,l)},function(l){return Qc(e,t,l)}):Jh(e,t,n)}function Jh(e,t,n){t.status="fulfilled",t.value=n,Ph(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qh(e,n)))}function Qc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Ph(t),t=t.next;while(t!==l)}e.action=null}function Ph(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fh(e,t){return t}function Ih(e,t){if(_e){var n=We.formState;if(n!==null){e:{var l=Re;if(_e){if(et){t:{for(var i=et,r=vn;i.nodeType!==8;){if(!r){i=null;break t}if(i=jn(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){et=jn(i.nextSibling),l=i.data==="F!";break e}}Da(l)}l=!1}l&&(t=n[0])}}return n=Gt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fh,lastRenderedState:t},n.queue=l,n=gm.bind(null,Re,l),l.dispatch=n,l=Zc(!1),r=Wc.bind(null,Re,!1,l.queue),l=Gt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=Wv.bind(null,Re,i,r,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Wh(e){var t=dt();return em(t,Fe,e)}function em(e,t,n){if(t=Vc(e,t,Fh)[0],e=_r(ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ii(t)}catch(d){throw d===Kl?wr:d}else l=t;t=dt();var i=t.queue,r=i.dispatch;return n!==t.memoizedState&&(Re.flags|=2048,Il(9,{destroy:void 0},eb.bind(null,i,n),null)),[l,r,e]}function eb(e,t){e.action=t}function tm(e){var t=dt(),n=Fe;if(n!==null)return em(t,n,e);dt(),t=t.memoizedState,n=dt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Il(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Re.updateQueue,t===null&&(t=Ar(),Re.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function nm(){return dt().memoizedState}function Or(e,t,n,l){var i=Gt();Re.flags|=e,i.memoizedState=Il(1|t,{destroy:void 0},n,l===void 0?null:l)}function Mr(e,t,n,l){var i=dt();l=l===void 0?null:l;var r=i.memoizedState.inst;Fe!==null&&l!==null&&Hc(l,Fe.memoizedState.deps)?i.memoizedState=Il(t,r,n,l):(Re.flags|=e,i.memoizedState=Il(1|t,r,n,l))}function am(e,t){Or(8390656,8,e,t)}function Kc(e,t){Mr(2048,8,e,t)}function tb(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=Ar(),Re.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function lm(e){var t=dt().memoizedState;return tb({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function sm(e,t){return Mr(4,2,e,t)}function im(e,t){return Mr(4,4,e,t)}function rm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function om(e,t,n){n=n!=null?n.concat([e]):null,Mr(4,4,rm.bind(null,t,e),n)}function Jc(){}function cm(e,t){var n=dt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Hc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function um(e,t){var n=dt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Hc(t,l[1]))return l[0];if(l=e(),yl){Ca(!0);try{e()}finally{Ca(!1)}}return n.memoizedState=[l,t],l}function Pc(e,t,n){return n===void 0||(ha&1073741824)!==0&&(Le&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=bx(),Re.lanes|=e,Va|=e,n)}function dm(e,t,n,l){return ln(n,t)?n:Ha.current!==null?(e=Pc(e,n,l),ln(e,t)||(xt=!0),e):(ha&106)===0||(ha&1073741824)!==0&&(Le&261930)===0?(xt=!0,e.memoizedState=n):(e=bx(),Re.lanes|=e,Va|=e,t)}function fm(e,t,n,l,i){var r=ye.p;ye.p=r!==0&&8>r?r:8;var d=ce.T,v={};v.types=d!==null?d.types:null,ce.T=v,Wc(e,!1,t,n);try{var w=i(),O=ce.S;if(O!==null&&O(v,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var G=Pv(w,l);ri(e,t,G,un(e))}else ri(e,t,l,un(e))}catch(J){ri(e,t,{then:function(){},status:"rejected",reason:J},un())}finally{ye.p=r,d!==null&&v.types!==null&&(d.types=v.types),ce.T=d}}function nb(){}function Fc(e,t,n,l){if(e.tag!==5)throw Error(u(476));var i=hm(e).queue;fm(e,i,t,Ht,n===null?nb:function(){return mm(e),n(l)})}function hm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ht,baseState:Ht,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:Ht},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function mm(e){var t=hm(e);t.next===null&&(t=e.alternate.memoizedState),ri(e,t.next.queue,{},un())}function Ic(){return Et(gs)}function xm(){return dt().memoizedState}function pm(){return dt().memoizedState}function ab(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=un();e=La(n);var l=Ua(t,e,n);l!==null&&(Jt(l,t,n),ti(l,t,n)),t={cache:Tc()},e.payload=t;return}t=t.return}}function lb(e,t,n){var l=un();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Lr(e)?ym(t,n):(n=gc(e,t,n,l),n!==null&&(Jt(n,e,l),vm(n,t,l)))}function gm(e,t,n){var l=un();ri(e,t,n,l)}function ri(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Lr(e))ym(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var d=t.lastRenderedState,v=r(d,n);if(i.hasEagerState=!0,i.eagerState=v,ln(v,d))return hr(e,t,i,0),We===null&&fr(),!1}catch{}finally{}if(n=gc(e,t,i,l),n!==null)return Jt(n,e,l),vm(n,t,l),!0}return!1}function Wc(e,t,n,l){if(l={lane:2,revertLane:$u(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Lr(e)){if(t)throw Error(u(479))}else t=gc(e,n,l,2),t!==null&&Jt(t,e,2)}function Lr(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function ym(e,t){Pl=zr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vm(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,bf(e,n)}}var Ur={readContext:Et,use:Dr,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot,useEffectEvent:ot},bm={readContext:Et,use:Dr,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:am,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Or(4194308,4,rm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Or(4194308,4,e,t)},useInsertionEffect:function(e,t){Or(4,2,e,t)},useMemo:function(e,t){var n=Gt();t=t===void 0?null:t;var l=e();if(yl){Ca(!0);try{e()}finally{Ca(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Gt();if(n!==void 0){var i=n(t);if(yl){Ca(!0);try{n(t)}finally{Ca(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=lb.bind(null,Re,e),[l.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:function(e){e=Zc(e);var t=e.queue,n=gm.bind(null,Re,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Jc,useDeferredValue:function(e,t){var n=Gt();return Pc(n,e,t)},useTransition:function(){var e=Zc(!1);return e=fm.bind(null,Re,e.queue,!0,!1),Gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Re,i=Gt();if(_e){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),We===null)throw Error(u(349));(Le&127)!==0||Gh(l,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,am($h.bind(null,l,r,e),[e]),l.flags|=2048,Il(9,{destroy:void 0},Yh.bind(null,l,r,n,t),null),n},useId:function(){var e=Gt(),t=We.identifierPrefix;if(_e){var n=Vn,l=$n;n=(l&~(1<<32-nn(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Rr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Fv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ic,useFormState:Ih,useActionState:Ih,useOptimistic:function(e){var t=Gt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Wc.bind(null,Re,!0,n),n.dispatch=t,[e,t]},useMemoCache:$c,useCacheRefresh:function(){return Gt().memoizedState=ab.bind(null,Re)},useEffectEvent:function(e){var t=Gt(),n={impl:e};return t.memoizedState=n,function(){if(($e&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},jm={readContext:Et,use:Dr,useCallback:cm,useContext:Et,useEffect:Kc,useImperativeHandle:om,useInsertionEffect:sm,useLayoutEffect:im,useMemo:um,useReducer:_r,useRef:nm,useState:function(){return _r(ma)},useDebugValue:Jc,useDeferredValue:function(e,t){var n=dt();return dm(n,Fe.memoizedState,e,t)},useTransition:function(){var e=_r(ma)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:ii(e),t]},useSyncExternalStore:qh,useId:xm,useHostTransitionStatus:Ic,useFormState:Wh,useActionState:Wh,useOptimistic:function(e,t){var n=dt();return Zh(n,Fe,e,t)},useMemoCache:$c,useCacheRefresh:pm,useEffectEvent:lm},sb={readContext:Et,use:Dr,useCallback:cm,useContext:Et,useEffect:Kc,useImperativeHandle:om,useInsertionEffect:sm,useLayoutEffect:im,useMemo:um,useReducer:Xc,useRef:nm,useState:function(){return Xc(ma)},useDebugValue:Jc,useDeferredValue:function(e,t){var n=dt();return Fe===null?Pc(n,e,t):dm(n,Fe.memoizedState,e,t)},useTransition:function(){var e=Xc(ma)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:ii(e),t]},useSyncExternalStore:qh,useId:xm,useHostTransitionStatus:Ic,useFormState:tm,useActionState:tm,useOptimistic:function(e,t){var n=dt();return Fe!==null?Zh(n,Fe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:$c,useCacheRefresh:pm,useEffectEvent:lm};function eu(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:M({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tu={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=un(),i=La(l);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,l),t!==null&&(Jt(t,e,l),ti(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=un(),i=La(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,l),t!==null&&(Jt(t,e,l),ti(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=un(),l=La(n);l.tag=2,t!=null&&(l.callback=t),t=Ua(e,l,n),t!==null&&(Jt(t,e,n),ti(t,e,n))}};function Nm(e,t,n,l,i,r,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,r,d):t.prototype&&t.prototype.isPureReactComponent?!Qs(n,l)||!Qs(i,r):!0}function wm(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&tu.enqueueReplaceState(t,t.state,null)}function vl(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=M({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function Sm(e){dr(e)}function km(e){console.error(e)}function Tm(e){dr(e)}function Hr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Cm(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function nu(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Hr(e,t)},n}function Em(e){return e=La(e),e.tag=3,e}function zm(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=l.value;e.payload=function(){return i(r)},e.callback=function(){Cm(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Cm(t,n,l),typeof i!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var v=l.stack;this.componentDidCatch(l.value,{componentStack:v!==null?v:""})})}function ib(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&dl(t,n,i,!0),n=zt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Lt===null?so():n.alternate===null&&ct===0&&(ct=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===Sr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),qu(e,l,i)),!1;case 22:return n.flags|=65536,l===Sr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),qu(e,l,i)),!1}throw Error(u(435,n.tag))}return qu(e,l,i),so(),!1}if(_e)return t=zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==Nc&&(e=Error(u(422),{cause:l}),Ps(pn(e,n)))):(l!==Nc&&(t=Error(u(423),{cause:l}),Ps(pn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=pn(l,n),i=nu(e.stateNode,l,i),Dc(e,i),ct!==4&&(ct=2)),!1;var r=Error(u(520),{cause:l});if(r=pn(r,n),xi===null?xi=[r]:xi.push(r),ct!==4&&(ct=2),t===null)return!0;l=pn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=nu(n.stateNode,l,e),Dc(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Xa===null||!Xa.has(r))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Em(i),zm(i,e,n,l),Dc(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var au=Error(u(461)),xt=!1;function gt(e,t,n,l){t.child=e===null?_h(t,null,n,l):gl(t,e.child,n,l)}function Rm(e,t,n,l,i){n=n.render;var r=t.ref;if("ref"in l){var d={};for(var v in l)v!=="ref"&&(d[v]=l[v])}else d=l;return fl(t),l=Bc(e,t,n,d,r,i),v=qc(),e!==null&&!xt?(Gc(e,t,i),xa(e,t,i)):(_e&&v&&gr(t),t.flags|=1,gt(e,t,l,i),t.child)}function Am(e,t,n,l,i){if(e===null){var r=n.type;return typeof r=="function"&&!yc(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,Dm(e,t,r,l,i)):(e=xr(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!du(e,i)){var d=r.memoizedProps;if(n=n.compare,n=n!==null?n:Qs,n(d,l)&&e.ref===t.ref)return xa(e,t,i)}return t.flags|=1,e=ca(r,l),e.ref=t.ref,e.return=t,t.child=e}function Dm(e,t,n,l,i){if(e!==null){var r=e.memoizedProps;if(Qs(r,l)&&e.ref===t.ref)if(xt=!1,t.pendingProps=l=r,du(e,i))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,xa(e,t,i)}return lu(e,t,n,l,i)}function _m(e,t,n,l){var i=l.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~r}else l=0,t.child=null;return Om(e,t,r,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Nr(t,r!==null?r.cachePool:null),r!==null?Lh(t,r):Oc(),Uh(t);else return l=t.lanes=536870912,Om(e,t,r!==null?r.baseLanes|n:n,n,l)}else r!==null?(Nr(t,r.cachePool),Lh(t,r),qa(),t.memoizedState=null):(e!==null&&Nr(t,null),Oc(),qa());return gt(e,t,i,n),t.child}function oi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Om(e,t,n,l,i){var r=Ec();return r=r===null?null:{parent:ht._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Nr(t,null),Oc(),Uh(t),e!==null&&dl(e,t,l,!0),t.childLanes=i,null}function Br(e,t){return t=qr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Mm(e,t,n){return gl(t,e.child,null,n),e=Br(t,t.pendingProps),e.flags|=2,sn(t),t.memoizedState=null,e}function rb(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(_e){if(l.mode==="hidden")return e=Br(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},oi(null,e);if(Lc(t),(e=et)?(e=rp(e,vn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ra!==null?{id:$n,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},n=yh(e),n.return=t,t.child=n,Nt=t,et=null)):e=null,e===null)throw Da(t);return t.lanes=536870912,null}return Br(t,l)}var r=e.memoizedState;if(r!==null){var d=r.dehydrated;if(Lc(t),i)if(t.flags&256)t.flags&=-257,t=Mm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(xt||dl(e,t,n,!1),i=(n&e.childLanes)!==0,xt||i){if(Ha.current===null){if(l=We,l!==null&&(d=jf(l,n),d!==0&&d!==r.retryLane))throw r.retryLane=d,rl(e,d),Jt(l,e,d),au;so()}t=Mm(e,t,n)}else e=r.treeContext,et=jn(d.nextSibling),Nt=t,_e=!0,Aa=null,vn=!1,e!==null&&jh(t,e),t=Br(t,l),t.flags|=134221824;return t}return e=ca(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wl(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lu(e,t,n,l,i){return fl(t),n=Bc(e,t,n,l,void 0,i),l=qc(),e!==null&&!xt?(Gc(e,t,i),xa(e,t,i)):(_e&&l&&gr(t),t.flags|=1,gt(e,t,n,i),t.child)}function Lm(e,t,n,l,i,r){return fl(t),t.updateQueue=null,n=Bh(t,l,n,i),Hh(e),l=qc(),e!==null&&!xt?(Gc(e,t,r),xa(e,t,r)):(_e&&l&&gr(t),t.flags|=1,gt(e,t,n,r),t.child)}function Um(e,t,n,l,i){if(fl(t),t.stateNode===null){var r=$l,d=n.contextType;typeof d=="object"&&d!==null&&(r=Et(d)),r=new n(l,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=tu,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=l,r.state=t.memoizedState,r.refs={},Rc(t),d=n.contextType,r.context=typeof d=="object"&&d!==null?Et(d):$l,r.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(eu(t,n,d,l),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(d=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),d!==r.state&&tu.enqueueReplaceState(r,r.state,null),ai(t,l,r,i),ni(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){r=t.stateNode;var v=t.memoizedProps,w=vl(n,v);r.props=w;var O=r.context,G=n.contextType;d=$l,typeof G=="object"&&G!==null&&(d=Et(G));var J=n.getDerivedStateFromProps;G=typeof J=="function"||typeof r.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,G||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(v||O!==d)&&wm(t,r,l,d),Ma=!1;var R=t.memoizedState;r.state=R,ai(t,l,r,i),ni(),O=t.memoizedState,v||R!==O||Ma?(typeof J=="function"&&(eu(t,n,J,l),O=t.memoizedState),(w=Ma||Nm(t,n,w,l,R,O,d))?(G||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=O),r.props=l,r.state=O,r.context=d,l=w):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{r=t.stateNode,Ac(e,t),d=t.memoizedProps,G=vl(n,d),r.props=G,J=t.pendingProps,R=r.context,O=n.contextType,w=$l,typeof O=="object"&&O!==null&&(w=Et(O)),v=n.getDerivedStateFromProps,(O=typeof v=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==J||R!==w)&&wm(t,r,l,w),Ma=!1,R=t.memoizedState,r.state=R,ai(t,l,r,i),ni();var q=t.memoizedState;d!==J||R!==q||Ma||e!==null&&e.dependencies!==null&&br(e.dependencies)?(typeof v=="function"&&(eu(t,n,v,l),q=t.memoizedState),(G=Ma||Nm(t,n,G,l,R,q,w)||e!==null&&e.dependencies!==null&&br(e.dependencies))?(O||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(l,q,w),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(l,q,w)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=q),r.props=l,r.state=q,r.context=w,l=G):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),l=!1)}return r=l,Wl(e,t),l=(t.flags&128)!==0,r||l?(r=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&l?(t.child=gl(t,e.child,null,i),t.child=gl(t,null,n,i)):gt(e,t,n,i),t.memoizedState=r.state,e=t.child):e=xa(e,t,i),e}function Hm(e,t,n,l){return cl(),t.flags|=256,gt(e,t,n,l),t.child}var su={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function iu(e){return{baseLanes:e,cachePool:Ch()}}function ru(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=cn),e}function Bm(e,t,n){var l=t.pendingProps,i=!1,r=(t.flags&128)!==0,d;if((d=r)||(d=e!==null&&e.memoizedState===null?!1:(Rt.current&2)!==0),d&&(i=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(_e){if(i?Ba(t):qa(),(e=et)?(e=rp(e,vn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ra!==null?{id:$n,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},n=yh(e),n.return=t,t.child=n,Nt=t,et=null)):e=null,e===null)throw Da(t);return id(e)?t.lanes=32:t.lanes=536870912,null}return r=l.children,l=l.fallback,i?(qa(),i=t.mode,r=qr({mode:"hidden",children:r},i),l=ol(l,i,n,null),r.return=t,l.return=t,r.sibling=l,t.child=r,l=t.child,l.memoizedState=iu(n),l.childLanes=ru(e,d,n),t.memoizedState=su,oi(null,l)):(Ba(t),ou(t,r))}var v=e.memoizedState;if(v!==null){var w=v.dehydrated;if(w!==null)return ob(e,t,r,d,l,w,v,n)}return i?(qa(),i=l.fallback,r=t.mode,v=e.child,w=v.sibling,l=ca(v,{mode:"hidden",children:l.children}),l.subtreeFlags=v.subtreeFlags&1206910976,w!==null?i=ca(w,i):(i=ol(i,r,n,null),i.flags|=2),i.return=t,l.return=t,l.sibling=i,t.child=l,oi(null,l),l=t.child,i=e.child.memoizedState,i===null?i=iu(n):(r=i.cachePool,r!==null?(v=ht._currentValue,r=r.parent!==v?{parent:v,pool:v}:r):r=Ch(),i={baseLanes:i.baseLanes|n,cachePool:r}),l.memoizedState=i,l.childLanes=ru(e,d,n),t.memoizedState=su,oi(e.child,l)):(Ba(t),n=e.child,e=n.sibling,n=ca(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function ou(e,t){return t=qr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function qr(e,t){return e=Xt(22,e,null,t),e.lanes=0,e}function Gr(e,t,n){return gl(t,e.child,null,n),e=ou(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ob(e,t,n,l,i,r,d,v){if(n)return t.flags&256?(Ba(t),t.flags&=-257,Gr(e,t,v)):t.memoizedState!==null?(qa(),t.child=e.child,t.flags|=128,null):(qa(),r=i.fallback,d=t.mode,i=qr({mode:"visible",children:i.children},d),r=ol(r,d,v,null),r.flags|=2,i.return=t,r.return=t,i.sibling=r,t.child=i,gl(t,e.child,null,v),i=t.child,i.memoizedState=iu(v),i.childLanes=ru(e,l,v),t.memoizedState=su,oi(null,i));if(Ba(t),id(r)){if(l=r.nextSibling&&r.nextSibling.dataset,l)var w=l.dgst;return l=w,l!==""&&(i=Error(u(419)),i.stack="",i.digest=l,Ps({value:i,source:null,stack:null})),Gr(e,t,v)}if(xt||dl(e,t,v,!1),l=(v&e.childLanes)!==0,xt||l){if(Ha.current!==null)return Gr(e,t,v);if(l=We,l!==null&&(i=jf(l,v),i!==0&&i!==d.retryLane))throw d.retryLane=i,rl(e,i),Jt(l,e,i),au;return sd(r)||so(),Gr(e,t,v)}return sd(r)?(t.flags|=192,t.child=e.child,null):(e=d.treeContext,et=jn(r.nextSibling),Nt=t,_e=!0,Aa=null,vn=!1,e!==null&&jh(t,e),t=ou(t,i.children),t.flags|=134221824,t)}function qm(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),vr(e.return,t,n)}function Gm(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Er(n)===null&&(t=e),e=e.sibling}return t}function Yr(e,t,n,l,i,r){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:r}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=i,d.treeForkCount=r)}function cu(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function uu(e,t,n){var l=t.pendingProps,i=l.revealOrder,r=l.tail;l=l.children;var d=Rt.current;if(t.flags&128)return li(t,d),null;var v=(d&2)!==0;if(v?(d=d&1|2,t.flags|=128):d&=1,li(t,d),i==="backwards"&&e!==null?(cu(e),gt(e,t,l,n),cu(e)):gt(e,t,l,n),l=_e?Js:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&qm(e,n,t);else if(e.tag===19)qm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"backwards":n=Gm(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cu(t)),Yr(t,!0,i,null,r,l);break;case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Er(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Yr(t,!0,n,null,r,l);break;case"together":Yr(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:n=Gm(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Yr(t,!1,i,n,r,l)}return t.child}function Ym(e,t,n){var l=t.pendingProps;return _a(t,t.type,l.value),gt(e,t,l.children,n),t.child}function xa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Va|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(dl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=ca(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ca(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function du(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&br(e)))}function cb(e,t,n){switch(t.tag){case 3:na(t,t.stateNode.containerInfo),_a(t,ht,e.memoizedState.cache),cl();break;case 27:case 5:aa(t);break;case 4:na(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lc(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return Ba(t),t.flags|=128,null;l=dl(e,t,n,!1);var i=t.child.childLanes;return l||(n&i)!==0?Bm(e,t,n):(Ba(t),e=xa(e,t,n),e!==null?e.sibling:null)}Ba(t);break;case 19:if(t.flags&128)return uu(e,t,n);if(i=(e.flags&128)!==0,l=(n&t.childLanes)!==0,l||(dl(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return uu(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),li(t,Rt.current),l)break;return null;case 22:return t.lanes=0,_m(e,t,n,t.pendingProps);case 24:_a(t,ht,e.memoizedState.cache)}return xa(e,t,n)}function $m(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!du(e,n)&&(t.flags&128)===0)return xt=!1,cb(e,t,n);xt=(e.flags&131072)!==0}else xt=!1,_e&&(t.flags&1048576)!==0&&bh(t,Js,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=xl(t.elementType),t.type=e,typeof e=="function")yc(e)?(l=vl(e,l),t.tag=1,t=Um(null,t,e,l,n)):(t.tag=0,t=lu(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===ee){t.tag=11,t=Rm(null,t,e,l,n);break e}else if(i===le){t.tag=14,t=Am(null,t,e,l,n);break e}else if(i===xe){t.tag=10,t.type=e,t=Ym(null,t,n);break e}}throw t=De(e)||e,Error(u(306,t,""))}}return t;case 0:return lu(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=vl(l,t.pendingProps),Um(e,t,l,i,n);case 3:e:{if(na(t,t.stateNode.containerInfo),e===null)throw Error(u(387));l=t.pendingProps;var r=t.memoizedState;i=r.element,Ac(e,t),ai(t,l,null,n);var d=t.memoizedState;if(l=d.cache,_a(t,ht,l),l!==r.cache&&kc(t,[ht],n,!0),ni(),l=d.element,r.isDehydrated)if(r={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Hm(e,t,l,n);break e}else if(l!==i){i=pn(Error(u(424)),t),Ps(i),t=Hm(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=jn(e.firstChild),Nt=t,_e=!0,Aa=null,vn=!0,n=_h(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(cl(),l===i){t=xa(e,t,n);break e}gt(e,t,l,n)}t=t.child}return t;case 26:return Wl(e,t),e===null?(n=mp(t.type,null,t.pendingProps,null))?t.memoizedState=n:_e||(t.stateNode=Qx(t.type,t.pendingProps,Ge.current,t)):t.memoizedState=mp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return aa(t),e===null&&_e&&(l=t.stateNode=up(t.type,t.pendingProps,Ge.current),Nt=t,vn=!0,i=et,Ka(t.type)?(rd=i,et=jn(l.firstChild)):et=i),gt(e,t,t.pendingProps.children,n),Wl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&_e&&((i=l=et)&&(l=a0(l,t.type,t.pendingProps,vn),l!==null?(t.stateNode=l,Nt=t,et=jn(l.firstChild),vn=!1,i=!0):i=!1),i||Da(t)),aa(t),i=t.type,r=t.pendingProps,d=e!==null?e.memoizedProps:null,l=r.children,Iu(i,r)?l=null:d!==null&&Iu(i,d)&&(t.flags|=32),t.memoizedState!==null&&(i=Bc(e,t,Iv,null,null,n),gs._currentValue=i),Wl(e,t),gt(e,t,l,n),t.child;case 6:return e===null&&_e&&((e=n=et)&&(n=l0(n,t.pendingProps,vn),n!==null?(t.stateNode=n,Nt=t,et=null,e=!0):e=!1),e||Da(t)),null;case 13:return Bm(e,t,n);case 4:return na(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=gl(t,null,l,n):gt(e,t,l,n),t.child;case 11:return Rm(e,t,t.type,t.pendingProps,n);case 7:return l=t.pendingProps,Wl(e,t),gt(e,t,l,n),t.child;case 8:return gt(e,t,t.pendingProps.children,n),t.child;case 12:return gt(e,t,t.pendingProps.children,n),t.child;case 10:return Ym(e,t,n);case 9:return i=t.type._context,l=t.pendingProps.children,fl(t),i=Et(i),l=l(i),t.flags|=1,gt(e,t,l,n),t.child;case 14:return Am(e,t,t.type,t.pendingProps,n);case 15:return Dm(e,t,t.type,t.pendingProps,n);case 19:return uu(e,t,n);case 31:return rb(e,t,n);case 22:return _m(e,t,n,t.pendingProps);case 24:return fl(t),l=Et(ht),e===null?(i=Ec(),i===null&&(i=We,r=Tc(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),t.memoizedState={parent:l,cache:i},Rc(t),_a(t,ht,i)):((e.lanes&n)!==0&&(Ac(e,t),ai(t,null,null,n),ni()),i=e.memoizedState,r=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),_a(t,ht,l)):(l=r.cache,_a(t,ht,l),l!==i.cache&&kc(t,[ht],n,!0))),gt(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:_e&&gr(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Wl(e,t),gt(e,t,l.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function pa(e){e.flags|=4}function fu(e,t,n,l,i){var r;if((r=(e.mode&32)!==0)&&(r=n===null?yp(t,l):yp(t,l)&&(l.src!==n.src||l.srcSet!==n.srcSet)),r){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Sx())e.flags|=8192;else throw pl=Sr,zc}else e.flags&=-16777217}function Vm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vp(t))if(Sx())e.flags|=8192;else throw pl=Sr,zc}function $r(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yf():536870912,e.lanes|=t,ls|=t)}function ci(e,t){if(!_e)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&1206910976,l|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function ub(e,t,n){var l=t.pendingProps;switch(jc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),fa(ht),Rn(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Zl(t)?pa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wc())),tt(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(pa(t),r!==null?(tt(t),Vm(t,r)):(tt(t),fu(t,i,null,l,n))):r?r!==e.memoizedState?(pa(t),tt(t),Vm(t,r)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&pa(t),tt(t),fu(t,i,e,l,n)),null;case 27:if(Rl(t),n=Ge.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return tt(t),t.subtreeFlags&=-33554433,null}e=be.current,Zl(t)?Nh(t):(e=up(i,l,n),t.stateNode=e,pa(t))}return tt(t),t.subtreeFlags&=-33554433,null;case 5:if(Rl(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return tt(t),t.subtreeFlags&=-33554433,null}if(r=be.current,Zl(t))Nh(t);else{var d=bi(Ge.current);switch(r){case 1:r=d.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=d.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=d.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?r.multiple=!0:l.size&&(r.size=l.size);break;default:r=typeof l.is=="string"?d.createElement(i,{is:l.is}):d.createElement(i)}}r[Ct]=t,r[Vt]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)r.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=r;e:switch(Dt(r,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&pa(t)}}return tt(t),t.subtreeFlags&=-33554433,fu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(e=Ge.current,Zl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=Nt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||$x(e.nodeValue,n)),e||Da(t,!0)}else e=bi(e).createTextNode(l),e[Ct]=t,t.stateNode=e}return tt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Zl(t),n!==null){if(e===null){if(!l)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Ct]=t}else cl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else n=wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(sn(t),t):(sn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return tt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Zl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(u(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(u(317));i[Ct]=t}else cl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else i=wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(sn(t),t):(sn(t),null)}return sn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),r=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(r=l.memoizedState.cachePool.pool),r!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),$r(t,t.updateQueue),tt(t),null);case 4:return Rn(),e===null&&Qu(t.stateNode.containerInfo),t.flags|=67108864,tt(t),null;case 10:return fa(t.type),tt(t),null;case 19:if(Uc(t),l=t.memoizedState,l===null)return tt(t),null;if(i=(t.flags&128)!==0,r=l.rendering,r===null)if(i)ci(l,!1);else{if(ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Er(e),r!==null){for(t.flags|=128,ci(l,!1),e=r.updateQueue,t.updateQueue=e,$r(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gh(n,e),n=n.sibling;return li(t,Rt.current&1|2),_e&&ua(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&en()>to&&(t.flags|=128,i=!0,ci(l,!1),t.lanes=4194304)}else{if(!i)if(e=Er(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,$r(t,e),ci(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!r.alternate&&!_e)return tt(t),null}else 2*en()-l.renderingStartTime>to&&n!==536870912&&(t.flags|=128,i=!0,ci(l,!1),t.lanes=4194304);l.isBackwards?(r.sibling=t.child,t.child=r):(e=l.last,e!==null?e.sibling=r:t.child=r,l.last=r)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=en(),e.sibling=null,r=Rt.current,r=i?r&1|2:r&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!n||_e?li(t,r):(n=r,de(zt,t),de(Rt,n),Lt===null&&(Lt=t)),_e&&ua(t,l.treeForkCount),e}return tt(t),null;case 22:case 23:return sn(t),Mc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),n=t.updateQueue,n!==null&&$r(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&V(ml),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fa(ht),tt(t),null;case 25:return null;case 30:return t.flags|=33554432,tt(t),null}throw Error(u(156,t.tag))}function db(e,t){switch(jc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fa(ht),Rn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Rl(t),null;case 31:if(t.memoizedState!==null){if(sn(t),t.alternate===null)throw Error(u(340));cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Uc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Rn(),null;case 10:return fa(t.type),null;case 22:case 23:return sn(t),Mc(),e!==null&&V(ml),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fa(ht),null;case 25:return null;default:return null}}function Xm(e,t){switch(jc(t),t.tag){case 3:fa(ht),Rn();break;case 26:case 27:case 5:Rl(t);break;case 4:Rn();break;case 31:t.memoizedState!==null&&sn(t);break;case 13:sn(t);break;case 19:Uc(t);break;case 10:fa(t.type);break;case 22:case 23:sn(t),Mc(),e!==null&&V(ml);break;case 24:fa(ht)}}function ui(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var r=n.create,d=n.inst;l=r(),d.destroy=l}n=n.next}while(n!==i)}}catch(v){Qe(t,t.return,v)}}function Ga(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var r=i.next;l=r;do{if((l.tag&e)===e){var d=l.inst,v=d.destroy;if(v!==void 0){d.destroy=void 0,i=t;var w=n,O=v;try{O()}catch(G){Qe(i,w,G)}}}l=l.next}while(l!==r)}}catch(G){Qe(t,t.return,G)}}function Zm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Mh(t,n)}catch(l){Qe(e,e.return,l)}}}function Qm(e,t,n){n.props=vl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Qe(e,t,l)}}function Xn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var i=e.stateNode,r=ra(e.memoizedProps,i);(i.ref===null||i.ref.name!==r)&&(i.ref=ep(r)),l=i.ref;break;case 7:if(e.stateNode===null){var d=new dn(e);y(e.child,!1,t0,d,void 0,void 0),e.stateNode=d}l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(v){Qe(e,t,v)}}function At(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Qe(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Qe(e,t,i)}else n.current=null}function Vr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)ip(e.stateNode,t[n])}function Km(e){for(var t=e.return;t!==null&&(mu(t)&&ip(e.stateNode,t.stateNode),!hu(t));)t=t.return}function di(e){for(var t=e.return;t!==null&&(mu(t)&&n0(e.stateNode,t.stateNode),!hu(t));)t=t.return}function hu(e){return e.tag===5||e.tag===3||e.tag===27}function mu(e){return e&&e.tag===7&&e.stateNode!==null}function xu(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){Qe(e,e.return,i)}}function pu(e,t,n){try{var l=e.stateNode;Ub(l,e.type,n,t),l[Vt]=t}catch(i){Qe(e,e.return,i)}}function Jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ka(e.type)||e.tag===4}function gu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jm(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&&Ka(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 yu(e,t,n,l){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yn)),Vr(e,l),Ye=!0;else if(i!==4&&(i===27&&(Vr(e,l),l=null,Ka(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(yu(e,t,n,l),e=e.sibling;e!==null;)yu(e,t,n,l),e=e.sibling}function Xr(e,t,n,l){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Vr(e,l),Ye=!0;else if(i!==4&&(i===27&&(Vr(e,l),l=null,Ka(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Xr(e,t,n,l),e=e.sibling;e!==null;)Xr(e,t,n,l),e=e.sibling}function Pm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Dt(t,l,n),t[Ct]=e,t[Vt]=n}catch(r){Qe(e,e.return,r)}}var Zr=!1,rn=null;function Fm(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Zr=!0)}var Zn=null;function Im(){var e=Zn;return Zn=null,e}var Zt=0;function es(e,t,n,l,i){return Zt=0,Wm(e.child,t,n,l,i)}function Wm(e,t,n,l,i){for(var r=!1;e!==null;){if(e.tag===5){var d=e.stateNode;if(l!==null){var v=td(d);l.push(v),v.view&&(r=!0)}else r||td(d).view&&(r=!0);Zr=!0,Ix(d,Zt===0?t:t+"_"+Zt,n),Zt++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Wm(e.child,t,n,l,i)&&(r=!0));e=e.sibling}return r}function Qn(e,t){for(;e!==null;)e.tag===5?Wx(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Qn(e.child,t)),e=e.sibling}function Qr(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Qr(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(u(544));var n=t.name;t=oa(t.default,t.share),t!=="none"&&(es(e,n,t,null,!1)||Qn(e.child,!1))}e=e.sibling}}function vu(e,t){if(e.tag===30){var n=e.stateNode,l=e.memoizedProps,i=ra(l,n),r=oa(l.default,n.paired?l.share:l.enter);r!=="none"?es(e,i,r,null,!1)?(Qr(e),n.paired||t||os(e,l.onEnter)):Qn(e.child,!1):Qr(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)vu(e,t),e=e.sibling;else Qr(e)}function bu(e){if(rn!==null&&rn.size!==0){var t=rn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,l=n.name;if(l!=null&&l!=="auto"){var i=t.get(l);if(i!==void 0){var r=oa(n.default,n.share);if(r!=="none"&&(es(e,l,r,null,!1)?(r=e.stateNode,i.paired=r,r.paired=i,os(e,n.onShare)):Qn(e.child,!1)),t.delete(l),t.size===0)break}}}bu(e)}e=e.sibling}}}function ju(e){if(e.tag===30){var t=e.memoizedProps,n=ra(t,e.stateNode),l=rn!==null?rn.get(n):void 0,i=oa(t.default,l!==void 0?t.share:t.exit);i!=="none"&&(es(e,n,i,null,!1)?l!==void 0?(i=e.stateNode,l.paired=i,i.paired=l,rn.delete(n),os(e,t.onShare)):os(e,t.onExit):Qn(e.child,!1)),rn!==null&&bu(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)ju(e),e=e.sibling;else rn!==null&&bu(e)}function ex(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ra(t,e.stateNode);t=oa(t.default,t.update),e.flags&=-5,t!=="none"&&es(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&ex(e);e=e.sibling}}function Nu(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,Qn(e.child,!1))}Nu(e)}e=e.sibling}}function Kr(e){if(e.tag===30)e.stateNode.paired=null,Qn(e.child,!1),Nu(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Kr(e),e=e.sibling;else Nu(e)}function tx(e){for(e=e.child;e!==null;)e.tag===30?Qn(e.child,!1):(e.subtreeFlags&33554432)!==0&&tx(e),e=e.sibling}function wu(e,t,n,l,i,r,d){for(var v=!1;t!==null;){if(t.tag===5){var w=t.stateNode;if(r!==null&&Zt<r.length){var O=r[Zt],G=td(w);(O.view||G.view)&&(v=!0);var J;if(J=(e.flags&4)===0)if(G.clip)J=!0;else{J=O.rect;var R=G.rect;J=J.y!==R.y||J.x!==R.x||J.height!==R.height||J.width!==R.width}J&&(e.flags|=4),G.abs?G=!O.abs:(O=O.rect,G=G.rect,G=O.height!==G.height||O.width!==G.width),G&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Ix(w,Zt===0?n:n+"_"+Zt,i),v&&(e.flags&4)!==0||(Zn===null&&(Zn=[]),Zn.push(w,Zt===0?l:l+"_"+Zt,t.memoizedProps)),Zt++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&d?e.flags|=t.flags&32:wu(e,t.child,n,l,i,r,d)&&(v=!0));t=t.sibling}return v}function nx(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=e.stateNode,i=ra(n,l),r=oa(n.default,n.update),d;d=e.memoizedState,e.memoizedState=null,l=e;var v=e.child;Zt=0,i=wu(l,v,i,i,r,d,!1),(e.flags&4)!==0&&i&&os(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&nx(e);e=e.sibling}}var wt=!1,Ve=!1,Kn=!1,Su=!1,ax=typeof WeakSet=="function"?WeakSet:Set,St=null,Jn=!1,fi=!1,Jr=!1,ku=!1;function fb(e,t,n){if(e=e.containerInfo,Pu=ys,e=rh(e),dc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var r=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{l.nodeType,d.nodeType}catch{l=null;break e}var v=0,w=-1,O=-1,G=0,J=0,R=e,q=null;t:for(;;){for(var se;R!==l||r!==0&&R.nodeType!==3||(w=v+r),R!==d||i!==0&&R.nodeType!==3||(O=v+i),R.nodeType===3&&(v+=R.nodeValue.length),(se=R.firstChild)!==null;)q=R,R=se;for(;;){if(R===e)break t;if(q===l&&++G===r&&(w=v),q===d&&++J===i&&(O=v),(se=R.nextSibling)!==null)break;R=q,q=R.parentNode}R=se}l=w===-1||O===-1?null:{start:w,end:O}}else l=null}l=l||{start:0,end:0}}else l=null;for(Fu={focusedElem:e,selectionRange:l},ys=!1,n=(n&335544064)===n,St=t,t=n?9270:1024;St!==null;){if(e=St,n&&(l=e.deletions,l!==null))for(r=0;r<l.length;r++)n&&ju(l[r]);if(e.alternate===null&&(e.flags&2)!==0)n&&Fm(e),Pr(n);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&n&&ju(l),Pr(n);continue}else if(l!==null&&l.memoizedState!==null){n&&Fm(e),Pr(n);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,St=l):(n&&ex(e),Pr(n))}}rn=null}function Pr(e){for(;St!==null;){var t=St,n=e,l=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((i&1024)!==0&&l!==null){n=void 0,i=l.memoizedProps,l=l.memoizedState;var r=t.stateNode;try{var d=vl(t.type,i);n=r.getSnapshotBeforeUpdate(d,l),r.__reactInternalSnapshotBeforeUpdate=n}catch(v){Qe(t,t.return,v)}}break;case 3:if((i&1024)!==0){if(l=t.stateNode.containerInfo,n=l.nodeType,n===9)ld(l);else if(n===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":ld(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&l!==null&&(n=ra(l.memoizedProps,l.stateNode),i=t.memoizedProps,i=oa(i.default,i.update),i!=="none"&&es(l,n,i,l.memoizedState=[],!0));break;default:if((i&1024)!==0)throw Error(u(163))}if(l=t.sibling,l!==null){l.return=t.return,St=l;break}St=t.return}}function lx(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Pn(e,n),l&4&&ui(5,n);break;case 1:if(Pn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){Qe(n,n.return,d)}else{var i=vl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Qe(n,n.return,d)}}l&64&&Zm(n),l&512&&Xn(n,n.return);break;case 3:if(Pn(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Mh(e,t)}catch(d){Qe(n,n.return,d)}}break;case 27:t===null&&l&4&&Pm(n);case 26:case 5:Pn(e,n),t===null&&l&4&&xu(n),l&512&&Xn(n,n.return);break;case 12:Pn(e,n);break;case 31:Pn(e,n),l&4&&ox(e,n);break;case 13:Pn(e,n),l&4&&cx(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sb.bind(null,n),s0(e,n))));break;case 22:if(l=n.memoizedState!==null||wt,!l){var r=t!==null&&t.memoizedState!==null||Ve;t=wt,i=Ve,wt=l,(Ve=r)&&!i?(l=2,(n.subtreeFlags&8772)!==0&&(l|=1),Mn(e,n,l)):Pn(e,n),wt=t,Ve=i}break;case 30:Pn(e,n),l&512&&Xn(n,n.return);break;case 7:l&512&&Xn(n,n.return);default:Pn(e,n)}}function Tu(e,t){for(e=e.child;e!==null;)sx(e,t),e=e.sibling}function sx(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var l=n.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var i=e.stateNode,r=e.memoizedProps.style,d=r!=null&&r.hasOwnProperty("display")?r.display:null;i.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(w){Qe(e,e.return,w)}Cu(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ye=!0}catch(w){Qe(e,e.return,w)}break;case 18:try{var v=e.stateNode;t?Fx(v,!0):Fx(e.stateNode,!1)}catch(w){Qe(e,e.return,w)}break;case 22:case 23:e.memoizedState===null&&Tu(e,t);break;default:Tu(e,t)}}function Cu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,l=t;switch(n.tag){case 4:sx(n,l);break e;case 22:n.memoizedState===null&&Cu(n,l);break e;default:Cu(n,l)}}e=e.sibling}}function ix(e){var t=e.alternate;t!==null&&(e.alternate=null,ix(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&tr(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 at=null,Qt=!1;function _n(e,t,n){for(n=n.child;n!==null;)rx(e,t,n),n=n.sibling}function rx(e,t,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Ms,n)}catch{}switch(n.tag){case 26:Ve||At(n,t),_n(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Ve&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ve||At(n,t),di(n);var l=at,i=Qt;Ka(n.type)&&(at=n.stateNode,Qt=!1),_n(e,t,n),dp(n.stateNode,n.type,n.memoizedProps),at=l,Qt=i;break;case 5:Ve||At(n,t),di(n);case 6:if(n.tag===6&&di(n),l=at,i=Qt,at=null,_n(e,t,n),at=l,Qt=i,at!==null)if(Qt)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(n.stateNode),Ye=!0}catch(r){Qe(n,t,r)}else try{at.removeChild(n.stateNode),Ye=!0}catch(r){Qe(n,t,r)}break;case 18:at!==null&&(Qt?(e=at,Px(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),vs(e)):Px(at,n.stateNode));break;case 4:l=at,i=Qt,at=n.stateNode.containerInfo,Qt=!0,_n(e,t,n),at=l,Qt=i;break;case 0:case 11:case 14:case 15:Ga(2,n,t),Ve||Ga(4,n,t),_n(e,t,n);break;case 1:Ve||(At(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Qm(n,t,l)),_n(e,t,n);break;case 21:_n(e,t,n);break;case 22:Ve=(l=Ve)||n.memoizedState!==null,_n(e,t,n),Ve=l;break;case 30:At(n,t),_n(e,t,n);break;case 7:Ve||At(n,t),_n(e,t,n);break;default:_n(e,t,n)}}function ox(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{vs(e)}catch(n){Qe(t,t.return,n)}}}function cx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{vs(e)}catch(n){Qe(t,t.return,n)}}function hb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ax),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ax),t;default:throw Error(u(435,e.tag))}}function Fr(e,t){var n=hb(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=kb.bind(null,e,l);l.then(i,i)}})}function Yt(e,t,n){var l=t.deletions;if(l!==null)for(var i=0;i<l.length;i++){var r=l[i],d=e,v=t,w=v;e:for(;w!==null;){switch(w.tag){case 27:if(Ka(w.type)){at=w.stateNode,Qt=!1;break e}break;case 5:at=w.stateNode,Qt=!1;break e;case 3:case 4:at=w.stateNode.containerInfo,Qt=!0;break e}w=w.return}if(at===null)throw Error(u(160));rx(d,v,r),at=null,Qt=!1,d=r.alternate,d!==null&&(d.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ux(t,e,n),t=t.sibling}var On=null;function ux(e,t,n){var l=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var r=0;r<l.length;r++){var d=l[r];d.ref.impl=d.nextImpl}Yt(t,e,n),$t(e),i&4&&(Ga(3,e,e.return),ui(3,e),Ga(5,e,e.return));break;case 1:Yt(t,e,n),$t(e),i&512&&(Ve||l===null||At(l,l.return)),i&64&&wt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(r=On,Yt(t,e,n),$t(e),i&512&&(Ve||l===null||At(l,l.return)),i&4)if(i=l!==null?l.memoizedState:null,n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null)if(wt)e.stateNode=Qx(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,i=r.ownerDocument||r;t:switch(t){case"title":l=i.getElementsByTagName("title")[0],(!l||l[Hs]||l[Ct]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=i.createElement(t),i.head.insertBefore(l,i.querySelector("head > title"))),Dt(l,t,n),l[Ct]=e,jt(l),t=l;break e;case"link":if(r=gp("link","href",i).get(t+(n.href||""))){for(d=0;d<r.length;d++)if(l=r[d],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){r.splice(d,1);break t}}l=i.createElement(t),Dt(l,t,n),i.head.appendChild(l);break;case"meta":if(r=gp("meta","content",i).get(t+(n.content||""))){for(d=0;d<r.length;d++)if(l=r[d],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){r.splice(d,1);break t}}l=i.createElement(t),Dt(l,t,n),i.head.appendChild(l);break;default:throw Error(u(468,t))}l[Ct]=e,jt(l),t=l}e.stateNode=t}else wt||dd(r,e.type,e.stateNode);else e.stateNode=pp(r,n,e.memoizedProps);else i!==n?(i===null?(t=l.stateNode,t===null||Ve||t.parentNode.removeChild(t)):i.count--,n===null?wt||dd(r,e.type,e.stateNode):pp(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&pu(e,e.memoizedProps,l.memoizedProps);break;case 27:Yt(t,e,n),$t(e),i&512&&(Ve||l===null||At(l,l.return)),l!==null&&i&4&&pu(e,e.memoizedProps,l.memoizedProps);break;case 5:if(r=Kn,Kn=!1,Yt(t,e,n),Kn=r,$t(e),i&512&&(Ve||l===null||At(l,l.return)),e.flags&32){t=e.stateNode;try{Ll(t,""),Ye=!0}catch(G){Qe(e,e.return,G)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,pu(e,t,l!==null?l.memoizedProps:t)),i&1024&&(Su=!0);break;case 6:if(Yt(t,e,n),$t(e),i&4){if(e.stateNode===null)throw Error(u(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ye=!0}catch(G){Qe(e,e.return,G)}}break;case 3:if(Ye=!1,ho=null,r=On,On=ji(t.containerInfo),Yt(t,e,n),On=r,$t(e),i&4&&l!==null&&l.memoizedState.isDehydrated)try{vs(t.containerInfo)}catch(G){Qe(e,e.return,G)}Su&&(Su=!1,dx(e)),Ye=!1;break;case 4:i=Kn,Kn=wt,l=Af(),r=On,On=ji(e.stateNode.containerInfo),Yt(t,e,n),$t(e),On=r,Ye&&fi&&(Jr=!0),Ye=l,Kn=i;break;case 12:Yt(t,e,n),$t(e);break;case 31:Yt(t,e,n),$t(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fr(e,t)));break;case 13:Yt(t,e,n),$t(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(eo=en()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fr(e,t)));break;case 22:r=e.memoizedState!==null,d=l!==null&&l.memoizedState!==null;var v=wt,w=Ve,O=Kn;wt=v||r,Kn=O||r,Ve=w||d,Yt(t,e,n),Ve=w,Kn=O,wt=v,$t(e),i&8192&&(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,!r||l===null||d||wt||Ve||(t=d||Ve,n=wt,l=Ve,wt=r||wt,Ve=t,Ya(e,2),wt=n,Ve=l),!r&&Kn||Tu(e,r)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Fr(e,n))));break;case 19:Yt(t,e,n),$t(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fr(e,t)));break;case 30:i&512&&(Ve||l===null||At(l,l.return)),i=Af(),r=fi,d=(n&335544064)===n,v=e.memoizedProps,fi=d&&oa(v.default,v.update)!=="none",Yt(t,e,n),$t(e),d&&l!==null&&Ye&&(e.flags|=4),fi=r,Ye=i;break;case 21:break;case 7:i&512&&(Ve||l===null||At(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:Yt(t,e,n),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Jm(l)){n=l;break}l=l.return}l=null;for(var i=e.return;i!==null;){if(mu(i)){var r=i.stateNode;l===null?l=[r]:l.push(r)}if(hu(i))break;i=i.return}var d=l;if(n==null)throw Error(u(160));switch(n.tag){case 27:var v=n.stateNode,w=gu(e);Xr(e,w,v,d);break;case 5:var O=n.stateNode;n.flags&32&&(Ll(O,""),n.flags&=-33);var G=gu(e);Xr(e,G,O,d);break;case 3:case 4:var J=n.stateNode.containerInfo,R=gu(e);yu(e,R,J,d);break;default:throw Error(u(161))}}catch(q){Qe(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dx(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,ys=!0,t.reset(),ys=!1),e=e.sibling}}function ts(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)fx(t,e),t=t.sibling;else nx(t)}function fx(e,t){var n=e.alternate;if(n===null)vu(e,!1);else switch(e.tag){case 3:if(ku=Jn=!1,Im(),ts(t,e),!Jn&&!Jr){if(e=Zn,e!==null)for(var l=0;l<e.length;l+=3){n=e[l];var i=e[l+1];Wx(n,e[l+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+i+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),ku=!0}Zn=null;break;case 5:ts(t,e);break;case 4:l=Jn,Jn=!1,ts(t,e),Jn&&(Jr=!0),Jn=l;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?vu(e,!1):ts(t,e));break;case 30:l=Jn,i=Im(),Jn=!1,ts(t,e),Jn&&(e.flags|=4);var r=e.memoizedProps,d=e.stateNode;t=ra(r,d),d=ra(n.memoizedProps,d);var v=oa(r.default,r.update);v==="none"?t=!1:(r=n.memoizedState,n.memoizedState=null,n=e.child,Zt=0,t=wu(e,n,t,d,v,r,!0),Zt!==(r===null?0:r.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(os(e,e.memoizedProps.onUpdate),Zn=i):i!==null&&(i.push.apply(i,Zn),Zn=i),Jn=(e.flags&32)!==0?!0:l;break;default:ts(t,e)}}function Pn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lx(e,t.alternate,t),t=t.sibling}function Ya(e,t){for(e=e.child;e!==null;){var n=e,l=t;switch(n.tag){case 0:case 11:case 14:case 15:Ga(4,n,n.return),Ya(n,l);break;case 1:At(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&Qm(n,n.return,i),Ya(n,l);break;case 27:(l&2)!==0&&dp(n.stateNode,n.type,n.memoizedProps);case 5:At(n,n.return),n.tag!==5&&n.tag!==27||di(n),Ya(n,l);break;case 6:di(n);break;case 26:At(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Ve||i.parentNode.removeChild(i),Ya(n,l);break;case 22:n.memoizedState===null&&Ya(n,l);break;case 30:At(n,n.return),Ya(n,l);break;case 7:At(n,n.return);default:Ya(n,l)}e=e.sibling}}function Mn(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var l=t.alternate,i=e,r=t,d=r.flags,v=(n&1)!==0;switch(r.tag){case 0:case 11:case 15:Mn(i,r,n),ui(4,r);break;case 1:if(Mn(i,r,n),l=r,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(G){Qe(l,l.return,G)}if(l=r,i=l.updateQueue,i!==null){var w=l.stateNode;try{var O=i.shared.hiddenCallbacks;if(O!==null)for(i.shared.hiddenCallbacks=null,i=0;i<O.length;i++)Oh(O[i],w)}catch(G){Qe(l,l.return,G)}}v&&d&64&&Zm(r),Xn(r,r.return);break;case 27:(n&2)!==0&&Pm(r);case 5:r.tag!==5&&r.tag!==27||Km(r),Mn(i,r,n),v&&l===null&&d&4&&xu(r),Xn(r,r.return);break;case 6:Km(r);break;case 26:w=r.stateNode,r.memoizedState!==null||w===null||wt||dd(ji(w.ownerDocument),r.type,w),Mn(i,r,n),v&&l===null&&d&4&&xu(r),Xn(r,r.return);break;case 12:Mn(i,r,n);break;case 31:Mn(i,r,n),v&&d&4&&ox(i,r);break;case 13:Mn(i,r,n),v&&d&4&&cx(i,r);break;case 22:r.memoizedState===null&&Mn(i,r,n),Xn(r,r.return);break;case 30:Mn(i,r,n),Xn(r,r.return);break;case 7:Xn(r,r.return);default:Mn(i,r,n)}t=t.sibling}}function Eu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Fs(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fs(e))}function bn(e,t,n,l){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)hx(e,t,n,l),t=t.sibling;else i&&tx(t)}function hx(e,t,n,l){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Kr(t);var r=t.flags;switch(t.tag){case 0:case 11:case 15:bn(e,t,n,l),r&2048&&ui(9,t);break;case 1:bn(e,t,n,l);break;case 3:bn(e,t,n,l),i&&ku&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),r&2048&&(r=null,t.alternate!==null&&(r=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==r&&(t.refCount++,r!=null&&Fs(r)));break;case 12:if(r&2048){bn(e,t,n,l),r=t.stateNode;try{var d=t.memoizedProps,v=d.id,w=d.onPostCommit;typeof w=="function"&&w(v,t.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(O){Qe(t,t.return,O)}}else bn(e,t,n,l);break;case 31:bn(e,t,n,l);break;case 13:bn(e,t,n,l);break;case 23:break;case 22:d=t.stateNode,v=t.alternate,t.memoizedState!==null?(i&&v!==null&&v.memoizedState===null&&Kr(v),d._visibility&2?bn(e,t,n,l):hi(e,t)):(i&&v!==null&&v.memoizedState!==null&&Kr(t),d._visibility&2?bn(e,t,n,l):(d._visibility|=2,ns(e,t,n,l,(t.subtreeFlags&10256)!==0||!1))),r&2048&&Eu(v,t);break;case 24:bn(e,t,n,l),r&2048&&zu(t.alternate,t);break;case 30:i&&(r=t.alternate,r!==null&&(Qn(r.child,!0),Qn(t.child,!0))),bn(e,t,n,l);break;default:bn(e,t,n,l)}}function ns(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,d=t,v=n,w=l,O=d.flags;switch(d.tag){case 0:case 11:case 15:ns(r,d,v,w,i),ui(8,d);break;case 23:break;case 22:var G=d.stateNode;d.memoizedState!==null?G._visibility&2?ns(r,d,v,w,i):hi(r,d):(G._visibility|=2,ns(r,d,v,w,i)),i&&O&2048&&Eu(d.alternate,d);break;case 24:ns(r,d,v,w,i),i&&O&2048&&zu(d.alternate,d);break;default:ns(r,d,v,w,i)}t=t.sibling}}function hi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:hi(n,l),i&2048&&Eu(l.alternate,l);break;case 24:hi(n,l),i&2048&&zu(l.alternate,l);break;default:hi(n,l)}t=t.sibling}}var bl=8192;function jl(e,t,n){if(e.subtreeFlags&bl)for(e=e.child;e!==null;)mx(e,t,n),e=e.sibling}function mx(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&bl&&(e.memoizedState!==null?v0(n,On,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&jp(n,e)));break;case 5:jl(e,t,n),e.flags&bl&&(e=e.stateNode,(t&335544128)===t&&jp(n,e));break;case 3:case 4:var l=On;On=ji(e.stateNode.containerInfo),jl(e,t,n),On=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=bl,bl=16777216,jl(e,t,n),bl=l):jl(e,t,n));break;case 30:if((e.flags&bl)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var i=e.stateNode;i.paired=null,rn===null&&(rn=new Map),rn.set(l,i)}jl(e,t,n);break;default:jl(e,t,n)}}function xx(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 mi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];St=l,gx(l,e)}xx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)px(e),e=e.sibling}function px(e){switch(e.tag){case 0:case 11:case 15:mi(e),e.flags&2048&&Ga(9,e,e.return);break;case 3:mi(e);break;case 12:mi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ir(e)):mi(e);break;default:mi(e)}}function Ir(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];St=l,gx(l,e)}xx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ga(8,t,t.return),Ir(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ir(t));break;default:Ir(t)}e=e.sibling}}function gx(e,t){for(;St!==null;){var n=St;switch(n.tag){case 0:case 11:case 15:Ga(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Fs(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,St=l;else e:for(n=e;St!==null;){l=St;var i=l.sibling,r=l.return;if(ix(l),l===n){St=null;break e}if(i!==null){i.return=r,St=i;break e}St=r}}}var mb={getCacheForType:function(e){var t=Et(ht),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Et(ht).controller.signal}},xb=typeof WeakMap=="function"?WeakMap:Map,$e=0,We=null,Oe=null,Le=0,Ze=0,on=null,$a=!1,as=!1,Ru=!1,ga=0,ct=0,Va=0,Nl=0,Wr=0,cn=0,ls=0,xi=null,Kt=null,Au=!1,eo=0,yx=0,to=1/0,no=null,Xa=null,lt=0,Ln=null,wl=null,Fn=0,Du=0,_u=null,vx=null,ss=null,is=null,rs=null,pi=0,ao=null;function un(){return($e&2)!==0&&Le!==0?Le&-Le:ce.T!==null?$u():Nf()}function bx(){if(cn===0)if((Le&536870912)===0||_e){var e=Fi;Fi<<=1,(Fi&3932160)===0&&(Fi=262144),cn=e}else cn=536870912;return e=zt.current,e!==null&&(e.flags|=32),cn}function os(e,t){if(t!=null){var n=e.stateNode,l=n.ref;l===null&&(l=n.ref=ep(ra(e.memoizedProps,n))),is===null&&(is=[]),is.push(t.bind(null,l))}}function Jt(e,t,n){(e===We&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(cs(e,0),Za(e,Le,cn,!1)),Us(e,n),(($e&2)===0||e!==We)&&(e===We&&(($e&2)===0&&(Nl|=n),ct===4&&Za(e,Le,cn,!1)),In(e))}function jx(e,t,n){if(($e&6)!==0)throw Error(u(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ls(e,t),i=l?yb(e,t):Mu(e,t,!0),r=l;do{if(i===0){as&&!l&&Za(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!pb(n)){i=Mu(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var v=e;i=xi;var w=v.current.memoizedState.isDehydrated;if(w&&(cs(v,d).flags|=256),d=Mu(v,d,!1),d!==2&&d!==6){if(Ru&&!w){v.errorRecoveryDisabledLanes|=r,Nl|=r,i=4;break e}r=Kt,Kt=i,r!==null&&(Kt===null?Kt=r:Kt.push.apply(Kt,r))}i=d}if(r=!1,i!==2)continue}}if(i===1){cs(e,0),Za(e,t,0,!0);break}e:{switch(l=e,r=i,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Za(l,t,cn,!$a);break e;case 2:Kt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(i=eo+300-en(),10<i)){if(Za(l,t,cn,!$a),Wi(l,0,!0)!==0)break e;Fn=t,l.timeoutHandle=ed(Nx.bind(null,l,n,Kt,no,Au,t,cn,Nl,ls,$a,r,"Throttled",-0,0),i);break e}Nx(l,n,Kt,no,Au,t,cn,Nl,ls,$a,r,null,-0,0)}}break}while(!0);In(e)}function Nx(e,t,n,l,i,r,d,v,w,O,G,J,R,q){e.timeoutHandle=-1;var se=t.subtreeFlags,me=(r&335544064)===r;if(J=null,(me||se&8192||(se&16785408)===16785408)&&(J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yn},rn=null,mx(t,r,J),me&&(se=J,me=e.containerInfo,me=(me.nodeType===9?me:me.ownerDocument).__reactViewTransition,me!=null&&(se.count++,se.waitingForViewTransition=!0,se=Si.bind(se),me.finished.then(se,se))),se=(r&62914560)===r?eo-en():(r&4194048)===r?yx-en():0,se=b0(J,se),se!==null)){Fn=r,e.cancelPendingCommit=se(Rx.bind(null,e,t,r,n,l,i,d,v,w,O,G,J,null,R,q)),Za(e,r,d,!O);return}Rx(e,t,r,n,l,i,d,v,w,O,G,J)}function pb(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],r=i.getSnapshot;i=i.value;try{if(!ln(r(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Za(e,t,n,l){t=gf(e,t),t&=~Wr,t&=~Nl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var r=31-nn(i),d=1<<r;l[r]=-1,i&=~d}n!==0&&vf(e,n,t)}function lo(){return($e&6)===0?(gi(0),!1):!0}function Ou(){if(Oe!==null){if(Ze===0)var e=Oe.return;else e=Oe,da=ul=null,Yc(e),Jl=null,ei=0,e=Oe;for(;e!==null;)Xm(e.alternate,e),e=e.return;Oe=null}}function cs(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,qb(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Fn=0,Ou(),We=e,Oe=n=ca(e.current,null),Le=t,Ze=0,on=null,$a=!1,as=Ls(e,t),Ru=!1,ls=cn=Wr=Nl=Va=ct=0,Kt=xi=null,Au=!1,ga=gf(e,t),fr(),n}function wx(e,t){Re=null,ce.H=Ur,t===Kl||t===wr?(t=Rh(),Ze=3):t===zc?(t=Rh(),Ze=4):Ze=t===au?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,on=t,Oe===null&&(ct=1,Hr(e,pn(t,e.current)))}function Sx(){var e=zt.current;return e===null?!0:(Le&4194048)===Le?Lt===null:(Le&62914560)===Le||(Le&536870912)!==0?e===Lt:!1}function kx(){var e=ce.H;return ce.H=Ur,e===null?Ur:e}function Tx(){var e=ce.A;return ce.A=mb,e}function so(){ct=4,$a||(Le&4194048)!==Le&&zt.current!==null||(as=!0),(Va&134217727)===0&&(Nl&134217727)===0||We===null||Za(We,Le,cn,!1)}function Mu(e,t,n){var l=$e;$e|=2;var i=kx(),r=Tx();(We!==e||Le!==t)&&(no=null,cs(e,t)),t=!1;var d=ct;e:do try{if(Ze!==0&&Oe!==null){var v=Oe,w=on;switch(Ze){case 8:Ou(),d=6;break e;case 3:case 2:case 9:case 6:zt.current===null&&(t=!0);var O=Ze;if(Ze=0,on=null,us(e,v,w,O),n&&as){d=0;break e}break;default:O=Ze,Ze=0,on=null,us(e,v,w,O)}}gb(),d=ct;break}catch(G){wx(e,G)}while(!0);return t&&e.shellSuspendCounter++,da=ul=null,$e=l,ce.H=i,ce.A=r,Oe===null&&(We=null,Le=0,fr()),d}function gb(){for(;Oe!==null;)Cx(Oe)}function yb(e,t){var n=$e;$e|=2;var l=kx(),i=Tx();We!==e||Le!==t?(no=null,to=en()+500,cs(e,t)):as=Ls(e,t);e:do try{if(Ze!==0&&Oe!==null){t=Oe;var r=on;t:switch(Ze){case 1:Ze=0,on=null,us(e,t,r,1);break;case 2:case 9:if(Eh(r)){Ze=0,on=null,Ex(t);break}t=function(){Ze!==2&&Ze!==9||We!==e||(Ze=7),In(e)},r.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:Eh(r)?(Ze=0,on=null,Ex(t)):(Ze=0,on=null,us(e,t,r,7));break;case 5:var d=null;switch(Oe.tag){case 26:d=Oe.memoizedState;case 5:case 27:var v=Oe;if(d?vp(d):v.stateNode.complete){Ze=0,on=null;var w=v.sibling;if(w!==null)Oe=w;else{var O=v.return;O!==null?(Oe=O,io(O)):Oe=null}break t}}Ze=0,on=null,us(e,t,r,5);break;case 6:Ze=0,on=null,us(e,t,r,6);break;case 8:Ou(),ct=6;break e;default:throw Error(u(462))}}vb();break}catch(G){wx(e,G)}while(!0);return da=ul=null,ce.H=l,ce.A=i,$e=n,Oe!==null?0:(We=null,Le=0,fr(),ct)}function vb(){for(;Oe!==null&&!rt();)Cx(Oe)}function Cx(e){var t=$m(e.alternate,e,ga);e.memoizedProps=e.pendingProps,t===null?io(e):Oe=t}function Ex(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lm(n,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=Lm(n,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:Yc(t);var l=t;l===Nt&&(_e?(yr(l),l.tag===5&&l.stateNode!=null&&(et=l.stateNode)):(yr(l),_e=!0));default:Xm(n,t),t=Oe=gh(t,ga),t=$m(n,t,ga)}e.memoizedProps=e.pendingProps,t===null?io(e):Oe=t}function us(e,t,n,l){da=ul=null,Yc(t),Jl=null,ei=0;var i=t.return;try{if(ib(e,i,t,n,Le)){ct=1,Hr(e,pn(n,e.current)),Oe=null;return}}catch(r){if(i!==null)throw Oe=i,r;ct=1,Hr(e,pn(n,e.current)),Oe=null;return}t.flags&32768?(_e||l===1?e=!0:as||(Le&536870912)!==0?e=!1:($a=e=!0,(l===2||l===9||l===3||l===6)&&(l=zt.current,l!==null&&l.tag===13&&(l.flags|=16384))),zx(t,e)):io(t)}function io(e){var t=e;do{if((t.flags&32768)!==0){zx(t,$a);return}e=t.return;var n=ub(t.alternate,t,ga);if(n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);ct===0&&(ct=5)}function zx(e,t){do{var n=db(e.alternate,e);if(n!==null){n.flags&=32767,Oe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=n}while(e!==null);ct=6,Oe=null}function Rx(e,t,n,l,i,r,d,v,w,O,G,J){e.cancelPendingCommit=null;do ro();while(lt!==0);if(($e&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));e===We&&(Oe=We=null,Le=0),wl=t,Ln=e,Fn=n,_u=i,vx=l,bb(e,t,n,d,v,w,J)}}function bb(e,t,n,l,i,r,d){var v=t.lanes|t.childLanes;if(Du=v,v|=pc,Zy(e,n,v,l,i,r),is=null,(n&335544064)===n?(rs=Kv(e),l=10262):(rs=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,Tb(Ji,function(){return Bu(),null})):(e.callbackNode=null,e.callbackPriority=0),Zr=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=ce.T,ce.T=null,i=ye.p,ye.p=2,r=$e,$e|=4;try{fb(e,t,n)}finally{$e=r,ye.p=i,ce.T=l}}lt=1,Zr?ss=Zb(d,e.containerInfo,rs,Lu,Uu,Nb,Hu,Bu,jb):(Lu(),Uu(),Hu())}function jb(e){if(lt!==0){var t=Ln.onRecoverableError;t(e,{componentStack:null})}}function Nb(){lt===3&&(lt=0,fx(wl,Ln),lt=4)}function Lu(){if(lt===1){lt=0;var e=Ln,t=wl,n=Fn,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=ce.T,ce.T=null;var i=ye.p;ye.p=2;var r=$e;$e|=4;try{fi=Jr=!1,ux(t,e,n),n=Fu;var d=rh(e.containerInfo),v=n.focusedElem,w=n.selectionRange;if(d!==v&&v&&v.ownerDocument&&ih(v.ownerDocument.documentElement,v)){if(w!==null&&dc(v)){var O=w.start,G=w.end;if(G===void 0&&(G=O),"selectionStart"in v)v.selectionStart=O,v.selectionEnd=Math.min(G,v.value.length);else{var J=v.ownerDocument||document,R=J&&J.defaultView||window;if(R.getSelection){var q=R.getSelection(),se=v.textContent.length,me=Math.min(w.start,se),Ae=w.end===void 0?me:Math.min(w.end,se);!q.extend&&me>Ae&&(d=Ae,Ae=me,me=d);var D=sh(v,me),C=sh(v,Ae);if(D&&C&&(q.rangeCount!==1||q.anchorNode!==D.node||q.anchorOffset!==D.offset||q.focusNode!==C.node||q.focusOffset!==C.offset)){var B=J.createRange();B.setStart(D.node,D.offset),q.removeAllRanges(),me>Ae?(q.addRange(B),q.extend(C.node,C.offset)):(B.setEnd(C.node,C.offset),q.addRange(B))}}}}for(J=[],q=v;q=q.parentNode;)q.nodeType===1&&J.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<J.length;v++){var K=J[v];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}ys=!!Pu,Fu=Pu=null}finally{$e=r,ye.p=i,ce.T=l}}e.current=t,lt=2}}function Uu(){if(lt===2){lt=0;var e=Ln,t=wl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=ce.T,ce.T=null;var l=ye.p;ye.p=2;var i=$e;$e|=4;try{lx(e,t.alternate,t)}finally{$e=i,ye.p=l,ce.T=n}}lt=3}}function Hu(){if(lt===4||lt===3){lt=0;var e=ss;ss=null,Wt();var t=Ln,n=wl,l=Fn,i=vx,r=(l&335544064)===l?10262:10256;if((n.subtreeFlags&r)!==0||(n.flags&r)!==0?lt=5:(lt=0,wl=Ln=null,Ax(t,t.pendingLanes)),r=t.pendingLanes,r===0&&(Xa=null),Qo(l),n=n.stateNode,tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(Ms,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=ce.T,r=ye.p,ye.p=2,ce.T=null;try{for(var d=t.onRecoverableError,v=0;v<i.length;v++){var w=i[v];d(w.value,{componentStack:w.stack})}}finally{ce.T=n,ye.p=r}}if(i=is,d=rs,rs=null,i!==null&&(is=null,d===null&&(d=[]),e!==null))for(w=0;w<i.length;w++)n=(0,i[w])(d),n!==void 0&&e.finished.finally(n);(Fn&3)!==0&&ro(),In(t),r=t.pendingLanes,(l&261930)!==0&&(r&42)!==0?t===ao?pi++:(pi=0,ao=t):(pi=0,ao=null),gi(0)}}function Ax(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fs(t)))}function ro(){return ss!==null&&(ss.skipTransition(),ss=null),Lu(),Uu(),Hu(),Bu()}function Bu(){if(lt!==5)return!1;var e=Ln,t=Du;Du=0;var n=Qo(Fn),l=ce.T,i=ye.p;try{ye.p=32>n?32:n,ce.T=null,n=_u,_u=null;var r=Ln,d=Fn;if(lt=0,wl=Ln=null,Fn=0,($e&6)!==0)throw Error(u(331));var v=$e;if($e|=4,px(r.current),hx(r,r.current,d,n),$e=v,gi(0,!1),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(Ms,r)}catch{}return!0}finally{ye.p=i,ce.T=l,Ax(e,t)}}function Dx(e,t,n){t=pn(n,t),t=nu(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Us(e,2),In(e))}function Qe(e,t,n){if(e.tag===3)Dx(e,e,n);else for(;t!==null;){if(t.tag===3){Dx(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Xa===null||!Xa.has(l))){e=pn(n,e),n=Em(2),l=Ua(t,n,2),l!==null&&(zm(n,l,t,e),Us(l,2),In(l));break}}t=t.return}}function qu(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new xb;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(Ru=!0,i.add(n),e=wb.bind(null,e,t,n),t.then(e,e))}function wb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,We===e&&(Le&n)===n&&((ct===4||ct===3&&(Le&62914560)===Le&&300>en()-eo)&&($e&2)===0?cs(e,0):Wr|=n,ls===Le&&(ls=0)),In(e)}function _x(e,t){t===0&&(t=yf()),e=rl(e,t),e!==null&&(Us(e,t),In(e))}function Sb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_x(e,n)}function kb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(u(314))}l!==null&&l.delete(t),_x(e,n)}function Tb(e,t){return Mt(e,t)}var ds=null,fs=null,Gu=!1,oo=!1,Yu=!1,Qa=0;function In(e){e!==fs&&e.next===null&&(fs===null?ds=fs=e:fs=fs.next=e),oo=!0,Gu||(Gu=!0,Eb())}function gi(e,t){if(!Yu&&oo){Yu=!0;do for(var n=!1,l=ds;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var r=0;else{var d=l.suspendedLanes,v=l.pingedLanes;r=(1<<31-nn(42|e)+1)-1,r&=i&~(d&~v),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Ux(l,r))}else r=Le,r=Wi(l,l===We?r:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(r&3)===0||Ls(l,r)||(n=!0,Ux(l,r));l=l.next}while(n);Yu=!1}}function Cb(){Ox()}function Ox(){oo=Gu=!1;var e=0;Qa!==0&&Bb()&&(e=Qa);for(var t=en(),n=null,l=ds;l!==null;){var i=l.next,r=Mx(l,t);r===0?(l.next=null,n===null?ds=i:n.next=i,i===null&&(fs=n)):(n=l,(e!==0||(r&3)!==0)&&(oo=!0)),l=i}lt!==0&&lt!==5||gi(e),Qa!==0&&(Qa=0)}function Mx(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var d=31-nn(r),v=1<<d,w=i[d];w===-1?((v&n)===0||(v&l)!==0)&&(i[d]=Xy(v,t)):w<=t&&(e.expiredLanes|=v),r&=~v}if(t=We,n=Le,n=Wi(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ut(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ls(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&ut(l),Qo(n)){case 2:case 8:n=xf;break;case 32:n=Ji;break;case 268435456:n=pf;break;default:n=Ji}return l=Lx.bind(null,e),n=Mt(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&ut(l),e.callbackPriority=2,e.callbackNode=null,2}function Lx(e,t){if(lt!==0&&lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ro()&&e.callbackNode!==n)return null;var l=Le;return l=Wi(e,e===We?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(jx(e,l,t),Mx(e,en()),e.callbackNode!=null&&e.callbackNode===n?Lx.bind(null,e):null)}function Ux(e,t){if(ro())return null;jx(e,t,!0)}function Eb(){Gb(function(){($e&6)!==0?Mt(mf,Cb):Ox()})}function $u(){if(Qa===0){var e=hl;e===0&&(e=Pi,Pi<<=1,(Pi&261888)===0&&(Pi=256)),Qa=e}return Qa}function Hx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:lr(e)}function zb(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var r=Hx((i[Vt]||null).action),d=l.submitter;d&&(t=(t=d[Vt]||null)?Hx(t.formAction):d.getAttribute("formAction"),t!==null&&(r=t,d=null));var v=new or("action","action",null,l,i);e.push({event:v,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Qa!==0){var w=new FormData(i,d);Fc(n,{pending:!0,data:w,method:i.method,action:r},null,w)}}else typeof r=="function"&&(v.preventDefault(),w=new FormData(i,d),Fc(n,{pending:!0,data:w,method:i.method,action:r},r,w))},currentTarget:i}]})}}for(var Vu=0;Vu<xc.length;Vu++){var Xu=xc[Vu],Rb=Xu.toLowerCase(),Ab=Xu[0].toUpperCase()+Xu.slice(1);Dn(Rb,"on"+Ab)}Dn(uh,"onAnimationEnd"),Dn(dh,"onAnimationIteration"),Dn(fh,"onAnimationStart"),Dn("dblclick","onDoubleClick"),Dn("focusin","onFocus"),Dn("focusout","onBlur"),Dn(qv,"onTransitionRun"),Dn(Gv,"onTransitionStart"),Dn(Yv,"onTransitionCancel"),Dn(hh,"onTransitionEnd"),Ol("onMouseEnter",["mouseout","mouseover"]),Ol("onMouseLeave",["mouseout","mouseover"]),Ol("onPointerEnter",["pointerout","pointerover"]),Ol("onPointerLeave",["pointerout","pointerover"]),ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ll("onBeforeInput",["compositionend","keypress","textInput","paste"]),ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yi="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(" "),Db=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yi));function Bx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var r=void 0;if(t)for(var d=l.length-1;0<=d;d--){var v=l[d],w=v.instance,O=v.currentTarget;if(v=v.listener,w!==r&&i.isPropagationStopped())break e;r=v,i.currentTarget=O;try{r(i)}catch(G){dr(G)}i.currentTarget=null,r=w}else for(d=0;d<l.length;d++){if(v=l[d],w=v.instance,O=v.currentTarget,v=v.listener,w!==r&&i.isPropagationStopped())break e;r=v,i.currentTarget=O;try{r(i)}catch(G){dr(G)}i.currentTarget=null,r=w}}}}function Me(e,t){var n=t[Sf];n===void 0&&(n=t[Sf]=new Set);var l=e+"__bubble";n.has(l)||(qx(t,e,2,!1),n.add(l))}function Zu(e,t,n){var l=0;t&&(l|=4),qx(n,e,l,t)}var co="_reactListening"+Math.random().toString(36).slice(2);function Qu(e){if(!e[co]){e[co]=!0,Cf.forEach(function(n){n!=="selectionchange"&&(Db.has(n)||Zu(n,!1,e),Zu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[co]||(t[co]=!0,Zu("selectionchange",!1,t))}}function qx(e,t,n,l){switch(zp(t)){case 2:var i=S0;break;case 8:i=k0;break;default:i=hd}n=i.bind(null,t,n,e),i=void 0,!tc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ku(e,t,n,l,i){var r=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var v=l.stateNode.containerInfo;if(v===i)break;if(d===4)for(d=l.return;d!==null;){var w=d.tag;if((w===3||w===4)&&d.stateNode.containerInfo===i)return;d=d.return}for(;v!==null;){if(d=al(v),d===null)return;if(w=d.tag,w===5||w===6||w===26||w===27){l=r=d;continue e}v=v.parentNode}}l=l.return}qf(function(){var O=r,G=Wo(n),J=[];e:{var R=mh.get(e);if(R!==void 0){var q=or,se=e;switch(e){case"keypress":if(ir(n)===0)break e;case"keydown":case"keyup":q=pv;break;case"focusin":se="focus",q=sc;break;case"focusout":se="blur",q=sc;break;case"beforeblur":case"afterblur":q=sc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=$f;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=lv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=jv;break;case uh:case dh:case fh:q=rv;break;case hh:q=wv;break;case"scroll":case"scrollend":q=nv;break;case"wheel":q=kv;break;case"copy":case"cut":case"paste":q=cv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=Xf;break;case"submit":q=vv;break;case"toggle":case"beforetoggle":q=Cv}var me=(t&4)!==0,Ae=!me&&(e==="scroll"||e==="scrollend"),D=me?R!==null?R+"Capture":null:R;me=[];for(var C=O,B;C!==null;){var K=C;if(B=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||B===null||D===null||(K=qs(C,D),K!=null&&me.push(vi(C,K,B))),Ae)break;C=C.return}0<me.length&&(R=new q(R,se,null,n,G),J.push({event:R,listeners:me}))}}if((t&7)===0){e:{if(q=e==="mouseover"||e==="pointerover",R=e==="mouseout"||e==="pointerout",q&&n!==Io&&(se=n.relatedTarget||n.fromElement)&&(al(se)||se[Al]))break e;(R||q)&&(se=G.window===G?G:(q=G.ownerDocument)?q.defaultView||q.parentWindow:window,R?(q=n.relatedTarget||n.toElement,R=O,q=q?al(q):null,q!==null&&(Ae=m(q),me=q.tag,q!==Ae||me!==5&&me!==27&&me!==6)&&(q=null)):(R=null,q=O),R!==q&&(me=$f,K="onMouseLeave",D="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(me=Xf,K="onPointerLeave",D="onPointerEnter",C="pointer"),Ae=R==null?se:Bs(R),B=q==null?se:Bs(q),se=new me(K,C+"leave",R,n,G),se.target=Ae,se.relatedTarget=B,K=null,al(G)===O&&(me=new me(D,C+"enter",q,n,G),me.target=B,me.relatedTarget=Ae,K=me),Ae=K,me=R&&q?ne(R,q,_b):null,R!==null&&Gx(J,se,R,me,!1),q!==null&&Ae!==null&&Gx(J,Ae,q,me,!0)))}e:{if(R=O?Bs(O):window,q=R.nodeName&&R.nodeName.toLowerCase(),q==="select"||q==="input"&&R.type==="file")var fe=Wf;else if(Ff(R))if(eh)fe=Uv;else{fe=Mv;var Ue=Ov}else q=R.nodeName,!q||q.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?O&&Fo(O.elementType)&&(fe=Wf):fe=Lv;if(fe&&(fe=fe(e,O))){If(J,fe,n,G);break e}Ue&&Ue(e,R,O)}switch(Ue=O?Bs(O):window,e){case"focusin":(Ff(Ue)||Ue.contentEditable==="true")&&(ql=Ue,fc=O,Ks=null);break;case"focusout":Ks=fc=ql=null;break;case"mousedown":hc=!0;break;case"contextmenu":case"mouseup":case"dragend":hc=!1,oh(J,n,G);break;case"selectionchange":if(Bv)break;case"keydown":case"keyup":oh(J,n,G)}var pe;if(rc)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else Bl?Jf(e,n)&&(we="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(we="onCompositionStart");we&&(Zf&&n.locale!=="ko"&&(Bl||we!=="onCompositionStart"?we==="onCompositionEnd"&&Bl&&(pe=Gf()):(Ea=G,nc="value"in Ea?Ea.value:Ea.textContent,Bl=!0)),Ue=uo(O,we),0<Ue.length&&(we=new Vf(we,e,null,n,G),J.push({event:we,listeners:Ue}),pe?we.data=pe:(pe=Pf(n),pe!==null&&(we.data=pe)))),(pe=zv?Rv(e,n):Av(e,n))&&(we=uo(O,"onBeforeInput"),0<we.length&&(Ue=new Vf("onBeforeInput","beforeinput",null,n,G),J.push({event:Ue,listeners:we}),Ue.data=pe)),zb(J,e,O,n,G)}Bx(J,t)})}function vi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function uo(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=qs(e,n),i!=null&&l.unshift(vi(e,i,r)),i=qs(e,t),i!=null&&l.push(vi(e,i,r))),e.tag===3)return l;e=e.return}return[]}function _b(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gx(e,t,n,l,i){for(var r=t._reactName,d=[];n!==null&&n!==l;){var v=n,w=v.alternate,O=v.stateNode;if(v=v.tag,w!==null&&w===l)break;v!==5&&v!==26&&v!==27||O===null||(w=O,i?(O=qs(n,r),O!=null&&d.unshift(vi(n,O,w))):i||(O=qs(n,r),O!=null&&d.push(vi(n,O,w)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var Ob=/\r\n?/g,Mb=/\u0000|\uFFFD/g;function Yx(e){return(typeof e=="string"?e:""+e).replace(Ob,`
49
- `).replace(Mb,"")}function $x(e,t){return t=Yx(t),Yx(e)===t}function Ke(e,t,n,l,i,r){switch(n){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Ll(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Ll(e,""+l);else return;break;case"className":ar(e,"class",l);break;case"tabIndex":ar(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ar(e,n,l);break;case"style":Hf(e,l,r);return;case"data":if(t!=="object"){ar(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=lr(l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="formAction"?(t!=="input"&&Ke(e,t,"name",i.name,i,null),Ke(e,t,"formEncType",i.formEncType,i,null),Ke(e,t,"formMethod",i.formMethod,i,null),Ke(e,t,"formTarget",i.formTarget,i,null)):(Ke(e,t,"encType",i.encType,i,null),Ke(e,t,"method",i.method,i,null),Ke(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=lr(l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Yn);return;case"onScroll":l!=null&&Me("scroll",e);return;case"onScrollEnd":l!=null&&Me("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(u(60));r?.__html!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=lr(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Me("beforetoggle",e),Me("toggle",e),nr(e,"popover",l);break;case"xlinkActuate":sa(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":sa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":sa(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":sa(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":sa(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":sa(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":sa(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":sa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":sa(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":nr(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=ev.get(n)||n,nr(e,n,l);else return}Ye=!0}function Ju(e,t,n,l,i,r){switch(n){case"style":Hf(e,l,r);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(u(60));r?.__html!==n&&(e.innerHTML=n)}}break;case"children":if(typeof l=="string")Ll(e,l);else if(typeof l=="number"||typeof l=="bigint")Ll(e,""+l);else return;break;case"onScroll":l!=null&&Me("scroll",e);return;case"onScrollEnd":l!=null&&Me("scrollend",e);return;case"onClick":l!=null&&(e.onclick=Yn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ef.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),r=n.slice(2,i?n.length-7:void 0),t=e[Vt]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(r,t,i),typeof l=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(r,l,i);break e}Ye=!0,n in e?e[n]=l:l===!0?e.setAttribute(n,""):nr(e,n,l)}return}Ye=!0}function Dt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var l=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ke(e,t,r,d,n,null)}}i&&Ke(e,t,"srcSet",n.srcSet,n,null),l&&Ke(e,t,"src",n.src,n,null);return;case"input":Me("invalid",e);var v=r=d=i=null,w=null,O=null;for(l in n)if(n.hasOwnProperty(l)){var G=n[l];if(G!=null)switch(l){case"name":i=G;break;case"type":d=G;break;case"checked":w=G;break;case"defaultChecked":O=G;break;case"value":r=G;break;case"defaultValue":v=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(u(137,t));break;default:Ke(e,t,l,G,n,null)}}Of(e,r,v,w,O,d,i,!1);return;case"select":Me("invalid",e),l=d=r=null;for(i in n)if(n.hasOwnProperty(i)&&(v=n[i],v!=null))switch(i){case"value":r=v;break;case"defaultValue":d=v;break;case"multiple":l=v;default:Ke(e,t,i,v,n,null)}t=r,n=d,e.multiple=!!l,t!=null?Ml(e,!!l,t,!1):n!=null&&Ml(e,!!l,n,!0);return;case"textarea":Me("invalid",e),r=i=l=null;for(d in n)if(n.hasOwnProperty(d)&&(v=n[d],v!=null))switch(d){case"value":l=v;break;case"defaultValue":i=v;break;case"children":r=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(u(91));break;default:Ke(e,t,d,v,n,null)}Lf(e,l,i,r);return;case"option":for(w in n)if(n.hasOwnProperty(w)&&(l=n[w],l!=null))switch(w){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ke(e,t,w,l,n,null)}return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(l=0;l<yi.length;l++)Me(yi[l],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("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(O in n)if(n.hasOwnProperty(O)&&(l=n[O],l!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ke(e,t,O,l,n,null)}return;default:if(Fo(t)){for(G in n)n.hasOwnProperty(G)&&(l=n[G],l!==void 0&&Ju(e,t,G,l,n,void 0));return}}for(v in n)n.hasOwnProperty(v)&&(l=n[v],l!=null&&Ke(e,t,v,l,n,null))}var Lb={};function Ub(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,d=null,v=null,w=null,O=null,G=null;for(q in n){var J=n[q];if(n.hasOwnProperty(q)&&J!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":w=J;default:l.hasOwnProperty(q)||Ke(e,t,q,null,l,J)}}for(var R in l){var q=l[R];if(J=n[R],l.hasOwnProperty(R)&&(q!=null||J!=null))switch(R){case"type":q!==J&&(Ye=!0),r=q;break;case"name":q!==J&&(Ye=!0),i=q;break;case"checked":q!==J&&(Ye=!0),O=q;break;case"defaultChecked":q!==J&&(Ye=!0),G=q;break;case"value":q!==J&&(Ye=!0),d=q;break;case"defaultValue":q!==J&&(Ye=!0),v=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(u(137,t));break;default:q!==J&&Ke(e,t,R,q,l,J)}}Jo(e,d,v,w,O,G,r,i);return;case"select":q=d=v=R=null;for(r in n)if(w=n[r],n.hasOwnProperty(r)&&w!=null)switch(r){case"value":break;case"multiple":q=w;default:l.hasOwnProperty(r)||Ke(e,t,r,null,l,w)}for(i in l)if(r=l[i],w=n[i],l.hasOwnProperty(i)&&(r!=null||w!=null))switch(i){case"value":r!==w&&(Ye=!0),R=r;break;case"defaultValue":r!==w&&(Ye=!0),v=r;break;case"multiple":r!==w&&(Ye=!0),d=r;default:r!==w&&Ke(e,t,i,r,l,w)}t=v,n=d,l=q,R!=null?Ml(e,!!n,R,!1):!!l!=!!n&&(t!=null?Ml(e,!!n,t,!0):Ml(e,!!n,n?[]:"",!1));return;case"textarea":q=R=null;for(v in n)if(i=n[v],n.hasOwnProperty(v)&&i!=null&&!l.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ke(e,t,v,null,l,i)}for(d in l)if(i=l[d],r=n[d],l.hasOwnProperty(d)&&(i!=null||r!=null))switch(d){case"value":i!==r&&(Ye=!0),R=i;break;case"defaultValue":i!==r&&(Ye=!0),q=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(u(91));break;default:i!==r&&Ke(e,t,d,i,l,r)}Mf(e,R,q);return;case"option":for(var se in n)if(R=n[se],n.hasOwnProperty(se)&&R!=null&&!l.hasOwnProperty(se))switch(se){case"selected":e.selected=!1;break;default:Ke(e,t,se,null,l,R)}for(w in l)if(R=l[w],q=n[w],l.hasOwnProperty(w)&&R!==q&&(R!=null||q!=null))switch(w){case"selected":R!==q&&(Ye=!0),e.selected=R&&typeof R!="function"&&typeof R!="symbol";break;default:Ke(e,t,w,R,l,q)}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 me in n)R=n[me],n.hasOwnProperty(me)&&R!=null&&!l.hasOwnProperty(me)&&Ke(e,t,me,null,l,R);for(O in l)if(R=l[O],q=n[O],l.hasOwnProperty(O)&&R!==q&&(R!=null||q!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:Ke(e,t,O,R,l,q)}return;default:if(Fo(t)){for(var Ae in n)R=n[Ae],n.hasOwnProperty(Ae)&&R!==void 0&&!l.hasOwnProperty(Ae)&&Ju(e,t,Ae,void 0,l,R);for(G in l)R=l[G],q=n[G],!l.hasOwnProperty(G)||R===q||R===void 0&&q===void 0||Ju(e,t,G,R,l,q);return}}for(var D in n)R=n[D],n.hasOwnProperty(D)&&R!=null&&!l.hasOwnProperty(D)&&Ke(e,t,D,null,l,R);for(J in l)R=l[J],q=n[J],!l.hasOwnProperty(J)||R===q||R==null&&q==null||Ke(e,t,J,R,l,q)}function Vx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Hb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],r=i.transferSize,d=i.initiatorType,v=i.duration;if(r&&v&&Vx(d)){for(d=0,v=i.responseEnd,l+=1;l<n.length;l++){var w=n[l],O=w.startTime;if(O>v)break;var G=w.transferSize,J=w.initiatorType;G&&Vx(J)&&(w=w.responseEnd,d+=G*(w<v?1:(v-O)/(w-O)))}if(--l,t+=8*(r+d)/(i.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 Pu=null,Fu=null;function bi(e){return e.nodeType===9?e:e.ownerDocument}function Xx(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 Zx(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 Qx(e,t,n,l){return n=bi(n).createElement(e),n[Ct]=l,n[Vt]=t,Dt(n,e,t),jt(n),n}function Iu(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 Wu=null;function Bb(){var e=window.event;return e&&e.type==="popstate"?e===Wu?!1:(Wu=e,!0):(Wu=null,!1)}var ed=typeof setTimeout=="function"?setTimeout:void 0,qb=typeof clearTimeout=="function"?clearTimeout:void 0,Kx=typeof Promise=="function"?Promise:void 0,Jx=typeof requestAnimationFrame=="function"?requestAnimationFrame:ed,Gb=typeof queueMicrotask=="function"?queueMicrotask:typeof Kx<"u"?function(e){return Kx.resolve(null).then(e).catch(Yb)}:ed;function Yb(e){setTimeout(function(){throw e})}function Ka(e){return e==="head"}function Px(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),vs(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")od(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,od(n);for(var r=n.firstChild;r;){var d=r.nextSibling,v=r.nodeName;r[Hs]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=d}}else n==="body"&&od(e.ownerDocument.body);n=i}while(n);vs(t)}function Fx(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Ix(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var i=l=0;i<t.length;i++){var r=t[i];0<r.width&&0<r.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Wx(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function $b(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function td(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return $b(t,n,e)}function Vb(e){return e.documentElement.clientHeight}function Xb(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Zb(e,t,n,l,i,r,d,v,w){var O=t.nodeType===9?t:t.ownerDocument;try{var G=O.startViewTransition({update:function(){var R=O.defaultView,q=R.navigation&&R.navigation.transition,se=O.fonts.status;l();var me=[];if(se==="loaded"&&(Vb(O),O.fonts.status==="loading"&&me.push(O.fonts.ready)),se=me.length,e!==null)for(var Ae=e.suspenseyImages,D=0,C=0;C<Ae.length;C++){var B=Ae[C];if(!B.complete){var K=B.getBoundingClientRect();if(0<K.bottom&&0<K.right&&K.top<R.innerHeight&&K.left<R.innerWidth){if(D+=bp(B),D>mo){me.length=se;break}B=new Promise(Xb.bind(B)),me.push(B)}}}if(0<me.length)return R=Promise.race([Promise.all(me),new Promise(function(fe){return setTimeout(fe,500)})]).then(i,i),(q?Promise.allSettled([q.finished,R]):R).then(r,r);if(i(),q)return q.finished.then(r,r);r()},types:n});O.__reactViewTransition=G;var J=[];return G.ready.then(function(){for(var R=O.documentElement.getAnimations({subtree:!0}),q=0;q<R.length;q++){var se=R[q],me=se.effect,Ae=me.pseudoElement;if(Ae!=null&&Ae.startsWith("::view-transition")){J.push(se),se=me.getKeyframes();for(var D=Ae=void 0,C=!0,B=0;B<se.length;B++){var K=se[B],fe=K.width;if(Ae===void 0)Ae=fe;else if(Ae!==fe){C=!1;break}if(fe=K.height,D===void 0)D=fe;else if(D!==fe){C=!1;break}delete K.width,delete K.height,K.transform==="none"&&delete K.transform}C&&Ae!==void 0&&D!==void 0&&(me.setKeyframes(se),C=getComputedStyle(me.target,me.pseudoElement),C.width!==Ae||C.height!==D)&&(C=se[0],C.width=Ae,C.height=D,C=se[se.length-1],C.width=Ae,C.height=D,me.setKeyframes(se))}}d()},function(R){O.__reactViewTransition===G&&(O.__reactViewTransition=null);try{if(typeof R=="object"&&R!==null)switch(R.name){case"InvalidStateError":(R.message==="View transition was skipped because document visibility state is hidden."||R.message==="Skipping view transition because document visibility state has become hidden."||R.message==="Skipping view transition because viewport size changed."||R.message==="Transition was aborted because of invalid state")&&(R=null)}R!==null&&w(R)}finally{l(),i(),d()}}),G.finished.finally(function(){for(var R=0;R<J.length;R++)J[R].cancel();O.__reactViewTransition===G&&(O.__reactViewTransition=null),v()}),G}catch{return l(),i(),d(),null}}function Sl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Sl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:M({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Sl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),l=[],i=0;i<n.length;i++){var r=n[i].effect;r!==null&&r.target===e&&r.pseudoElement===t&&l.push(n[i])}return l},Sl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ep(e){return{name:e,group:new Sl("group",e),imagePair:new Sl("image-pair",e),old:new Sl("old",e),new:new Sl("new",e)}}function dn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}dn.prototype.addEventListener=function(e,t,n){var l=null,i=null;if(!(n!=null&&typeof n!="boolean"&&(l=n.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var r=this._eventListeners;if(np(r,e,t,n)===-1){var d=this,v=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(v=function(w){d.removeEventListener(e,t,n),typeof t=="function"?t.call(this,w):t.handleEvent(w)}),l!==null&&(i=d.removeEventListener.bind(d,e,t,n),l.addEventListener("abort",i,{once:!0}),i=l.removeEventListener.bind(l,"abort",i)),l=hs(n),r.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:v,cleanup:i}),y(this._fragmentFiber.child,!1,Qb,e,v,l)}this._eventListeners=r}};function Qb(e,t,n,l){return k(e).addEventListener(t,n,l),!1}dn.prototype.removeEventListener=function(e,t,n){var l=this._eventListeners;if(l!==null&&(t=np(l,e,t,n),t!==-1)){var i=l[t];n=i.attachedListener;var r=i.cleanup;i=hs(i.optionsOrUseCapture),y(this._fragmentFiber.child,!1,Kb,e,n,i),l.splice(t,1),r!==null&&r()}};function Kb(e,t,n,l){return k(e).removeEventListener(t,n,l),!1}function hs(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function tp(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function np(e,t,n,l){if(e.length===0)return-1;l=tp(l);for(var i=0;i<e.length;i++){var r=e[i];if(r.type===t&&r.listener===n&&tp(r.optionsOrUseCapture)===l)return i}return-1}dn.prototype.dispatchEvent=function(e){var t=N(this._fragmentFiber);if(t===null)return!0;t=k(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var i=0;i<n.length;i++){var r=n[i];l.addEventListener(r.type,r.attachedListener,hs(r.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),n)for(i=0;i<n.length;i++)r=n[i],l.removeEventListener(r.type,r.attachedListener,hs(r.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},dn.prototype.focus=function(e){y(this._fragmentFiber.child,!0,ap,e,void 0,void 0)};function ap(e,t){return e.tag===6?!1:(e=k(e),i0(e,t))}dn.prototype.focusLast=function(e){var t=[];y(this._fragmentFiber.child,!0,nd,t,void 0,void 0);for(var n=t.length-1;0<=n&&!ap(t[n],e);n--);};function nd(e,t){return t.push(e),!1}dn.prototype.blur=function(){var e=N(this._fragmentFiber);e!==null&&(e=k(e),e=bi(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,Jb,e,void 0,void 0))};function Jb(e,t){return e.tag===6?!1:(e=k(e),e===t||e.contains(t)?(t.blur(),!0):!1)}dn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,Pb,e,void 0,void 0)};function Pb(e,t){return e.tag===6||(e=k(e),t.observe(e)),!1}dn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),y(this._fragmentFiber.child,!1,Fb,e,void 0,void 0);for(var n=t=0;n<Un.length;n++){var l=Un[n];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):Un[t++]=l}Un.length=t}};function Fb(e,t){return e.tag===6||(e=k(e),t.unobserve(e)),!1}var Un=[],ad=!1;function Ib(e,t,n){Un.push({fragmentInstance:e,observer:t,instance:n}),ad||(ad=!0,r0(function(){ad=!1;var l=Un;Un=[];for(var i=0;i<l.length;i++){var r=l[i];r.observer.unobserve(r.instance)}}))}dn.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,Wb,e,void 0,void 0),e};function Wb(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=k(e),t.push.apply(t,e.getClientRects());return!1}dn.prototype.getRootNode=function(e){var t=N(this._fragmentFiber);return t===null?this:k(t).getRootNode(e)},dn.prototype.compareDocumentPosition=function(e){var t=N(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];y(this._fragmentFiber.child,!1,nd,n,void 0,void 0);var l=k(t);if(n.length===0){if(n=l,E(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=l=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=U(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=k(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=k(n[0]),i=k(n[n.length-1]);var r=E(this._fragmentFiber)?t.parentElement:l;if(r==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,r=r.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var d=t.compareDocumentPosition(e),v=i.compareDocumentPosition(e),w=d&Node.DOCUMENT_POSITION_CONTAINED_BY||v&Node.DOCUMENT_POSITION_CONTAINED_BY;return v=l&&r&&d&Node.DOCUMENT_POSITION_FOLLOWING&&v&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||r&&i===e||w||v?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!r&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:d,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||e0(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function e0(e,t,n,l,i){var r=al(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!r)e:{for(;r!==null;){if(r.tag===7&&(r===t||r.alternate===t)){n=!0;break e}r=r.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(r===null)return r=i.ownerDocument,i===r||i===r.documentElement||i===r.body;e:{for(r=t,t=N(t);r!==null;){if(!(r.tag!==5&&r.tag!==3&&r.tag!==27||r!==t&&r.alternate!==t)){r=!0;break e}r=r.return}r=!1}return r}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!r)&&!(t=r===n)&&(t=ne(n,r,Y),t===null?t=!1:(y(t,!0,Q,r,n),r=_,_=null,t=r!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!r)&&!(t=r===l)&&(t=ne(l,r,Y),t===null?t=!1:(y(t,!0,A,r,l),r=_,z=_=null,t=r!==null)),t):!1}function lp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}dn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(u(566));var t=[];y(this._fragmentFiber.child,!1,nd,t,void 0,void 0);var n=e!==!1;if(t.length===0){var l=U(this._fragmentFiber);if(l=n?l[1]||l[0]||N(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=k(l),lp(e,n);return}if(l=k(l),l.nodeType!==9){if(l.nodeType===11){n="host"in l?l.host:null,n!==null&&n.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=n?t.length-1:0;l!==(n?-1:t.length);){var i=t[l];i.tag===6?(i=k(i),lp(i,n)):k(i).scrollIntoView(e),l+=n?-1:1}};function t0(e,t){return e=k(e),sp(e,t),!1}function sp(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function ip(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l];e.addEventListener(i.type,i.attachedListener,hs(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){for(var d=0,v=0;v<Un.length;v++){var w=Un[v];(w.fragmentInstance!==t||w.observer!==r||w.instance!==e)&&(Un[d++]=w)}Un.length=d,r.observe(e)}),sp(e,t))}function n0(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l];e.removeEventListener(i.type,i.attachedListener,hs(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){typeof r.rootMargin=="string"?Ib(t,r,e):r.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function ld(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":ld(n),tr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function a0(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Hs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=jn(e.nextSibling),e===null)break}return null}function l0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=jn(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=jn(e.nextSibling),e===null))return null;return e}function sd(e){return e.data==="$?"||e.data==="$~"}function id(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function s0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function jn(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 rd=null;function op(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return jn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function cp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function i0(e,t){function n(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return l}function r0(e){Jx(function(){Jx(function(t){return e(t)})})}function up(e,t,n){switch(t=bi(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function dp(e,t,n){for(var l in n){var i=n[l];n.hasOwnProperty(l)&&i!=null&&Ke(e,t,l,null,Lb,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Yn&&(e.onclick=null),tr(e)}function od(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);tr(e)}var Nn=new Map,fp=new Set;function ji(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var ya=ye.d;ye.d={f:o0,r:c0,D:u0,C:d0,L:f0,m:h0,X:x0,S:m0,M:p0};function o0(){var e=ya.f(),t=lo();return e||t}function c0(e){var t=Dl(e);t!==null&&t.tag===5&&t.type==="form"?mm(t):ya.r(e)}var ms=typeof document>"u"?null:document;function hp(e,t,n){var l=ms;if(l&&typeof t=="string"&&t){var i=mn(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),fp.has(i)||(fp.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),Dt(t,"link",e),jt(t),l.head.appendChild(t)))}}function u0(e){ya.D(e),hp("dns-prefetch",e,null)}function d0(e,t){ya.C(e,t),hp("preconnect",e,t)}function f0(e,t,n){ya.L(e,t,n);var l=ms;if(l&&e&&t){var i='link[rel="preload"][as="'+mn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+mn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+mn(n.imageSizes)+'"]')):i+='[href="'+mn(e)+'"]';var r=i;switch(t){case"style":r=xs(e);break;case"script":r=ps(e)}if(!(Nn.has(r)||(e=M({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Nn.set(r,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Ni(r))||t==="script"&&l.querySelector(wi(r))))){var d=l.createElement("link");Dt(d,"link",e),t==="style"&&(d[er]=!0,d.onload=d.onerror=function(){Tf(d)}),jt(d),l.head.appendChild(d)}}}function h0(e,t){ya.m(e,t);var n=ms;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+mn(l)+'"][href="'+mn(e)+'"]',r=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ps(e)}if(!Nn.has(r)&&(e=M({rel:"modulepreload",href:e},t),Nn.set(r,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wi(r)))return}l=n.createElement("link"),Dt(l,"link",e),jt(l),n.head.appendChild(l)}}}function m0(e,t,n){ya.S(e,t,n);var l=ms;if(l&&e){var i=_l(l).hoistableStyles,r=xs(e);t=t||"default";var d=i.get(r);if(!d){var v={loading:0,preload:null};if(d=l.querySelector(Ni(r)))v.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Nn.get(r))&&cd(e,n);var w=d=l.createElement("link");jt(w),Dt(w,"link",e),w._p=new Promise(function(O,G){w.onload=O,w.onerror=G}),w.addEventListener("load",function(){v.loading|=1}),w.addEventListener("error",function(){v.loading|=2}),v.loading|=4,fo(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:v},i.set(r,d)}}}function x0(e,t){ya.X(e,t);var n=ms;if(n&&e){var l=_l(n).hoistableScripts,i=ps(e),r=l.get(i);r||(r=n.querySelector(wi(i)),r||(e=M({src:e,async:!0},t),(t=Nn.get(i))&&ud(e,t),r=n.createElement("script"),jt(r),Dt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},l.set(i,r))}}function p0(e,t){ya.M(e,t);var n=ms;if(n&&e){var l=_l(n).hoistableScripts,i=ps(e),r=l.get(i);r||(r=n.querySelector(wi(i)),r||(e=M({src:e,async:!0,type:"module"},t),(t=Nn.get(i))&&ud(e,t),r=n.createElement("script"),jt(r),Dt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},l.set(i,r))}}function mp(e,t,n,l){var i=(i=Ge.current)?ji(i):null;if(!i)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=xs(n.href),t=_l(i).hoistableStyles,l=t.get(n),l||(l={type:"style",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=xs(n.href);var r=_l(i).hoistableStyles,d=r.get(e);if(d||(i=i.ownerDocument||i,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,d),(r=i.querySelector(Ni(e)))?r._p||(d.instance=r,d.state.loading=5):(r=Nn.get(e),r||(r={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Nn.set(e,r)),g0(i,e,r,d.state))),t&&l===null)throw Error(u(528,""));return d}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=ps(n),t=_l(i).hoistableScripts,l=t.get(n),l||(l={type:"script",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function xs(e){return'href="'+mn(e)+'"'}function Ni(e){return'link[rel="stylesheet"]['+e+"]"}function xp(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function g0(e,t,n,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[er]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[er]=!0,t.onload=t.onerror=Tf.bind(null,t),Dt(t,"link",n),jt(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function ps(e){return'[src="'+mn(e)+'"]'}function wi(e){return"script[async]"+e}function pp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+mn(n.href)+'"]');if(l)return t.instance=l,jt(l),l;var i=M({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),jt(l),Dt(l,"style",i),fo(l,n.precedence,e),t.instance=l;case"stylesheet":i=xs(n.href);var r=e.querySelector(Ni(i));if(r)return t.state.loading|=4,t.instance=r,jt(r),r;l=xp(n),(i=Nn.get(i))&&cd(l,i),r=(e.ownerDocument||e).createElement("link"),jt(r);var d=r;return d._p=new Promise(function(v,w){d.onload=v,d.onerror=w}),Dt(r,"link",l),t.state.loading|=4,fo(r,n.precedence,e),t.instance=r;case"script":return r=ps(n.src),(i=e.querySelector(wi(r)))?(t.instance=i,jt(i),i):(l=n,(i=Nn.get(r))&&(l=M({},n),ud(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),jt(i),Dt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,fo(l,n.precedence,e));return t.instance}function fo(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,r=i,d=0;d<l.length;d++){var v=l[d];if(v.dataset.precedence===t)r=v;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function cd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ho=null;function gp(e,t,n){if(ho===null){var l=new Map,i=ho=new Map;i.set(n,l)}else i=ho,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[Hs]||r[Ct]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var d=r.getAttribute(t)||"";d=e+d;var v=l.get(d);v?v.push(r):l.set(d,[r])}}return l}function dd(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function y0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!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 yp(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function vp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function bp(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function jp(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=bp(t),e.suspenseyImages.push(t)),e=j0.bind(e),t.decode().then(e,e))}function v0(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=xs(l.href),r=t.querySelector(Ni(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Si.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,jt(r);return}r=t.ownerDocument||t,l=xp(l),(i=Nn.get(i))&&cd(l,i),r=r.createElement("link"),jt(r);var d=r;d._p=new Promise(function(v,w){d.onload=v,d.onerror=w}),Dt(r,"link",l),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Si.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var mo=0;function b0(e,t){return e.stylesheets&&e.count===0&&po(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&po(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&mo===0&&(mo=62500*Hb());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&po(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>mo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function Np(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)po(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Si(){this.count--,Np(this)}function j0(){this.imgCount--,Np(this)}var xo=null;function po(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xo=new Map,t.forEach(N0,e),xo=null,Si.call(e))}function N0(e,t){if(!(t.state.loading&4)){var n=xo.get(e);if(n)var l=n.get(null);else{n=new Map,xo.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var d=i[r];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}i=t.instance,d=i.getAttribute("data-precedence"),r=n.get(d)||l,r===l&&n.set(null,i),n.set(d,i),this.count++,l=Si.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var gs={$$typeof:xe,Provider:null,Consumer:null,_currentValue:Ht,_currentValue2:Ht,_threadCount:0};function w0(e,t,n,l,i,r,d,v,w){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=Xo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xo(0),this.hiddenUpdates=Xo(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.transitionTypes=null,this.incompleteTransitions=new Map}function wp(e,t,n,l,i,r,d,v,w,O,G,J){return e=new w0(e,t,n,d,w,O,G,J,v),t=1,r===!0&&(t|=24),r=Xt(3,null,null,t),e.current=r,r.stateNode=e,t=Tc(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:l,isDehydrated:n,cache:t},Rc(r),e}function Sp(e){return e?(e=$l,e):$l}function kp(e,t,n,l,i,r){i=Sp(i),l.context===null?l.context=i:l.pendingContext=i,l=La(t),l.payload={element:n},r=r===void 0?null:r,r!==null&&(l.callback=r),n=Ua(e,l,t),n!==null&&(Jt(n,e,t),ti(n,e,t))}function Tp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fd(e,t){Tp(e,t),(e=e.alternate)&&Tp(e,t)}function Cp(e){if(e.tag===13||e.tag===31){var t=rl(e,67108864);t!==null&&Jt(t,e,67108864),fd(e,67108864)}}function Ep(e){if(e.tag===13||e.tag===31){var t=un();t=Zo(t);var n=rl(e,t);n!==null&&Jt(n,e,t),fd(e,t)}}var ys=!0;function S0(e,t,n,l){var i=ce.T;ce.T=null;var r=ye.p;try{ye.p=2,hd(e,t,n,l)}finally{ye.p=r,ce.T=i}}function k0(e,t,n,l){var i=ce.T;ce.T=null;var r=ye.p;try{ye.p=8,hd(e,t,n,l)}finally{ye.p=r,ce.T=i}}function hd(e,t,n,l){if(ys){var i=md(l);if(i===null)Ku(e,t,l,go,n),Rp(e,l);else if(C0(i,e,t,n,l))l.stopPropagation();else if(Rp(e,l),t&4&&-1<T0.indexOf(e)){for(;i!==null;){var r=Dl(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var d=nl(r.pendingLanes);if(d!==0){var v=r;for(v.pendingLanes|=2,v.entangledLanes|=2;d;){var w=1<<31-nn(d);v.entanglements[1]|=w,d&=~w}In(r),($e&6)===0&&(to=en()+500,gi(0))}}break;case 31:case 13:v=rl(r,2),v!==null&&Jt(v,r,2),lo(),fd(r,2)}if(r=md(l),r===null&&Ku(e,t,l,go,n),r===i)break;i=r}i!==null&&l.stopPropagation()}else Ku(e,t,l,null,n)}}function md(e){return e=Wo(e),xd(e)}var go=null;function xd(e){if(go=null,e=al(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g(t),e!==null)return e;e=null}else if(n===31){if(e=h(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return go=e,null}function zp(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Hy()){case mf:return 2;case xf:return 8;case Ji:case By:return 32;case pf:return 268435456;default:return 32}default:return 32}}var pd=!1,Ja=null,Pa=null,Fa=null,ki=new Map,Ti=new Map,Ia=[],T0="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 Rp(e,t){switch(e){case"focusin":case"focusout":Ja=null;break;case"dragenter":case"dragleave":Pa=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":ki.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ti.delete(t.pointerId)}}function Ci(e,t,n,l,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Dl(t),t!==null&&Cp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function C0(e,t,n,l,i){switch(t){case"focusin":return Ja=Ci(Ja,e,t,n,l,i),!0;case"dragenter":return Pa=Ci(Pa,e,t,n,l,i),!0;case"mouseover":return Fa=Ci(Fa,e,t,n,l,i),!0;case"pointerover":var r=i.pointerId;return ki.set(r,Ci(ki.get(r)||null,e,t,n,l,i)),!0;case"gotpointercapture":return r=i.pointerId,Ti.set(r,Ci(Ti.get(r)||null,e,t,n,l,i)),!0}return!1}function Ap(e){var t=al(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,wf(e.priority,function(){Ep(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,wf(e.priority,function(){Ep(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function yo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=md(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Io=l,n.target.dispatchEvent(l),Io=null}else return t=Dl(n),t!==null&&Cp(t),e.blockedOn=n,!1;t.shift()}return!0}function Dp(e,t,n){yo(e)&&n.delete(t)}function E0(){pd=!1,Ja!==null&&yo(Ja)&&(Ja=null),Pa!==null&&yo(Pa)&&(Pa=null),Fa!==null&&yo(Fa)&&(Fa=null),ki.forEach(Dp),Ti.forEach(Dp)}function vo(e,t){e.blockedOn===t&&(e.blockedOn=null,pd||(pd=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,E0)))}var bo=null;function _p(e){bo!==e&&(bo=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){bo===e&&(bo=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(xd(l||n)===null)continue;break}var r=Dl(n);r!==null&&(e.splice(t,3),t-=3,Fc(r,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function vs(e){function t(w){return vo(w,e)}Ja!==null&&vo(Ja,e),Pa!==null&&vo(Pa,e),Fa!==null&&vo(Fa,e),ki.forEach(t),Ti.forEach(t);for(var n=0;n<Ia.length;n++){var l=Ia[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ia.length&&(n=Ia[0],n.blockedOn===null);)Ap(n),n.blockedOn===null&&Ia.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],r=n[l+1],d=i[Vt]||null;if(typeof r=="function")d||_p(n);else if(d){var v=null;if(r&&r.hasAttribute("formAction")){if(i=r,d=r[Vt]||null)v=d.formAction;else if(xd(i)!==null)continue}else v=d.action;typeof v=="function"?n[l+1]=v:(n.splice(l,3),l-=3),_p(n)}}}function Op(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(d){return i=d})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function gd(e){this._internalRoot=e}jo.prototype.render=gd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,l=un();kp(n,l,e,t,null,null)},jo.prototype.unmount=gd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kp(e.current,2,null,e,null,null),lo(),t[Al]=null}};function jo(e){this._internalRoot=e}jo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Nf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ia.length&&t!==0&&t<Ia[n].priority;n++);Ia.splice(n,0,e),n===0&&Ap(e)}};var Mp=o.version;if(Mp!=="19.3.1")throw Error(u(527,Mp,"19.3.1"));ye.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=b(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var z0={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ce,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var No=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!No.isDisabled&&No.supportsFiber)try{Ms=No.inject(z0),tn=No}catch{}}return zi.createRoot=function(e,t){if(!f(e))throw Error(u(299));var n=!1,l="",i=Sm,r=km,d=Tm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=wp(e,1,!1,null,null,n,l,null,i,r,d,Op),e[Al]=t.current,Qu(e),new gd(t)},zi.hydrateRoot=function(e,t,n){if(!f(e))throw Error(u(299));var l=!1,i="",r=Sm,d=km,v=Tm,w=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.formState!==void 0&&(w=n.formState)),t=wp(e,1,!0,t,n??null,l,i,w,r,d,v,Op),t.context=Sp(null),n=t.current,l=un(),l=Zo(l),i=La(l),i.callback=null,Ua(n,i,l),n=l,t.current.lanes=n,Us(t,n),In(t),e[Al]=t.current,Qu(e),new jo(t)},zi.version="19.3.1",zi}var Xp;function H0(){if(Xp)return bd.exports;Xp=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),bd.exports=U0(),bd.exports}var B0=H0();/**
50
- * react-router v7.18.5
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var Kd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Dg=/^[\\/]{2}/;function q0(s,o){return o+s.replace(/\\/g,"/")}var Zp="popstate";function Qp(s){return typeof s=="object"&&s!=null&&"pathname"in s&&"search"in s&&"hash"in s&&"state"in s&&"key"in s}function G0(s={}){function o(f,m){let{pathname:g="/",search:h="",hash:x=""}=El(f.location.hash.substring(1));return!g.startsWith("/")&&!g.startsWith(".")&&(g="/"+g),Od("",{pathname:g,search:h,hash:x},m.state&&m.state.usr||null,m.state&&m.state.key||"default")}function c(f,m){let g=f.document.querySelector("base"),h="";if(g&&g.getAttribute("href")){let x=f.location.href,b=x.indexOf("#");h=b===-1?x:x.slice(0,b)}return h+"#"+(typeof m=="string"?m:Ns(m))}function u(f,m){Tn(f.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(m)})`)}return $0(o,c,u,s)}function st(s,o){if(s===!1||s===null||typeof s>"u")throw new Error(o)}function Tn(s,o){if(!s){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function Y0(){return Math.random().toString(36).substring(2,10)}function Kp(s,o){return{usr:s.state,key:s.key,idx:o,masked:s.mask?{pathname:s.pathname,search:s.search,hash:s.hash}:void 0}}function Od(s,o,c=null,u,f){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof o=="string"?El(o):o,state:c,key:o&&o.key||u||Y0(),mask:f}}function Ns({pathname:s="/",search:o="",hash:c=""}){return o&&o!=="?"&&(s+=o.charAt(0)==="?"?o:"?"+o),c&&c!=="#"&&(s+=c.charAt(0)==="#"?c:"#"+c),s}function El(s){let o={};if(s){let c=s.indexOf("#");c>=0&&(o.hash=s.substring(c),s=s.substring(0,c));let u=s.indexOf("?");u>=0&&(o.search=s.substring(u),s=s.substring(0,u)),s&&(o.pathname=s)}return o}function $0(s,o,c,u={}){let{window:f=document.defaultView,v5Compat:m=!1}=u,g=f.history,h="POP",x=null,b=j();b==null&&(b=0,g.replaceState({...g.state,idx:b},""));function j(){return(g.state||{idx:null}).idx}function y(){h="POP";let k=j(),_=k==null?null:k-b;b=k,x&&x({action:h,location:S.location,delta:_})}function N(k,_){h="PUSH";let z=Qp(k)?k:Od(S.location,k,_);c&&c(z,k),b=j()+1;let Q=Kp(z,b),A=S.createHref(z.mask||z);try{g.pushState(Q,"",A)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;f.location.assign(A)}m&&x&&x({action:h,location:S.location,delta:1})}function E(k,_){h="REPLACE";let z=Qp(k)?k:Od(S.location,k,_);c&&c(z,k),b=j();let Q=Kp(z,b),A=S.createHref(z.mask||z);g.replaceState(Q,"",A),m&&x&&x({action:h,location:S.location,delta:0})}function U(k){return V0(f,k)}let S={get action(){return h},get location(){return s(f,g)},listen(k){if(x)throw new Error("A history only accepts one active listener");return f.addEventListener(Zp,y),x=k,()=>{f.removeEventListener(Zp,y),x=null}},createHref(k){return o(f,k)},createURL:U,encodeLocation(k){let _=U(k);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:N,replace:E,go(k){return g.go(k)}};return S}function V0(s,o,c=!1){let u="http://localhost";s&&(u=s.location.origin!=="null"?s.location.origin:s.location.href),st(u,"No window.location.(origin|href) available to create URL");let f=typeof o=="string"?o:Ns(o);return f=f.replace(/ $/,"%20"),!c&&Dg.test(f)&&(f=u+f),new URL(f,u)}function _g(s,o,c="/"){return X0(s,o,c,!1)}function X0(s,o,c,u,f){let m=typeof o=="string"?El(o):o,g=ja(m.pathname||"/",c);if(g==null)return null;let h=Z0(s),x=null,b=a1(g);for(let j=0;x==null&&j<h.length;++j)x=n1(h[j],b,u);return x}function Z0(s){let o=Og(s);return Q0(o),o}function Og(s,o=[],c=[],u="",f=!1){let m=(g,h,x=f,b)=>{let j={relativePath:b===void 0?g.path||"":b,caseSensitive:g.caseSensitive===!0,childrenIndex:h,route:g};if(j.relativePath.startsWith("/")){if(!j.relativePath.startsWith(u)&&x)return;st(j.relativePath.startsWith(u),`Absolute route path "${j.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),j.relativePath=j.relativePath.slice(u.length)}let y=Hn([u,j.relativePath]),N=c.concat(j);g.children&&g.children.length>0&&(st(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Og(g.children,o,N,y,x)),!(g.path==null&&!g.index)&&o.push({path:y,score:e1(y,g.index),routesMeta:N.map((E,U)=>{let[S,k]=Ug(E.relativePath,E.caseSensitive,U===N.length-1);return{...E,matcher:S,compiledParams:k}})})};return s.forEach((g,h)=>{if(g.path===""||!g.path?.includes("?"))m(g,h);else for(let x of Mg(g.path))m(g,h,!0,x)}),o}function Mg(s){let o=s.split("/");if(o.length===0)return[];let[c,...u]=o,f=c.endsWith("?"),m=c.replace(/\?$/,"");if(u.length===0)return f?[m,""]:[m];let g=Mg(u.join("/")),h=[];return h.push(...g.map(x=>x===""?m:[m,x].join("/"))),f&&h.push(...g),h.map(x=>s.startsWith("/")&&x===""?"/":x)}function Q0(s){s.sort((o,c)=>o.score!==c.score?c.score-o.score:t1(o.routesMeta.map(u=>u.childrenIndex),c.routesMeta.map(u=>u.childrenIndex)))}var K0=/^:[\w-]+$/,J0=3,P0=2,F0=1,I0=10,W0=-2,Jp=s=>s==="*";function e1(s,o){let c=s.split("/"),u=c.length;return c.some(Jp)&&(u+=W0),o&&(u+=P0),c.filter(f=>!Jp(f)).reduce((f,m)=>f+(K0.test(m)?J0:m===""?F0:I0),u)}function t1(s,o){return s.length===o.length&&s.slice(0,-1).every((u,f)=>u===o[f])?s[s.length-1]-o[o.length-1]:0}function n1(s,o,c=!1){let{routesMeta:u}=s,f={},m="/",g=[];for(let h=0;h<u.length;++h){let x=u[h],b=h===u.length-1,j=m==="/"?o:o.slice(m.length)||"/",y={path:x.relativePath,caseSensitive:x.caseSensitive,end:b},N=x.matcher&&x.compiledParams?Lg(y,j,x.matcher,x.compiledParams):Ao(y,j),E=x.route;if(!N&&b&&c&&!u[u.length-1].route.index&&(N=Ao({path:x.relativePath,caseSensitive:x.caseSensitive,end:!1},j)),!N)return null;Object.assign(f,N.params),g.push({params:f,pathname:Hn([m,N.pathname]),pathnameBase:i1(Hn([m,N.pathnameBase])),route:E}),N.pathnameBase!=="/"&&(m=Hn([m,N.pathnameBase]))}return g}function Ao(s,o){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[c,u]=Ug(s.path,s.caseSensitive,s.end);return Lg(s,o,c,u)}function Lg(s,o,c,u){let f=o.match(c);if(!f)return null;let m=f[0],g=ws(m,1),h=f.slice(1);return{params:u.reduce((b,{paramName:j,isOptional:y},N)=>{if(j==="*"){let U=h[N]||"";g=ws(m.slice(0,m.length-U.length),1)}const E=h[N];return y&&!E?b[j]=void 0:b[j]=(E||"").replace(/%2F/g,"/"),b},{}),pathname:m,pathnameBase:g,pattern:s}}function Ug(s,o=!1,c=!0){Tn(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let u=[],f="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,h,x,b,j)=>{if(u.push({paramName:h,isOptional:x!=null}),x){let y=j.charAt(b+g.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(u.push({paramName:"*"}),f+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):c?f+="\\/*$":s!==""&&s!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,o?void 0:"i"),u]}function a1(s){try{return s.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return Tn(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),s}}function ja(s,o){if(o==="/")return s;if(!s.toLowerCase().startsWith(o.toLowerCase()))return null;let c=o.endsWith("/")?o.length-1:o.length,u=s.charAt(c);return u&&u!=="/"?null:s.slice(c)||"/"}function l1(s,o="/"){let{pathname:c,search:u="",hash:f=""}=typeof s=="string"?El(s):s,m;return c?(c=Bg(c),c.startsWith("/")||c.startsWith("\\")?m=Pp(c.substring(1),"/"):m=Pp(c,o)):m=o,{pathname:m,search:r1(u),hash:o1(f)}}function Pp(s,o){let c=ws(o).split("/");return s.split("/").forEach(f=>{f===".."?c.length>1&&c.pop():f!=="."&&c.push(f)}),c.length>1?c.join("/"):"/"}function Sd(s,o,c,u){return`Cannot include a '${s}' character in a manually specified \`to.${o}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${c}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function s1(s){return s.filter((o,c)=>c===0||o.route.path&&o.route.path.length>0)}function Hg(s){let o=s1(s);return o.map((c,u)=>u===o.length-1?c.pathname:c.pathnameBase)}function Jd(s,o,c,u=!1){let f;typeof s=="string"?f=El(s):(f={...s},st(!f.pathname||!f.pathname.includes("?"),Sd("?","pathname","search",f)),st(!f.pathname||!f.pathname.includes("#"),Sd("#","pathname","hash",f)),st(!f.search||!f.search.includes("#"),Sd("#","search","hash",f)));let m=s===""||f.pathname==="",g=m?"/":f.pathname,h;if(g==null)h=c;else{let y=o.length-1;if(!u&&g.startsWith("..")){let N=g.split("/");for(;N[0]==="..";)N.shift(),y-=1;f.pathname=N.join("/")}h=y>=0?o[y]:"/"}let x=l1(f,h),b=g&&g!=="/"&&g.endsWith("/"),j=(m||g===".")&&c.endsWith("/");return!x.pathname.endsWith("/")&&(b||j)&&(x.pathname+="/"),x}var Bg=s=>s.replace(/[\\/]{2,}/g,"/"),Hn=s=>Bg(s.join("/"));function ws(s,o=0){let c=s.length;for(;c>o&&s.charCodeAt(c-1)===47;)c--;return c===s.length?s:s.slice(0,c)}var i1=s=>ws(s).replace(/^\/*/,"/"),r1=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,o1=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,c1=class{constructor(s,o,c,u=!1){this.status=s,this.statusText=o||"",this.internal=u,c instanceof Error?(this.data=c.toString(),this.error=c):this.data=c}};function u1(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function d1(s){let o=s.map(c=>c.route.path).filter(Boolean);return Hn(o)||"/"}var qg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gg(s,o){let c=s;if(typeof c!="string"||!Kd.test(c))return{absoluteURL:void 0,isExternal:!1,to:c};let u=c,f=!1;if(qg)try{let m=new URL(window.location.href),g=Dg.test(c)?new URL(q0(c,m.protocol)):new URL(c),h=ja(g.pathname,o);g.origin===m.origin&&h!=null?c=h+g.search+g.hash:f=!0}catch{Tn(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:f,to:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Fp=new URL("http://localhost");function Yg(s){if(s.createURL)return s.createURL("/");try{return new URL(s.createHref("/"),Fp)}catch{return Fp}}function kd(s,o){return s.origin===o.origin&&(s.origin!=="null"||s.protocol===o.protocol&&s.host===o.host)}function f1(s,o){if(s.startsWith("//"))return!0;let c=o.protocol.toLowerCase();return s.toLowerCase().startsWith(c)?o.host===""||s.slice(c.length).startsWith("//"):!1}function $g(s,o,c,u){let f=null;try{f=s==null?null:new URL(s,c)}catch{}let m=new URL(o,c),g=f!=null&&!kd(f,c),h=!kd(m,c);if(u==="reject"){if(g||h)throw new Error("External navigation is not allowed")}else if(h&&(f==null||!f1(s,f)||!kd(f,m)))throw new Error("External navigation is not allowed")}var Vg=["POST","PUT","PATCH","DELETE"];new Set(Vg);var h1=["GET",...Vg];new Set(h1);var m1=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function x1(s){try{return m1.includes(new URL(s).protocol)}catch{return!1}}var Es=p.createContext(null);Es.displayName="DataRouter";var Uo=p.createContext(null);Uo.displayName="DataRouterState";var Xg=p.createContext(!1);function p1(){return p.useContext(Xg)}var Zg=p.createContext({isTransitioning:!1});Zg.displayName="ViewTransition";var g1=p.createContext(new Map);g1.displayName="Fetchers";var y1=p.createContext(null);y1.displayName="Await";var zn=p.createContext(null);zn.displayName="Navigation";var Hi=p.createContext(null);Hi.displayName="Location";var Wn=p.createContext({outlet:null,matches:[],isDataRoute:!1});Wn.displayName="Route";var Pd=p.createContext(null);Pd.displayName="RouteError";var Qg="REACT_ROUTER_ERROR",v1="REDIRECT",b1="ROUTE_ERROR_RESPONSE";function j1(s){if(s.startsWith(`${Qg}:${v1}:{`))try{let o=JSON.parse(s.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function N1(s){if(s.startsWith(`${Qg}:${b1}:{`))try{let o=JSON.parse(s.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new c1(o.status,o.statusText,o.data)}catch{}}function w1(s,{relative:o}={}){st(Bi(),"useHref() may be used only in the context of a <Router> component.");let{basename:c,navigator:u}=p.useContext(zn),{hash:f,pathname:m,search:g}=Gi(s,{relative:o}),h=m;return c!=="/"&&(h=m==="/"?c:Hn([c,m])),u.createHref({pathname:h,search:g,hash:f})}function Bi(){return p.useContext(Hi)!=null}function fn(){return st(Bi(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Hi).location}var Kg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jg(s){p.useContext(zn).static||p.useLayoutEffect(s)}function qi(){let{isDataRoute:s}=p.useContext(Wn);return s?H1():S1()}function S1(){st(Bi(),"useNavigate() may be used only in the context of a <Router> component.");let s=p.useContext(Es),{basename:o,navigator:c}=p.useContext(zn),{matches:u}=p.useContext(Wn),{pathname:f}=fn(),m=JSON.stringify(Hg(u)),g=p.useRef(!1);return Jg(()=>{g.current=!0}),p.useCallback((x,b={})=>{if(Tn(g.current,Kg),!g.current)return;if(typeof x=="number"){c.go(x);return}let j=Jd(x,JSON.parse(m),f,b.relative==="path");s==null&&o!=="/"&&(j.pathname=j.pathname==="/"?o:Hn([o,j.pathname])),$g(typeof x=="string"?x:Ns(x),c.createHref(j),Yg(c),"reject"),(b.replace?c.replace:c.push)(j,b.state,b)},[o,c,m,f,s])}var k1=p.createContext(null);function T1(s){let o=p.useContext(Wn).outlet;return p.useMemo(()=>o&&p.createElement(k1.Provider,{value:s},o),[o,s])}function Gi(s,{relative:o}={}){let{matches:c}=p.useContext(Wn),{pathname:u}=fn(),f=JSON.stringify(Hg(c));return p.useMemo(()=>Jd(s,JSON.parse(f),u,o==="path"),[s,f,u,o])}function C1(s,o){return Pg(s,o)}function Pg(s,o,c){st(Bi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=p.useContext(zn),{matches:f}=p.useContext(Wn),m=f[f.length-1],g=m?m.params:{},h=m?m.pathname:"/",x=m?m.pathnameBase:"/",b=m&&m.route;{let k=b&&b.path||"";Ig(h,!b||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
-
60
- Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let j=fn(),y;if(o){let k=typeof o=="string"?El(o):o;st(x==="/"||k.pathname?.startsWith(x),`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 "${x}" but pathname "${k.pathname}" was given in the \`location\` prop.`),y=k}else y=j;let N=y.pathname||"/",E=N;if(x!=="/"){let k=x.replace(/^\//,"").split("/");E="/"+N.replace(/^\//,"").split("/").slice(k.length).join("/")}let U=c&&c.state.matches.length?c.state.matches.map(k=>Object.assign(k,{route:c.manifest[k.route.id]||k.route})):_g(s,{pathname:E});Tn(b||U!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Tn(U==null||U[U.length-1].route.element!==void 0||U[U.length-1].route.Component!==void 0||U[U.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 S=D1(U&&U.map(k=>Object.assign({},k,{params:Object.assign({},g,k.params),pathname:Hn([x,u.encodeLocation?u.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?x:Hn([x,u.encodeLocation?u.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),f,c);return o&&S?p.createElement(Hi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},S):S}function E1(){let s=U1(),o=u1(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),c=s instanceof Error?s.stack:null,u="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:u},m={padding:"2px 4px",backgroundColor:u},g=null;return console.error("Error handled by React Router default ErrorBoundary:",s),g=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:m},"ErrorBoundary")," or"," ",p.createElement("code",{style:m},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},o),c?p.createElement("pre",{style:f},c):null,g)}var z1=p.createElement(E1,null),Fg=class extends p.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,o){return o.location!==s.location||o.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:o.error,location:o.location,revalidation:s.revalidation||o.revalidation}}componentDidCatch(s,o){this.props.onError?this.props.onError(s,o):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const c=N1(s.digest);c&&(s=c)}let o=s!==void 0?p.createElement(Wn.Provider,{value:this.props.routeContext},p.createElement(Pd.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?p.createElement(R1,{error:s},o):o}};Fg.contextType=Xg;var Td=new WeakMap;function R1({children:s,error:o}){let{basename:c,navigator:u}=p.useContext(zn);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let f=j1(o.digest);if(f){let m=Td.get(o);if(m)throw m;let g=Gg(f.location,c),h=g.absoluteURL||g.to;if($g(f.location,h,Yg(u),"allow-explicit"),x1(h))throw new Error("Invalid redirect location");if(qg&&!Td.get(o))if(g.isExternal||f.reloadDocument)window.location.href=h;else{const x=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(g.to,{replace:f.replace}));throw Td.set(o,x),x}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return s}function A1({routeContext:s,match:o,children:c}){let u=p.useContext(Es);return u&&u.static&&u.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=o.route.id),p.createElement(Wn.Provider,{value:s},c)}function D1(s,o=[],c){let u=c?.state;if(s==null){if(!u)return null;if(u.errors)s=u.matches;else if(o.length===0&&!u.initialized&&u.matches.length>0)s=u.matches;else return null}let f=s,m=u?.errors;if(m!=null){let j=f.findIndex(y=>y.route.id&&m?.[y.route.id]!==void 0);st(j>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,j+1))}let g=!1,h=-1;if(c&&u){g=u.renderFallback;for(let j=0;j<f.length;j++){let y=f[j];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(h=j),y.route.id){let{loaderData:N,errors:E}=u,U=y.route.loader&&!N.hasOwnProperty(y.route.id)&&(!E||E[y.route.id]===void 0);if(y.route.lazy||U){c.isStatic&&(g=!0),h>=0?f=f.slice(0,h+1):f=[f[0]];break}}}}let x=c?.onError,b=u&&x?(j,y)=>{x(j,{location:u.location,params:u.matches?.[0]?.params??{},pattern:d1(u.matches),errorInfo:y})}:void 0;return f.reduceRight((j,y,N)=>{let E,U=!1,S=null,k=null;u&&(E=m&&y.route.id?m[y.route.id]:void 0,S=y.route.errorElement||z1,g&&(h<0&&N===0?(Ig("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),U=!0,k=null):h===N&&(U=!0,k=y.route.hydrateFallbackElement||null)));let _=o.concat(f.slice(0,N+1)),z=()=>{let Q;return E?Q=S:U?Q=k:y.route.Component?Q=p.createElement(y.route.Component,null):y.route.element?Q=y.route.element:Q=j,p.createElement(A1,{match:y,routeContext:{outlet:j,matches:_,isDataRoute:u!=null},children:Q})};return u&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?p.createElement(Fg,{location:u.location,revalidation:u.revalidation,component:S,error:E,children:z(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:b}):z()},null)}function Fd(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _1(s){let o=p.useContext(Es);return st(o,Fd(s)),o}function O1(s){let o=p.useContext(Uo);return st(o,Fd(s)),o}function M1(s){let o=p.useContext(Wn);return st(o,Fd(s)),o}function Id(s){let o=M1(s),c=o.matches[o.matches.length-1];return st(c.route.id,`${s} can only be used on routes that contain a unique "id"`),c.route.id}function L1(){return Id("useRouteId")}function U1(){let s=p.useContext(Pd),o=O1("useRouteError"),c=Id("useRouteError");return s!==void 0?s:o.errors?.[c]}function H1(){let{router:s}=_1("useNavigate"),o=Id("useNavigate"),c=p.useRef(!1);return Jg(()=>{c.current=!0}),p.useCallback(async(f,m={})=>{Tn(c.current,Kg),c.current&&(typeof f=="number"?await s.navigate(f):await s.navigate(f,{fromRouteId:o,...m}))},[s,o])}var Ip={};function Ig(s,o,c){!o&&!Ip[s]&&(Ip[s]=!0,Tn(!1,c))}p.memo(B1);function B1({routes:s,manifest:o,future:c,state:u,isStatic:f,onError:m}){return Pg(s,void 0,{manifest:o,state:u,isStatic:f,onError:m})}function q1(s){return T1(s.context)}function wn(s){st(!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 G1({basename:s="/",children:o=null,location:c,navigationType:u="POP",navigator:f,static:m=!1,useTransitions:g}){st(!Bi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=s.replace(/^\/*/,"/"),x=p.useMemo(()=>({basename:h,navigator:f,static:m,useTransitions:g,future:{}}),[h,f,m,g]);typeof c=="string"&&(c=El(c));let{pathname:b="/",search:j="",hash:y="",state:N=null,key:E="default",mask:U}=c,S=p.useMemo(()=>{let k=ja(b,h);return k==null?null:{location:{pathname:k,search:j,hash:y,state:N,key:E,mask:U},navigationType:u}},[h,b,j,y,N,E,u,U]);return Tn(S!=null,`<Router basename="${h}"> is not able to match the URL "${b}${j}${y}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:p.createElement(zn.Provider,{value:x},p.createElement(Hi.Provider,{children:o,value:S}))}function Y1({children:s,location:o}){return C1(Md(s),o)}function Md(s,o=[]){let c=[];return p.Children.forEach(s,(u,f)=>{if(!p.isValidElement(u))return;let m=[...o,f];if(u.type===p.Fragment){c.push.apply(c,Md(u.props.children,m));return}st(u.type===wn,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),st(!u.props.index||!u.props.children,"An index route cannot have child routes.");let g={id:u.props.id||m.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(g.children=Md(u.props.children,m)),c.push(g)}),c}var Co="get",Eo="application/x-www-form-urlencoded";function Ho(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function $1(s){return Ho(s)&&s.tagName.toLowerCase()==="button"}function V1(s){return Ho(s)&&s.tagName.toLowerCase()==="form"}function X1(s){return Ho(s)&&s.tagName.toLowerCase()==="input"}function Z1(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function Q1(s,o){return s.button===0&&(!o||o==="_self")&&!Z1(s)}function Ld(s=""){return new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((o,c)=>{let u=s[c];return o.concat(Array.isArray(u)?u.map(f=>[c,f]):[[c,u]])},[]))}function K1(s,o){let c=Ld(s);return o&&o.forEach((u,f)=>{c.has(f)||o.getAll(f).forEach(m=>{c.append(f,m)})}),c}var wo=null;function J1(){if(wo===null)try{new FormData(document.createElement("form"),0),wo=!1}catch{wo=!0}return wo}var P1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cd(s){return s!=null&&!P1.has(s)?(Tn(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Eo}"`),null):s}function F1(s,o){let c,u,f,m,g;if(V1(s)){let h=s.getAttribute("action");u=h?ja(h,o):null,c=s.getAttribute("method")||Co,f=Cd(s.getAttribute("enctype"))||Eo,m=new FormData(s)}else if($1(s)||X1(s)&&(s.type==="submit"||s.type==="image")){let h=s.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let x=s.getAttribute("formaction")||h.getAttribute("action");if(u=x?ja(x,o):null,c=s.getAttribute("formmethod")||h.getAttribute("method")||Co,f=Cd(s.getAttribute("formenctype"))||Cd(h.getAttribute("enctype"))||Eo,m=new FormData(h,s),!J1()){let{name:b,type:j,value:y}=s;if(j==="image"){let N=b?`${b}.`:"";m.append(`${N}x`,"0"),m.append(`${N}y`,"0")}else b&&m.append(b,y)}}else{if(Ho(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');c=Co,u=null,f=Eo,g=s}return m&&f==="text/plain"&&(g=m,m=void 0),{action:u,method:c.toLowerCase(),encType:f,formData:m,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Wd(s,o){if(s===!1||s===null||typeof s>"u")throw new Error(o)}function Wg(s,o,c,u){let f=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return c?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${u}`:f.pathname=`${f.pathname}.${u}`:f.pathname==="/"?f.pathname=`_root.${u}`:o&&ja(f.pathname,o)==="/"?f.pathname=`${ws(o)}/_root.${u}`:f.pathname=`${ws(f.pathname)}.${u}`,f}async function I1(s,o){if(s.id in o)return o[s.id];try{let c=await import(s.module);return o[s.id]=c,c}catch(c){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(c),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function W1(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function ej(s,o,c){let u=await Promise.all(s.map(async f=>{let m=o.routes[f.route.id];if(m){let g=await I1(m,c);return g.links?g.links():[]}return[]}));return lj(u.flat(1).filter(W1).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function Wp(s,o,c,u,f,m){let g=(x,b)=>c[b]?x.route.id!==c[b].route.id:!0,h=(x,b)=>c[b].pathname!==x.pathname||c[b].route.path?.endsWith("*")&&c[b].params["*"]!==x.params["*"];return m==="assets"?o.filter((x,b)=>g(x,b)||h(x,b)):m==="data"?o.filter((x,b)=>{let j=u.routes[x.route.id];if(!j||!j.hasLoader)return!1;if(g(x,b)||h(x,b))return!0;if(x.route.shouldRevalidate){let y=x.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:c[0]?.params||{},nextUrl:new URL(s,window.origin),nextParams:x.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function tj(s,o,{includeHydrateFallback:c}={}){return nj(s.map(u=>{let f=o.routes[u.route.id];if(!f)return[];let m=[f.module];return f.clientActionModule&&(m=m.concat(f.clientActionModule)),f.clientLoaderModule&&(m=m.concat(f.clientLoaderModule)),c&&f.hydrateFallbackModule&&(m=m.concat(f.hydrateFallbackModule)),f.imports&&(m=m.concat(f.imports)),m}).flat(1))}function nj(s){return[...new Set(s)]}function aj(s){let o={},c=Object.keys(s).sort();for(let u of c)o[u]=s[u];return o}function lj(s,o){let c=new Set;return new Set(o),s.reduce((u,f)=>{let m=JSON.stringify(aj(f));return c.has(m)||(c.add(m),u.push({key:m,link:f})),u},[])}function ef(){let s=p.useContext(Es);return Wd(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function sj(){let s=p.useContext(Uo);return Wd(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var tf=p.createContext(void 0);tf.displayName="FrameworkContext";function Bo(){let s=p.useContext(tf);return Wd(s,"You must render this element inside a <HydratedRouter> element"),s}function ij(s,o){let c=p.useContext(tf),[u,f]=p.useState(!1),[m,g]=p.useState(!1),{onFocus:h,onBlur:x,onMouseEnter:b,onMouseLeave:j,onTouchStart:y}=o,N=p.useRef(null);p.useEffect(()=>{if(s==="render"&&g(!0),s==="viewport"){let S=_=>{_.forEach(z=>{g(z.isIntersecting)})},k=new IntersectionObserver(S,{threshold:.5});return N.current&&k.observe(N.current),()=>{k.disconnect()}}},[s]),p.useEffect(()=>{if(u){let S=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(S)}}},[u]);let E=()=>{f(!0)},U=()=>{f(!1),g(!1)};return c?s!=="intent"?[m,N,{}]:[m,N,{onFocus:Ri(h,E),onBlur:Ri(x,U),onMouseEnter:Ri(b,E),onMouseLeave:Ri(j,U),onTouchStart:Ri(y,E)}]:[!1,N,{}]}function Ri(s,o){return c=>{s&&s(c),c.defaultPrevented||o(c)}}function rj({page:s,...o}){let c=p1(),{nonce:u}=Bo(),{router:f}=ef(),m=p.useMemo(()=>_g(f.routes,s,f.basename),[f.routes,s,f.basename]);return m?(o.nonce==null&&u&&(o={...o,nonce:u}),c?p.createElement(cj,{page:s,matches:m,...o}):p.createElement(uj,{page:s,matches:m,...o})):null}function oj(s){let{manifest:o,routeModules:c}=Bo(),[u,f]=p.useState([]);return p.useEffect(()=>{let m=!1;return ej(s,o,c).then(g=>{m||f(g)}),()=>{m=!0}},[s,o,c]),u}function cj({page:s,matches:o,...c}){let u=fn(),{future:f}=Bo(),{basename:m}=ef(),g=p.useMemo(()=>{if(s===u.pathname+u.search+u.hash)return[];let h=Wg(s,m,f.v8_trailingSlashAwareDataRequests,"rsc"),x=!1,b=[];for(let j of o)typeof j.route.shouldRevalidate=="function"?x=!0:b.push(j.route.id);return x&&b.length>0&&h.searchParams.set("_routes",b.join(",")),[h.pathname+h.search]},[m,f.v8_trailingSlashAwareDataRequests,s,u,o]);return p.createElement(p.Fragment,null,g.map(h=>p.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...c})))}function uj({page:s,matches:o,...c}){let u=fn(),{future:f,manifest:m,routeModules:g}=Bo(),{basename:h}=ef(),{loaderData:x,matches:b}=sj(),j=p.useMemo(()=>Wp(s,o,b,m,u,"data"),[s,o,b,m,u]),y=p.useMemo(()=>Wp(s,o,b,m,u,"assets"),[s,o,b,m,u]),N=p.useMemo(()=>{if(s===u.pathname+u.search+u.hash)return[];let S=new Set,k=!1;if(o.forEach(z=>{let Q=m.routes[z.route.id];!Q||!Q.hasLoader||(!j.some(A=>A.route.id===z.route.id)&&z.route.id in x&&g[z.route.id]?.shouldRevalidate||Q.hasClientLoader?k=!0:S.add(z.route.id))}),S.size===0)return[];let _=Wg(s,h,f.v8_trailingSlashAwareDataRequests,"data");return k&&S.size>0&&_.searchParams.set("_routes",o.filter(z=>S.has(z.route.id)).map(z=>z.route.id).join(",")),[_.pathname+_.search]},[h,f.v8_trailingSlashAwareDataRequests,x,u,m,j,o,s,g]),E=p.useMemo(()=>tj(y,m),[y,m]),U=oj(y);return p.createElement(p.Fragment,null,N.map(S=>p.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...c})),E.map(S=>p.createElement("link",{key:S,rel:"modulepreload",href:S,...c})),U.map(({key:S,link:k})=>p.createElement("link",{key:S,nonce:c.nonce,...k,crossOrigin:k.crossOrigin??c.crossOrigin})))}function dj(...s){return o=>{s.forEach(c=>{typeof c=="function"?c(o):c!=null&&(c.current=o)})}}var fj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fj&&(window.__reactRouterVersion="7.18.5")}catch{}function hj({basename:s,children:o,useTransitions:c,window:u}){let f=p.useRef();f.current==null&&(f.current=G0({window:u,v5Compat:!0}));let m=f.current,[g,h]=p.useState({action:m.action,location:m.location}),x=p.useCallback(b=>{c===!1?h(b):p.startTransition(()=>h(b))},[c]);return p.useLayoutEffect(()=>m.listen(x),[m,x]),p.createElement(G1,{basename:s,children:o,location:g.location,navigationType:g.action,navigator:m,useTransitions:c})}var yt=p.forwardRef(function({onClick:o,discover:c="render",prefetch:u="none",relative:f,reloadDocument:m,replace:g,mask:h,state:x,target:b,to:j,preventScrollReset:y,viewTransition:N,defaultShouldRevalidate:E,...U},S){let{basename:k,navigator:_,useTransitions:z}=p.useContext(zn),Q=typeof j=="string"&&Kd.test(j),A=Gg(j,k);j=A.to;let Y=w1(j,{relative:f}),ne=fn(),M=null;if(h){let xe=Jd(h,[],ne.mask?ne.mask.pathname:"/",!0);k!=="/"&&(xe.pathname=xe.pathname==="/"?k:Hn([k,xe.pathname])),M=_.createHref(xe)}let[L,X,Z]=ij(u,U),ae=pj(j,{replace:g,mask:h,state:x,target:b,preventScrollReset:y,relative:f,viewTransition:N,defaultShouldRevalidate:E,useTransitions:z});function H(xe){o&&o(xe),xe.defaultPrevented||ae(xe)}let W=!(A.isExternal||m),ve=p.createElement("a",{...U,...Z,href:(W?M:void 0)||A.absoluteURL||Y,onClick:W?H:o,ref:dj(S,X),target:b,"data-discover":!Q&&c==="render"?"true":void 0});return L&&!Q?p.createElement(p.Fragment,null,ve,p.createElement(rj,{page:Y})):ve});yt.displayName="Link";var ey=p.forwardRef(function({"aria-current":o="page",caseSensitive:c=!1,className:u="",end:f=!1,style:m,to:g,viewTransition:h,children:x,...b},j){let y=Gi(g,{relative:b.relative}),N=fn(),E=p.useContext(Uo),{navigator:U,basename:S}=p.useContext(zn),k=E!=null&&jj(y)&&h===!0,_=U.encodeLocation?U.encodeLocation(y).pathname:y.pathname,z=N.pathname,Q=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;c||(z=z.toLowerCase(),Q=Q?Q.toLowerCase():null,_=_.toLowerCase()),Q&&S&&(Q=ja(Q,S)||Q);const A=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let Y=z===_||!f&&z.startsWith(_)&&z.charAt(A)==="/",ne=Q!=null&&(Q===_||!f&&Q.startsWith(_)&&Q.charAt(_.length)==="/"),M={isActive:Y,isPending:ne,isTransitioning:k},L=Y?o:void 0,X;typeof u=="function"?X=u(M):X=[u,Y?"active":null,ne?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let Z=typeof m=="function"?m(M):m;return p.createElement(yt,{...b,"aria-current":L,className:X,ref:j,style:Z,to:g,viewTransition:h},typeof x=="function"?x(M):x)});ey.displayName="NavLink";var mj=p.forwardRef(({discover:s="render",fetcherKey:o,navigate:c,reloadDocument:u,replace:f,state:m,method:g=Co,action:h,onSubmit:x,relative:b,preventScrollReset:j,viewTransition:y,defaultShouldRevalidate:N,...E},U)=>{let{useTransitions:S}=p.useContext(zn),k=vj(),_=bj(h,{relative:b}),z=g.toLowerCase()==="get"?"get":"post",Q=typeof h=="string"&&Kd.test(h),A=Y=>{if(x&&x(Y),Y.defaultPrevented)return;Y.preventDefault();let ne=Y.nativeEvent.submitter,M=ne?.getAttribute("formmethod")||g,L=()=>k(ne||Y.currentTarget,{fetcherKey:o,method:M,navigate:c,replace:f,state:m,relative:b,preventScrollReset:j,viewTransition:y,defaultShouldRevalidate:N});S&&c!==!1?p.startTransition(()=>L()):L()};return p.createElement("form",{ref:U,method:z,action:_,onSubmit:u?x:A,...E,"data-discover":!Q&&s==="render"?"true":void 0})});mj.displayName="Form";function xj(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ty(s){let o=p.useContext(Es);return st(o,xj(s)),o}function pj(s,{target:o,replace:c,mask:u,state:f,preventScrollReset:m,relative:g,viewTransition:h,defaultShouldRevalidate:x,useTransitions:b}={}){let j=qi(),y=fn(),N=Gi(s,{relative:g});return p.useCallback(E=>{if(Q1(E,o)){E.preventDefault();let U=c!==void 0?c:Ns(y)===Ns(N),S=()=>j(s,{replace:U,mask:u,state:f,preventScrollReset:m,relative:g,viewTransition:h,defaultShouldRevalidate:x});b?p.startTransition(()=>S()):S()}},[y,j,N,c,u,f,o,s,m,g,h,x,b])}function qo(s){Tn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let o=p.useRef(Ld(s)),c=p.useRef(!1),u=fn(),f=p.useMemo(()=>K1(u.search,c.current?null:o.current),[u.search]),m=qi(),g=p.useCallback((h,x)=>{const b=Ld(typeof h=="function"?h(new URLSearchParams(f)):h);c.current=!0,m("?"+b,x)},[m,f]);return[f,g]}var gj=0,yj=()=>`__${String(++gj)}__`;function vj(){let{router:s}=ty("useSubmit"),{basename:o}=p.useContext(zn),c=L1(),u=s.fetch,f=s.navigate;return p.useCallback(async(m,g={})=>{let{action:h,method:x,encType:b,formData:j,body:y}=F1(m,o);if(g.navigate===!1){let N=g.fetcherKey||yj();await u(N,c,g.action||h,{defaultShouldRevalidate:g.defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:j,body:y,formMethod:g.method||x,formEncType:g.encType||b,flushSync:g.flushSync})}else await f(g.action||h,{defaultShouldRevalidate:g.defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:j,body:y,formMethod:g.method||x,formEncType:g.encType||b,replace:g.replace,state:g.state,fromRouteId:c,flushSync:g.flushSync,viewTransition:g.viewTransition})},[u,f,o,c])}function bj(s,{relative:o}={}){let{basename:c}=p.useContext(zn),u=p.useContext(Wn);st(u,"useFormAction must be used inside a RouteContext");let[f]=u.matches.slice(-1),m={...Gi(s||".",{relative:o})},g=fn();if(s==null){m.search=g.search;let h=new URLSearchParams(m.search),x=h.getAll("index");if(x.some(j=>j==="")){h.delete("index"),x.filter(y=>y).forEach(y=>h.append("index",y));let j=h.toString();m.search=j?`?${j}`:""}}return(!s||s===".")&&f.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),c!=="/"&&(m.pathname=m.pathname==="/"?c:Hn([c,m.pathname])),Ns(m)}function jj(s,{relative:o}={}){let c=p.useContext(Zg);st(c!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=ty("useViewTransitionState"),f=Gi(s,{relative:o});if(!c.isTransitioning)return!1;let m=ja(c.currentLocation.pathname,u)||c.currentLocation.pathname,g=ja(c.nextLocation.pathname,u)||c.nextLocation.pathname;return Ao(f.pathname,g)!=null||Ao(f.pathname,m)!=null}var Nj=Ag();const ny="ez-theme",ay=p.createContext(null);function wj(){try{const s=localStorage.getItem(ny);if(s==="light"||s==="dark")return s}catch{}return"dark"}function Sj({children:s}){const[o,c]=p.useState(wj);p.useEffect(()=>{document.documentElement.dataset.theme=o;try{localStorage.setItem(ny,o)}catch{}},[o]);const u=p.useCallback(()=>{c(m=>m==="dark"?"light":"dark")},[]),f=p.useMemo(()=>({theme:o,setTheme:c,toggleTheme:u}),[o,u]);return a.jsx(ay.Provider,{value:f,children:s})}function ly(){const s=p.useContext(ay);if(!s)throw new Error("useTheme must be used inside ThemeProvider");return s}/**
61
- * @license lucide-react v0.511.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const kj=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tj=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,c,u)=>u?u.toUpperCase():c.toLowerCase()),eg=s=>{const o=Tj(s);return o.charAt(0).toUpperCase()+o.slice(1)},sy=(...s)=>s.filter((o,c,u)=>!!o&&o.trim()!==""&&u.indexOf(o)===c).join(" ").trim(),Cj=s=>{for(const o in s)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/**
66
- * @license lucide-react v0.511.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */var Ej={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"};/**
71
- * @license lucide-react v0.511.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const zj=p.forwardRef(({color:s="currentColor",size:o=24,strokeWidth:c=2,absoluteStrokeWidth:u,className:f="",children:m,iconNode:g,...h},x)=>p.createElement("svg",{ref:x,...Ej,width:o,height:o,stroke:s,strokeWidth:u?Number(c)*24/Number(o):c,className:sy("lucide",f),...!m&&!Cj(h)&&{"aria-hidden":"true"},...h},[...g.map(([b,j])=>p.createElement(b,j)),...Array.isArray(m)?m:[m]]));/**
76
- * @license lucide-react v0.511.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const ue=(s,o)=>{const c=p.forwardRef(({className:u,...f},m)=>p.createElement(zj,{ref:m,iconNode:o,className:sy(`lucide-${kj(eg(s))}`,`lucide-${s}`,u),...f}));return c.displayName=eg(s),c};/**
81
- * @license lucide-react v0.511.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const Rj=[["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"}]],Do=ue("activity",Rj);/**
86
- * @license lucide-react v0.511.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const Aj=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Dj=ue("arrow-down",Aj);/**
91
- * @license lucide-react v0.511.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const _j=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Oj=ue("arrow-left",_j);/**
96
- * @license lucide-react v0.511.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const Mj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zs=ue("arrow-right",Mj);/**
101
- * @license lucide-react v0.511.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const Lj=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],Uj=ue("bell-off",Lj);/**
106
- * @license lucide-react v0.511.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const Hj=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],tg=ue("bell-ring",Hj);/**
111
- * @license lucide-react v0.511.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const Bj=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],nf=ue("bell",Bj);/**
116
- * @license lucide-react v0.511.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const qj=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],iy=ue("boxes",qj);/**
121
- * @license lucide-react v0.511.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const Gj=[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]],Yj=ue("cable",Gj);/**
126
- * @license lucide-react v0.511.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const $j=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ry=ue("check",$j);/**
131
- * @license lucide-react v0.511.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const Vj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Xj=ue("chevron-down",Vj);/**
136
- * @license lucide-react v0.511.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const Zj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qj=ue("chevron-right",Zj);/**
141
- * @license lucide-react v0.511.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const Kj=[["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"}]],Jj=ue("circle-alert",Kj);/**
146
- * @license lucide-react v0.511.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const Pj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Tl=ue("circle-check",Pj);/**
151
- * @license lucide-react v0.511.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const Fj=[["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"}]],Ud=ue("circle-x",Fj);/**
156
- * @license lucide-react v0.511.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const Ij=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Wj=ue("code-xml",Ij);/**
161
- * @license lucide-react v0.511.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const e2=[["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"}]],t2=ue("copy",e2);/**
166
- * @license lucide-react v0.511.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const n2=[["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"}]],Hd=ue("download",n2);/**
171
- * @license lucide-react v0.511.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const a2=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Cl=ue("earth",a2);/**
176
- * @license lucide-react v0.511.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const l2=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],s2=ue("eye-off",l2);/**
181
- * @license lucide-react v0.511.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const i2=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r2=ue("eye",i2);/**
186
- * @license lucide-react v0.511.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const o2=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],c2=ue("flask-conical",o2);/**
191
- * @license lucide-react v0.511.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const u2=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],d2=ue("folder-input",u2);/**
196
- * @license lucide-react v0.511.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const f2=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],h2=ue("gauge",f2);/**
201
- * @license lucide-react v0.511.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const m2=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],x2=ue("git-branch",m2);/**
206
- * @license lucide-react v0.511.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const p2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],g2=ue("history",p2);/**
211
- * @license lucide-react v0.511.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const y2=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],v2=ue("inbox",y2);/**
216
- * @license lucide-react v0.511.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const b2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],oy=ue("info",b2);/**
221
- * @license lucide-react v0.511.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const j2=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Yi=ue("key-round",j2);/**
226
- * @license lucide-react v0.511.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const N2=[["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"}]],w2=ue("layout-dashboard",N2);/**
231
- * @license lucide-react v0.511.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const S2=[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],k2=ue("link-2-off",S2);/**
236
- * @license lucide-react v0.511.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const T2=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],C2=ue("link-2",T2);/**
241
- * @license lucide-react v0.511.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const E2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Mi=ue("loader-circle",E2);/**
246
- * @license lucide-react v0.511.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const z2=[["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"}]],af=ue("lock",z2);/**
251
- * @license lucide-react v0.511.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const R2=[["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"}]],A2=ue("log-out",R2);/**
256
- * @license lucide-react v0.511.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const D2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],_2=ue("menu",D2);/**
261
- * @license lucide-react v0.511.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const O2=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],cy=ue("moon",O2);/**
266
- * @license lucide-react v0.511.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const M2=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],uy=ue("pause",M2);/**
271
- * @license lucide-react v0.511.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const L2=[["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"}]],lf=ue("pencil",L2);/**
276
- * @license lucide-react v0.511.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const U2=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Go=ue("play",U2);/**
281
- * @license lucide-react v0.511.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const H2=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],B2=ue("plug-zap",H2);/**
286
- * @license lucide-react v0.511.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const q2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Na=ue("plus",q2);/**
291
- * @license lucide-react v0.511.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const G2=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Y2=ue("power-off",G2);/**
296
- * @license lucide-react v0.511.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const $2=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],V2=ue("power",$2);/**
301
- * @license lucide-react v0.511.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const X2=[["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"}]],Ot=ue("refresh-cw",X2);/**
306
- * @license lucide-react v0.511.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const Z2=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Li=ue("rocket",Z2);/**
311
- * @license lucide-react v0.511.0 - ISC
312
- *
313
- * This source code is licensed under the ISC license.
314
- * See the LICENSE file in the root directory of this source tree.
315
- */const Q2=[["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"}]],K2=ue("rotate-ccw",Q2);/**
316
- * @license lucide-react v0.511.0 - ISC
317
- *
318
- * This source code is licensed under the ISC license.
319
- * See the LICENSE file in the root directory of this source tree.
320
- */const J2=[["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"}]],dy=ue("rotate-cw",J2);/**
321
- * @license lucide-react v0.511.0 - ISC
322
- *
323
- * This source code is licensed under the ISC license.
324
- * See the LICENSE file in the root directory of this source tree.
325
- */const P2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Bd=ue("save",P2);/**
326
- * @license lucide-react v0.511.0 - ISC
327
- *
328
- * This source code is licensed under the ISC license.
329
- * See the LICENSE file in the root directory of this source tree.
330
- */const F2=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],_o=ue("scroll-text",F2);/**
331
- * @license lucide-react v0.511.0 - ISC
332
- *
333
- * This source code is licensed under the ISC license.
334
- * See the LICENSE file in the root directory of this source tree.
335
- */const I2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],W2=ue("search",I2);/**
336
- * @license lucide-react v0.511.0 - ISC
337
- *
338
- * This source code is licensed under the ISC license.
339
- * See the LICENSE file in the root directory of this source tree.
340
- */const eN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fy=ue("send",eN);/**
341
- * @license lucide-react v0.511.0 - ISC
342
- *
343
- * This source code is licensed under the ISC license.
344
- * See the LICENSE file in the root directory of this source tree.
345
- */const tN=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],hy=ue("server-cog",tN);/**
346
- * @license lucide-react v0.511.0 - ISC
347
- *
348
- * This source code is licensed under the ISC license.
349
- * See the LICENSE file in the root directory of this source tree.
350
- */const nN=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],sf=ue("settings-2",nN);/**
351
- * @license lucide-react v0.511.0 - ISC
352
- *
353
- * This source code is licensed under the ISC license.
354
- * See the LICENSE file in the root directory of this source tree.
355
- */const aN=[["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"}]],Rs=ue("server",aN);/**
356
- * @license lucide-react v0.511.0 - ISC
357
- *
358
- * This source code is licensed under the ISC license.
359
- * See the LICENSE file in the root directory of this source tree.
360
- */const lN=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],sN=ue("settings",lN);/**
361
- * @license lucide-react v0.511.0 - ISC
362
- *
363
- * This source code is licensed under the ISC license.
364
- * See the LICENSE file in the root directory of this source tree.
365
- */const iN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],ka=ue("shield-alert",iN);/**
366
- * @license lucide-react v0.511.0 - ISC
367
- *
368
- * This source code is licensed under the ISC license.
369
- * See the LICENSE file in the root directory of this source tree.
370
- */const rN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wa=ue("shield-check",rN);/**
371
- * @license lucide-react v0.511.0 - ISC
372
- *
373
- * This source code is licensed under the ISC license.
374
- * See the LICENSE file in the root directory of this source tree.
375
- */const oN=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],cN=ue("shield-off",oN);/**
376
- * @license lucide-react v0.511.0 - ISC
377
- *
378
- * This source code is licensed under the ISC license.
379
- * See the LICENSE file in the root directory of this source tree.
380
- */const uN=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],my=ue("sparkles",uN);/**
381
- * @license lucide-react v0.511.0 - ISC
382
- *
383
- * This source code is licensed under the ISC license.
384
- * See the LICENSE file in the root directory of this source tree.
385
- */const dN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],xy=ue("square",dN);/**
386
- * @license lucide-react v0.511.0 - ISC
387
- *
388
- * This source code is licensed under the ISC license.
389
- * See the LICENSE file in the root directory of this source tree.
390
- */const fN=[["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"}]],py=ue("sun",fN);/**
391
- * @license lucide-react v0.511.0 - ISC
392
- *
393
- * This source code is licensed under the ISC license.
394
- * See the LICENSE file in the root directory of this source tree.
395
- */const hN=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],$i=ue("trash-2",hN);/**
396
- * @license lucide-react v0.511.0 - ISC
397
- *
398
- * This source code is licensed under the ISC license.
399
- * See the LICENSE file in the root directory of this source tree.
400
- */const mN=[["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"}]],Ui=ue("triangle-alert",mN);/**
401
- * @license lucide-react v0.511.0 - ISC
402
- *
403
- * This source code is licensed under the ISC license.
404
- * See the LICENSE file in the root directory of this source tree.
405
- */const xN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],pN=ue("undo-2",xN);/**
406
- * @license lucide-react v0.511.0 - ISC
407
- *
408
- * This source code is licensed under the ISC license.
409
- * See the LICENSE file in the root directory of this source tree.
410
- */const gN=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],yN=ue("unplug",gN);/**
411
- * @license lucide-react v0.511.0 - ISC
412
- *
413
- * This source code is licensed under the ISC license.
414
- * See the LICENSE file in the root directory of this source tree.
415
- */const vN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],bN=ue("upload",vN);/**
416
- * @license lucide-react v0.511.0 - ISC
417
- *
418
- * This source code is licensed under the ISC license.
419
- * See the LICENSE file in the root directory of this source tree.
420
- */const jN=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],NN=ue("wand-sparkles",jN);/**
421
- * @license lucide-react v0.511.0 - ISC
422
- *
423
- * This source code is licensed under the ISC license.
424
- * See the LICENSE file in the root directory of this source tree.
425
- */const wN=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Oo=ue("webhook",wN);/**
426
- * @license lucide-react v0.511.0 - ISC
427
- *
428
- * This source code is licensed under the ISC license.
429
- * See the LICENSE file in the root directory of this source tree.
430
- */const SN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vi=ue("x",SN);function ie(...s){return s.filter(Boolean).join(" ")}const gy=p.createContext(null),kN={success:{icon:Tl,iconClass:"text-ok"},error:{icon:Jj,iconClass:"text-bad"},warning:{icon:Ui,iconClass:"text-warn"},info:{icon:oy,iconClass:"text-info"}},TN=6e3;function CN({children:s}){const[o,c]=p.useState([]),u=p.useRef(new Map),f=h=>{const x=u.current.get(h);x&&clearTimeout(x),u.current.delete(h),c(b=>b.filter(j=>j.id!==h))},m=h=>{const x=crypto.randomUUID(),b={id:x,title:h.title,description:h.description,tone:h.tone??"info"};c(y=>{const N=[...y,b];return N.length>5?N.slice(N.length-5):N});const j=setTimeout(()=>f(x),h.durationMs??TN);return u.current.set(x,j),x},g=p.useMemo(()=>({push:m,dismiss:f,success:(h,x)=>m({title:h,description:x,tone:"success"}),error:(h,x)=>m({title:h,description:x,tone:"error"}),warning:(h,x)=>m({title:h,description:x,tone:"warning"}),info:(h,x)=>m({title:h,description:x,tone:"info"})}),[]);return p.useEffect(()=>{const h=u.current;return()=>{for(const x of h.values())clearTimeout(x);h.clear()}},[]),a.jsxs(gy.Provider,{value:g,children:[s,a.jsx("div",{className:"pointer-events-none fixed inset-x-3 bottom-3 z-[70] flex flex-col items-end gap-2 sm:inset-x-auto sm:right-4 sm:bottom-4 sm:w-[380px]","aria-live":"polite","aria-atomic":"false",children:o.map(h=>{const{icon:x,iconClass:b}=kN[h.tone];return a.jsxs("div",{role:h.tone==="error"?"alert":"status",className:"toast-enter pointer-events-auto flex w-full items-start gap-3 rounded-md border border-line bg-raised px-3.5 py-3 shadow-pop",children:[a.jsx(x,{className:ie("mt-0.5 size-4 shrink-0",b),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:h.title}),h.description&&a.jsx("div",{className:"mt-0.5 break-words text-xs text-muted",children:h.description})]}),a.jsx("button",{type:"button",onClick:()=>f(h.id),"aria-label":"Dismiss notification",className:"-mr-1 -mt-1 rounded-sm p-1 text-faint transition-colors hover:bg-inset hover:text-ink",children:a.jsx(Vi,{className:"size-3.5","aria-hidden":"true"})})]},h.id)})})]})}function Tt(){const s=p.useContext(gy);if(!s)throw new Error("useToast must be used inside ToastProvider");return s}const EN={primary:"bg-accent text-accent-ink border border-transparent hover:bg-accent-hover shadow-sm",secondary:"bg-raised text-ink border border-line hover:border-line-strong hover:bg-inset",ghost:"bg-transparent text-muted border border-transparent hover:text-ink hover:bg-inset",danger:"bg-bad text-white border border-transparent hover:opacity-90 shadow-sm",dangerGhost:"bg-bad-soft text-bad border border-transparent hover:border-bad/40 hover:bg-bad/15"},zN={sm:"h-8 px-3 text-xs gap-1.5 rounded-sm",md:"h-9 px-4 text-sm gap-2 rounded-md",lg:"h-10 px-5 text-sm gap-2 rounded-md"};function ba(s="secondary",o="md",c){return ie("inline-flex select-none items-center justify-center whitespace-nowrap font-medium transition-colors duration-[var(--ez-motion-fast)] disabled:pointer-events-none disabled:opacity-50",EN[s],zN[o],c)}const te=p.forwardRef(function({variant:o="secondary",size:c="md",loading:u=!1,icon:f,className:m,children:g,disabled:h,...x},b){return a.jsxs("button",{ref:b,type:"button",className:ba(o,c,m),disabled:h||u,"aria-busy":u||void 0,...x,children:[u?a.jsx(Mi,{className:"spin size-4","aria-hidden":"true"}):f,g]})}),ft=p.forwardRef(function({label:o,variant:c="ghost",size:u="md",className:f,children:m,...g},h){return a.jsx("button",{ref:h,type:"button","aria-label":o,title:o,className:ba(c,u==="sm"?"sm":"md",ie("!px-0",u==="sm"?"size-8":"size-9",f)),...g,children:m})}),RN={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-4xl"},AN='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Cn({open:s,onClose:o,title:c,description:u,children:f,footer:m,size:g="md",preventClose:h=!1,bodyClassName:x}){const b=p.useId(),j=p.useId(),y=p.useRef(null),N=p.useRef(null),E=p.useRef(o);E.current=o;const U=p.useRef(h);return U.current=h,p.useEffect(()=>{if(!s)return;N.current=document.activeElement;const S=document.body.style.overflow;document.body.style.overflow="hidden";const k=window.setTimeout(()=>{const z=y.current;if(!z)return;(z.querySelector("[data-autofocus]")??z).focus()},0),_=z=>{if(z.key==="Escape"&&!U.current){z.stopPropagation(),E.current();return}if(z.key!=="Tab")return;const Q=y.current;if(!Q)return;const A=Array.from(Q.querySelectorAll(AN)).filter(L=>L.offsetParent!==null);if(A.length===0){z.preventDefault(),Q.focus();return}const Y=A[0],ne=A[A.length-1],M=document.activeElement;z.shiftKey&&(M===Y||M===Q)?(z.preventDefault(),ne.focus()):!z.shiftKey&&M===ne&&(z.preventDefault(),Y.focus())};return document.addEventListener("keydown",_,!0),()=>{window.clearTimeout(k),document.removeEventListener("keydown",_,!0),document.body.style.overflow=S,N.current?.focus()}},[s]),s?Nj.createPortal(a.jsx("div",{className:"fade-enter fixed inset-0 z-[60] flex items-end justify-center bg-[var(--ez-overlay)] p-0 backdrop-blur-[2px] sm:items-center sm:p-6",onMouseDown:S=>{S.target===S.currentTarget&&!h&&o()},children:a.jsxs("div",{ref:y,role:"dialog","aria-modal":"true","aria-labelledby":b,"aria-describedby":u?j:void 0,tabIndex:-1,className:ie("panel-enter flex max-h-[92vh] w-full flex-col overflow-hidden rounded-t-xl border border-line bg-surface shadow-pop outline-none sm:rounded-xl",RN[g]),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-5 py-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{id:b,className:"text-base font-semibold text-ink",children:c}),u&&a.jsx("p",{id:j,className:"mt-1 text-sm text-muted",children:u})]}),a.jsx(ft,{label:"Close",size:"sm",onClick:o,disabled:h,className:"-mr-1 -mt-1",children:a.jsx(Vi,{className:"size-4","aria-hidden":"true"})})]}),f&&a.jsx("div",{className:ie("min-h-0 flex-1 overflow-y-auto px-5 py-4",x),children:f}),m&&a.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line bg-raised/40 px-5 py-3",children:m})]})}),document.body):null}class Be extends Error{status;payload;constructor(o,c,u){super(u??DN(o,c)),this.name="ApiError",this.status=o,this.payload=c}get code(){const{error:o}=this.payload;if(typeof o=="string")return o;if(o&&typeof o=="object")return o.step}get blockedReason(){return this.status!==403?null:this.payload.reason??null}}function DN(s,o){const{error:c}=o;return typeof c=="string"&&c&&c!=="Forbidden"?c:c&&typeof c=="object"?c.cause||c.consequence||"The request failed.":s===403?"Request blocked by the dashboard.":s===401?"Your session ended. Please sign in again.":s===0?"Cannot reach the dashboard.":`Request failed (HTTP ${s}).`}function _N(s){if(s instanceof Be)return s;const o=s instanceof Error?s.message:"Something went wrong.";return new Be(0,{error:o})}function bt(s,o=[],c={}){const u=c.enabled??!0,f=p.useRef(s);f.current=s;const[m,g]=p.useState(0),[h,x]=p.useState({data:null,error:null,loading:u});p.useEffect(()=>{if(!u){x({data:null,error:null,loading:!1});return}const y=new AbortController;return x(N=>({...N,loading:!0,error:null})),f.current(y.signal).then(N=>{y.signal.aborted||x({data:N,error:null,loading:!1})}).catch(N=>{y.signal.aborted||N?.name!=="AbortError"&&x(E=>({...E,error:_N(N),loading:!1}))}),()=>y.abort()},[...o,u,m]);const b=p.useCallback(()=>g(y=>y+1),[]),j=p.useCallback(y=>{x(N=>({...N,data:typeof y=="function"?y(N.data):y}))},[]);return{data:h.data,error:h.error,loading:h.loading,reload:b,setData:j}}function Ss(s,o,c=!0){const u=p.useRef(s);u.current=s,p.useEffect(()=>{if(!c)return;const f=setInterval(()=>u.current(),o);return()=>clearInterval(f)},[o,c])}function zl(s){const o=p.useRef(s);o.current=s,p.useEffect(()=>{const c=()=>{document.visibilityState==="visible"&&o.current()};return document.addEventListener("visibilitychange",c),()=>document.removeEventListener("visibilitychange",c)},[])}function Bn(s){p.useEffect(()=>{document.title=s?`${s} · Easy DevOps`:"Easy DevOps"},[s])}let qd=null;function ng(s){qd=s}function hn(){return p.useCallback(s=>qd?qd(s):Promise.resolve(!1),[])}function ON({children:s}){const[o,c]=p.useState(null),u=p.useRef(null),f=p.useCallback(h=>(u.current?.resolve(!1),new Promise(x=>{u.current={resolve:x},c(h)})),[]);p.useEffect(()=>(ng(f),()=>ng(null)),[f]);const m=p.useCallback(h=>{c(null);const x=u.current;u.current=null,x?.resolve(h)},[]),g=o?.tone==="danger";return a.jsxs(a.Fragment,{children:[s,a.jsx(Cn,{open:o!==null,onClose:()=>m(!1),title:o?.title??"",size:"sm",bodyClassName:"px-5 py-4",footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"ghost",onClick:()=>m(!1),"data-autofocus":!0,children:o?.cancelLabel??"Cancel"}),a.jsx(te,{variant:g?"danger":"primary",onClick:()=>m(!0),children:o?.confirmLabel??"Confirm"})]}),children:a.jsx("div",{className:"text-sm text-muted",children:o?.body})})]})}const MN="modulepreload",LN=function(s,o){return new URL(s,o).href},ag={},UN=function(o,c,u){let f=Promise.resolve();if(c&&c.length>0){let g=function(j){return Promise.all(j.map(y=>Promise.resolve(y).then(N=>({status:"fulfilled",value:N}),N=>({status:"rejected",reason:N}))))};const h=document.getElementsByTagName("link"),x=document.querySelector("meta[property=csp-nonce]"),b=x?.nonce||x?.getAttribute("nonce");f=g(c.map(j=>{if(j=LN(j,u),j in ag)return;ag[j]=!0;const y=j.endsWith(".css"),N=y?'[rel="stylesheet"]':"";if(!!u)for(let S=h.length-1;S>=0;S--){const k=h[S];if(k.href===j&&(!y||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${j}"]${N}`))return;const U=document.createElement("link");if(U.rel=y?"stylesheet":MN,y||(U.as="script"),U.crossOrigin="",U.href=j,b&&U.setAttribute("nonce",b),document.head.appendChild(U),y)return new Promise((S,k)=>{U.addEventListener("load",S),U.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${j}`)))})}))}function m(g){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=g,window.dispatchEvent(h),!h.defaultPrevented)throw g}return f.then(g=>{for(const h of g||[])h.status==="rejected"&&m(h.reason);return o().catch(m)})},HN="/api",BN=new Set(["POST","PUT","PATCH","DELETE"]),qN=!1,GN="Your session ended. Please sign in again.",Gd=new Set,Yd=new Set;function YN(s){return Gd.add(s),()=>Gd.delete(s)}function $N(s){return Yd.add(s),()=>Yd.delete(s)}function VN(s){if(!s)return"";const o=new URLSearchParams;for(const[u,f]of Object.entries(s))f!=null&&o.set(u,String(f));const c=o.toString();return c?`?${c}`:""}async function XN(s){const o=await s.text();if(!o)return{};try{const c=JSON.parse(o);return c&&typeof c=="object"?c:{error:String(c)}}catch{return{error:o.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,240)}}}async function he(s,o={}){const c=o.method??"GET",u={Accept:"application/json"};let f;o.body!==void 0&&(u["Content-Type"]="application/json",f=JSON.stringify(o.body)),BN.has(c)&&(u["X-EZ-Request"]="1");let m;try{m=await fetch(`${HN}${s}${VN(o.query)}`,{method:c,headers:u,body:f,credentials:"same-origin",signal:o.signal})}catch(h){throw h?.name==="AbortError"?h:new Be(0,{error:"Cannot reach the dashboard."})}if(m.status===204)return;if(!m.ok){const h=await XN(m),x=new Be(m.status,h);if(!o.skipAuthEvents){if(m.status===401)for(const b of Gd)b(GN);else if(m.status===403)for(const b of Yd)b(x)}throw x}const g=await m.text();if(g)return JSON.parse(g)}function Je(s){return encodeURIComponent(s)}const re={auth:{status:s=>he("/auth",{signal:s}),login:s=>he("/login",{method:"POST",body:{password:s},skipAuthEvents:!0}),setup:s=>he("/setup",{method:"POST",body:s,skipAuthEvents:!0}),logout:()=>he("/logout",{method:"POST"})},domains:{list:s=>he("/domains",{signal:s}),create:s=>he("/domains",{method:"POST",body:s}),update:(s,o)=>he(`/domains/${Je(s)}`,{method:"PUT",body:o}),remove:(s,o)=>he(`/domains/${Je(s)}`,{method:"DELETE",query:{deleteCert:o}}),toggle:s=>he(`/domains/${Je(s)}/toggle`,{method:"PUT"}),reload:s=>he(`/domains/${Je(s)}/reload`,{method:"POST"}),notifications:(s,o)=>he(`/domains/${Je(s)}/notifications`,{signal:o}),saveNotifications:(s,o)=>he(`/domains/${Je(s)}/notifications`,{method:"PUT",body:o})},ssl:{list:s=>he("/ssl",{signal:s}),create:s=>he("/ssl/create",{method:"POST",body:s}),confirmDns:s=>he("/ssl/create-confirm",{method:"POST",body:{domain:s}}),cancelDns:s=>he("/ssl/create-cancel",{method:"POST",body:{domain:s}}),renew:s=>he(`/ssl/renew/${Je(s)}`,{method:"POST"}),renewAll:()=>he("/ssl/renew-all",{method:"POST"})},nginx:{status:s=>he("/nginx/status",{signal:s}),reload:()=>he("/nginx/reload",{method:"POST"}),restart:()=>he("/nginx/restart",{method:"POST"}),start:()=>he("/nginx/start",{method:"POST"}),stop:()=>he("/nginx/stop",{method:"POST"}),test:()=>he("/nginx/test",{method:"POST"}),configs:s=>he("/nginx/configs",{signal:s}),getConfig:(s,o)=>he(`/nginx/config/${Je(s)}`,{signal:o}),saveConfig:(s,o)=>he(`/nginx/config/${Je(s)}`,{method:"POST",body:{content:o}}),logs:s=>he("/nginx/logs",{signal:s})},processes:{list:s=>he("/processes",{signal:s}),action:(s,o)=>he(`/processes/${Je(s)}/${o}`,{method:"POST"}),logs:(s,o=200,c)=>he(`/processes/${Je(s)}/logs`,{signal:c,query:{lines:o}})},deployments:{list:s=>he("/deployments",{signal:s}),get:(s,o)=>he(`/deployments/${Je(s)}`,{signal:o}),create:s=>he("/deployments",{method:"POST",body:s}),update:(s,o)=>he(`/deployments/${Je(s)}`,{method:"PUT",body:o}),remove:(s,o=!1)=>he(`/deployments/${Je(s)}`,{method:"DELETE",query:o?{deleteDomain:1}:void 0}),linkDomain:(s,o,c=!1)=>he(`/deployments/${Je(s)}/domain`,{method:"PUT",body:{domain:o,ssl:c}}),unlinkDomain:s=>he(`/deployments/${Je(s)}/domain`,{method:"DELETE"}),move:(s,o)=>he(`/deployments/${Je(s)}/move`,{method:"POST",body:{path:o}}),deploy:(s,o)=>he(`/deployments/${Je(s)}/deploy`,{method:"POST",body:o?{ref:o}:{}}),rollback:(s,o)=>he(`/deployments/${Je(s)}/rollback`,{method:"POST",body:o?{releaseId:o}:{}}),run:(s,o,c)=>he(`/deployments/${Je(s)}/runs/${Je(o)}`,{signal:c}),issueHookToken:s=>he(`/deployments/${Je(s)}/hook-token`,{method:"POST"}),revokeHookToken:s=>he(`/deployments/${Je(s)}/hook-token`,{method:"DELETE"}),generateDeployKey:s=>he(`/deployments/${Je(s)}/deploy-key`,{method:"POST"}),github:(s,o)=>he(`/deployments/${Je(s)}/github`,{signal:o}),applyGithub:(s,o)=>he(`/deployments/${Je(s)}/github/apply`,{method:"POST",body:o}),hook:s=>he("/deployments/hook",{signal:s}),updateHook:s=>he("/deployments/hook",{method:"PUT",body:s})},service:{status:s=>he("/service",{signal:s}),start:()=>he("/service/start",{method:"POST"}),stop:()=>he("/service/stop",{method:"POST"}),restart:()=>he("/service/restart",{method:"POST"})},settings:{get:s=>he("/settings",{signal:s}),update:s=>he("/settings",{method:"POST",body:s}),permissions:s=>he("/settings/permissions",{signal:s}),setupPermissions:s=>he("/settings/permissions/setup",{method:"POST",body:{password:s},skipAuthEvents:!0}),backup:s=>he("/settings/backup",{signal:s}),restore:s=>he("/settings/restore",{method:"POST",body:s}),channels:{list:s=>he("/settings/channels",{signal:s}),create:s=>he("/settings/channels",{method:"POST",body:s}),update:(s,o)=>he(`/settings/channels/${Je(s)}`,{method:"PUT",body:o}),remove:s=>he(`/settings/channels/${Je(s)}`,{method:"DELETE"}),test:s=>he(`/settings/channels/${Je(s)}/test`,{method:"POST"})}},hub:{status:s=>he("/hub/status",{signal:s}),connect:s=>he("/hub/connect",{method:"POST",body:{connectionString:s}}),unlink:()=>he("/hub/link",{method:"DELETE"}),updatePermissions:s=>he("/hub/permissions",{method:"PUT",body:s})}},yy=p.createContext(null);function ZN(s){if(s instanceof Be)return s;const o=s instanceof Error?s.message:"Cannot reach the dashboard.";return new Be(0,{error:o})}function QN({children:s}){const[o,c]=p.useState("loading"),[u,f]=p.useState(null),[m,g]=p.useState(null),[h,x]=p.useState(null),[b,j]=p.useState(null),y=p.useRef("loading");y.current=o;const N=p.useCallback(Y=>{f(Y),g(null),c(Y.authenticated?"authenticated":"unauthenticated")},[]),E=p.useCallback(async()=>{c("loading");try{N(await re.auth.status())}catch(Y){g(ZN(Y)),c("error")}},[N]);p.useEffect(()=>{E()},[E]);const U=p.useCallback(Y=>{x(Y??"Your session ended. Please sign in again."),j(null),f(ne=>ne&&{...ne,authenticated:!1}),c("unauthenticated")},[]);p.useEffect(()=>{const Y=YN(M=>{y.current==="authenticated"&&U(M)}),ne=$N(M=>j(M));return()=>{Y(),ne()}},[U]);const S=p.useCallback(async()=>{try{N(await re.auth.status())}catch{f(Y=>Y&&{...Y,authenticated:!0}),c("authenticated")}x(null),j(null)},[N]),k=p.useCallback(async Y=>{await re.auth.login(Y),await S()},[S]),_=p.useCallback(async Y=>{await re.auth.setup(Y),await S()},[S]),z=p.useCallback(async()=>{try{await re.auth.logout()}catch{}f(Y=>Y&&{...Y,authenticated:!1}),x(null),j(null),c("unauthenticated")},[]),Q=p.useCallback(()=>j(null),[]),A=p.useMemo(()=>({phase:o,auth:u,bootError:m,sessionMessage:h,blocked:b,login:k,setup:_,logout:z,retryBoot:E,dismissBlocked:Q,reportUnauthorized:U}),[o,u,m,h,b,k,_,z,E,Q,U]);return a.jsx(yy.Provider,{value:A,children:s})}function qn(){const s=p.useContext(yy);if(!s)throw new Error("useAuth must be used inside AuthProvider");return s}const lg=50,vy=p.createContext(null);function KN({children:s}){const{phase:o,reportUnauthorized:c}=qn(),u=o==="authenticated",[f,m]=p.useState(null),[g,h]=p.useState(!1),[x,b]=p.useState(null),[j,y]=p.useState(null),[N,E]=p.useState(null),[U,S]=p.useState([]),[k,_]=p.useState(0),[z,Q]=p.useState(null),[A,Y]=p.useState(0),ne=p.useCallback(()=>_(0),[]),M=p.useCallback(()=>{S([]),_(0)},[]);p.useEffect(()=>{if(!u){m(null),h(!1),b(null),y(null),E(null),S([]),_(0),Q(null);return}let X=!1,Z=null;const ae=()=>{h(!0),b(null)},H=()=>h(!1),W=$=>{h(!1);const le=$.data;if($.message==="UNAUTHORIZED"||le?.reason==="unauthorized"){c();return}if($.message==="FORBIDDEN"||le?.reason){b(le?.detail??"Live updates were blocked by the dashboard.");return}b("Live updates are unavailable. Data still refreshes on the page.")},ve=$=>y($),xe=$=>E($),ee=$=>{S(le=>{const ke=le.filter(Ie=>Ie.id!==$.id),Te=[$,...ke];return Te.length>lg?Te.slice(0,lg):Te}),_(le=>Math.min(le+1,99))},oe=$=>{Q($),Y(le=>le+1)};return(async()=>{try{if(!qN){const{createRealtimeClient:$}=await UN(async()=>{const{createRealtimeClient:le}=await import("./socket-DwLPrgsr.js");return{createRealtimeClient:le}},[],import.meta.url);Z=$()}if(X){Z.disconnect();return}Z.on("connect",ae),Z.on("disconnect",H),Z.on("connect_error",W),Z.on("nginx:status",ve),Z.on("domain:health",xe),Z.on("notification:new",ee),Z.on("local:changed",oe),m(Z),Z.connect()}catch{X||b("Could not start the live connection.")}})(),()=>{X=!0,Z&&(Z.off("connect",ae),Z.off("disconnect",H),Z.off("connect_error",W),Z.off("nginx:status",ve),Z.off("domain:health",xe),Z.off("notification:new",ee),Z.off("local:changed",oe),Z.disconnect()),h(!1)}},[u,c]);const L=p.useMemo(()=>({client:f,connected:g,connectionError:x,nginxStatus:j,domainHealth:N,notifications:U,unread:k,markAllRead:ne,clearNotifications:M,lastChange:z,changeSeq:A}),[f,g,x,j,N,U,k,ne,M,z,A]);return a.jsx(vy.Provider,{value:L,children:s})}function ea(){const s=p.useContext(vy);if(!s)throw new Error("useRealtime must be used inside RealtimeProvider");return s}const by=p.createContext(null);function JN({children:s}){const{phase:o}=qn(),c=o==="authenticated",{client:u,connected:f}=ea(),m=bt(k=>re.service.status(k),[c],{enabled:c}),{setData:g,reload:h}=m;Ss(h,6e4,c);const x=p.useCallback(k=>{g(_=>_&&{..._,backgroundService:{..._.backgroundService,...k}})},[g]),b=p.useRef(null),j=p.useRef(!1),y=p.useRef(!1);y.current=m.loading;const N=p.useCallback(()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{if(b.current=null,y.current){j.current=!0;return}h()},250)},[h]);p.useEffect(()=>{!m.loading&&j.current&&(j.current=!1,h())},[m.loading,h]),p.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),p.useEffect(()=>{if(!c||!u)return;const k=_=>{x(_),N()};return u.on("service:changed",k),()=>u.off("service:changed",k)},[c,u,x,N]);const E=p.useRef(!1),U=p.useRef(!1);p.useEffect(()=>{if(!c){E.current=!1,U.current=!1;return}f&&!E.current&&(U.current&&N(),U.current=!0),E.current=f},[c,f,N]);const S=p.useMemo(()=>({service:m.data,loading:m.loading,error:m.error,reload:m.reload,applyBackgroundService:x}),[m.data,m.loading,m.error,m.reload,x]);return a.jsx(by.Provider,{value:S,children:s})}function Xi(){const s=p.useContext(by);if(!s)throw new Error("useService must be used inside ServiceProvider");return s}const jy=[{label:"Manage",items:[{to:"/",label:"Overview",title:"Overview",description:"The state of nginx, your domains and their certificates at a glance.",icon:w2},{to:"/domains",label:"Domains",title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",icon:Cl},{to:"/ssl",label:"SSL certificates",title:"SSL certificates",description:"Issue and renew Let’s Encrypt certificates for your domains.",icon:wa},{to:"/nginx",label:"Nginx",title:"Nginx",description:"Service status, configuration files and live logs.",icon:Rs},{to:"/deployments",label:"Deployments",title:"Deployments",description:"Put a project from a git repository on this server and keep it deployed.",icon:Li}]},{label:"Monitor",items:[{to:"/notifications",label:"Notifications",title:"Notifications",description:"Delivery channels, test messages and recent events.",icon:nf},{to:"/processes",label:"Processes",title:"Processes",description:"The Easy DevOps background service and your own PM2 apps.",icon:iy},{to:"/logs",label:"Logs",title:"Logs",description:"nginx access and error output as it is written.",icon:_o}]},{label:"System",items:[{to:"/settings",label:"Settings",title:"Settings",description:"Access, authentication, Hub pairing and backup.",icon:sN}]}],PN=jy.flatMap(s=>s.items);function Ny(s){return PN.find(o=>o.to==="/"?s==="/":s===o.to||s.startsWith(`${o.to}/`))}function wy({className:s}){return a.jsxs("span",{className:ie("inline-flex shrink-0 items-center",s),"aria-hidden":"true",children:[a.jsx("img",{src:"/brand/mark-dark.png",alt:"",className:"brand-logo-dark h-full w-auto"}),a.jsx("img",{src:"/brand/mark-light.png",alt:"",className:"brand-logo-light h-full w-auto"})]})}const FN=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",year:"numeric"}),IN=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"});function Sy(s){if(s==null||s==="")return"—";const o=typeof s=="number"?new Date(s):new Date(s);return Number.isNaN(o.getTime())?"—":FN.format(o)}function rf(s){if(s==null||s==="")return"—";const o=typeof s=="number"?new Date(s):new Date(s);return Number.isNaN(o.getTime())?"—":IN.format(o)}function Zi(s){const o=Math.max(0,Math.round((Date.now()-s)/1e3));if(o<10)return"just now";if(o<60)return`${o}s ago`;const c=Math.floor(o/60);if(c<60)return`${c}m ago`;const u=Math.floor(c/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}function ky(s){if(s==null)return"—";if(s<1024)return`${s} B`;const o=["KB","MB","GB","TB"];let c=s/1024,u=0;for(;c>=1024&&u<o.length-1;)c/=1024,u+=1;return`${c.toFixed(c<10?1:0)} ${o[u]}`}function of(s){if(s==null||s<0)return"—";const o=Math.floor(s/6e4);if(o<1)return"<1m";if(o<60)return`${o}m`;const c=Math.floor(o/60);return c<24?`${c}h ${o%60}m`:`${Math.floor(c/24)}d ${c%24}h`}function ks(s){return s===null?"Unknown":s<0?`Expired ${Math.abs(s)} day${Math.abs(s)===1?"":"s"} ago`:s===0?"Expires today":`${s} day${s===1?"":"s"} left`}function WN(s){return s==null?"—":`${s.toFixed(1)}%`}function kn(s,o,c=`${o}s`){return`${s} ${s===1?o:c}`}function ew(s,o=48){if(s.length<=o)return s;const c=Math.ceil((o-1)/2),u=Math.floor((o-1)/2);return`${s.slice(0,c)}…${s.slice(-u)}`}const tw={personal:"Personal","windows-service":"Windows service",systemd:"systemd",unknown:"Unknown"},nw={personal:"Startup supervisor · runs as you, starts at logon","windows-service":"WinSW service · NT SERVICE\\EasyDevOps",systemd:"systemd unit · starts at boot",unknown:"Not reported by this API"},aw={personal:"No administrator needed — run it in a normal PowerShell. Personal mode starts at logon and stops when you sign out.","windows-service":"Run it in an Administrator PowerShell. It creates a Windows service that runs as NT SERVICE\\EasyDevOps and never asks for an account password.",systemd:"Run it once with sudo; the unit then starts at boot.",unknown:"Run it in a terminal with the rights your platform requires."};function lw(s){switch(s.backgroundService.mechanism){case"startup-supervisor":return"personal";case"winsw":return"windows-service";case"systemd":return"systemd";default:return"unknown"}}function sw(s){return s==="logon"?"At logon":s==="boot"?"At boot":"Unknown"}function iw(s){return s.jobsRunningHere?"This dashboard":s.jobsOwnerRole==="daemon"?"Background service":s.jobsOwnerRole==="dashboard"?"Another dashboard process":s.running?"Background service":"Paused — no owner"}function Qi(s){if(!s)return null;const o=s.backgroundService,c=lw(s),u=o.startsAt==="logon"||o.startsAt==="boot"?o.startsAt:"unknown",f=o.runtime??null,m=o.stoppedAt??null,g=Array.from(new Set([...o.warnings??[],...f?.warnings??[]]));return{running:o.running,connected:o.connected,jobsRunningHere:o.jobsRunningHere,jobsOwnerLabel:iw(o),pid:o.pid,version:o.version,startedAt:o.startedAt,uptimeMs:o.startedAt?Math.max(0,Date.now()-o.startedAt):null,heartbeatAgeMs:o.heartbeatAgeMs??null,mechanism:c,mechanismLabel:tw[c],mechanismDetail:nw[c],startsAt:u,startsAtLabel:sw(u),installed:o.installed===!0,stoppedByUser:o.stoppedByUser===!0,stoppedAt:m,stoppedAtLabel:m?rf(m):null,state:o.state??null,detail:o.detail??null,enabledOnBoot:o.enabledOnBoot??null,restarts:o.restarts??0,crashLooping:o.crashLooping===!0,dataDir:o.dataDir,installCommand:s.install.command,installGuidance:aw[c],runtime:f,warnings:g}}function Mo(s){return s?s.running?"Running":s.stoppedByUser?"Stopped by you":s.installed?"Not running":"Not installed":"Unknown"}function rw(s){if(!s)return null;const o=s.pinned,c=o?.version??null,u=s.systemNode.version??null,f=!!(o&&o.kind!=="none"&&o.exists!==!1),m=f&&!!(c&&u)&&c===u&&!o?.differsFromSystem;return{serviceVersion:c,servicePath:o?.path??null,systemVersion:u,systemPath:s.systemNode.path??null,sameAsSystem:m,broken:o?.broken===!0,pinned:f,kind:o?.kind??null,manager:s.manager?.managed?s.manager.manager??null:null}}const ow={neutral:"bg-inset text-muted",accent:"bg-accent-soft text-accent-text",ok:"bg-ok-soft text-ok",warn:"bg-warn-soft text-warn",bad:"bg-bad-soft text-bad",info:"bg-info-soft text-info"},Ty={neutral:"bg-faint",accent:"bg-accent",ok:"bg-ok",warn:"bg-warn",bad:"bg-bad",info:"bg-info"};function je({tone:s="neutral",children:o,className:c,dot:u=!1}){return a.jsxs("span",{className:ie("inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-2xs font-medium tracking-wide",ow[s],c),children:[u&&a.jsx("span",{className:ie("size-1.5 rounded-full",Ty[s]),"aria-hidden":"true"}),o]})}function Ft({tone:s="ok",pulse:o=!1,className:c}){return a.jsx("span",{className:ie("inline-block size-2 shrink-0 rounded-full",Ty[s],o&&"live-dot",c),"aria-hidden":"true"})}const cw='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function sg({onNavigate:s}){const{service:o}=Xi(),c=Qi(o),u=c?c.running?{tone:"ok",label:"Service running"}:c.stoppedByUser?{tone:"warn",label:"Service stopped by you"}:{tone:"warn",label:"Service stopped"}:{tone:"neutral",label:"Checking service…"};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ie("flex h-[var(--ez-topbar-height)] shrink-0 items-center gap-2.5 border-b border-line px-4",s&&"pr-12"),children:[a.jsx(wy,{className:"h-5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate text-sm font-semibold tracking-tight text-ink",children:"Easy DevOps"}),a.jsx("div",{className:"text-2xs text-faint",children:"Server control plane"})]})]}),a.jsx("nav",{"aria-label":"Main navigation",className:"flex-1 overflow-y-auto px-3 py-4",children:jy.map((f,m)=>a.jsxs("div",{className:ie(m>0&&"mt-5"),children:[a.jsx("div",{className:"mb-1.5 px-2 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:f.label}),a.jsx("div",{className:"space-y-0.5",children:f.items.map(g=>{const h=g.icon;return a.jsx(ey,{to:g.to,end:g.to==="/",onClick:s,className:({isActive:x})=>ie("group relative flex items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-colors duration-[var(--ez-motion-fast)]",x?"bg-accent-soft text-ink":"text-muted hover:bg-inset hover:text-ink"),children:({isActive:x})=>a.jsxs(a.Fragment,{children:[a.jsx("span",{className:ie("absolute left-0 top-1/2 h-4 w-0.5 -translate-y-1/2 rounded-pill bg-accent transition-opacity duration-[var(--ez-motion-fast)]",x?"opacity-100":"opacity-0"),"aria-hidden":"true"}),a.jsx(h,{className:ie("size-4 shrink-0 transition-colors",x?"text-accent-text":"text-faint group-hover:text-muted"),"aria-hidden":"true"}),g.label]})},g.to)})})]},f.label))}),a.jsx("div",{className:"border-t border-line p-3",children:a.jsxs(yt,{to:"/processes",onClick:s,className:"flex items-center gap-2.5 rounded-md border border-line bg-raised/60 px-2.5 py-2 transition-colors hover:border-line-strong hover:bg-inset","aria-label":`Background service: ${u.label}. Open Processes.`,children:[a.jsx(Ft,{tone:u.tone,pulse:u.tone==="ok"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-2xs font-medium text-ink",children:"Background service"}),a.jsx("div",{className:"truncate text-2xs text-faint",children:u.label})]})]})})]})}function uw({open:s,onClose:o}){const c=p.useRef(null),u=p.useRef(null);return p.useEffect(()=>{if(!s)return;const f=document.activeElement,m=document.body.style.overflow;document.body.style.overflow="hidden";const g=window.setTimeout(()=>u.current?.focus(),0),h=x=>{if(x.key==="Escape"){x.preventDefault(),o();return}if(x.key!=="Tab")return;const b=c.current;if(!b)return;const j=Array.from(b.querySelectorAll(cw)).filter(U=>U.offsetParent!==null);if(j.length===0)return;const y=j[0],N=j[j.length-1],E=document.activeElement;x.shiftKey&&(E===y||E===b)?(x.preventDefault(),N.focus()):!x.shiftKey&&E===N&&(x.preventDefault(),y.focus())};return document.addEventListener("keydown",h,!0),()=>{window.clearTimeout(g),document.removeEventListener("keydown",h,!0),document.body.style.overflow=m,f?.focus()}},[s,o]),a.jsxs(a.Fragment,{children:[a.jsx("aside",{className:"hidden w-[var(--ez-sidebar-width)] shrink-0 flex-col border-r border-line bg-surface lg:flex",children:a.jsx(sg,{})}),s&&a.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",children:[a.jsx("div",{className:"fade-enter absolute inset-0 bg-[var(--ez-overlay)] backdrop-blur-[1px]",onClick:o,"aria-hidden":"true"}),a.jsxs("aside",{ref:c,role:"dialog","aria-modal":"true","aria-label":"Main navigation",tabIndex:-1,className:"drawer-enter absolute inset-y-0 left-0 flex w-[276px] flex-col border-r border-line bg-surface shadow-pop outline-none",children:[a.jsx(ft,{ref:u,label:"Close navigation",size:"sm",onClick:o,className:"absolute right-2 top-2 z-10",children:a.jsx(Vi,{className:"size-4","aria-hidden":"true"})}),a.jsx(sg,{onNavigate:o})]})]})]})}function dw(s){return s.type==="nginx_down"?Rs:s.type==="cert_expiry"?ka:s.type==="domain_health"?Do:s.type==="deploy"?Li:my}function fw(s){return s==="danger"?"text-bad":s==="warning"?"text-warn":s==="success"?"text-ok":s==="info"?"text-info":"text-muted"}function hw(){const{notifications:s,unread:o,markAllRead:c,clearNotifications:u}=ea(),[f,m]=p.useState(!1),[,g]=p.useState(0),h=p.useRef(null),x=p.useRef(null);p.useEffect(()=>{if(!f)return;c();const j=N=>{h.current&&!h.current.contains(N.target)&&m(!1)},y=N=>{N.key==="Escape"&&(m(!1),x.current?.focus())};return document.addEventListener("pointerdown",j),document.addEventListener("keydown",y),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",y)}},[f,c]),p.useEffect(()=>{f&&c()},[f,s.length,c]),p.useEffect(()=>{if(!f)return;const j=setInterval(()=>g(y=>y+1),3e4);return()=>clearInterval(j)},[f]);const b=o>0?`Notifications, ${o} unread`:"Notifications";return a.jsxs("div",{ref:h,className:"sm:relative",children:[a.jsxs("div",{className:"relative",children:[a.jsx(ft,{ref:x,label:b,onClick:()=>m(j=>!j),"aria-expanded":f,"aria-haspopup":"dialog","aria-controls":"notifications-panel",className:ie(f&&"bg-inset text-ink"),children:a.jsx(nf,{className:"size-4.5","aria-hidden":"true"})}),o>0&&a.jsx("span",{className:"pointer-events-none absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-pill bg-accent px-1 text-[10px] font-semibold leading-none text-accent-ink","aria-hidden":"true",children:o>9?"9+":o})]}),f&&a.jsxs("div",{id:"notifications-panel",role:"dialog","aria-label":"Notifications",className:"panel-enter absolute right-3 top-[calc(100%+10px)] z-50 w-[min(92vw,360px)] overflow-hidden rounded-lg border border-line bg-surface shadow-pop sm:right-0",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2.5",children:[a.jsx("span",{className:"text-sm font-semibold text-ink",children:"Notifications"}),s.length>0&&a.jsx("button",{type:"button",onClick:u,className:"text-2xs text-muted transition-colors hover:text-ink",children:"Clear all"})]}),a.jsx("div",{className:"max-h-[min(60vh,320px)] overflow-y-auto",children:s.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[a.jsx(Uj,{className:"size-5 text-faint","aria-hidden":"true"}),a.jsx("div",{className:"text-xs text-muted",children:"All clear — no notifications yet."})]}):s.map(j=>{const y=dw(j);return a.jsxs("div",{className:"flex items-start gap-2.5 border-b border-line/70 px-4 py-2.5 last:border-0",children:[a.jsx(y,{className:ie("mt-0.5 size-4 shrink-0",fw(j.severity)),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs leading-snug text-ink",children:j.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:Zi(j.timestamp)})]})]},j.id)})}),a.jsx("div",{className:"border-t border-line bg-raised/50 px-4 py-2",children:a.jsx(yt,{to:"/notifications",onClick:()=>m(!1),className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Open notification settings"})})]})]})}function mw({onMenu:s}){const{pathname:o}=fn(),{theme:c,toggleTheme:u}=ly(),{nginxStatus:f,connected:m,connectionError:g}=ea(),{logout:h}=qn(),x=Tt(),[b,j]=p.useState(!1),y=Ny(o)?.title??"Easy DevOps",N=f?.running===!0,E=f===null?"Unknown":N?"Running":"Stopped",U=async()=>{if(!b){j(!0);try{await h(),x.success("Signed out","Your dashboard session has ended.")}finally{j(!1)}}};return a.jsxs("header",{className:"sticky top-0 z-30 flex h-[var(--ez-topbar-height)] shrink-0 items-center justify-between gap-3 border-b border-line bg-canvas/85 px-3 backdrop-blur sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx(ft,{label:"Open navigation",size:"sm",onClick:s,className:"lg:hidden",children:a.jsx(_2,{className:"size-4.5","aria-hidden":"true"})}),a.jsx("div",{className:"truncate text-sm font-semibold text-ink",children:y})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1 sm:gap-1.5",children:[a.jsxs(yt,{to:"/nginx","aria-label":`Nginx is ${E.toLowerCase()}. Open Nginx.`,className:"hidden items-center gap-1.5 rounded-pill border border-line bg-raised px-2.5 py-1 text-2xs transition-colors hover:border-line-strong hover:bg-inset sm:inline-flex",children:[a.jsx(Ft,{tone:f===null?"neutral":N?"ok":"bad",pulse:N&&m}),a.jsx("span",{className:"font-medium text-ink",children:"nginx"}),a.jsx("span",{className:"text-faint",children:E})]}),a.jsx(yt,{to:"/nginx","aria-label":`Nginx is ${E.toLowerCase()}. Open Nginx.`,className:"flex size-9 items-center justify-center rounded-md transition-colors hover:bg-inset sm:hidden",children:a.jsx(Ft,{tone:f===null?"neutral":N?"ok":"bad",pulse:N&&m})}),a.jsxs("span",{className:"hidden items-center gap-1.5 pl-1 pr-2 text-2xs text-faint md:flex",title:g??(m?"Live updates are connected.":"Reconnecting to live updates…"),children:[a.jsx("span",{className:ie("size-1.5 rounded-full",g?"bg-bad":m?"bg-ok live-dot":"bg-faint"),"aria-hidden":"true"}),g?"Live blocked":m?"Live":"Connecting"]}),a.jsx(hw,{}),a.jsx(ft,{label:c==="dark"?"Switch to light theme":"Switch to dark theme",onClick:u,children:c==="dark"?a.jsx(py,{className:"size-4.5","aria-hidden":"true"}):a.jsx(cy,{className:"size-4.5","aria-hidden":"true"})}),a.jsx(ft,{label:"Sign out",onClick:U,disabled:b,className:"hover:text-bad",children:a.jsx(A2,{className:"size-4.5","aria-hidden":"true"})})]})]})}function Xe({className:s,children:o,...c}){return a.jsx("div",{className:ie("rounded-lg border border-line bg-surface shadow-card",s),...c,children:o})}function Pt({title:s,description:o,actions:c,className:u,icon:f}){return a.jsxs("div",{className:ie("flex flex-wrap items-start justify-between gap-3 border-b border-line px-4 py-3.5 sm:px-5",u),children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[f&&a.jsx("div",{className:"mt-0.5 text-muted",children:f}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:s}),o&&a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:o})]})]}),c&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:c})]})}function Sn({className:s,children:o,...c}){return a.jsx("div",{className:ie("px-4 py-4 sm:px-5",s),...c,children:o})}function Ed({className:s,children:o}){return a.jsx("div",{className:ie("flex flex-wrap items-center justify-between gap-2 border-t border-line bg-raised/50 px-4 py-3 sm:px-5",s),children:o})}function Ts({className:s}){return a.jsx(Mi,{className:ie("spin size-4 text-muted",s),"aria-hidden":"true"})}function Pe({className:s}){return a.jsx("div",{className:ie("skeleton",s),"aria-hidden":"true"})}function Sa({children:s}){return a.jsx("div",{className:"page-enter space-y-5","aria-busy":"true","aria-label":"Loading",children:s})}function xw(){return a.jsx("div",{className:"flex min-h-full items-center justify-center bg-canvas",children:a.jsxs("div",{className:"flex items-center gap-3 text-muted",children:[a.jsx(Mi,{className:"spin size-5 text-accent-text","aria-hidden":"true"}),a.jsx("span",{className:"text-sm",children:"Loading Easy DevOps…"})]})})}function En({title:s,description:o,action:c,icon:u,className:f}){return a.jsxs("div",{className:ie("flex flex-col items-center justify-center px-6 py-12 text-center",f),children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-inset text-faint",children:u??a.jsx(v2,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-medium text-ink",children:s}),o&&a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:o}),c&&a.jsx("div",{className:"mt-4",children:c})]})}function Se({tone:s="info",title:o,children:c,action:u,className:f}){const m={info:"border-info/25 bg-info-soft text-info",warning:"border-warn/30 bg-warn-soft text-warn",danger:"border-bad/30 bg-bad-soft text-bad",success:"border-ok/30 bg-ok-soft text-ok"}[s],g={info:oy,warning:Ui,danger:Ui,success:Tl}[s];return a.jsx("div",{className:ie("rounded-md border px-3.5 py-3 text-xs",m,f),role:"status",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(g,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 text-muted",children:[o&&a.jsx("div",{className:"font-medium text-ink",children:o}),c&&a.jsx("div",{className:ie(o?"mt-0.5":void 0,"break-words"),children:c})]}),u&&a.jsx("div",{className:"shrink-0",children:u})]})})}function kt({error:s,onRetry:o,title:c,className:u}){const f=s instanceof Be?s:null,m=f?.status===403,g=typeof f?.payload?.detail=="string"?f.payload.detail:void 0,h=f?.message??(s instanceof Error?s.message:"Something went wrong while loading this section.");return a.jsx(Xe,{className:ie("border-bad/25",u),children:a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 text-center",children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:m?a.jsx(ka,{className:"size-5","aria-hidden":"true"}):a.jsx(Ui,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-semibold text-ink",children:c??(m?"Request blocked":"Could not load this section")}),a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:h}),g&&a.jsx("p",{className:"mt-1 max-w-md break-all font-mono text-2xs text-faint",children:g}),f&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",f.status,f.code?` · ${f.code}`:""]}),o&&a.jsx(te,{className:"mt-4",variant:"secondary",size:"sm",icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:o,children:"Try again"})]})})}const ig="ez-service-banner-dismissed";function zd({children:s}){return a.jsx("code",{className:"font-mono text-ink",children:s})}function pw(s){return s.startsAt==="logon"?"at your next logon":s.startsAt==="boot"?"at the next boot":"when the service starts"}function gw(s){return s.running?{code:"running",tone:"info",title:"Background service is running",body:"This dashboard is the interface only.",action:"Open Processes"}:s.stoppedByUser?{code:"stopped_by_user",tone:"warning",title:"The background service is stopped",body:a.jsxs(a.Fragment,{children:["You stopped it",s.stoppedAtLabel?` on ${s.stoppedAtLabel}`:"",", so monitoring and notifications are paused. It starts again ",pw(s),", or run"," ",a.jsx(zd,{children:"ezz service start"})," to start it now."]}),action:"Open Processes"}:{code:"not_running",tone:"warning",title:"The background service is not running",body:s.installed?a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Start the service with ",a.jsx(zd,{children:"ezz service start"}),"."]}):a.jsxs(a.Fragment,{children:["Monitoring and notifications would run in this dashboard and stop when it closes. Set up the service with ",a.jsx(zd,{children:s.installCommand}),"."]}),action:"Open Processes"}}function yw(){const{service:s}=Xi(),{pathname:o}=fn(),[c,u]=p.useState(()=>{try{return sessionStorage.getItem(ig)}catch{return null}}),f=Qi(s),m=f?gw(f):null,g=o!=="/processes",h=p.useMemo(()=>!f||!m?"":[m.code,f.pid,f.startedAt,f.stoppedByUser,f.stoppedAt,f.startsAt,f.installed].join("|"),[f,m]);if(!f||!m||c===h)return null;const x=()=>{u(h);try{sessionStorage.setItem(ig,h)}catch{}};return a.jsx("div",{className:"fade-enter mb-5",children:a.jsx(Se,{tone:m.tone,title:m.title,action:a.jsxs("div",{className:"flex items-center gap-1",children:[g&&a.jsxs(yt,{to:"/processes",className:ie("inline-flex items-center gap-1 rounded-sm px-2 py-1 text-xs font-medium text-ink","border border-line bg-raised transition-colors hover:border-line-strong hover:bg-inset"),children:[m.action,a.jsx(zs,{className:"size-3","aria-hidden":"true"})]}),a.jsx(ft,{label:"Dismiss banner",size:"sm",onClick:x,children:a.jsx(Vi,{className:"size-3.5","aria-hidden":"true"})})]}),children:m.body})})}const vw={host_missing:"The request arrived without a Host header.",host_port_mismatch:"The request was addressed to a different port.",host_not_local:"The request hostname does not mean this machine.",origin_malformed:"The request carried an unreadable Origin.",origin_port_mismatch:"The request came from a different port.",origin_not_local:"The request came from another site.",origin_cross_site:"The request came from another site.",missing_request_header:"The request was missing the dashboard’s safety header."};function bw(){const{blocked:s,dismissBlocked:o}=qn();if(!s)return null;const c=s.blockedReason,u=typeof s.payload.detail=="string"?s.payload.detail:void 0;return a.jsx("div",{className:"fade-enter mb-5 rounded-md border border-bad/30 bg-bad-soft px-3.5 py-3 text-xs",role:"alert",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(ka,{className:"mt-0.5 size-4 shrink-0 text-bad","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"font-medium text-ink",children:"Request blocked"}),a.jsx("div",{className:"mt-0.5 text-muted",children:c?vw[c]??"The dashboard refused this request.":s.message}),u&&a.jsx("div",{className:"mt-1 break-all font-mono text-2xs text-faint",children:u}),a.jsx("div",{className:"mt-1.5 text-2xs text-faint",children:"This happens when a request comes from another site or through a different port. Try reloading the dashboard from its own address."})]}),a.jsx(te,{variant:"ghost",size:"sm",onClick:o,className:"-mr-1 -mt-1 shrink-0",children:"Dismiss"})]})})}class jw extends p.Component{state={error:null};static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o,c){console.error(`[ui] ${this.props.area??"page"} crashed`,o,c.componentStack)}render(){return this.state.error?a.jsx(Xe,{className:"border-bad/30",children:a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-12 text-center",children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:a.jsx(ka,{className:"size-5","aria-hidden":"true"})}),a.jsx("h2",{className:"text-sm font-semibold text-ink",children:this.props.area?`${this.props.area} hit an error`:"This page hit an error"}),a.jsx("p",{className:"mt-1 max-w-lg text-xs text-muted",children:"The rest of the dashboard still works. Try again, or reload the page if it keeps happening."}),a.jsx("p",{className:"mt-2 max-w-lg break-all font-mono text-2xs text-faint",children:this.state.error.message}),a.jsx(te,{className:"mt-4",size:"sm",icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>this.setState({error:null}),children:"Try again"})]})}):this.props.children}}function Nw(){const[s,o]=p.useState(!1),{pathname:c}=fn(),u=p.useRef(null),f=p.useCallback(()=>o(!1),[]);p.useEffect(()=>{o(!1),u.current?.scrollTo({top:0}),u.current?.focus({preventScroll:!0})},[c]),p.useEffect(()=>{const g=window.matchMedia("(min-width: 1024px)"),h=()=>{g.matches&&o(!1)};return g.addEventListener("change",h),()=>g.removeEventListener("change",h)},[]);const m=Ny(c);return a.jsxs("div",{className:"flex h-full min-h-0 bg-canvas",children:[a.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:left-3 focus:top-3 focus:z-[80] focus:rounded-md focus:border focus:border-line focus:bg-surface focus:px-3 focus:py-2 focus:text-sm focus:text-ink focus:shadow-pop",children:"Skip to content"}),a.jsx(uw,{open:s,onClose:f}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx(mw,{onMenu:()=>o(!0)}),a.jsx("main",{ref:u,id:"main-content",tabIndex:-1,className:"min-h-0 flex-1 overflow-y-auto outline-none",children:a.jsxs("div",{className:"mx-auto w-full max-w-[var(--ez-content-max)] px-3 py-4 sm:px-5 sm:py-5 lg:px-7 lg:py-6",children:[a.jsx(yw,{}),a.jsx(bw,{}),a.jsx("div",{className:"page-enter",children:a.jsx(jw,{area:m?.title,children:a.jsx(q1,{})})},c)]})})]})]})}function ww(){const{bootError:s,retryBoot:o}=qn(),[c,u]=p.useState(!1),f=async()=>{u(!0),await o(),u(!1)};return a.jsx("div",{className:"flex min-h-full items-center justify-center bg-canvas px-4 py-10",children:a.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-card",children:[a.jsx("div",{className:"mb-4 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:a.jsx(B2,{className:"size-5","aria-hidden":"true"})}),a.jsx("h1",{className:"text-lg font-semibold text-ink",children:"Cannot reach the dashboard"}),a.jsxs("p",{className:"mt-1 text-sm text-muted",children:[s?.message??"The dashboard did not answer."," Check that Easy DevOps is running, then try again."]}),s&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",s.status===0?"connection failed":s.status]}),a.jsx(te,{variant:"primary",loading:c,onClick:f,icon:a.jsx(Ot,{className:"size-4","aria-hidden":"true"}),className:"mt-5",children:"Try again"})]})})}const cf="w-full rounded-md border border-line bg-canvas px-3 text-sm text-ink placeholder:text-faint transition-colors duration-[var(--ez-motion-fast)] hover:border-line-strong focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/25 disabled:opacity-60",uf="border-bad/60 hover:border-bad focus:border-bad focus:ring-bad/25";function df({htmlFor:s,children:o,optional:c}){return a.jsxs("label",{htmlFor:s,className:"mb-1.5 flex items-baseline gap-2 text-xs font-medium text-muted",children:[a.jsx("span",{children:o}),c&&a.jsx("span",{className:"text-2xs font-normal text-faint",children:"Optional"})]})}function ff({id:s,children:o}){return a.jsx("p",{id:s,className:"mt-1.5 text-xs text-bad",role:"alert",children:o})}function Cs({id:s,children:o}){return a.jsx("p",{id:s,className:"mt-1.5 text-xs text-faint",children:o})}function ze({label:s,hint:o,error:c,optional:u,trailing:f,id:m,className:g,...h}){const x=p.useId(),b=m??x,j=`${b}-error`,y=`${b}-hint`;return a.jsxs("div",{className:g,children:[s&&a.jsx(df,{htmlFor:b,optional:u,children:s}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{id:b,className:ie(cf,"h-9",!!f&&"pr-10",c&&uf),"aria-invalid":c?!0:void 0,"aria-describedby":c?j:o?y:void 0,...h}),f&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-1.5",children:f})]}),c?a.jsx(ff,{id:j,children:c}):o?a.jsx(Cs,{id:y,children:o}):null]})}function Lo({label:s,hint:o,error:c,optional:u,id:f,className:m,...g}){const h=p.useId(),x=f??h,b=`${x}-error`,j=`${x}-hint`;return a.jsxs("div",{className:m,children:[s&&a.jsx(df,{htmlFor:x,optional:u,children:s}),a.jsx("textarea",{id:x,className:ie(cf,"min-h-24 py-2 leading-relaxed",c&&uf),"aria-invalid":c?!0:void 0,"aria-describedby":c?b:o?j:void 0,...g}),c?a.jsx(ff,{id:b,children:c}):o?a.jsx(Cs,{id:j,children:o}):null]})}function tl({label:s,hint:o,error:c,optional:u,id:f,className:m,children:g,...h}){const x=p.useId(),b=f??x,j=`${b}-error`,y=`${b}-hint`;return a.jsxs("div",{className:m,children:[s&&a.jsx(df,{htmlFor:b,optional:u,children:s}),a.jsx("select",{id:b,className:ie(cf,"h-9 cursor-pointer pr-8",c&&uf),"aria-invalid":c?!0:void 0,"aria-describedby":c?j:o?y:void 0,...h,children:g}),c?a.jsx(ff,{id:j,children:c}):o?a.jsx(Cs,{id:y,children:o}):null]})}function kl({label:s,hint:o,checked:c,onChange:u,disabled:f,className:m,id:g}){const h=p.useId(),x=g??h;return a.jsxs("div",{className:ie("flex items-start gap-2.5",m),children:[a.jsx("input",{id:x,type:"checkbox",checked:c,disabled:f,onChange:b=>u(b.target.checked),className:"mt-0.5 size-4 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{htmlFor:x,className:ie("cursor-pointer text-sm text-ink",f&&"cursor-not-allowed opacity-60"),children:s}),o&&a.jsx("p",{className:"mt-0.5 text-xs text-faint",children:o})]})]})}function Ut({checked:s,onChange:o,label:c,description:u,disabled:f,className:m}){const g=p.useId();return a.jsxs("div",{className:ie("flex items-start justify-between gap-4",m),children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{id:g,className:"text-sm text-ink",children:c}),u&&a.jsx("div",{className:"mt-0.5 text-xs text-faint",children:u})]}),a.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-labelledby":g,disabled:f,onClick:()=>o(!s),className:ie("relative mt-0.5 inline-flex h-5 w-9 shrink-0 items-center rounded-pill border transition-colors duration-[var(--ez-motion-fast)] disabled:opacity-50",s?"border-accent bg-accent":"border-line-strong bg-inset","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50"),children:a.jsx("span",{className:ie("inline-block size-3.5 rounded-full bg-white shadow-sm transition-transform duration-[var(--ez-motion-fast)]",s?"translate-x-[18px]":"translate-x-[3px]")})})]})}function va({children:s,className:o}){return a.jsx("div",{className:ie("grid gap-4 sm:grid-cols-2",o),children:s})}const Sw=["Domains, certificates and nginx configs in one flow","Live nginx status, health checks and log tails","Processes, notifications and Hub pairing built in","Local-first: no Docker, no cloud account"],kw="This code has expired. Get a new one with: ezz dashboard setup-code";function rg(s){return s?.setupCodeRequired!==!0?!1:s.setupCodeExpiresAt===null||s.setupCodeExpiresAt<=Date.now()}function og({compact:s=!1}){return a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(wy,{className:"h-6"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold tracking-tight text-ink",children:"Easy DevOps"}),!s&&a.jsx("div",{className:"text-2xs text-faint",children:"Server control plane"})]})]})}function Tw({children:s}){const{theme:o,toggleTheme:c}=ly();return a.jsxs("div",{className:"relative flex min-h-full items-center justify-center overflow-hidden bg-canvas px-4 py-8 sm:py-12",children:[a.jsxs("div",{className:"pointer-events-none absolute inset-0","aria-hidden":"true",children:[a.jsx("div",{className:"absolute -top-48 left-1/2 h-[420px] w-[760px] -translate-x-1/2 rounded-full bg-accent-soft blur-3xl"}),a.jsx("div",{className:"absolute -bottom-56 right-[-120px] h-[380px] w-[520px] rounded-full bg-info-soft blur-3xl"})]}),a.jsxs("div",{className:"relative grid w-full max-w-4xl overflow-hidden rounded-xl border border-line bg-surface shadow-card lg:grid-cols-[1.02fr_1fr]",children:[a.jsxs("aside",{className:"hidden flex-col justify-between gap-8 border-r border-line bg-raised/40 p-8 lg:flex",children:[a.jsx(og,{}),a.jsxs("div",{children:[a.jsx("h2",{className:"max-w-sm text-2xl font-semibold leading-snug tracking-tight text-ink",children:"nginx, certificates and processes — one calm console."}),a.jsx("ul",{className:"mt-6 space-y-3",children:Sw.map(u=>a.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-muted",children:[a.jsx("span",{className:"mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full bg-ok-soft text-ok",children:a.jsx(ry,{className:"size-2.5","aria-hidden":"true"})}),u]},u))})]}),a.jsxs("div",{className:"flex items-center gap-2 text-2xs text-faint",children:[a.jsx(af,{className:"size-3.5","aria-hidden":"true"}),"Runs on this server. Nothing leaves it."]})]}),a.jsxs("section",{className:"relative p-6 sm:p-8",children:[a.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4 lg:justify-end",children:[a.jsx("div",{className:"lg:hidden",children:a.jsx(og,{compact:!0})}),a.jsx(ft,{label:o==="dark"?"Switch to light theme":"Switch to dark theme",onClick:c,children:o==="dark"?a.jsx(py,{className:"size-4.5","aria-hidden":"true"}):a.jsx(cy,{className:"size-4.5","aria-hidden":"true"})})]}),s]})]})]})}function Cy({show:s,onToggle:o}){return a.jsx(ft,{label:s?"Hide password":"Show password",size:"sm",onClick:o,className:"text-faint hover:text-ink",children:s?a.jsx(s2,{className:"size-4","aria-hidden":"true"}):a.jsx(r2,{className:"size-4","aria-hidden":"true"})})}function Ey({error:s}){if(!s)return null;const o=typeof s.payload.hint=="string"?s.payload.hint:void 0;return a.jsx(Se,{tone:"danger",title:s.message,className:"mb-4",children:o??(s.status===429?"Wait a moment before trying again.":void 0)})}function Cw(){const{login:s,retryBoot:o,sessionMessage:c}=qn(),[u,f]=p.useState(""),[m,g]=p.useState(!1),[h,x]=p.useState(null),[b,j]=p.useState(null),[y,N]=p.useState(!1),E=async U=>{if(U.preventDefault(),!u){x("Enter your password.");return}x(null),j(null),N(!0);try{await s(u)}catch(S){const k=S instanceof Be?S:null;if(k?.payload.needsSetup){await o();return}if(k?.status===409){await o();return}j(k)}finally{N(!1)}};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"Dashboard"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Welcome back"}),a.jsx("p",{className:"mt-1 text-sm text-muted",children:"Sign in to manage this server."})]}),c&&a.jsx(Se,{tone:"info",title:"You were signed out",className:"mb-4",children:c}),a.jsx(Ey,{error:b}),a.jsxs("form",{onSubmit:E,noValidate:!0,children:[a.jsx(ze,{label:"Password",type:m?"text":"password",value:u,onChange:U=>{f(U.target.value),h&&x(null)},error:h,autoComplete:"current-password",autoFocus:!0,trailing:a.jsx(Cy,{show:m,onToggle:()=>g(U=>!U)})}),a.jsxs(te,{type:"submit",variant:"primary",size:"lg",loading:y,className:"mt-5 w-full",children:["Sign in",!y&&a.jsx(zs,{className:"size-4","aria-hidden":"true"})]})]})]})}function Ew(){const{auth:s,setup:o,retryBoot:c}=qn(),u=s?.minPasswordLength??8,f=s?.canUseNoPassword===!0,m=s?.setupCodeRequired===!0,g=rg(s),[h,x]=p.useState("password"),[b,j]=p.useState(""),[y,N]=p.useState(""),[E,U]=p.useState(""),[S,k]=p.useState(!1),[_,z]=p.useState({}),[Q,A]=p.useState(null),[Y,ne]=p.useState(!1),M=async L=>{L.preventDefault();const X={};if(m&&!b.trim()&&(X.code="Enter the setup code shown by the server."),h==="password"&&(y.length<u&&(X.password=`Use at least ${u} characters.`),E!==y&&(X.confirm="The two passwords do not match.")),z(X),!(Object.keys(X).length>0)){A(null),ne(!0);try{if(h==="none")await o({mode:"none"});else{const Z=b.trim();await o({password:y,mode:"password",...Z?{setupCode:Z}:{}})}}catch(Z){const ae=Z instanceof Be?Z:null;if(ae?.status===409){await c();return}if(ae?.status===400&&rg(s)){A(null);return}A(ae)}finally{ne(!1)}}};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"First run"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Set up this dashboard"}),a.jsx("p",{className:"mt-1 text-sm text-muted",children:"Choose how Easy DevOps protects itself. You can change this later in Settings."})]}),a.jsx(Ey,{error:Q}),a.jsxs("form",{onSubmit:M,noValidate:!0,children:[a.jsxs("div",{className:ie("grid gap-2",f&&"grid-cols-2"),role:"group","aria-label":"Authentication method",children:[a.jsxs("button",{type:"button","aria-pressed":h==="password",onClick:()=>x("password"),className:ie("rounded-md border p-3 text-left transition-colors duration-[var(--ez-motion-fast)]",h==="password"?"border-accent bg-accent-soft":"border-line bg-raised hover:border-line-strong hover:bg-inset"),children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(Yi,{className:"size-3.5 text-accent-text","aria-hidden":"true"}),"Password"]}),a.jsx("span",{className:"mt-1 block text-2xs text-muted",children:"Required to sign in from any browser."})]}),f&&a.jsxs("button",{type:"button","aria-pressed":h==="none",onClick:()=>x("none"),className:ie("rounded-md border p-3 text-left transition-colors duration-[var(--ez-motion-fast)]",h==="none"?"border-accent bg-accent-soft":"border-line bg-raised hover:border-line-strong hover:bg-inset"),children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(cN,{className:"size-3.5 text-warn","aria-hidden":"true"}),"No password"]}),a.jsx("span",{className:"mt-1 block text-2xs text-muted",children:"Only from this machine, while bound to loopback."})]})]}),m&&g&&a.jsx(Se,{tone:"warning",title:kw,className:"mt-4",children:"Run that on the server, then reload this page to enter the new code."}),m&&a.jsx(ze,{className:"mt-4",label:"Setup code",value:b,onChange:L=>{j(L.target.value),_.code&&z(X=>({...X,code:void 0}))},error:_.code,hint:"Printed in the terminal where the dashboard was started.",autoComplete:"one-time-code"}),h==="password"?a.jsxs(a.Fragment,{children:[a.jsx(ze,{className:"mt-4",label:"Password",type:S?"text":"password",value:y,onChange:L=>{N(L.target.value),_.password&&z(X=>({...X,password:void 0}))},error:_.password,hint:`At least ${u} characters. Stored as a scrypt hash on this server.`,autoComplete:"new-password",autoFocus:!m,trailing:a.jsx(Cy,{show:S,onToggle:()=>k(L=>!L)})}),a.jsx(ze,{className:"mt-4",label:"Confirm password",type:S?"text":"password",value:E,onChange:L=>{U(L.target.value),_.confirm&&z(X=>({...X,confirm:void 0}))},error:_.confirm,autoComplete:"new-password"})]}):a.jsxs(Se,{tone:"warning",title:"The dashboard will have no password",className:"mt-4",children:["Anyone who can reach ",s?.bindAddress??"this machine"," can manage nginx, domains and certificates. Keep the dashboard bound to 127.0.0.1. Adding a password later in Settings is recommended if you ever expose it."]}),a.jsxs(te,{type:"submit",variant:"primary",size:"lg",loading:Y,className:"mt-5 w-full",children:[h==="password"?"Save password and sign in":"Start without a password",!Y&&a.jsx(zs,{className:"size-4","aria-hidden":"true"})]})]})]})}function zw(){const{auth:s,retryBoot:o}=qn(),[c,u]=p.useState(!1),f=async()=>{u(!0),await o(),u(!1)};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"No password"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Open the dashboard"}),a.jsxs("p",{className:"mt-1 text-sm text-muted",children:["This dashboard is configured without a password. It only accepts requests from"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-2xs text-ink",children:s?.bindAddress??"this machine"}),"."]})]}),a.jsxs(te,{variant:"primary",size:"lg",loading:c,onClick:f,className:"w-full",children:["Continue to dashboard",!c&&a.jsx(zs,{className:"size-4","aria-hidden":"true"})]})]})}function Rw(){const{auth:s}=qn();return Bn(s?.needsSetup?"Set up this dashboard":s?.authMode==="none"?"Open the dashboard":"Sign in"),a.jsxs(Tw,{children:[s?.needsSetup?a.jsx(Ew,{}):s?.authMode==="none"?a.jsx(zw,{}):a.jsx(Cw,{}),a.jsxs("div",{className:"mx-auto mt-6 w-full max-w-sm border-t border-line pt-4 text-2xs text-faint",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[a.jsx(af,{className:"size-3 shrink-0","aria-hidden":"true"}),a.jsxs("span",{className:"truncate",children:["Listening on"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-2xs text-muted",children:s?.bindAddress??"…"})]})]}),a.jsx("span",{children:"Easy DevOps"})]}),!1]})]})}function As(s,o){const{lastChange:c,changeSeq:u}=ea(),f=p.useRef(o);f.current=o,p.useEffect(()=>{if(!c)return;(Array.isArray(s)?s:[s]).includes(c.section)&&f.current()},[u])}function ta({title:s,description:o,actions:c,meta:u,eyebrow:f}){return a.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[a.jsxs("div",{className:"min-w-0",children:[f&&a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:f}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:s}),u]}),o&&a.jsx("p",{className:"mt-1 max-w-2xl text-sm text-muted",children:o})]}),c&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:c})]})}function Aw(s){return Promise.all([re.domains.list(s),re.ssl.list(s),re.nginx.status(s)]).then(([o,c,u])=>({domains:o,certs:c,nginx:u}))}const Dw={neutral:"text-muted",accent:"text-accent-text",ok:"text-ok",warn:"text-warn",bad:"text-bad",info:"text-info"};function So({label:s,value:o,hint:c,icon:u,tone:f="neutral",pulse:m=!1,to:g}){return a.jsx(yt,{to:g,className:"group block rounded-lg",children:a.jsxs(Xe,{className:"h-full px-4 py-3.5 transition-colors duration-[var(--ez-motion-fast)] group-hover:border-line-strong",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-2xs font-semibold uppercase tracking-[0.12em] text-faint",children:s}),a.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[a.jsx("span",{className:ie("text-xl font-semibold tracking-tight",Dw[f]),children:o}),(f==="ok"||f==="bad"||f==="warn")&&a.jsx(Ft,{tone:f,pulse:m})]})]}),a.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-md bg-inset text-muted transition-colors group-hover:text-ink",children:a.jsx(u,{className:"size-4","aria-hidden":"true"})})]}),a.jsx("div",{className:"mt-2 truncate text-2xs text-muted",children:c})]})})}function _w(s,o,c,u){const f=[];s&&!s.running&&f.push({id:"nginx-down",tone:"bad",title:"nginx is not running",detail:"No domain is being proxied until nginx is started.",to:"/nginx"});for(const m of c)m.status==="error"?f.push({id:`cert-error-${m.domain}`,tone:"bad",title:`Certificate for ${m.domain} cannot be read`,detail:"The certificate files are missing or unreadable.",to:"/ssl"}):m.status==="expired"||m.daysLeft!==null&&m.daysLeft<0?f.push({id:`cert-expired-${m.domain}`,tone:"bad",title:`Certificate for ${m.domain} has expired`,detail:ks(m.daysLeft),to:"/ssl"}):m.status==="expiring"&&f.push({id:`cert-expiring-${m.domain}`,tone:"warn",title:`Certificate for ${m.domain} expires soon`,detail:ks(m.daysLeft),to:"/ssl"});for(const m of o)u.get(m.name)?.up===!1&&f.push({id:`domain-down-${m.name}`,tone:"bad",title:`${m.name} is not responding`,detail:`The backend ${m.backendHost}:${m.port} did not answer a health check.`,to:"/domains"});return f}function Ow({entry:s}){return s?s.up===null?a.jsx(je,{tone:"neutral",dot:!0,children:"External"}):s.up?a.jsx(je,{tone:"ok",dot:!0,children:"Up"}):a.jsx(je,{tone:"bad",dot:!0,children:"Down"}):a.jsx("span",{className:"text-2xs text-faint",children:"Awaiting check"})}function Mw(s){return s.type==="nginx_down"?{icon:Rs,tone:"text-muted"}:s.type==="cert_expiry"?{icon:ka,tone:"text-warn"}:s.type==="domain_health"?{icon:Do,tone:"text-info"}:{icon:Do,tone:"text-muted"}}function Lw(){Bn("Overview");const s=Tt(),o=hn(),{nginxStatus:c,domainHealth:u,notifications:f}=ea(),{service:m}=Xi(),g=Qi(m),h=bt(Aw),[x,b]=p.useState(!1);zl(h.reload),As(["domains","ssl","nginx"],h.reload);const j=h.data,y=c??j?.nginx??null,N=j?.domains??[],E=j?.certs??[],U=new Map((u??[]).map(M=>[M.name,M])),S=N.filter(M=>M.enabled).length,k=E.filter(M=>M.status==="expiring"),_=E.filter(M=>M.status==="expired"||M.status==="error"),z=j?_w(y,N,E,U):[],Q=z.filter(M=>M.tone==="bad").length,A=j!==null&&y?.running===!0&&z.length===0,Y=_.length>0?`${kn(_.length,"certificate")} expired or unreadable`:k.length>0?`${k.length} expiring within 30 days`:E.length>0?"All certificates healthy":"No certificates yet",ne=async()=>{if(await o({title:"Reload nginx?",body:"Reloading applies configuration changes. Existing connections are kept open.",confirmLabel:"Reload nginx"})){b(!0);try{const L=await re.nginx.reload();L.success?(s.success("Nginx reloaded",L.output.trim()||"Configuration reloaded."),h.reload()):s.error("Nginx reload failed",L.output.trim()||"nginx refused the reload.")}catch(L){s.error("Nginx reload failed",L instanceof Be?L.message:"The dashboard could not complete the reload.")}finally{b(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"Overview",description:"The state of nginx, your domains and their certificates, live.",actions:a.jsx(te,{variant:"secondary",size:"sm",loading:h.loading,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:h.reload,children:"Refresh"})}),h.error&&!j?a.jsx(kt,{error:h.error,onRetry:h.reload}):j?a.jsxs("div",{className:"space-y-4",children:[h.error&&a.jsx(Se,{tone:"warning",title:"Showing the last known state",action:a.jsx(te,{variant:"ghost",size:"sm",onClick:h.reload,children:"Try again"}),children:h.error.message}),a.jsxs(Xe,{className:"relative overflow-hidden",children:[a.jsx("div",{className:"status-sheen pointer-events-none absolute inset-x-0 top-0 h-px overflow-hidden","aria-hidden":"true"}),a.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsxs("div",{className:ie("relative mt-0.5 flex size-11 shrink-0 items-center justify-center rounded-full border",Q>0?"border-bad/30 bg-bad-soft text-bad":z.length>0?"border-warn/30 bg-warn-soft text-warn":"border-ok/30 bg-ok-soft text-ok"),children:[Q>0||z.length>0?a.jsx(Ui,{className:"size-5","aria-hidden":"true"}):a.jsx(Tl,{className:"size-5","aria-hidden":"true"}),a.jsx("span",{className:ie("absolute -inset-px rounded-full border",Q>0?"border-bad/20":z.length>0?"border-warn/20":"border-ok/20"),"aria-hidden":"true"})]}),a.jsxs("div",{"aria-live":"polite",children:[a.jsx("div",{className:"text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"System status"}),a.jsx("div",{className:"mt-0.5 text-lg font-semibold tracking-tight text-ink",children:Q>0?"Attention needed":z.length>0?"A few things to check":"All systems healthy"}),a.jsxs("div",{className:"mt-0.5 text-xs text-muted",children:[y?.running?"nginx running":"nginx stopped"," · ",kn(N.length,"domain")," · ",kn(E.length,"certificate"),z.length>0&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("span",{className:Q>0?"text-bad":"text-warn",children:[kn(z.length,"item")," need attention"]})]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-3 sm:flex-col sm:items-end",children:[a.jsx(je,{tone:A?"ok":Q>0?"bad":"warn",dot:!0,children:A?"Healthy":Q>0?"Degraded":"Check"}),a.jsxs("span",{className:"text-2xs text-faint",children:["Checked ",j.nginx?"live":"—",y?.version?` · ${y.version}`:""]})]})]})]}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[a.jsx(So,{label:"Nginx",value:y?y.running?"Active":"Offline":"Unknown",hint:y?.running?`PID ${y.pid??"—"}${y.version?` · ${y.version}`:""}`:"Traffic is not being proxied.",icon:Rs,tone:y?y.running?"ok":"bad":"neutral",pulse:y?.running===!0,to:"/nginx"}),a.jsx(So,{label:"Domains",value:`${S}/${N.length}`,hint:N.length===0?"No domains configured yet.":S===N.length?"All domains enabled.":`${N.length-S} disabled.`,icon:Cl,tone:N.length===0?"neutral":S>0?"accent":"warn",to:"/domains"}),a.jsx(So,{label:"Certificates",value:String(E.length),hint:Y,icon:wa,tone:_.length>0?"bad":k.length>0?"warn":E.length>0?"ok":"neutral",to:"/ssl"}),a.jsx(So,{label:"Background service",value:g?g.running?"Running":"Stopped":"Unknown",hint:g?g.running?g.startsAt==="unknown"?g.mechanismDetail:`${g.mechanismLabel} · starts ${g.startsAtLabel.toLowerCase()}`:g.stoppedByUser?g.installed?`You stopped it${g.stoppedAtLabel?` on ${g.stoppedAtLabel}`:""}; it starts again automatically.`:"You stopped it; start it to resume monitoring.":g.installed?"Monitoring runs in this window.":"Not installed; monitoring runs in this window.":"Checking…",icon:iy,tone:g?g.running?"ok":"warn":"neutral",pulse:g?.running===!0,to:"/processes"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(yt,{to:"/domains?new=1",className:ba("primary","sm"),children:[a.jsx(Na,{className:"size-3.5","aria-hidden":"true"}),"Add domain"]}),a.jsxs(yt,{to:"/ssl?new=1",className:ba("secondary","sm"),children:[a.jsx(wa,{className:"size-3.5","aria-hidden":"true"}),"Issue certificate"]}),a.jsx(te,{variant:"secondary",size:"sm",loading:x,disabled:!y?.running,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:ne,children:"Reload nginx"})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsxs(Xe,{className:"xl:col-span-2",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3 sm:px-5",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Domain health"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Backends are checked on connect and every 60 seconds."})]}),a.jsx(yt,{to:"/domains",className:"text-2xs font-medium text-muted hover:text-ink",children:"Manage"})]}),N.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[a.jsx(Cl,{className:"size-5 text-faint","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"No domains yet"}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"Add a domain to put a backend behind nginx."})]}),a.jsx(yt,{to:"/domains?new=1",className:ba("primary","sm"),children:"Add your first domain"})]}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-line text-left text-2xs uppercase tracking-wider text-faint",children:[a.jsx("th",{className:"px-4 py-2 font-medium sm:px-5",children:"Domain"}),a.jsx("th",{className:"hidden px-3 py-2 font-medium sm:table-cell",children:"Target"}),a.jsx("th",{className:"px-3 py-2 font-medium",children:"Health"}),a.jsx("th",{className:"hidden px-3 py-2 font-medium md:table-cell",children:"Certificate"})]})}),a.jsx("tbody",{children:N.map(M=>{const L=U.get(M.name);return a.jsxs("tr",{className:"border-b border-line/60 last:border-0 hover:bg-raised/40",children:[a.jsx("td",{className:"px-4 py-2.5 sm:px-5",children:a.jsxs(yt,{to:`/domains?domain=${encodeURIComponent(M.name)}`,className:"flex items-center gap-2 font-medium text-ink hover:text-accent-text",children:[a.jsx("span",{className:"truncate",children:M.name}),!M.enabled&&a.jsx(je,{tone:"neutral",children:"Disabled"})]})}),a.jsxs("td",{className:"hidden px-3 py-2.5 font-mono text-2xs text-muted sm:table-cell",children:[M.backendHost,":",M.port]}),a.jsx("td",{className:"px-3 py-2.5",children:a.jsx(Ow,{entry:L})}),a.jsx("td",{className:"hidden px-3 py-2.5 text-2xs md:table-cell",children:M.ssl.enabled?a.jsx("span",{className:ie(M.daysLeft!==null&&M.daysLeft<30?"text-warn":"text-muted"),children:M.daysLeft!==null?ks(M.daysLeft):"Unknown"}):a.jsx("span",{className:"text-faint",children:"Not enabled"})})]},M.name)})})]})}),u===null&&N.length>0&&a.jsx("div",{className:"border-t border-line px-4 py-2 text-2xs text-faint sm:px-5",children:"Waiting for the first health check…"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs(Xe,{children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Needs attention"}),a.jsx("span",{className:"text-2xs text-faint",children:z.length})]}),z.length===0?a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-5 text-xs text-muted",children:[a.jsx(Tl,{className:"size-4 text-ok","aria-hidden":"true"}),"Nothing needs attention right now."]}):a.jsx("div",{className:"max-h-[280px] overflow-y-auto",children:z.map(M=>a.jsxs(yt,{to:M.to,className:"group flex items-start gap-2.5 border-b border-line/60 px-4 py-2.5 last:border-0 hover:bg-raised/50",children:[a.jsx(Ft,{tone:M.tone,className:"mt-1"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:M.title}),a.jsx("div",{className:"mt-0.5 text-2xs text-muted",children:M.detail})]}),a.jsx(Qj,{className:"mt-0.5 size-3.5 shrink-0 text-faint transition-transform group-hover:translate-x-0.5","aria-hidden":"true"})]},M.id))})]}),a.jsxs(Xe,{children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Recent events"}),a.jsx(yt,{to:"/notifications",className:"text-2xs font-medium text-muted hover:text-ink",children:"All events"})]}),f.length===0?a.jsx("div",{className:"px-4 py-5 text-xs text-muted",children:"No events since this tab opened. Alerts from nginx, certificates and domain health appear here live."}):a.jsx("div",{children:f.slice(0,6).map(M=>{const{icon:L,tone:X}=Mw(M);return a.jsxs("div",{className:"flex items-start gap-2.5 border-b border-line/60 px-4 py-2.5 last:border-0",children:[a.jsx(L,{className:ie("mt-0.5 size-3.5 shrink-0",X),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs leading-snug text-ink",children:M.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:Zi(M.timestamp)})]})]},M.id)})})]})]})]})]}):a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-28 w-full rounded-lg"}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[0,1,2,3].map(M=>a.jsx(Pe,{className:"h-[92px] rounded-lg"},M))}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsx(Pe,{className:"h-64 rounded-lg xl:col-span-2"}),a.jsx(Pe,{className:"h-64 rounded-lg"})]})]})]})}function zy(s){if(!s||!s.trim())return"A domain name is required.";const c=(s.startsWith("*.")?s.slice(2):s).split(".");if(c.length<2)return"Use at least two labels, for example example.com.";const u=/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/;return c.some(f=>!f||!u.test(f))?"Use letters, digits and hyphens only; each label must start and end with a letter or digit.":null}function Yo(s){const o=Number(s);return!Number.isInteger(o)||o<1||o>65535?"Port must be a whole number between 1 and 65535.":null}function Ry(s){return s&&(!s.includes("@")||s.trim()!==s)?"Enter a valid email address.":null}function Uw(s){return s?/^\d+[kmgKMG]?$/.test(s)?null:"Use a size like 10m, 1g or 512k.":null}function Ai(s,o){const c=Number(s);return!Number.isInteger(c)||c<1?`${o} must be a positive whole number.`:null}function cg(s,o){return s?s.length<o?`Use at least ${o} characters.`:null:"Enter a password."}const Hw=2048,ug=/^[A-Za-z0-9._~-]{1,200}$/;function Bw(s){if(!s)return"The Hub URL is missing.";if(s!==s.trim())return"The Hub URL must not have spaces around it.";if(s.includes("://")&&!/^https?:\/\//i.test(s))return"The Hub URL must use http or https.";const o=/^https?:\/\//i.test(s)?s:`https://${s}`;let c;try{c=new URL(o)}catch{return"The Hub URL is not valid."}return c.protocol!=="http:"&&c.protocol!=="https:"?"The Hub URL must use http or https.":c.hostname?c.username||c.password?"The Hub URL must not contain credentials.":null:"The Hub URL is missing a host."}function qw(s){const o=s.trim();if(!o)return"Paste the connection string the Hub gave you.";if(o.length>Hw)return"That connection string is too long.";if(!o.toLowerCase().startsWith("ezops://"))return"The connection string must start with ezops://.";const c=o.slice(8).split("|");if(c.length!==3)return"Expected the form ezops://hubUrl|serverId|secret.";const[u,f,m]=c.map(h=>h.trim()),g=Bw(u);return g||(f?m?ug.test(f)?ug.test(m)?null:"The secret has characters the Hub does not use.":"The server ID has characters the Hub does not use.":"The secret is missing.":"The server ID is missing.")}function vt({value:s,label:o="Copy",withText:c=!1,className:u}){const[f,m]=p.useState("idle"),g=p.useRef(null);p.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const h=async()=>{try{await navigator.clipboard.writeText(s),m("copied")}catch{m("failed")}g.current&&clearTimeout(g.current),g.current=setTimeout(()=>m("idle"),1600)},x=f==="copied"?a.jsx(ry,{className:"size-3.5 text-ok","aria-hidden":"true"}):a.jsx(t2,{className:"size-3.5","aria-hidden":"true"}),b=f==="copied"?"Copied":f==="failed"?"Copy failed":o;return c?a.jsx(te,{size:"sm",variant:"secondary",icon:x,onClick:h,className:u,children:a.jsx("span",{"aria-live":"polite",children:b})}):a.jsx(ft,{label:b,size:"sm",variant:"ghost",onClick:h,className:ie(f==="copied"&&"text-ok",u),children:x})}const Gw="text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript",Ay=[{id:"domain_health",label:"Port / health check",description:"The backend stops answering its health check."},{id:"cert_expiry",label:"SSL / certificate expiry",description:"A certificate is expired or close to expiry."},{id:"nginx_down",label:"nginx stopped",description:"nginx itself is not serving requests."}],Dy=()=>({domain_health:{enabled:!0,channelIds:[]},cert_expiry:{enabled:!0,channelIds:[]},nginx_down:{enabled:!0,channelIds:[]}});function Yw(){return{name:"",port:3e3,backendHost:"127.0.0.1",upstreamType:"http",www:!1,wildcard:!1,enabled:!0,ssl:{enabled:!1,certPath:"",keyPath:"",redirect:!0,hsts:!1,hstsMaxAge:31536e3},performance:{maxBodySize:"10m",readTimeout:60,connectTimeout:10,proxyBuffers:!1,gzip:!0,gzipTypes:Gw},security:{rateLimit:!1,rateLimitRate:10,rateLimitBurst:20,securityHeaders:!1,custom404:!1,custom50x:!1},advanced:{accessLog:!0,customLocations:""},notifications:Dy()}}function $w(s){const o=Dy();for(const c of Ay){const u=s.notifications?.[c.id];u&&(o[c.id]={enabled:u.enabled,channelIds:[...u.channelIds??[]]})}return{name:s.name,port:s.port,backendHost:s.backendHost||"127.0.0.1",upstreamType:s.upstreamType||"http",www:s.www,wildcard:s.wildcard,enabled:s.enabled,ssl:{enabled:!!s.ssl?.enabled,certPath:s.ssl?.certPath??"",keyPath:s.ssl?.keyPath??"",redirect:s.ssl?.redirect??!0,hsts:s.ssl?.hsts??!1,hstsMaxAge:s.ssl?.hstsMaxAge||31536e3},performance:{...s.performance},security:{...s.security},advanced:{...s.advanced},notifications:o}}const dg={http:"HTTP",https:"HTTPS",ws:"WebSocket"};function $d(s){return s.trim().replace(/^\*\./,"")}function Vw(s){return"status"in s&&s.status==="waiting_dns"}function Xw(s,o){const c={};if(o){const h=zy($d(s.name));h&&(c["domain-name"]=h)}if(s.backendHost.trim()||(c["backend-host"]="A backend host or URL is required."),!/^https?:\/\//i.test(s.backendHost.trim())){const h=Yo(s.port);h&&(c["backend-port"]=h)}const f=Uw(s.performance.maxBodySize);f&&(c["max-body"]=f);const m=Ai(s.performance.readTimeout,"Read timeout");m&&(c["read-timeout"]=m);const g=Ai(s.performance.connectTimeout,"Connect timeout");if(g&&(c["connect-timeout"]=g),s.ssl.enabled&&s.ssl.hsts){const h=Ai(s.ssl.hstsMaxAge,"HSTS max-age");h&&(c["hsts-max-age"]=h)}if(s.security.rateLimit){const h=Ai(s.security.rateLimitRate,"Rate");h&&(c["rate-limit-rate"]=h);const x=Ai(s.security.rateLimitBurst,"Burst");x&&(c["rate-limit-burst"]=x)}return c}function fg(s){if(s instanceof Be){const o=s.payload.error;if(o&&typeof o=="object")return{message:"Certificate creation failed",detail:[o.step?`Step: ${o.step}`:"",o.cause?`Cause: ${o.cause}`:"",o.consequence?`Note: ${o.consequence}`:""].filter(Boolean).join(`
431
- `)||"The certificate authority did not issue a certificate.",hint:"nginx is left as it was."};const c=s.code==="email_required"?"Set the ACME email in Settings → General, then try again.":typeof s.payload.hint=="string"?s.payload.hint:void 0;return{message:"Certificate creation failed",detail:(typeof s.payload.detail=="string"?s.payload.detail:typeof s.payload.output=="string"?s.payload.output:void 0)??s.message,hint:c}}return{message:"Certificate creation failed",detail:s instanceof Error?s.message:"The request could not be completed."}}function bs({id:s,title:o,description:c,icon:u,open:f,onToggle:m,children:g}){return a.jsxs("section",{className:"border-b border-line last:border-b-0",children:[a.jsx("h3",{children:a.jsxs("button",{type:"button","aria-expanded":f,"aria-controls":`section-${s}`,onClick:m,className:"group flex w-full items-center gap-3 px-5 py-3.5 text-left transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/50",children:[a.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-inset text-muted transition-colors group-hover:text-ink",children:a.jsx(u,{className:"size-3.5","aria-hidden":"true"})}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:o}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:c})]}),a.jsx(Xj,{className:ie("size-4 shrink-0 text-faint transition-transform duration-[var(--ez-motion-fast)]",f&&"rotate-180"),"aria-hidden":"true"})]})}),f&&a.jsx("div",{id:`section-${s}`,className:"px-5 pb-5 pt-1",children:g})]})}function Zw({channel:s,checked:o,onChange:c}){return a.jsxs("label",{className:ie("flex cursor-pointer items-center gap-2 rounded-md border px-2.5 py-1.5 text-xs transition-colors duration-[var(--ez-motion-fast)]",o?"border-accent/50 bg-accent-soft/50 text-ink":"border-line text-muted hover:border-line-strong hover:text-ink"),children:[a.jsx("input",{type:"checkbox",checked:o,onChange:u=>c(u.target.checked),className:"size-3.5 shrink-0 accent-[var(--ez-accent)]"}),a.jsx("span",{className:"font-medium",children:s.name}),a.jsx("span",{className:"text-2xs text-faint",children:s.type})]})}const js=s=>Number.isFinite(s)&&s!==0?s:"";function Qw({editor:s,onClose:o,onSaved:c}){const u=s.mode==="edit"?s.domain:null,f=Tt(),m=hn(),g=qi(),h=p.useId(),[x,b]=p.useState(()=>u?$w(u):Yw()),j=p.useRef(JSON.stringify(x)),y=JSON.stringify(x)!==j.current,[N,E]=p.useState(()=>u?{basic:!0,ssl:!0,performance:!0,security:!0,advanced:!0,notifications:!0}:{basic:!0,ssl:!0,performance:!1,security:!1,advanced:!1,notifications:!1}),[U,S]=p.useState({}),[k,_]=p.useState(null),[z,Q]=p.useState(!1),[A,Y]=p.useState(null),[ne,M]=p.useState("http"),[L,X]=p.useState(null),[Z,ae]=p.useState(null),[H,W]=p.useState(null),ve=bt(V=>re.settings.channels.list(V),[],{enabled:!!u});p.useEffect(()=>{if(!y)return;const V=de=>{de.preventDefault(),de.returnValue=""};return window.addEventListener("beforeunload",V),()=>window.removeEventListener("beforeunload",V)},[y]),p.useEffect(()=>{A&&x.wildcard&&M("dns")},[A,x.wildcard]);const xe=/^https?:\/\//i.test(x.backendHost.trim());function ee(V,de){b(be=>({...be,[V]:de}))}function oe(V,de){b(be=>({...be,ssl:{...be.ssl,[V]:de}}))}function $(V,de){b(be=>({...be,performance:{...be.performance,[V]:de}}))}function le(V,de){b(be=>({...be,security:{...be.security,[V]:de}}))}function ke(V,de){b(be=>({...be,advanced:{...be.advanced,[V]:de}}))}function Te(V,de){b(be=>({...be,notifications:{...be.notifications,[V]:{...be.notifications[V],...de}}}))}function Ie(V,de,be){b(nt=>{const Ge=nt.notifications[V],Ta=be?Array.from(new Set([...Ge.channelIds,de])):Ge.channelIds.filter(na=>na!==de);return{...nt,notifications:{...nt.notifications,[V]:{...Ge,channelIds:Ta}}}})}const qe=V=>E(de=>({...de,[V]:!0})),T=async V=>{const de={...x,...V,ssl:{...x.ssl,...V?.ssl??{}},name:u?u.name:$d(x.name)},be=Xw(de,!u);if(Object.keys(be).length>0){S(be),_({message:"Check the highlighted fields before saving."}),(be["domain-name"]||be["backend-host"]||be["backend-port"])&&qe("basic"),(be["max-body"]||be["read-timeout"]||be["connect-timeout"])&&qe("performance"),(be["rate-limit-rate"]||be["rate-limit-burst"])&&qe("security"),be["hsts-max-age"]&&qe("ssl");const nt=Object.keys(be)[0];queueMicrotask(()=>document.getElementById(nt)?.focus());return}S({}),_(null),Q(!0);try{const nt=u?await re.domains.update(u.name,de):await re.domains.create(de);Y(null),ae(null),X(null),f.success(u?"Domain saved":"Domain created",u?`${nt.name} was updated and its nginx config regenerated.`:`${nt.name} is configured; nginx will start serving it on the next reload.`),c(nt)}catch(nt){const Ge=nt instanceof Be?nt:null;Ge?.status===422&&Ge.code==="cert_missing"?(Y({certPath:typeof Ge.payload.certPath=="string"?Ge.payload.certPath:"",keyPath:typeof Ge.payload.keyPath=="string"?Ge.payload.keyPath:"",hint:typeof Ge.payload.hint=="string"?Ge.payload.hint:"The SSL certificate files do not exist at the configured paths."}),X(null),ae(null),_(null),M(x.wildcard?"dns":"http"),qe("ssl")):(_({message:Ge?.message??"The domain could not be saved.",detail:typeof Ge?.payload.detail=="string"?Ge.payload.detail:typeof Ge?.payload.output=="string"?Ge.payload.output:void 0,hint:typeof Ge?.payload.hint=="string"?Ge.payload.hint:void 0}),f.error("Could not save the domain",Ge?.message??void 0))}finally{Q(!1)}},I=async()=>{W("issue"),X(null);try{const V=u?u.name:$d(x.name),de=await re.ssl.create({domain:V,www:x.www,validationMethod:ne});if(Vw(de)){ae(de);return}Y(null),ae(null),await T({ssl:{...x.ssl,enabled:!0,certPath:de.certPath,keyPath:de.keyPath}})}catch(V){X(fg(V))}finally{W(null)}},P=async()=>{if(Z){W("confirm"),X(null);try{const V=await re.ssl.confirmDns(Z.domain);ae(null),Y(null),await T({ssl:{...x.ssl,enabled:!0,certPath:V.certPath,keyPath:V.keyPath}})}catch(V){X(fg(V)),ae(null)}finally{W(null)}}},F=async()=>{if(Z){W("confirm");try{await re.ssl.cancelDns(Z.domain),f.info("DNS challenge cancelled","No certificate was requested.")}catch{f.warning("Could not cancel the DNS challenge")}finally{ae(null),W(null)}}},Ne=()=>{const V={...x.ssl,enabled:!1};b(de=>({...de,ssl:V})),Y(null),X(null),ae(null),T({ssl:V})},De=()=>{Y(null),X(null),ae(null)},Ce=z||H!==null,ce=async()=>y?m({title:"Discard changes?",body:"The changes to this domain have not been saved.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}):!0,ye=()=>{Z&&re.ssl.cancelDns(Z.domain).catch(()=>{})},Ht=async()=>{Ce||await ce()&&(ye(),o())},Gn=p.useRef(Ht);Gn.current=Ht;const It=p.useCallback(()=>{Gn.current()},[]),Bt=async()=>{Ce||await ce()&&(ye(),o(),g("/settings"))};return a.jsxs(Cn,{open:!0,onClose:It,title:u?`Edit ${u.name}`:"New domain",description:"Changes are written to nginx, tested, and rolled back automatically if nginx rejects them.",size:"xl",preventClose:Ce,bodyClassName:"px-0 py-0",footer:a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mr-auto hidden text-2xs text-faint sm:block",children:u?"The domain name cannot change after creation.":"The domain is enabled as soon as it is created."}),a.jsx(te,{variant:"ghost",onClick:It,disabled:Ce,children:"Cancel"}),a.jsx(te,{variant:"primary",type:"submit",form:h,loading:z,disabled:H!==null,children:u?"Save changes":"Create domain"})]}),children:[(k||A)&&a.jsxs("div",{className:"space-y-3 border-b border-line px-5 py-4",children:[k&&!A&&a.jsxs(Se,{tone:"danger",title:k.message,children:[k.hint&&a.jsx("div",{children:k.hint}),k.detail&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:k.detail})]}),A&&a.jsxs(a.Fragment,{children:[a.jsx(Se,{tone:"warning",title:"SSL certificate not found",action:a.jsx(te,{variant:"ghost",size:"sm",onClick:De,disabled:Ce,children:"Keep editing"}),children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"break-all font-mono text-2xs",children:A.certPath||A.keyPath}),a.jsx("div",{children:A.hint}),a.jsx("div",{children:"Issue a certificate now, disable SSL for this domain, or point the paths at files that already exist."})]})}),a.jsx("div",{className:"rounded-md border border-line bg-raised/40 p-3",children:Z?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"Add this DNS TXT record, then continue"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:Z.hint??"The certificate authority checks this record before issuing the certificate."})]}),a.jsxs("div",{className:"space-y-2 rounded-md border border-line bg-canvas p-3 font-mono text-2xs",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-sans text-2xs uppercase tracking-wider text-faint",children:"Name"}),a.jsx("div",{className:"mt-0.5 break-all text-ink",children:Z.txtName})]}),a.jsx(vt,{value:Z.txtName,label:"Copy record name"})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-line pt-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-sans text-2xs uppercase tracking-wider text-faint",children:"Value"}),a.jsx("div",{className:"mt-0.5 break-all text-ink",children:Z.txtValue})]}),a.jsx(vt,{value:Z.txtValue,label:"Copy record value"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(te,{variant:"primary",size:"sm",loading:H==="confirm",onClick:P,children:"I added the record, continue"}),a.jsx(te,{variant:"secondary",size:"sm",onClick:F,disabled:H!==null,children:"Cancel issuance"})]})]}):a.jsxs("div",{className:"space-y-3",children:[L&&a.jsxs(Se,{tone:"danger",title:L.message,children:[L.hint&&a.jsx("div",{children:L.hint}),L.detail&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:L.detail})]}),a.jsxs("fieldset",{children:[a.jsx("legend",{className:"mb-2 text-xs font-medium text-muted",children:"Validation method"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("label",{className:ie("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",ne==="http"?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong",x.wildcard&&"cursor-not-allowed opacity-50"),children:[a.jsx("input",{type:"radio",name:"cert-method",value:"http",checked:ne==="http",disabled:x.wildcard||Ce,onChange:()=>M("http"),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{children:[a.jsx("span",{className:"block font-medium text-ink",children:"HTTP challenge"}),a.jsx("span",{className:"block text-2xs text-faint",children:"DNS already points here"})]})]}),a.jsxs("label",{className:ie("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",ne==="dns"?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong"),children:[a.jsx("input",{type:"radio",name:"cert-method",value:"dns",checked:ne==="dns",disabled:Ce,onChange:()=>M("dns"),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{children:[a.jsx("span",{className:"block font-medium text-ink",children:"DNS challenge"}),a.jsx("span",{className:"block text-2xs text-faint",children:"Add a TXT record"})]})]})]}),x.wildcard&&a.jsx("p",{className:"mt-2 text-2xs text-warn",children:"Wildcard certificates require the DNS challenge."})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(te,{variant:"primary",size:"sm",loading:H==="issue",onClick:I,icon:a.jsx(wa,{className:"size-3.5","aria-hidden":"true"}),children:"Create certificate"}),a.jsx(te,{variant:"dangerGhost",size:"sm",onClick:Ne,disabled:H!==null,children:"Disable SSL and save"})]})]})})]})]}),a.jsxs("form",{id:h,onSubmit:V=>{V.preventDefault(),Ce||T()},children:[a.jsx(bs,{id:"basic",title:"Basic configuration",description:"What nginx serves and where traffic goes.",icon:Cl,open:N.basic??!1,onToggle:()=>E(V=>({...V,basic:!V.basic})),children:a.jsxs(va,{children:[a.jsx(ze,{id:"domain-name",className:"sm:col-span-2",label:"Domain name",placeholder:"api.example.com",value:x.name,disabled:!!u,onChange:V=>ee("name",V.target.value),error:U["domain-name"],hint:x.wildcard?"Enter the bare domain — the *. prefix is added automatically.":u?"The domain name cannot be changed after creation.":void 0,autoComplete:"off",spellCheck:!1}),a.jsx(ze,{id:"backend-host",className:"sm:col-span-2",label:"Backend host or URL",placeholder:"127.0.0.1 or https://app.vercel.app",value:x.backendHost,onChange:V=>ee("backendHost",V.target.value),error:U["backend-host"],hint:"A host and port, or a full http(s) URL to proxy to.",autoComplete:"off",spellCheck:!1}),a.jsx(ze,{id:"backend-port",label:"Backend port",type:"number",inputMode:"numeric",min:1,max:65535,value:js(x.port),disabled:xe,onChange:V=>ee("port",Number(V.target.value)),error:U["backend-port"],hint:xe?"Taken from the URL.":void 0}),a.jsx(tl,{label:"Upstream type",value:x.upstreamType,onChange:V=>ee("upstreamType",V.target.value),children:Object.keys(dg).map(V=>a.jsx("option",{value:V,children:dg[V]},V))}),a.jsxs("div",{className:"sm:col-span-2 space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Ut,{checked:x.wildcard,onChange:V=>b(de=>({...de,wildcard:V,www:V?!1:de.www})),label:"Wildcard domain",description:"Serve *.example.com. Requires a DNS-01 certificate."}),!x.wildcard&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Ut,{checked:x.www,onChange:V=>ee("www",V),label:"Include www subdomain",description:"Adds www.example.com to server_name."})})]})]})}),a.jsx(bs,{id:"ssl",title:"SSL",description:"Serve this domain over HTTPS.",icon:wa,open:N.ssl??!1,onToggle:()=>E(V=>({...V,ssl:!V.ssl})),children:a.jsxs("div",{className:"space-y-4",children:[x.ssl.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(ze,{label:"Certificate path",value:x.ssl.certPath,onChange:V=>oe("certPath",V.target.value),placeholder:"fullchain.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"}),a.jsx(ze,{label:"Private key path",value:x.ssl.keyPath,onChange:V=>oe("keyPath",V.target.value),placeholder:"privkey.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Ut,{checked:x.ssl.redirect,onChange:V=>oe("redirect",V),label:"Redirect HTTP to HTTPS",description:"Port 80 requests are sent to the HTTPS address."}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Ut,{checked:x.ssl.hsts,onChange:V=>oe("hsts",V),label:"Enable HSTS",description:"Tells browsers to use HTTPS for this domain only."})}),x.ssl.hsts&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(ze,{id:"hsts-max-age",label:"HSTS max-age",type:"number",inputMode:"numeric",min:1,value:js(x.ssl.hstsMaxAge),onChange:V=>oe("hstsMaxAge",Number(V.target.value)),error:U["hsts-max-age"],hint:"Seconds. 31536000 is one year.",className:"max-w-56"})})]})]}):a.jsx(Ut,{checked:x.ssl.enabled,onChange:V=>oe("enabled",V),label:"Enable SSL / HTTPS",description:"Adds a 443 server block with the certificate below."}),x.ssl.enabled&&a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(ka,{className:"mt-0.5 size-3.5 shrink-0 text-warn","aria-hidden":"true"}),a.jsx("span",{children:"The certificate files must exist before this domain can be saved. If they are missing, you will be offered to issue one."})]})]})}),a.jsx(bs,{id:"performance",title:"Performance",description:"Request limits, timeouts and compression.",icon:h2,open:N.performance??!1,onToggle:()=>E(V=>({...V,performance:!V.performance})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[a.jsx(ze,{id:"max-body",label:"Max body size",value:x.performance.maxBodySize,onChange:V=>$("maxBodySize",V.target.value),error:U["max-body"],placeholder:"10m",hint:"For uploads: 10m, 512k or 1g.",autoComplete:"off"}),a.jsx(ze,{id:"read-timeout",label:"Read timeout",type:"number",inputMode:"numeric",min:1,value:js(x.performance.readTimeout),onChange:V=>$("readTimeout",Number(V.target.value)),error:U["read-timeout"],hint:"Seconds."}),a.jsx(ze,{id:"connect-timeout",label:"Connect timeout",type:"number",inputMode:"numeric",min:1,value:js(x.performance.connectTimeout),onChange:V=>$("connectTimeout",Number(V.target.value)),error:U["connect-timeout"],hint:"Seconds."})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Ut,{checked:x.performance.proxyBuffers,onChange:V=>$("proxyBuffers",V),label:"Proxy buffering",description:"Buffer upstream responses on disk for slow clients."}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Ut,{checked:x.performance.gzip,onChange:V=>$("gzip",V),label:"Gzip compression",description:"Compress text responses before sending them."})}),x.performance.gzip&&a.jsxs("div",{className:"border-t border-line pt-3",children:[a.jsx(Lo,{label:"Gzip MIME types",value:x.performance.gzipTypes,onChange:V=>$("gzipTypes",V.target.value),rows:3,spellCheck:!1,className:"font-mono"}),a.jsx(Cs,{children:"Space-separated list of content types."})]})]})]})}),a.jsx(bs,{id:"security",title:"Security",description:"Rate limiting and response headers.",icon:af,open:N.security??!1,onToggle:()=>E(V=>({...V,security:!V.security})),children:a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Ut,{checked:x.security.rateLimit,onChange:V=>le("rateLimit",V),label:"Rate limiting",description:"Limit requests per IP address."}),x.security.rateLimit&&a.jsxs("div",{className:"grid gap-4 border-t border-line pt-3 sm:grid-cols-2",children:[a.jsx(ze,{id:"rate-limit-rate",label:"Requests per second",type:"number",inputMode:"numeric",min:1,value:js(x.security.rateLimitRate),onChange:V=>le("rateLimitRate",Number(V.target.value)),error:U["rate-limit-rate"]}),a.jsx(ze,{id:"rate-limit-burst",label:"Burst",type:"number",inputMode:"numeric",min:1,value:js(x.security.rateLimitBurst),onChange:V=>le("rateLimitBurst",Number(V.target.value)),error:U["rate-limit-burst"],hint:"Requests allowed to exceed the rate briefly."})]}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Ut,{checked:x.security.securityHeaders,onChange:V=>le("securityHeaders",V),label:"Security headers",description:"Adds X-Frame-Options and X-Content-Type-Options."})}),a.jsxs("div",{className:"grid gap-3 border-t border-line pt-3 sm:grid-cols-2",children:[a.jsx(Ut,{checked:x.security.custom404,onChange:V=>le("custom404",V),label:"Custom 404 form",description:"Return the dashboard's 404 page."}),a.jsx(Ut,{checked:x.security.custom50x,onChange:V=>le("custom50x",V),label:"Custom 50x page",description:"Return the dashboard's error page when the backend fails."})]})]})}),a.jsx(bs,{id:"advanced",title:"Advanced",description:"Raw nginx additions for this domain.",icon:Wj,open:N.advanced??!1,onToggle:()=>E(V=>({...V,advanced:!V.advanced})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Ut,{checked:x.advanced.accessLog,onChange:V=>ke("accessLog",V),label:"Domain-specific access log",description:"Writes this domain's requests to its own log file."}),a.jsx(Lo,{label:"Custom location blocks",value:x.advanced.customLocations,onChange:V=>ke("customLocations",V.target.value),rows:6,spellCheck:!1,placeholder:`location /api/v2 {
432
- proxy_pass http://localhost:8080;
433
- }`,className:"font-mono"}),a.jsx(Cs,{children:"Appended verbatim inside the server block. nginx tests the result before it is kept."})]})}),u&&a.jsx(bs,{id:"notifications",title:"Notifications",description:"Which channels hear about this domain.",icon:nf,open:N.notifications??!1,onToggle:()=>E(V=>({...V,notifications:!V.notifications})),children:ve.loading&&!ve.data?a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{className:"h-14 rounded-md"}),a.jsx(Pe,{className:"h-14 rounded-md"}),a.jsx(Pe,{className:"h-14 rounded-md"})]}):ve.error&&!ve.data?a.jsx(Se,{tone:"warning",title:"Could not load notification channels",action:a.jsx(te,{variant:"ghost",size:"sm",onClick:ve.reload,children:"Retry"}),children:ve.error.message}):(ve.data??[]).length===0?a.jsxs(Se,{tone:"info",title:"No notification channels configured",children:["Add a Discord or Telegram channel in Settings first; this domain's alerts are recorded either way.",a.jsx("div",{className:"mt-2",children:a.jsx(te,{variant:"secondary",size:"sm",icon:a.jsx(sf,{className:"size-3.5","aria-hidden":"true"}),onClick:Bt,children:"Open settings"})})]}):a.jsx("div",{className:"space-y-3",children:Ay.map(V=>{const de=x.notifications[V.id];return a.jsxs("div",{className:"rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Ut,{checked:de.enabled,onChange:be=>Te(V.id,{enabled:be}),label:V.label,description:V.description}),de.enabled&&a.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5 border-t border-line pt-3",children:(ve.data??[]).map(be=>a.jsx(Zw,{channel:be,checked:de.channelIds.includes(be.id),onChange:nt=>Ie(V.id,be.id,nt)},be.id))}),de.enabled&&de.channelIds.length===0&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"No channels selected — the event is recorded but not delivered."})]},V.id)})})})]})]})}function Kw(s){return/^https?:\/\//i.test(s.backendHost||"")?s.backendHost:`${s.upstreamType||"http"}://${s.backendHost||"127.0.0.1"}:${s.port}`}function Jw({domain:s}){if(!s.ssl?.enabled)return a.jsx(je,{tone:"neutral",children:"HTTP only"});const o=s.daysLeft;return o==null?a.jsx(je,{tone:"neutral",children:"SSL"}):o<0?a.jsx(je,{tone:"bad",children:"SSL expired"}):o<30?a.jsx(je,{tone:"warn",children:ks(o)}):a.jsx(je,{tone:"ok",children:ks(o)})}function Pw({entry:s}){return s?s.up===null?a.jsx(je,{tone:"neutral",dot:!0,children:"External"}):s.up?a.jsx(je,{tone:"ok",dot:!0,children:"Up"}):a.jsx(je,{tone:"bad",dot:!0,children:"Down"}):null}function Fw(){Bn("Domains");const s=Tt(),o=hn(),{domainHealth:c}=ea(),u=bt($=>re.domains.list($)),[f,m]=qo(),[g,h]=p.useState(""),[x,b]=p.useState("all"),[j,y]=p.useState(null),[N,E]=p.useState(null),[U,S]=p.useState(!1),[k,_]=p.useState(!1);zl(u.reload),As("domains",u.reload);const z=u.data,Q=p.useMemo(()=>new Map((c??[]).map($=>[$.name,$])),[c]),A=f.get("new")==="1",Y=f.get("domain"),ne=Y?(z??[]).find($=>$.name===Y):void 0,M=A?{mode:"create"}:ne?{mode:"edit",domain:ne}:null,L=p.useRef(null);p.useEffect(()=>{if(!z||!Y){L.current=null;return}if(ne){L.current=null;return}L.current!==Y&&(L.current=Y,s.error("Domain not found",Y),m({},{replace:!0}))},[z,Y,ne,m,s]);const X=()=>m({new:"1"}),Z=$=>m({domain:$}),ae=()=>m({},{replace:!0}),H=p.useMemo(()=>{const $=z??[];return{all:$.length,enabled:$.filter(le=>le.enabled).length,disabled:$.filter(le=>!le.enabled).length}},[z]),W=p.useMemo(()=>{const $=g.trim().toLowerCase();return(z??[]).filter(le=>x==="enabled"&&!le.enabled||x==="disabled"&&le.enabled?!1:$?[le.name,le.backendHost,String(le.port)].join(" ").toLowerCase().includes($):!0)},[z,x,g]),ve=async $=>{const le=!$.enabled;if(await o({title:`${le?"Enable":"Disable"} "${$.name}"?`,body:le?"nginx resumes serving this domain with its saved configuration.":"nginx stops serving this domain until you enable it again. The config file is kept.",confirmLabel:le?"Enable":"Disable",tone:le?"accent":"danger"})){y({name:$.name,action:"toggle"});try{const Te=await re.domains.toggle($.name);u.setData(Ie=>Ie&&Ie.map(qe=>qe.name===$.name?{...qe,enabled:Te.enabled}:qe)),s.success(Te.enabled?"Domain enabled":"Domain disabled",Te.enabled?`${$.name} is being served again.`:`${$.name} is no longer served by nginx.`)}catch(Te){s.error(`Could not ${le?"enable":"disable"} the domain`,Te instanceof Be?Te.message:void 0)}finally{y(null)}}},xe=async $=>{y({name:$.name,action:"reload"});try{const le=await re.domains.reload($.name);s.success("nginx reloaded",le.message||`${$.name} is live with its current configuration.`)}catch(le){s.error("Could not reload nginx",le instanceof Be?le.message:void 0)}finally{y(null)}},ee=$=>{S(!1),E($)},oe=async()=>{if(N){_(!0);try{const $=await re.domains.remove(N.name,N.ssl.enabled&&U);s.success("Domain deleted",$.certDeleted?`${N.name}, its nginx config and its certificate files were removed.`:`${N.name} and its nginx config were removed. The certificate files were kept.`),E(null),u.reload()}catch($){s.error("Could not delete the domain",$ instanceof Be?$.message:void 0)}finally{_(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",meta:z?a.jsxs("span",{className:"text-2xs text-faint",children:[H.all," total · ",H.enabled," enabled"]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",size:"sm",loading:u.loading,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:u.reload,children:"Refresh"}),a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(Na,{className:"size-3.5","aria-hidden":"true"}),onClick:X,children:"Add domain"})]})}),u.error&&!z?a.jsx(kt,{error:u.error,onRetry:u.reload}):z?z.length===0?a.jsx(Xe,{children:a.jsx(En,{icon:a.jsx(Cl,{className:"size-5","aria-hidden":"true"}),title:"No domains yet",description:"Add a domain and Easy DevOps writes its nginx config, tests it, and reloads nginx.",action:a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(Na,{className:"size-3.5","aria-hidden":"true"}),onClick:X,children:"Add your first domain"})})}):a.jsxs("div",{className:"space-y-3",children:[u.error&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known list. ",u.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:u.reload,children:"Try again"})]}),a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-col gap-3 border-b border-line p-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"relative w-full sm:max-w-xs",children:[a.jsx(W2,{className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-faint","aria-hidden":"true"}),a.jsx("input",{type:"search","aria-label":"Search domains",placeholder:"Search domain or backend…",value:g,onChange:$=>h($.target.value),className:"h-9 w-full rounded-md border border-line bg-canvas pl-8 pr-3 text-sm text-ink placeholder:text-faint transition-colors duration-[var(--ez-motion-fast)] hover:border-line-strong focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/25"})]}),a.jsx("div",{role:"group","aria-label":"Filter domains",className:"flex flex-wrap gap-1.5",children:[["all","All",H.all],["enabled","Enabled",H.enabled],["disabled","Disabled",H.disabled]].map(([$,le,ke])=>a.jsxs("button",{type:"button","aria-pressed":x===$,onClick:()=>b($),className:ie("inline-flex items-center gap-1.5 rounded-pill border px-2.5 py-1 text-xs transition-colors duration-[var(--ez-motion-fast)]",x===$?"border-accent/50 bg-accent-soft text-accent-text":"border-line text-muted hover:border-line-strong hover:text-ink"),children:[le,a.jsx("span",{className:ie("rounded-pill px-1 text-2xs",x===$?"bg-accent/15":"bg-inset text-faint"),children:ke})]},$))})]}),W.length===0?a.jsx(En,{title:"No domains match",description:"Try a different search or show all domains.",action:a.jsx(te,{variant:"secondary",size:"sm",onClick:()=>{h(""),b("all")},children:"Clear filters"})}):a.jsx("ul",{className:"divide-y divide-line",children:W.map($=>{const le=Q.get($.name),ke=le?.up===!1,Te=j?.name===$.name,Ie=Te?j?.action:null;return a.jsxs("li",{className:ie("group flex flex-col gap-2.5 px-4 py-3 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 sm:flex-row sm:items-center sm:gap-4",!$.enabled&&"opacity-60"),children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[a.jsx(Ft,{tone:$.enabled?ke?"bad":"ok":"neutral",pulse:$.enabled&&!ke,className:"mt-1.5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("button",{type:"button",onClick:()=>Z($.name),className:"max-w-full truncate text-left font-mono text-sm font-semibold text-ink transition-colors hover:text-accent-text",children:$.name}),$.wildcard&&a.jsx(je,{tone:"accent",children:"wildcard"}),$.www&&a.jsx(je,{tone:"neutral",children:"www"}),!$.enabled&&a.jsx(je,{tone:"neutral",children:"disabled"}),$.sslPathWarning&&a.jsx("span",{className:"inline-flex",title:"Certificate paths contain backslashes, which nginx on Windows can fail to load. Open and save this domain to regenerate them with forward slashes.",children:a.jsxs(je,{tone:"warn",children:[a.jsx(ka,{className:"size-3","aria-hidden":"true"}),"Backslash cert paths"]})})]}),a.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-muted",children:[a.jsx("span",{className:"max-w-full truncate font-mono",children:Kw($)}),$.ssl.enabled&&$.ssl.redirect&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{children:"HTTP redirects to HTTPS"})]})]})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-7 sm:w-52 sm:shrink-0 sm:pl-0",children:[a.jsx(Jw,{domain:$}),a.jsx(Pw,{entry:le})]}),a.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1 pl-7 sm:pl-0",children:[a.jsx(ft,{label:$.enabled?`Disable ${$.name}`:`Enable ${$.name}`,size:"sm",disabled:Te,onClick:()=>ve($),className:"text-muted hover:text-ink",children:Ie==="toggle"?a.jsx(Mi,{className:"spin size-3.5","aria-hidden":"true"}):$.enabled?a.jsx(Y2,{className:"size-3.5","aria-hidden":"true"}):a.jsx(V2,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ft,{label:`Reload nginx for ${$.name}`,size:"sm",disabled:Te,onClick:()=>xe($),className:"text-muted hover:text-ink",children:Ie==="reload"?a.jsx(Mi,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ft,{label:`Edit ${$.name}`,size:"sm",onClick:()=>Z($.name),className:"text-muted hover:text-accent-text",children:a.jsx(lf,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ft,{label:`Delete ${$.name}`,size:"sm",onClick:()=>ee($),className:"text-muted hover:text-bad",children:a.jsx($i,{className:"size-3.5","aria-hidden":"true"})})]})]},$.name)})})]})]}):a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-14 rounded-lg"}),a.jsx(Pe,{className:"h-[320px] rounded-lg"})]}),M&&a.jsx(Qw,{editor:M,onClose:ae,onSaved:()=>{ae(),u.reload()}},M.mode==="edit"?`edit:${M.domain.name}`:"create"),a.jsx(Cn,{open:N!==null,onClose:()=>{k||E(null)},title:N?`Delete "${N.name}"?`:"Delete domain",description:"This also removes the domain's nginx config. It cannot be undone.",size:"sm",preventClose:k,footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"ghost",onClick:()=>E(null),disabled:k,children:"Cancel"}),a.jsx(te,{variant:"danger",loading:k,onClick:oe,children:"Delete domain"})]}),children:N&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("p",{className:"text-sm text-muted",children:["nginx stops serving ",a.jsx("span",{className:"font-mono text-ink",children:N.name})," ","as soon as the config is removed."]}),N.ssl.enabled&&a.jsx("div",{className:"rounded-md border border-line bg-raised/40 p-3",children:a.jsx(kl,{checked:U,onChange:S,label:"Also delete the SSL certificate files",hint:`Otherwise ${N.name}'s certificate stays on disk and can be reused.`})})]})})]})}function Iw(s,o){if(s instanceof Be){const c=s.payload.error;if(c&&typeof c=="object")return{title:o,step:c.step,cause:c.cause,consequence:c.consequence,nginxRunning:c.nginxRunning};const u=s.code==="email_required"?"Set the ACME email in Settings → General, or provide an email with this request.":typeof s.payload.hint=="string"?s.payload.hint:void 0,f=typeof s.payload.detail=="string"?s.payload.detail:typeof s.payload.output=="string"?s.payload.output:s.message;return{title:o,summary:u,detail:f}}if(s&&typeof s=="object"){const c=s;return{title:c.step==="email configuration"?"ACME email is not configured":o,step:c.step,cause:c.cause,consequence:c.consequence,nginxRunning:c.nginxRunning}}return typeof s=="string"&&s?{title:o,detail:s}:{title:o,summary:"No certificate was issued."}}function _y(s){return s==null?"unknown":s<1e3?`${Math.round(s)} ms`:s<6e4?`${(s/1e3).toFixed(1)} s`:`${Math.round(s/6e4)} min`}function Ww(s){return s?s==="proxy"?"The HTTP-01 challenge was answered through nginx, so nginx stayed running.":s==="standalone"?"The challenge ran in standalone mode.":s==="dns"?"Validated with a DNS TXT record.":`Validation mode: ${s}.`:null}function Vd({value:s,title:o="Certificate issuance failed"}){const c=Iw(s,o),u=!!(c.step||c.cause||c.consequence);return a.jsxs(Se,{tone:"danger",title:c.title,children:[c.summary&&a.jsx("p",{children:c.summary}),u&&a.jsxs("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-2xs",children:[c.step&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Step"}),a.jsx("dd",{className:"text-muted",children:c.step})]}),c.cause&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Cause"}),a.jsx("dd",{className:"text-muted",children:c.cause})]}),c.consequence&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Note"}),a.jsx("dd",{className:"text-muted",children:c.consequence})]})]}),c.nginxRunning===!1&&a.jsx("p",{className:"mt-2 text-2xs",children:"nginx is not running right now."}),c.detail&&a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:c.detail})]})}function eS({result:s,title:o="Certificate issued"}){const c=Ww(s.mode);return a.jsxs("div",{className:"rounded-md border border-ok/30 bg-ok-soft/40 px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-ink",children:[a.jsx(Tl,{className:"size-4 shrink-0 text-ok","aria-hidden":"true"}),o]}),s.summary&&a.jsx("p",{className:"mt-1 text-xs text-muted",children:s.summary}),s.fellBack&&a.jsxs(Se,{tone:"warning",className:"mt-2.5",children:["The HTTP challenge could not be answered through nginx, so the standalone challenge was used. nginx was stopped for ",_y(s.nginxDownMs),"."]}),s.staging&&a.jsx(Se,{tone:"warning",className:"mt-2.5",children:"This is a staging certificate. Browsers will not trust it; issue again against production before relying on it."}),a.jsxs("dl",{className:"mt-2.5 space-y-1.5",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Certificate"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-2xs text-muted",children:s.certPath}),a.jsx(vt,{value:s.certPath,label:"Copy certificate path"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Private key"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-2xs text-muted",children:s.keyPath}),a.jsx(vt,{value:s.keyPath,label:"Copy private key path"})]})]}),c&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:c})]})}const hg="ssl-known-domains";function tS(s){return"status"in s&&s.status==="waiting_dns"}function nS({error:s}){const o=Array.isArray(s.payload.found)?s.payload.found.filter(u=>typeof u=="string"):[],c=typeof s.payload.hint=="string"?s.payload.hint:s.message;return a.jsxs(Se,{tone:"warning",title:"The TXT record was not found yet",children:[a.jsx("p",{children:c}),o.length>0&&a.jsxs("p",{className:"mt-1.5 break-all",children:["Records currently visible:"," ",a.jsx("span",{className:"font-mono text-ink",children:o.join(" · ")})]})]})}function aS({domains:s,initialDomain:o="",onClose:c,onIssued:u}){const f=Tt(),m=hn(),g=qi(),[h,x]=p.useState(o),[b,j]=p.useState(""),[y,N]=p.useState(!1),[E,U]=p.useState("http"),[S,k]=p.useState("form"),[_,z]=p.useState({}),[Q,A]=p.useState(null),[Y,ne]=p.useState(!1),[M,L]=p.useState(null),[X,Z]=p.useState(!1),[ae,H]=p.useState(null),[W,ve]=p.useState(null),xe=h.trim().startsWith("*.");p.useEffect(()=>{xe&&(U("dns"),N(!1))},[xe]);const ee=h.trim()!==o||b.trim()!==""||y||E!=="http",oe=async()=>{const F={},Ne=zy(h.trim());Ne&&(F.domain=Ne);const De=Ry(b.trim());if(De&&(F.email=De),F.domain||F.email){z(F),queueMicrotask(()=>document.getElementById(F.domain?"ssl-domain":"ssl-email")?.focus());return}z({}),A(null),H(null),ne(!0);const Ce=h.trim();try{const ce=await re.ssl.create({domain:Ce,www:xe?!1:y,validationMethod:xe?"dns":E,email:b.trim()||void 0});if(tS(ce)){L(ce),k("dns");return}ve({result:ce,domain:Ce}),k("success"),u(ce,Ce)}catch(ce){A(ce)}finally{ne(!1)}},$=async()=>{if(M){H(null),Z(!0);try{const F=await re.ssl.confirmDns(M.domain),Ne=M.domain;L(null),ve({result:F,domain:Ne}),k("success"),u(F,Ne)}catch(F){F instanceof Be&&(F.code==="dns_not_propagated"||F.code==="dns_lookup_failed")?H(F):(L(null),k("form"),A(F))}finally{Z(!1)}}},le=async()=>{if(M){Z(!0);try{await re.ssl.cancelDns(M.domain),f.info("DNS challenge cancelled","No certificate was issued.")}catch{f.warning("Could not cancel the DNS challenge","It will expire on its own after ten minutes.")}finally{L(null),H(null),k("form"),Z(!1)}}},ke=()=>{x(""),j(""),N(!1),U("http"),z({}),A(null),H(null),ve(null),k("form")},Te=Y||X,Ie=async()=>{if(!Te){if(S==="dns"&&M){if(!await m({title:"Cancel the pending DNS challenge?",body:`No certificate will be issued for ${M.domain}. The TXT record can be removed afterwards.`,confirmLabel:"Cancel challenge",cancelLabel:"Keep waiting",tone:"danger"}))return;re.ssl.cancelDns(M.domain).catch(()=>{}),c();return}S==="form"&&ee&&!await m({title:"Discard this certificate request?",body:"The form has not been submitted, so nothing has been issued.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"})||c()}},qe=p.useRef(Ie);qe.current=Ie;const T=p.useCallback(()=>{qe.current()},[]),I=Q instanceof Be&&Q.code==="email_required",P=S==="success"?"Certificate issued":S==="dns"?"DNS validation":"New certificate";return a.jsxs(Cn,{open:!0,onClose:T,title:P,description:S==="form"?"Let’s Encrypt issues 90-day certificates. nginx keeps running unless the HTTP challenge has to fall back to standalone mode.":void 0,size:"lg",preventClose:Te,footer:S==="form"?a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"ghost",onClick:T,disabled:Te,children:"Cancel"}),a.jsx(te,{variant:"primary",loading:Y,icon:a.jsx(wa,{className:"size-3.5","aria-hidden":"true"}),onClick:oe,children:"Issue certificate"})]}):S==="dns"?a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"ghost",onClick:le,disabled:Te,children:"Cancel challenge"}),a.jsx(te,{variant:"primary",loading:X,onClick:$,children:"I’ve added the record"})]}):a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"ghost",onClick:ke,children:"Issue another"}),a.jsx(te,{variant:"primary",onClick:T,children:"Done"})]}),children:[S==="form"&&a.jsxs("div",{className:"space-y-4",children:[Q!=null&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Vd,{value:Q}),I&&a.jsx(te,{variant:"secondary",size:"sm",onClick:()=>{c(),g("/settings")},children:"Open settings"})]}),a.jsx(ze,{id:"ssl-domain",label:"Domain name",placeholder:"example.com",value:h,onChange:F=>x(F.target.value),error:_.domain,hint:"An A or AAAA record for this name must point at this server for an HTTP challenge.",list:hg,autoComplete:"off",spellCheck:!1,disabled:Te}),a.jsx("datalist",{id:hg,children:s.map(F=>a.jsx("option",{value:F.name},F.name))}),a.jsx(ze,{id:"ssl-email",label:"ACME email",optional:!0,type:"email",placeholder:"admin@example.com",value:b,onChange:F=>j(F.target.value),error:_.email,hint:"Used by Let’s Encrypt for expiry notices. Falls back to the email saved in Settings.",autoComplete:"email",disabled:Te}),xe&&a.jsxs(Se,{tone:"info",title:"Wildcard certificate",children:["Wildcard names like ",a.jsx("span",{className:"font-mono",children:"*.example.com"})," can only be validated with a DNS TXT record, so the DNS challenge is selected."]}),a.jsxs("fieldset",{className:"rounded-md border border-line p-3.5",disabled:Te,children:[a.jsx("legend",{className:"px-1 text-xs font-medium text-muted",children:"Challenge method"}),a.jsxs("div",{className:"mt-1 space-y-2",children:[a.jsxs("label",{className:ie("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",E==="http"&&!xe?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",(xe||Te)&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"http",checked:E==="http"&&!xe,disabled:xe||Te,onChange:()=>U("http"),className:"mt-0.5 size-4 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm text-ink",children:"HTTP challenge"}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:"nginx answers the ACME challenge on port 80, so it can keep running."})]})]}),a.jsxs("label",{className:ie("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",E==="dns"?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",Te&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"dns",checked:E==="dns",disabled:Te,onChange:()=>U("dns"),className:"mt-0.5 size-4 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm text-ink",children:"DNS challenge"}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:"You add a TXT record at your DNS provider. Works for names that do not point at this server yet."})]})]})]})]}),a.jsx(kl,{checked:y&&!xe,onChange:N,disabled:xe||Te,label:h.trim()?`Also cover www.${h.trim().replace(/^\*\./,"")}`:"Also cover the www subdomain",hint:xe?"A wildcard certificate already covers every subdomain.":"Both names are added to the same certificate."})]}),S==="dns"&&M&&a.jsxs("div",{className:"space-y-4",children:[a.jsx(Se,{tone:"warning",title:"Add this DNS TXT record",children:"Create the record at your DNS provider, then confirm. The challenge waits up to ten minutes; nothing is written to nginx while it waits."}),a.jsxs("dl",{className:"space-y-2.5 rounded-md border border-line bg-raised/40 p-3.5",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Name"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-xs text-ink",children:M.txtName}),a.jsx(vt,{value:M.txtName,label:"Copy record name"})]}),a.jsxs("div",{className:"flex items-start gap-2 border-t border-line pt-2.5",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Value"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-xs text-ink",children:M.txtValue}),a.jsx(vt,{value:M.txtValue,label:"Copy record value"})]})]}),a.jsx("p",{className:"text-xs text-faint",children:"DNS changes can take a few minutes to propagate. Confirming checks that the value is publicly visible before Let’s Encrypt does."}),ae&&a.jsx(nS,{error:ae})]}),S==="success"&&W&&a.jsxs("div",{className:"space-y-4",children:[a.jsx(eS,{result:W.result,title:`Certificate issued for ${W.domain}`}),a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(zs,{className:"mt-0.5 size-3.5 shrink-0 text-faint","aria-hidden":"true"}),a.jsx("p",{children:"The files are on disk. To serve them, edit a domain, enable SSL and use these paths."})]}),a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-raised/40 px-3.5 py-2.5 text-xs text-muted",children:[a.jsx(Yi,{className:"size-3.5 shrink-0 text-faint","aria-hidden":"true"}),"Rename or move these files only after updating the domain config; nginx reads them by path."]})]})]})}const lS={valid:{label:"Valid",tone:"ok"},expiring:{label:"Expiring",tone:"warn"},expired:{label:"Expired",tone:"bad"},error:{label:"Unreadable",tone:"bad"}};function sS(s){return s===null?"text-faint":s<0?"text-bad":s<30?"text-warn":"text-ink"}function mg(s){const o=[];return s.summary&&o.push(s.summary),s.fellBack&&o.push(`nginx was stopped for ${_y(s.nginxDownMs)} while the challenge ran.`),s.staging&&o.push("This is a staging certificate that browsers will not trust."),o.join(" ")||"The certificate was renewed."}function iS(s){return s.error&&typeof s.error=="object"?s.error:typeof s.error=="string"?{step:s.error,cause:s.detail}:s.detail??"No certificate was issued."}function rS(){Bn("SSL certificates");const s=Tt(),o=hn(),c=qi(),u=bt(L=>re.ssl.list(L)),[f,m]=qo(),g=f.get("new")==="1"||!!f.get("domain"),h=f.get("domain")??"",x=bt(L=>re.domains.list(L),[],{enabled:g}),[b,j]=p.useState(null),[y,N]=p.useState(null),[E,U]=p.useState(null);zl(u.reload),As(["ssl","domains"],u.reload);const S=u.data,k=p.useMemo(()=>{const L=S??[];return{total:L.length,valid:L.filter(X=>X.status==="valid").length,expiring:L.filter(X=>X.status==="expiring"||X.daysLeft!==null&&X.daysLeft>=0&&X.daysLeft<30).length,expired:L.filter(X=>X.status==="expired"||X.daysLeft!==null&&X.daysLeft<0).length,error:L.filter(X=>X.status==="error").length}},[S]),_=p.useMemo(()=>(S??[]).filter(L=>L.daysLeft!==null&&L.daysLeft<30),[S]),z=k.expiring>0||k.expired>0||k.error>0,Q=()=>m({},{replace:!0}),A=()=>m({new:"1"}),Y=async L=>{if(!b){j(L.domain);try{const X=await re.ssl.renew(L.domain);s.success(`${L.domain} renewed`,mg(X)),u.reload()}catch(X){N({domain:L.domain,error:X})}finally{j(null)}}},ne=async()=>{if(!(b||_.length===0||!await o({title:`Renew ${kn(_.length,"certificate")}?`,body:"Every certificate expiring within 30 days is renewed one at a time. nginx keeps running unless a challenge has to fall back to standalone mode, which stops it briefly.",confirmLabel:"Renew now",tone:"accent"}))){j("all");try{const X=await re.ssl.renewAll();U(X);const Z=X.filter(ae=>!ae.success).length;X.length===0?s.info("Nothing to renew","No certificate expires within 30 days."):Z===0?s.success(`${kn(X.length,"certificate")} renewed`,"The new certificates are already on disk."):s.warning("Some certificates were not renewed",`${X.length-Z} renewed, ${Z} failed.`),u.reload()}catch(X){N({domain:null,error:X})}finally{j(null)}}},M=y?.error instanceof Be&&y.error.code==="email_required";return a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"SSL certificates",description:"Let’s Encrypt certificates managed by this installation. Renewals keep nginx running where possible.",meta:S?a.jsxs("span",{className:"text-2xs text-faint",children:[kn(k.total,"certificate")," · ",k.valid," valid"]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",size:"sm",loading:u.loading,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:u.reload,children:"Refresh"}),a.jsxs(te,{variant:"secondary",size:"sm",disabled:_.length===0||b!==null,loading:b==="all",onClick:ne,children:["Renew expiring",_.length>0?` (${_.length})`:""]}),a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(Na,{className:"size-3.5","aria-hidden":"true"}),onClick:A,children:"New certificate"})]})}),z&&a.jsxs(Se,{tone:k.expired>0||k.error>0?"danger":"warning",title:"Certificates need attention",className:"mb-4",children:[[k.expired>0?`${k.expired} expired`:null,k.expiring>0?`${k.expiring} expiring within 30 days`:null,k.error>0?`${k.error} unreadable`:null].filter(Boolean).join(" · "),". Renewing uses the same domain; an unreadable certificate is replaced by a freshly issued one."]}),u.error&&!S?a.jsx(kt,{error:u.error,onRetry:u.reload}):S?S.length===0?a.jsx(Xe,{children:a.jsx(En,{icon:a.jsx(wa,{className:"size-5","aria-hidden":"true"}),title:"No certificates yet",description:"Issue a Let’s Encrypt certificate for a domain, then point the domain’s SSL settings at its files.",action:a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(Na,{className:"size-3.5","aria-hidden":"true"}),onClick:A,children:"Issue a certificate"})})}):a.jsxs("div",{className:"space-y-3",children:[u.error&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known list. ",u.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:u.reload,children:"Try again"})]}),a.jsx(Xe,{className:"overflow-hidden",children:a.jsx("ul",{className:"divide-y divide-line",children:S.map(L=>{const X=lS[L.status]??{label:L.status,tone:"neutral"},Z=b===L.domain;return a.jsxs("li",{className:"flex flex-col gap-2.5 px-4 py-3 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 sm:flex-row sm:items-center sm:gap-4",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[a.jsx(Ft,{tone:X.tone,pulse:L.status==="valid",className:"mt-1.5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate font-mono text-sm font-semibold text-ink",children:L.domain}),a.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-muted",children:L.status==="error"?a.jsx("span",{children:"Certificate files are missing or unreadable"}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:["Expires ",Sy(L.expiry)]}),a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{className:ie("font-mono font-medium",sS(L.daysLeft)),children:L.daysLeft!==null?L.daysLeft<0?`${Math.abs(L.daysLeft)}d overdue`:`${L.daysLeft}d`:ks(L.daysLeft)}),L.autoRenew&&L.autoRenew!=="off"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{title:L.autoRenew==="auto"?"The background service renews this certificate on its own.":L.autoRenew==="manual"?"DNS-validated (wildcard) certificates need a TXT record added by hand, so they are not renewed automatically.":"No enabled domain serves this certificate, so it is not renewed automatically.",className:L.autoRenew==="manual"?"text-warn":void 0,children:L.autoRenew==="auto"?`Auto-renews ${L.autoRenewDays??7}d before expiry`:L.autoRenew==="manual"?"Manual renewal (DNS)":"Not in use"})]})]})})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pl-7 sm:w-28 sm:shrink-0 sm:pl-0",children:a.jsx(je,{tone:X.tone,dot:!0,children:X.label})}),a.jsx("div",{className:"flex shrink-0 items-center justify-end pl-7 sm:w-24 sm:pl-0",children:a.jsx(te,{variant:"secondary",size:"sm",loading:Z,disabled:b!==null&&!Z,onClick:()=>Y(L),children:"Renew"})})]},L.domain)})})})]}):a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-14 rounded-lg"}),a.jsx(Pe,{className:"h-[280px] rounded-lg"})]}),g&&a.jsx(aS,{domains:x.data??[],initialDomain:h,onClose:Q,onIssued:()=>u.reload()},h||"new"),a.jsx(Cn,{open:y!==null,onClose:()=>N(null),title:y?.domain?`${y.domain} was not renewed`:"Renewal failed",description:"The certificate already on disk was not replaced.",size:"md",footer:a.jsxs(a.Fragment,{children:[M&&a.jsx(te,{variant:"secondary",onClick:()=>{N(null),c("/settings")},children:"Open settings"}),a.jsx(te,{variant:"primary",onClick:()=>N(null),children:"Close"})]}),children:y&&a.jsx(Vd,{value:y.error,title:"The certificate could not be renewed"})}),a.jsx(Cn,{open:E!==null,onClose:()=>U(null),title:"Renewal results",description:E?`${E.filter(L=>L.success).length} of ${E.length} certificates renewed.`:void 0,size:"lg",footer:a.jsx(te,{variant:"secondary",onClick:()=>U(null),children:"Close"}),children:E&&E.length===0?a.jsx(En,{icon:a.jsx(wa,{className:"size-5","aria-hidden":"true"}),title:"Nothing to renew",description:"No certificate expires within 30 days."}):a.jsx("ul",{className:"space-y-2.5",children:(E??[]).map(L=>a.jsx("li",{className:"rounded-md border border-line bg-raised/30 px-3.5 py-3",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[L.success?a.jsx(Tl,{className:"mt-0.5 size-4 shrink-0 text-ok","aria-hidden":"true"}):a.jsx(Ud,{className:"mt-0.5 size-4 shrink-0 text-bad","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-sm font-medium text-ink",children:L.domain}),L.success?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:mg(L)}),L.configRegenerated&&a.jsx("p",{className:"mt-1 text-2xs text-faint",children:"The nginx config was regenerated so it can answer the ACME challenge."})]}):a.jsx("div",{className:"mt-2",children:a.jsx(Vd,{value:iS(L),title:`${L.domain} was not renewed`})})]})]})},L.domain))})})]})}function Oy(s,o={}){const{client:c,connected:u}=ea(),f=o.enabled??!0,m=o.limit??500,[g,h]=p.useState([]),[x,b]=p.useState(!1),[j,y]=p.useState(0),N=p.useRef(x);N.current=x,p.useEffect(()=>{if(!c||!f)return;const k=_=>{if(_.logFile===s){if(N.current){y(z=>Math.min(z+1,999));return}h(z=>{const Q=[...z,_.line];return Q.length>m?Q.slice(Q.length-m):Q})}};return c.on("logs:line",k),()=>c.off("logs:line",k)},[c,f,m,s]),p.useEffect(()=>{h([]),y(0)},[f,s]),p.useEffect(()=>{if(!(!c||!f||!u))return h([]),y(0),c.emit("logs:subscribe",{logFile:s}),()=>c.emit("logs:unsubscribe")},[c,u,f,s]);const E=p.useCallback(()=>{h([]),y(0)},[]),U=p.useCallback(()=>{h([]),y(0),!(!c||!f)&&(c.emit("logs:unsubscribe"),c.emit("logs:subscribe",{logFile:s}))},[c,f,s]),S=p.useCallback(k=>{b(k),k||y(0)},[]);return{lines:g,paused:x,missed:j,connected:u,clear:E,restart:U,setPaused:S}}const ko={start:"Start nginx",stop:"Stop nginx",restart:"Restart nginx",reload:"Reload nginx",test:"Test configuration"},oS={start:()=>re.nginx.start(),stop:()=>re.nginx.stop(),restart:()=>re.nginx.restart(),reload:()=>re.nginx.reload(),test:()=>re.nginx.test()};function xg(s){return s instanceof Be?typeof s.payload.output=="string"&&s.payload.output?s.payload.output:typeof s.payload.error=="string"&&s.payload.error?s.payload.error:s.message:s instanceof Error?s.message:"The action failed."}function cS(s){return/\[(error|crit|emerg|alert)\]/i.test(s)?"text-bad":/\[warn(ing)?\]/i.test(s)?"text-warn":"text-muted"}function uS(){Bn("Nginx");const s=Tt(),o=hn(),{nginxStatus:c,connectionError:u}=ea(),f=bt(P=>re.nginx.status(P)),m=bt(P=>re.nginx.configs(P)),[g,h]=p.useState(null),[x,b]=p.useState(null),[j,y]=p.useState(null),[N,E]=p.useState(null),[U,S]=p.useState(""),[k,_]=p.useState(""),[z,Q]=p.useState(!1),[A,Y]=p.useState(!1),[ne,M]=p.useState(null),[L,X]=p.useState(null),Z=p.useRef(null),ae=p.useRef(null),H=Oy("error",{limit:300}),W=p.useRef(null),[ve,xe]=p.useState(!0);p.useEffect(()=>{f.data&&h(f.data)},[f.data]),p.useEffect(()=>{c&&h(c)},[c]),p.useEffect(()=>{const P=W.current;P&&ve&&(P.scrollTop=P.scrollHeight)},[H.lines,ve]);const ee=N!==null&&U!==k;p.useEffect(()=>{if(!ee)return;const P=F=>{F.preventDefault(),F.returnValue=""};return window.addEventListener("beforeunload",P),()=>window.removeEventListener("beforeunload",P)},[ee]);const oe=()=>{f.reload(),m.reload()};zl(oe),As("nginx",oe);async function $(P){if(!(!P||P===N||z||A)&&!(ee&&!await o({title:"Discard unsaved changes?",body:`${N} has edits that were not saved.`,confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}))){E(P),Q(!0),M(null),X(null);try{const F=await re.nginx.getConfig(P);S(F.content),_(F.content)}catch(F){M(F),S(""),_("")}finally{Q(!1)}}}p.useEffect(()=>{N||!m.data?.length||$(m.data[0])},[m.data,N]);const le=async P=>{if(!x&&!((P==="stop"||P==="restart")&&!await o({title:P==="stop"?"Stop nginx?":"Restart nginx?",body:P==="stop"?"Every site nginx serves goes offline until it is started again.":"Open connections are dropped for a moment while nginx restarts.",confirmLabel:P==="stop"?"Stop nginx":"Restart nginx",tone:"danger"}))){b(P),y(null);try{const F=await oS[P]();y({action:P,ok:F.success,output:F.output}),F.success?(s.success(`${ko[P]} succeeded`,P==="test"?"nginx -t accepted the configuration.":void 0),P!=="test"&&f.reload()):s.error(`${ko[P]} failed`,F.output||void 0)}catch(F){const Ne=xg(F);y({action:P,ok:!1,output:Ne}),s.error(`${ko[P]} failed`,Ne)}finally{b(null)}}},ke=async()=>{if(!(!N||A||z||!ee)){Y(!0),X(null);try{const P=await re.nginx.saveConfig(N,U);_(U),X({ok:!0,output:P.output||"Saved and tested successfully."}),s.success("Configuration saved","nginx -t passed. Reload nginx to apply it.")}catch(P){X({ok:!1,output:xg(P)}),s.error("Configuration rejected","The previous file was restored.")}finally{Y(!1)}}},Te=()=>{S(k),X(null)},Ie=p.useMemo(()=>{const P=U.split(`
434
- `).length;return Array.from({length:Math.max(P,1)},(F,Ne)=>Ne+1)},[U]),qe=!!g?.running,T=!g&&(f.loading||!!f.error),I=H.lines.join(`
435
- `);return a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"Nginx",description:"Service controls, configuration files and the error log, without leaving the dashboard.",actions:a.jsx(te,{variant:"secondary",size:"sm",loading:f.loading||m.loading,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>{oe(),H.restart()},children:"Refresh"})}),f.error&&!g?a.jsx(kt,{error:f.error,onRetry:f.reload}):T?a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-24 rounded-lg"}),a.jsx(Pe,{className:"h-[380px] rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[f.error&&g&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known status. ",f.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:f.reload,children:"Try again"})]}),a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx("div",{className:ie("h-0.5 w-full",qe?"bg-ok/60":"bg-bad/60"),"aria-hidden":"true"}),a.jsxs(Sn,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3.5",children:[a.jsxs("div",{className:"relative flex size-11 shrink-0 items-center justify-center rounded-lg border border-line bg-raised",children:[a.jsx(Rs,{className:"size-5 text-ink","aria-hidden":"true"}),a.jsx(Ft,{tone:qe?"ok":"bad",pulse:qe,className:"absolute -right-0.5 -top-0.5 ring-2 ring-surface"})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-base font-semibold text-ink",children:qe?"nginx is running":"nginx is stopped"}),g?.pid!==null&&g?.pid!==void 0&&qe&&a.jsxs(je,{tone:"neutral",children:["pid ",g.pid]})]}),a.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted",children:g?.version??"Version unavailable"}),g?.error&&a.jsx("p",{className:"mt-1 text-xs text-bad",children:g.error})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[qe?a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",size:"sm",loading:x==="reload",disabled:x!==null&&x!=="reload",onClick:()=>le("reload"),children:"Reload"}),a.jsx(te,{variant:"secondary",size:"sm",loading:x==="restart",disabled:x!==null&&x!=="restart",onClick:()=>le("restart"),children:"Restart"}),a.jsx(te,{variant:"danger",size:"sm",loading:x==="stop",disabled:x!==null&&x!=="stop",onClick:()=>le("stop"),children:"Stop"})]}):a.jsx(te,{variant:"primary",size:"sm",loading:x==="start",disabled:x!==null&&x!=="start",onClick:()=>le("start"),children:"Start nginx"}),a.jsx("span",{className:"mx-0.5 hidden h-6 w-px bg-line sm:block","aria-hidden":"true"}),a.jsx(te,{variant:"secondary",size:"sm",loading:x==="test",disabled:x!==null&&x!=="test",onClick:()=>le("test"),children:"Test config"})]})]}),j&&a.jsx("div",{className:"border-t border-line px-4 py-3 sm:px-5",children:a.jsx(Se,{tone:j.ok?"success":"danger",title:`${ko[j.action]} ${j.ok?"succeeded":"failed"}`,children:j.output&&a.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:j.output})})})]}),a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-col gap-3 border-b border-line px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Configuration"}),ee&&a.jsx(je,{tone:"warn",children:"Unsaved changes"})]}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Every save is written, tested with nginx -t, and rolled back if nginx rejects it."})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(tl,{"aria-label":"Configuration file",value:N??"",disabled:A||z||!m.data?.length,onChange:P=>void $(P.target.value),className:"w-full sm:w-60",children:[a.jsx("option",{value:"",disabled:!0,children:"Select a config file…"}),(m.data??[]).map(P=>a.jsx("option",{value:P,children:P},P))]}),a.jsx(te,{variant:"ghost",size:"sm",disabled:!ee||A,icon:a.jsx(pN,{className:"size-3.5","aria-hidden":"true"}),onClick:Te,children:"Revert"}),a.jsx(te,{variant:"primary",size:"sm",disabled:!N||!ee,loading:A,icon:a.jsx(Bd,{className:"size-3.5","aria-hidden":"true"}),onClick:ke,children:"Save"})]})]}),m.error&&!m.data?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx(kt,{error:m.error,onRetry:m.reload})}):m.data?m.data.length===0?a.jsx("div",{className:"px-4 py-14 text-center text-sm text-muted sm:px-5",children:"No configuration files were found."}):z?a.jsxs("div",{className:"flex h-[360px] items-center justify-center gap-2 text-sm text-muted",children:[a.jsx(Ot,{className:"spin size-4","aria-hidden":"true"}),"Loading configuration…"]}):ne?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx(kt,{error:ne,title:"Could not load this configuration",onRetry:()=>N?void $(N):void 0})}):N?a.jsxs("div",{className:"relative flex h-[min(56vh,520px)] min-h-[280px] overflow-hidden bg-canvas",children:[a.jsx("div",{ref:ae,"aria-hidden":"true",className:"config-editor pointer-events-none w-12 shrink-0 overflow-hidden border-r border-line bg-inset/40 py-3 pr-2 text-right text-faint",children:Ie.map(P=>a.jsx("div",{children:P},P))}),a.jsx("textarea",{ref:Z,value:U,onChange:P=>S(P.target.value),onScroll:()=>{ae.current&&Z.current&&(ae.current.scrollTop=Z.current.scrollTop)},onKeyDown:P=>{(P.metaKey||P.ctrlKey)&&P.key.toLowerCase()==="s"&&(P.preventDefault(),ke())},wrap:"off",spellCheck:!1,"aria-label":N?`${N} contents`:"nginx configuration",className:"config-editor h-full w-full resize-none bg-transparent py-3 pl-4 pr-4 text-ink caret-accent outline-none"})]}):a.jsx("div",{className:"px-4 py-14 text-center text-sm text-muted sm:px-5",children:"Select a configuration file to start editing."}):a.jsxs("div",{className:"space-y-2 p-4 sm:p-5",children:[a.jsx(Pe,{className:"h-5 w-48"}),a.jsx(Pe,{className:"h-[300px]"})]}),L&&a.jsxs("div",{className:ie("border-t px-4 py-3 sm:px-5",L.ok?"border-ok/25 bg-ok-soft":"border-bad/25 bg-bad-soft"),children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("p",{className:ie("text-xs font-medium",L.ok?"text-ok":"text-bad"),children:L.ok?"Saved — nginx test passed":"Save rejected — the previous file was restored"}),L.ok&&a.jsx(te,{variant:"secondary",size:"sm",loading:x==="reload",disabled:x!==null&&x!=="reload",onClick:()=>le("reload"),children:"Reload nginx"})]}),L.output&&a.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:L.output})]})]}),a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-3 sm:px-5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Error log"}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(Ft,{tone:H.paused?"warn":H.connected?"ok":"neutral",pulse:!H.paused&&H.connected}),H.paused?"Paused":H.connected?"Live":"Connecting…"]}),H.paused&&H.missed>0&&a.jsxs(je,{tone:"warn",children:[H.missed," new"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[I&&a.jsx(vt,{value:I,label:"Copy lines",withText:!0}),a.jsx(ft,{label:H.paused?"Resume the log stream":"Pause the log stream",size:"sm",onClick:()=>H.setPaused(!H.paused),children:H.paused?a.jsx(Go,{className:"size-3.5","aria-hidden":"true"}):a.jsx(uy,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ft,{label:"Clear the log view",size:"sm",onClick:H.clear,disabled:H.lines.length===0,children:a.jsx(Ot,{className:"size-3.5 rotate-45","aria-hidden":"true"})})]})]}),a.jsx("div",{ref:W,"aria-label":"Recent nginx error log",onScroll:P=>{const F=P.currentTarget;xe(F.scrollHeight-F.scrollTop-F.clientHeight<40)},className:"h-64 overflow-y-auto bg-canvas px-4 py-3 font-mono text-2xs leading-relaxed sm:px-5",children:!H.connected&&H.lines.length===0?a.jsx("p",{className:"text-faint",children:"Waiting for the live stream…"}):H.lines.length===0?a.jsx("p",{className:"text-faint",children:"No errors logged."}):H.lines.map((P,F)=>a.jsx("div",{className:ie("whitespace-pre-wrap break-all py-0.5",cS(P)),children:P},F))}),u&&a.jsxs("div",{className:"border-t border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["The live log stream is disconnected. New lines appear once the dashboard socket reconnects."," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:H.restart,children:"Try again"})]})]})]})]})}const dS=[{value:"discord",label:"Discord",description:"Post alerts to a channel through a webhook URL.",icon:Oo},{value:"telegram",label:"Telegram",description:"Send alerts through a bot to a chat or group.",icon:fy}];function fS(s){return{name:s?.name??"",type:s?.type??"discord",webhookUrl:s?.webhookUrl??"",botToken:s?.botToken??"",chatId:s?.chatId??"",message:s?.message??""}}function hS(s){if(s instanceof Be){const o=typeof s.payload.detail=="string"?s.payload.detail:null;return o||s.message}return s instanceof Error?s.message:"The channel could not be saved."}function mS({channel:s,onClose:o,onSaved:c}){const u=hn(),f=s!==null,m=p.useRef(fS(s)),[g,h]=p.useState(m.current),[x,b]=p.useState({}),[j,y]=p.useState(null),[N,E]=p.useState(!1),U=Object.keys(g).some(z=>g[z]!==m.current[z]),S=(z,Q)=>{h(A=>({...A,[z]:Q})),b(A=>({...A,[z]:void 0})),y(null)},k=()=>{if(!N){if(!U){o();return}u({title:f?"Discard channel changes?":"Discard this channel?",body:"Nothing has been sent to the server yet.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}).then(z=>{z&&o()})}},_=async()=>{if(N)return;const z={};if(g.name.trim()||(z.name="Give the channel a name."),g.type==="discord"){const A=g.webhookUrl.trim();A?/^https:\/\/\S+$/i.test(A)||(z.webhookUrl="Enter an https:// URL without spaces."):z.webhookUrl="A Discord webhook URL is required."}else g.botToken.trim()||(z.botToken="The bot token is required."),g.chatId.trim()||(z.chatId="The chat ID is required.");if(b(z),Object.keys(z).length>0)return;const Q={name:g.name.trim(),type:g.type,...g.type==="discord"?{webhookUrl:g.webhookUrl.trim(),message:g.message.trim()}:{botToken:g.botToken.trim(),chatId:g.chatId.trim()}};E(!0),y(null);try{const A=s?await re.settings.channels.update(s.id,Q):await re.settings.channels.create(Q);c(A,!f)}catch(A){y(hS(A))}finally{E(!1)}};return a.jsx(Cn,{open:!0,onClose:k,title:f?`Edit ${s.name}`:"New notification channel",description:f?"Change where this channel delivers, or how its messages look.":"Add a Discord webhook or a Telegram bot. Domains choose their channels per event.",preventClose:N,footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",onClick:k,disabled:N,children:"Cancel"}),a.jsx(te,{variant:"primary",type:"submit",form:"channel-form",loading:N,children:f?"Save channel":"Create channel"})]}),children:a.jsxs("form",{id:"channel-form",onSubmit:z=>{z.preventDefault(),_()},className:"space-y-4",children:[j&&a.jsx(Se,{tone:"danger",title:"Could not save the channel",children:j}),a.jsx(ze,{label:"Name",value:g.name,onChange:z=>S("name",z.target.value),placeholder:"Production Discord",error:x.name,autoFocus:!0}),a.jsxs("fieldset",{disabled:f||N,children:[a.jsx("legend",{className:"mb-1.5 text-xs font-medium text-muted",children:"Type"}),a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:dS.map(z=>{const Q=g.type===z.value;return a.jsxs("label",{className:ie("flex cursor-pointer items-start gap-2.5 rounded-md border p-3 transition-colors duration-[var(--ez-motion-fast)]",Q?"border-accent bg-accent-soft":"border-line bg-canvas hover:border-line-strong",(f||N)&&"cursor-not-allowed opacity-70"),children:[a.jsx("input",{type:"radio",name:"channel-type",value:z.value,checked:Q,onChange:()=>S("type",z.value),className:"mt-0.5 size-3.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(z.icon,{className:"size-3.5 text-muted","aria-hidden":"true"}),z.label]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-faint",children:z.description})]})]},z.value)})}),f&&a.jsx(Cs,{children:"The channel type cannot be changed after it is created."})]}),g.type==="discord"?a.jsxs(a.Fragment,{children:[a.jsx(ze,{label:"Webhook URL",value:g.webhookUrl,onChange:z=>S("webhookUrl",z.target.value),placeholder:"https://discord.com/api/webhooks/…",error:x.webhookUrl,hint:"Create one in Discord under Channel settings → Integrations → Webhooks.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsxs("div",{children:[a.jsx(ze,{label:"Message prefix",optional:!0,value:g.message,onChange:z=>S("message",z.target.value),placeholder:"<@&1280907071813976196> or @team",hint:"Prepended to every alert in this channel.",spellCheck:!1}),a.jsxs("div",{className:"mt-2 rounded-md border border-info/25 bg-info-soft px-3 py-2 text-2xs text-muted",children:["Tip: to ping a Discord role, paste its mention as"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-[10px] text-ink",children:"<@&RoleId>"})," ","— for example"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-[10px] text-ink",children:"<@&1280907071813976196>"}),". The role is mentioned on every alert."]})]})]}):a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(ze,{label:"Bot token",value:g.botToken,onChange:z=>S("botToken",z.target.value),placeholder:"123456:ABC…",error:x.botToken,hint:"From @BotFather.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(ze,{label:"Chat ID",value:g.chatId,onChange:z=>S("chatId",z.target.value),placeholder:"-1001234567890",error:x.chatId,hint:"Groups start with a minus sign.",className:"font-mono",spellCheck:!1,autoComplete:"off"})]})]})})}const xS={nginx_down:"nginx",cert_expiry:"Certificate",domain_health:"Health check",test:"Test message"};function pS(s){return s.type==="nginx_down"?Rs:s.type==="cert_expiry"?ka:s.type==="domain_health"?Do:my}function gS(s){return s==="danger"?"text-bad":s==="warning"?"text-warn":s==="success"?"text-ok":s==="info"?"text-info":"text-muted"}function pg(s,o){return s instanceof Be?(typeof s.payload.detail=="string"?s.payload.detail:null)??s.message:s instanceof Error?s.message:o}function yS(s){if(!s)return"Webhook URL not set";try{const o=new URL(s),c=o.pathname.split("/").filter(Boolean).pop()??"";return`${o.host}/…${c.slice(-4)}`}catch{return"Webhook URL configured"}}function vS(s){return s.type==="discord"?yS(s.webhookUrl):`Chat ${s.chatId??"—"} · bot token saved`}function bS(){Bn("Notifications");const s=Tt(),o=hn(),{notifications:c,clearNotifications:u,connected:f,connectionError:m}=ea(),g=bt(A=>re.settings.channels.list(A)),h=bt(A=>re.domains.list(A)),[x,b]=p.useState(null),[j,y]=p.useState(null),[N,E]=p.useState(null),[,U]=p.useState(0);p.useEffect(()=>{const A=setInterval(()=>U(Y=>Y+1),3e4);return()=>clearInterval(A)},[]);const S=()=>{g.reload(),h.reload()};zl(S),As(["settings","domains"],S);const k=p.useMemo(()=>{const A=new Map;for(const Y of h.data??[]){if(!Y.enabled)continue;const ne=new Map;for(const M of Object.values(Y.notifications))if(M.enabled)for(const L of M.channelIds)ne.set(L,(ne.get(L)??0)+1);for(const[M,L]of ne){const X=A.get(M)??{domains:0,rules:0};X.domains+=1,X.rules+=L,A.set(M,X)}}return A},[h.data]),_=async A=>{if(!j){y(A.id);try{await re.settings.channels.test(A.id),s.success(`Test sent to ${A.name}`,"Check the channel to confirm the message arrived.")}catch(Y){s.error(`Test failed for ${A.name}`,pg(Y,"The test message could not be delivered."))}finally{y(null)}}},z=async A=>{if(!(N||!await o({title:`Delete ${A.name}?`,body:"Domains routed to this channel stop delivering alerts there. The domains themselves are not changed.",confirmLabel:"Delete channel",tone:"danger"}))){E(A.id);try{await re.settings.channels.remove(A.id),s.success("Channel deleted",`${A.name} will no longer receive alerts.`),g.reload()}catch(ne){s.error("Could not delete the channel",pg(ne,"The channel is still configured."))}finally{E(null)}}},Q=g.data;return a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"Notifications",description:"Delivery channels for alerts, and the events received in this session.",actions:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",size:"sm",loading:g.loading||h.loading,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:S,children:"Refresh"}),a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(Na,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>b({channel:null}),children:"New channel"})]})}),g.error&&!Q?a.jsx(kt,{error:g.error,onRetry:g.reload}):Q?a.jsxs("div",{className:"grid items-start gap-5 xl:grid-cols-[minmax(0,1fr)_380px]",children:[a.jsx("div",{className:"space-y-5",children:a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx(Pt,{title:"Channels",description:"Named Discord and Telegram destinations. Domains choose which channels receive their events.",actions:Q.length>0?a.jsx(je,{tone:"neutral",children:kn(Q.length,"channel")}):void 0}),g.error&&a.jsxs("div",{className:"border-b border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["Showing the last known list. ",g.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:g.reload,children:"Try again"})]}),Q.length===0?a.jsx(En,{icon:a.jsx(Oo,{className:"size-5","aria-hidden":"true"}),title:"No channels yet",description:"Add a Discord webhook or a Telegram bot, then route domain events to it. Until then, alerts stay in the dashboard only.",action:a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(Na,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>b({channel:null}),children:"New channel"})}):a.jsx("ul",{className:"divide-y divide-line/70",children:Q.map(A=>{const Y=A.type==="discord"?Oo:fy,ne=k.get(A.id),M=N===A.id;return a.jsxs("li",{className:"flex flex-col gap-3 px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("div",{className:ie("flex size-9 shrink-0 items-center justify-center rounded-md border border-line",A.type==="discord"?"bg-info-soft text-info":"bg-accent-soft text-accent-text"),children:a.jsx(Y,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:A.name}),a.jsx(je,{tone:"neutral",children:A.type==="discord"?"Discord":"Telegram"}),h.data&&(ne?a.jsxs(je,{tone:"ok",dot:!0,className:"cursor-default",children:[ne.domains," ",ne.domains===1?"domain":"domains"]}):a.jsx(je,{tone:"neutral",children:"Not routed yet"}))]}),a.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-muted",children:vS(A)}),A.type==="discord"&&A.message&&a.jsxs("p",{className:"mt-0.5 truncate text-2xs text-faint",children:["Prefix: ",A.message]})]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 pl-12 sm:pl-0",children:[a.jsx(te,{variant:"secondary",size:"sm",loading:j===A.id,disabled:j!==null&&j!==A.id,icon:a.jsx(c2,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void _(A),children:"Test"}),a.jsx(te,{variant:"ghost",size:"sm",disabled:M,icon:a.jsx(lf,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>b({channel:A}),children:"Edit"}),a.jsx(ft,{label:`Delete ${A.name}`,size:"sm",disabled:M,className:"hover:text-bad",onClick:()=>void z(A),children:a.jsx($i,{className:"size-3.5","aria-hidden":"true"})})]})]},A.id)})}),Q.length>0&&a.jsx("div",{className:"border-t border-line bg-raised/40 px-4 py-2.5 text-2xs text-faint sm:px-5",children:h.error?"Domain routing could not be loaded, so usage counts are hidden.":"Counts include enabled domains that route at least one event to a channel."})]})}),a.jsxs("div",{className:"space-y-5",children:[a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx(Pt,{icon:a.jsx(tg,{className:"size-4","aria-hidden":"true"}),title:"Recent events",description:"Received live while this page is open.",actions:a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(Ft,{tone:f?"ok":"warn",pulse:f}),f?"Live":"Reconnecting…"]})}),m&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(Se,{tone:"warning",children:m})}),c.length===0?a.jsx(En,{icon:a.jsx(tg,{className:"size-5","aria-hidden":"true"}),title:"No events yet",description:"Alerts appear here as they happen. The bell in the header keeps the same list between pages.",className:"py-9"}):a.jsxs(a.Fragment,{children:[a.jsx("ul",{className:"max-h-[420px] divide-y divide-line/70 overflow-y-auto",children:c.map(A=>{const Y=pS(A);return a.jsxs("li",{className:"flex items-start gap-2.5 px-4 py-2.5 sm:px-5",children:[a.jsx(Y,{className:ie("mt-0.5 size-4 shrink-0",gS(A.severity)),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-xs leading-snug text-ink",children:A.message}),a.jsxs("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-1.5 text-2xs text-faint",children:[a.jsx("span",{children:xS[A.type]??"Notification"}),A.domain&&a.jsxs("span",{children:["· ",A.domain]}),a.jsxs("span",{children:["· ",Zi(A.timestamp)]})]})]})]},A.id)})}),a.jsx("div",{className:"border-t border-line bg-raised/40 px-4 py-2 sm:px-5",children:a.jsx("button",{type:"button",onClick:u,className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Clear all events"})})]})]}),a.jsxs(Xe,{children:[a.jsx(Pt,{title:"How routing works",description:"Channels do nothing until a domain sends to them."}),a.jsxs(Sn,{className:"space-y-3",children:[a.jsx("ol",{className:"space-y-2.5",children:["Create a channel here and send it a test message.","Open a domain and pick channels for nginx downtime, certificate expiry and health events.","Toggle each event separately — turning one off keeps the others delivering."].map((A,Y)=>a.jsxs("li",{className:"flex gap-2.5 text-xs text-muted",children:[a.jsx("span",{className:"mt-0.5 flex size-4.5 shrink-0 items-center justify-center rounded-full bg-inset text-2xs font-semibold text-muted",children:Y+1}),a.jsx("span",{children:A})]},A))}),a.jsxs(yt,{to:"/domains",className:ba("secondary","sm","w-full"),children:["Open domains",a.jsx(zs,{className:"size-3.5","aria-hidden":"true"})]})]})]})]})]}):a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-40 rounded-lg"}),a.jsx(Pe,{className:"h-64 rounded-lg"})]}),x&&a.jsx(mS,{channel:x.channel,onClose:()=>b(null),onSaved:(A,Y)=>{b(null),g.reload(),s.success(Y?"Channel created":"Channel updated",Y?`${A.name} is ready to receive alerts.`:`${A.name} was saved.`)}},x.channel?.id??"new")]})}function gg(s,o){return s instanceof Be?typeof s.payload.detail=="string"?s.payload.detail:typeof s.payload.message=="string"?s.payload.message:s.message:s instanceof Error?s.message:o}function yg(s){return s==="online"?"ok":s==="errored"?"bad":s==="stopping"||s==="launching"?"warn":"neutral"}function jS(s){return s===null||s===0?"—":WN(s)}function NS(s){return s===null||s===0?"—":ky(s)}function vg(s,o){const c=o?.replace(/\\/g,"/").replace(/\/+$/,"").toLowerCase()??null;return[s.execPath,s.cwd].some(u=>{if(!u)return!1;const f=u.replace(/\\/g,"/").toLowerCase();return c&&f.startsWith(`${c}/modules/`)?!0:/(^|\/)(\.pm2|pm2)\/modules\//.test(f)})}function To({label:s,value:o}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:s}),a.jsx("div",{className:"mt-0.5 text-xs tabular-nums text-muted",children:o})]})}function el({label:s,value:o,detail:c,tone:u}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:s}),a.jsx("div",{className:ie("mt-0.5 text-sm font-medium",u??"text-ink"),children:o}),c&&a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:c})]})}function wS({command:s,guidance:o}){return a.jsxs("div",{className:"rounded-md border border-line bg-canvas p-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("code",{className:"break-all font-mono text-xs text-ink",children:s}),a.jsx(vt,{value:s,label:"Copy command",withText:!0})]}),a.jsx("p",{className:"mt-2 text-2xs leading-relaxed text-muted",children:o})]})}function bg({label:s,version:o,path:c,broken:u=!1,emptyLabel:f="Unknown"}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs text-faint",children:s}),a.jsx("div",{className:ie("text-xs font-medium",u?"text-warn":"text-ink"),children:o??(u?"Missing":f)}),a.jsx("div",{className:"break-all font-mono text-2xs text-faint",children:c??"—"})]})}function SS({runtime:s}){const o=rw(s);return o?a.jsxs("div",{className:"rounded-md border border-line bg-canvas/40 px-3.5 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Node runtime"}),o.broken?a.jsx(je,{tone:"warn",children:"service runtime missing"}):o.pinned?o.sameAsSystem?a.jsx(je,{tone:"neutral",children:"same as system"}):a.jsx(je,{tone:"info",children:"pinned copy"}):a.jsx(je,{tone:"warn",children:"not pinned"})]}),a.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[a.jsx(bg,{label:"Service Node",version:o.serviceVersion,path:o.servicePath,broken:o.broken,emptyLabel:o.pinned?"Unknown":"Not pinned"}),a.jsx(bg,{label:"System Node",version:o.systemVersion,path:o.systemPath})]}),o.manager&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["The system Node is managed by ",o.manager,". The service uses its own pinned binary so switching versions cannot break it."]}),!o.pinned&&!o.broken&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["No pinned Node was found. The service will start with whatever"," ",a.jsx("code",{className:"font-mono",children:"node"})," its launcher resolves;"," ",a.jsx("code",{className:"font-mono",children:"ezz service repair"})," pins one."]}),o.pinned&&!o.sameAsSystem&&!o.broken&&o.serviceVersion&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["The service is pinned to a different Node than this dashboard. That is normal after an upgrade; ",a.jsx("code",{className:"font-mono",children:"ezz service repair"})," re-pins it."]})]}):null}function kS({app:s,onClose:o}){const c=bt(f=>re.processes.logs(s.name,200,f)),u=(c.data?.lines??[]).join(`
436
- `);return a.jsx(Cn,{open:!0,onClose:o,title:`Logs — ${s.name}`,description:"The last 200 lines PM2 has written for this process.",size:"lg",footer:a.jsxs(a.Fragment,{children:[u.trim()&&a.jsx(vt,{value:u,label:"Copy logs",withText:!0}),a.jsx(te,{variant:"secondary",onClick:o,children:"Close"})]}),children:c.error&&!c.data?a.jsx(kt,{error:c.error,title:"Could not read the logs",onRetry:c.reload,className:"border-0"}):c.data?a.jsx("pre",{className:"max-h-[55vh] overflow-auto whitespace-pre-wrap break-all rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted",children:u.trim()?u:"(no output)"}):a.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted",children:[a.jsx(Ts,{}),"Reading logs…"]})})}function jg({app:s,isModule:o,busy:c,currentUser:u,onAction:f,onLogs:m}){const g=c?.name===s.name,h=!!(s.user&&u&&s.user!==u);return a.jsxs("li",{className:"px-4 py-3.5 sm:px-5",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(Ft,{tone:yg(s.status),pulse:s.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:s.name}),a.jsx(je,{tone:yg(s.status),children:s.status}),o&&a.jsx(je,{tone:"info",children:"module"}),h&&a.jsx(je,{tone:"warn",children:s.user})]}),(s.execPath||s.cwd)&&a.jsx("p",{className:"mt-0.5 truncate font-mono text-2xs text-faint",children:s.execPath??s.cwd})]}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5",children:[s.status==="online"?a.jsx(te,{variant:"secondary",size:"sm",loading:g&&c?.action==="stop",disabled:g||h,icon:a.jsx(xy,{className:"size-3","aria-hidden":"true"}),onClick:()=>f(s,"stop",o),children:"Stop"}):a.jsx(te,{variant:"secondary",size:"sm",loading:g&&c?.action==="start",disabled:g||h,icon:a.jsx(Go,{className:"size-3","aria-hidden":"true"}),onClick:()=>f(s,"start",o),children:"Start"}),a.jsx(te,{variant:"ghost",size:"sm",loading:g&&c?.action==="restart",disabled:g||h,icon:a.jsx(dy,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>f(s,"restart",o),children:"Restart"}),a.jsx(te,{variant:"ghost",size:"sm",disabled:g,icon:a.jsx(_o,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>m(s),children:"Logs"})]})]}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[a.jsx(To,{label:"CPU",value:jS(s.cpu)}),a.jsx(To,{label:"Memory",value:NS(s.memoryBytes)}),a.jsx(To,{label:"Uptime",value:of(s.uptimeMs)}),a.jsx(To,{label:"Restarts",value:s.unstableRestarts>0?`${s.restarts} · ${s.unstableRestarts} unstable`:String(s.restarts)})]})]})}function TS(){Bn("Processes");const s=Tt(),o=hn(),{service:c,loading:u,error:f,reload:m,applyBackgroundService:g}=Xi(),h=Qi(c),x=bt(X=>re.processes.list(X)),[b,j]=p.useState(null),[y,N]=p.useState(null),[E,U]=p.useState(null),[S,k]=p.useState(null),_=()=>{x.reload(),m()};Ss(x.reload,15e3),Ss(()=>{u||m()},15e3),zl(_);const z=async(X,Z,ae)=>{if(!b){if(Z==="stop"||Z==="restart"){const H=ae?Z==="stop"?X.name.toLowerCase().includes("logrotate")?`${X.name} rotates PM2's logs. Stopping it lets PM2 logs grow without limit until you start it again. It is a PM2 module, not one of your apps.`:`${X.name} is a PM2 module, not one of your apps. Stopping it changes how PM2 itself behaves.`:`${X.name} is a PM2 module. Restarting it briefly stops the behaviour it adds to PM2.`:`${X.name} is one of your own PM2 apps. ${Z==="stop"?"Stopping":"Restarting"} it affects whatever else relies on it.`;if(!await o({title:`${Z==="stop"?"Stop":"Restart"} ${X.name}?`,body:H,confirmLabel:ae&&Z==="stop"?"Stop module anyway":`${Z==="stop"?"Stop":"Restart"} anyway`,tone:"danger"}))return}j({name:X.name,action:Z});try{const H=await re.processes.action(X.name,Z);s.success(`${X.name}: ${Z} done`,H.output||void 0),_()}catch(H){s.error(`Could not ${Z} ${X.name}`,gg(H,"PM2 refused the action. Check the PM2 log for details."))}finally{j(null)}}},Q=async X=>{if(!h||E)return;const Z=h.startsAt==="logon"?"at your next logon":h.startsAt==="boot"?"at the next boot":"when the service starts";if(await o(X==="start"?{title:"Start the background service?",body:h.installed?`Monitoring and notifications keep running after this dashboard closes. From now on it also starts ${Z}.`:"The service is not installed; if it cannot start, the exact install command is shown instead.",confirmLabel:"Start service"}:X==="stop"?{title:"Stop the background service?",body:h.installed?`Monitoring and notifications pause while it is down. It returns ${Z} or as soon as you start it again.`:"Monitoring and notifications pause while it is down. It will not restart until you start it, because it is not installed.",confirmLabel:"Stop service",tone:"danger"}:{title:"Restart the background service?",body:"Monitoring pauses for a moment while the service restarts. Jobs resume when it is back up.",confirmLabel:"Restart service",tone:"danger"})){U(X),k(null);try{const H=await re.service[X]();g(H.backgroundService),s.success(X==="start"?"Background service started":X==="stop"?"Background service stopped":"Background service restarted",H.output?.trim()||void 0),m()}catch(H){if(H instanceof Be){if(H.payload.backgroundService&&g(H.payload.backgroundService),H.status===403&&H.code==="elevation_required"){k({kind:"elevation",action:X,command:typeof H.payload.command=="string"?H.payload.command:`ezz service ${X}`,shell:typeof H.payload.shell=="string"?H.payload.shell:null,message:typeof H.payload.message=="string"?H.payload.message:null});return}if(H.status===409&&H.code==="not_installed"){k({kind:"install",action:X,command:typeof H.payload.command=="string"?H.payload.command:c?.install.command??"ezz service install",shell:c?.install.shell??null,message:typeof H.payload.message=="string"?H.payload.message:null});return}if(H.status===409&&H.code==="already_running"){s.info("The background service is already running.",typeof H.payload.message=="string"?H.payload.message:void 0),m();return}s.error(`Could not ${X} the background service`,gg(H,"The service manager refused the action.")),m();return}s.error(`Could not ${X} the background service`,H instanceof Error?H.message:"The dashboard could not complete the action.")}finally{U(null)}}},A=(x.data?.apps??[]).filter(X=>!X.managed),Y=x.data?.currentUser??null,ne=x.data?.pm2Home??null,M=A.filter(X=>vg(X,ne)),L=A.filter(X=>!vg(X,ne));return a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"Processes",description:"The Easy DevOps background service, plus every PM2 app you run for yourself.",actions:a.jsx(te,{variant:"secondary",size:"sm",loading:x.loading||u,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:_,children:"Refresh"})}),x.error&&!x.data?a.jsx(kt,{error:x.error,onRetry:x.reload}):x.data?a.jsxs("div",{className:"space-y-5",children:[a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx("div",{className:ie("h-0.5 w-full",h?.running?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(Pt,{icon:a.jsx(hy,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Background service",h&&a.jsx(je,{tone:h.running?"ok":"warn",dot:!0,children:Mo(h)}),c?.dev&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Runs monitoring and notifications in the background, independent of this dashboard.",actions:h?h.running?a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",size:"sm",loading:E==="stop",disabled:E!==null,icon:a.jsx(xy,{className:"size-3","aria-hidden":"true"}),onClick:()=>void Q("stop"),children:"Stop"}),a.jsx(te,{variant:"secondary",size:"sm",loading:E==="restart",disabled:E!==null,icon:a.jsx(dy,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void Q("restart"),children:"Restart"})]}):a.jsx(te,{variant:"primary",size:"sm",loading:E==="start",disabled:E!==null,icon:a.jsx(Go,{className:"size-3","aria-hidden":"true"}),onClick:()=>void Q("start"),children:"Start"}):void 0}),a.jsxs(Sn,{className:"space-y-4",children:[S&&a.jsxs(Se,{tone:"warning",title:S.kind==="install"?"The background service is not installed":`${S.action==="start"?"Starting":S.action==="stop"?"Stopping":"Restarting"} needs ${S.shell??"a terminal with extra rights"}`,action:a.jsx(ft,{label:"Dismiss",size:"sm",onClick:()=>k(null),children:a.jsx(Vi,{className:"size-3.5","aria-hidden":"true"})}),children:[S.message&&a.jsx("p",{children:S.message}),a.jsxs("div",{className:"mt-2 rounded-md border border-line bg-canvas p-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("code",{className:"break-all font-mono text-xs text-ink",children:S.command}),a.jsx(vt,{value:S.command,label:"Copy command",withText:!0})]}),S.shell&&a.jsxs("p",{className:"mt-1.5 text-2xs text-faint",children:["Run it in ",S.shell,"."]})]}),a.jsx("p",{className:"mt-2 text-2xs text-faint",children:S.kind==="elevation"?"The dashboard cannot elevate itself or ask for a password. Run the command in a terminal you control.":"The command is run in a terminal, not from this dashboard."})]}),f&&!c?a.jsx(kt,{error:f,title:"Could not read the service state",onRetry:m,className:"border-0"}):h?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-5 sm:grid-cols-4",children:[a.jsx(el,{label:"Status",value:Mo(h),tone:h.running?"text-ok":"text-warn",detail:h.stoppedByUser&&h.stoppedAtLabel?`Stopped ${h.stoppedAtLabel}`:h.detail??void 0}),a.jsx(el,{label:"PID",value:h.pid===null?"—":String(h.pid)}),a.jsx(el,{label:"Uptime",value:of(h.uptimeMs)}),a.jsx(el,{label:"Installed",value:h.installed?"Yes":"No"}),a.jsx(el,{label:"Mode",value:h.mechanismLabel,detail:h.mechanismDetail}),a.jsx(el,{label:"Starts",value:h.startsAtLabel}),a.jsx(el,{label:"Monitoring runs in",value:h.jobsOwnerLabel}),a.jsx(el,{label:"Live channel",value:h.connected?"Connected":"Not connected"})]}),a.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1 text-2xs text-faint",children:[a.jsxs("span",{className:"min-w-0",children:["Data directory"," ",a.jsx("code",{className:"break-all font-mono text-muted",children:c?.dataDir??"—"})]}),h.version&&a.jsxs("span",{children:["Daemon ",a.jsx("code",{className:"font-mono text-muted",children:h.version})]})]}),h.runtime?a.jsx(SS,{runtime:h.runtime}):a.jsx("p",{className:"text-2xs text-faint",children:"The service and system Node versions are not available for this install."}),h.warnings.map(X=>a.jsx(Se,{tone:"warning",children:a.jsx("span",{className:"whitespace-pre-line",children:X})},X)),!h.running&&a.jsx(Se,{tone:"warning",title:h.stoppedByUser?"The background service is stopped":h.installed?"The background service is not running":"The background service is not set up",children:h.stoppedByUser?a.jsxs(a.Fragment,{children:["You stopped it",h.stoppedAtLabel?` on ${h.stoppedAtLabel}`:"",". Monitoring and notifications are paused until it starts again"," ",h.startsAt==="logon"?"at your next logon":h.startsAt==="boot"?"at the next boot":"when the service starts",". Use Start above, or run"," ",a.jsx("code",{className:"font-mono",children:"ezz service start"}),"."]}):h.installed?a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Start the service with ",a.jsx("code",{className:"font-mono",children:"ezz service start"}),", or use Start above."]}):a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Set up the service with"," ",a.jsx("code",{className:"font-mono",children:h.installCommand}),"."]})}),a.jsxs("details",{className:"rounded-md border border-line bg-canvas/40 px-3.5 py-3",children:[a.jsx("summary",{className:"cursor-pointer select-none text-xs font-medium text-ink",children:"Install or repair the service"}),a.jsxs("div",{className:"mt-3 space-y-2.5",children:[a.jsx(wS,{command:h.installCommand,guidance:h.installGuidance}),a.jsxs("p",{className:"text-2xs text-faint",children:["The command is run in a terminal, not from this dashboard."," ",h.startsAt==="logon"?"It starts the service at logon.":h.startsAt==="boot"?"It starts the service at boot.":"It sets the service up to start automatically."," ","It never asks for an account password."]})]})]})]}):a.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-muted",children:[a.jsx(Ts,{}),"Checking the background service…"]})]})]}),a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx(Pt,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Your PM2 apps",L.length>0&&a.jsx(je,{tone:"neutral",children:kn(L.length,"app")})]}),description:Y?`Apps PM2 is supervising for ${Y}. Easy DevOps itself is not one of them.`:"Apps PM2 is supervising for you. Easy DevOps itself is not one of them."}),x.data.pm2.installed&&x.data.hint&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(Se,{tone:"warning",children:x.data.hint})}),x.error&&a.jsxs("div",{className:"border-b border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["Showing the last known list. ",x.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:x.reload,children:"Try again"})]}),x.data.pm2.installed?L.length===0?a.jsx(En,{icon:a.jsx(_o,{className:"size-5","aria-hidden":"true"}),title:"No PM2 apps of your own",description:"Start an app with PM2 and it will appear here. Easy DevOps does not run itself under PM2."}):a.jsx("ul",{className:"divide-y divide-line/70",children:L.map(X=>a.jsx(jg,{app:X,isModule:!1,busy:b,currentUser:Y,onAction:z,onLogs:N},`${X.name}-${X.pmId??"x"}`))}):a.jsx(En,{icon:a.jsx(_o,{className:"size-5","aria-hidden":"true"}),title:"PM2 is not installed",description:"PM2 is optional. It is only for apps you run yourself; Easy DevOps uses its own background service."})]}),M.length>0&&a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx(Pt,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["PM2 modules",a.jsx(je,{tone:"neutral",children:kn(M.length,"module")})]}),description:"Modules extend PM2 itself and are not your apps. Stopping pm2-logrotate lets PM2 logs grow without limit."}),a.jsx("ul",{className:"divide-y divide-line/70",children:M.map(X=>a.jsx(jg,{app:X,isModule:!0,busy:b,currentUser:Y,onAction:z,onLogs:N},`${X.name}-${X.pmId??"x"}`))})]})]}):a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-56 rounded-lg"}),a.jsx(Pe,{className:"h-72 rounded-lg"})]}),y&&a.jsx(kS,{app:y,onClose:()=>N(null)})]})}function CS(s){return s?!/^[a-z0-9][a-z0-9-]{0,39}$/.test(s)||s.endsWith("-")?"Lower-case letters, digits and dashes, up to 40 characters.":null:"A name is required."}function ES(s){return/^ssh:\/\//.test(s)||/^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+:/.test(s)}function zS(s){const o={},c=s.split(/\r?\n/);for(let u=0;u<c.length;u++){const f=c[u];if(!f.trim()||f.trim().startsWith("#"))continue;const m=f.indexOf("=");if(m===-1)return{env:o,error:`Line ${u+1}: expected NAME=value.`};const g=f.slice(0,m).trim().replace(/^export\s+/,"");if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(g))return{env:o,error:`Line ${u+1}: "${g}" is not a valid variable name.`};let h=f.slice(m+1).trim();h.length>=2&&(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))&&(h=h.slice(1,-1)),o[g]=h}return{env:o,error:null}}function RS(s){return Object.keys(s).sort().map(o=>`${o}=${s[o]}`).join(`
437
- `)}function Ng(s){return s===void 0||s===!1?"":Array.isArray(s)?s.join(" && "):s}function My(s){return{install:Ng(s.install),build:Ng(s.build),start:s.start??"",port:s.port?String(s.port):"",healthPath:s.healthPath??"",skipInstall:s.install===!1||Array.isArray(s.install)&&s.install.length===0,skipBuild:s.build===!1||Array.isArray(s.build)&&s.build.length===0}}function AS(s){const o={};return s.skipInstall?o.install=!1:s.install.trim()&&(o.install=s.install.trim()),s.skipBuild?o.build=!1:s.build.trim()&&(o.build=s.build.trim()),s.start.trim()&&(o.start=s.start.trim()),s.port.trim()&&(o.port=Number(s.port)),s.healthPath.trim()&&(o.healthPath=s.healthPath.trim()),o}const Ly={running:{label:"Deploying",tone:"info"},success:{label:"Succeeded",tone:"ok"},failed:{label:"Failed",tone:"bad"},rolled_back:{label:"Rolled back",tone:"warn"}},DS={fetch:"Fetching the code",settings:"Reading project settings",pre:"Pre-deploy hook",install:"Installing",build:"Building",start:"Starting",health:"Health check",post:"Post-deploy hook",finish:"Finishing",done:"Done"};function hf(s){return DS[s]??s}const _S={manual:"Dashboard",webhook:"GitHub Actions",hub:"Hub",rollback:"Rollback"};function $o(s){return s?s.slice(0,7):"—"}function OS(s){const o=s.finishedAt??Date.now(),c=Math.max(0,Math.round((o-s.startedAt)/1e3));return c<60?`${c}s`:`${Math.floor(c/60)}m ${c%60}s`}function MS(s){return s==="online"?"ok":s==="errored"?"bad":s==="stopped"||s==="stopping"?"warn":"neutral"}function LS(s){const o=(m,g)=>m===!1?!1:Array.isArray(m)?m.length===0?!1:m.length===1?m[0]:m:m&&m.trim()?m:g,c={install:o(s.install,"npm ci"),build:o(s.build,"npm run build"),start:s.start?.trim()||"npm start",port:s.port??3e3,health:s.healthPath?.trim()||"/"},u=o(s.pre,""),f=o(s.post,"");return(u&&u!==""||f&&f!=="")&&(c.hooks={...u&&u!==""?{pre:u}:{},...f&&f!==""?{post:f}:{}}),`${JSON.stringify(c,null,2)}
438
- `}const US=`${JSON.stringify({install:"pip install -r requirements.txt",build:!1,start:"python app.py",port:8e3,health:"/health"},null,2)}
439
- `,HS=[{name:"install",meaning:"Run first, in a fresh checkout. A command, a list of commands, or false to skip.",without:"npm ci (yarn and pnpm are detected from the lockfile)"},{name:"build",meaning:"Run after install. Same forms.",without:'the "build" script, if package.json has one'},{name:"start",meaning:"The long-running process. One command, any language.",without:'the "start" script, else node <main>'},{name:"port",meaning:"The port the app listens on. Passed to it as PORT and used for the health check.",without:"no HTTP check; the process only has to stay up"},{name:"health",meaning:'A path that must answer before the deployment counts: "/healthz", or { "path": "/healthz", "timeout": 60 }.',without:'"/" with a 60-second limit'},{name:"hooks.pre",meaning:"Run before install — check the environment, fetch something.",without:"nothing"},{name:"hooks.post",meaning:"Run once the new release is live — warm a cache, notify someone. A failure is a warning; the release stays.",without:"nothing"}];function BS({items:s,value:o,onChange:c,ariaLabel:u,className:f}){const m=p.useRef(new Map),g=x=>{const b=s[x];b&&(c(b.id),m.current.get(b.id)?.focus())},h=(x,b)=>{x.key==="ArrowRight"?(x.preventDefault(),g((b+1)%s.length)):x.key==="ArrowLeft"?(x.preventDefault(),g((b-1+s.length)%s.length)):x.key==="Home"?(x.preventDefault(),g(0)):x.key==="End"&&(x.preventDefault(),g(s.length-1))};return a.jsx("div",{role:"tablist","aria-label":u,className:ie("flex gap-1 overflow-x-auto border-b border-line",f),children:s.map((x,b)=>{const j=x.id===o;return a.jsxs("button",{ref:y=>{y?m.current.set(x.id,y):m.current.delete(x.id)},id:`tab-${x.id}`,role:"tab",type:"button","aria-selected":j,"aria-controls":`panel-${x.id}`,tabIndex:j?0:-1,onClick:()=>c(x.id),onKeyDown:y=>h(y,b),className:ie("relative -mb-px flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2.5 text-sm font-medium transition-colors duration-[var(--ez-motion-fast)]",j?"border-accent text-ink":"border-transparent text-muted hover:border-line-strong hover:text-ink"),children:[x.label,x.count!==void 0&&a.jsx("span",{className:ie("rounded-pill px-1.5 py-0.5 text-2xs",j?"bg-accent-soft text-accent-text":"bg-inset text-faint"),children:x.count})]},x.id)})})}function Di({id:s,value:o,children:c}){return s!==o?null:a.jsx("div",{role:"tabpanel",id:`panel-${s}`,"aria-labelledby":`tab-${s}`,className:"page-enter",children:c})}function zo(s,o){return s instanceof Be||s instanceof Error?s.message:o}function qS({app:s,onClose:o,onDeleted:c}){const u=Tt(),[f,m]=p.useState(!1),[g,h]=p.useState(!1);p.useEffect(()=>{s&&m(!1)},[s]);const x=async()=>{if(!(!s||g)){h(!0);try{const b=await re.deployments.remove(s.id,f&&!!s.domain);b.warning?u.warning(`${s.id} deleted`,b.warning):u.success(`${s.id} deleted`,b.domainDeleted?`${s.domain} was removed too.`:void 0),c()}catch(b){u.error(`Could not delete ${s.id}`,zo(b,"Nothing was changed."))}finally{h(!1)}}};return a.jsx(Cn,{open:s!==null,onClose:o,preventClose:g,size:"sm",title:`Delete ${s?.id??""}?`,footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",onClick:o,disabled:g,children:"Cancel"}),a.jsx(te,{variant:"danger",onClick:()=>void x(),loading:g,children:"Delete app"})]}),children:a.jsxs("div",{className:"space-y-4 text-sm text-muted",children:[a.jsx("p",{children:"Its process is stopped and removed from PM2, and every release, log and its deploy key are deleted from this server. The repository is not touched."}),s?.dir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:s.dir}),s?.domain&&a.jsx(kl,{label:a.jsxs(a.Fragment,{children:["Also delete the domain ",a.jsx("span",{className:"font-mono text-ink",children:s.domain})]}),hint:"Its nginx config is removed and the site stops answering. Leave this off to keep the domain.",checked:f,onChange:m})]})})}function GS({app:s,meta:o,onChanged:c,onDelete:u}){const f=Tt(),[m,g]=p.useState(""),[h,x]=p.useState(!1),[b,j]=p.useState(!1),[y,N]=p.useState(""),[E,U]=p.useState(!1),S=m.trim().toLowerCase(),k=o.domains.find(Y=>Y.name===S),_=s.settings.port??null,z=async()=>{if(!(!S||b)){j(!0);try{const Y=await re.deployments.linkDomain(s.id,S,h&&!k?.ssl),ne=Y.created?`${Y.domain} was created and proxies to port ${Y.port}.`:`${Y.domain} now proxies to port ${Y.port}.`;Y.ssl&&!Y.ssl.ok?f.warning("Linked, without a certificate",`${ne} ${Y.ssl.detail}`):Y.nginxReloaded?f.success("Domain linked",Y.ssl?.ok?`${ne} ${Y.ssl.detail}`:ne):f.warning("Linked, but nginx was not reloaded",`${ne} Reload nginx for it to take effect.`),g(""),x(!1),c()}catch(Y){f.error("Could not link the domain",zo(Y,"Nothing was changed."))}finally{j(!1)}}},Q=async()=>{try{await re.deployments.unlinkDomain(s.id),f.success("Link removed",`${s.domain} is still configured; only the link is gone.`),c()}catch(Y){f.error("Could not remove the link",zo(Y,"Nothing was changed."))}},A=async()=>{if(!(!y.trim()||E)){U(!0);try{const Y=await re.deployments.move(s.id,y.trim());Y.warning?f.warning("Moved",Y.warning):f.success("App moved",`${Y.to}${Y.restarted?" — and started again.":""}`),N(""),c()}catch(Y){f.error("Could not move the app",zo(Y,"It is still where it was."))}finally{U(!1)}}};return a.jsxs("div",{className:"space-y-7",children:[a.jsxs("section",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(Cl,{className:"mt-0.5 size-4 shrink-0 text-muted","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Domain"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Point a domain at this app. nginx proxies it to the app’s port, and a deployment that changes the port takes the domain with it."})]})]}),s.domain?a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-line bg-inset/40 px-3.5 py-2.5",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate font-mono text-sm text-ink",children:s.domain}),a.jsxs("div",{className:"text-2xs text-faint",children:[_?`Proxies to port ${_}.`:"Proxies to the app’s port."," Edit it on the Domains page."]})]}),a.jsx(te,{size:"sm",icon:a.jsx(k2,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void Q(),children:"Remove link"})]}):null,a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(ze,{label:s.domain?"Link a different domain":"Domain name",value:m,onChange:Y=>g(Y.target.value),placeholder:"app.example.com",list:"deploy-domain-options",hint:S?k?"This domain exists. It will be re-pointed at this app.":"This domain will be created.":"Type a new name, or pick one of your domains.",className:"min-w-56 flex-1 font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(te,{variant:"primary",onClick:()=>void z(),loading:b,disabled:!S,children:"Link domain"})]}),a.jsx("datalist",{id:"deploy-domain-options",children:o.domains.map(Y=>a.jsx("option",{value:Y.name},Y.name))}),S&&!k?.ssl&&a.jsx(kl,{label:"Request an SSL certificate",hint:"Over HTTP-01, so the domain’s DNS must already point at this server. If it cannot be issued the domain still works over HTTP, and you can issue it later from the SSL page.",checked:h,onChange:x}),!_&&!s.currentRelease&&a.jsxs(Se,{tone:"info",children:["The app needs a port first: set one in Edit, or put ",a.jsx("code",{className:"font-mono",children:"port"})," ","in ez.json and deploy once."]})]})]}),a.jsxs("section",{className:"space-y-3 border-t border-line pt-6",children:[a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(d2,{className:"mt-0.5 size-4 shrink-0 text-muted","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Folder"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Where this app’s releases, logs and deploy key live. It stays here even if the deployments folder in Settings changes."}),a.jsx("p",{className:"mt-1.5 break-all font-mono text-2xs text-ink",children:s.dir??"—"})]})]}),a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(ze,{label:"Move to",value:y,onChange:Y=>N(Y.target.value),placeholder:o.deployDir??"/srv/ez_deploys",hint:y.trim()?`The app will be in ${y.trim().replace(/[\\/]+$/,"")}/${s.id}`:"A folder on this server. The app goes into a subfolder named after it.",className:"min-w-56 flex-1 font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(te,{onClick:()=>void A(),loading:E,disabled:!y.trim()||!!s.deploying,children:"Move app"})]}),a.jsx("p",{className:"text-2xs text-faint",children:"The app is stopped, its folder is moved, and it is started again from the new place. To another disk this copies every release, and can take a while."})]}),a.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-line pt-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Delete this app"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Stops it and removes its folder. You are asked what to do with its domain."})]}),a.jsx(te,{variant:"danger",icon:a.jsx($i,{className:"size-4","aria-hidden":"true"}),onClick:u,disabled:!!s.deploying,children:"Delete app"})]})]})}function YS(s,o){const c=URL.createObjectURL(new Blob([o],{type:"application/json"})),u=document.createElement("a");u.href=c,u.download=s,document.body.appendChild(u),u.click(),u.remove(),URL.revokeObjectURL(c)}function $S({app:s,locations:o}){const c=LS(s.settings);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2 text-xs text-muted",children:[a.jsxs("p",{children:[a.jsx("code",{className:"font-mono text-ink",children:"ez.json"})," is an optional file in your repository that says how the project is installed, built and started. Keeping it with the code means the commands are reviewed and versioned like everything else, and a new server needs no setup."]}),a.jsxs("p",{children:[a.jsx("strong",{className:"font-medium text-ink",children:"You do not need one for a Node project"})," — without it, the scripts in ",a.jsx("code",{className:"font-mono",children:"package.json"})," are used. You do need one for any other language."]})]}),a.jsxs("ol",{className:"space-y-5",children:[a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"1. Create the file"}),a.jsxs("p",{className:"text-xs text-muted",children:["This is what ",a.jsx("span",{className:"font-mono",children:s.id})," deploys with today. Change the commands to match your project."]}),a.jsx("pre",{className:"overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-ink",children:c}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(vt,{value:c,label:"Copy ez.json",withText:!0}),a.jsx(te,{size:"sm",icon:a.jsx(Hd,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>YS("ez.json",c),children:"Download ez.json"})]})]}),a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"2. Put it in the repository"}),a.jsxs("p",{className:"text-xs text-muted",children:["At the top of the repository, next to ",a.jsx("code",{className:"font-mono",children:"package.json"}),". It is looked for in this order:"," ",o.map((u,f)=>a.jsxs("span",{children:[a.jsx("code",{className:"font-mono text-ink",children:u}),f<o.length-1?", ":"."]},u))]})]}),a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"3. Commit, push, deploy"}),a.jsxs("p",{className:"text-xs text-muted",children:["The next deployment reads it. Its log shows where each value came from —"," ",a.jsx("code",{className:"font-mono",children:"[ez.json]"}),", ",a.jsx("code",{className:"font-mono",children:"[package.json]"})," ","or ",a.jsx("code",{className:"font-mono",children:"[override]"})," — so you can see that it was picked up."]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"mb-2 text-sm font-medium text-ink",children:"What each field means"}),a.jsx("div",{className:"overflow-x-auto rounded-md border border-line",children:a.jsxs("table",{className:"w-full text-left text-2xs",children:[a.jsx("thead",{className:"border-b border-line bg-inset/50 text-faint",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"Field"}),a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"Meaning"}),a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"If you leave it out"})]})}),a.jsx("tbody",{className:"divide-y divide-line",children:HS.map(u=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap px-3 py-2 align-top font-mono text-ink",children:u.name}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:u.meaning}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:u.without})]},u.name))})]})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"Not a Node project?"}),a.jsx("p",{className:"text-xs text-muted",children:"The commands are run exactly as written, so any language works. A Python app:"}),a.jsx("pre",{className:"overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-ink",children:US})]}),a.jsxs(Se,{tone:"info",title:"Which one wins",children:["A value set on the app (Edit) overrides ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", which overrides ",a.jsx("code",{className:"font-mono",children:"package.json"}),". To let the file decide, leave that field empty in Edit. A mistake in the file stops the deployment before anything that is running is touched."]})]})}function Xd(s,o){return s instanceof Be||s instanceof Error?s.message:o}function VS({appId:s,run:o}){const c=bt(x=>re.deployments.run(s,o.id,x),[s,o.id]),u=(c.data?.status??o.status)==="running";Ss(c.reload,1500,u);const f=p.useRef(null),m=p.useRef(!0),g=c.data?.log??"";p.useEffect(()=>{const x=f.current;x&&m.current&&(x.scrollTop=x.scrollHeight)},[g]);const h=c.data??o;return a.jsxs("div",{className:"space-y-2.5",children:[h.error&&a.jsx(Se,{tone:h.status==="rolled_back"?"warning":"danger",title:h.status==="rolled_back"?"The new release was not healthy — the previous one is running again":`Failed while: ${hf(h.step).toLowerCase()}`,children:h.error}),h.warnings?.map(x=>a.jsx(Se,{tone:"warning",children:x},x)),c.error&&!c.data?a.jsx(kt,{error:c.error,onRetry:c.reload,title:"Could not load the log"}):a.jsxs("pre",{ref:f,onScroll:x=>{const b=x.currentTarget;m.current=b.scrollHeight-b.scrollTop-b.clientHeight<24},className:"h-[42vh] overflow-auto whitespace-pre-wrap break-all rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted","aria-label":"Deployment log","aria-busy":u,children:[c.data?.logTruncated&&`… earlier output is not shown …
440
- `,g||(c.loading?"Loading…":"No output yet.")]})]})}function XS({app:s,initialRunId:o}){const[c,u]=p.useState(o);if(p.useEffect(()=>{s.activeRunId&&u(s.activeRunId)},[s.activeRunId]),s.runs.length===0)return a.jsx(En,{icon:a.jsx(g2,{className:"size-5","aria-hidden":"true"}),title:"No deployments yet",description:"Press Deploy to build and start this app for the first time."});const f=s.runs.find(m=>m.id===c)??s.runs[0];return a.jsxs("div",{className:"grid gap-4 lg:grid-cols-[17rem_minmax(0,1fr)]",children:[a.jsx("ul",{className:"max-h-[52vh] space-y-1 overflow-y-auto pr-1","aria-label":"Deployments",children:s.runs.map(m=>{const g=Ly[m.status],h=m.id===f.id;return a.jsx("li",{children:a.jsxs("button",{type:"button",onClick:()=>u(m.id),"aria-current":h?"true":void 0,className:ie("w-full rounded-md border px-3 py-2 text-left transition-colors duration-[var(--ez-motion-fast)]",h?"border-accent/40 bg-accent-soft":"border-transparent hover:bg-inset"),children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(je,{tone:g.tone,dot:!0,children:m.status==="running"?hf(m.step):g.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:$o(m.sha)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 text-2xs text-muted",children:[a.jsx("span",{children:_S[m.trigger]??m.trigger}),a.jsxs("span",{title:rf(m.startedAt),children:[Zi(m.startedAt)," · ",OS(m)]})]})]})},m.id)})}),a.jsx(VS,{appId:s.id,run:f},f.id)]})}function ZS({app:s,onRollback:o,busy:c}){return s.releases.length===0?a.jsx(En,{title:"No releases on disk",description:"Each successful deployment leaves a release here to roll back to."}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{className:"text-xs text-muted",children:["A rollback starts an earlier release exactly as it was built — nothing is fetched or rebuilt. The newest ",s.keepReleases," are kept."]}),a.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:s.releases.map(u=>a.jsxs("li",{className:"flex flex-wrap items-center gap-3 px-3.5 py-2.5",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs text-ink",children:u.id}),u.current&&a.jsx(je,{tone:"ok",children:"Live"}),u.previous&&a.jsx(je,{tone:"neutral",children:"Previous"})]}),a.jsxs("div",{className:"mt-0.5 font-mono text-2xs text-faint",children:[$o(u.sha),u.ref?` · ${u.ref}`:""]})]}),!u.current&&a.jsx(te,{size:"sm",icon:a.jsx(K2,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>o(u),disabled:c||!u.startable,title:u.startable?void 0:"This release never got as far as starting.",children:"Roll back to this"})]},u.id))})]})}function _i({n:s,title:o,children:c}){return a.jsxs("li",{className:"flex gap-3",children:[a.jsx("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-pill bg-inset font-mono text-2xs font-semibold text-muted","aria-hidden":"true",children:s}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:o}),c]})]})}function wg({name:s,value:o,note:c}){return a.jsxs("div",{className:"rounded-md border border-line bg-inset/50 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("code",{className:"font-mono text-xs font-semibold text-ink",children:s}),a.jsx(vt,{value:s,label:`Copy the name ${s}`})]}),o?a.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[a.jsx("code",{className:"min-w-0 break-all font-mono text-2xs text-muted",children:o}),a.jsx(vt,{value:o,label:`Copy the value of ${s}`,withText:!0})]}):c&&a.jsx("p",{className:"mt-1.5 text-2xs text-faint",children:c})]})}function QS({app:s,hook:o,onConfigureHook:c,onChanged:u}){const f=Tt(),m=hn(),g=bt(W=>re.deployments.github(s.id,W),[s.id,o.enabled,o.domain,o.bind,o.port,s.branch]),[h,x]=p.useState(null),[b,j]=p.useState(!1),[y,N]=p.useState(null),[E,U]=p.useState(""),[S,k]=p.useState(!1),[_,z]=p.useState(null),Q=async()=>{if(!b&&!(s.hook.hasToken&&!await m({title:"Replace the deploy token?",body:"The current token stops working immediately. The repository’s EZ_DEPLOY_TOKEN secret has to be updated before the next push can deploy.",confirmLabel:"Replace token",tone:"danger"}))){j(!0);try{const W=await re.deployments.issueHookToken(s.id);x(W.token),u()}catch(W){f.error("Could not create the token",Xd(W,"Try again."))}finally{j(!1)}}};if(g.error&&!g.data)return a.jsx(kt,{error:g.error,onRetry:g.reload});if(!g.data)return a.jsx(Pe,{className:"h-64 rounded-lg"});const A=g.data,Y=s.hook.hasToken||h!==null,ne=A.targets??[{id:"hook",label:"This server’s deploy hook",url:A.hookUrl,secure:A.hookSecure,note:A.hookNote}],M=W=>!!W.url&&(W.id!=="hub"||W.ready!==!1),L=ne.find(W=>W.id===y)??ne.find(M)??ne[0],X=M(L),Z=/github\.com[:/]/.test(s.repoUrl),ae=s.authType==="deployKey"?1:0,H=async()=>{if(!S&&!(s.hook.hasToken&&!await m({title:"Set up GitHub automatically?",body:"A new deploy token is created and stored straight into the repository’s secrets; the current one stops working. The workflow file is committed to the branch, which starts a deployment.",confirmLabel:"Set up",tone:"accent"}))){k(!0),z(null);try{const W=await re.deployments.applyGithub(s.id,{target:L.id,...E.trim()?{token:E.trim()}:{}});z(W),U(""),x(null),u(),W.ok?f.success("GitHub is set up",`${W.repo} deploys on every push to ${s.branch}.`):f.warning("Partly set up","Some steps need a token with more access. They are listed below.")}catch(W){const ve=W instanceof Be?W.payload:null;ve&&Array.isArray(ve.steps)&&z(ve),f.error("Could not set up GitHub",Xd(W,"Nothing was changed on GitHub."))}finally{k(!1)}}};return a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"How it works"}),a.jsxs("ol",{className:"mt-2 list-decimal space-y-1 pl-4 text-xs text-muted",children:[a.jsxs("li",{children:["You push to ",a.jsx("code",{className:"font-mono text-ink",children:s.branch}),"."]}),a.jsx("li",{children:"GitHub runs the workflow file in your repository. It makes one request: “deploy this commit”, with the app’s deploy token."}),a.jsx("li",{children:"This server fetches that commit, builds it and starts it — the same steps as the Deploy button, with the log in the Deployments tab."}),a.jsx("li",{children:"The workflow waits for the result. A green check means the new version is live; a red one means it failed, and the previous version is still running."})]}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"GitHub never gets access to the server: it holds a URL and a token that can start a deployment of this one app, and nothing else."})]}),ne.length>1&&a.jsx(tl,{label:"How GitHub reaches this server",value:L.id,onChange:W=>N(W.target.value),hint:L.note,children:ne.map(W=>a.jsxs("option",{value:W.id,children:[W.label,M(W)?"":" — not available yet"]},W.id))}),X?!L.secure&&a.jsx(Se,{tone:"warning",title:"The deploy token would be sent unencrypted",action:L.id==="hook"?a.jsx(te,{size:"sm",onClick:c,children:"Change"}):void 0,children:L.note}):a.jsx(Se,{tone:"warning",title:L.id==="hub"?"Not available through the Hub yet":"GitHub cannot reach this server yet",action:L.id==="hook"?a.jsx(te,{size:"sm",onClick:c,children:"Set up the deploy hook"}):void 0,children:L.note}),Z&&a.jsx("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(NN,{className:"mt-0.5 size-4 shrink-0 text-accent-text","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"Do it for me"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Stores both secrets, commits the workflow file",s.authType==="deployKey"?" and adds the deploy key":"",". Needs a GitHub token that may write this repository’s ",a.jsx("em",{children:"secrets"}),", ",a.jsx("em",{children:"contents"})," and"," ",a.jsx("em",{children:"workflows"}),s.authType==="deployKey"?", and administer it (for the deploy key)":"",". A token typed here is used once and not stored."]})]}),a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(ze,{label:"GitHub token",optional:s.authType==="token"&&s.hasToken,type:"password",value:E,onChange:W=>U(W.target.value),placeholder:s.authType==="token"&&s.hasToken?"leave empty to try the app’s token":"github_pat_…",autoComplete:"off",spellCheck:!1,className:"min-w-56 flex-1"}),a.jsx(te,{variant:"primary",onClick:()=>void H(),loading:S,disabled:!X||!E.trim()&&!(s.authType==="token"&&s.hasToken),children:"Set up on GitHub"})]}),_&&a.jsxs("ul",{className:"space-y-1.5","aria-label":"Setup result",children:[_.error&&a.jsxs("li",{className:"flex items-start gap-2 text-xs text-bad",children:[a.jsx(Ud,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:_.error})]}),_.steps.map(W=>a.jsxs("li",{className:ie("flex items-start gap-2 text-xs",W.ok?"text-muted":"text-bad"),children:[W.ok?a.jsx(Tl,{className:"mt-0.5 size-3.5 shrink-0 text-ok","aria-hidden":"true"}):a.jsx(Ud,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:W.detail})]},W.id))]})]})]})}),a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-faint",children:Z?"Or by hand":"Steps"}),a.jsxs("ol",{className:"space-y-5",children:[A.deployKey!==null&&a.jsxs(_i,{n:1,title:"Let this server read the repository",children:[a.jsx("p",{className:"text-xs text-muted",children:"In the repository: Settings → Deploy keys → Add deploy key. Paste this, and leave “Allow write access” off."}),a.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-md border border-line bg-inset/50 p-2.5",children:[a.jsx("code",{className:"min-w-0 break-all font-mono text-2xs text-muted",children:A.deployKey}),a.jsx(vt,{value:A.deployKey,label:"Copy the deploy key",withText:!0})]})]}),s.authType==="deployKey"&&A.deployKey===null&&a.jsx(_i,{n:1,title:"Let this server read the repository",children:a.jsx(Se,{tone:"warning",children:"This app uses a deploy key but none has been generated. Open Edit and press “Generate key”."})}),a.jsxs(_i,{n:ae+1,title:"Create the deploy token",children:[a.jsx("p",{className:"text-xs text-muted",children:"It can start a deployment of this app and nothing else. Only a hash of it is stored here, so it is shown once."}),h?a.jsx(Se,{tone:"success",title:"Copy it now — it will not be shown again",children:a.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[a.jsx("code",{className:"min-w-0 break-all font-mono text-2xs",children:h}),a.jsx(vt,{value:h,label:"Copy the deploy token",withText:!0})]})}):a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx(te,{size:"sm",icon:a.jsx(Yi,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void Q(),loading:b,children:s.hook.hasToken?"Replace the token":"Create token"}),s.hook.hasToken&&a.jsxs("span",{className:"text-2xs text-faint",children:["One exists, ending in"," ",a.jsx("code",{className:"font-mono",children:s.hook.tokenHint}),s.hook.createdAt?`, created ${rf(s.hook.createdAt)}`:"","."]})]})]}),a.jsxs(_i,{n:ae+2,title:"Add two repository secrets",children:[a.jsx("p",{className:"text-xs text-muted",children:"In the repository: Settings → Secrets and variables → Actions → New repository secret."}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(wg,{name:"EZ_DEPLOY_URL",value:X?L.url:null,note:"Available once GitHub can reach this server (see above)."}),a.jsx(wg,{name:"EZ_DEPLOY_TOKEN",value:h,note:Y?"The token from the step above. If you no longer have it, replace it.":"Create the token in the step above first."})]})]}),a.jsxs(_i,{n:ae+3,title:"Add the workflow file",children:[a.jsxs("p",{className:"text-xs text-muted",children:["Commit this to the repository as"," ",a.jsx("code",{className:"break-all font-mono text-ink",children:A.workflowPath}),". It contains no secrets, and it is the same file whichever way GitHub reaches the server."]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(vt,{value:A.workflowPath,label:"Copy the file path",withText:!0}),a.jsx(vt,{value:A.workflow,label:"Copy the workflow",withText:!0})]}),a.jsx("pre",{className:"max-h-64 overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted",children:A.workflow})]})]}),a.jsxs(Se,{tone:"info",title:"Optional: ez.json",children:["To keep the install, build and start commands with the code, add an"," ",a.jsx("code",{className:"font-mono",children:"ez.json"})," to the repository. Without one, a Node project is deployed from its ",a.jsx("code",{className:"font-mono",children:"package.json"})," scripts."]})]})}function KS({appId:s,hook:o,meta:c,initialTab:u="activity",onClose:f,onConfigureHook:m,onChanged:g,onDelete:h}){const x=Tt(),b=hn(),j=s!==null,[y,N]=p.useState(u),[E,U]=p.useState(!1),S=bt(z=>re.deployments.get(s??"",z),[s],{enabled:j}),k=S.data&&S.data.id===s?S.data:null;p.useEffect(()=>{j&&N(u)},[j,s,u]),Ss(S.reload,2e3,j&&!!k?.deploying);const _=async z=>{if(!(!k||E||!await b({title:`Roll back ${k.id}?`,body:`Release ${z.id} (${$o(z.sha)}) will be started in place of the live one. The app restarts.`,confirmLabel:"Roll back",tone:"danger"}))){U(!0);try{await re.deployments.rollback(k.id,z.id),x.info("Rollback started"),N("activity"),S.reload(),g()}catch(A){x.error("Could not roll back",Xd(A,"Nothing was changed."))}finally{U(!1)}}};return a.jsx(Cn,{open:j,onClose:f,size:"xl",title:a.jsxs("span",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("span",{className:"font-mono",children:s}),k?.deploying&&a.jsx(je,{tone:"info",dot:!0,children:"Deploying"})]}),description:k?`${k.repoUrl} · ${k.branch}`:void 0,children:S.error&&!k?a.jsx(kt,{error:S.error,onRetry:S.reload}):k?a.jsxs("div",{className:"space-y-4",children:[a.jsx(BS,{ariaLabel:"App sections",value:y,onChange:N,items:[{id:"activity",label:"Deployments",count:k.runs.length},{id:"releases",label:"Releases",count:k.releases.length},{id:"setup",label:"Domain & folder"},{id:"github",label:"GitHub Actions"},{id:"ezjson",label:"ez.json"}]}),a.jsx(Di,{id:"activity",value:y,children:a.jsx(XS,{app:k,initialRunId:k.activeRunId??null})}),a.jsx(Di,{id:"releases",value:y,children:a.jsx(ZS,{app:k,onRollback:z=>void _(z),busy:E||!!k.deploying})}),a.jsx(Di,{id:"setup",value:y,children:a.jsx(GS,{app:k,meta:c,onChanged:()=>{S.reload(),g()},onDelete:()=>h(k)})}),a.jsx(Di,{id:"ezjson",value:y,children:a.jsx($S,{app:k,locations:c.ezFileLocations})}),a.jsx(Di,{id:"github",value:y,children:a.jsx(QS,{app:k,hook:o,onConfigureHook:m,onChanged:()=>{S.reload(),g()}})}),!o.enabled&&y!=="github"&&k.hook.hasToken&&a.jsx(Se,{tone:"warning",title:"The deploy hook is switched off",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx(ka,{className:"size-3.5","aria-hidden":"true"}),"This app has a deploy token, but nothing is listening for it."]})})]}):a.jsxs("div",{className:"flex items-center gap-2.5 py-10 text-sm text-muted",children:[a.jsx(Ts,{})," Loading…"]})})}function Sg(s){return{id:"",repoUrl:"",branch:"main",authType:"none",token:"",settings:My({}),envText:"",keepReleases:String(s),autoRollback:!0,notifyChannelIds:[]}}function JS(s){return{id:s.id,repoUrl:s.repoUrl,branch:s.branch,authType:s.authType,token:"",settings:My(s.settings),envText:RS(s.env),keepReleases:String(s.keepReleases),autoRollback:s.autoRollback,notifyChannelIds:s.notifyChannelIds}}function kg(s,o){return s instanceof Be||s instanceof Error?s.message:o}function PS({open:s,app:o,meta:c,onClose:u,onSaved:f}){const m=Tt(),g=o!==null,[h,x]=p.useState(()=>Sg(c.limits.keepReleasesDefault)),[b,j]=p.useState(!1),[y,N]=p.useState(!1),[E,U]=p.useState(null),[S,k]=p.useState(!1);p.useEffect(()=>{s&&(x(o?JS(o):Sg(c.limits.keepReleasesDefault)),U(o?.deployKey??null),j(!1))},[s,o?.id]);const _=H=>x(W=>({...W,...H})),z=H=>x(W=>({...W,settings:{...W.settings,...H}})),Q=h.repoUrl.trim(),A=ES(Q),Y=zS(h.envText),ne=Number(h.keepReleases),M={id:g?null:CS(h.id.trim()),repoUrl:Q?h.authType==="token"&&A?"Token access needs an https:// URL.":h.authType==="deployKey"&&!A?"A deploy key needs an SSH URL, like git@github.com:owner/repo.git.":null:"A repository URL is required.",token:h.authType==="token"&&!h.token.trim()&&!(g&&o?.hasToken)?"A token is required.":null,port:h.settings.port.trim()?Yo(h.settings.port):null,healthPath:h.settings.healthPath.trim()&&!h.settings.healthPath.trim().startsWith("/")?'Must start with "/".':null,env:Y.error,keepReleases:!Number.isInteger(ne)||ne<c.limits.keepReleasesMin||ne>c.limits.keepReleasesMax?`A whole number from ${c.limits.keepReleasesMin} to ${c.limits.keepReleasesMax}.`:null},L=Object.values(M).some(Boolean),X=async()=>{if(y||(j(!0),L))return;const H={repoUrl:Q,branch:h.branch.trim()||"main",authType:h.authType,settings:AS(h.settings),env:Y.env,keepReleases:ne,autoRollback:h.autoRollback,notifyChannelIds:h.notifyChannelIds};h.token.trim()&&(H.token=h.token.trim()),N(!0);try{const W=g?await re.deployments.update(o.id,H):await re.deployments.create({...H,id:h.id.trim()});f(W,!g)}catch(W){m.error(g?"Could not save the app":"Could not create the app",kg(W,"Nothing was changed."))}finally{N(!1)}},Z=async()=>{if(!(!o||S)){k(!0);try{const H=await re.deployments.generateDeployKey(o.id);U(H.publicKey),m.success("Deploy key generated","Add the public key to the repository, read-only.")}catch(H){m.error("Could not generate the key",kg(H,"Try again."))}finally{k(!1)}}},ae=H=>b?M[H]:null;return a.jsx(Cn,{open:s,onClose:u,preventClose:y,size:"lg",title:g?`Edit ${o.id}`:"New app",description:g?"Changes apply to the next deployment. The running release is not touched.":"Where the code lives and how this server may read it. Everything else can be left to the project.",footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",onClick:u,disabled:y,children:"Cancel"}),a.jsx(te,{variant:"primary",type:"submit",form:"deploy-app-form",loading:y,children:g?"Save app":"Create app"})]}),children:a.jsxs("form",{id:"deploy-app-form",className:"space-y-6",onSubmit:H=>{H.preventDefault(),X()},noValidate:!0,children:[a.jsxs("section",{className:"space-y-4",children:[a.jsxs(va,{children:[a.jsx(ze,{label:"Name",value:h.id,onChange:H=>_({id:H.target.value.toLowerCase()}),disabled:g,error:ae("id"),hint:g?"The name cannot be changed.":"Used for its folder and its PM2 process (ez-<name>).",placeholder:"my-api",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(ze,{label:"Branch",value:h.branch,onChange:H=>_({branch:H.target.value}),hint:"Deployed when no specific commit is named.",placeholder:"main",className:"font-mono",spellCheck:!1})]}),a.jsx(ze,{label:"Repository URL",value:h.repoUrl,onChange:H=>_({repoUrl:H.target.value}),error:ae("repoUrl"),hint:"https://github.com/owner/repo.git, or git@github.com:owner/repo.git for a deploy key.",placeholder:"https://github.com/owner/repo.git",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsxs(tl,{label:"Repository access",value:h.authType,onChange:H=>_({authType:H.target.value}),hint:h.authType==="none"?"For a public repository.":h.authType==="deployKey"?"An SSH key generated here; you add its public half to the repository. Nothing secret leaves this server.":"A personal access token stored on this server and sent only to the repository host.",children:[a.jsx("option",{value:"none",children:"Public — no credentials"}),a.jsx("option",{value:"deployKey",children:"Private — deploy key (SSH)"}),a.jsx("option",{value:"token",children:"Private — access token (HTTPS)"})]}),h.authType==="token"&&a.jsx(ze,{label:"Access token",type:"password",value:h.token,onChange:H=>_({token:H.target.value}),error:ae("token"),hint:g&&o.hasToken?"A token is stored. Leave this empty to keep it.":"Read-only access to this one repository is enough.",placeholder:g&&o.hasToken?"••••••••":"github_pat_…",autoComplete:"off",spellCheck:!1}),h.authType==="deployKey"&&(g?a.jsxs("div",{className:"rounded-md border border-line bg-inset/50 p-3.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Deploy key"}),a.jsx(te,{size:"sm",icon:a.jsx(Yi,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void Z(),loading:S,children:E?"Generate a new key":"Generate key"})]}),E?a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"mt-2.5 max-h-24 overflow-auto whitespace-pre-wrap break-all rounded border border-line bg-canvas p-2.5 font-mono text-2xs text-muted",children:E}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2",children:[a.jsx("p",{className:"text-2xs text-faint",children:"Add it under the repository’s Settings → Deploy keys. Leave “Allow write access” off."}),a.jsx(vt,{value:E,label:"Copy public key",withText:!0})]})]}):a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"No key yet. The private half stays on this server and is never shown."})]}):a.jsx(Se,{tone:"info",children:"Create the app first; the key is generated from its settings afterwards."}))]}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-ink",children:"How it runs"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["All optional. An empty field is read from the repository’s"," ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", and failing that from"," ",a.jsx("code",{className:"font-mono",children:"package.json"}),"."]})]}),a.jsxs(va,{children:[a.jsx(ze,{label:"Port",optional:!0,type:"number",min:1,max:65535,inputMode:"numeric",value:h.settings.port,onChange:H=>z({port:H.target.value}),error:ae("port"),hint:"The port the app listens on. Passed to it as PORT, and used for the health check.",placeholder:"3000"}),a.jsx(ze,{label:"Health check path",optional:!0,value:h.settings.healthPath,onChange:H=>z({healthPath:H.target.value}),error:ae("healthPath"),hint:"Must answer before a deployment counts. Defaults to /.",placeholder:"/healthz",className:"font-mono",spellCheck:!1})]}),a.jsx(ze,{label:"Start command",optional:!0,value:h.settings.start,onChange:H=>z({start:H.target.value}),hint:"The long-running process. Any language: node server.js, python app.py, ./server.",placeholder:"from ez.json, or npm start",className:"font-mono",spellCheck:!1}),a.jsxs(va,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{label:"Install command",optional:!0,value:h.settings.install,onChange:H=>z({install:H.target.value}),disabled:h.settings.skipInstall,placeholder:"from ez.json, or npm ci",className:"font-mono",spellCheck:!1}),a.jsx(kl,{label:"Skip the install step",checked:h.settings.skipInstall,onChange:H=>z({skipInstall:H})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{label:"Build command",optional:!0,value:h.settings.build,onChange:H=>z({build:H.target.value}),disabled:h.settings.skipBuild,placeholder:"from ez.json, or npm run build",className:"font-mono",spellCheck:!1}),a.jsx(kl,{label:"Skip the build step",checked:h.settings.skipBuild,onChange:H=>z({skipBuild:H})})]})]})]}),a.jsx("section",{className:"space-y-4 border-t border-line pt-5",children:a.jsx(Lo,{label:"Environment variables",optional:!0,rows:5,value:h.envText,onChange:H=>_({envText:H.target.value}),error:ae("env"),hint:"One NAME=value per line; a pasted .env file works. Stored on this server only, and available to the build and the running app.",placeholder:`DATABASE_URL=postgres://…
441
- NODE_ENV=production`,className:"font-mono",spellCheck:!1})}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(Ut,{checked:h.autoRollback,onChange:H=>_({autoRollback:H}),label:"Roll back automatically",description:"If a new release starts but fails its health check, the previous release is started again."}),a.jsx(va,{children:a.jsx(ze,{label:"Releases to keep",type:"number",min:c.limits.keepReleasesMin,max:c.limits.keepReleasesMax,inputMode:"numeric",value:h.keepReleases,onChange:H=>_({keepReleases:H.target.value}),error:ae("keepReleases"),hint:"Older ones are deleted. The live release and the one before it are always kept."})}),c.channels.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"mb-1.5 text-xs font-medium text-ink",children:"Notify on every deployment"}),a.jsx("div",{className:"space-y-1.5",children:c.channels.map(H=>a.jsx(kl,{label:`${H.name} (${H.type})`,checked:h.notifyChannelIds.includes(H.id),onChange:W=>_({notifyChannelIds:W?[...h.notifyChannelIds,H.id]:h.notifyChannelIds.filter(ve=>ve!==H.id)})},H.id))})]})]})]})})}function Tg(s){return s.domain?"domain":s.bind==="0.0.0.0"?"direct":"local"}function FS({open:s,hook:o,domains:c,onClose:u,onSaved:f}){const m=Tt(),[g,h]=p.useState(o.enabled),[x,b]=p.useState(Tg(o)),[j,y]=p.useState(o.domain??""),[N,E]=p.useState(String(o.port)),[U,S]=p.useState(!1),[k,_]=p.useState(!1);p.useEffect(()=>{s&&(h(o.enabled),b(Tg(o)),y(o.domain??""),E(String(o.port)),_(!1))},[s]);const z=c.filter(M=>M.enabled),Q=z.find(M=>M.name===j),A=Yo(N),Y=g&&x==="domain"&&!Q?"Choose a domain.":null,ne=async()=>{if(!U&&(_(!0),!(A||Y))){S(!0);try{const M=await re.deployments.updateHook({enabled:g,port:Number(N),bind:x==="direct"?"0.0.0.0":"127.0.0.1",domain:x==="domain"?j:null});M.nginxReloaded===!1?m.warning("Saved, but nginx was not reloaded","The domain’s config was written. Reload nginx for the deploy hook to be reachable."):m.success("Deploy hook saved",g?`The background service picks it up within ${M.appliesWithinSeconds??10} seconds.`:"Nothing is listening for deployments now."),f(M)}catch(M){const L=M instanceof Be&&typeof M.payload.detail=="string"?M.payload.detail:null;m.error("Could not save the deploy hook",L??(M instanceof Error?M.message:"Nothing was changed."))}finally{S(!1)}}};return a.jsx(Cn,{open:s,onClose:u,preventClose:U,size:"md",title:"Deploy hook",description:"Lets a GitHub Action tell this server to deploy. Each app has its own token; the hook can do nothing else.",footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",onClick:u,disabled:U,children:"Cancel"}),a.jsx(te,{variant:"primary",onClick:()=>void ne(),loading:U,children:"Save"})]}),children:a.jsxs("div",{className:"space-y-5",children:[a.jsx(Ut,{checked:g,onChange:h,label:"Accept deployments from CI",description:"Off by default. While it is off nothing listens, and apps can only be deployed from this dashboard."}),g&&a.jsxs(a.Fragment,{children:[a.jsxs(tl,{label:"How CI reaches it",value:x,onChange:M=>b(M.target.value),children:[a.jsx("option",{value:"domain",children:"Through one of my domains (recommended)"}),a.jsx("option",{value:"direct",children:"Directly, on its own port"}),a.jsx("option",{value:"local",children:"This machine only"})]}),x==="domain"&&a.jsxs(a.Fragment,{children:[a.jsxs(tl,{label:"Domain",value:j,onChange:M=>y(M.target.value),error:k?Y:null,hint:"One path, /.ez-deploy/, is added to this domain’s nginx config. Nothing else becomes reachable.",children:[a.jsx("option",{value:"",children:"Choose a domain…"}),z.map(M=>a.jsxs("option",{value:M.name,children:[M.name,M.ssl?"":" — no SSL"]},M.name))]}),z.length===0&&a.jsx(Se,{tone:"warning",children:"There is no enabled domain yet. Add one on the Domains page, or reach the hook directly."}),Q&&!Q.ssl&&a.jsx(Se,{tone:"warning",title:"This domain has no certificate",children:"The deploy token would travel over plain HTTP. Issue a certificate for it on the SSL page first."})]}),x==="direct"&&a.jsx(Se,{tone:"warning",title:"Plain HTTP, on every network interface",children:"The deploy token is sent unencrypted, and the port has to be opened in your firewall. Use a domain with SSL unless this server sits on a private network."}),x==="local"&&a.jsx(Se,{tone:"info",children:"Only programs on this server can call the hook — useful with your own tunnel or reverse proxy. GitHub cannot reach it."}),a.jsx(va,{children:a.jsx(ze,{label:"Listener port",type:"number",min:1,max:65535,inputMode:"numeric",value:N,onChange:M=>E(M.target.value),error:k?A:null,hint:x==="direct"?"The port CI connects to.":"Internal. nginx forwards to it; it is not opened to the network."})})]})]})})}function IS(s,o){return s instanceof Be||s instanceof Error?s.message:o}function WS({data:s,onConfigure:o}){const{hook:c}=s,u=c.enabled&&(c.domain!==null||c.bind==="0.0.0.0"),m=!!(c.domain?s.domains.find(b=>b.name===c.domain):void 0)?.ssl;let g="neutral",h="Off",x="Apps are deployed from this dashboard only. Turn it on to deploy from GitHub Actions.";return c.enabled&&!c.listening?(g="warn",h="Not listening",x="It is switched on, but nothing answers on its port yet. The background service starts it within a few seconds; if it stays like this, check that the service is running."):c.enabled&&!u?(g="neutral",h="This machine only",x="Listening, but only programs on this server can call it. GitHub cannot reach it."):c.enabled&&c.domain?(g=m?"ok":"warn",h=m?"On":"On — no SSL",x=m?`Reached through https://${c.domain}${c.path}`:`Reached through http://${c.domain}${c.path} — the deploy token travels unencrypted. Issue a certificate for that domain.`):c.enabled&&(g="warn",h="On — plain HTTP",x=`Listening on every interface, port ${c.port}. The deploy token travels unencrypted; prefer a domain with SSL.`),a.jsx(Xe,{children:a.jsx(Pt,{icon:a.jsx(Oo,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:["Deploy hook",a.jsx(je,{tone:g,dot:!0,children:h})]}),description:x,actions:a.jsx(te,{size:"sm",icon:a.jsx(sf,{className:"size-3.5","aria-hidden":"true"}),onClick:o,children:"Configure"})})})}function e5({app:s,canDeploy:o,busy:c,onDeploy:u,onOpen:f,onEdit:m,onDelete:g}){const h=s.lastRun??null,x=s.process??null,b=h?Ly[h.status]:null;return a.jsxs("li",{className:"flex flex-col gap-3 px-4 py-3.5 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 lg:flex-row lg:items-center lg:gap-4",children:[a.jsxs("button",{type:"button",onClick:()=>f("activity"),className:"flex min-w-0 flex-1 items-start gap-3 rounded text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",children:[a.jsx(Ft,{tone:x?MS(x.status):"neutral",pulse:x?.status==="online",className:"mt-1.5"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block truncate font-mono text-sm font-semibold text-ink",children:s.id}),a.jsxs("span",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-muted",children:[a.jsx("span",{className:"truncate font-mono",title:s.repoUrl,children:ew(s.repoUrl,44)}),a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(x2,{className:"size-3","aria-hidden":"true"}),s.branch]}),s.domain&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-accent-text",children:[a.jsx(Cl,{className:"size-3","aria-hidden":"true"}),s.domain]})]}),a.jsx("span",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-faint",children:x?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[x.status,x.status==="online"&&x.uptimeMs!==null?` · up ${of(x.uptimeMs)}`:""]}),x.memoryBytes!==null&&a.jsxs("span",{children:["· ",ky(x.memoryBytes)]}),x.restarts>0&&a.jsxs("span",{children:["· ",kn(x.restarts,"restart")]})]}):a.jsx("span",{children:s.currentRelease?"Not running":"Never deployed"})})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2 pl-7 lg:w-56 lg:shrink-0 lg:pl-0",children:s.deploying?a.jsx(je,{tone:"info",dot:!0,children:h?.status==="running"?hf(h.step):"Deploying"}):b&&h?a.jsxs(a.Fragment,{children:[a.jsx(je,{tone:b.tone,dot:!0,children:b.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:$o(h.sha)}),a.jsx("span",{className:"text-2xs text-faint",children:Zi(h.finishedAt??h.startedAt)})]}):a.jsx("span",{className:"text-2xs text-faint",children:"No deployments yet"})}),a.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1.5 pl-7 lg:pl-0",children:[a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(Li,{className:"size-3.5","aria-hidden":"true"}),onClick:u,loading:c,disabled:!o||!!s.deploying,children:"Deploy"}),a.jsx(te,{size:"sm",onClick:()=>f("setup"),children:"Domain"}),a.jsx(te,{size:"sm",onClick:()=>f("github"),children:"GitHub"}),a.jsx(ft,{label:`Edit ${s.id}`,size:"sm",onClick:m,children:a.jsx(lf,{className:"size-4","aria-hidden":"true"})}),a.jsx(ft,{label:`Delete ${s.id}`,size:"sm",variant:"dangerGhost",onClick:g,disabled:!!s.deploying,children:a.jsx($i,{className:"size-4","aria-hidden":"true"})})]})]})}function t5(){Bn("Deployments");const s=Tt(),o=bt(A=>re.deployments.list(A),[]),c=o.data,u=!!c?.apps.some(A=>A.deploying);zl(o.reload),Ss(o.reload,u?2e3:15e3);const[f,m]=p.useState(!1),[g,h]=p.useState(null),[x,b]=p.useState(!1),[j,y]=p.useState(null),[N,E]=p.useState(null),[U,S]=p.useState(null),k=()=>{h(null),m(!0)},_=async A=>{if(!N){E(A.id);try{await re.deployments.deploy(A.id),y({id:A.id,tab:"activity"}),o.reload()}catch(Y){s.error(`Could not deploy ${A.id}`,IS(Y,"Nothing was started."))}finally{E(null)}}},z=a.jsx(ta,{title:"Deployments",description:"Put a project from a git repository on this server: fetched, built and started here, with earlier releases kept to roll back to.",actions:a.jsxs(a.Fragment,{children:[a.jsx(ft,{label:"Refresh",onClick:o.reload,children:a.jsx(Ot,{className:"size-4","aria-hidden":"true"})}),a.jsx(te,{variant:"primary",icon:a.jsx(Na,{className:"size-4","aria-hidden":"true"}),onClick:k,disabled:!c,children:"New app"})]})});if(o.error&&!c)return a.jsxs(a.Fragment,{children:[z,a.jsx(kt,{error:o.error,onRetry:o.reload})]});if(!c)return a.jsxs(a.Fragment,{children:[z,a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-20 rounded-lg"}),a.jsx(Pe,{className:"h-56 rounded-lg"})]})]});const Q=c.requirements.git&&c.requirements.pm2;return a.jsxs(a.Fragment,{children:[z,a.jsxs("div",{className:"space-y-5",children:[!c.requirements.git&&a.jsx(Se,{tone:"danger",title:"git is not installed on this server",children:"Deployments fetch the code with git. Install it, and make sure it is on the PATH of the Easy DevOps service."}),!c.requirements.pm2&&a.jsxs(Se,{tone:"warning",title:"PM2 is not installed",action:a.jsx(yt,{to:"/processes",className:ba("secondary","sm"),children:"Open Processes"}),children:["Deployed apps are kept running by PM2. Install it from the Processes page, or with"," ",a.jsx("code",{className:"font-mono",children:"npm install -g pm2"}),"."]}),a.jsx(WS,{data:c,onConfigure:()=>b(!0)}),a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx(Pt,{icon:a.jsx(Li,{className:"size-4","aria-hidden":"true"}),title:"Apps",description:c.apps.length===0?"Nothing is deployed from here yet.":`${kn(c.apps.length,"app")}. Each runs under PM2 as ez-<name>.`}),c.apps.length===0?a.jsx(Sn,{children:a.jsx(En,{icon:a.jsx(Li,{className:"size-5","aria-hidden":"true"}),title:"Deploy your first app",description:a.jsxs(a.Fragment,{children:["Give it a repository. A Node project needs nothing else; for any other language, add an ",a.jsx("code",{className:"font-mono",children:"ez.json"})," with its install, build and start commands."]}),action:a.jsx(te,{variant:"primary",icon:a.jsx(Na,{className:"size-4","aria-hidden":"true"}),onClick:k,children:"New app"})})}):a.jsx("ul",{className:"divide-y divide-line",children:c.apps.map(A=>a.jsx(e5,{app:A,canDeploy:Q,busy:N===A.id,onDeploy:()=>void _(A),onOpen:Y=>y({id:A.id,tab:Y}),onEdit:()=>{h(A),m(!0)},onDelete:()=>S(A)},A.id))})]})]}),a.jsx(PS,{open:f,app:g,meta:c,onClose:()=>m(!1),onSaved:(A,Y)=>{m(!1),o.reload(),Y?(s.success(`${A.id} created`,"Press Deploy to build and start it."),A.authType==="deployKey"&&(h(A),m(!0))):s.success(`${A.id} saved`,"It applies to the next deployment.")}}),a.jsx(FS,{open:x,hook:c.hook,domains:c.domains,onClose:()=>b(!1),onSaved:()=>{b(!1),o.reload()}}),a.jsx(KS,{appId:j?.id??null,initialTab:j?.tab,hook:c.hook,meta:c,onClose:()=>y(null),onConfigureHook:()=>b(!0),onChanged:o.reload,onDelete:A=>S(A)}),a.jsx(qS,{app:U,onClose:()=>S(null),onDeleted:()=>{S(null),y(null),o.reload()}})]})}const Cg=[{id:"error",label:"Error",fileName:"error.log"},{id:"access",label:"Access",fileName:"access.log"}];function n5(s){return/\[(error|crit|emerg|alert)\]/.test(s)?"text-bad":/\[(warn|warning)\]/.test(s)?"text-warn":/\s(2\d\d|3\d\d)\s/.test(s)?"text-ok":"text-muted"}function a5(){Bn("Logs");const{connectionError:s}=ea(),[o,c]=qo(),f=o.get("file")==="access"?"access":"error",m=Cg.find(E=>E.id===f),g=E=>{const U=new URLSearchParams(o);E==="error"?U.delete("file"):U.set("file",E),c(U,{replace:!0})},h=Oy(f,{limit:500}),x=p.useRef(null),[b,j]=p.useState(!0);p.useEffect(()=>{const E=x.current;E&&b&&(E.scrollTop=E.scrollHeight)},[h.lines,b]);const y=h.paused,N=h.connected&&!y;return a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"Logs",description:"nginx output as it is written. The stream follows the file; switching tabs does not restart nginx.",meta:a.jsx(je,{tone:y?"warn":h.connected?"ok":"bad",dot:!0,children:y?"Paused":h.connected?"Live":"Reconnecting"}),actions:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex items-center gap-1 rounded-md border border-line bg-raised/60 p-1",role:"group","aria-label":"Log file",children:Cg.map(E=>a.jsx("button",{type:"button","aria-pressed":f===E.id,onClick:()=>g(E.id),className:ie("rounded-sm px-3 py-1 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",f===E.id?"bg-surface text-ink shadow-sm":"text-muted hover:text-ink"),children:E.label},E.id))}),a.jsx(te,{variant:"secondary",size:"sm",icon:y?a.jsx(Go,{className:"size-3.5","aria-hidden":"true"}):a.jsx(uy,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>h.setPaused(!y),children:y?"Resume":"Pause"}),a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx($i,{className:"size-3.5","aria-hidden":"true"}),onClick:h.clear,disabled:h.lines.length===0,children:"Clear"}),a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:h.restart,disabled:!h.connected,children:"Reload tail"}),a.jsx(vt,{value:h.lines.join(`
442
- `),label:"Copy logs",withText:!0})]})}),s&&a.jsx(Se,{tone:"warning",title:"The live stream is disconnected",className:"mb-4",children:"New lines appear once the dashboard socket reconnects. nginx itself is unaffected."}),a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-line bg-raised/40 px-4 py-2 sm:px-5",children:[a.jsxs("span",{className:"inline-flex items-center gap-2 font-mono text-2xs text-muted",children:[a.jsx(Ft,{tone:y?"warn":h.connected?"ok":"bad",pulse:N}),y?"Paused":h.connected?"Live":"Reconnecting"]}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:m.fileName}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:h.lines.length===1?"1 line":`${h.lines.length} lines`}),y&&h.missed>0&&a.jsxs(je,{tone:"warn",children:[h.missed===999?"999+":h.missed," new while paused"]}),a.jsx("span",{className:"ml-auto text-2xs text-faint",children:b?"Following the tail":"Scrolled back"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{ref:x,role:"log","aria-label":`nginx ${m.label.toLowerCase()} log`,"aria-live":"off",onScroll:()=>{const E=x.current;E&&j(E.scrollHeight-E.scrollTop-E.clientHeight<40)},className:"h-[calc(100dvh-20rem)] min-h-72 overflow-y-auto bg-canvas p-4 font-mono text-xs leading-relaxed",children:h.lines.length===0?a.jsx("p",{className:"italic text-faint",children:h.connected?f==="access"?"No access lines yet. They appear here as nginx writes them.":"No error lines yet.":"Waiting for the live stream…"}):h.lines.map((E,U)=>a.jsx("div",{className:ie("whitespace-pre-wrap break-all py-0.5",n5(E)),children:E},`${U}-${E}`))}),!b&&a.jsxs("button",{type:"button",onClick:()=>{const E=x.current;E&&(E.scrollTop=E.scrollHeight),j(!0)},className:"absolute bottom-3 right-3 inline-flex items-center gap-1.5 rounded-pill border border-line bg-surface px-3 py-1.5 text-2xs font-medium text-ink shadow-pop transition-colors hover:bg-inset",children:[a.jsx(Dj,{className:"size-3","aria-hidden":"true"}),"Jump to latest"]})]})]}),a.jsx("p",{className:"mt-3 text-2xs text-faint",children:"The dashboard keeps the last 500 lines in memory for this tab. Pausing only stops the display — lines keep being written to disk."})]})}const Eg={not_linked:"Not linked",connecting:"Connecting…",connected:"Online",rejected:"Rejected by the Hub",unreachable:"Hub unreachable"},zg={connected:"ok",connecting:"warn",unreachable:"warn",rejected:"bad",not_linked:"neutral"};function Rd(s,o){return s instanceof Be?(typeof s.payload.detail=="string"?s.payload.detail:null)??s.message:s instanceof Error?s.message:o}function l5({checked:s,indeterminate:o,disabled:c,label:u,onChange:f}){const m=p.useRef(null);return p.useEffect(()=>{m.current&&(m.current.indeterminate=o)},[o]),a.jsx("input",{ref:m,type:"checkbox","aria-label":`All ${u} permissions`,checked:s,disabled:c,onChange:g=>f(g.target.checked),className:"mt-0.5 size-4 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"})}function Ad(s,o){return!!s.comingSoon||o.includes(s.id)}function s5(){const s=Tt(),o=hn(),c=bt(Z=>re.hub.status(Z)),[u,f]=p.useState(""),[m,g]=p.useState(null),[h,x]=p.useState(!1),[b,j]=p.useState(!1),[y,N]=p.useState(!1),E=c.data?.status??"not_linked";p.useEffect(()=>{const Z=E==="connecting"?2e3:E==="unreachable"?15e3:0;if(!Z)return;const ae=window.setTimeout(c.reload,Z);return()=>window.clearTimeout(ae)},[c.data,c.reload,E]);const U=async()=>{if(h)return;const Z=qw(u);if(Z){g(Z);return}g(null),x(!0);try{const ae=await re.hub.connect(u.trim());c.setData(ae.status),f(""),s.success("Connection string saved",ae.status.status==="connecting"?"Connecting to the Hub…":"This server is now linked to the Hub.")}catch(ae){g(Rd(ae,"The Hub did not accept that connection string."))}finally{x(!1)}},S=async()=>{if(!(b||!await o({title:"Unlink this server from the Hub?",body:"The Hub stops receiving data from this server. Domains and certificates are not affected.",confirmLabel:"Unlink",tone:"danger"}))){j(!0);try{await re.hub.unlink(),c.setData(ae=>ae&&{...ae,linked:!1,hubUrl:null,serverId:null,connected:!1,status:"not_linked",permissions:{},lastError:null,attempts:0}),f(""),g(null),s.success("Unlinked from the Hub")}catch(ae){s.error("Could not unlink",Rd(ae,"The link is still in place."))}finally{j(!1)}}},k=c.data?.permissions??{},_=c.data?.tree??[],z=c.data?.comingSoon??[],Q=async(Z,ae)=>{if(!y){N(!0),c.setData(H=>{if(!H)return H;const W={...H.permissions};for(const ve of Z)W[ve]=ae;return{...H,permissions:W}});try{const H={};for(const ve of Z)H[ve]=ae;const W=await re.hub.updatePermissions(H);c.setData(ve=>ve&&{...ve,permissions:W.permissions,tree:W.tree,comingSoon:W.comingSoon})}catch(H){s.error("Could not save permissions",Rd(H,"The change was not kept.")),c.reload()}finally{N(!1)}}},A=Z=>{const ae=Z.children.filter(W=>!Ad(W,z));if(ae.length===0)return"off";const H=ae.filter(W=>k[W.id]===!0).length;return H===0?"off":H===ae.length?"on":"partial"},Y=(Z,ae)=>{const H=Z.children.filter(W=>!Ad(W,z)).map(W=>W.id);H.length!==0&&Q(H,ae)},ne=Object.values(k).filter(Boolean).length,M=Z=>a.jsxs("div",{className:"w-full max-w-md space-y-3",children:[a.jsx(Lo,{label:"Connection string",value:u,onChange:ae=>{f(ae.target.value),m&&g(null)},placeholder:"ezops://https://hub.example.com|server-id|secret",hint:"Shown only once by the Hub. Treat it like a password.",error:m,className:"font-mono",spellCheck:!1,autoComplete:"off",rows:3}),a.jsx(te,{variant:"primary",loading:h,disabled:!u.trim(),icon:a.jsx(C2,{className:"size-4","aria-hidden":"true"}),onClick:()=>void U(),children:Z})]}),L=zg[E]??"neutral",X=(()=>{if(c.error&&!c.data)return a.jsx(Sn,{children:a.jsx(kt,{error:c.error,title:"Could not read the Hub status",onRetry:c.reload,className:"border-0"})});if(!c.data)return a.jsxs(Sn,{className:"space-y-3",children:[a.jsx(Pe,{className:"h-5 w-48"}),a.jsx(Pe,{className:"h-24 rounded-md"}),a.jsx(Pe,{className:"h-40 rounded-md"})]});const Z=c.data,ae=Eg[Z.status]??"Unknown state",H=zg[Z.status]??"neutral";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-line bg-raised/40 px-4 py-3 sm:px-5",children:[a.jsx(Ft,{tone:H,pulse:Z.status==="connecting"}),a.jsx("span",{className:"text-sm font-medium text-ink",children:ae}),Z.hubUrl&&a.jsx("code",{className:"break-all font-mono text-xs text-muted",children:Z.hubUrl}),Z.serverId&&a.jsxs("span",{className:"text-2xs text-faint",children:["Server ID ",a.jsx("code",{className:"font-mono text-muted",children:Z.serverId})]}),Z.status==="unreachable"&&Z.attempts>0&&a.jsxs("span",{className:"text-2xs text-faint",children:[Z.attempts," reconnect attempt",Z.attempts===1?"":"s"]})]}),a.jsxs("div",{className:"flex flex-wrap items-start gap-x-2 gap-y-1 border-b border-line px-4 py-2.5 text-2xs sm:px-5",children:[a.jsx("span",{className:"font-medium uppercase tracking-wider text-faint",children:"Data directory"}),a.jsx("code",{className:"break-all font-mono text-muted",children:Z.dataDir}),Z.devDataDir&&a.jsx(je,{tone:"warn",children:"dev override"}),Z.devDataDir&&a.jsx("span",{className:"w-full text-faint",children:"This is not the normal data directory. The CLI must run with the same override, or it reads and writes a different domain list."})]}),a.jsxs(Sn,{className:"space-y-5",children:[Z.lastError&&a.jsx(Se,{tone:Z.status==="rejected"?"danger":"warning",title:Z.status==="rejected"?"The Hub rejected this server":"The Hub cannot be reached right now",children:Z.lastError}),Z.linked?a.jsxs(a.Fragment,{children:[Z.status==="rejected"&&a.jsxs("div",{className:"space-y-3 border-t border-line pt-4",children:[a.jsx("p",{className:"text-sm text-muted",children:"This link cannot recover by itself. Paste a fresh connection string from the Hub to replace it."}),M("Reconnect")]}),a.jsxs("section",{className:"space-y-3","aria-labelledby":"hub-permissions-heading",children:[a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h3",{id:"hub-permissions-heading",className:"text-sm font-semibold text-ink",children:"Allow the Hub to"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Monitoring — metrics, nginx status, domains and certificate expiry — is always on. These toggles are enforced on this server; the Hub cannot grant itself anything."})]}),a.jsxs(je,{tone:ne>0?"accent":"neutral",children:[ne," granted"]})]}),a.jsx("div",{className:"space-y-2.5",children:_.map(W=>{const ve=A(W);return a.jsxs("div",{className:"overflow-hidden rounded-md border border-line",children:[a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 bg-raised/60 px-3.5 py-2.5",children:[a.jsx(l5,{checked:ve==="on",indeterminate:ve==="partial",disabled:y,label:W.label,onChange:xe=>Y(W,xe)}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:W.label}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:W.description})]})]}),a.jsx("ul",{className:"divide-y divide-line/60",children:W.children.map(xe=>{const ee=Ad(xe,z),oe=k[xe.id]===!0;return a.jsx("li",{children:a.jsxs("label",{className:ie("flex items-start gap-3 px-3.5 py-2.5 pl-8",ee?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-inset/60"),children:[a.jsx("input",{type:"checkbox",checked:oe,disabled:ee||y,onChange:()=>void Q([xe.id],!oe),className:"mt-0.5 size-3.5 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2 text-sm text-ink",children:[xe.label,ee&&a.jsx(je,{tone:"warn",children:"Coming soon"})]}),a.jsx("span",{className:"mt-0.5 block text-xs text-faint",children:xe.description})]})]})},xe.id)})})]},W.id)})})]}),a.jsx("div",{className:"border-t border-line pt-4",children:a.jsx(te,{variant:"dangerGhost",loading:b,icon:a.jsx(yN,{className:"size-4","aria-hidden":"true"}),onClick:()=>void S(),children:"Unlink from Hub"})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm text-muted",children:"Add this server in the Hub first, then paste the connection string it gives you."}),a.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted",children:[a.jsxs("li",{children:["Open your Hub dashboard → ",a.jsx("span",{className:"text-ink",children:"Add Server"})]}),a.jsx("li",{children:"Enter a display name and submit"}),a.jsx("li",{children:"Copy the connection string the Hub shows you"}),a.jsx("li",{children:"Paste it below and click Connect"})]})]}),M("Connect")]})]})]})})();return a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx("div",{className:ie("h-0.5 w-full",L==="ok"?"bg-ok/60":L==="bad"?"bg-bad/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(Pt,{icon:a.jsx(Yj,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Easy DevOps Hub",c.data&&a.jsx(je,{tone:L,dot:!0,children:Eg[c.data.status]??"Unknown"}),c.data?.devDataDir&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Monitor and control this server from a central dashboard.",actions:a.jsx(te,{variant:"secondary",size:"sm",loading:c.loading,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:c.reload,children:"Refresh"})}),X,c.loading&&c.data&&a.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2 text-2xs text-faint sm:px-5",children:[a.jsx(Ts,{}),"Refreshing the Hub state…"]})]})}const Rg=[{id:"general",label:"General"},{id:"access",label:"Access"},{id:"hub",label:"Hub"},{id:"backup",label:"Backup"}],Zd=[{value:"127.0.0.1",label:"This machine only (127.0.0.1)"},{value:"0.0.0.0",label:"All interfaces (0.0.0.0)"}];function i5(s){return s==="::1"?"This machine only (::1)":Zd.find(o=>o.value===s)?.label??s}const Ro={days:7,min:1,max:30};function Dd(s){return{port:String(s.dashboardPort),nginxDir:s.nginxDir,sslDir:s.sslDir,acmeEmail:s.acmeEmail,autoRenew:s.sslAutoRenew??!0,autoRenewDays:String(s.sslAutoRenewDays??Ro.days),deployDir:s.deployDir??""}}function _d(s){return{bind:s.dashboardBindAddress,auth:s.dashboardAuth,password:"",confirm:""}}function Oi(s,o){return s instanceof Be?(typeof s.payload.detail=="string"?s.payload.detail:null)??s.message:s instanceof Error?s.message:o}function r5(s){if(s instanceof Be){const o=s.payload.reason;if(o==="no_auth_requires_loopback")return"Running without a password requires the dashboard to listen on this machine only.";if(o==="bind_requires_password")return"Set a password before opening the dashboard to the network.";if(o==="no_auth_requires_local_request")return"Turning the password off is only allowed from this machine itself."}return Oi(s,"The previous access settings are still in force.")}function o5(){Bn("Settings");const s=Tt(),o=hn(),{auth:c}=qn(),u=c?.minPasswordLength??8,[f,m]=qo(),g=f.get("tab"),h=Rg.some(ge=>ge.id===g)?g:"general",x=ge=>{const it=new URLSearchParams(f);ge==="general"?it.delete("tab"):it.set("tab",ge),m(it,{replace:!0})},b=bt(ge=>re.settings.get(ge)),j=bt(ge=>re.settings.permissions(ge),[],{enabled:!!b.data&&b.data?.platform!=="win32"}),{service:y,error:N,reload:E}=Xi(),U=Qi(y);As("settings",()=>{b.reload(),j.reload()});const[S,k]=p.useState(null),[_,z]=p.useState(null),[Q,A]=p.useState(!1),[Y,ne]=p.useState(!1),[M,L]=p.useState(!1),[X,Z]=p.useState(!1),[ae,H]=p.useState(!1),[W,ve]=p.useState(null),[xe,ee]=p.useState(null);p.useEffect(()=>{b.data&&!S&&k(Dd(b.data))},[b.data,S]),p.useEffect(()=>{b.data&&!_&&z(_d(b.data))},[b.data,_]);const oe=S?Yo(S.port):null,$=S?Ry(S.acmeEmail):null,le=S&&!S.nginxDir.trim()?"This directory is required.":null,ke=S&&!S.sslDir.trim()?"This directory is required.":null,Te=b.data?.deployDir!==void 0,Ie=!!S&&Te&&S.deployDir.trim()!==(b.data?.deployDir??""),qe=b.data?.sslAutoRenew!==void 0,T=b.data?.sslAutoRenewDaysMin??Ro.min,I=b.data?.sslAutoRenewDaysMax??Ro.max,P=S?Number(S.autoRenewDays):NaN,F=S&&qe&&S.autoRenew&&(!/^\d+$/.test(S.autoRenewDays.trim())||P<T||P>I)?`Enter a whole number from ${T} to ${I}.`:null,Ne=!!(S&&b.data&&(Number(S.port)!==b.data.dashboardPort||S.nginxDir!==b.data.nginxDir||S.sslDir!==b.data.sslDir||S.acmeEmail!==b.data.acmeEmail||Te&&S.deployDir.trim()!==(b.data.deployDir??"")||qe&&(S.autoRenew!==(b.data.sslAutoRenew??!0)||S.autoRenew&&P!==(b.data.sslAutoRenewDays??Ro.days)))),De=!!(_&&b.data&&(_.bind!==b.data.dashboardBindAddress||_.auth!==b.data.dashboardAuth||_.password!=="")),Ce=async()=>{if(!(!S||M)&&(A(!0),!(oe||$||le||ke||F))){L(!0);try{const ge=await re.settings.update({dashboardPort:Number(S.port),nginxDir:S.nginxDir.trim(),sslDir:S.sslDir.trim(),acmeEmail:S.acmeEmail.trim(),...Ie?{deployDir:S.deployDir.trim()}:{},...qe?{sslAutoRenew:S.autoRenew,...S.autoRenew?{sslAutoRenewDays:P}:{}}:{}});H(ge.needsRestart),s.success("Settings saved",ge.needsRestart?"Restart the dashboard for the new port to take effect.":void 0),b.reload()}catch(ge){s.error("Could not save settings",Oi(ge,"The previous settings are still in force."))}finally{L(!1)}}},ce=async()=>{if(!_||!b.data||X)return;if(ne(!0),ve(null),ee(null),_.auth==="none"&&_.bind==="0.0.0.0"){ve("Running without a password requires the dashboard to listen here only.");return}if(_.password){const it=cg(_.password,u)??(_.password!==_.confirm?"The two passwords do not match.":null);if(it){ee(it);return}}else if(_.auth==="password"&&!b.data.hasPassword){ee("Set a password before requiring a password to sign in.");return}const ge=_.password?"password":_.auth;Z(!0);try{const it={dashboardBindAddress:_.bind,dashboardAuth:ge};_.password&&(it.dashboardPassword=_.password);const Mt=await re.settings.update(it);H(Mt.needsRestart),z(ut=>ut&&{...ut,auth:Mt.dashboardAuth,password:"",confirm:""}),s.success("Access settings saved",Mt.needsRestart?"Restart the dashboard for the new listening address to take effect.":void 0),b.reload()}catch(it){ve(r5(it))}finally{Z(!1)}},[ye,Ht]=p.useState(""),[Gn,It]=p.useState(null),[Bt,V]=p.useState(!1),de=async()=>{if(!(!ye||Bt)){V(!0),It(null);try{await re.settings.setupPermissions(ye),Ht(""),j.setData({configured:!0}),s.success("Permissions configured","nginx and systemctl no longer prompt for a password.")}catch(ge){It(Oi(ge,"The sudoers file was not written."))}finally{V(!1)}}},be=p.useRef(null),[nt,Ge]=p.useState(!1),[Ta,na]=p.useState(!1),[Rn,aa]=p.useState(null),Rl=async()=>{if(!nt){Ge(!0);try{const ge=await re.settings.backup(),it=new Blob([JSON.stringify(ge,null,2)],{type:"application/json"}),Mt=URL.createObjectURL(it),ut=document.createElement("a");ut.href=Mt,ut.download=`easy-devops-backup-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(ut),ut.click(),ut.remove(),window.setTimeout(()=>URL.revokeObjectURL(Mt),1e3),s.success("Backup downloaded")}catch(ge){s.error("Could not create the backup",Oi(ge,"Nothing was downloaded."))}finally{Ge(!1)}}},Ds=async ge=>{const it=ge.target.files?.[0];if(!it)return;aa(null);let Mt;try{Mt=JSON.parse(await it.text())}catch{aa({tone:"danger",title:"That file is not valid JSON",body:"Pick the .json file produced by Export backup."}),ge.target.value="";return}const ut=Mt;if(!ut||typeof ut!="object"||typeof ut.config!="object"||ut.config===null){aa({tone:"danger",title:"That file is not an Easy DevOps backup",body:"A backup always contains a config section and a domains list."}),ge.target.value="";return}const rt=await o({title:"Restore this backup?",body:"This replaces your current configuration and domain list. Passwords and the listen address stored in the file are ignored.",confirmLabel:"Restore",tone:"danger"});if(ge.target.value="",!!rt){na(!0);try{await re.settings.restore(Mt);const Wt=await re.settings.get();b.setData(Wt),k(Dd(Wt)),z(_d(Wt)),A(!1),ne(!1),H(!1),j.reload(),aa({tone:"success",title:"Backup restored",body:`Configuration from ${Sy(ut.exportedAt??null)} is now in force. Reload any other open dashboard tabs to pick it up.`}),s.success("Backup restored")}catch(Wt){aa({tone:"danger",title:"The restore failed",body:Oi(Wt,"Nothing was changed.")})}finally{na(!1)}}},Ki=()=>{b.reload(),j.reload(),h==="general"&&E()},An=ae&&a.jsx(Se,{tone:"info",title:"Restart needed",children:"The port or listening address changed. It takes effect after the dashboard restarts."}),_s=()=>b.error&&!b.data?a.jsx(kt,{error:b.error,title:"Could not read the settings",onRetry:b.reload}):!b.data||!S?a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-64 rounded-lg"}),a.jsx(Pe,{className:"h-40 rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(Pt,{icon:a.jsx(sf,{className:"size-4","aria-hidden":"true"}),title:"Application configuration",description:"Where nginx lives, which port the dashboard answers on, and the address Let’s Encrypt knows you by."}),a.jsxs(Sn,{className:"space-y-5",children:[An,a.jsxs(va,{children:[a.jsx(ze,{label:"Dashboard port",type:"number",min:1,max:65535,inputMode:"numeric",value:S.port,onChange:ge=>k({...S,port:ge.target.value}),error:Q?oe:null,hint:"Takes effect after the dashboard restarts."}),a.jsx(ze,{label:"ACME email",type:"email",value:S.acmeEmail,onChange:ge=>k({...S,acmeEmail:ge.target.value}),error:Q?$:null,hint:"Used when ordering certificates. Usually not shown to anyone.",placeholder:"admin@example.com"}),a.jsx(ze,{label:"Nginx directory",value:S.nginxDir,onChange:ge=>k({...S,nginxDir:ge.target.value}),error:Q?le:null,hint:"Where nginx.conf is located.",className:"font-mono",spellCheck:!1}),a.jsx(ze,{label:"SSL settings directory",value:S.sslDir,onChange:ge=>k({...S,sslDir:ge.target.value}),error:Q?ke:null,hint:"Default directory for certificates the dashboard manages.",className:"font-mono",spellCheck:!1}),Te&&a.jsx(ze,{label:"Deployments folder",value:S.deployDir,onChange:ge=>k({...S,deployDir:ge.target.value}),hint:a.jsxs(a.Fragment,{children:["Where ",a.jsx("strong",{className:"font-medium",children:"new"})," deployed apps are created. Apps that already exist stay where they are — move one from its “Domain & folder” tab. Leave empty for the default",b.data.deployDirDefault?` (${b.data.deployDirDefault})`:"","."]}),placeholder:b.data.deployDirDefault,className:"font-mono",spellCheck:!1})]}),qe&&a.jsxs("div",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(Ut,{checked:S.autoRenew,onChange:ge=>k({...S,autoRenew:ge}),label:"Renew certificates automatically",description:a.jsx(a.Fragment,{children:"The background service renews HTTP-validated certificates before they expire, without stopping nginx. Wildcard and other DNS-validated certificates need a TXT record added by hand, so they only get a warning."})}),S.autoRenew&&a.jsx(va,{children:a.jsx(ze,{label:"Renew this many days before expiry",type:"number",min:T,max:I,inputMode:"numeric",value:S.autoRenewDays,onChange:ge=>k({...S,autoRenewDays:ge.target.value}),error:Q?F:null,hint:S.acmeEmail.trim()?"A failed attempt is retried on the next check, and you are notified either way.":"Set an ACME email above — renewal cannot run without one."})})]})]}),a.jsxs(Ed,{children:[a.jsx("span",{className:"text-2xs text-faint",children:Ne?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{variant:"ghost",size:"sm",disabled:!Ne,onClick:()=>{k(Dd(b.data)),A(!1)},children:"Revert"}),a.jsx(te,{variant:"primary",size:"sm",loading:M,disabled:!Ne,icon:a.jsx(Bd,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void Ce(),children:"Save settings"})]})]})]}),a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx(Pt,{icon:a.jsx(hy,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Background service",U&&a.jsx(je,{tone:U.running?"ok":"warn",dot:!0,children:Mo(U)}),y?.dev&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Runs monitoring and notifications without this dashboard open.",actions:a.jsx(yt,{to:"/processes",className:ba("secondary","sm"),children:"Open Processes"})}),a.jsx(Sn,{children:N&&!y?a.jsxs(Se,{tone:"warning",title:"Could not read the service state",children:[N.message," ",a.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:E,children:"Try again"})]}):y?U?a.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Status"}),a.jsx("div",{className:ie("mt-0.5 text-sm font-medium",U.running?"text-ok":"text-warn"),children:Mo(U)}),U.stoppedByUser&&U.stoppedAtLabel&&a.jsxs("div",{className:"mt-0.5 text-2xs text-faint",children:["Stopped ",U.stoppedAtLabel]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Mode"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",title:U.mechanismDetail,children:U.mechanismLabel})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Starts"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",children:U.startsAtLabel})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"PM2 (your apps)"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",children:y.pm2.installed?y.pm2.version??"Installed":"Not installed"})]})]}):null:a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(Ts,{}),"Checking the background service…"]})})]})]}),Os=()=>{if(b.error&&!b.data)return a.jsx(kt,{error:b.error,title:"Could not read the settings",onRetry:b.reload});if(!b.data||!_)return a.jsxs(Sa,{children:[a.jsx(Pe,{className:"h-72 rounded-lg"}),a.jsx(Pe,{className:"h-40 rounded-lg"})]});const ge=_.bind!=="0.0.0.0",it=b.data.canUseNoPassword||ge,Mt=_.password?cg(_.password,u)??(_.confirm&&_.password!==_.confirm?"The two passwords do not match.":null):null,ut=xe??(Y?Mt:null);return a.jsxs("div",{className:"space-y-5",children:[a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(Pt,{icon:a.jsx(Yi,{className:"size-4","aria-hidden":"true"}),title:"Access and authentication",description:"Who can reach the dashboard, and how they prove who they are."}),a.jsxs(Sn,{className:"space-y-5",children:[An,W&&a.jsx(Se,{tone:"danger",title:"Could not save access settings",children:W}),a.jsxs(va,{children:[a.jsxs(tl,{label:"Listen on",value:_.bind,onChange:rt=>{const Wt=rt.target.value;z({..._,bind:Wt,auth:Wt==="0.0.0.0"?"password":_.auth})},hint:_.auth==="none"?"Locked to this machine while there is no password.":"Changing this needs a dashboard restart.",children:[Zd.map(rt=>a.jsx("option",{value:rt.value,disabled:rt.value==="0.0.0.0"&&_.auth==="none",children:rt.label},rt.value)),!Zd.some(rt=>rt.value===_.bind)&&a.jsx("option",{value:_.bind,children:i5(_.bind)})]}),a.jsxs(tl,{label:"Authentication",value:_.auth,onChange:rt=>{const Wt=rt.target.value;z({..._,auth:Wt,bind:Wt==="none"?"127.0.0.1":_.bind}),ee(null)},hint:_.auth==="none"?"No login — reachable from this machine only.":!b.data.hasPassword&&!_.password?"No password set yet — set one below.":"A password is required to sign in.",children:[a.jsx("option",{value:"password",children:"Password required"}),a.jsx("option",{value:"none",disabled:!it,children:"No password (this machine only)"})]})]}),_.auth==="none"&&a.jsx(Se,{tone:"warning",title:"No login",children:"Anyone who can reach this machine can open the dashboard. Listening is fixed to 127.0.0.1 so that is only this machine, not the network."}),a.jsxs("div",{className:"max-w-md space-y-4 border-t border-line pt-4",children:[a.jsx(ze,{label:"New password",type:"password",autoComplete:"new-password",value:_.password,onChange:rt=>{z({..._,password:rt.target.value}),ee(null)},error:ut,hint:`Leave blank to keep the current password. At least ${u} characters.`}),a.jsx(ze,{label:"Confirm new password",type:"password",autoComplete:"new-password",value:_.confirm,onChange:rt=>{z({..._,confirm:rt.target.value}),ee(null)}})]})]}),a.jsxs(Ed,{children:[a.jsx("span",{className:"text-2xs text-faint",children:De?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{variant:"ghost",size:"sm",disabled:!De,onClick:()=>{z(_d(b.data)),ne(!1),ve(null),ee(null)},children:"Revert"}),a.jsx(te,{variant:"primary",size:"sm",loading:X,disabled:!De,icon:a.jsx(Bd,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void ce(),children:"Save access"})]})]})]}),b.data.platform!=="win32"&&a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx("div",{className:ie("h-0.5 w-full",j.data?.configured?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(Pt,{icon:a.jsx(wa,{className:"size-4","aria-hidden":"true"}),title:"Linux permissions",description:"Passwordless sudo for nginx and systemctl.",actions:j.data?a.jsx(je,{tone:j.data.configured?"ok":"warn",dot:!0,children:j.data.configured?"Configured":"Required"}):void 0}),a.jsx(Sn,{children:j.error&&!j.data?a.jsx(kt,{error:j.error,title:"Could not read the permission state",onRetry:j.reload,className:"border-0"}):j.data?j.data.configured?a.jsx("p",{className:"text-sm text-muted",children:"Passwordless sudo is configured. The dashboard can reload nginx and call systemctl without stopping to ask for a password."}):a.jsxs("div",{className:"max-w-md space-y-4",children:[a.jsx("p",{className:"text-sm text-muted",children:"The dashboard needs passwordless sudo to control nginx and systemctl. Enter your sudo password once and it writes the sudoers entry for you."}),Gn&&a.jsx(Se,{tone:"danger",title:"Permissions were not configured",children:Gn}),a.jsx(ze,{label:"Sudo password",type:"password",autoComplete:"current-password",placeholder:"Enter your sudo password",value:ye,onChange:rt=>{Ht(rt.target.value),Gn&&It(null)},onKeyDown:rt=>{rt.key==="Enter"&&de()}}),a.jsx(te,{variant:"primary",loading:Bt,disabled:!ye,onClick:()=>void de(),children:"Set up permissions"})]}):a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(Ts,{}),"Checking sudoers…"]})})]})]})},Vo=()=>a.jsxs(Xe,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(Pt,{icon:a.jsx(Hd,{className:"size-4","aria-hidden":"true"}),title:"Backup and restore",description:"Export or restore settings and domains as JSON."}),a.jsxs(Sn,{className:"space-y-5",children:[a.jsxs("div",{className:"grid gap-5 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-ink",children:"Export"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Download every setting and domain as one JSON file. Passwords are excluded from the export."})]}),a.jsx(te,{variant:"secondary",loading:nt,icon:a.jsx(Hd,{className:"size-4","aria-hidden":"true"}),onClick:()=>void Rl(),children:"Export backup"})]}),a.jsxs("div",{className:"space-y-3 border-t border-line pt-5 sm:border-l sm:border-t-0 sm:pl-5 sm:pt-0",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-ink",children:"Restore"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Replace the current configuration and domain list with a previously exported file. Passwords and the listen address stored in the file are ignored."})]}),a.jsx("input",{ref:be,type:"file",accept:".json,application/json",className:"sr-only",onChange:ge=>void Ds(ge)}),a.jsx(te,{variant:"secondary",loading:Ta,disabled:nt,icon:a.jsx(bN,{className:"size-4","aria-hidden":"true"}),onClick:()=>be.current?.click(),children:"Choose backup file…"})]})]}),Rn&&a.jsx(Se,{tone:Rn.tone,title:Rn.title,children:Rn.body})]}),a.jsx(Ed,{children:a.jsx("span",{className:"text-2xs text-faint",children:"Exported backups never contain the dashboard password."})})]});return a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"Settings",description:"Configuration, access, Hub pairing and backups for this dashboard.",actions:h!=="hub"?a.jsx(te,{variant:"secondary",size:"sm",loading:b.loading||j.loading,icon:a.jsx(Ot,{className:"size-3.5","aria-hidden":"true"}),onClick:Ki,children:"Refresh"}):void 0}),a.jsx("div",{role:"tablist","aria-label":"Settings sections",className:"mb-5 flex flex-wrap gap-1 rounded-lg border border-line bg-raised/60 p-1",children:Rg.map(ge=>a.jsx("button",{type:"button",role:"tab",id:`settings-tab-${ge.id}`,"aria-selected":h===ge.id,"aria-controls":`settings-panel-${ge.id}`,onClick:()=>x(ge.id),className:ie("rounded-sm border px-3 py-1.5 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",h===ge.id?"border-line bg-surface text-ink shadow-sm":"border-transparent text-muted hover:text-ink"),children:ge.label},ge.id))}),a.jsxs("div",{role:"tabpanel",id:`settings-panel-${h}`,"aria-labelledby":`settings-tab-${h}`,tabIndex:-1,className:"outline-none",children:[h==="general"&&_s(),h==="access"&&Os(),h==="hub"&&a.jsx(s5,{}),h==="backup"&&Vo()]})]})}function c5(){return Bn("Page not found"),a.jsxs(a.Fragment,{children:[a.jsx(ta,{title:"Page not found",description:"That address does not match a dashboard section."}),a.jsx(Xe,{children:a.jsx(En,{title:"Nothing here",description:"The link may be old, or the section may have moved.",action:a.jsxs(yt,{to:"/",className:ba("secondary","sm"),children:[a.jsx(Oj,{className:"size-3.5","aria-hidden":"true"}),"Back to Overview"]})})})]})}function u5(){const{phase:s}=qn();return s==="loading"?a.jsx(xw,{}):s==="error"?a.jsx(ww,{}):s==="unauthenticated"?a.jsx(Rw,{}):a.jsx(Y1,{children:a.jsxs(wn,{element:a.jsx(Nw,{}),children:[a.jsx(wn,{index:!0,element:a.jsx(Lw,{})}),a.jsx(wn,{path:"domains",element:a.jsx(Fw,{})}),a.jsx(wn,{path:"ssl",element:a.jsx(rS,{})}),a.jsx(wn,{path:"nginx",element:a.jsx(uS,{})}),a.jsx(wn,{path:"notifications",element:a.jsx(bS,{})}),a.jsx(wn,{path:"deployments",element:a.jsx(t5,{})}),a.jsx(wn,{path:"processes",element:a.jsx(TS,{})}),a.jsx(wn,{path:"logs",element:a.jsx(a5,{})}),a.jsx(wn,{path:"settings",element:a.jsx(o5,{})}),a.jsx(wn,{path:"*",element:a.jsx(c5,{})})]})})}function d5(){return a.jsx(Sj,{children:a.jsx(CN,{children:a.jsx(ON,{children:a.jsx(QN,{children:a.jsx(KN,{children:a.jsx(JN,{children:a.jsx(hj,{children:a.jsx(u5,{})})})})})})})})}const Uy=document.getElementById("root");if(!Uy)throw new Error("Missing #root element");B0.createRoot(Uy).render(a.jsx(p.StrictMode,{children:a.jsx(d5,{})}));