easy-devops 1.4.2 → 1.4.3

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,4 +1,4 @@
1
- (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function MN(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Yf={exports:{}},xr={};/**
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function qN(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xf={exports:{}},gr={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ty;function _N(){if(Ty)return xr;Ty=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(c,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var h in d)h!=="key"&&(f[h]=d[h])}else f=d;return d=f.ref,{$$typeof:n,type:c,key:m,ref:d!==void 0?d:null,props:f}}return xr.Fragment=i,xr.jsx=r,xr.jsxs=r,xr}var Ey;function LN(){return Ey||(Ey=1,Yf.exports=_N()),Yf.exports}var a=LN(),Vf={exports:{}},Oe={};/**
9
+ */var Rv;function GN(){if(Rv)return gr;Rv=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(c,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var h in d)h!=="key"&&(f[h]=d[h])}else f=d;return d=f.ref,{$$typeof:n,type:c,key:m,ref:d!==void 0?d:null,props:f}}return gr.Fragment=i,gr.jsx=r,gr.jsxs=r,gr}var zv;function YN(){return zv||(zv=1,Xf.exports=GN()),Xf.exports}var a=YN(),Kf={exports:{}},Oe={};/**
10
10
  * @license React
11
11
  * react.production.js
12
12
  *
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ry;function UN(){if(Ry)return Oe;Ry=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.for("react.view_transition"),S=Symbol.iterator;function R(T){return T===null||typeof T!="object"?null:(T=S&&T[S]||T["@@iterator"],typeof T=="function"?T:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,z={};function w(T,q,V){this.props=T,this.context=q,this.refs=z,this.updater=V||k}w.prototype.isReactComponent={},w.prototype.setState=function(T,q){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,q,"setState")},w.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function O(){}O.prototype=w.prototype;function E(T,q,V){this.props=T,this.context=q,this.refs=z,this.updater=V||k}var M=E.prototype=new O;M.constructor=E,C(M,w.prototype),M.isPureReactComponent=!0;var Y=Array.isArray;function A(){}var H={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function I(T,q,V){var re=V.ref;return{$$typeof:n,type:T,key:q,ref:re!==void 0?re:null,props:V}}function ne(T,q){return I(T.type,q,T.props)}function J(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function Z(T){var q={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(V){return q[V]})}var ee=/\/+/g;function ue(T,q){return typeof T=="object"&&T!==null&&T.key!=null?Z(""+T.key):q.toString(36)}function K(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(A,A):(T.status="pending",T.then(function(q){T.status==="pending"&&(T.status="fulfilled",T.value=q)},function(q){T.status==="pending"&&(T.status="rejected",T.reason=q)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function B(T,q,V,re,ye){var Re=typeof T;(Re==="undefined"||Re==="boolean")&&(T=null);var xe=!1;if(T===null)xe=!0;else switch(Re){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(T.$$typeof){case n:case i:xe=!0;break;case b:return xe=T._init,B(xe(T._payload),q,V,re,ye)}}if(xe)return ye=ye(T),xe=re===""?"."+ue(T,0):re,Y(ye)?(V="",xe!=null&&(V=xe.replace(ee,"$&/")+"/"),B(ye,q,V,"",function(Pe){return Pe})):ye!=null&&(J(ye)&&(ye=ne(ye,V+(ye.key==null||T&&T.key===ye.key?"":(""+ye.key).replace(ee,"$&/")+"/")+xe)),q.push(ye)),1;xe=0;var me=re===""?".":re+":";if(Y(T))for(var ie=0;ie<T.length;ie++)re=T[ie],Re=me+ue(re,ie),xe+=B(re,q,V,Re,ye);else if(ie=R(T),typeof ie=="function")for(T=ie.call(T),ie=0;!(re=T.next()).done;)re=re.value,Re=me+ue(re,ie++),xe+=B(re,q,V,Re,ye);else if(Re==="object"){if(typeof T.then=="function")return B(K(T),q,V,re,ye);throw q=String(T),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return xe}function L(T,q,V){if(T==null)return T;var re=[],ye=0;return B(T,re,"","",function(Re){return q.call(V,Re,ye++)}),re}function te(T){if(T._status===-1){var q=T._result,V=q();V.then(function(re){(T._status===0||T._status===-1)&&(T._status=1,T._result=re,V.status===void 0&&(V.status="fulfilled",V.value=re))},function(re){(T._status===0||T._status===-1)&&(T._status=2,T._result=re,V.status===void 0&&(V.status="rejected",V.reason=re))}),T._status===-1&&(T._status=0,T._result=V)}if(T._status===1)return T._result.default;throw T._result}var de=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function ke(T){var q=H.T,V={};V.types=q!==null?q.types:null,H.T=V;try{var re=T(),ye=H.S;ye!==null&&ye(V,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(A,de)}catch(Re){de(Re)}finally{q!==null&&V.types!==null&&(q.types=V.types),H.T=q}}function Ne(T){var q=H.T;if(q!==null){var V=q.types;V===null?q.types=[T]:V.indexOf(T)===-1&&V.push(T)}else ke(Ne.bind(null,T))}var Ee={map:L,forEach:function(T,q,V){L(T,function(){q.apply(this,arguments)},V)},count:function(T){var q=0;return L(T,function(){q++}),q},toArray:function(T){return L(T,function(q){return q})||[]},only:function(T){if(!J(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Oe.Activity=x,Oe.Children=Ee,Oe.Component=w,Oe.Fragment=r,Oe.Profiler=d,Oe.PureComponent=E,Oe.StrictMode=c,Oe.Suspense=g,Oe.ViewTransition=j,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(T){return H.H.useMemoCache(T)}},Oe.addTransitionType=Ne,Oe.cache=function(T){return function(){return T.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(T,q,V){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var re=C({},T.props),ye=T.key;if(q!=null)for(Re in q.key!==void 0&&(ye=""+q.key),q)!W.call(q,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&q.ref===void 0||(re[Re]=q[Re]);var Re=arguments.length-2;if(Re===1)re.children=V;else if(1<Re){for(var xe=Array(Re),me=0;me<Re;me++)xe[me]=arguments[me+2];re.children=xe}return I(T.type,ye,re)},Oe.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:f,_context:T},T},Oe.createElement=function(T,q,V){var re,ye={},Re=null;if(q!=null)for(re in q.key!==void 0&&(Re=""+q.key),q)W.call(q,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ye[re]=q[re]);var xe=arguments.length-2;if(xe===1)ye.children=V;else if(1<xe){for(var me=Array(xe),ie=0;ie<xe;ie++)me[ie]=arguments[ie+2];ye.children=me}if(T&&T.defaultProps)for(re in xe=T.defaultProps,xe)ye[re]===void 0&&(ye[re]=xe[re]);return I(T,Re,ye)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(T){return{$$typeof:h,render:T}},Oe.isValidElement=J,Oe.lazy=function(T){return{$$typeof:b,_payload:{_status:-1,_result:T},_init:te}},Oe.memo=function(T,q){return{$$typeof:v,type:T,compare:q===void 0?null:q}},Oe.startTransition=ke,Oe.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Oe.use=function(T){return H.H.use(T)},Oe.useActionState=function(T,q,V){return H.H.useActionState(T,q,V)},Oe.useCallback=function(T,q){return H.H.useCallback(T,q)},Oe.useContext=function(T){return H.H.useContext(T)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(T,q){return H.H.useDeferredValue(T,q)},Oe.useEffect=function(T,q){return H.H.useEffect(T,q)},Oe.useEffectEvent=function(T){return H.H.useEffectEvent(T)},Oe.useId=function(){return H.H.useId()},Oe.useImperativeHandle=function(T,q,V){return H.H.useImperativeHandle(T,q,V)},Oe.useInsertionEffect=function(T,q){return H.H.useInsertionEffect(T,q)},Oe.useLayoutEffect=function(T,q){return H.H.useLayoutEffect(T,q)},Oe.useMemo=function(T,q){return H.H.useMemo(T,q)},Oe.useOptimistic=function(T,q){return H.H.useOptimistic(T,q)},Oe.useReducer=function(T,q,V){return H.H.useReducer(T,q,V)},Oe.useRef=function(T){return H.H.useRef(T)},Oe.useState=function(T){return H.H.useState(T)},Oe.useSyncExternalStore=function(T,q,V){return H.H.useSyncExternalStore(T,q,V)},Oe.useTransition=function(){return H.H.useTransition()},Oe.version="19.3.1",Oe}var zy;function Mh(){return zy||(zy=1,Vf.exports=UN()),Vf.exports}var p=Mh();const yt=MN(p);var Xf={exports:{}},gr={},Kf={exports:{}},Zf={};/**
17
+ */var Dv;function VN(){if(Dv)return Oe;Dv=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.for("react.view_transition"),S=Symbol.iterator;function R(T){return T===null||typeof T!="object"?null:(T=S&&T[S]||T["@@iterator"],typeof T=="function"?T:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(T,q,V){this.props=T,this.context=q,this.refs=D,this.updater=V||k}E.prototype.isReactComponent={},E.prototype.setState=function(T,q){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,q,"setState")},E.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function O(){}O.prototype=E.prototype;function w(T,q,V){this.props=T,this.context=q,this.refs=D,this.updater=V||k}var U=w.prototype=new O;U.constructor=w,C(U,E.prototype),U.isPureReactComponent=!0;var Y=Array.isArray;function A(){}var M={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function I(T,q,V){var re=V.ref;return{$$typeof:n,type:T,key:q,ref:re!==void 0?re:null,props:V}}function ne(T,q){return I(T.type,q,T.props)}function F(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function Z(T){var q={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(V){return q[V]})}var te=/\/+/g;function ce(T,q){return typeof T=="object"&&T!==null&&T.key!=null?Z(""+T.key):q.toString(36)}function K(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(A,A):(T.status="pending",T.then(function(q){T.status==="pending"&&(T.status="fulfilled",T.value=q)},function(q){T.status==="pending"&&(T.status="rejected",T.reason=q)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function H(T,q,V,re,ye){var Re=typeof T;(Re==="undefined"||Re==="boolean")&&(T=null);var xe=!1;if(T===null)xe=!0;else switch(Re){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(T.$$typeof){case n:case i:xe=!0;break;case b:return xe=T._init,H(xe(T._payload),q,V,re,ye)}}if(xe)return ye=ye(T),xe=re===""?"."+ce(T,0):re,Y(ye)?(V="",xe!=null&&(V=xe.replace(te,"$&/")+"/"),H(ye,q,V,"",function(Pe){return Pe})):ye!=null&&(F(ye)&&(ye=ne(ye,V+(ye.key==null||T&&T.key===ye.key?"":(""+ye.key).replace(te,"$&/")+"/")+xe)),q.push(ye)),1;xe=0;var me=re===""?".":re+":";if(Y(T))for(var ie=0;ie<T.length;ie++)re=T[ie],Re=me+ce(re,ie),xe+=H(re,q,V,Re,ye);else if(ie=R(T),typeof ie=="function")for(T=ie.call(T),ie=0;!(re=T.next()).done;)re=re.value,Re=me+ce(re,ie++),xe+=H(re,q,V,Re,ye);else if(Re==="object"){if(typeof T.then=="function")return H(K(T),q,V,re,ye);throw q=String(T),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return xe}function L(T,q,V){if(T==null)return T;var re=[],ye=0;return H(T,re,"","",function(Re){return q.call(V,Re,ye++)}),re}function ee(T){if(T._status===-1){var q=T._result,V=q();V.then(function(re){(T._status===0||T._status===-1)&&(T._status=1,T._result=re,V.status===void 0&&(V.status="fulfilled",V.value=re))},function(re){(T._status===0||T._status===-1)&&(T._status=2,T._result=re,V.status===void 0&&(V.status="rejected",V.reason=re))}),T._status===-1&&(T._status=0,T._result=V)}if(T._status===1)return T._result.default;throw T._result}var de=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function ke(T){var q=M.T,V={};V.types=q!==null?q.types:null,M.T=V;try{var re=T(),ye=M.S;ye!==null&&ye(V,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(A,de)}catch(Re){de(Re)}finally{q!==null&&V.types!==null&&(q.types=V.types),M.T=q}}function Ne(T){var q=M.T;if(q!==null){var V=q.types;V===null?q.types=[T]:V.indexOf(T)===-1&&V.push(T)}else ke(Ne.bind(null,T))}var Ee={map:L,forEach:function(T,q,V){L(T,function(){q.apply(this,arguments)},V)},count:function(T){var q=0;return L(T,function(){q++}),q},toArray:function(T){return L(T,function(q){return q})||[]},only:function(T){if(!F(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Oe.Activity=x,Oe.Children=Ee,Oe.Component=E,Oe.Fragment=r,Oe.Profiler=d,Oe.PureComponent=w,Oe.StrictMode=c,Oe.Suspense=g,Oe.ViewTransition=j,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(T){return M.H.useMemoCache(T)}},Oe.addTransitionType=Ne,Oe.cache=function(T){return function(){return T.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(T,q,V){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var re=C({},T.props),ye=T.key;if(q!=null)for(Re in q.key!==void 0&&(ye=""+q.key),q)!W.call(q,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&q.ref===void 0||(re[Re]=q[Re]);var Re=arguments.length-2;if(Re===1)re.children=V;else if(1<Re){for(var xe=Array(Re),me=0;me<Re;me++)xe[me]=arguments[me+2];re.children=xe}return I(T.type,ye,re)},Oe.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:f,_context:T},T},Oe.createElement=function(T,q,V){var re,ye={},Re=null;if(q!=null)for(re in q.key!==void 0&&(Re=""+q.key),q)W.call(q,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ye[re]=q[re]);var xe=arguments.length-2;if(xe===1)ye.children=V;else if(1<xe){for(var me=Array(xe),ie=0;ie<xe;ie++)me[ie]=arguments[ie+2];ye.children=me}if(T&&T.defaultProps)for(re in xe=T.defaultProps,xe)ye[re]===void 0&&(ye[re]=xe[re]);return I(T,Re,ye)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(T){return{$$typeof:h,render:T}},Oe.isValidElement=F,Oe.lazy=function(T){return{$$typeof:b,_payload:{_status:-1,_result:T},_init:ee}},Oe.memo=function(T,q){return{$$typeof:y,type:T,compare:q===void 0?null:q}},Oe.startTransition=ke,Oe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Oe.use=function(T){return M.H.use(T)},Oe.useActionState=function(T,q,V){return M.H.useActionState(T,q,V)},Oe.useCallback=function(T,q){return M.H.useCallback(T,q)},Oe.useContext=function(T){return M.H.useContext(T)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(T,q){return M.H.useDeferredValue(T,q)},Oe.useEffect=function(T,q){return M.H.useEffect(T,q)},Oe.useEffectEvent=function(T){return M.H.useEffectEvent(T)},Oe.useId=function(){return M.H.useId()},Oe.useImperativeHandle=function(T,q,V){return M.H.useImperativeHandle(T,q,V)},Oe.useInsertionEffect=function(T,q){return M.H.useInsertionEffect(T,q)},Oe.useLayoutEffect=function(T,q){return M.H.useLayoutEffect(T,q)},Oe.useMemo=function(T,q){return M.H.useMemo(T,q)},Oe.useOptimistic=function(T,q){return M.H.useOptimistic(T,q)},Oe.useReducer=function(T,q,V){return M.H.useReducer(T,q,V)},Oe.useRef=function(T){return M.H.useRef(T)},Oe.useState=function(T){return M.H.useState(T)},Oe.useSyncExternalStore=function(T,q,V){return M.H.useSyncExternalStore(T,q,V)},Oe.useTransition=function(){return M.H.useTransition()},Oe.version="19.3.1",Oe}var Av;function Lh(){return Av||(Av=1,Kf.exports=VN()),Kf.exports}var p=Lh();const vt=qN(p);var Zf={exports:{}},vr={},Qf={exports:{}},If={};/**
18
18
  * @license React
19
19
  * scheduler.production.js
20
20
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var Dy;function HN(){return Dy||(Dy=1,(function(n){function i(K,B){var L=K.length;K.push(B);e:for(;0<L;){var te=L-1>>>1,de=K[te];if(0<d(de,B))K[te]=B,K[L]=de,L=te;else break e}}function r(K){return K.length===0?null:K[0]}function c(K){if(K.length===0)return null;var B=K[0],L=K.pop();if(L!==B){K[0]=L;e:for(var te=0,de=K.length,ke=de>>>1;te<ke;){var Ne=2*(te+1)-1,Ee=K[Ne],T=Ne+1,q=K[T];if(0>d(Ee,L))T<de&&0>d(q,Ee)?(K[te]=q,K[T]=L,te=T):(K[te]=Ee,K[Ne]=L,te=Ne);else if(T<de&&0>d(q,L))K[te]=q,K[T]=L,te=T;else break e}}return B}function d(K,B){var L=K.sortIndex-B.sortIndex;return L!==0?L:K.id-B.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,h=m.now();n.unstable_now=function(){return m.now()-h}}var g=[],v=[],b=1,x=null,j=3,S=!1,R=!1,k=!1,C=!1,z=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function E(K){for(var B=r(v);B!==null;){if(B.callback===null)c(v);else if(B.startTime<=K)c(v),B.sortIndex=B.expirationTime,i(g,B);else break;B=r(v)}}function M(K){if(k=!1,E(K),!R)if(r(g)!==null)R=!0,Y||(Y=!0,J());else{var B=r(v);B!==null&&ue(M,B.startTime-K)}}var Y=!1,A=-1,H=5,W=-1;function I(){return C?!0:!(n.unstable_now()-W<H)}function ne(){if(C=!1,Y){var K=n.unstable_now();W=K;var B=!0;try{e:{R=!1,k&&(k=!1,w(A),A=-1),S=!0;var L=j;try{t:{for(E(K),x=r(g);x!==null&&!(x.expirationTime>K&&I());){var te=x.callback;if(typeof te=="function"){x.callback=null,j=x.priorityLevel;var de=te(x.expirationTime<=K);if(K=n.unstable_now(),typeof de=="function"){x.callback=de,E(K),B=!0;break t}x===r(g)&&c(g),E(K)}else c(g);x=r(g)}if(x!==null)B=!0;else{var ke=r(v);ke!==null&&ue(M,ke.startTime-K),B=!1}}break e}finally{x=null,j=L,S=!1}B=void 0}}finally{B?J():Y=!1}}}var J;if(typeof O=="function")J=function(){O(ne)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ee=Z.port2;Z.port1.onmessage=ne,J=function(){ee.postMessage(null)}}else J=function(){z(ne,0)};function ue(K,B){A=z(function(){K(n.unstable_now())},B)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(K){K.callback=null},n.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<K?Math.floor(1e3/K):5},n.unstable_getCurrentPriorityLevel=function(){return j},n.unstable_next=function(K){switch(j){case 1:case 2:case 3:var B=3;break;default:B=j}var L=j;j=B;try{return K()}finally{j=L}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(K,B){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var L=j;j=K;try{return B()}finally{j=L}},n.unstable_scheduleCallback=function(K,B,L){var te=n.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?te+L:te):L=te,K){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=L+de,K={id:b++,callback:B,priorityLevel:K,startTime:L,expirationTime:de,sortIndex:-1},L>te?(K.sortIndex=L,i(v,K),r(g)===null&&K===r(v)&&(k?(w(A),A=-1):k=!0,ue(M,L-te))):(K.sortIndex=de,i(g,K),R||S||(R=!0,Y||(Y=!0,J()))),K},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(K){var B=j;return function(){var L=j;j=B;try{return K.apply(this,arguments)}finally{j=L}}}})(Zf)),Zf}var Ay;function BN(){return Ay||(Ay=1,Kf.exports=HN()),Kf.exports}var Qf={exports:{}},nn={};/**
25
+ */var Ov;function XN(){return Ov||(Ov=1,(function(n){function i(K,H){var L=K.length;K.push(H);e:for(;0<L;){var ee=L-1>>>1,de=K[ee];if(0<d(de,H))K[ee]=H,K[L]=de,L=ee;else break e}}function r(K){return K.length===0?null:K[0]}function c(K){if(K.length===0)return null;var H=K[0],L=K.pop();if(L!==H){K[0]=L;e:for(var ee=0,de=K.length,ke=de>>>1;ee<ke;){var Ne=2*(ee+1)-1,Ee=K[Ne],T=Ne+1,q=K[T];if(0>d(Ee,L))T<de&&0>d(q,Ee)?(K[ee]=q,K[T]=L,ee=T):(K[ee]=Ee,K[Ne]=L,ee=Ne);else if(T<de&&0>d(q,L))K[ee]=q,K[T]=L,ee=T;else break e}}return H}function d(K,H){var L=K.sortIndex-H.sortIndex;return L!==0?L:K.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,h=m.now();n.unstable_now=function(){return m.now()-h}}var g=[],y=[],b=1,x=null,j=3,S=!1,R=!1,k=!1,C=!1,D=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function w(K){for(var H=r(y);H!==null;){if(H.callback===null)c(y);else if(H.startTime<=K)c(y),H.sortIndex=H.expirationTime,i(g,H);else break;H=r(y)}}function U(K){if(k=!1,w(K),!R)if(r(g)!==null)R=!0,Y||(Y=!0,F());else{var H=r(y);H!==null&&ce(U,H.startTime-K)}}var Y=!1,A=-1,M=5,W=-1;function I(){return C?!0:!(n.unstable_now()-W<M)}function ne(){if(C=!1,Y){var K=n.unstable_now();W=K;var H=!0;try{e:{R=!1,k&&(k=!1,E(A),A=-1),S=!0;var L=j;try{t:{for(w(K),x=r(g);x!==null&&!(x.expirationTime>K&&I());){var ee=x.callback;if(typeof ee=="function"){x.callback=null,j=x.priorityLevel;var de=ee(x.expirationTime<=K);if(K=n.unstable_now(),typeof de=="function"){x.callback=de,w(K),H=!0;break t}x===r(g)&&c(g),w(K)}else c(g);x=r(g)}if(x!==null)H=!0;else{var ke=r(y);ke!==null&&ce(U,ke.startTime-K),H=!1}}break e}finally{x=null,j=L,S=!1}H=void 0}}finally{H?F():Y=!1}}}var F;if(typeof O=="function")F=function(){O(ne)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,te=Z.port2;Z.port1.onmessage=ne,F=function(){te.postMessage(null)}}else F=function(){D(ne,0)};function ce(K,H){A=D(function(){K(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(K){K.callback=null},n.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<K?Math.floor(1e3/K):5},n.unstable_getCurrentPriorityLevel=function(){return j},n.unstable_next=function(K){switch(j){case 1:case 2:case 3:var H=3;break;default:H=j}var L=j;j=H;try{return K()}finally{j=L}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(K,H){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var L=j;j=K;try{return H()}finally{j=L}},n.unstable_scheduleCallback=function(K,H,L){var ee=n.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?ee+L:ee):L=ee,K){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=L+de,K={id:b++,callback:H,priorityLevel:K,startTime:L,expirationTime:de,sortIndex:-1},L>ee?(K.sortIndex=L,i(y,K),r(g)===null&&K===r(y)&&(k?(E(A),A=-1):k=!0,ce(U,L-ee))):(K.sortIndex=de,i(g,K),R||S||(R=!0,Y||(Y=!0,F()))),K},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(K){var H=j;return function(){var L=j;j=H;try{return K.apply(this,arguments)}finally{j=L}}}})(If)),If}var Mv;function KN(){return Mv||(Mv=1,Qf.exports=XN()),Qf.exports}var Pf={exports:{}},nn={};/**
26
26
  * @license React
27
27
  * react-dom.production.js
28
28
  *
@@ -30,7 +30,7 @@
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Oy;function $N(){if(Oy)return nn;Oy=1;var n=Mh();function i(b){var x="https://react.dev/errors/"+b;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)x+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+b+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),m=Symbol.for("react.optimistic_key");function h(b,x,j){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:S==null?null:S===m?m:""+S,children:b,containerInfo:x,implementation:j}}var g=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(b,x){if(b==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,nn.browser=function(b){return{$$typeof:f,_reason:b}},nn.createPortal=function(b,x){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(i(299));return h(b,x,null,j)},nn.flushSync=function(b){var x=g.T,j=c.p;try{if(g.T=null,c.p=2,b)return b()}finally{g.T=x,c.p=j,c.d.f()}},nn.preconnect=function(b,x){typeof b=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(b,x))},nn.prefetchDNS=function(b){typeof b=="string"&&c.d.D(b)},nn.preinit=function(b,x){if(typeof b=="string"&&x&&typeof x.as=="string"){var j=x.as,S=v(j,x.crossOrigin),R=typeof x.integrity=="string"?x.integrity:void 0,k=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;j==="style"?c.d.S(b,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:S,integrity:R,fetchPriority:k}):j==="script"&&c.d.X(b,{crossOrigin:S,integrity:R,fetchPriority:k,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},nn.preinitModule=function(b,x){if(typeof b=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var j=v(x.as,x.crossOrigin);c.d.M(b,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}}else x==null&&c.d.M(b)},nn.preload=function(b,x){if(typeof b=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var j=x.as,S=v(j,x.crossOrigin);c.d.L(b,j,{crossOrigin:S,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},nn.preloadModule=function(b,x){if(typeof b=="string")if(x){var j=v(x.as,x.crossOrigin);c.d.m(b,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}else c.d.m(b)},nn.requestFormReset=function(b){c.d.r(b)},nn.unstable_batchedUpdates=function(b,x){return b(x)},nn.useFormState=function(b,x,j){return g.H.useFormState(b,x,j)},nn.useFormStatus=function(){return g.H.useHostTransitionStatus()},nn.version="19.3.1",nn}var My;function Fv(){if(My)return Qf.exports;My=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Qf.exports=$N(),Qf.exports}/**
33
+ */var _v;function ZN(){if(_v)return nn;_v=1;var n=Lh();function i(b){var x="https://react.dev/errors/"+b;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)x+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+b+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),m=Symbol.for("react.optimistic_key");function h(b,x,j){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:S==null?null:S===m?m:""+S,children:b,containerInfo:x,implementation:j}}var g=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(b,x){if(b==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,nn.browser=function(b){return{$$typeof:f,_reason:b}},nn.createPortal=function(b,x){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(i(299));return h(b,x,null,j)},nn.flushSync=function(b){var x=g.T,j=c.p;try{if(g.T=null,c.p=2,b)return b()}finally{g.T=x,c.p=j,c.d.f()}},nn.preconnect=function(b,x){typeof b=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(b,x))},nn.prefetchDNS=function(b){typeof b=="string"&&c.d.D(b)},nn.preinit=function(b,x){if(typeof b=="string"&&x&&typeof x.as=="string"){var j=x.as,S=y(j,x.crossOrigin),R=typeof x.integrity=="string"?x.integrity:void 0,k=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;j==="style"?c.d.S(b,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:S,integrity:R,fetchPriority:k}):j==="script"&&c.d.X(b,{crossOrigin:S,integrity:R,fetchPriority:k,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},nn.preinitModule=function(b,x){if(typeof b=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var j=y(x.as,x.crossOrigin);c.d.M(b,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}}else x==null&&c.d.M(b)},nn.preload=function(b,x){if(typeof b=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var j=x.as,S=y(j,x.crossOrigin);c.d.L(b,j,{crossOrigin:S,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},nn.preloadModule=function(b,x){if(typeof b=="string")if(x){var j=y(x.as,x.crossOrigin);c.d.m(b,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}else c.d.m(b)},nn.requestFormReset=function(b){c.d.r(b)},nn.unstable_batchedUpdates=function(b,x){return b(x)},nn.useFormState=function(b,x,j){return g.H.useFormState(b,x,j)},nn.useFormStatus=function(){return g.H.useHostTransitionStatus()},nn.version="19.3.1",nn}var Lv;function Wy(){if(Lv)return Pf.exports;Lv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Pf.exports=ZN(),Pf.exports}/**
34
34
  * @license React
35
35
  * react-dom-client.production.js
36
36
  *
@@ -38,15 +38,15 @@
38
38
  *
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
- */var _y;function qN(){if(_y)return gr;_y=1;var n=BN(),i=Mh(),r=Fv();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,s=t;s&&!s.alternate;)t=s,(t.flags&4098)!==0&&(e=t.return),s=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function 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 g(e){if(f(e)!==e)throw Error(c(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var s=e,l=t;;){var o=s.return;if(o===null)break;var u=o.alternate;if(u===null){if(l=o.return,l!==null){s=l;continue}break}if(o.child===u.child){for(u=o.child;u;){if(u===s)return g(o),e;if(u===l)return g(o),t;u=u.sibling}throw Error(c(188))}if(s.return!==l.return)s=o,l=u;else{for(var y=!1,N=o.child;N;){if(N===s){y=!0,s=o,l=u;break}if(N===l){y=!0,l=o,s=u;break}N=N.sibling}if(!y){for(N=u.child;N;){if(N===s){y=!0,s=u,l=o;break}if(N===l){y=!0,l=u,s=o;break}N=N.sibling}if(!y)throw Error(c(189))}}if(s.alternate!==l)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}function x(e,t,s,l,o,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&s(e,l,o,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&x(e.child,t,s,l,o,u))return!0;e=e.sibling}return!1}function j(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 S(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 R(e){var t=[null,null],s=j(e);return s===null||k(t,e,s.child,{foundSelf:!1}),t}function k(e,t,s,l){for(;s!==null;){if(s===t)l.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(l.foundSelf)return e[1]=s,!0;e[0]=s}else if((s.tag!==22||s.memoizedState===null)&&k(e,t,s.child,l))return!0;s=s.sibling}return!1}function C(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(c(559))}}var z=null,w=null;function O(e,t,s){return e===s?!0:e===t?(z=e,!0):!1}function E(e,t,s){return e===s?(w=e,!1):e===t?(w!==null&&(z=e),!0):!1}function M(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 Y(e,t,s){for(var l=0,o=e;o;o=s(o))l++;o=0;for(var u=t;u;u=s(u))o++;for(;0<l-o;)e=s(e),l--;for(;0<o-l;)t=s(t),o--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=s(e),t=s(t)}return null}var A=Object.assign,H=Symbol.for("react.element"),W=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),ne=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),ue=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),ke=Symbol.for("react.activity"),Ne=Symbol.for("react.legacy_hidden"),Ee=Symbol.for("react.memo_cache_sentinel"),T=Symbol.for("react.view_transition"),q=Symbol.for("react.recoverable"),V=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function Re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ne:return"Fragment";case Z:return"Profiler";case J:return"StrictMode";case B:return"Suspense";case L:return"SuspenseList";case ke:return"Activity";case T:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case I:return"Portal";case ue:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:Re(e.type)||"Memo";case de:t=e._payload,e=e._init;try{return Re(e(t))}catch{}}return null}var xe=Array.isArray,me=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pe={pending:!1,data:null,method:null,action:null},Ve=[],Xe=-1;function ce(e){return{current:e}}function De(e){0>Xe||(e.current=Ve[Xe],Ve[Xe]=null,Xe--)}function we(e,t){Xe++,Ve[Xe]=e.current,e.current=t}var nt=ce(null),rt=ce(null),xt=ce(null),bt=ce(null);function zn(e,t){switch(we(xt,t),we(rt,e),we(nt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lg(t),e=Ug(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}De(nt),we(nt,e)}function jn(){De(nt),De(rt),De(xt)}function na(e){var t=e.memoizedState;t!==null&&(ri._currentValue=t.memoizedState,we(bt,e)),t=nt.current;var s=Ug(t,e.type);t!==s&&(we(rt,e),we(nt,s))}function F(e){rt.current===e&&(De(nt),De(rt)),bt.current===e&&(De(bt),ri._currentValue=Pe)}var be,Ue;function Dt(e){if(be===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||"",Ue=-1<s.stack.indexOf(`
41
+ */var Uv;function QN(){if(Uv)return vr;Uv=1;var n=KN(),i=Lh(),r=Wy();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,s=t;s&&!s.alternate;)t=s,(t.flags&4098)!==0&&(e=t.return),s=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function 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 g(e){if(f(e)!==e)throw Error(c(188))}function y(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var s=e,l=t;;){var o=s.return;if(o===null)break;var u=o.alternate;if(u===null){if(l=o.return,l!==null){s=l;continue}break}if(o.child===u.child){for(u=o.child;u;){if(u===s)return g(o),e;if(u===l)return g(o),t;u=u.sibling}throw Error(c(188))}if(s.return!==l.return)s=o,l=u;else{for(var v=!1,N=o.child;N;){if(N===s){v=!0,s=o,l=u;break}if(N===l){v=!0,l=o,s=u;break}N=N.sibling}if(!v){for(N=u.child;N;){if(N===s){v=!0,s=u,l=o;break}if(N===l){v=!0,l=u,s=o;break}N=N.sibling}if(!v)throw Error(c(189))}}if(s.alternate!==l)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}function x(e,t,s,l,o,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&s(e,l,o,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&x(e.child,t,s,l,o,u))return!0;e=e.sibling}return!1}function j(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 S(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 R(e){var t=[null,null],s=j(e);return s===null||k(t,e,s.child,{foundSelf:!1}),t}function k(e,t,s,l){for(;s!==null;){if(s===t)l.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(l.foundSelf)return e[1]=s,!0;e[0]=s}else if((s.tag!==22||s.memoizedState===null)&&k(e,t,s.child,l))return!0;s=s.sibling}return!1}function C(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(c(559))}}var D=null,E=null;function O(e,t,s){return e===s?!0:e===t?(D=e,!0):!1}function w(e,t,s){return e===s?(E=e,!1):e===t?(E!==null&&(D=e),!0):!1}function U(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 Y(e,t,s){for(var l=0,o=e;o;o=s(o))l++;o=0;for(var u=t;u;u=s(u))o++;for(;0<l-o;)e=s(e),l--;for(;0<o-l;)t=s(t),o--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=s(e),t=s(t)}return null}var A=Object.assign,M=Symbol.for("react.element"),W=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),ne=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),ce=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),ke=Symbol.for("react.activity"),Ne=Symbol.for("react.legacy_hidden"),Ee=Symbol.for("react.memo_cache_sentinel"),T=Symbol.for("react.view_transition"),q=Symbol.for("react.recoverable"),V=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function Re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ne:return"Fragment";case Z:return"Profiler";case F:return"StrictMode";case H:return"Suspense";case L:return"SuspenseList";case ke:return"Activity";case T:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case I:return"Portal";case ce:return e.displayName||"Context";case te:return(e._context.displayName||"Context")+".Consumer";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ee:return t=e.displayName||null,t!==null?t:Re(e.type)||"Memo";case de:t=e._payload,e=e._init;try{return Re(e(t))}catch{}}return null}var xe=Array.isArray,me=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pe={pending:!1,data:null,method:null,action:null},Ve=[],Xe=-1;function ue(e){return{current:e}}function De(e){0>Xe||(e.current=Ve[Xe],Ve[Xe]=null,Xe--)}function we(e,t){Xe++,Ve[Xe]=e.current,e.current=t}var nt=ue(null),rt=ue(null),xt=ue(null),bt=ue(null);function zn(e,t){switch(we(xt,t),we(rt,e),we(nt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hg(t),e=Bg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}De(nt),we(nt,e)}function jn(){De(nt),De(rt),De(xt)}function na(e){var t=e.memoizedState;t!==null&&(ri._currentValue=t.memoizedState,we(bt,e)),t=nt.current;var s=Bg(t,e.type);t!==s&&(we(rt,e),we(nt,s))}function J(e){rt.current===e&&(De(nt),De(rt)),bt.current===e&&(De(bt),ri._currentValue=Pe)}var be,He;function Dt(e){if(be===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||"",He=-1<s.stack.indexOf(`
42
42
  at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+be+e+Ue}var aa=!1;function Ke(e,t){if(!e||aa)return"";aa=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(pe){var U=pe}Reflect.construct(e,[],le)}else{try{le.call()}catch(pe){U=pe}le=!1;try{var Q=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),le=!0,new e}finally{le&&(Q!==void 0?Object.defineProperty(e.prototype,"props",Q):delete e.prototype.props)}}}else{try{throw Error()}catch(pe){U=pe}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(pe){if(pe&&U&&typeof pe.stack=="string")return[pe.stack,U.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),y=u[0],N=u[1];if(y&&N){var D=y.split(`
43
+ `+be+e+He}var aa=!1;function Ke(e,t){if(!e||aa)return"";aa=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(pe){var B=pe}Reflect.construct(e,[],le)}else{try{le.call()}catch(pe){B=pe}le=!1;try{var Q=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),le=!0,new e}finally{le&&(Q!==void 0?Object.defineProperty(e.prototype,"props",Q):delete e.prototype.props)}}}else{try{throw Error()}catch(pe){B=pe}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(pe){if(pe&&B&&typeof pe.stack=="string")return[pe.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),v=u[0],N=u[1];if(v&&N){var z=v.split(`
44
44
  `),G=N.split(`
45
- `);for(o=l=0;l<D.length&&!D[l].includes("DetermineComponentFrameRoot");)l++;for(;o<G.length&&!G[o].includes("DetermineComponentFrameRoot");)o++;if(l===D.length||o===G.length)for(l=D.length-1,o=G.length-1;1<=l&&0<=o&&D[l]!==G[o];)o--;for(;1<=l&&0<=o;l--,o--)if(D[l]!==G[o]){if(l!==1||o!==1)do if(l--,o--,0>o||D[l]!==G[o]){var P=`
46
- `+D[l].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=l&&0<=o);break}}}finally{aa=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Dt(s):""}function vl(e,t){switch(e.tag){case 26:case 27:case 5:return Dt(e.type);case 16:return Dt("Lazy");case 13:return e.child!==t&&t!==null?Dt("Suspense Fallback"):Dt("Suspense");case 19:return Dt("SuspenseList");case 0:case 15:return Ke(e.type,!1);case 11:return Ke(e.type.render,!1);case 1:return Ke(e.type,!0);case 31:return Dt("Activity");case 30:return Dt("ViewTransition");default:return""}}function bl(e){try{var t="",s=null;do t+=vl(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
45
+ `);for(o=l=0;l<z.length&&!z[l].includes("DetermineComponentFrameRoot");)l++;for(;o<G.length&&!G[o].includes("DetermineComponentFrameRoot");)o++;if(l===z.length||o===G.length)for(l=z.length-1,o=G.length-1;1<=l&&0<=o&&z[l]!==G[o];)o--;for(;1<=l&&0<=o;l--,o--)if(z[l]!==G[o]){if(l!==1||o!==1)do if(l--,o--,0>o||z[l]!==G[o]){var P=`
46
+ `+z[l].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=l&&0<=o);break}}}finally{aa=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Dt(s):""}function yl(e,t){switch(e.tag){case 26:case 27:case 5:return Dt(e.type);case 16:return Dt("Lazy");case 13:return e.child!==t&&t!==null?Dt("Suspense Fallback"):Dt("Suspense");case 19:return Dt("SuspenseList");case 0:case 15:return Ke(e.type,!1);case 11:return Ke(e.type.render,!1);case 1:return Ke(e.type,!0);case 31:return Dt("Activity");case 30:return Dt("ViewTransition");default:return""}}function bl(e){try{var t="",s=null;do t+=yl(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
47
47
  Error generating stack: `+l.message+`
48
- `+l.stack}}var Hs=Object.prototype.hasOwnProperty,Te=n.unstable_scheduleCallback,ut=n.unstable_cancelCallback,Rt=n.unstable_shouldYield,jt=n.unstable_requestPaint,Ze=n.unstable_now,It=n.unstable_getCurrentPriorityLevel,Kr=n.unstable_ImmediatePriority,Ut=n.unstable_UserBlockingPriority,Gt=n.unstable_NormalPriority,on=n.unstable_LowPriority,sa=n.unstable_IdlePriority,Nn=n.log,cn=n.unstable_setDisableYieldValue,an=null,At=null;function ft(e){if(typeof Nn=="function"&&cn(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(an,e)}catch{}}var Nt=Math.clz32?Math.clz32:Bs,Gn=Math.log,la=Math.LN2;function Bs(e){return e>>>=0,e===0?32:31-(Gn(e)/la|0)|0}var Na=256,Dn=262144,wa=4194304;function ia(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 Zr(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var o=0,u=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var N=l&134217727;return N!==0?(l=N&~u,l!==0?o=ia(l):(y&=N,y!==0?o=ia(y):s||(s=N&~e,s!==0&&(o=ia(s))))):(N=l&~u,N!==0?o=ia(N):y!==0?o=ia(y):s||(s=l&~e,s!==0&&(o=ia(s)))),o===0?0:t!==0&&t!==o&&(t&u)===0&&(u=o&-o,s=t&-t,u>=s||u===32&&(s&4194048)!==0)?t:o}function Si(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function om(e,t){(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var l=31-Nt(s),o=1<<l;t|=e[l],s&=~o}return t}function Q0(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 cm(){var e=wa;return wa<<=1,(wa&62914560)===0&&(wa=4194304),e}function pu(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function ki(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function I0(e,t,s,l,o,u){var y=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var N=e.entanglements,D=e.expirationTimes,G=e.hiddenUpdates;for(s=y&~s;0<s;){var P=31-Nt(s),le=1<<P;N[P]=0,D[P]=-1;var U=G[P];if(U!==null)for(G[P]=null,P=0;P<U.length;P++){var Q=U[P];Q!==null&&(Q.lane&=-536870913)}s&=~le}l!==0&&um(e,l,0),u!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=u&~(y&~t))}function um(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Nt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function dm(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-Nt(s),o=1<<l;o&t|e[l]&t&&(e[l]|=t),s&=~o}}function fm(e,t){var s=t&-t;return s=(s&42)!==0?1:xu(s),(s&(e.suspendedLanes|t))!==0?0:s}function xu(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 gu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function hm(){var e=ie.p;return e!==0?e:(e=window.event,e===void 0?32:by(e.type))}function mm(e,t){var s=ie.p;try{return ie.p=e,t()}finally{ie.p=s}}var Ua=Math.random().toString(36).slice(2),Pt="__reactFiber$"+Ua,wn="__reactProps$"+Ua,jl="__reactContainer$"+Ua,pm="__reactEvents$"+Ua,P0="__reactListeners$"+Ua,F0="__reactHandles$"+Ua,xm="__reactResources$"+Ua,Ci="__reactMarker$"+Ua,Qr="__reactLoad$"+Ua;function Ir(e){delete e[Pt],delete e[wn],delete e[P0],delete e[F0]}function $s(e){var t;if(t=e[Pt])return t;for(var s=e.parentNode;s;){if(t=s[jl]||s[Pt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=ey(e);e!==null;){if(s=e[Pt])return s;e=ey(e)}return t}e=s,s=e.parentNode}return null}function Nl(e){if(e=e[Pt]||e[jl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ti(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function wl(e){var t=e[xm];return t||(t=e[xm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Yt(e){e[Ci]=!0}function gm(e){e[Qr]=void 0}var ym=new Set,vm={};function qs(e,t){Sl(e,t),Sl(e+"Capture",t)}function Sl(e,t){for(vm[e]=t,e=0;e<t.length;e++)ym.add(t[e])}var J0=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]*$"),bm={},jm={};function W0(e){return Hs.call(jm,e)?!0:Hs.call(bm,e)?!1:J0.test(e)?jm[e]=!0:(bm[e]=!0,!1)}var Je=!1;function Nm(){var e=Je;return Je=!1,e}function Pr(e,t,s){if(W0(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){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,s)}}function Fr(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,s)}}function Ha(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,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 wm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ej(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var o=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(y){s=""+y,u.call(this,y)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yu(e){if(!e._valueTracker){var t=wm(e)?"checked":"value";e._valueTracker=ej(e,t,""+e[t])}}function Sm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=wm(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}var tj=/[\n"\\]/g;function Yn(e){return e.replace(tj,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function vu(e,t,s,l,o,u,y,N){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+An(t)):e.value!==""+An(t)&&(e.value=""+An(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?y==="number"&&e.value==t?bu(e,An(e.value)):bu(e,An(t)):s!=null?bu(e,An(s)):l!=null&&e.removeAttribute("value"),o==null&&u!=null&&(e.defaultChecked=!!u),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+An(N):e.removeAttribute("name")}function km(e,t,s,l,o,u,y,N){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||s!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){yu(e);return}s=s!=null?""+An(s):"",t=t!=null?""+An(t):s,N||t===e.value||(e.value=t),e.defaultValue=t}l=l??o,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=N?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),yu(e)}function bu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function kl(e,t,s,l){if(e=e.options,t){t={};for(var o=0;o<s.length;o++)t["$"+s[o]]=!0;for(s=0;s<e.length;s++)o=t.hasOwnProperty("$"+e[s].value),e[s].selected!==o&&(e[s].selected=o),o&&l&&(e[s].defaultSelected=!0)}else{for(s=""+An(s),t=null,o=0;o<e.length;o++){if(e[o].value===s){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Cm(e,t,s){if(t!=null&&(t=""+An(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+An(s):""}function Tm(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(c(92));if(xe(l)){if(1<l.length)throw Error(c(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=An(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),yu(e)}function Cl(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var nj=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 Em(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||nj.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Rm(e,t,s){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",Je=!0);for(var o in t)l=t[o],t.hasOwnProperty(o)&&s[o]!==l&&(Em(e,o,l),Je=!0)}else for(var u in t)t.hasOwnProperty(u)&&Em(e,u,t[u])}function ju(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 aj=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"]]),sj=/^[\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 Jr(e){return sj.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Sa(){}var Nu=null;function wu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tl=null,El=null;function zm(e){var t=Nl(e);if(t&&(e=t.stateNode)){var s=e[wn]||null;e:switch(e=t.stateNode,t.type){case"input":if(vu(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Yn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var o=l[wn]||null;if(!o)throw Error(c(90));vu(l,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&Sm(l)}break e;case"textarea":Cm(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&kl(e,!!s.multiple,t,!1)}}}var Su=!1;function Dm(e,t,s){if(Su)return e(t,s);Su=!0;try{var l=e(t);return l}finally{if(Su=!1,(Tl!==null||El!==null)&&(Wo(),Tl&&(t=Tl,e=El,El=Tl=null,zm(t),e)))for(t=0;t<e.length;t++)zm(e[t])}}function Ei(e,t){var s=e.stateNode;if(s===null)return null;var l=s[wn]||null;if(l===null)return null;s=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(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var Ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ku=!1;if(Ba)try{var Ri={};Object.defineProperty(Ri,"passive",{get:function(){ku=!0}}),window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{ku=!1}var ss=null,Cu=null,Wr=null;function Am(){if(Wr)return Wr;var e,t=Cu,s=t.length,l,o="value"in ss?ss.value:ss.textContent,u=o.length;for(e=0;e<s&&t[e]===o[e];e++);var y=s-e;for(l=1;l<=y&&t[s-l]===o[u-l];l++);return Wr=o.slice(e,1<l?1-l:void 0)}function eo(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 to(){return!0}function Om(){return!1}function un(e){function t(s,l,o,u,y){this._reactName=s,this._targetInst=o,this.type=l,this.nativeEvent=u,this.target=y,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(s=e[N],this[N]=s?s(u):u[N]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?to:Om,this.isPropagationStopped=Om,this}return A(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=to)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=to)},persist:function(){},isPersistent:to}),t}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},no=un(ls),zi=A({},ls,{view:0,detail:0}),lj=un(zi),Tu,Eu,Di,ao=A({},zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zu,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!==Di&&(Di&&e.type==="mousemove"?(Tu=e.screenX-Di.screenX,Eu=e.screenY-Di.screenY):Eu=Tu=0,Di=e),Tu)},movementY:function(e){return"movementY"in e?e.movementY:Eu}}),Mm=un(ao),ij=A({},ao,{dataTransfer:0}),rj=un(ij),oj=A({},zi,{relatedTarget:0}),Ru=un(oj),cj=A({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),uj=un(cj),dj=A({},ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fj=un(dj),hj=A({},ls,{data:0}),_m=un(hj),mj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pj={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"},xj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xj[e])?!!t[e]:!1}function zu(){return gj}var yj=A({},zi,{key:function(e){if(e.key){var t=mj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=eo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zu,charCode:function(e){return e.type==="keypress"?eo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?eo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vj=un(yj),bj=A({},ao,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lm=un(bj),jj=A({},ls,{submitter:0}),Nj=un(jj),wj=A({},zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zu}),Sj=un(wj),kj=A({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),Cj=un(kj),Tj=A({},ao,{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}),Ej=un(Tj),Rj=A({},ls,{newState:0,oldState:0,source:0}),zj=un(Rj),Dj=[9,13,27,32],Du=Ba&&"CompositionEvent"in window,Ai=null;Ba&&"documentMode"in document&&(Ai=document.documentMode);var Aj=Ba&&"TextEvent"in window&&!Ai,Um=Ba&&(!Du||Ai&&8<Ai&&11>=Ai),Hm=" ",Bm=!1;function $m(e,t){switch(e){case"keyup":return Dj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rl=!1;function Oj(e,t){switch(e){case"compositionend":return qm(t);case"keypress":return t.which!==32?null:(Bm=!0,Hm);case"textInput":return e=t.data,e===Hm&&Bm?null:e;default:return null}}function Mj(e,t){if(Rl)return e==="compositionend"||!Du&&$m(e,t)?(e=Am(),Wr=Cu=ss=null,Rl=!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 Um&&t.locale!=="ko"?null:t.data;default:return null}}var _j={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 Gm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_j[e.type]:t==="textarea"}function Ym(e,t,s,l){Tl?El?El.push(l):El=[l]:Tl=l,t=lc(t,"onChange"),0<t.length&&(s=new no("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var Oi=null,Mi=null;function Lj(e){zg(e,0)}function so(e){var t=Ti(e);if(Sm(t))return e}function Vm(e,t){if(e==="change")return t}var Xm=!1;if(Ba){var Au;if(Ba){var Ou="oninput"in document;if(!Ou){var Km=document.createElement("div");Km.setAttribute("oninput","return;"),Ou=typeof Km.oninput=="function"}Au=Ou}else Au=!1;Xm=Au&&(!document.documentMode||9<document.documentMode)}function Zm(){Oi&&(Oi.detachEvent("onpropertychange",Qm),Mi=Oi=null)}function Qm(e){if(e.propertyName==="value"&&so(Mi)){var t=[];Ym(t,Mi,e,wu(e)),Dm(Lj,t)}}function Uj(e,t,s){e==="focusin"?(Zm(),Oi=t,Mi=s,Oi.attachEvent("onpropertychange",Qm)):e==="focusout"&&Zm()}function Hj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return so(Mi)}function Bj(e,t){if(e==="click")return so(t)}function $j(e,t){if(e==="input"||e==="change")return so(t)}function qj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var On=typeof Object.is=="function"?Object.is:qj;function _i(e,t){if(On(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var o=s[l];if(!Hs.call(t,o)||!On(e[o],t[o]))return!1}return!0}function Mu(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 Im(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pm(e,t){var s=Im(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Im(s)}}function Fm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mu(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Mu(e.document)}return t}function _u(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 Gj=Ba&&"documentMode"in document&&11>=document.documentMode,zl=null,Lu=null,Li=null,Uu=!1;function Wm(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Uu||zl==null||zl!==Mu(l)||(l=zl,"selectionStart"in l&&_u(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}),Li&&_i(Li,l)||(Li=l,l=lc(Lu,"onSelect"),0<l.length&&(t=new no("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=zl)))}function Gs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Dl={animationend:Gs("Animation","AnimationEnd"),animationiteration:Gs("Animation","AnimationIteration"),animationstart:Gs("Animation","AnimationStart"),transitionrun:Gs("Transition","TransitionRun"),transitionstart:Gs("Transition","TransitionStart"),transitioncancel:Gs("Transition","TransitionCancel"),transitionend:Gs("Transition","TransitionEnd")},Hu={},ep={};Ba&&(ep=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function Ys(e){if(Hu[e])return Hu[e];if(!Dl[e])return e;var t=Dl[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in ep)return Hu[e]=t[s];return e}var tp=Ys("animationend"),np=Ys("animationiteration"),ap=Ys("animationstart"),Yj=Ys("transitionrun"),Vj=Ys("transitionstart"),Xj=Ys("transitioncancel"),sp=Ys("transitionend"),lp=new Map,Bu="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(" ");Bu.push("scrollEnd");function ra(e,t){lp.set(e,t),qs(t,[e])}var Kj=0;function $a(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=da.identifierPrefix;var s=Kj++;return e="_"+e+"t_"+s.toString(32)+"_",t.autoName=e}function ip(e){if(e==null||typeof e=="string")return e;var t=null,s=Fl;if(s!==null)for(var l=0;l<s.length;l++){var o=e[s[l]];if(o!=null){if(o==="none")return"none";t=t==null?o:t+(" "+o)}}return t??e.default}function qa(e,t){return e=ip(e),t=ip(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var lo=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)},Vn=[],Al=0,$u=0;function io(){for(var e=Al,t=$u=Al=0;t<e;){var s=Vn[t];Vn[t++]=null;var l=Vn[t];Vn[t++]=null;var o=Vn[t];Vn[t++]=null;var u=Vn[t];if(Vn[t++]=null,l!==null&&o!==null){var y=l.pending;y===null?o.next=o:(o.next=y.next,y.next=o),l.pending=o}u!==0&&rp(s,o,u)}}function ro(e,t,s,l){Vn[Al++]=e,Vn[Al++]=t,Vn[Al++]=s,Vn[Al++]=l,$u|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function qu(e,t,s,l){return ro(e,t,s,l),oo(e)}function Vs(e,t){return ro(e,null,null,t),oo(e)}function rp(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var o=!1,u=e.return;u!==null;)u.childLanes|=s,l=u.alternate,l!==null&&(l.childLanes|=s),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(o=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,o&&t!==null&&(o=31-Nt(s),e=u.hiddenUpdates,l=e[o],l===null?e[o]=[t]:l.push(t),t.lane=s|536870912),u):null}function oo(e){if(50<sr)throw sr=0,Jo=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ol={};function Zj(e,t,s,l){this.tag=e,this.key=s,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 Sn(e,t,s,l){return new Zj(e,t,s,l)}function Gu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ga(e,t){var s=e.alternate;return s===null?(s=Sn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&1206910976,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function op(e,t){e.flags&=1206910978;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function co(e,t,s,l,o,u){var y=0;if(l=e,typeof l=="function")Gu(l)&&(y=1);else if(typeof l=="string")y=jN(e,s,nt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case ke:return e=Sn(31,s,t,o),e.elementType=ke,e.lanes=u,e;case ne:return Xs(s.children,o,u,t);case J:y=8,o|=24;break;case Z:return e=Sn(12,s,t,o|2),e.elementType=Z,e.lanes=u,e;case B:return e=Sn(13,s,t,o),e.elementType=B,e.lanes=u,e;case L:return e=Sn(19,s,t,o),e.elementType=L,e.lanes=u,e;case Ne:case T:return e=o|32,e=Sn(30,s,t,e),e.elementType=T,e.lanes=u,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case ue:y=10;break e;case ee:y=9;break e;case K:y=11;break e;case te:y=14;break e;case de:y=16,l=null;break e}y=29,s=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=Sn(y,s,t,o),t.elementType=e,t.type=l,t.lanes=u,t}function Xs(e,t,s,l){return e=Sn(7,e,l,t),e.lanes=s,e}function Yu(e,t,s){return e=Sn(6,e,null,t),e.lanes=s,e}function cp(e){var t=Sn(18,null,null,0);return t.stateNode=e,t}function Vu(e,t,s){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var up=new WeakMap;function Xn(e,t){if(typeof e=="object"&&e!==null){var s=up.get(e);return s!==void 0?s:(t={value:e,source:t,stack:bl(t)},up.set(e,t),t)}return{value:e,source:t,stack:bl(t)}}var Ml=[],_l=0,uo=null,Ui=0,Kn=[],Zn=0,is=null,ka=1,Ca="";function Ya(e,t){Ml[_l++]=Ui,Ml[_l++]=uo,uo=e,Ui=t}function dp(e,t,s){Kn[Zn++]=ka,Kn[Zn++]=Ca,Kn[Zn++]=is,is=e;var l=ka;e=Ca;var o=32-Nt(l)-1;l&=~(1<<o),s+=1;var u=32-Nt(t)+o;if(30<u){var y=o-o%5;u=(l&(1<<y)-1).toString(32),l>>=y,o-=y,ka=1<<32-Nt(t)+o|s<<o|l,Ca=u+e}else ka=1<<u|s<<o|l,Ca=e}function fo(e){e.return!==null&&(Ya(e,1),dp(e,1,0))}function Xu(e){for(;e===uo;)uo=Ml[--_l],Ml[_l]=null,Ui=Ml[--_l],Ml[_l]=null;for(;e===is;)is=Kn[--Zn],Kn[Zn]=null,Ca=Kn[--Zn],Kn[Zn]=null,ka=Kn[--Zn],Kn[Zn]=null}function fp(e,t){Kn[Zn++]=ka,Kn[Zn++]=Ca,Kn[Zn++]=is,ka=t.id,Ca=t.overflow,is=e}var Vt=null,ht=null,Be=!1,rs=null,Qn=!1,Ku=Error(c(519));function os(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hi(Xn(t,e)),Ku}function hp(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[Pt]=e,t[wn]=l,s){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(s=0;s<ir.length;s++)qe(ir[s],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),km(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),Tm(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||Mg(t.textContent,s)?(l.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),l.onScroll!=null&&qe("scroll",t),l.onScrollEnd!=null&&qe("scrollend",t),l.onClick!=null&&(t.onclick=Sa),t=!0):t=!1,t||os(e,!0)}function ho(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:Vt=Vt.return}}function Ll(e){if(e!==Vt)return!1;if(!Be)return ho(e),Be=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||wf(e.type,e.memoizedProps)),s=!s),s&&ht&&os(e),ho(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ht=Wg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ht=Wg(e)}else t===27?(t=ht,Ss(e.type)?(e=Af,Af=null,ht=e):ht=t):ht=Vt?Pn(e.stateNode.nextSibling):null;return!0}function Ks(){ht=Vt=null,Be=!1}function Zu(){var e=rs;return e!==null&&(Tn===null?Tn=e:Tn.push.apply(Tn,e),rs=null),e}function Hi(e){rs===null?rs=[e]:rs.push(e)}var Qu=ce(null),Zs=null,Va=null;function cs(e,t,s){we(Qu,t._currentValue),t._currentValue=s}function Xa(e){e._currentValue=Qu.current,De(Qu)}function mo(e,t,s){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===s)break;e=e.return}}function Iu(e,t,s,l){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){var y=o.child;u=u.firstContext;e:for(;u!==null;){var N=u;u=o;for(var D=0;D<t.length;D++)if(N.context===t[D]){u.lanes|=s,N=u.alternate,N!==null&&(N.lanes|=s),mo(u.return,s,e),l||(y=null);break e}u=N.next}}else if(o.tag===18){if(y=o.return,y===null)throw Error(c(341));y.lanes|=s,u=y.alternate,u!==null&&(u.lanes|=s),mo(y,s,e),y=null}else o.tag===13&&o.memoizedState!==null&&o.memoizedState.dehydrated===null?(o.lanes|=s,y=o.alternate,y!==null&&(y.lanes|=s),mo(o.return,s,e),y=o.child,y=y!==null?y.sibling:null):y=o.child;if(y!==null)y.return=o;else for(y=o;y!==null;){if(y===e){y=null;break}if(o=y.sibling,o!==null){o.return=y.return,y=o;break}y=y.return}o=y}}function Qs(e,t,s,l){e=null;for(var o=t,u=!1;o!==null;){if(!u){if((o.flags&524288)!==0)u=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var y=o.alternate;if(y===null)throw Error(c(387));if(y=y.memoizedProps,y!==null){var N=o.type;On(o.pendingProps.value,y.value)||(e!==null?e.push(N):e=[N])}}else if(o===bt.current){if(y=o.alternate,y===null)throw Error(c(387));y.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ri):e=[ri])}o=o.return}return e!==null&&Iu(t,e,s,l),t.flags|=262144,e!==null}function po(e){for(e=e.firstContext;e!==null;){if(!On(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Is(e){Zs=e,Va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return mp(Zs,e)}function xo(e,t){return Zs===null&&Is(e),mp(e,t)}function mp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Va===null){if(e===null)throw Error(c(308));Va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Va=Va.next=t;return s}var Qj=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Ij=n.unstable_scheduleCallback,Pj=n.unstable_NormalPriority,Ot={$$typeof:ue,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pu(){return{controller:new Qj,data:new Map,refCount:0}}function Bi(e){e.refCount--,e.refCount===0&&Ij(Pj,function(){e.controller.abort()})}function pp(e,t){if((e.pendingLanes&4194048)!==0){var s=e.transitionTypes;for(s===null&&(s=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];s.indexOf(l)===-1&&s.push(l)}}}var $i=null;function Fj(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var qi=null,Fu=0,Ps=0,Ul=null;function Jj(e,t){if(qi===null){var s=qi=[];Fu=0,Ps=mf(),Ul={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Fu++,t.then(xp,xp),t}function xp(){if(--Fu===0&&($i=null,qi!==null)){Ul!==null&&(Ul.status="fulfilled");var e=qi;qi=null,Ps=0,Ul=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wj(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(o){s.push(o)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var o=0;o<s.length;o++)(0,s[o])(t)},function(o){for(l.status="rejected",l.reason=o,o=0;o<s.length;o++)(0,s[o])(void 0)}),l}var gp=me.S;me.S=function(e,t){if(cg=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Jj(e,t),$i!==null)for(var s=ti;s!==null;)pp(s,$i),s=s.next;if(s=e.types,s!==null){for(var l=ti;l!==null;)pp(l,s),l=l.next;if(Ps!==0){l=$i,l===null&&(l=$i=[]);for(var o=0;o<s.length;o++){var u=s[o];l.indexOf(u)===-1&&l.push(u)}}}gp!==null&&gp(e,t)};var Fs=ce(null);function Ju(){var e=Fs.current;return e!==null?e:dt.pooledCache}function go(e,t){t===null?we(Fs,Fs.current):we(Fs,t.pool)}function yp(){var e=Ju();return e===null?null:{parent:Ot._currentValue,pool:e}}var Hl=Error(c(460)),Wu=Error(c(474)),yo=Error(c(542)),vo={then:function(){}};function vp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function bp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Sa,Sa),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Np(e),e===void 0&&!("reason"in t)?Error(c(600)):e;default:if(typeof t.status=="string")t.then(Sa,Sa);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=l}},function(l){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Np(e),e}throw Ws=t,Hl}}function Js(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ws=s,Hl):s}}var Ws=null;function jp(){if(Ws===null)throw Error(c(459));var e=Ws;return Ws=null,e}function Np(e){if(e===Hl||e===yo)throw Error(c(483))}var Bl=null,Gi=0;function bo(e){var t=Gi;return Gi+=1,Bl===null&&(Bl=[]),bp(Bl,e,t)}function us(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function jo(e,t){throw t.$$typeof===H?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wp(e){function t($,_){if(e){var X=$.deletions;X===null?($.deletions=[_],$.flags|=16):X.push(_)}}function s($,_){if(!e)return null;for(;_!==null;)t($,_),_=_.sibling;return null}function l($){for(var _=new Map;$!==null;)$.key===null?_.set($.index,$):_.set($.key,$),$=$.sibling;return _}function o($,_){return $=Ga($,_),$.index=0,$.sibling=null,$}function u($,_,X){return $.index=X,e?(X=$.alternate,X!==null?(X=X.index,X<_?($.flags|=2,_):X):($.flags|=134217730,_)):($.flags|=1048576,_)}function y($){return e&&$.alternate===null&&($.flags|=134217730),$}function N($,_,X,ae){return _===null||_.tag!==6?(_=Yu(X,$.mode,ae),_.return=$,_):(_=o(_,X),_.return=$,_)}function D($,_,X,ae){var Se=X.type;return Se===ne?($=P($,_,X.props.children,ae,X.key),us($,X),$):_!==null&&(_.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===de&&Js(Se)===_.type)?(_=o(_,X.props),us(_,X),_.return=$,_):(_=co(X.type,X.key,X.props,null,$.mode,ae),us(_,X),_.return=$,_)}function G($,_,X,ae){return _===null||_.tag!==4||_.stateNode.containerInfo!==X.containerInfo||_.stateNode.implementation!==X.implementation?(_=Vu(X,$.mode,ae),_.return=$,_):(_=o(_,X.children||[]),_.return=$,_)}function P($,_,X,ae,Se){return _===null||_.tag!==7?(_=Xs(X,$.mode,ae,Se),_.return=$,_):(_=o(_,X),_.return=$,_)}function le($,_,X){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=Yu(""+_,$.mode,X),_.return=$,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case W:return X=co(_.type,_.key,_.props,null,$.mode,X),us(X,_),X.return=$,X;case I:return _=Vu(_,$.mode,X),_.return=$,_;case de:return _=Js(_),le($,_,X)}if(xe(_)||re(_))return _=Xs(_,$.mode,X,null),_.return=$,_;if(typeof _.then=="function")return le($,bo(_),X);if(_.$$typeof===ue)return le($,xo($,_),X);jo($,_)}return null}function U($,_,X,ae){var Se=_!==null?_.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Se!==null?null:N($,_,""+X,ae);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case W:return X.key===Se?D($,_,X,ae):null;case I:return X.key===Se?G($,_,X,ae):null;case de:return X=Js(X),U($,_,X,ae)}if(xe(X)||re(X))return Se!==null?null:P($,_,X,ae,null);if(typeof X.then=="function")return U($,_,bo(X),ae);if(X.$$typeof===ue)return U($,_,xo($,X),ae);jo($,X)}return null}function Q($,_,X,ae,Se){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return $=$.get(X)||null,N(_,$,""+ae,Se);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case W:return $=$.get(ae.key===null?X:ae.key)||null,D(_,$,ae,Se);case I:return $=$.get(ae.key===null?X:ae.key)||null,G(_,$,ae,Se);case de:return ae=Js(ae),Q($,_,X,ae,Se)}if(xe(ae)||re(ae))return $=$.get(X)||null,P(_,$,ae,Se,null);if(typeof ae.then=="function")return Q($,_,X,bo(ae),Se);if(ae.$$typeof===ue)return Q($,_,X,xo(_,ae),Se);jo(_,ae)}return null}function pe($,_,X,ae){for(var Se=null,Ye=null,ze=_,Ae=_=0,Lt=null;ze!==null&&Ae<X.length;Ae++){ze.index>Ae?(Lt=ze,ze=null):Lt=ze.sibling;var Fe=U($,ze,X[Ae],ae);if(Fe===null){ze===null&&(ze=Lt);break}e&&ze&&Fe.alternate===null&&t($,ze),_=u(Fe,_,Ae),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe,ze=Lt}if(Ae===X.length)return s($,ze),Be&&Ya($,Ae),Se;if(ze===null){for(;Ae<X.length;Ae++)ze=le($,X[Ae],ae),ze!==null&&(_=u(ze,_,Ae),Ye===null?Se=ze:Ye.sibling=ze,Ye=ze);return Be&&Ya($,Ae),Se}for(ze=l(ze);Ae<X.length;Ae++)Lt=Q(ze,$,Ae,X[Ae],ae),Lt!==null&&(e&&(Fe=Lt.alternate,Fe!==null&&ze.delete(Fe.key===null?Ae:Fe.key)),_=u(Lt,_,Ae),Ye===null?Se=Lt:Ye.sibling=Lt,Ye=Lt);return e&&ze.forEach(function(Rs){return t($,Rs)}),Be&&Ya($,Ae),Se}function Ce($,_,X,ae){if(X==null)throw Error(c(151));for(var Se=null,Ye=null,ze=_,Ae=_=0,Lt=null,Fe=X.next();ze!==null&&!Fe.done;Ae++,Fe=X.next()){ze.index>Ae?(Lt=ze,ze=null):Lt=ze.sibling;var Rs=U($,ze,Fe.value,ae);if(Rs===null){ze===null&&(ze=Lt);break}e&&ze&&Rs.alternate===null&&t($,ze),_=u(Rs,_,Ae),Ye===null?Se=Rs:Ye.sibling=Rs,Ye=Rs,ze=Lt}if(Fe.done)return s($,ze),Be&&Ya($,Ae),Se;if(ze===null){for(;!Fe.done;Ae++,Fe=X.next())Fe=le($,Fe.value,ae),Fe!==null&&(_=u(Fe,_,Ae),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe);return Be&&Ya($,Ae),Se}for(ze=l(ze);!Fe.done;Ae++,Fe=X.next())Fe=Q(ze,$,Ae,Fe.value,ae),Fe!==null&&(e&&(Lt=Fe.alternate,Lt!==null&&ze.delete(Lt.key===null?Ae:Lt.key)),_=u(Fe,_,Ae),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe);return e&&ze.forEach(function(ON){return t($,ON)}),Be&&Ya($,Ae),Se}function Le($,_,X,ae){if(typeof X=="object"&&X!==null&&X.type===ne&&X.key===null&&X.props.ref===void 0&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case W:e:{for(var Se=X.key;_!==null;){if(_.key===Se){if(Se=X.type,Se===ne){if(_.tag===7){s($,_.sibling),ae=o(_,X.props.children),us(ae,X),ae.return=$,$=ae;break e}}else if(_.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===de&&Js(Se)===_.type){s($,_.sibling),ae=o(_,X.props),us(ae,X),ae.return=$,$=ae;break e}s($,_);break}else t($,_);_=_.sibling}X.type===ne?(ae=Xs(X.props.children,$.mode,ae,X.key),us(ae,X),ae.return=$,$=ae):(ae=co(X.type,X.key,X.props,null,$.mode,ae),us(ae,X),ae.return=$,$=ae)}return y($);case I:e:{for(Se=X.key;_!==null;){if(_.key===Se)if(_.tag===4&&_.stateNode.containerInfo===X.containerInfo&&_.stateNode.implementation===X.implementation){s($,_.sibling),ae=o(_,X.children||[]),ae.return=$,$=ae;break e}else{s($,_);break}else t($,_);_=_.sibling}ae=Vu(X,$.mode,ae),ae.return=$,$=ae}return y($);case de:return X=Js(X),Le($,_,X,ae)}if(xe(X))return pe($,_,X,ae);if(re(X)){if(Se=re(X),typeof Se!="function")throw Error(c(150));return X=Se.call(X),Ce($,_,X,ae)}if(typeof X.then=="function")return Le($,_,bo(X),ae);if(X.$$typeof===ue)return Le($,_,xo($,X),ae);jo($,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,_!==null&&_.tag===6?(s($,_.sibling),ae=o(_,X),ae.return=$,$=ae):(s($,_),ae=Yu(X,$.mode,ae),ae.return=$,$=ae),y($)):s($,_)}return function($,_,X,ae){try{Gi=0;var Se=Le($,_,X,ae);return Bl=null,Se}catch(ze){if(ze===Hl||ze===yo)throw ze;var Ye=Sn(29,ze,null,$.mode);return Ye.lanes=ae,Ye.return=$,Ye}finally{}}}var el=wp(!0),Sp=wp(!1),ds=!1;function ed(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function td(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 fs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hs(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(We&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,t=oo(e),rp(e,null,s),t}return ro(e,l,t,s),oo(e)}function Yi(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,dm(e,s)}}function nd(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var o=null,u=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};u===null?o=u=y:u=u.next=y,s=s.next}while(s!==null);u===null?o=u=t:u=u.next=t}else o=u=t;s={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var ad=!1;function Vi(){if(ad){var e=Ul;if(e!==null)throw e}}function Xi(e,t,s,l){ad=!1;var o=e.updateQueue;ds=!1;var u=o.firstBaseUpdate,y=o.lastBaseUpdate,N=o.shared.pending;if(N!==null){o.shared.pending=null;var D=N,G=D.next;D.next=null,y===null?u=G:y.next=G,y=D;var P=e.alternate;P!==null&&(P=P.updateQueue,N=P.lastBaseUpdate,N!==y&&(N===null?P.firstBaseUpdate=G:N.next=G,P.lastBaseUpdate=D))}if(u!==null){var le=o.baseState;y=0,P=G=D=null,N=u;do{var U=N.lane&-536870913,Q=U!==N.lane;if(Q?(Ge&U)===U:(l&U)===U){U!==0&&U===Ps&&(ad=!0),P!==null&&(P=P.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var pe=e,Ce=N;U=t;var Le=s;switch(Ce.tag){case 1:if(pe=Ce.payload,typeof pe=="function"){le=pe.call(Le,le,U);break e}le=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ce.payload,U=typeof pe=="function"?pe.call(Le,le,U):pe,U==null)break e;le=A({},le,U);break e;case 2:ds=!0}}U=N.callback,U!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=o.callbacks,Q===null?o.callbacks=[U]:Q.push(U))}else Q={lane:U,tag:N.tag,payload:N.payload,callback:N.callback,next:null},P===null?(G=P=Q,D=le):P=P.next=Q,y|=U;if(N=N.next,N===null){if(N=o.shared.pending,N===null)break;Q=N,N=Q.next,Q.next=null,o.lastBaseUpdate=Q,o.shared.pending=null}}while(!0);P===null&&(D=le),o.baseState=D,o.firstBaseUpdate=G,o.lastBaseUpdate=P,u===null&&(o.shared.lanes=0),bs|=y,e.lanes=y,e.memoizedState=le}}function kp(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Cp(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)kp(s[e],t)}var ms=ce(null),No=ce(0);function Tp(e,t){e=Pa,we(No,e),we(ms,t),Pa=e|t.baseLanes}function sd(){we(No,Pa),we(ms,ms.current)}function ld(){Pa=No.current,De(ms),De(No)}var Jt=ce(null),sn=null;function ps(e){var t=e.alternate;we(Wt,Wt.current&1),we(Jt,e),sn===null&&(t===null||ms.current!==null||t.memoizedState!==null)&&(sn=e)}function id(e){we(Wt,Wt.current),we(Jt,e),sn===null&&(sn=e)}function Ep(e){e.tag===22?(we(Wt,Wt.current),we(Jt,e),sn===null&&(sn=e)):xs()}function xs(){we(Wt,Wt.current),we(Jt,Jt.current)}function Mn(e){De(Jt),sn===e&&(sn=null),De(Wt)}var Wt=ce(0);function Ki(e,t){we(Jt,Jt.current),we(Wt,t)}function rd(e){De(Wt),De(Jt),sn===e&&(sn=null)}function wo(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||zf(s)||Df(s)))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 Ka=0,_e=null,ot=null,Mt=null,So=!1,$l=!1,tl=!1,ko=0,Zi=0,ql=null,e1=0;function wt(){throw Error(c(321))}function od(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!On(e[s],t[s]))return!1;return!0}function cd(e,t,s,l,o,u){return Ka=u,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?dx:fx,tl=!1,u=s(l,o),tl=!1,$l&&(u=zp(t,s,l,o)),Rp(e),u}function Rp(e){me.H=Ao;var t=ot!==null&&ot.next!==null;if(Ka=0,Mt=ot=_e=null,So=!1,Zi=0,ql=null,t)throw Error(c(300));e===null||_t||(e=e.dependencies,e!==null&&po(e)&&(_t=!0))}function zp(e,t,s,l){_e=e;var o=0;do{if($l&&(ql=null),Zi=0,$l=!1,25<=o)throw Error(c(301));if(o+=1,Mt=ot=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}me.H=o1,u=t(s,l)}while($l);return u}function t1(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Qi(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(_e.flags|=1024),t}function ud(){var e=ko!==0;return ko=0,e}function dd(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function fd(e){if(So){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}So=!1}Ka=0,Mt=ot=_e=null,$l=!1,Zi=ko=0,ql=null}function dn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function zt(){if(ot===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Mt===null?_e.memoizedState:Mt.next;if(t!==null)Mt=t,ot=e;else{if(e===null)throw _e.alternate===null?Error(c(467)):Error(c(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qi(e){var t=Zi;return Zi+=1,ql===null&&(ql=[]),e=bp(ql,e,t),t=_e,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?dx:fx),e}function To(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qi(e);if(e.$$typeof===q)return;if(e.$$typeof===ue)return Ft(e)}throw Error(c(438,String(e)))}function hd(e){var t=null,s=_e.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=_e.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Co(),_e.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=Ee;return t.index++,s}function Za(e,t){return typeof t=="function"?t(e):t}function Eo(e){var t=zt();return md(t,ot,e)}function md(e,t,s){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=s;var o=e.baseQueue,u=l.pending;if(u!==null){if(o!==null){var y=o.next;o.next=u.next,u.next=y}t.baseQueue=o=u,l.pending=null}if(u=e.baseState,o===null)e.memoizedState=u;else{t=o.next;var N=y=null,D=null,G=t,P=!1;do{var le=G.lane&-536870913;if(le!==G.lane?(Ge&le)===le:(Ka&le)===le){var U=G.revertLane;if(U===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),le===Ps&&(P=!0);else if((Ka&U)===U){G=G.next,U===Ps&&(P=!0);continue}else le={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},D===null?(N=D=le,y=u):D=D.next=le,_e.lanes|=U,bs|=U;le=G.action,tl&&s(u,le),u=G.hasEagerState?G.eagerState:s(u,le)}else U={lane:le,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},D===null?(N=D=U,y=u):D=D.next=U,_e.lanes|=le,bs|=le;G=G.next}while(G!==null&&G!==t);if(D===null?y=u:D.next=N,!On(u,e.memoizedState)&&(_t=!0,P&&(s=Ul,s!==null)))throw s;e.memoizedState=u,e.baseState=y,e.baseQueue=D,l.lastRenderedState=u}return o===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function pd(e){var t=zt(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var l=s.dispatch,o=s.pending,u=t.memoizedState;if(o!==null){s.pending=null;var y=o=o.next;do u=e(u,y.action),y=y.next;while(y!==o);On(u,t.memoizedState)||(_t=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),s.lastRenderedState=u}return[u,l]}function Dp(e,t,s){var l=_e,o=zt(),u=Be;if(u){if(s===void 0)throw Error(c(407));s=s()}else s=t();var y=!On((ot||o).memoizedState,s);if(y&&(o.memoizedState=s,_t=!0),o=o.queue,yd(Mp.bind(null,l,o,e),[e]),e=o.getSnapshot!==t||y||Mt!==null&&(Mt.memoizedState.tag&1)!==0,Gl(e?9:8,{destroy:void 0},Op.bind(null,l,o,s,t),null),e){if(l.flags|=2048,dt===null)throw Error(c(349));u||(Ka&127)!==0||Ap(l,t,s)}return s}function Ap(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=_e.updateQueue,t===null?(t=Co(),_e.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Op(e,t,s,l){t.value=s,t.getSnapshot=l,_p(t)&&Lp(e)}function Mp(e,t,s){return s(function(){_p(t)&&Lp(e)})}function _p(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!On(e,s)}catch{return!0}}function Lp(e){var t=Vs(e,2);t!==null&&En(t,e,2)}function xd(e){var t=dn();if(typeof e=="function"){var s=e;if(e=s(),tl){ft(!0);try{s()}finally{ft(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:e},t}function Up(e,t,s,l){return e.baseState=s,md(e,ot,typeof l=="function"?l:Za)}function n1(e,t,s,l,o){if(Do(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){u.listeners.push(y)}};me.T!==null?s(!0):u.isTransition=!1,l(u),s=t.pending,s===null?(u.next=t.pending=u,Hp(t,u)):(u.next=s.next,t.pending=s.next=u)}}function Hp(e,t){var s=t.action,l=t.payload,o=e.state;if(t.isTransition){var u=me.T,y={};y.types=u!==null?u.types:null,me.T=y;try{var N=s(o,l),D=me.S;D!==null&&D(y,N),Bp(e,t,N)}catch(G){gd(e,t,G)}finally{u!==null&&y.types!==null&&(u.types=y.types),me.T=u}}else try{u=s(o,l),Bp(e,t,u)}catch(G){gd(e,t,G)}}function Bp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){$p(e,t,l)},function(l){return gd(e,t,l)}):$p(e,t,s)}function $p(e,t,s){t.status="fulfilled",t.value=s,qp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Hp(e,s)))}function gd(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,qp(t),t=t.next;while(t!==l)}e.action=null}function qp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Gp(e,t){return t}function Yp(e,t){if(Be){var s=dt.formState;if(s!==null){e:{var l=_e;if(Be){if(ht){t:{for(var o=ht,u=Qn;o.nodeType!==8;){if(!u){o=null;break t}if(o=Pn(o.nextSibling),o===null){o=null;break t}}u=o.data,o=u==="F!"||u==="F"?o:null}if(o){ht=Pn(o.nextSibling),l=o.data==="F!";break e}}os(l)}l=!1}l&&(t=s[0])}}return s=dn(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gp,lastRenderedState:t},s.queue=l,s=ox.bind(null,_e,l),l.dispatch=s,l=xd(!1),u=wd.bind(null,_e,!1,l.queue),l=dn(),o={state:t,dispatch:null,action:e,pending:null},l.queue=o,s=n1.bind(null,_e,o,u,s),o.dispatch=s,l.memoizedState=e,[t,s,!1]}function Vp(e){var t=zt();return Xp(t,ot,e)}function Xp(e,t,s){if(t=md(e,t,Gp)[0],e=Eo(Za)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Qi(t)}catch(y){throw y===Hl?yo:y}else l=t;t=zt();var o=t.queue,u=o.dispatch;return s!==t.memoizedState&&(_e.flags|=2048,Gl(9,{destroy:void 0},a1.bind(null,o,s),null)),[l,u,e]}function a1(e,t){e.action=t}function Kp(e){var t=zt(),s=ot;if(s!==null)return Xp(t,s,e);zt(),t=t.memoizedState,s=zt();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function Gl(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=_e.updateQueue,t===null&&(t=Co(),_e.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Zp(){return zt().memoizedState}function Ro(e,t,s,l){var o=dn();_e.flags|=e,o.memoizedState=Gl(1|t,{destroy:void 0},s,l===void 0?null:l)}function zo(e,t,s,l){var o=zt();l=l===void 0?null:l;var u=o.memoizedState.inst;ot!==null&&l!==null&&od(l,ot.memoizedState.deps)?o.memoizedState=Gl(t,u,s,l):(_e.flags|=e,o.memoizedState=Gl(1|t,u,s,l))}function Qp(e,t){Ro(8390656,8,e,t)}function yd(e,t){zo(2048,8,e,t)}function s1(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=Co(),_e.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Ip(e){var t=zt().memoizedState;return s1({ref:t,nextImpl:e}),function(){if((We&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Pp(e,t){return zo(4,2,e,t)}function Fp(e,t){return zo(4,4,e,t)}function Jp(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Wp(e,t,s){s=s!=null?s.concat([e]):null,zo(4,4,Jp.bind(null,t,e),s)}function vd(){}function ex(e,t){var s=zt();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&od(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function tx(e,t){var s=zt();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&od(t,l[1]))return l[0];if(l=e(),tl){ft(!0);try{e()}finally{ft(!1)}}return s.memoizedState=[l,t],l}function bd(e,t,s){return s===void 0||(Ka&1073741824)!==0&&(Ge&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=dg(),_e.lanes|=e,bs|=e,s)}function nx(e,t,s,l){return On(s,t)?s:ms.current!==null?(e=bd(e,s,l),On(e,t)||(_t=!0),e):(Ka&106)===0||(Ka&1073741824)!==0&&(Ge&261930)===0?(_t=!0,e.memoizedState=s):(e=dg(),_e.lanes|=e,bs|=e,t)}function ax(e,t,s,l,o){var u=ie.p;ie.p=u!==0&&8>u?u:8;var y=me.T,N={};N.types=y!==null?y.types:null,me.T=N,wd(e,!1,t,s);try{var D=o(),G=me.S;if(G!==null&&G(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var P=Wj(D,l);Ii(e,t,P,Hn(e))}else Ii(e,t,l,Hn(e))}catch(le){Ii(e,t,{then:function(){},status:"rejected",reason:le},Hn())}finally{ie.p=u,y!==null&&N.types!==null&&(y.types=N.types),me.T=y}}function l1(){}function jd(e,t,s,l){if(e.tag!==5)throw Error(c(476));var o=sx(e).queue;ax(e,o,t,Pe,s===null?l1:function(){return lx(e),s(l)})}function sx(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Pe,baseState:Pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:Pe},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lx(e){var t=sx(e);t.next===null&&(t=e.alternate.memoizedState),Ii(e,t.next.queue,{},Hn())}function Nd(){return Ft(ri)}function ix(){return zt().memoizedState}function rx(){return zt().memoizedState}function i1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Hn();e=fs(s);var l=hs(t,e,s);l!==null&&(En(l,t,s),Yi(l,t,s)),t={cache:Pu()},e.payload=t;return}t=t.return}}function r1(e,t,s){var l=Hn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Do(e)?cx(t,s):(s=qu(e,t,s,l),s!==null&&(En(s,e,l),ux(s,t,l)))}function ox(e,t,s){var l=Hn();Ii(e,t,s,l)}function Ii(e,t,s,l){var o={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Do(e))cx(t,o);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var y=t.lastRenderedState,N=u(y,s);if(o.hasEagerState=!0,o.eagerState=N,On(N,y))return ro(e,t,o,0),dt===null&&io(),!1}catch{}finally{}if(s=qu(e,t,o,l),s!==null)return En(s,e,l),ux(s,t,l),!0}return!1}function wd(e,t,s,l){if(l={lane:2,revertLane:mf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Do(e)){if(t)throw Error(c(479))}else t=qu(e,s,l,2),t!==null&&En(t,e,2)}function Do(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function cx(e,t){$l=So=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function ux(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,dm(e,s)}}var Ao={readContext:Ft,use:To,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},dx={readContext:Ft,use:To,useCallback:function(e,t){return dn().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:Qp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Ro(4194308,4,Jp.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Ro(4194308,4,e,t)},useInsertionEffect:function(e,t){Ro(4,2,e,t)},useMemo:function(e,t){var s=dn();t=t===void 0?null:t;var l=e();if(tl){ft(!0);try{e()}finally{ft(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=dn();if(s!==void 0){var o=s(t);if(tl){ft(!0);try{s(t)}finally{ft(!1)}}}else o=t;return l.memoizedState=l.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},l.queue=e,e=e.dispatch=r1.bind(null,_e,e),[l.memoizedState,e]},useRef:function(e){var t=dn();return e={current:e},t.memoizedState=e},useState:function(e){e=xd(e);var t=e.queue,s=ox.bind(null,_e,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:vd,useDeferredValue:function(e,t){var s=dn();return bd(s,e,t)},useTransition:function(){var e=xd(!1);return e=ax.bind(null,_e,e.queue,!0,!1),dn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=_e,o=dn();if(Be){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),dt===null)throw Error(c(349));(Ge&127)!==0||Ap(l,t,s)}o.memoizedState=s;var u={value:s,getSnapshot:t};return o.queue=u,Qp(Mp.bind(null,l,u,e),[e]),l.flags|=2048,Gl(9,{destroy:void 0},Op.bind(null,l,u,s,t),null),s},useId:function(){var e=dn(),t=dt.identifierPrefix;if(Be){var s=Ca,l=ka;s=(l&~(1<<32-Nt(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=ko++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=e1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Nd,useFormState:Yp,useActionState:Yp,useOptimistic:function(e){var t=dn();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=wd.bind(null,_e,!0,s),s.dispatch=t,[e,t]},useMemoCache:hd,useCacheRefresh:function(){return dn().memoizedState=i1.bind(null,_e)},useEffectEvent:function(e){var t=dn(),s={impl:e};return t.memoizedState=s,function(){if((We&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}},fx={readContext:Ft,use:To,useCallback:ex,useContext:Ft,useEffect:yd,useImperativeHandle:Wp,useInsertionEffect:Pp,useLayoutEffect:Fp,useMemo:tx,useReducer:Eo,useRef:Zp,useState:function(){return Eo(Za)},useDebugValue:vd,useDeferredValue:function(e,t){var s=zt();return nx(s,ot.memoizedState,e,t)},useTransition:function(){var e=Eo(Za)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:Dp,useId:ix,useHostTransitionStatus:Nd,useFormState:Vp,useActionState:Vp,useOptimistic:function(e,t){var s=zt();return Up(s,ot,e,t)},useMemoCache:hd,useCacheRefresh:rx,useEffectEvent:Ip},o1={readContext:Ft,use:To,useCallback:ex,useContext:Ft,useEffect:yd,useImperativeHandle:Wp,useInsertionEffect:Pp,useLayoutEffect:Fp,useMemo:tx,useReducer:pd,useRef:Zp,useState:function(){return pd(Za)},useDebugValue:vd,useDeferredValue:function(e,t){var s=zt();return ot===null?bd(s,e,t):nx(s,ot.memoizedState,e,t)},useTransition:function(){var e=pd(Za)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:Dp,useId:ix,useHostTransitionStatus:Nd,useFormState:Kp,useActionState:Kp,useOptimistic:function(e,t){var s=zt();return ot!==null?Up(s,ot,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:hd,useCacheRefresh:rx,useEffectEvent:Ip};function Sd(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:A({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var kd={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=Hn(),o=fs(l);o.payload=t,s!=null&&(o.callback=s),t=hs(e,o,l),t!==null&&(En(t,e,l),Yi(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=Hn(),o=fs(l);o.tag=1,o.payload=t,s!=null&&(o.callback=s),t=hs(e,o,l),t!==null&&(En(t,e,l),Yi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Hn(),l=fs(s);l.tag=2,t!=null&&(l.callback=t),t=hs(e,l,s),t!==null&&(En(t,e,s),Yi(t,e,s))}};function hx(e,t,s,l,o,u,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,y):t.prototype&&t.prototype.isPureReactComponent?!_i(s,l)||!_i(o,u):!0}function mx(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&kd.enqueueReplaceState(t,t.state,null)}function nl(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=A({},s));for(var o in e)s[o]===void 0&&(s[o]=e[o])}return s}function px(e){lo(e)}function xx(e){console.error(e)}function gx(e){lo(e)}function Oo(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function yx(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Cd(e,t,s){return s=fs(s),s.tag=3,s.payload={element:null},s.callback=function(){Oo(e,t)},s}function vx(e){return e=fs(e),e.tag=3,e}function bx(e,t,s,l){var o=s.type.getDerivedStateFromError;if(typeof o=="function"){var u=l.value;e.payload=function(){return o(u)},e.callback=function(){yx(t,s,l)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){yx(t,s,l),typeof o!="function"&&(js===null?js=new Set([this]):js.add(this));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})})}function c1(e,t,s,l,o){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&Qs(t,s,o,!0),s=Jt.current,s!==null){switch(s.tag){case 31:case 13:case 19:return sn===null?ec():s.alternate===null&&St===0&&(St=3),s.flags&=-257,s.flags|=65536,s.lanes=o,l===vo?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),df(e,l,o)),!1;case 22:return s.flags|=65536,l===vo?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),df(e,l,o)),!1}throw Error(c(435,s.tag))}return df(e,l,o),ec(),!1}if(Be)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,l!==Ku&&(e=Error(c(422),{cause:l}),Hi(Xn(e,s)))):(l!==Ku&&(t=Error(c(423),{cause:l}),Hi(Xn(t,s))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,l=Xn(l,s),o=Cd(e.stateNode,l,o),nd(e,o),St!==4&&(St=2)),!1;var u=Error(c(520),{cause:l});if(u=Xn(u,s),ar===null?ar=[u]:ar.push(u),St!==4&&(St=2),t===null)return!0;l=Xn(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=o&-o,s.lanes|=e,e=Cd(s.stateNode,l,e),nd(s,e),!1;case 1:if(t=s.type,u=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(js===null||!js.has(u))))return s.flags|=65536,o&=-o,s.lanes|=o,o=vx(o),bx(o,e,s,l),nd(s,o),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var Td=Error(c(461)),_t=!1;function Ht(e,t,s,l){t.child=e===null?Sp(t,null,s,l):el(t,e.child,s,l)}function jx(e,t,s,l,o){s=s.render;var u=t.ref;if("ref"in l){var y={};for(var N in l)N!=="ref"&&(y[N]=l[N])}else y=l;return Is(t),l=cd(e,t,s,y,u,o),N=ud(),e!==null&&!_t?(dd(e,t,o),Qa(e,t,o)):(Be&&N&&fo(t),t.flags|=1,Ht(e,t,l,o),t.child)}function Nx(e,t,s,l,o){if(e===null){var u=s.type;return typeof u=="function"&&!Gu(u)&&u.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=u,wx(e,t,u,l,o)):(e=co(s.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!_d(e,o)){var y=u.memoizedProps;if(s=s.compare,s=s!==null?s:_i,s(y,l)&&e.ref===t.ref)return Qa(e,t,o)}return t.flags|=1,e=Ga(u,l),e.ref=t.ref,e.return=t,t.child=e}function wx(e,t,s,l,o){if(e!==null){var u=e.memoizedProps;if(_i(u,l)&&e.ref===t.ref)if(_t=!1,t.pendingProps=l=u,_d(e,o))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,Qa(e,t,o)}return Ed(e,t,s,l,o)}function Sx(e,t,s,l){var o=l.children,u=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(u=u!==null?u.baseLanes|s:s,e!==null){for(l=t.child=e.child,o=0;l!==null;)o=o|l.lanes|l.childLanes,l=l.sibling;l=o&~u}else l=0,t.child=null;return kx(e,t,u,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&go(t,u!==null?u.cachePool:null),u!==null?Tp(t,u):sd(),Ep(t);else return l=t.lanes=536870912,kx(e,t,u!==null?u.baseLanes|s:s,s,l)}else u!==null?(go(t,u.cachePool),Tp(t,u),xs(),t.memoizedState=null):(e!==null&&go(t,null),sd(),xs());return Ht(e,t,o,s),t.child}function Pi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function kx(e,t,s,l,o){var u=Ju();return u=u===null?null:{parent:Ot._currentValue,pool:u},t.memoizedState={baseLanes:s,cachePool:u},e!==null&&go(t,null),sd(),Ep(t),e!==null&&Qs(e,t,l,!0),t.childLanes=o,null}function Mo(e,t){return t=_o({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Cx(e,t,s){return el(t,e.child,null,s),e=Mo(t,t.pendingProps),e.flags|=2,Mn(t),t.memoizedState=null,e}function u1(e,t,s){var l=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(l.mode==="hidden")return e=Mo(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Pi(null,e);if(id(t),(e=ht)?(e=Jg(e,Qn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:is!==null?{id:ka,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},s=cp(e),s.return=t,t.child=s,Vt=t,ht=null)):e=null,e===null)throw os(t);return t.lanes=536870912,null}return Mo(t,l)}var u=e.memoizedState;if(u!==null){var y=u.dehydrated;if(id(t),o)if(t.flags&256)t.flags&=-257,t=Cx(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(_t||Qs(e,t,s,!1),o=(s&e.childLanes)!==0,_t||o){if(ms.current===null){if(l=dt,l!==null&&(y=fm(l,s),y!==0&&y!==u.retryLane))throw u.retryLane=y,Vs(e,y),En(l,e,y),Td;ec()}t=Cx(e,t,s)}else e=u.treeContext,ht=Pn(y.nextSibling),Vt=t,Be=!0,rs=null,Qn=!1,e!==null&&fp(t,e),t=Mo(t,l),t.flags|=134221824;return t}return e=Ga(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Yl(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(c(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Ed(e,t,s,l,o){return Is(t),s=cd(e,t,s,l,void 0,o),l=ud(),e!==null&&!_t?(dd(e,t,o),Qa(e,t,o)):(Be&&l&&fo(t),t.flags|=1,Ht(e,t,s,o),t.child)}function Tx(e,t,s,l,o,u){return Is(t),t.updateQueue=null,s=zp(t,l,s,o),Rp(e),l=ud(),e!==null&&!_t?(dd(e,t,u),Qa(e,t,u)):(Be&&l&&fo(t),t.flags|=1,Ht(e,t,s,u),t.child)}function Ex(e,t,s,l,o){if(Is(t),t.stateNode===null){var u=Ol,y=s.contextType;typeof y=="object"&&y!==null&&(u=Ft(y)),u=new s(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=kd,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},ed(t),y=s.contextType,u.context=typeof y=="object"&&y!==null?Ft(y):Ol,u.state=t.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Sd(t,s,y,l),u.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(y=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),y!==u.state&&kd.enqueueReplaceState(u,u.state,null),Xi(t,l,u,o),Vi(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var N=t.memoizedProps,D=nl(s,N);u.props=D;var G=u.context,P=s.contextType;y=Ol,typeof P=="object"&&P!==null&&(y=Ft(P));var le=s.getDerivedStateFromProps;P=typeof le=="function"||typeof u.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,P||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(N||G!==y)&&mx(t,u,l,y),ds=!1;var U=t.memoizedState;u.state=U,Xi(t,l,u,o),Vi(),G=t.memoizedState,N||U!==G||ds?(typeof le=="function"&&(Sd(t,s,le,l),G=t.memoizedState),(D=ds||hx(t,s,D,l,U,G,y))?(P||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=G),u.props=l,u.state=G,u.context=y,l=D):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,td(e,t),y=t.memoizedProps,P=nl(s,y),u.props=P,le=t.pendingProps,U=u.context,G=s.contextType,D=Ol,typeof G=="object"&&G!==null&&(D=Ft(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(y!==le||U!==D)&&mx(t,u,l,D),ds=!1,U=t.memoizedState,u.state=U,Xi(t,l,u,o),Vi();var Q=t.memoizedState;y!==le||U!==Q||ds||e!==null&&e.dependencies!==null&&po(e.dependencies)?(typeof N=="function"&&(Sd(t,s,N,l),Q=t.memoizedState),(P=ds||hx(t,s,P,l,U,Q,D)||e!==null&&e.dependencies!==null&&po(e.dependencies))?(G||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,Q,D),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,Q,D)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||y===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Q),u.props=l,u.state=Q,u.context=D,l=P):(typeof u.componentDidUpdate!="function"||y===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,Yl(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=el(t,e.child,null,o),t.child=el(t,null,s,o)):Ht(e,t,s,o),t.memoizedState=u.state,e=t.child):e=Qa(e,t,o),e}function Rx(e,t,s,l){return Ks(),t.flags|=256,Ht(e,t,s,l),t.child}var Rd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zd(e){return{baseLanes:e,cachePool:yp()}}function Dd(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Un),e}function zx(e,t,s){var l=t.pendingProps,o=!1,u=(t.flags&128)!==0,y;if((y=u)||(y=e!==null&&e.memoizedState===null?!1:(Wt.current&2)!==0),y&&(o=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(o?ps(t):xs(),(e=ht)?(e=Jg(e,Qn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:is!==null?{id:ka,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},s=cp(e),s.return=t,t.child=s,Vt=t,ht=null)):e=null,e===null)throw os(t);return Df(e)?t.lanes=32:t.lanes=536870912,null}return u=l.children,l=l.fallback,o?(xs(),o=t.mode,u=_o({mode:"hidden",children:u},o),l=Xs(l,o,s,null),u.return=t,l.return=t,u.sibling=l,t.child=u,l=t.child,l.memoizedState=zd(s),l.childLanes=Dd(e,y,s),t.memoizedState=Rd,Pi(null,l)):(ps(t),Ad(t,u))}var N=e.memoizedState;if(N!==null){var D=N.dehydrated;if(D!==null)return d1(e,t,u,y,l,D,N,s)}return o?(xs(),o=l.fallback,u=t.mode,N=e.child,D=N.sibling,l=Ga(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&1206910976,D!==null?o=Ga(D,o):(o=Xs(o,u,s,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,Pi(null,l),l=t.child,o=e.child.memoizedState,o===null?o=zd(s):(u=o.cachePool,u!==null?(N=Ot._currentValue,u=u.parent!==N?{parent:N,pool:N}:u):u=yp(),o={baseLanes:o.baseLanes|s,cachePool:u}),l.memoizedState=o,l.childLanes=Dd(e,y,s),t.memoizedState=Rd,Pi(e.child,l)):(ps(t),s=e.child,e=s.sibling,s=Ga(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=s,t.memoizedState=null,s)}function Ad(e,t){return t=_o({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _o(e,t){return e=Sn(22,e,null,t),e.lanes=0,e}function Lo(e,t,s){return el(t,e.child,null,s),e=Ad(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function d1(e,t,s,l,o,u,y,N){if(s)return t.flags&256?(ps(t),t.flags&=-257,Lo(e,t,N)):t.memoizedState!==null?(xs(),t.child=e.child,t.flags|=128,null):(xs(),u=o.fallback,y=t.mode,o=_o({mode:"visible",children:o.children},y),u=Xs(u,y,N,null),u.flags|=2,o.return=t,u.return=t,o.sibling=u,t.child=o,el(t,e.child,null,N),o=t.child,o.memoizedState=zd(N),o.childLanes=Dd(e,l,N),t.memoizedState=Rd,Pi(null,o));if(ps(t),Df(u)){if(l=u.nextSibling&&u.nextSibling.dataset,l)var D=l.dgst;return l=D,l!==""&&(o=Error(c(419)),o.stack="",o.digest=l,Hi({value:o,source:null,stack:null})),Lo(e,t,N)}if(_t||Qs(e,t,N,!1),l=(N&e.childLanes)!==0,_t||l){if(ms.current!==null)return Lo(e,t,N);if(l=dt,l!==null&&(o=fm(l,N),o!==0&&o!==y.retryLane))throw y.retryLane=o,Vs(e,o),En(l,e,o),Td;return zf(u)||ec(),Lo(e,t,N)}return zf(u)?(t.flags|=192,t.child=e.child,null):(e=y.treeContext,ht=Pn(u.nextSibling),Vt=t,Be=!0,rs=null,Qn=!1,e!==null&&fp(t,e),t=Ad(t,o.children),t.flags|=134221824,t)}function Dx(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),mo(e.return,t,s)}function Ax(e){for(var t=null;e!==null;){var s=e.alternate;s!==null&&wo(s)===null&&(t=e),e=e.sibling}return t}function Uo(e,t,s,l,o,u){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:o,treeForkCount:u}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=l,y.tail=s,y.tailMode=o,y.treeForkCount=u)}function Od(e){var t=e.child;for(e.child=null;t!==null;){var s=t.sibling;t.sibling=e.child,e.child=t,t=s}}function Md(e,t,s){var l=t.pendingProps,o=l.revealOrder,u=l.tail;l=l.children;var y=Wt.current;if(t.flags&128)return Ki(t,y),null;var N=(y&2)!==0;if(N?(y=y&1|2,t.flags|=128):y&=1,Ki(t,y),o==="backwards"&&e!==null?(Od(e),Ht(e,t,l,s),Od(e)):Ht(e,t,l,s),l=Be?Ui:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dx(e,s,t);else if(e.tag===19)Dx(e,s,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(o){case"backwards":s=Ax(t.child),s===null?(o=t.child,t.child=null):(o=s.sibling,s.sibling=null,Od(t)),Uo(t,!0,o,null,u,l);break;case"unstable_legacy-backwards":for(s=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&wo(e)===null){t.child=o;break}e=o.sibling,o.sibling=s,s=o,o=e}Uo(t,!0,s,null,u,l);break;case"together":Uo(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:s=Ax(t.child),s===null?(o=t.child,t.child=null):(o=s.sibling,s.sibling=null),Uo(t,!1,o,s,u,l)}return t.child}function Ox(e,t,s){var l=t.pendingProps;return cs(t,t.type,l.value),Ht(e,t,l.children,s),t.child}function Qa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),bs|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Qs(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,s=Ga(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Ga(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function _d(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&po(e)))}function f1(e,t,s){switch(t.tag){case 3:zn(t,t.stateNode.containerInfo),cs(t,Ot,e.memoizedState.cache),Ks();break;case 27:case 5:na(t);break;case 4:zn(t,t.stateNode.containerInfo);break;case 10:cs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,id(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return ps(t),t.flags|=128,null;l=Qs(e,t,s,!1);var o=t.child.childLanes;return l||(s&o)!==0?zx(e,t,s):(ps(t),e=Qa(e,t,s),e!==null?e.sibling:null)}ps(t);break;case 19:if(t.flags&128)return Md(e,t,s);if(o=(e.flags&128)!==0,l=(s&t.childLanes)!==0,l||(Qs(e,t,s,!1),l=(s&t.childLanes)!==0),o){if(l)return Md(e,t,s);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ki(t,Wt.current),l)break;return null;case 22:return t.lanes=0,Sx(e,t,s,t.pendingProps);case 24:cs(t,Ot,e.memoizedState.cache)}return Qa(e,t,s)}function Mx(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!_d(e,s)&&(t.flags&128)===0)return _t=!1,f1(e,t,s);_t=(e.flags&131072)!==0}else _t=!1,Be&&(t.flags&1048576)!==0&&dp(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Js(t.elementType),t.type=e,typeof e=="function")Gu(e)?(l=nl(e,l),t.tag=1,t=Ex(null,t,e,l,s)):(t.tag=0,t=Ed(null,t,e,l,s));else{if(e!=null){var o=e.$$typeof;if(o===K){t.tag=11,t=jx(null,t,e,l,s);break e}else if(o===te){t.tag=14,t=Nx(null,t,e,l,s);break e}else if(o===ue){t.tag=10,t.type=e,t=Ox(null,t,s);break e}}throw t=Re(e)||e,Error(c(306,t,""))}}return t;case 0:return Ed(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,o=nl(l,t.pendingProps),Ex(e,t,l,o,s);case 3:e:{if(zn(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var u=t.memoizedState;o=u.element,td(e,t),Xi(t,l,null,s);var y=t.memoizedState;if(l=y.cache,cs(t,Ot,l),l!==u.cache&&Iu(t,[Ot],s,!0),Vi(),l=y.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Rx(e,t,l,s);break e}else if(l!==o){o=Xn(Error(c(424)),t),Hi(o),t=Rx(e,t,l,s);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(ht=Pn(e.firstChild),Vt=t,Be=!0,rs=null,Qn=!0,s=Sp(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(Ks(),l===o){t=Qa(e,t,s);break e}Ht(e,t,l,s)}t=t.child}return t;case 26:return Yl(e,t),e===null?(s=ly(t.type,null,t.pendingProps,null))?t.memoizedState=s:Be||(t.stateNode=Hg(t.type,t.pendingProps,xt.current,t)):t.memoizedState=ly(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return na(t),e===null&&Be&&(l=t.stateNode=ty(t.type,t.pendingProps,xt.current),Vt=t,Qn=!0,o=ht,Ss(t.type)?(Af=o,ht=Pn(l.firstChild)):ht=o),Ht(e,t,t.pendingProps.children,s),Yl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((o=l=ht)&&(l=iN(l,t.type,t.pendingProps,Qn),l!==null?(t.stateNode=l,Vt=t,ht=Pn(l.firstChild),Qn=!1,o=!0):o=!1),o||os(t)),na(t),o=t.type,u=t.pendingProps,y=e!==null?e.memoizedProps:null,l=u.children,wf(o,u)?l=null:y!==null&&wf(o,y)&&(t.flags|=32),t.memoizedState!==null&&(o=cd(e,t,t1,null,null,s),ri._currentValue=o),Yl(e,t),Ht(e,t,l,s),t.child;case 6:return e===null&&Be&&((e=s=ht)&&(s=rN(s,t.pendingProps,Qn),s!==null?(t.stateNode=s,Vt=t,ht=null,e=!0):e=!1),e||os(t)),null;case 13:return zx(e,t,s);case 4:return zn(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=el(t,null,l,s):Ht(e,t,l,s),t.child;case 11:return jx(e,t,t.type,t.pendingProps,s);case 7:return l=t.pendingProps,Yl(e,t),Ht(e,t,l,s),t.child;case 8:return Ht(e,t,t.pendingProps.children,s),t.child;case 12:return Ht(e,t,t.pendingProps.children,s),t.child;case 10:return Ox(e,t,s);case 9:return o=t.type._context,l=t.pendingProps.children,Is(t),o=Ft(o),l=l(o),t.flags|=1,Ht(e,t,l,s),t.child;case 14:return Nx(e,t,t.type,t.pendingProps,s);case 15:return wx(e,t,t.type,t.pendingProps,s);case 19:return Md(e,t,s);case 31:return u1(e,t,s);case 22:return Sx(e,t,s,t.pendingProps);case 24:return Is(t),l=Ft(Ot),e===null?(o=Ju(),o===null&&(o=dt,u=Pu(),o.pooledCache=u,u.refCount++,u!==null&&(o.pooledCacheLanes|=s),o=u),t.memoizedState={parent:l,cache:o},ed(t),cs(t,Ot,o)):((e.lanes&s)!==0&&(td(e,t),Xi(t,null,null,s),Vi()),o=e.memoizedState,u=t.memoizedState,o.parent!==l?(o={parent:l,cache:l},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),cs(t,Ot,l)):(l=u.cache,cs(t,Ot,l),l!==o.cache&&Iu(t,[Ot],s,!0))),Ht(e,t,t.pendingProps.children,s),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:Be&&fo(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Yl(e,t),Ht(e,t,l.children,s),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ia(e){e.flags|=4}function Ld(e,t,s,l,o){var u;if((u=(e.mode&32)!==0)&&(u=s===null?cy(t,l):cy(t,l)&&(l.src!==s.src||l.srcSet!==s.srcSet)),u){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(pg())e.flags|=8192;else throw Ws=vo,Wu}else e.flags&=-16777217}function _x(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!uy(t))if(pg())e.flags|=8192;else throw Ws=vo,Wu}function Ho(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?cm():536870912,e.lanes|=t,Ql|=t)}function Fi(e,t){if(!Be)switch(e.tailMode){case"visible":break;case"collapsed":for(var s=e.tail,l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var o=e.child;o!==null;)s|=o.lanes|o.childLanes,l|=o.subtreeFlags&1206910976,l|=o.flags&1206910976,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)s|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function h1(e,t,s){var l=t.pendingProps;switch(Xu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Xa(Ot),jn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?Ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zu())),mt(t),null;case 26:var o=t.type,u=t.memoizedState;return e===null?(Ia(t),u!==null?(mt(t),_x(t,u)):(mt(t),Ld(t,o,null,l,s))):u?u!==e.memoizedState?(Ia(t),mt(t),_x(t,u)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ia(t),mt(t),Ld(t,o,e,l,s)),null;case 27:if(F(t),s=xt.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return mt(t),t.subtreeFlags&=-33554433,null}e=nt.current,Ll(t)?hp(t):(e=ty(o,l,s),t.stateNode=e,Ia(t))}return mt(t),t.subtreeFlags&=-33554433,null;case 5:if(F(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return mt(t),t.subtreeFlags&=-33554433,null}if(u=nt.current,Ll(t))hp(t);else{var y=or(xt.current);switch(u){case 1:u=y.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:u=y.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":u=y.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":u=y.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":u=y.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?y.createElement("select",{is:l.is}):y.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?y.createElement(o,{is:l.is}):y.createElement(o)}}u[Pt]=t,u[wn]=l;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)u.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=u;e:switch(tn(u,o,l),o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ia(t)}}return mt(t),t.subtreeFlags&=-33554433,Ld(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=xt.current,Ll(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,o=Vt,o!==null)switch(o.tag){case 27:case 5:l=o.memoizedProps}e[Pt]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||Mg(e.nodeValue,s)),e||os(t,!0)}else e=or(e).createTextNode(l),e[Pt]=t,t.stateNode=e}return mt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ll(t),s!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Pt]=t}else Ks(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else s=Zu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Mn(t),t):(Mn(t),null);if((t.flags&128)!==0)throw Error(c(558))}return mt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Ll(t),l!==null&&l.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[Pt]=t}else Ks(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),o=!1}else o=Zu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Mn(t),t):(Mn(t),null)}return Mn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,o=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(o=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==o&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Ho(t,t.updateQueue),mt(t),null);case 4:return jn(),e===null&&yf(t.stateNode.containerInfo),t.flags|=67108864,mt(t),null;case 10:return Xa(t.type),mt(t),null;case 19:if(rd(t),l=t.memoizedState,l===null)return mt(t),null;if(o=(t.flags&128)!==0,u=l.rendering,u===null)if(o)Fi(l,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=wo(e),u!==null){for(t.flags|=128,Fi(l,!1),e=u.updateQueue,t.updateQueue=e,Ho(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)op(s,e),s=s.sibling;return Ki(t,Wt.current&1|2),Be&&Ya(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ze()>Po&&(t.flags|=128,o=!0,Fi(l,!1),t.lanes=4194304)}else{if(!o)if(e=wo(u),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Ho(t,e),Fi(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!u.alternate&&!Be)return mt(t),null}else 2*Ze()-l.renderingStartTime>Po&&s!==536870912&&(t.flags|=128,o=!0,Fi(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(s=e;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ze(),e.sibling=null,u=Wt.current,u=o?u&1|2:u&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!s||Be?Ki(t,u):(s=u,we(Jt,t),we(Wt,s),sn===null&&(sn=t)),Be&&Ya(t,l.treeForkCount),e}return mt(t),null;case 22:case 23:return Mn(t),ld(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),s=t.updateQueue,s!==null&&Ho(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&De(Fs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Xa(Ot),mt(t),null;case 25:return null;case 30:return t.flags|=33554432,mt(t),null}throw Error(c(156,t.tag))}function m1(e,t){switch(Xu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xa(Ot),jn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return F(t),null;case 31:if(t.memoizedState!==null){if(Mn(t),t.alternate===null)throw Error(c(340));Ks()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ks()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return rd(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 jn(),null;case 10:return Xa(t.type),null;case 22:case 23:return Mn(t),ld(),e!==null&&De(Fs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xa(Ot),null;case 25:return null;default:return null}}function Lx(e,t){switch(Xu(t),t.tag){case 3:Xa(Ot),jn();break;case 26:case 27:case 5:F(t);break;case 4:jn();break;case 31:t.memoizedState!==null&&Mn(t);break;case 13:Mn(t);break;case 19:rd(t);break;case 10:Xa(t.type);break;case 22:case 23:Mn(t),ld(),e!==null&&De(Fs);break;case 24:Xa(Ot)}}function Ji(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var o=l.next;s=o;do{if((s.tag&e)===e){l=void 0;var u=s.create,y=s.inst;l=u(),y.destroy=l}s=s.next}while(s!==o)}}catch(N){lt(t,t.return,N)}}function gs(e,t,s){try{var l=t.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var u=o.next;l=u;do{if((l.tag&e)===e){var y=l.inst,N=y.destroy;if(N!==void 0){y.destroy=void 0,o=t;var D=s,G=N;try{G()}catch(P){lt(o,D,P)}}}l=l.next}while(l!==u)}}catch(P){lt(t,t.return,P)}}function Ux(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Cp(t,s)}catch(l){lt(e,e.return,l)}}}function Hx(e,t,s){s.props=nl(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){lt(e,t,l)}}function Ta(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var o=e.stateNode,u=$a(e.memoizedProps,o);(o.ref===null||o.ref.name!==u)&&(o.ref=Xg(u)),l=o.ref;break;case 7:if(e.stateNode===null){var y=new Bn(e);x(e.child,!1,sN,y,void 0,void 0),e.stateNode=y}l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(N){lt(e,t,N)}}function en(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(o){lt(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(o){lt(e,t,o)}else s.current=null}function Bo(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var s=0;s<t.length;s++)Fg(e.stateNode,t[s])}function Bx(e){for(var t=e.return;t!==null&&(Hd(t)&&Fg(e.stateNode,t.stateNode),!Ud(t));)t=t.return}function Wi(e){for(var t=e.return;t!==null&&(Hd(t)&&lN(e.stateNode,t.stateNode),!Ud(t));)t=t.return}function Ud(e){return e.tag===5||e.tag===3||e.tag===27}function Hd(e){return e&&e.tag===7&&e.stateNode!==null}function Bd(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(o){lt(e,e.return,o)}}function $d(e,t,s){try{var l=e.stateNode;$1(l,e.type,s,t),l[wn]=t}catch(o){lt(e,e.return,o)}}function $x(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ss(e.type)||e.tag===4}function qd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$x(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&&Ss(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 Gd(e,t,s,l){var o=e.tag;if(o===5||o===6)o=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(o,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(o),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Sa)),Bo(e,l),Je=!0;else if(o!==4&&(o===27&&(Bo(e,l),l=null,Ss(e.type)&&(s=e.stateNode,t=null)),e=e.child,e!==null))for(Gd(e,t,s,l),e=e.sibling;e!==null;)Gd(e,t,s,l),e=e.sibling}function $o(e,t,s,l){var o=e.tag;if(o===5||o===6)o=e.stateNode,t?s.insertBefore(o,t):s.appendChild(o),Bo(e,l),Je=!0;else if(o!==4&&(o===27&&(Bo(e,l),l=null,Ss(e.type)&&(s=e.stateNode)),e=e.child,e!==null))for($o(e,t,s,l),e=e.sibling;e!==null;)$o(e,t,s,l),e=e.sibling}function qx(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);tn(t,l,s),t[Pt]=e,t[wn]=s}catch(u){lt(e,e.return,u)}}var qo=!1,_n=null;function Gx(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(qo=!0)}var Ea=null;function Yx(){var e=Ea;return Ea=null,e}var kn=0;function Vl(e,t,s,l,o){return kn=0,Vx(e.child,t,s,l,o)}function Vx(e,t,s,l,o){for(var u=!1;e!==null;){if(e.tag===5){var y=e.stateNode;if(l!==null){var N=Cf(y);l.push(N),N.view&&(u=!0)}else u||Cf(y).view&&(u=!0);qo=!0,Yg(y,kn===0?t:t+"_"+kn,s),kn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&o||Vx(e.child,t,s,l,o)&&(u=!0));e=e.sibling}return u}function Ra(e,t){for(;e!==null;)e.tag===5?Vg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ra(e.child,t)),e=e.sibling}function Go(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Go(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(c(544));var s=t.name;t=qa(t.default,t.share),t!=="none"&&(Vl(e,s,t,null,!1)||Ra(e.child,!1))}e=e.sibling}}function Yd(e,t){if(e.tag===30){var s=e.stateNode,l=e.memoizedProps,o=$a(l,s),u=qa(l.default,s.paired?l.share:l.enter);u!=="none"?Vl(e,o,u,null,!1)?(Go(e),s.paired||t||Jl(e,l.onEnter)):Ra(e.child,!1):Go(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Yd(e,t),e=e.sibling;else Go(e)}function Vd(e){if(_n!==null&&_n.size!==0){var t=_n;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 s=e.memoizedProps,l=s.name;if(l!=null&&l!=="auto"){var o=t.get(l);if(o!==void 0){var u=qa(s.default,s.share);if(u!=="none"&&(Vl(e,l,u,null,!1)?(u=e.stateNode,o.paired=u,u.paired=o,Jl(e,s.onShare)):Ra(e.child,!1)),t.delete(l),t.size===0)break}}}Vd(e)}e=e.sibling}}}function Xd(e){if(e.tag===30){var t=e.memoizedProps,s=$a(t,e.stateNode),l=_n!==null?_n.get(s):void 0,o=qa(t.default,l!==void 0?t.share:t.exit);o!=="none"&&(Vl(e,s,o,null,!1)?l!==void 0?(o=e.stateNode,l.paired=o,o.paired=l,_n.delete(s),Jl(e,t.onShare)):Jl(e,t.onExit):Ra(e.child,!1)),_n!==null&&Vd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Xd(e),e=e.sibling;else _n!==null&&Vd(e)}function Xx(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,s=$a(t,e.stateNode);t=qa(t.default,t.update),e.flags&=-5,t!=="none"&&Vl(e,s,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Xx(e);e=e.sibling}}function Kd(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,Ra(e.child,!1))}Kd(e)}e=e.sibling}}function Yo(e){if(e.tag===30)e.stateNode.paired=null,Ra(e.child,!1),Kd(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Yo(e),e=e.sibling;else Kd(e)}function Kx(e){for(e=e.child;e!==null;)e.tag===30?Ra(e.child,!1):(e.subtreeFlags&33554432)!==0&&Kx(e),e=e.sibling}function Zd(e,t,s,l,o,u,y){for(var N=!1;t!==null;){if(t.tag===5){var D=t.stateNode;if(u!==null&&kn<u.length){var G=u[kn],P=Cf(D);(G.view||P.view)&&(N=!0);var le;if(le=(e.flags&4)===0)if(P.clip)le=!0;else{le=G.rect;var U=P.rect;le=le.y!==U.y||le.x!==U.x||le.height!==U.height||le.width!==U.width}le&&(e.flags|=4),P.abs?P=!G.abs:(G=G.rect,P=P.rect,P=G.height!==P.height||G.width!==P.width),P&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Yg(D,kn===0?s:s+"_"+kn,o),N&&(e.flags&4)!==0||(Ea===null&&(Ea=[]),Ea.push(D,kn===0?l:l+"_"+kn,t.memoizedProps)),kn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&y?e.flags|=t.flags&32:Zd(e,t.child,s,l,o,u,y)&&(N=!0));t=t.sibling}return N}function Zx(e,t){for(e=e.child;e!==null;){if(e.tag===30){var s=e.memoizedProps,l=e.stateNode,o=$a(s,l),u=qa(s.default,s.update),y;y=e.memoizedState,e.memoizedState=null,l=e;var N=e.child;kn=0,o=Zd(l,N,o,o,u,y,!1),(e.flags&4)!==0&&o&&Jl(e,s.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Zx(e);e=e.sibling}}var Xt=!1,at=!1,za=!1,Qd=!1,Qx=typeof WeakSet=="function"?WeakSet:Set,Kt=null,Da=!1,er=!1,Vo=!1,Id=!1;function p1(e,t,s){if(e=e.containerInfo,jf=oi,e=Jm(e),_u(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var u=o.anchorOffset,y=o.focusNode;o=o.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var N=0,D=-1,G=-1,P=0,le=0,U=e,Q=null;t:for(;;){for(var pe;U!==l||u!==0&&U.nodeType!==3||(D=N+u),U!==y||o!==0&&U.nodeType!==3||(G=N+o),U.nodeType===3&&(N+=U.nodeValue.length),(pe=U.firstChild)!==null;)Q=U,U=pe;for(;;){if(U===e)break t;if(Q===l&&++P===u&&(D=N),Q===y&&++le===o&&(G=N),(pe=U.nextSibling)!==null)break;U=Q,Q=U.parentNode}U=pe}l=D===-1||G===-1?null:{start:D,end:G}}else l=null}l=l||{start:0,end:0}}else l=null;for(Nf={focusedElem:e,selectionRange:l},oi=!1,s=(s&335544064)===s,Kt=t,t=s?9270:1024;Kt!==null;){if(e=Kt,s&&(l=e.deletions,l!==null))for(u=0;u<l.length;u++)s&&Xd(l[u]);if(e.alternate===null&&(e.flags&2)!==0)s&&Gx(e),Xo(s);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&s&&Xd(l),Xo(s);continue}else if(l!==null&&l.memoizedState!==null){s&&Gx(e),Xo(s);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Kt=l):(s&&Xx(e),Xo(s))}}_n=null}function Xo(e){for(;Kt!==null;){var t=Kt,s=e,l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((o&1024)!==0&&l!==null){s=void 0,o=l.memoizedProps,l=l.memoizedState;var u=t.stateNode;try{var y=nl(t.type,o);s=u.getSnapshotBeforeUpdate(y,l),u.__reactInternalSnapshotBeforeUpdate=s}catch(N){lt(t,t.return,N)}}break;case 3:if((o&1024)!==0){if(l=t.stateNode.containerInfo,s=l.nodeType,s===9)Rf(l);else if(s===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Rf(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&l!==null&&(s=$a(l.memoizedProps,l.stateNode),o=t.memoizedProps,o=qa(o.default,o.update),o!=="none"&&Vl(l,s,o,l.memoizedState=[],!0));break;default:if((o&1024)!==0)throw Error(c(163))}if(l=t.sibling,l!==null){l.return=t.return,Kt=l;break}Kt=t.return}}function Ix(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Aa(e,s),l&4&&Ji(5,s);break;case 1:if(Aa(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(y){lt(s,s.return,y)}else{var o=nl(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){lt(s,s.return,y)}}l&64&&Ux(s),l&512&&Ta(s,s.return);break;case 3:if(Aa(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Cp(e,t)}catch(y){lt(s,s.return,y)}}break;case 27:t===null&&l&4&&qx(s);case 26:case 5:Aa(e,s),t===null&&l&4&&Bd(s),l&512&&Ta(s,s.return);break;case 12:Aa(e,s);break;case 31:Aa(e,s),l&4&&Wx(e,s);break;case 13:Aa(e,s),l&4&&eg(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=T1.bind(null,s),oN(e,s))));break;case 22:if(l=s.memoizedState!==null||Xt,!l){var u=t!==null&&t.memoizedState!==null||at;t=Xt,o=at,Xt=l,(at=u)&&!o?(l=2,(s.subtreeFlags&8772)!==0&&(l|=1),ua(e,s,l)):Aa(e,s),Xt=t,at=o}break;case 30:Aa(e,s),l&512&&Ta(s,s.return);break;case 7:l&512&&Ta(s,s.return);default:Aa(e,s)}}function Pd(e,t){for(e=e.child;e!==null;)Px(e,t),e=e.sibling}function Px(e,t){switch(e.tag){case 5:case 26:try{var s=e.stateNode;if(t){var l=s.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var o=e.stateNode,u=e.memoizedProps.style,y=u!=null&&u.hasOwnProperty("display")?u.display:null;o.style.display=y==null||typeof y=="boolean"?"":(""+y).trim()}}catch(D){lt(e,e.return,D)}Fd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Je=!0}catch(D){lt(e,e.return,D)}break;case 18:try{var N=e.stateNode;t?Gg(N,!0):Gg(e.stateNode,!1)}catch(D){lt(e,e.return,D)}break;case 22:case 23:e.memoizedState===null&&Pd(e,t);break;default:Pd(e,t)}}function Fd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var s=e,l=t;switch(s.tag){case 4:Px(s,l);break e;case 22:s.memoizedState===null&&Fd(s,l);break e;default:Fd(s,l)}}e=e.sibling}}function Fx(e){var t=e.alternate;t!==null&&(e.alternate=null,Fx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ir(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 pt=null,Cn=!1;function oa(e,t,s){for(s=s.child;s!==null;)Jx(e,t,s),s=s.sibling}function Jx(e,t,s){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(an,s)}catch{}switch(s.tag){case 26:at||en(s,t),oa(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!at&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:at||en(s,t),Wi(s);var l=pt,o=Cn;Ss(s.type)&&(pt=s.stateNode,Cn=!1),oa(e,t,s),ny(s.stateNode,s.type,s.memoizedProps),pt=l,Cn=o;break;case 5:at||en(s,t),Wi(s);case 6:if(s.tag===6&&Wi(s),l=pt,o=Cn,pt=null,oa(e,t,s),pt=l,Cn=o,pt!==null)if(Cn)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(s.stateNode),Je=!0}catch(u){lt(s,t,u)}else try{pt.removeChild(s.stateNode),Je=!0}catch(u){lt(s,t,u)}break;case 18:pt!==null&&(Cn?(e=pt,qg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),ci(e)):qg(pt,s.stateNode));break;case 4:l=pt,o=Cn,pt=s.stateNode.containerInfo,Cn=!0,oa(e,t,s),pt=l,Cn=o;break;case 0:case 11:case 14:case 15:gs(2,s,t),at||gs(4,s,t),oa(e,t,s);break;case 1:at||(en(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Hx(s,t,l)),oa(e,t,s);break;case 21:oa(e,t,s);break;case 22:at=(l=at)||s.memoizedState!==null,oa(e,t,s),at=l;break;case 30:en(s,t),oa(e,t,s);break;case 7:at||en(s,t),oa(e,t,s);break;default:oa(e,t,s)}}function Wx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ci(e)}catch(s){lt(t,t.return,s)}}}function eg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ci(e)}catch(s){lt(t,t.return,s)}}function x1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qx),t;default:throw Error(c(435,e.tag))}}function Ko(e,t){var s=x1(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var o=E1.bind(null,e,l);l.then(o,o)}})}function fn(e,t,s){var l=t.deletions;if(l!==null)for(var o=0;o<l.length;o++){var u=l[o],y=e,N=t,D=N;e:for(;D!==null;){switch(D.tag){case 27:if(Ss(D.type)){pt=D.stateNode,Cn=!1;break e}break;case 5:pt=D.stateNode,Cn=!1;break e;case 3:case 4:pt=D.stateNode.containerInfo,Cn=!0;break e}D=D.return}if(pt===null)throw Error(c(160));Jx(y,N,u),pt=null,Cn=!1,y=u.alternate,y!==null&&(y.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)tg(t,e,s),t=t.sibling}var ca=null;function tg(e,t,s){var l=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(o&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var u=0;u<l.length;u++){var y=l[u];y.ref.impl=y.nextImpl}fn(t,e,s),hn(e),o&4&&(gs(3,e,e.return),Ji(3,e),gs(5,e,e.return));break;case 1:fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),o&64&&Xt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?t:s.concat(t))));break;case 26:if(u=ca,fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),o&4)if(o=l!==null?l.memoizedState:null,s=e.memoizedState,l===null)if(s===null)if(e.stateNode===null)if(Xt)e.stateNode=Hg(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,s=e.memoizedProps,o=u.ownerDocument||u;t:switch(t){case"title":l=o.getElementsByTagName("title")[0],(!l||l[Ci]||l[Pt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=o.createElement(t),o.head.insertBefore(l,o.querySelector("head > title"))),tn(l,t,s),l[Pt]=e,Yt(l),t=l;break e;case"link":if(u=oy("link","href",o).get(t+(s.href||""))){for(y=0;y<u.length;y++)if(l=u[y],l.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&l.getAttribute("rel")===(s.rel==null?null:s.rel)&&l.getAttribute("title")===(s.title==null?null:s.title)&&l.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){u.splice(y,1);break t}}l=o.createElement(t),tn(l,t,s),o.head.appendChild(l);break;case"meta":if(u=oy("meta","content",o).get(t+(s.content||""))){for(y=0;y<u.length;y++)if(l=u[y],l.getAttribute("content")===(s.content==null?null:""+s.content)&&l.getAttribute("name")===(s.name==null?null:s.name)&&l.getAttribute("property")===(s.property==null?null:s.property)&&l.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&l.getAttribute("charset")===(s.charSet==null?null:s.charSet)){u.splice(y,1);break t}}l=o.createElement(t),tn(l,t,s),o.head.appendChild(l);break;default:throw Error(c(468,t))}l[Pt]=e,Yt(l),t=l}e.stateNode=t}else Xt||Lf(u,e.type,e.stateNode);else e.stateNode=ry(u,s,e.memoizedProps);else o!==s?(o===null?(t=l.stateNode,t===null||at||t.parentNode.removeChild(t)):o.count--,s===null?Xt||Lf(u,e.type,e.stateNode):ry(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&$d(e,e.memoizedProps,l.memoizedProps);break;case 27:fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),l!==null&&o&4&&$d(e,e.memoizedProps,l.memoizedProps);break;case 5:if(u=za,za=!1,fn(t,e,s),za=u,hn(e),o&512&&(at||l===null||en(l,l.return)),e.flags&32){t=e.stateNode;try{Cl(t,""),Je=!0}catch(P){lt(e,e.return,P)}}o&4&&e.stateNode!=null&&(t=e.memoizedProps,$d(e,t,l!==null?l.memoizedProps:t)),o&1024&&(Qd=!0);break;case 6:if(fn(t,e,s),hn(e),o&4){if(e.stateNode===null)throw Error(c(162));t=e.memoizedProps,s=e.stateNode;try{s.nodeValue=t,Je=!0}catch(P){lt(e,e.return,P)}}break;case 3:if(Je=!1,rc=null,u=ca,ca=cr(t.containerInfo),fn(t,e,s),ca=u,hn(e),o&4&&l!==null&&l.memoizedState.isDehydrated)try{ci(t.containerInfo)}catch(P){lt(e,e.return,P)}Qd&&(Qd=!1,ng(e)),Je=!1;break;case 4:o=za,za=Xt,l=Nm(),u=ca,ca=cr(e.stateNode.containerInfo),fn(t,e,s),hn(e),ca=u,Je&&er&&(Vo=!0),Je=l,za=o;break;case 12:fn(t,e,s),hn(e);break;case 31:fn(t,e,s),hn(e),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ko(e,t)));break;case 13:fn(t,e,s),hn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Io=Ze()),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ko(e,t)));break;case 22:u=e.memoizedState!==null,y=l!==null&&l.memoizedState!==null;var N=Xt,D=at,G=za;Xt=N||u,za=G||u,at=D||y,fn(t,e,s),at=D,za=G,Xt=N,hn(e),o&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||l===null||y||Xt||at||(t=y||at,s=Xt,l=at,Xt=u||Xt,at=t,ys(e,2),Xt=s,at=l),!u&&za||Pd(e,u)),o&4&&(t=e.updateQueue,t!==null&&(s=t.retryQueue,s!==null&&(t.retryQueue=null,Ko(e,s))));break;case 19:fn(t,e,s),hn(e),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ko(e,t)));break;case 30:o&512&&(at||l===null||en(l,l.return)),o=Nm(),u=er,y=(s&335544064)===s,N=e.memoizedProps,er=y&&qa(N.default,N.update)!=="none",fn(t,e,s),hn(e),y&&l!==null&&Je&&(e.flags|=4),er=u,Je=o;break;case 21:break;case 7:o&512&&(at||l===null||en(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:fn(t,e,s),hn(e)}}function hn(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if($x(l)){s=l;break}l=l.return}l=null;for(var o=e.return;o!==null;){if(Hd(o)){var u=o.stateNode;l===null?l=[u]:l.push(u)}if(Ud(o))break;o=o.return}var y=l;if(s==null)throw Error(c(160));switch(s.tag){case 27:var N=s.stateNode,D=qd(e);$o(e,D,N,y);break;case 5:var G=s.stateNode;s.flags&32&&(Cl(G,""),s.flags&=-33);var P=qd(e);$o(e,P,G,y);break;case 3:case 4:var le=s.stateNode.containerInfo,U=qd(e);Gd(e,U,le,y);break;default:throw Error(c(161))}}catch(Q){lt(e,e.return,Q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ng(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ng(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,oi=!0,t.reset(),oi=!1),e=e.sibling}}function Xl(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ag(t,e),t=t.sibling;else Zx(t)}function ag(e,t){var s=e.alternate;if(s===null)Yd(e,!1);else switch(e.tag){case 3:if(Id=Da=!1,Yx(),Xl(t,e),!Da&&!Vo){if(e=Ea,e!==null)for(var l=0;l<e.length;l+=3){s=e[l];var o=e[l+1];Vg(s,e[l+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+o+")"})}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"})),Id=!0}Ea=null;break;case 5:Xl(t,e);break;case 4:l=Da,Da=!1,Xl(t,e),Da&&(Vo=!0),Da=l;break;case 22:e.memoizedState===null&&(s.memoizedState!==null?Yd(e,!1):Xl(t,e));break;case 30:l=Da,o=Yx(),Da=!1,Xl(t,e),Da&&(e.flags|=4);var u=e.memoizedProps,y=e.stateNode;t=$a(u,y),y=$a(s.memoizedProps,y);var N=qa(u.default,u.update);N==="none"?t=!1:(u=s.memoizedState,s.memoizedState=null,s=e.child,kn=0,t=Zd(e,s,t,y,N,u,!0),kn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Jl(e,e.memoizedProps.onUpdate),Ea=o):o!==null&&(o.push.apply(o,Ea),Ea=o),Da=(e.flags&32)!==0?!0:l;break;default:Xl(t,e)}}function Aa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ix(e,t.alternate,t),t=t.sibling}function ys(e,t){for(e=e.child;e!==null;){var s=e,l=t;switch(s.tag){case 0:case 11:case 14:case 15:gs(4,s,s.return),ys(s,l);break;case 1:en(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&Hx(s,s.return,o),ys(s,l);break;case 27:(l&2)!==0&&ny(s.stateNode,s.type,s.memoizedProps);case 5:en(s,s.return),s.tag!==5&&s.tag!==27||Wi(s),ys(s,l);break;case 6:Wi(s);break;case 26:en(s,s.return),o=s.stateNode,s.memoizedState!==null||o===null||at||o.parentNode.removeChild(o),ys(s,l);break;case 22:s.memoizedState===null&&ys(s,l);break;case 30:en(s,s.return),ys(s,l);break;case 7:en(s,s.return);default:ys(s,l)}e=e.sibling}}function ua(e,t,s){for(s=(t.subtreeFlags&8772)!==0?s:s&-2,t=t.child;t!==null;){var l=t.alternate,o=e,u=t,y=u.flags,N=(s&1)!==0;switch(u.tag){case 0:case 11:case 15:ua(o,u,s),Ji(4,u);break;case 1:if(ua(o,u,s),l=u,o=l.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(P){lt(l,l.return,P)}if(l=u,o=l.updateQueue,o!==null){var D=l.stateNode;try{var G=o.shared.hiddenCallbacks;if(G!==null)for(o.shared.hiddenCallbacks=null,o=0;o<G.length;o++)kp(G[o],D)}catch(P){lt(l,l.return,P)}}N&&y&64&&Ux(u),Ta(u,u.return);break;case 27:(s&2)!==0&&qx(u);case 5:u.tag!==5&&u.tag!==27||Bx(u),ua(o,u,s),N&&l===null&&y&4&&Bd(u),Ta(u,u.return);break;case 6:Bx(u);break;case 26:D=u.stateNode,u.memoizedState!==null||D===null||Xt||Lf(cr(D.ownerDocument),u.type,D),ua(o,u,s),N&&l===null&&y&4&&Bd(u),Ta(u,u.return);break;case 12:ua(o,u,s);break;case 31:ua(o,u,s),N&&y&4&&Wx(o,u);break;case 13:ua(o,u,s),N&&y&4&&eg(o,u);break;case 22:u.memoizedState===null&&ua(o,u,s),Ta(u,u.return);break;case 30:ua(o,u,s),Ta(u,u.return);break;case 7:Ta(u,u.return);default:ua(o,u,s)}t=t.sibling}}function Jd(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Bi(s))}function Wd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bi(e))}function In(e,t,s,l){var o=(s&335544064)===s;if(t.subtreeFlags&(o?10262:10256))for(t=t.child;t!==null;)sg(e,t,s,l),t=t.sibling;else o&&Kx(t)}function sg(e,t,s,l){var o=(s&335544064)===s;o&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yo(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:In(e,t,s,l),u&2048&&Ji(9,t);break;case 1:In(e,t,s,l);break;case 3:In(e,t,s,l),o&&Id&&(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="")),u&2048&&(u=null,t.alternate!==null&&(u=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==u&&(t.refCount++,u!=null&&Bi(u)));break;case 12:if(u&2048){In(e,t,s,l),u=t.stateNode;try{var y=t.memoizedProps,N=y.id,D=y.onPostCommit;typeof D=="function"&&D(N,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(G){lt(t,t.return,G)}}else In(e,t,s,l);break;case 31:In(e,t,s,l);break;case 13:In(e,t,s,l);break;case 23:break;case 22:y=t.stateNode,N=t.alternate,t.memoizedState!==null?(o&&N!==null&&N.memoizedState===null&&Yo(N),y._visibility&2?In(e,t,s,l):tr(e,t)):(o&&N!==null&&N.memoizedState!==null&&Yo(t),y._visibility&2?In(e,t,s,l):(y._visibility|=2,Kl(e,t,s,l,(t.subtreeFlags&10256)!==0||!1))),u&2048&&Jd(N,t);break;case 24:In(e,t,s,l),u&2048&&Wd(t.alternate,t);break;case 30:o&&(u=t.alternate,u!==null&&(Ra(u.child,!0),Ra(t.child,!0))),In(e,t,s,l);break;default:In(e,t,s,l)}}function Kl(e,t,s,l,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,y=t,N=s,D=l,G=y.flags;switch(y.tag){case 0:case 11:case 15:Kl(u,y,N,D,o),Ji(8,y);break;case 23:break;case 22:var P=y.stateNode;y.memoizedState!==null?P._visibility&2?Kl(u,y,N,D,o):tr(u,y):(P._visibility|=2,Kl(u,y,N,D,o)),o&&G&2048&&Jd(y.alternate,y);break;case 24:Kl(u,y,N,D,o),o&&G&2048&&Wd(y.alternate,y);break;default:Kl(u,y,N,D,o)}t=t.sibling}}function tr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,o=l.flags;switch(l.tag){case 22:tr(s,l),o&2048&&Jd(l.alternate,l);break;case 24:tr(s,l),o&2048&&Wd(l.alternate,l);break;default:tr(s,l)}t=t.sibling}}var al=8192;function sl(e,t,s){if(e.subtreeFlags&al)for(e=e.child;e!==null;)lg(e,t,s),e=e.sibling}function lg(e,t,s){switch(e.tag){case 26:sl(e,t,s),e.flags&al&&(e.memoizedState!==null?NN(s,ca,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&fy(s,e)));break;case 5:sl(e,t,s),e.flags&al&&(e=e.stateNode,(t&335544128)===t&&fy(s,e));break;case 3:case 4:var l=ca;ca=cr(e.stateNode.containerInfo),sl(e,t,s),ca=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=al,al=16777216,sl(e,t,s),al=l):sl(e,t,s));break;case 30:if((e.flags&al)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var o=e.stateNode;o.paired=null,_n===null&&(_n=new Map),_n.set(l,o)}sl(e,t,s);break;default:sl(e,t,s)}}function ig(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 nr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Kt=l,og(l,e)}ig(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)rg(e),e=e.sibling}function rg(e){switch(e.tag){case 0:case 11:case 15:nr(e),e.flags&2048&&gs(9,e,e.return);break;case 3:nr(e);break;case 12:nr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zo(e)):nr(e);break;default:nr(e)}}function Zo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Kt=l,og(l,e)}ig(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gs(8,t,t.return),Zo(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Zo(t));break;default:Zo(t)}e=e.sibling}}function og(e,t){for(;Kt!==null;){var s=Kt;switch(s.tag){case 0:case 11:case 15:gs(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Bi(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Kt=l;else e:for(s=e;Kt!==null;){l=Kt;var o=l.sibling,u=l.return;if(Fx(l),l===s){Kt=null;break e}if(o!==null){o.return=u,Kt=o;break e}Kt=u}}}var g1={getCacheForType:function(e){var t=Ft(Ot),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ft(Ot).controller.signal}},y1=typeof WeakMap=="function"?WeakMap:Map,We=0,dt=null,$e=null,Ge=0,st=0,Ln=null,vs=!1,Zl=!1,ef=!1,Pa=0,St=0,bs=0,ll=0,Qo=0,Un=0,Ql=0,ar=null,Tn=null,tf=!1,Io=0,cg=0,Po=1/0,Fo=null,js=null,gt=0,da=null,il=null,Oa=0,nf=0,af=null,ug=null,Il=null,Pl=null,Fl=null,sr=0,Jo=null;function Hn(){return(We&2)!==0&&Ge!==0?Ge&-Ge:me.T!==null?mf():hm()}function dg(){if(Un===0)if((Ge&536870912)===0||Be){var e=Dn;Dn<<=1,(Dn&3932160)===0&&(Dn=262144),Un=e}else Un=536870912;return e=Jt.current,e!==null&&(e.flags|=32),Un}function Jl(e,t){if(t!=null){var s=e.stateNode,l=s.ref;l===null&&(l=s.ref=Xg($a(e.memoizedProps,s))),Pl===null&&(Pl=[]),Pl.push(t.bind(null,l))}}function En(e,t,s){(e===dt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(Wl(e,0),Ns(e,Ge,Un,!1)),ki(e,s),((We&2)===0||e!==dt)&&(e===dt&&((We&2)===0&&(ll|=s),St===4&&Ns(e,Ge,Un,!1)),Ma(e))}function fg(e,t,s){if((We&6)!==0)throw Error(c(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Si(e,t),o=l?j1(e,t):lf(e,t,!0),u=l;do{if(o===0){Zl&&!l&&Ns(e,t,0,!1);break}else{if(s=e.current.alternate,u&&!v1(s)){o=lf(e,t,!1),u=!1;continue}if(o===2){if(u=t,e.errorRecoveryDisabledLanes&u)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var N=e;o=ar;var D=N.current.memoizedState.isDehydrated;if(D&&(Wl(N,y).flags|=256),y=lf(N,y,!1),y!==2&&y!==6){if(ef&&!D){N.errorRecoveryDisabledLanes|=u,ll|=u,o=4;break e}u=Tn,Tn=o,u!==null&&(Tn===null?Tn=u:Tn.push.apply(Tn,u))}o=y}if(u=!1,o!==2)continue}}if(o===1){Wl(e,0),Ns(e,t,0,!0);break}e:{switch(l=e,u=o,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ns(l,t,Un,!vs);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Io+300-Ze(),10<o)){if(Ns(l,t,Un,!vs),Zr(l,0,!0)!==0)break e;Oa=t,l.timeoutHandle=kf(hg.bind(null,l,s,Tn,Fo,tf,t,Un,ll,Ql,vs,u,"Throttled",-0,0),o);break e}hg(l,s,Tn,Fo,tf,t,Un,ll,Ql,vs,u,null,-0,0)}}break}while(!0);Ma(e)}function hg(e,t,s,l,o,u,y,N,D,G,P,le,U,Q){e.timeoutHandle=-1;var pe=t.subtreeFlags,Ce=(u&335544064)===u;if(le=null,(Ce||pe&8192||(pe&16785408)===16785408)&&(le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sa},_n=null,lg(t,u,le),Ce&&(pe=le,Ce=e.containerInfo,Ce=(Ce.nodeType===9?Ce:Ce.ownerDocument).__reactViewTransition,Ce!=null&&(pe.count++,pe.waitingForViewTransition=!0,pe=fr.bind(pe),Ce.finished.then(pe,pe))),pe=(u&62914560)===u?Io-Ze():(u&4194048)===u?cg-Ze():0,pe=wN(le,pe),pe!==null)){Oa=u,e.cancelPendingCommit=pe(jg.bind(null,e,t,u,s,l,o,y,N,D,G,P,le,null,U,Q)),Ns(e,u,y,!G);return}jg(e,t,u,s,l,o,y,N,D,G,P,le)}function v1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var o=s[l],u=o.getSnapshot;o=o.value;try{if(!On(u(),o))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Ns(e,t,s,l){t=om(e,t),t&=~Qo,t&=~ll,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var o=t;0<o;){var u=31-Nt(o),y=1<<u;l[u]=-1,o&=~y}s!==0&&um(e,s,t)}function Wo(){return(We&6)===0?(lr(0),!1):!0}function sf(){if($e!==null){if(st===0)var e=$e.return;else e=$e,Va=Zs=null,fd(e),Bl=null,Gi=0,e=$e;for(;e!==null;)Lx(e.alternate,e),e=e.return;$e=null}}function Wl(e,t){var s=e.timeoutHandle;return s!==-1&&(e.timeoutHandle=-1,Y1(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Oa=0,sf(),dt=e,$e=s=Ga(e.current,null),Ge=t,st=0,Ln=null,vs=!1,Zl=Si(e,t),ef=!1,Ql=Un=Qo=ll=bs=St=0,Tn=ar=null,tf=!1,Pa=om(e,t),io(),s}function mg(e,t){_e=null,me.H=Ao,t===Hl||t===yo?(t=jp(),st=3):t===Wu?(t=jp(),st=4):st=t===Td?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ln=t,$e===null&&(St=1,Oo(e,Xn(t,e.current)))}function pg(){var e=Jt.current;return e===null?!0:(Ge&4194048)===Ge?sn===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?e===sn:!1}function xg(){var e=me.H;return me.H=Ao,e===null?Ao:e}function gg(){var e=me.A;return me.A=g1,e}function ec(){St=4,vs||(Ge&4194048)!==Ge&&Jt.current!==null||(Zl=!0),(bs&134217727)===0&&(ll&134217727)===0||dt===null||Ns(dt,Ge,Un,!1)}function lf(e,t,s){var l=We;We|=2;var o=xg(),u=gg();(dt!==e||Ge!==t)&&(Fo=null,Wl(e,t)),t=!1;var y=St;e:do try{if(st!==0&&$e!==null){var N=$e,D=Ln;switch(st){case 8:sf(),y=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var G=st;if(st=0,Ln=null,ei(e,N,D,G),s&&Zl){y=0;break e}break;default:G=st,st=0,Ln=null,ei(e,N,D,G)}}b1(),y=St;break}catch(P){mg(e,P)}while(!0);return t&&e.shellSuspendCounter++,Va=Zs=null,We=l,me.H=o,me.A=u,$e===null&&(dt=null,Ge=0,io()),y}function b1(){for(;$e!==null;)yg($e)}function j1(e,t){var s=We;We|=2;var l=xg(),o=gg();dt!==e||Ge!==t?(Fo=null,Po=Ze()+500,Wl(e,t)):Zl=Si(e,t);e:do try{if(st!==0&&$e!==null){t=$e;var u=Ln;t:switch(st){case 1:st=0,Ln=null,ei(e,t,u,1);break;case 2:case 9:if(vp(u)){st=0,Ln=null,vg(t);break}t=function(){st!==2&&st!==9||dt!==e||(st=7),Ma(e)},u.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:vp(u)?(st=0,Ln=null,vg(t)):(st=0,Ln=null,ei(e,t,u,7));break;case 5:var y=null;switch($e.tag){case 26:y=$e.memoizedState;case 5:case 27:var N=$e;if(y?uy(y):N.stateNode.complete){st=0,Ln=null;var D=N.sibling;if(D!==null)$e=D;else{var G=N.return;G!==null?($e=G,tc(G)):$e=null}break t}}st=0,Ln=null,ei(e,t,u,5);break;case 6:st=0,Ln=null,ei(e,t,u,6);break;case 8:sf(),St=6;break e;default:throw Error(c(462))}}N1();break}catch(P){mg(e,P)}while(!0);return Va=Zs=null,me.H=l,me.A=o,We=s,$e!==null?0:(dt=null,Ge=0,io(),St)}function N1(){for(;$e!==null&&!Rt();)yg($e)}function yg(e){var t=Mx(e.alternate,e,Pa);e.memoizedProps=e.pendingProps,t===null?tc(e):$e=t}function vg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Tx(s,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=Tx(s,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:fd(t);var l=t;l===Vt&&(Be?(ho(l),l.tag===5&&l.stateNode!=null&&(ht=l.stateNode)):(ho(l),Be=!0));default:Lx(s,t),t=$e=op(t,Pa),t=Mx(s,t,Pa)}e.memoizedProps=e.pendingProps,t===null?tc(e):$e=t}function ei(e,t,s,l){Va=Zs=null,fd(t),Bl=null,Gi=0;var o=t.return;try{if(c1(e,o,t,s,Ge)){St=1,Oo(e,Xn(s,e.current)),$e=null;return}}catch(u){if(o!==null)throw $e=o,u;St=1,Oo(e,Xn(s,e.current)),$e=null;return}t.flags&32768?(Be||l===1?e=!0:Zl||(Ge&536870912)!==0?e=!1:(vs=e=!0,(l===2||l===9||l===3||l===6)&&(l=Jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),bg(t,e)):tc(t)}function tc(e){var t=e;do{if((t.flags&32768)!==0){bg(t,vs);return}e=t.return;var s=h1(t.alternate,t,Pa);if(s!==null){$e=s;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);St===0&&(St=5)}function bg(e,t){do{var s=m1(e.alternate,e);if(s!==null){s.flags&=32767,$e=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=s}while(e!==null);St=6,$e=null}function jg(e,t,s,l,o,u,y,N,D,G,P,le){e.cancelPendingCommit=null;do nc();while(gt!==0);if((We&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));e===dt&&($e=dt=null,Ge=0),il=t,da=e,Oa=s,af=o,ug=l,w1(e,t,s,y,N,D,le)}}function w1(e,t,s,l,o,u,y){var N=t.lanes|t.childLanes;if(nf=N,N|=$u,I0(e,s,N,l,o,u),Pl=null,(s&335544064)===s?(Fl=Fj(e),l=10262):(Fl=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,R1(Gt,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),qo=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null,o=ie.p,ie.p=2,u=We,We|=4;try{p1(e,t,s)}finally{We=u,ie.p=o,me.T=l}}gt=1,qo?Il=I1(y,e.containerInfo,Fl,rf,of,k1,cf,uf,S1):(rf(),of(),cf())}function S1(e){if(gt!==0){var t=da.onRecoverableError;t(e,{componentStack:null})}}function k1(){gt===3&&(gt=0,ag(il,da),gt=4)}function rf(){if(gt===1){gt=0;var e=da,t=il,s=Oa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null;var o=ie.p;ie.p=2;var u=We;We|=4;try{er=Vo=!1,tg(t,e,s),s=Nf;var y=Jm(e.containerInfo),N=s.focusedElem,D=s.selectionRange;if(y!==N&&N&&N.ownerDocument&&Fm(N.ownerDocument.documentElement,N)){if(D!==null&&_u(N)){var G=D.start,P=D.end;if(P===void 0&&(P=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(P,N.value.length);else{var le=N.ownerDocument||document,U=le&&le.defaultView||window;if(U.getSelection){var Q=U.getSelection(),pe=N.textContent.length,Ce=Math.min(D.start,pe),Le=D.end===void 0?Ce:Math.min(D.end,pe);!Q.extend&&Ce>Le&&(y=Le,Le=Ce,Ce=y);var $=Pm(N,Ce),_=Pm(N,Le);if($&&_&&(Q.rangeCount!==1||Q.anchorNode!==$.node||Q.anchorOffset!==$.offset||Q.focusNode!==_.node||Q.focusOffset!==_.offset)){var X=le.createRange();X.setStart($.node,$.offset),Q.removeAllRanges(),Ce>Le?(Q.addRange(X),Q.extend(_.node,_.offset)):(X.setEnd(_.node,_.offset),Q.addRange(X))}}}}for(le=[],Q=N;Q=Q.parentNode;)Q.nodeType===1&&le.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<le.length;N++){var ae=le[N];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}oi=!!jf,Nf=jf=null}finally{We=u,ie.p=o,me.T=l}}e.current=t,gt=2}}function of(){if(gt===2){gt=0;var e=da,t=il,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=me.T,me.T=null;var l=ie.p;ie.p=2;var o=We;We|=4;try{Ix(e,t.alternate,t)}finally{We=o,ie.p=l,me.T=s}}gt=3}}function cf(){if(gt===4||gt===3){gt=0;var e=Il;Il=null,jt();var t=da,s=il,l=Oa,o=ug,u=(l&335544064)===l?10262:10256;if((s.subtreeFlags&u)!==0||(s.flags&u)!==0?gt=5:(gt=0,il=da=null,Ng(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(js=null),gu(l),s=s.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(an,s,void 0,(s.current.flags&128)===128)}catch{}if(o!==null){s=me.T,u=ie.p,ie.p=2,me.T=null;try{for(var y=t.onRecoverableError,N=0;N<o.length;N++){var D=o[N];y(D.value,{componentStack:D.stack})}}finally{me.T=s,ie.p=u}}if(o=Pl,y=Fl,Fl=null,o!==null&&(Pl=null,y===null&&(y=[]),e!==null))for(D=0;D<o.length;D++)s=(0,o[D])(y),s!==void 0&&e.finished.finally(s);(Oa&3)!==0&&nc(),Ma(t),u=t.pendingLanes,(l&261930)!==0&&(u&42)!==0?t===Jo?sr++:(sr=0,Jo=t):(sr=0,Jo=null),lr(0)}}function Ng(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Bi(t)))}function nc(){return Il!==null&&(Il.skipTransition(),Il=null),rf(),of(),cf(),uf()}function uf(){if(gt!==5)return!1;var e=da,t=nf;nf=0;var s=gu(Oa),l=me.T,o=ie.p;try{ie.p=32>s?32:s,me.T=null,s=af,af=null;var u=da,y=Oa;if(gt=0,il=da=null,Oa=0,(We&6)!==0)throw Error(c(331));var N=We;if(We|=4,rg(u.current),sg(u,u.current,y,s),We=N,lr(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(an,u)}catch{}return!0}finally{ie.p=o,me.T=l,Ng(e,t)}}function wg(e,t,s){t=Xn(s,t),t=Cd(e.stateNode,t,2),e=hs(e,t,2),e!==null&&(ki(e,2),Ma(e))}function lt(e,t,s){if(e.tag===3)wg(e,e,s);else for(;t!==null;){if(t.tag===3){wg(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(js===null||!js.has(l))){e=Xn(s,e),s=vx(2),l=hs(t,s,2),l!==null&&(bx(s,l,t,e),ki(l,2),Ma(l));break}}t=t.return}}function df(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new y1;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(s)||(ef=!0,o.add(s),e=C1.bind(null,e,t,s),t.then(e,e))}function C1(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,dt===e&&(Ge&s)===s&&((St===4||St===3&&(Ge&62914560)===Ge&&300>Ze()-Io)&&(We&2)===0?Wl(e,0):Qo|=s,Ql===Ge&&(Ql=0)),Ma(e)}function Sg(e,t){t===0&&(t=cm()),e=Vs(e,t),e!==null&&(ki(e,t),Ma(e))}function T1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Sg(e,s)}function E1(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(s=o.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),Sg(e,s)}function R1(e,t){return Te(e,t)}var ti=null,ni=null,ff=!1,ac=!1,hf=!1,ws=0;function Ma(e){e!==ni&&e.next===null&&(ni===null?ti=ni=e:ni=ni.next=e),ac=!0,ff||(ff=!0,D1())}function lr(e,t){if(!hf&&ac){hf=!0;do for(var s=!1,l=ti;l!==null;){if(e!==0){var o=l.pendingLanes;if(o===0)var u=0;else{var y=l.suspendedLanes,N=l.pingedLanes;u=(1<<31-Nt(42|e)+1)-1,u&=o&~(y&~N),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(s=!0,Eg(l,u))}else u=Ge,u=Zr(l,l===dt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Si(l,u)||(s=!0,Eg(l,u));l=l.next}while(s);hf=!1}}function z1(){kg()}function kg(){ac=ff=!1;var e=0;ws!==0&&G1()&&(e=ws);for(var t=Ze(),s=null,l=ti;l!==null;){var o=l.next,u=Cg(l,t);u===0?(l.next=null,s===null?ti=o:s.next=o,o===null&&(ni=s)):(s=l,(e!==0||(u&3)!==0)&&(ac=!0)),l=o}gt!==0&&gt!==5||lr(e),ws!==0&&(ws=0)}function Cg(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var y=31-Nt(u),N=1<<y,D=o[y];D===-1?((N&s)===0||(N&l)!==0)&&(o[y]=Q0(N,t)):D<=t&&(e.expiredLanes|=N),u&=~N}if(t=dt,s=Ge,s=Zr(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ut(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Si(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&ut(l),gu(s)){case 2:case 8:s=Ut;break;case 32:s=Gt;break;case 268435456:s=sa;break;default:s=Gt}return l=Tg.bind(null,e),s=Te(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&ut(l),e.callbackPriority=2,e.callbackNode=null,2}function Tg(e,t){if(gt!==0&&gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(nc()&&e.callbackNode!==s)return null;var l=Ge;return l=Zr(e,e===dt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(fg(e,l,t),Cg(e,Ze()),e.callbackNode!=null&&e.callbackNode===s?Tg.bind(null,e):null)}function Eg(e,t){if(nc())return null;fg(e,t,!0)}function D1(){V1(function(){(We&6)!==0?Te(Kr,z1):kg()})}function mf(){if(ws===0){var e=Ps;e===0&&(e=Na,Na<<=1,(Na&261888)===0&&(Na=256)),ws=e}return ws}function Rg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jr(e)}function A1(e,t,s,l,o){if(t==="submit"&&s&&s.stateNode===o){var u=Rg((o[wn]||null).action),y=l.submitter;y&&(t=(t=y[wn]||null)?Rg(t.formAction):y.getAttribute("formAction"),t!==null&&(u=t,y=null));var N=new no("action","action",null,l,o);e.push({event:N,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ws!==0){var D=new FormData(o,y);jd(s,{pending:!0,data:D,method:o.method,action:u},null,D)}}else typeof u=="function"&&(N.preventDefault(),D=new FormData(o,y),jd(s,{pending:!0,data:D,method:o.method,action:u},u,D))},currentTarget:o}]})}}for(var pf=0;pf<Bu.length;pf++){var xf=Bu[pf],O1=xf.toLowerCase(),M1=xf[0].toUpperCase()+xf.slice(1);ra(O1,"on"+M1)}ra(tp,"onAnimationEnd"),ra(np,"onAnimationIteration"),ra(ap,"onAnimationStart"),ra("dblclick","onDoubleClick"),ra("focusin","onFocus"),ra("focusout","onBlur"),ra(Yj,"onTransitionRun"),ra(Vj,"onTransitionStart"),ra(Xj,"onTransitionCancel"),ra(sp,"onTransitionEnd"),Sl("onMouseEnter",["mouseout","mouseover"]),Sl("onMouseLeave",["mouseout","mouseover"]),Sl("onPointerEnter",["pointerout","pointerover"]),Sl("onPointerLeave",["pointerout","pointerover"]),qs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qs("onBeforeInput",["compositionend","keypress","textInput","paste"]),qs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ir="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(" "),_1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function zg(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],o=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var y=l.length-1;0<=y;y--){var N=l[y],D=N.instance,G=N.currentTarget;if(N=N.listener,D!==u&&o.isPropagationStopped())break e;u=N,o.currentTarget=G;try{u(o)}catch(P){lo(P)}o.currentTarget=null,u=D}else for(y=0;y<l.length;y++){if(N=l[y],D=N.instance,G=N.currentTarget,N=N.listener,D!==u&&o.isPropagationStopped())break e;u=N,o.currentTarget=G;try{u(o)}catch(P){lo(P)}o.currentTarget=null,u=D}}}}function qe(e,t){var s=t[pm];s===void 0&&(s=t[pm]=new Set);var l=e+"__bubble";s.has(l)||(Dg(t,e,2,!1),s.add(l))}function gf(e,t,s){var l=0;t&&(l|=4),Dg(s,e,l,t)}var sc="_reactListening"+Math.random().toString(36).slice(2);function yf(e){if(!e[sc]){e[sc]=!0,ym.forEach(function(s){s!=="selectionchange"&&(_1.has(s)||gf(s,!1,e),gf(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sc]||(t[sc]=!0,gf("selectionchange",!1,t))}}function Dg(e,t,s,l){switch(by(t)){case 2:var o=TN;break;case 8:o=EN;break;default:o=Hf}s=o.bind(null,t,s,e),o=void 0,!ku||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?o!==void 0?e.addEventListener(t,s,{capture:!0,passive:o}):e.addEventListener(t,s,!0):o!==void 0?e.addEventListener(t,s,{passive:o}):e.addEventListener(t,s,!1)}function vf(e,t,s,l,o){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var N=l.stateNode.containerInfo;if(N===o)break;if(y===4)for(y=l.return;y!==null;){var D=y.tag;if((D===3||D===4)&&y.stateNode.containerInfo===o)return;y=y.return}for(;N!==null;){if(y=$s(N),y===null)return;if(D=y.tag,D===5||D===6||D===26||D===27){l=u=y;continue e}N=N.parentNode}}l=l.return}Dm(function(){var G=u,P=wu(s),le=[];e:{var U=lp.get(e);if(U!==void 0){var Q=no,pe=e;switch(e){case"keypress":if(eo(s)===0)break e;case"keydown":case"keyup":Q=vj;break;case"focusin":pe="focus",Q=Ru;break;case"focusout":pe="blur",Q=Ru;break;case"beforeblur":case"afterblur":Q=Ru;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Mm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=rj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Sj;break;case tp:case np:case ap:Q=uj;break;case sp:Q=Cj;break;case"scroll":case"scrollend":Q=lj;break;case"wheel":Q=Ej;break;case"copy":case"cut":case"paste":Q=fj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Lm;break;case"submit":Q=Nj;break;case"toggle":case"beforetoggle":Q=zj}var Ce=(t&4)!==0,Le=!Ce&&(e==="scroll"||e==="scrollend"),$=Ce?U!==null?U+"Capture":null:U;Ce=[];for(var _=G,X;_!==null;){var ae=_;if(X=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||X===null||$===null||(ae=Ei(_,$),ae!=null&&Ce.push(rr(_,ae,X))),Le)break;_=_.return}0<Ce.length&&(U=new Q(U,pe,null,s,P),le.push({event:U,listeners:Ce}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",Q&&s!==Nu&&(pe=s.relatedTarget||s.fromElement)&&($s(pe)||pe[jl]))break e;(U||Q)&&(pe=P.window===P?P:(Q=P.ownerDocument)?Q.defaultView||Q.parentWindow:window,U?(Q=s.relatedTarget||s.toElement,U=G,Q=Q?$s(Q):null,Q!==null&&(Le=f(Q),Ce=Q.tag,Q!==Le||Ce!==5&&Ce!==27&&Ce!==6)&&(Q=null)):(U=null,Q=G),U!==Q&&(Ce=Mm,ae="onMouseLeave",$="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Lm,ae="onPointerLeave",$="onPointerEnter",_="pointer"),Le=U==null?pe:Ti(U),X=Q==null?pe:Ti(Q),pe=new Ce(ae,_+"leave",U,s,P),pe.target=Le,pe.relatedTarget=X,ae=null,$s(P)===G&&(Ce=new Ce($,_+"enter",Q,s,P),Ce.target=X,Ce.relatedTarget=Le,ae=Ce),Le=ae,Ce=U&&Q?Y(U,Q,L1):null,U!==null&&Ag(le,pe,U,Ce,!1),Q!==null&&Le!==null&&Ag(le,Le,Q,Ce,!0)))}e:{if(U=G?Ti(G):window,Q=U.nodeName&&U.nodeName.toLowerCase(),Q==="select"||Q==="input"&&U.type==="file")var Se=Vm;else if(Gm(U))if(Xm)Se=$j;else{Se=Hj;var Ye=Uj}else Q=U.nodeName,!Q||Q.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?G&&ju(G.elementType)&&(Se=Vm):Se=Bj;if(Se&&(Se=Se(e,G))){Ym(le,Se,s,P);break e}Ye&&Ye(e,U,G)}switch(Ye=G?Ti(G):window,e){case"focusin":(Gm(Ye)||Ye.contentEditable==="true")&&(zl=Ye,Lu=G,Li=null);break;case"focusout":Li=Lu=zl=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,Wm(le,s,P);break;case"selectionchange":if(Gj)break;case"keydown":case"keyup":Wm(le,s,P)}var ze;if(Du)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Rl?$m(e,s)&&(Ae="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ae="onCompositionStart");Ae&&(Um&&s.locale!=="ko"&&(Rl||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Rl&&(ze=Am()):(ss=P,Cu="value"in ss?ss.value:ss.textContent,Rl=!0)),Ye=lc(G,Ae),0<Ye.length&&(Ae=new _m(Ae,e,null,s,P),le.push({event:Ae,listeners:Ye}),ze?Ae.data=ze:(ze=qm(s),ze!==null&&(Ae.data=ze)))),(ze=Aj?Oj(e,s):Mj(e,s))&&(Ae=lc(G,"onBeforeInput"),0<Ae.length&&(Ye=new _m("onBeforeInput","beforeinput",null,s,P),le.push({event:Ye,listeners:Ae}),Ye.data=ze)),A1(le,e,G,s,P)}zg(le,t)})}function rr(e,t,s){return{instance:e,listener:t,currentTarget:s}}function lc(e,t){for(var s=t+"Capture",l=[];e!==null;){var o=e,u=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||u===null||(o=Ei(e,s),o!=null&&l.unshift(rr(e,o,u)),o=Ei(e,t),o!=null&&l.push(rr(e,o,u))),e.tag===3)return l;e=e.return}return[]}function L1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ag(e,t,s,l,o){for(var u=t._reactName,y=[];s!==null&&s!==l;){var N=s,D=N.alternate,G=N.stateNode;if(N=N.tag,D!==null&&D===l)break;N!==5&&N!==26&&N!==27||G===null||(D=G,o?(G=Ei(s,u),G!=null&&y.unshift(rr(s,G,D))):o||(G=Ei(s,u),G!=null&&y.push(rr(s,G,D)))),s=s.return}y.length!==0&&e.push({event:t,listeners:y})}var U1=/\r\n?/g,H1=/\u0000|\uFFFD/g;function Og(e){return(typeof e=="string"?e:""+e).replace(U1,`
49
- `).replace(H1,"")}function Mg(e,t){return t=Og(t),Og(e)===t}function it(e,t,s,l,o,u){switch(s){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Cl(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Cl(e,""+l);else return;break;case"className":Fr(e,"class",l);break;case"tabIndex":Fr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Fr(e,s,l);break;case"style":Rm(e,l,u);return;case"data":if(t!=="object"){Fr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Jr(l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(s==="formAction"?(t!=="input"&&it(e,t,"name",o.name,o,null),it(e,t,"formEncType",o.formEncType,o,null),it(e,t,"formMethod",o.formMethod,o,null),it(e,t,"formTarget",o.formTarget,o,null)):(it(e,t,"encType",o.encType,o,null),it(e,t,"method",o.method,o,null),it(e,t,"target",o.target,o,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Jr(l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=Sa);return;case"onScroll":l!=null&&qe("scroll",e);return;case"onScrollEnd":l!=null&&qe("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(s=l.__html,s!=null){if(o.children!=null)throw Error(c(60));u?.__html!==s&&(e.innerHTML=s)}}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}s=Jr(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);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(s,l):e.removeAttribute(s);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(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":qe("beforetoggle",e),qe("toggle",e),Pr(e,"popover",l);break;case"xlinkActuate":Ha(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ha(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ha(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ha(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ha(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ha(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Pr(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=aj.get(s)||s,Pr(e,s,l);else return}Je=!0}function bf(e,t,s,l,o,u){switch(s){case"style":Rm(e,l,u);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(s=l.__html,s!=null){if(o.children!=null)throw Error(c(60));u?.__html!==s&&(e.innerHTML=s)}}break;case"children":if(typeof l=="string")Cl(e,l);else if(typeof l=="number"||typeof l=="bigint")Cl(e,""+l);else return;break;case"onScroll":l!=null&&qe("scroll",e);return;case"onScrollEnd":l!=null&&qe("scrollend",e);return;case"onClick":l!=null&&(e.onclick=Sa);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!vm.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(o=s.endsWith("Capture"),u=s.slice(2,o?s.length-7:void 0),t=e[wn]||null,t=t!=null?t[s]:null,typeof t=="function"&&e.removeEventListener(u,t,o),typeof l=="function")){typeof t!="function"&&t!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(u,l,o);break e}Je=!0,s in e?e[s]=l:l===!0?e.setAttribute(s,""):Pr(e,s,l)}return}Je=!0}function tn(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var l=!1,o=!1,u;for(u in s)if(s.hasOwnProperty(u)){var y=s[u];if(y!=null)switch(u){case"src":l=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:it(e,t,u,y,s,null)}}o&&it(e,t,"srcSet",s.srcSet,s,null),l&&it(e,t,"src",s.src,s,null);return;case"input":qe("invalid",e);var N=u=y=o=null,D=null,G=null;for(l in s)if(s.hasOwnProperty(l)){var P=s[l];if(P!=null)switch(l){case"name":o=P;break;case"type":y=P;break;case"checked":D=P;break;case"defaultChecked":G=P;break;case"value":u=P;break;case"defaultValue":N=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(c(137,t));break;default:it(e,t,l,P,s,null)}}km(e,u,N,D,G,y,o,!1);return;case"select":qe("invalid",e),l=y=u=null;for(o in s)if(s.hasOwnProperty(o)&&(N=s[o],N!=null))switch(o){case"value":u=N;break;case"defaultValue":y=N;break;case"multiple":l=N;default:it(e,t,o,N,s,null)}t=u,s=y,e.multiple=!!l,t!=null?kl(e,!!l,t,!1):s!=null&&kl(e,!!l,s,!0);return;case"textarea":qe("invalid",e),u=o=l=null;for(y in s)if(s.hasOwnProperty(y)&&(N=s[y],N!=null))switch(y){case"value":l=N;break;case"defaultValue":o=N;break;case"children":u=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(91));break;default:it(e,t,y,N,s,null)}Tm(e,l,o,u);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(l=s[D],l!=null))switch(D){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:it(e,t,D,l,s,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(l=0;l<ir.length;l++)qe(ir[l],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("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(G in s)if(s.hasOwnProperty(G)&&(l=s[G],l!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:it(e,t,G,l,s,null)}return;default:if(ju(t)){for(P in s)s.hasOwnProperty(P)&&(l=s[P],l!==void 0&&bf(e,t,P,l,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(l=s[N],l!=null&&it(e,t,N,l,s,null))}var B1={};function $1(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,u=null,y=null,N=null,D=null,G=null,P=null;for(Q in s){var le=s[Q];if(s.hasOwnProperty(Q)&&le!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":D=le;default:l.hasOwnProperty(Q)||it(e,t,Q,null,l,le)}}for(var U in l){var Q=l[U];if(le=s[U],l.hasOwnProperty(U)&&(Q!=null||le!=null))switch(U){case"type":Q!==le&&(Je=!0),u=Q;break;case"name":Q!==le&&(Je=!0),o=Q;break;case"checked":Q!==le&&(Je=!0),G=Q;break;case"defaultChecked":Q!==le&&(Je=!0),P=Q;break;case"value":Q!==le&&(Je=!0),y=Q;break;case"defaultValue":Q!==le&&(Je=!0),N=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(c(137,t));break;default:Q!==le&&it(e,t,U,Q,l,le)}}vu(e,y,N,D,G,P,u,o);return;case"select":Q=y=N=U=null;for(u in s)if(D=s[u],s.hasOwnProperty(u)&&D!=null)switch(u){case"value":break;case"multiple":Q=D;default:l.hasOwnProperty(u)||it(e,t,u,null,l,D)}for(o in l)if(u=l[o],D=s[o],l.hasOwnProperty(o)&&(u!=null||D!=null))switch(o){case"value":u!==D&&(Je=!0),U=u;break;case"defaultValue":u!==D&&(Je=!0),N=u;break;case"multiple":u!==D&&(Je=!0),y=u;default:u!==D&&it(e,t,o,u,l,D)}t=N,s=y,l=Q,U!=null?kl(e,!!s,U,!1):!!l!=!!s&&(t!=null?kl(e,!!s,t,!0):kl(e,!!s,s?[]:"",!1));return;case"textarea":Q=U=null;for(N in s)if(o=s[N],s.hasOwnProperty(N)&&o!=null&&!l.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:it(e,t,N,null,l,o)}for(y in l)if(o=l[y],u=s[y],l.hasOwnProperty(y)&&(o!=null||u!=null))switch(y){case"value":o!==u&&(Je=!0),U=o;break;case"defaultValue":o!==u&&(Je=!0),Q=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==u&&it(e,t,y,o,l,u)}Cm(e,U,Q);return;case"option":for(var pe in s)if(U=s[pe],s.hasOwnProperty(pe)&&U!=null&&!l.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:it(e,t,pe,null,l,U)}for(D in l)if(U=l[D],Q=s[D],l.hasOwnProperty(D)&&U!==Q&&(U!=null||Q!=null))switch(D){case"selected":U!==Q&&(Je=!0),e.selected=U&&typeof U!="function"&&typeof U!="symbol";break;default:it(e,t,D,U,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 Ce in s)U=s[Ce],s.hasOwnProperty(Ce)&&U!=null&&!l.hasOwnProperty(Ce)&&it(e,t,Ce,null,l,U);for(G in l)if(U=l[G],Q=s[G],l.hasOwnProperty(G)&&U!==Q&&(U!=null||Q!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(c(137,t));break;default:it(e,t,G,U,l,Q)}return;default:if(ju(t)){for(var Le in s)U=s[Le],s.hasOwnProperty(Le)&&U!==void 0&&!l.hasOwnProperty(Le)&&bf(e,t,Le,void 0,l,U);for(P in l)U=l[P],Q=s[P],!l.hasOwnProperty(P)||U===Q||U===void 0&&Q===void 0||bf(e,t,P,U,l,Q);return}}for(var $ in s)U=s[$],s.hasOwnProperty($)&&U!=null&&!l.hasOwnProperty($)&&it(e,t,$,null,l,U);for(le in l)U=l[le],Q=s[le],!l.hasOwnProperty(le)||U===Q||U==null&&Q==null||it(e,t,le,U,l,Q)}function _g(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function q1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var o=s[l],u=o.transferSize,y=o.initiatorType,N=o.duration;if(u&&N&&_g(y)){for(y=0,N=o.responseEnd,l+=1;l<s.length;l++){var D=s[l],G=D.startTime;if(G>N)break;var P=D.transferSize,le=D.initiatorType;P&&_g(le)&&(D=D.responseEnd,y+=P*(D<N?1:(N-G)/(D-G)))}if(--l,t+=8*(u+y)/(o.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 jf=null,Nf=null;function or(e){return e.nodeType===9?e:e.ownerDocument}function Lg(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 Ug(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 Hg(e,t,s,l){return s=or(s).createElement(e),s[Pt]=l,s[wn]=t,tn(s,e,t),Yt(s),s}function wf(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 Sf=null;function G1(){var e=window.event;return e&&e.type==="popstate"?e===Sf?!1:(Sf=e,!0):(Sf=null,!1)}var kf=typeof setTimeout=="function"?setTimeout:void 0,Y1=typeof clearTimeout=="function"?clearTimeout:void 0,Bg=typeof Promise=="function"?Promise:void 0,$g=typeof requestAnimationFrame=="function"?requestAnimationFrame:kf,V1=typeof queueMicrotask=="function"?queueMicrotask:typeof Bg<"u"?function(e){return Bg.resolve(null).then(e).catch(X1)}:kf;function X1(e){setTimeout(function(){throw e})}function Ss(e){return e==="head"}function qg(e,t){var s=t,l=0;do{var o=s.nextSibling;if(e.removeChild(s),o&&o.nodeType===8)if(s=o.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(o),ci(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Of(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Of(s);for(var u=s.firstChild;u;){var y=u.nextSibling,N=u.nodeName;u[Ci]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&u.rel.toLowerCase()==="stylesheet"||s.removeChild(u),u=y}}else s==="body"&&Of(e.ownerDocument.body);s=o}while(s);ci(t)}function Gg(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Yg(e,t,s){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,s!=null&&(e.style.viewTransitionClass=s),s=getComputedStyle(e),s.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var o=l=0;o<t.length;o++){var u=t[o];0<u.width&&0<u.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+s.paddingTop,e.marginBottom="-"+s.paddingBottom)}}function Vg(e,t){e=e.style,t=t.style;var s=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(s=t.display,e.display=s==null||typeof s=="boolean"?"":s,s=t.margin,s!=null?e.margin=s:(s=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=s==null||typeof s=="boolean"?"":s,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function K1(e,t,s){return s=s.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<=s.innerHeight&&e.left<=s.innerWidth}}function Cf(e){var t=e.getBoundingClientRect(),s=getComputedStyle(e);return K1(t,s,e)}function Z1(e){return e.documentElement.clientHeight}function Q1(e){this.addEventListener("load",e),this.addEventListener("error",e)}function I1(e,t,s,l,o,u,y,N,D){var G=t.nodeType===9?t:t.ownerDocument;try{var P=G.startViewTransition({update:function(){var U=G.defaultView,Q=U.navigation&&U.navigation.transition,pe=G.fonts.status;l();var Ce=[];if(pe==="loaded"&&(Z1(G),G.fonts.status==="loading"&&Ce.push(G.fonts.ready)),pe=Ce.length,e!==null)for(var Le=e.suspenseyImages,$=0,_=0;_<Le.length;_++){var X=Le[_];if(!X.complete){var ae=X.getBoundingClientRect();if(0<ae.bottom&&0<ae.right&&ae.top<U.innerHeight&&ae.left<U.innerWidth){if($+=dy(X),$>oc){Ce.length=pe;break}X=new Promise(Q1.bind(X)),Ce.push(X)}}}if(0<Ce.length)return U=Promise.race([Promise.all(Ce),new Promise(function(Se){return setTimeout(Se,500)})]).then(o,o),(Q?Promise.allSettled([Q.finished,U]):U).then(u,u);if(o(),Q)return Q.finished.then(u,u);u()},types:s});G.__reactViewTransition=P;var le=[];return P.ready.then(function(){for(var U=G.documentElement.getAnimations({subtree:!0}),Q=0;Q<U.length;Q++){var pe=U[Q],Ce=pe.effect,Le=Ce.pseudoElement;if(Le!=null&&Le.startsWith("::view-transition")){le.push(pe),pe=Ce.getKeyframes();for(var $=Le=void 0,_=!0,X=0;X<pe.length;X++){var ae=pe[X],Se=ae.width;if(Le===void 0)Le=Se;else if(Le!==Se){_=!1;break}if(Se=ae.height,$===void 0)$=Se;else if($!==Se){_=!1;break}delete ae.width,delete ae.height,ae.transform==="none"&&delete ae.transform}_&&Le!==void 0&&$!==void 0&&(Ce.setKeyframes(pe),_=getComputedStyle(Ce.target,Ce.pseudoElement),_.width!==Le||_.height!==$)&&(_=pe[0],_.width=Le,_.height=$,_=pe[pe.length-1],_.width=Le,_.height=$,Ce.setKeyframes(pe))}}y()},function(U){G.__reactViewTransition===P&&(G.__reactViewTransition=null);try{if(typeof U=="object"&&U!==null)switch(U.name){case"InvalidStateError":(U.message==="View transition was skipped because document visibility state is hidden."||U.message==="Skipping view transition because document visibility state has become hidden."||U.message==="Skipping view transition because viewport size changed."||U.message==="Transition was aborted because of invalid state")&&(U=null)}U!==null&&D(U)}finally{l(),o(),y()}}),P.finished.finally(function(){for(var U=0;U<le.length;U++)le[U].cancel();G.__reactViewTransition===P&&(G.__reactViewTransition=null),N()}),P}catch{return l(),o(),y(),null}}function rl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}rl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:A({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},rl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,s=e.getAnimations({subtree:!0}),l=[],o=0;o<s.length;o++){var u=s[o].effect;u!==null&&u.target===e&&u.pseudoElement===t&&l.push(s[o])}return l},rl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Xg(e){return{name:e,group:new rl("group",e),imagePair:new rl("image-pair",e),old:new rl("old",e),new:new rl("new",e)}}function Bn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Bn.prototype.addEventListener=function(e,t,s){var l=null,o=null;if(!(s!=null&&typeof s!="boolean"&&(l=s.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(Zg(u,e,t,s)===-1){var y=this,N=t;s!=null&&typeof s!="boolean"&&s.once===!0&&(N=function(D){y.removeEventListener(e,t,s),typeof t=="function"?t.call(this,D):t.handleEvent(D)}),l!==null&&(o=y.removeEventListener.bind(y,e,t,s),l.addEventListener("abort",o,{once:!0}),o=l.removeEventListener.bind(l,"abort",o)),l=ai(s),u.push({type:e,listener:t,optionsOrUseCapture:s,attachedListener:N,cleanup:o}),x(this._fragmentFiber.child,!1,P1,e,N,l)}this._eventListeners=u}};function P1(e,t,s,l){return C(e).addEventListener(t,s,l),!1}Bn.prototype.removeEventListener=function(e,t,s){var l=this._eventListeners;if(l!==null&&(t=Zg(l,e,t,s),t!==-1)){var o=l[t];s=o.attachedListener;var u=o.cleanup;o=ai(o.optionsOrUseCapture),x(this._fragmentFiber.child,!1,F1,e,s,o),l.splice(t,1),u!==null&&u()}};function F1(e,t,s,l){return C(e).removeEventListener(t,s,l),!1}function ai(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Kg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Zg(e,t,s,l){if(e.length===0)return-1;l=Kg(l);for(var o=0;o<e.length;o++){var u=e[o];if(u.type===t&&u.listener===s&&Kg(u.optionsOrUseCapture)===l)return o}return-1}Bn.prototype.dispatchEvent=function(e){var t=j(this._fragmentFiber);if(t===null)return!0;t=C(t);var s=this._eventListeners;if(s!==null&&0<s.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(s)for(var o=0;o<s.length;o++){var u=s[o];l.addEventListener(u.type,u.attachedListener,ai(u.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),s)for(o=0;o<s.length;o++)u=s[o],l.removeEventListener(u.type,u.attachedListener,ai(u.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},Bn.prototype.focus=function(e){x(this._fragmentFiber.child,!0,Qg,e,void 0,void 0)};function Qg(e,t){return e.tag===6?!1:(e=C(e),cN(e,t))}Bn.prototype.focusLast=function(e){var t=[];x(this._fragmentFiber.child,!0,Tf,t,void 0,void 0);for(var s=t.length-1;0<=s&&!Qg(t[s],e);s--);};function Tf(e,t){return t.push(e),!1}Bn.prototype.blur=function(){var e=j(this._fragmentFiber);e!==null&&(e=C(e),e=or(e).activeElement,e!==null&&x(this._fragmentFiber.child,!1,J1,e,void 0,void 0))};function J1(e,t){return e.tag===6?!1:(e=C(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Bn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),x(this._fragmentFiber.child,!1,W1,e,void 0,void 0)};function W1(e,t){return e.tag===6||(e=C(e),t.observe(e)),!1}Bn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),x(this._fragmentFiber.child,!1,eN,e,void 0,void 0);for(var s=t=0;s<fa.length;s++){var l=fa[s];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):fa[t++]=l}fa.length=t}};function eN(e,t){return e.tag===6||(e=C(e),t.unobserve(e)),!1}var fa=[],Ef=!1;function tN(e,t,s){fa.push({fragmentInstance:e,observer:t,instance:s}),Ef||(Ef=!0,uN(function(){Ef=!1;var l=fa;fa=[];for(var o=0;o<l.length;o++){var u=l[o];u.observer.unobserve(u.instance)}}))}Bn.prototype.getClientRects=function(){var e=[];return x(this._fragmentFiber.child,!1,nN,e,void 0,void 0),e};function nN(e,t){if(e.tag===6){e=e.stateNode;var s=e.ownerDocument.createRange();s.selectNodeContents(e),t.push.apply(t,s.getClientRects())}else e=C(e),t.push.apply(t,e.getClientRects());return!1}Bn.prototype.getRootNode=function(e){var t=j(this._fragmentFiber);return t===null?this:C(t).getRootNode(e)},Bn.prototype.compareDocumentPosition=function(e){var t=j(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];x(this._fragmentFiber.child,!1,Tf,s,void 0,void 0);var l=C(t);if(s.length===0){if(s=l,S(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&&(s=t)}t=this._fragmentFiber;var o=l=s.compareDocumentPosition(e);return s===e?o=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=R(t)[1],s===null?o=Node.DOCUMENT_POSITION_PRECEDING:(e=C(s).compareDocumentPosition(e),o=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),o|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=C(s[0]),o=C(s[s.length-1]);var u=S(this._fragmentFiber)?t.parentElement:l;if(u==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=u.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,u=u.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY;var y=t.compareDocumentPosition(e),N=o.compareDocumentPosition(e),D=y&Node.DOCUMENT_POSITION_CONTAINED_BY||N&Node.DOCUMENT_POSITION_CONTAINED_BY;return N=l&&u&&y&Node.DOCUMENT_POSITION_FOLLOWING&&N&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||u&&o===e||D||N?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!u&&o===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:y,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||aN(t,this._fragmentFiber,s[0],s[s.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function aN(e,t,s,l,o){var u=$s(o);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){s=!0;break e}u=u.return}s=!1}return s}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(u===null)return u=o.ownerDocument,o===u||o===u.documentElement||o===u.body;e:{for(u=t,t=j(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===s)&&(t=Y(s,u,M),t===null?t=!1:(x(t,!0,O,u,s),u=z,z=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===l)&&(t=Y(l,u,M),t===null?t=!1:(x(t,!0,E,u,l),u=z,w=z=null,t=u!==null)),t):!1}function Ig(e,t){var s=e.ownerDocument.createRange();s.selectNodeContents(e),e=s.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Bn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(c(566));var t=[];x(this._fragmentFiber.child,!1,Tf,t,void 0,void 0);var s=e!==!1;if(t.length===0){var l=R(this._fragmentFiber);if(l=s?l[1]||l[0]||j(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=C(l),Ig(e,s);return}if(l=C(l),l.nodeType!==9){if(l.nodeType===11){s="host"in l?l.host:null,s!==null&&s.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=s?t.length-1:0;l!==(s?-1:t.length);){var o=t[l];o.tag===6?(o=C(o),Ig(o,s)):C(o).scrollIntoView(e),l+=s?-1:1}};function sN(e,t){return e=C(e),Pg(e,t),!1}function Pg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Fg(e,t){var s=t._eventListeners;if(s!==null)for(var l=0;l<s.length;l++){var o=s[l];e.addEventListener(o.type,o.attachedListener,ai(o.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(u){for(var y=0,N=0;N<fa.length;N++){var D=fa[N];(D.fragmentInstance!==t||D.observer!==u||D.instance!==e)&&(fa[y++]=D)}fa.length=y,u.observe(e)}),Pg(e,t))}function lN(e,t){var s=t._eventListeners;if(s!==null)for(var l=0;l<s.length;l++){var o=s[l];e.removeEventListener(o.type,o.attachedListener,ai(o.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(u){typeof u.rootMargin=="string"?tN(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Rf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Rf(s),Ir(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function iN(e,t,s,l){for(;e.nodeType===1;){var o=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ci])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Pn(e.nextSibling),e===null)break}return null}function rN(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Pn(e.nextSibling),e===null))return null;return e}function Jg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Pn(e.nextSibling),e===null))return null;return e}function zf(e){return e.data==="$?"||e.data==="$~"}function Df(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function oN(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Pn(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 Af=null;function Wg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Pn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function ey(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function cN(e,t){function s(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",s,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",s,!0)}return l}function uN(e){$g(function(){$g(function(t){return e(t)})})}function ty(e,t,s){switch(t=or(s),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function ny(e,t,s){for(var l in s){var o=s[l];s.hasOwnProperty(l)&&o!=null&&it(e,t,l,null,B1,o)}s.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Sa&&(e.onclick=null),Ir(e)}function Of(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ir(e)}var Fn=new Map,ay=new Set;function cr(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 Fa=ie.d;ie.d={f:dN,r:fN,D:hN,C:mN,L:pN,m:xN,X:yN,S:gN,M:vN};function dN(){var e=Fa.f(),t=Wo();return e||t}function fN(e){var t=Nl(e);t!==null&&t.tag===5&&t.type==="form"?lx(t):Fa.r(e)}var si=typeof document>"u"?null:document;function sy(e,t,s){var l=si;if(l&&typeof t=="string"&&t){var o=Yn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof s=="string"&&(o+='[crossorigin="'+s+'"]'),ay.has(o)||(ay.add(o),e={rel:e,crossOrigin:s,href:t},l.querySelector(o)===null&&(t=l.createElement("link"),tn(t,"link",e),Yt(t),l.head.appendChild(t)))}}function hN(e){Fa.D(e),sy("dns-prefetch",e,null)}function mN(e,t){Fa.C(e,t),sy("preconnect",e,t)}function pN(e,t,s){Fa.L(e,t,s);var l=si;if(l&&e&&t){var o='link[rel="preload"][as="'+Yn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(o+='[imagesrcset="'+Yn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(o+='[imagesizes="'+Yn(s.imageSizes)+'"]')):o+='[href="'+Yn(e)+'"]';var u=o;switch(t){case"style":u=li(e);break;case"script":u=ii(e)}if(!(Fn.has(u)||(e=A({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Fn.set(u,e),l.querySelector(o)!==null||t==="style"&&l.querySelector(ur(u))||t==="script"&&l.querySelector(dr(u))))){var y=l.createElement("link");tn(y,"link",e),t==="style"&&(y[Qr]=!0,y.onload=y.onerror=function(){gm(y)}),Yt(y),l.head.appendChild(y)}}}function xN(e,t){Fa.m(e,t);var s=si;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Yn(l)+'"][href="'+Yn(e)+'"]',u=o;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ii(e)}if(!Fn.has(u)&&(e=A({rel:"modulepreload",href:e},t),Fn.set(u,e),s.querySelector(o)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(dr(u)))return}l=s.createElement("link"),tn(l,"link",e),Yt(l),s.head.appendChild(l)}}}function gN(e,t,s){Fa.S(e,t,s);var l=si;if(l&&e){var o=wl(l).hoistableStyles,u=li(e);t=t||"default";var y=o.get(u);if(!y){var N={loading:0,preload:null};if(y=l.querySelector(ur(u)))N.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Fn.get(u))&&Mf(e,s);var D=y=l.createElement("link");Yt(D),tn(D,"link",e),D._p=new Promise(function(G,P){D.onload=G,D.onerror=P}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,ic(y,t,l)}y={type:"stylesheet",instance:y,count:1,state:N},o.set(u,y)}}}function yN(e,t){Fa.X(e,t);var s=si;if(s&&e){var l=wl(s).hoistableScripts,o=ii(e),u=l.get(o);u||(u=s.querySelector(dr(o)),u||(e=A({src:e,async:!0},t),(t=Fn.get(o))&&_f(e,t),u=s.createElement("script"),Yt(u),tn(u,"link",e),s.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function vN(e,t){Fa.M(e,t);var s=si;if(s&&e){var l=wl(s).hoistableScripts,o=ii(e),u=l.get(o);u||(u=s.querySelector(dr(o)),u||(e=A({src:e,async:!0,type:"module"},t),(t=Fn.get(o))&&_f(e,t),u=s.createElement("script"),Yt(u),tn(u,"link",e),s.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function ly(e,t,s,l){var o=(o=xt.current)?cr(o):null;if(!o)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=li(s.href),t=wl(o).hoistableStyles,l=t.get(s),l||(l={type:"style",instance:null,count:0,state:null},t.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=li(s.href);var u=wl(o).hoistableStyles,y=u.get(e);if(y||(o=o.ownerDocument||o,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,y),(u=o.querySelector(ur(e)))?u._p||(y.instance=u,y.state.loading=5):(u=Fn.get(e),u||(u={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Fn.set(e,u)),bN(o,e,u,y.state))),t&&l===null)throw Error(c(528,""));return y}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(s=ii(s),t=wl(o).hoistableScripts,l=t.get(s),l||(l={type:"script",instance:null,count:0,state:null},t.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function li(e){return'href="'+Yn(e)+'"'}function ur(e){return'link[rel="stylesheet"]['+e+"]"}function iy(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function bN(e,t,s,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Qr]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Qr]=!0,t.onload=t.onerror=gm.bind(null,t),tn(t,"link",s),Yt(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 ii(e){return'[src="'+Yn(e)+'"]'}function dr(e){return"script[async]"+e}function ry(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Yn(s.href)+'"]');if(l)return t.instance=l,Yt(l),l;var o=A({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Yt(l),tn(l,"style",o),ic(l,s.precedence,e),t.instance=l;case"stylesheet":o=li(s.href);var u=e.querySelector(ur(o));if(u)return t.state.loading|=4,t.instance=u,Yt(u),u;l=iy(s),(o=Fn.get(o))&&Mf(l,o),u=(e.ownerDocument||e).createElement("link"),Yt(u);var y=u;return y._p=new Promise(function(N,D){y.onload=N,y.onerror=D}),tn(u,"link",l),t.state.loading|=4,ic(u,s.precedence,e),t.instance=u;case"script":return u=ii(s.src),(o=e.querySelector(dr(u)))?(t.instance=o,Yt(o),o):(l=s,(o=Fn.get(u))&&(l=A({},s),_f(l,o)),e=e.ownerDocument||e,o=e.createElement("script"),Yt(o),tn(o,"link",l),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,ic(l,s.precedence,e));return t.instance}function ic(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=l.length?l[l.length-1]:null,u=o,y=0;y<l.length;y++){var N=l[y];if(N.dataset.precedence===t)u=N;else if(u!==o)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Mf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _f(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var rc=null;function oy(e,t,s){if(rc===null){var l=new Map,o=rc=new Map;o.set(s,l)}else o=rc,l=o.get(s),l||(l=new Map,o.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),o=0;o<s.length;o++){var u=s[o];if(!(u[Ci]||u[Pt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var y=u.getAttribute(t)||"";y=e+y;var N=l.get(y);N?N.push(u):l.set(y,[u])}}return l}function Lf(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function jN(e,t,s){if(s===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 cy(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function uy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function dy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function fy(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=dy(t),e.suspenseyImages.push(t)),e=SN.bind(e),t.decode().then(e,e))}function NN(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var o=li(l.href),u=t.querySelector(ur(o));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=fr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=u,Yt(u);return}u=t.ownerDocument||t,l=iy(l),(o=Fn.get(o))&&Mf(l,o),u=u.createElement("link"),Yt(u);var y=u;y._p=new Promise(function(N,D){y.onload=N,y.onerror=D}),tn(u,"link",l),s.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=fr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var oc=0;function wN(e,t){return e.stylesheets&&e.count===0&&uc(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&uc(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&oc===0&&(oc=62500*q1());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uc(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>oc?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(o)}}:null}function hy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)uc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fr(){this.count--,hy(this)}function SN(){this.imgCount--,hy(this)}var cc=null;function uc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cc=new Map,t.forEach(kN,e),cc=null,fr.call(e))}function kN(e,t){if(!(t.state.loading&4)){var s=cc.get(e);if(s)var l=s.get(null);else{s=new Map,cc.set(e,s);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<o.length;u++){var y=o[u];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),l=y)}l&&s.set(null,l)}o=t.instance,y=o.getAttribute("data-precedence"),u=s.get(y)||l,u===l&&s.set(null,o),s.set(y,o),this.count++,l=fr.bind(this),o.addEventListener("load",l),o.addEventListener("error",l),u?u.parentNode.insertBefore(o,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ri={$$typeof:ue,Provider:null,Consumer:null,_currentValue:Pe,_currentValue2:Pe,_threadCount:0};function CN(e,t,s,l,o,u,y,N,D){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=pu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pu(0),this.hiddenUpdates=pu(null),this.identifierPrefix=l,this.onUncaughtError=o,this.onCaughtError=u,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.transitionTypes=null,this.incompleteTransitions=new Map}function my(e,t,s,l,o,u,y,N,D,G,P,le){return e=new CN(e,t,s,y,D,G,P,le,N),t=1,u===!0&&(t|=24),u=Sn(3,null,null,t),e.current=u,u.stateNode=e,t=Pu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:s,cache:t},ed(u),e}function py(e){return e?(e=Ol,e):Ol}function xy(e,t,s,l,o,u){o=py(o),l.context===null?l.context=o:l.pendingContext=o,l=fs(t),l.payload={element:s},u=u===void 0?null:u,u!==null&&(l.callback=u),s=hs(e,l,t),s!==null&&(En(s,e,t),Yi(s,e,t))}function gy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Uf(e,t){gy(e,t),(e=e.alternate)&&gy(e,t)}function yy(e){if(e.tag===13||e.tag===31){var t=Vs(e,67108864);t!==null&&En(t,e,67108864),Uf(e,67108864)}}function vy(e){if(e.tag===13||e.tag===31){var t=Hn();t=xu(t);var s=Vs(e,t);s!==null&&En(s,e,t),Uf(e,t)}}var oi=!0;function TN(e,t,s,l){var o=me.T;me.T=null;var u=ie.p;try{ie.p=2,Hf(e,t,s,l)}finally{ie.p=u,me.T=o}}function EN(e,t,s,l){var o=me.T;me.T=null;var u=ie.p;try{ie.p=8,Hf(e,t,s,l)}finally{ie.p=u,me.T=o}}function Hf(e,t,s,l){if(oi){var o=Bf(l);if(o===null)vf(e,t,l,dc,s),jy(e,l);else if(zN(o,e,t,s,l))l.stopPropagation();else if(jy(e,l),t&4&&-1<RN.indexOf(e)){for(;o!==null;){var u=Nl(o);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var y=ia(u.pendingLanes);if(y!==0){var N=u;for(N.pendingLanes|=2,N.entangledLanes|=2;y;){var D=1<<31-Nt(y);N.entanglements[1]|=D,y&=~D}Ma(u),(We&6)===0&&(Po=Ze()+500,lr(0))}}break;case 31:case 13:N=Vs(u,2),N!==null&&En(N,u,2),Wo(),Uf(u,2)}if(u=Bf(l),u===null&&vf(e,t,l,dc,s),u===o)break;o=u}o!==null&&l.stopPropagation()}else vf(e,t,l,null,s)}}function Bf(e){return e=wu(e),$f(e)}var dc=null;function $f(e){if(dc=null,e=$s(e),e!==null){var t=f(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=m(t),e!==null)return e;e=null}else if(s===31){if(e=h(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return dc=e,null}function by(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(It()){case Kr:return 2;case Ut:return 8;case Gt:case on:return 32;case sa:return 268435456;default:return 32}default:return 32}}var qf=!1,ks=null,Cs=null,Ts=null,hr=new Map,mr=new Map,Es=[],RN="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 jy(e,t){switch(e){case"focusin":case"focusout":ks=null;break;case"dragenter":case"dragleave":Cs=null;break;case"mouseover":case"mouseout":Ts=null;break;case"pointerover":case"pointerout":hr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mr.delete(t.pointerId)}}function pr(e,t,s,l,o,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:u,targetContainers:[o]},t!==null&&(t=Nl(t),t!==null&&yy(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function zN(e,t,s,l,o){switch(t){case"focusin":return ks=pr(ks,e,t,s,l,o),!0;case"dragenter":return Cs=pr(Cs,e,t,s,l,o),!0;case"mouseover":return Ts=pr(Ts,e,t,s,l,o),!0;case"pointerover":var u=o.pointerId;return hr.set(u,pr(hr.get(u)||null,e,t,s,l,o)),!0;case"gotpointercapture":return u=o.pointerId,mr.set(u,pr(mr.get(u)||null,e,t,s,l,o)),!0}return!1}function Ny(e){var t=$s(e.target);if(t!==null){var s=f(t);if(s!==null){if(t=s.tag,t===13){if(t=m(s),t!==null){e.blockedOn=t,mm(e.priority,function(){vy(s)});return}}else if(t===31){if(t=h(s),t!==null){e.blockedOn=t,mm(e.priority,function(){vy(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Bf(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Nu=l,s.target.dispatchEvent(l),Nu=null}else return t=Nl(s),t!==null&&yy(t),e.blockedOn=s,!1;t.shift()}return!0}function wy(e,t,s){fc(e)&&s.delete(t)}function DN(){qf=!1,ks!==null&&fc(ks)&&(ks=null),Cs!==null&&fc(Cs)&&(Cs=null),Ts!==null&&fc(Ts)&&(Ts=null),hr.forEach(wy),mr.forEach(wy)}function hc(e,t){e.blockedOn===t&&(e.blockedOn=null,qf||(qf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,DN)))}var mc=null;function Sy(e){mc!==e&&(mc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){mc===e&&(mc=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],o=e[t+2];if(typeof l!="function"){if($f(l||s)===null)continue;break}var u=Nl(s);u!==null&&(e.splice(t,3),t-=3,jd(u,{pending:!0,data:o,method:s.method,action:l},l,o))}}))}function ci(e){function t(D){return hc(D,e)}ks!==null&&hc(ks,e),Cs!==null&&hc(Cs,e),Ts!==null&&hc(Ts,e),hr.forEach(t),mr.forEach(t);for(var s=0;s<Es.length;s++){var l=Es[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Es.length&&(s=Es[0],s.blockedOn===null);)Ny(s),s.blockedOn===null&&Es.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var o=s[l],u=s[l+1],y=o[wn]||null;if(typeof u=="function")y||Sy(s);else if(y){var N=null;if(u&&u.hasAttribute("formAction")){if(o=u,y=u[wn]||null)N=y.formAction;else if($f(o)!==null)continue}else N=y.action;typeof N=="function"?s[l+1]=N:(s.splice(l,3),l-=3),Sy(s)}}}function ky(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(y){return o=y})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Gf(e){this._internalRoot=e}pc.prototype.render=Gf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var s=t.current,l=Hn();xy(s,l,e,t,null,null)},pc.prototype.unmount=Gf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xy(e.current,2,null,e,null,null),Wo(),t[jl]=null}};function pc(e){this._internalRoot=e}pc.prototype.unstable_scheduleHydration=function(e){if(e){var t=hm();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Es.length&&t!==0&&t<Es[s].priority;s++);Es.splice(s,0,e),s===0&&Ny(e)}};var Cy=i.version;if(Cy!=="19.3.1")throw Error(c(527,Cy,"19.3.1"));ie.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=v(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var AN={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xc.isDisabled&&xc.supportsFiber)try{an=xc.inject(AN),At=xc}catch{}}return gr.createRoot=function(e,t){if(!d(e))throw Error(c(299));var s=!1,l="",o=px,u=xx,y=gx;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=my(e,1,!1,null,null,s,l,null,o,u,y,ky),e[jl]=t.current,yf(e),new Gf(t)},gr.hydrateRoot=function(e,t,s){if(!d(e))throw Error(c(299));var l=!1,o="",u=px,y=xx,N=gx,D=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(o=s.identifierPrefix),s.onUncaughtError!==void 0&&(u=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=my(e,1,!0,t,s??null,l,o,D,u,y,N,ky),t.context=py(null),s=t.current,l=Hn(),l=xu(l),o=fs(l),o.callback=null,hs(s,o,l),s=l,t.current.lanes=s,ki(t,s),Ma(t),e[jl]=t.current,yf(e),new pc(t)},gr.version="19.3.1",gr}var Ly;function GN(){if(Ly)return Xf.exports;Ly=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Xf.exports=qN(),Xf.exports}var YN=GN();/**
48
+ `+l.stack}}var Hs=Object.prototype.hasOwnProperty,Te=n.unstable_scheduleCallback,ut=n.unstable_cancelCallback,Rt=n.unstable_shouldYield,jt=n.unstable_requestPaint,Ze=n.unstable_now,It=n.unstable_getCurrentPriorityLevel,Zr=n.unstable_ImmediatePriority,Ht=n.unstable_UserBlockingPriority,Gt=n.unstable_NormalPriority,on=n.unstable_LowPriority,sa=n.unstable_IdlePriority,Nn=n.log,cn=n.unstable_setDisableYieldValue,an=null,At=null;function ft(e){if(typeof Nn=="function"&&cn(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(an,e)}catch{}}var Nt=Math.clz32?Math.clz32:Bs,Gn=Math.log,la=Math.LN2;function Bs(e){return e>>>=0,e===0?32:31-(Gn(e)/la|0)|0}var Na=256,Dn=262144,wa=4194304;function ia(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 Qr(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var o=0,u=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var N=l&134217727;return N!==0?(l=N&~u,l!==0?o=ia(l):(v&=N,v!==0?o=ia(v):s||(s=N&~e,s!==0&&(o=ia(s))))):(N=l&~u,N!==0?o=ia(N):v!==0?o=ia(v):s||(s=l&~e,s!==0&&(o=ia(s)))),o===0?0:t!==0&&t!==o&&(t&u)===0&&(u=o&-o,s=t&-t,u>=s||u===32&&(s&4194048)!==0)?t:o}function ki(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function um(e,t){(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var l=31-Nt(s),o=1<<l;t|=e[l],s&=~o}return t}function tj(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 dm(){var e=wa;return wa<<=1,(wa&62914560)===0&&(wa=4194304),e}function gu(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Ci(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nj(e,t,s,l,o,u){var v=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var N=e.entanglements,z=e.expirationTimes,G=e.hiddenUpdates;for(s=v&~s;0<s;){var P=31-Nt(s),le=1<<P;N[P]=0,z[P]=-1;var B=G[P];if(B!==null)for(G[P]=null,P=0;P<B.length;P++){var Q=B[P];Q!==null&&(Q.lane&=-536870913)}s&=~le}l!==0&&fm(e,l,0),u!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=u&~(v&~t))}function fm(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Nt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function hm(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-Nt(s),o=1<<l;o&t|e[l]&t&&(e[l]|=t),s&=~o}}function mm(e,t){var s=t&-t;return s=(s&42)!==0?1:vu(s),(s&(e.suspendedLanes|t))!==0?0:s}function vu(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 yu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pm(){var e=ie.p;return e!==0?e:(e=window.event,e===void 0?32:Nv(e.type))}function xm(e,t){var s=ie.p;try{return ie.p=e,t()}finally{ie.p=s}}var Ua=Math.random().toString(36).slice(2),Pt="__reactFiber$"+Ua,wn="__reactProps$"+Ua,jl="__reactContainer$"+Ua,gm="__reactEvents$"+Ua,aj="__reactListeners$"+Ua,sj="__reactHandles$"+Ua,vm="__reactResources$"+Ua,Ti="__reactMarker$"+Ua,Ir="__reactLoad$"+Ua;function Pr(e){delete e[Pt],delete e[wn],delete e[aj],delete e[sj]}function $s(e){var t;if(t=e[Pt])return t;for(var s=e.parentNode;s;){if(t=s[jl]||s[Pt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=nv(e);e!==null;){if(s=e[Pt])return s;e=nv(e)}return t}e=s,s=e.parentNode}return null}function Nl(e){if(e=e[Pt]||e[jl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ei(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function wl(e){var t=e[vm];return t||(t=e[vm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Yt(e){e[Ti]=!0}function ym(e){e[Ir]=void 0}var bm=new Set,jm={};function qs(e,t){Sl(e,t),Sl(e+"Capture",t)}function Sl(e,t){for(jm[e]=t,e=0;e<t.length;e++)bm.add(t[e])}var lj=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]*$"),Nm={},wm={};function ij(e){return Hs.call(wm,e)?!0:Hs.call(Nm,e)?!1:lj.test(e)?wm[e]=!0:(Nm[e]=!0,!1)}var Je=!1;function Sm(){var e=Je;return Je=!1,e}function Fr(e,t,s){if(ij(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){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,s)}}function Jr(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,s)}}function Ha(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,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 km(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rj(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var o=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(v){s=""+v,u.call(this,v)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(v){s=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bu(e){if(!e._valueTracker){var t=km(e)?"checked":"value";e._valueTracker=rj(e,t,""+e[t])}}function Cm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=km(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}var oj=/[\n"\\]/g;function Yn(e){return e.replace(oj,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ju(e,t,s,l,o,u,v,N){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),t!=null?v==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+An(t)):e.value!==""+An(t)&&(e.value=""+An(t)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),t!=null?v==="number"&&e.value==t?Nu(e,An(e.value)):Nu(e,An(t)):s!=null?Nu(e,An(s)):l!=null&&e.removeAttribute("value"),o==null&&u!=null&&(e.defaultChecked=!!u),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+An(N):e.removeAttribute("name")}function Tm(e,t,s,l,o,u,v,N){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||s!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){bu(e);return}s=s!=null?""+An(s):"",t=t!=null?""+An(t):s,N||t===e.value||(e.value=t),e.defaultValue=t}l=l??o,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=N?e.checked:!!l,e.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),bu(e)}function Nu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function kl(e,t,s,l){if(e=e.options,t){t={};for(var o=0;o<s.length;o++)t["$"+s[o]]=!0;for(s=0;s<e.length;s++)o=t.hasOwnProperty("$"+e[s].value),e[s].selected!==o&&(e[s].selected=o),o&&l&&(e[s].defaultSelected=!0)}else{for(s=""+An(s),t=null,o=0;o<e.length;o++){if(e[o].value===s){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Em(e,t,s){if(t!=null&&(t=""+An(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+An(s):""}function Rm(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(c(92));if(xe(l)){if(1<l.length)throw Error(c(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=An(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),bu(e)}function Cl(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var cj=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 zm(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||cj.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Dm(e,t,s){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",Je=!0);for(var o in t)l=t[o],t.hasOwnProperty(o)&&s[o]!==l&&(zm(e,o,l),Je=!0)}else for(var u in t)t.hasOwnProperty(u)&&zm(e,u,t[u])}function wu(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 uj=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"]]),dj=/^[\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 Wr(e){return dj.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Sa(){}var Su=null;function ku(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tl=null,El=null;function Am(e){var t=Nl(e);if(t&&(e=t.stateNode)){var s=e[wn]||null;e:switch(e=t.stateNode,t.type){case"input":if(ju(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Yn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var o=l[wn]||null;if(!o)throw Error(c(90));ju(l,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&Cm(l)}break e;case"textarea":Em(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&kl(e,!!s.multiple,t,!1)}}}var Cu=!1;function Om(e,t,s){if(Cu)return e(t,s);Cu=!0;try{var l=e(t);return l}finally{if(Cu=!1,(Tl!==null||El!==null)&&(ec(),Tl&&(t=Tl,e=El,El=Tl=null,Am(t),e)))for(t=0;t<e.length;t++)Am(e[t])}}function Ri(e,t){var s=e.stateNode;if(s===null)return null;var l=s[wn]||null;if(l===null)return null;s=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(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var Ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tu=!1;if(Ba)try{var zi={};Object.defineProperty(zi,"passive",{get:function(){Tu=!0}}),window.addEventListener("test",zi,zi),window.removeEventListener("test",zi,zi)}catch{Tu=!1}var ss=null,Eu=null,eo=null;function Mm(){if(eo)return eo;var e,t=Eu,s=t.length,l,o="value"in ss?ss.value:ss.textContent,u=o.length;for(e=0;e<s&&t[e]===o[e];e++);var v=s-e;for(l=1;l<=v&&t[s-l]===o[u-l];l++);return eo=o.slice(e,1<l?1-l:void 0)}function to(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 no(){return!0}function _m(){return!1}function un(e){function t(s,l,o,u,v){this._reactName=s,this._targetInst=o,this.type=l,this.nativeEvent=u,this.target=v,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(s=e[N],this[N]=s?s(u):u[N]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?no:_m,this.isPropagationStopped=_m,this}return A(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=no)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=no)},persist:function(){},isPersistent:no}),t}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ao=un(ls),Di=A({},ls,{view:0,detail:0}),fj=un(Di),Ru,zu,Ai,so=A({},Di,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Au,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!==Ai&&(Ai&&e.type==="mousemove"?(Ru=e.screenX-Ai.screenX,zu=e.screenY-Ai.screenY):zu=Ru=0,Ai=e),Ru)},movementY:function(e){return"movementY"in e?e.movementY:zu}}),Lm=un(so),hj=A({},so,{dataTransfer:0}),mj=un(hj),pj=A({},Di,{relatedTarget:0}),Du=un(pj),xj=A({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),gj=un(xj),vj=A({},ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yj=un(vj),bj=A({},ls,{data:0}),Um=un(bj),jj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nj={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"},wj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wj[e])?!!t[e]:!1}function Au(){return Sj}var kj=A({},Di,{key:function(e){if(e.key){var t=jj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=to(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Au,charCode:function(e){return e.type==="keypress"?to(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?to(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cj=un(kj),Tj=A({},so,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hm=un(Tj),Ej=A({},ls,{submitter:0}),Rj=un(Ej),zj=A({},Di,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Au}),Dj=un(zj),Aj=A({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),Oj=un(Aj),Mj=A({},so,{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}),_j=un(Mj),Lj=A({},ls,{newState:0,oldState:0,source:0}),Uj=un(Lj),Hj=[9,13,27,32],Ou=Ba&&"CompositionEvent"in window,Oi=null;Ba&&"documentMode"in document&&(Oi=document.documentMode);var Bj=Ba&&"TextEvent"in window&&!Oi,Bm=Ba&&(!Ou||Oi&&8<Oi&&11>=Oi),$m=" ",qm=!1;function Gm(e,t){switch(e){case"keyup":return Hj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ym(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rl=!1;function $j(e,t){switch(e){case"compositionend":return Ym(t);case"keypress":return t.which!==32?null:(qm=!0,$m);case"textInput":return e=t.data,e===$m&&qm?null:e;default:return null}}function qj(e,t){if(Rl)return e==="compositionend"||!Ou&&Gm(e,t)?(e=Mm(),eo=Eu=ss=null,Rl=!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 Bm&&t.locale!=="ko"?null:t.data;default:return null}}var Gj={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 Vm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gj[e.type]:t==="textarea"}function Xm(e,t,s,l){Tl?El?El.push(l):El=[l]:Tl=l,t=ic(t,"onChange"),0<t.length&&(s=new ao("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var Mi=null,_i=null;function Yj(e){Ag(e,0)}function lo(e){var t=Ei(e);if(Cm(t))return e}function Km(e,t){if(e==="change")return t}var Zm=!1;if(Ba){var Mu;if(Ba){var _u="oninput"in document;if(!_u){var Qm=document.createElement("div");Qm.setAttribute("oninput","return;"),_u=typeof Qm.oninput=="function"}Mu=_u}else Mu=!1;Zm=Mu&&(!document.documentMode||9<document.documentMode)}function Im(){Mi&&(Mi.detachEvent("onpropertychange",Pm),_i=Mi=null)}function Pm(e){if(e.propertyName==="value"&&lo(_i)){var t=[];Xm(t,_i,e,ku(e)),Om(Yj,t)}}function Vj(e,t,s){e==="focusin"?(Im(),Mi=t,_i=s,Mi.attachEvent("onpropertychange",Pm)):e==="focusout"&&Im()}function Xj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return lo(_i)}function Kj(e,t){if(e==="click")return lo(t)}function Zj(e,t){if(e==="input"||e==="change")return lo(t)}function Qj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var On=typeof Object.is=="function"?Object.is:Qj;function Li(e,t){if(On(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var o=s[l];if(!Hs.call(t,o)||!On(e[o],t[o]))return!1}return!0}function Lu(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 Fm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jm(e,t){var s=Fm(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Fm(s)}}function Wm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ep(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lu(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Lu(e.document)}return t}function Uu(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 Ij=Ba&&"documentMode"in document&&11>=document.documentMode,zl=null,Hu=null,Ui=null,Bu=!1;function tp(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Bu||zl==null||zl!==Lu(l)||(l=zl,"selectionStart"in l&&Uu(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}),Ui&&Li(Ui,l)||(Ui=l,l=ic(Hu,"onSelect"),0<l.length&&(t=new ao("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=zl)))}function Gs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Dl={animationend:Gs("Animation","AnimationEnd"),animationiteration:Gs("Animation","AnimationIteration"),animationstart:Gs("Animation","AnimationStart"),transitionrun:Gs("Transition","TransitionRun"),transitionstart:Gs("Transition","TransitionStart"),transitioncancel:Gs("Transition","TransitionCancel"),transitionend:Gs("Transition","TransitionEnd")},$u={},np={};Ba&&(np=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function Ys(e){if($u[e])return $u[e];if(!Dl[e])return e;var t=Dl[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in np)return $u[e]=t[s];return e}var ap=Ys("animationend"),sp=Ys("animationiteration"),lp=Ys("animationstart"),Pj=Ys("transitionrun"),Fj=Ys("transitionstart"),Jj=Ys("transitioncancel"),ip=Ys("transitionend"),rp=new Map,qu="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(" ");qu.push("scrollEnd");function ra(e,t){rp.set(e,t),qs(t,[e])}var Wj=0;function $a(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=da.identifierPrefix;var s=Wj++;return e="_"+e+"t_"+s.toString(32)+"_",t.autoName=e}function op(e){if(e==null||typeof e=="string")return e;var t=null,s=Fl;if(s!==null)for(var l=0;l<s.length;l++){var o=e[s[l]];if(o!=null){if(o==="none")return"none";t=t==null?o:t+(" "+o)}}return t??e.default}function qa(e,t){return e=op(e),t=op(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var io=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)},Vn=[],Al=0,Gu=0;function ro(){for(var e=Al,t=Gu=Al=0;t<e;){var s=Vn[t];Vn[t++]=null;var l=Vn[t];Vn[t++]=null;var o=Vn[t];Vn[t++]=null;var u=Vn[t];if(Vn[t++]=null,l!==null&&o!==null){var v=l.pending;v===null?o.next=o:(o.next=v.next,v.next=o),l.pending=o}u!==0&&cp(s,o,u)}}function oo(e,t,s,l){Vn[Al++]=e,Vn[Al++]=t,Vn[Al++]=s,Vn[Al++]=l,Gu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Yu(e,t,s,l){return oo(e,t,s,l),co(e)}function Vs(e,t){return oo(e,null,null,t),co(e)}function cp(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var o=!1,u=e.return;u!==null;)u.childLanes|=s,l=u.alternate,l!==null&&(l.childLanes|=s),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(o=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,o&&t!==null&&(o=31-Nt(s),e=u.hiddenUpdates,l=e[o],l===null?e[o]=[t]:l.push(t),t.lane=s|536870912),u):null}function co(e){if(50<lr)throw lr=0,Wo=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ol={};function e1(e,t,s,l){this.tag=e,this.key=s,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 Sn(e,t,s,l){return new e1(e,t,s,l)}function Vu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ga(e,t){var s=e.alternate;return s===null?(s=Sn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&1206910976,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function up(e,t){e.flags&=1206910978;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function uo(e,t,s,l,o,u){var v=0;if(l=e,typeof l=="function")Vu(l)&&(v=1);else if(typeof l=="string")v=EN(e,s,nt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case ke:return e=Sn(31,s,t,o),e.elementType=ke,e.lanes=u,e;case ne:return Xs(s.children,o,u,t);case F:v=8,o|=24;break;case Z:return e=Sn(12,s,t,o|2),e.elementType=Z,e.lanes=u,e;case H:return e=Sn(13,s,t,o),e.elementType=H,e.lanes=u,e;case L:return e=Sn(19,s,t,o),e.elementType=L,e.lanes=u,e;case Ne:case T:return e=o|32,e=Sn(30,s,t,e),e.elementType=T,e.lanes=u,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case ce:v=10;break e;case te:v=9;break e;case K:v=11;break e;case ee:v=14;break e;case de:v=16,l=null;break e}v=29,s=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=Sn(v,s,t,o),t.elementType=e,t.type=l,t.lanes=u,t}function Xs(e,t,s,l){return e=Sn(7,e,l,t),e.lanes=s,e}function Xu(e,t,s){return e=Sn(6,e,null,t),e.lanes=s,e}function dp(e){var t=Sn(18,null,null,0);return t.stateNode=e,t}function Ku(e,t,s){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fp=new WeakMap;function Xn(e,t){if(typeof e=="object"&&e!==null){var s=fp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:bl(t)},fp.set(e,t),t)}return{value:e,source:t,stack:bl(t)}}var Ml=[],_l=0,fo=null,Hi=0,Kn=[],Zn=0,is=null,ka=1,Ca="";function Ya(e,t){Ml[_l++]=Hi,Ml[_l++]=fo,fo=e,Hi=t}function hp(e,t,s){Kn[Zn++]=ka,Kn[Zn++]=Ca,Kn[Zn++]=is,is=e;var l=ka;e=Ca;var o=32-Nt(l)-1;l&=~(1<<o),s+=1;var u=32-Nt(t)+o;if(30<u){var v=o-o%5;u=(l&(1<<v)-1).toString(32),l>>=v,o-=v,ka=1<<32-Nt(t)+o|s<<o|l,Ca=u+e}else ka=1<<u|s<<o|l,Ca=e}function ho(e){e.return!==null&&(Ya(e,1),hp(e,1,0))}function Zu(e){for(;e===fo;)fo=Ml[--_l],Ml[_l]=null,Hi=Ml[--_l],Ml[_l]=null;for(;e===is;)is=Kn[--Zn],Kn[Zn]=null,Ca=Kn[--Zn],Kn[Zn]=null,ka=Kn[--Zn],Kn[Zn]=null}function mp(e,t){Kn[Zn++]=ka,Kn[Zn++]=Ca,Kn[Zn++]=is,ka=t.id,Ca=t.overflow,is=e}var Vt=null,ht=null,Be=!1,rs=null,Qn=!1,Qu=Error(c(519));function os(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bi(Xn(t,e)),Qu}function pp(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[Pt]=e,t[wn]=l,s){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(s=0;s<rr.length;s++)qe(rr[s],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),Tm(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),Rm(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||Lg(t.textContent,s)?(l.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),l.onScroll!=null&&qe("scroll",t),l.onScrollEnd!=null&&qe("scrollend",t),l.onClick!=null&&(t.onclick=Sa),t=!0):t=!1,t||os(e,!0)}function mo(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:Vt=Vt.return}}function Ll(e){if(e!==Vt)return!1;if(!Be)return mo(e),Be=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||kf(e.type,e.memoizedProps)),s=!s),s&&ht&&os(e),mo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ht=tv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ht=tv(e)}else t===27?(t=ht,Ss(e.type)?(e=Mf,Mf=null,ht=e):ht=t):ht=Vt?Pn(e.stateNode.nextSibling):null;return!0}function Ks(){ht=Vt=null,Be=!1}function Iu(){var e=rs;return e!==null&&(Tn===null?Tn=e:Tn.push.apply(Tn,e),rs=null),e}function Bi(e){rs===null?rs=[e]:rs.push(e)}var Pu=ue(null),Zs=null,Va=null;function cs(e,t,s){we(Pu,t._currentValue),t._currentValue=s}function Xa(e){e._currentValue=Pu.current,De(Pu)}function po(e,t,s){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===s)break;e=e.return}}function Fu(e,t,s,l){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){var v=o.child;u=u.firstContext;e:for(;u!==null;){var N=u;u=o;for(var z=0;z<t.length;z++)if(N.context===t[z]){u.lanes|=s,N=u.alternate,N!==null&&(N.lanes|=s),po(u.return,s,e),l||(v=null);break e}u=N.next}}else if(o.tag===18){if(v=o.return,v===null)throw Error(c(341));v.lanes|=s,u=v.alternate,u!==null&&(u.lanes|=s),po(v,s,e),v=null}else o.tag===13&&o.memoizedState!==null&&o.memoizedState.dehydrated===null?(o.lanes|=s,v=o.alternate,v!==null&&(v.lanes|=s),po(o.return,s,e),v=o.child,v=v!==null?v.sibling:null):v=o.child;if(v!==null)v.return=o;else for(v=o;v!==null;){if(v===e){v=null;break}if(o=v.sibling,o!==null){o.return=v.return,v=o;break}v=v.return}o=v}}function Qs(e,t,s,l){e=null;for(var o=t,u=!1;o!==null;){if(!u){if((o.flags&524288)!==0)u=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var v=o.alternate;if(v===null)throw Error(c(387));if(v=v.memoizedProps,v!==null){var N=o.type;On(o.pendingProps.value,v.value)||(e!==null?e.push(N):e=[N])}}else if(o===bt.current){if(v=o.alternate,v===null)throw Error(c(387));v.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ri):e=[ri])}o=o.return}return e!==null&&Fu(t,e,s,l),t.flags|=262144,e!==null}function xo(e){for(e=e.firstContext;e!==null;){if(!On(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Is(e){Zs=e,Va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return xp(Zs,e)}function go(e,t){return Zs===null&&Is(e),xp(e,t)}function xp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Va===null){if(e===null)throw Error(c(308));Va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Va=Va.next=t;return s}var t1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},n1=n.unstable_scheduleCallback,a1=n.unstable_NormalPriority,Ot={$$typeof:ce,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ju(){return{controller:new t1,data:new Map,refCount:0}}function $i(e){e.refCount--,e.refCount===0&&n1(a1,function(){e.controller.abort()})}function gp(e,t){if((e.pendingLanes&4194048)!==0){var s=e.transitionTypes;for(s===null&&(s=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];s.indexOf(l)===-1&&s.push(l)}}}var qi=null;function s1(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Gi=null,Wu=0,Ps=0,Ul=null;function l1(e,t){if(Gi===null){var s=Gi=[];Wu=0,Ps=xf(),Ul={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Wu++,t.then(vp,vp),t}function vp(){if(--Wu===0&&(qi=null,Gi!==null)){Ul!==null&&(Ul.status="fulfilled");var e=Gi;Gi=null,Ps=0,Ul=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function i1(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(o){s.push(o)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var o=0;o<s.length;o++)(0,s[o])(t)},function(o){for(l.status="rejected",l.reason=o,o=0;o<s.length;o++)(0,s[o])(void 0)}),l}var yp=me.S;me.S=function(e,t){if(dg=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&l1(e,t),qi!==null)for(var s=ti;s!==null;)gp(s,qi),s=s.next;if(s=e.types,s!==null){for(var l=ti;l!==null;)gp(l,s),l=l.next;if(Ps!==0){l=qi,l===null&&(l=qi=[]);for(var o=0;o<s.length;o++){var u=s[o];l.indexOf(u)===-1&&l.push(u)}}}yp!==null&&yp(e,t)};var Fs=ue(null);function ed(){var e=Fs.current;return e!==null?e:dt.pooledCache}function vo(e,t){t===null?we(Fs,Fs.current):we(Fs,t.pool)}function bp(){var e=ed();return e===null?null:{parent:Ot._currentValue,pool:e}}var Hl=Error(c(460)),td=Error(c(474)),yo=Error(c(542)),bo={then:function(){}};function jp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Np(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Sa,Sa),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Sp(e),e===void 0&&!("reason"in t)?Error(c(600)):e;default:if(typeof t.status=="string")t.then(Sa,Sa);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=l}},function(l){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Sp(e),e}throw Ws=t,Hl}}function Js(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ws=s,Hl):s}}var Ws=null;function wp(){if(Ws===null)throw Error(c(459));var e=Ws;return Ws=null,e}function Sp(e){if(e===Hl||e===yo)throw Error(c(483))}var Bl=null,Yi=0;function jo(e){var t=Yi;return Yi+=1,Bl===null&&(Bl=[]),Np(Bl,e,t)}function us(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function No(e,t){throw t.$$typeof===M?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function kp(e){function t($,_){if(e){var X=$.deletions;X===null?($.deletions=[_],$.flags|=16):X.push(_)}}function s($,_){if(!e)return null;for(;_!==null;)t($,_),_=_.sibling;return null}function l($){for(var _=new Map;$!==null;)$.key===null?_.set($.index,$):_.set($.key,$),$=$.sibling;return _}function o($,_){return $=Ga($,_),$.index=0,$.sibling=null,$}function u($,_,X){return $.index=X,e?(X=$.alternate,X!==null?(X=X.index,X<_?($.flags|=2,_):X):($.flags|=134217730,_)):($.flags|=1048576,_)}function v($){return e&&$.alternate===null&&($.flags|=134217730),$}function N($,_,X,se){return _===null||_.tag!==6?(_=Xu(X,$.mode,se),_.return=$,_):(_=o(_,X),_.return=$,_)}function z($,_,X,se){var Se=X.type;return Se===ne?($=P($,_,X.props.children,se,X.key),us($,X),$):_!==null&&(_.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===de&&Js(Se)===_.type)?(_=o(_,X.props),us(_,X),_.return=$,_):(_=uo(X.type,X.key,X.props,null,$.mode,se),us(_,X),_.return=$,_)}function G($,_,X,se){return _===null||_.tag!==4||_.stateNode.containerInfo!==X.containerInfo||_.stateNode.implementation!==X.implementation?(_=Ku(X,$.mode,se),_.return=$,_):(_=o(_,X.children||[]),_.return=$,_)}function P($,_,X,se,Se){return _===null||_.tag!==7?(_=Xs(X,$.mode,se,Se),_.return=$,_):(_=o(_,X),_.return=$,_)}function le($,_,X){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=Xu(""+_,$.mode,X),_.return=$,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case W:return X=uo(_.type,_.key,_.props,null,$.mode,X),us(X,_),X.return=$,X;case I:return _=Ku(_,$.mode,X),_.return=$,_;case de:return _=Js(_),le($,_,X)}if(xe(_)||re(_))return _=Xs(_,$.mode,X,null),_.return=$,_;if(typeof _.then=="function")return le($,jo(_),X);if(_.$$typeof===ce)return le($,go($,_),X);No($,_)}return null}function B($,_,X,se){var Se=_!==null?_.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Se!==null?null:N($,_,""+X,se);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case W:return X.key===Se?z($,_,X,se):null;case I:return X.key===Se?G($,_,X,se):null;case de:return X=Js(X),B($,_,X,se)}if(xe(X)||re(X))return Se!==null?null:P($,_,X,se,null);if(typeof X.then=="function")return B($,_,jo(X),se);if(X.$$typeof===ce)return B($,_,go($,X),se);No($,X)}return null}function Q($,_,X,se,Se){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return $=$.get(X)||null,N(_,$,""+se,Se);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case W:return $=$.get(se.key===null?X:se.key)||null,z(_,$,se,Se);case I:return $=$.get(se.key===null?X:se.key)||null,G(_,$,se,Se);case de:return se=Js(se),Q($,_,X,se,Se)}if(xe(se)||re(se))return $=$.get(X)||null,P(_,$,se,Se,null);if(typeof se.then=="function")return Q($,_,X,jo(se),Se);if(se.$$typeof===ce)return Q($,_,X,go(_,se),Se);No(_,se)}return null}function pe($,_,X,se){for(var Se=null,Ye=null,ze=_,Ae=_=0,Lt=null;ze!==null&&Ae<X.length;Ae++){ze.index>Ae?(Lt=ze,ze=null):Lt=ze.sibling;var Fe=B($,ze,X[Ae],se);if(Fe===null){ze===null&&(ze=Lt);break}e&&ze&&Fe.alternate===null&&t($,ze),_=u(Fe,_,Ae),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe,ze=Lt}if(Ae===X.length)return s($,ze),Be&&Ya($,Ae),Se;if(ze===null){for(;Ae<X.length;Ae++)ze=le($,X[Ae],se),ze!==null&&(_=u(ze,_,Ae),Ye===null?Se=ze:Ye.sibling=ze,Ye=ze);return Be&&Ya($,Ae),Se}for(ze=l(ze);Ae<X.length;Ae++)Lt=Q(ze,$,Ae,X[Ae],se),Lt!==null&&(e&&(Fe=Lt.alternate,Fe!==null&&ze.delete(Fe.key===null?Ae:Fe.key)),_=u(Lt,_,Ae),Ye===null?Se=Lt:Ye.sibling=Lt,Ye=Lt);return e&&ze.forEach(function(Rs){return t($,Rs)}),Be&&Ya($,Ae),Se}function Ce($,_,X,se){if(X==null)throw Error(c(151));for(var Se=null,Ye=null,ze=_,Ae=_=0,Lt=null,Fe=X.next();ze!==null&&!Fe.done;Ae++,Fe=X.next()){ze.index>Ae?(Lt=ze,ze=null):Lt=ze.sibling;var Rs=B($,ze,Fe.value,se);if(Rs===null){ze===null&&(ze=Lt);break}e&&ze&&Rs.alternate===null&&t($,ze),_=u(Rs,_,Ae),Ye===null?Se=Rs:Ye.sibling=Rs,Ye=Rs,ze=Lt}if(Fe.done)return s($,ze),Be&&Ya($,Ae),Se;if(ze===null){for(;!Fe.done;Ae++,Fe=X.next())Fe=le($,Fe.value,se),Fe!==null&&(_=u(Fe,_,Ae),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe);return Be&&Ya($,Ae),Se}for(ze=l(ze);!Fe.done;Ae++,Fe=X.next())Fe=Q(ze,$,Ae,Fe.value,se),Fe!==null&&(e&&(Lt=Fe.alternate,Lt!==null&&ze.delete(Lt.key===null?Ae:Lt.key)),_=u(Fe,_,Ae),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe);return e&&ze.forEach(function($N){return t($,$N)}),Be&&Ya($,Ae),Se}function Le($,_,X,se){if(typeof X=="object"&&X!==null&&X.type===ne&&X.key===null&&X.props.ref===void 0&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case W:e:{for(var Se=X.key;_!==null;){if(_.key===Se){if(Se=X.type,Se===ne){if(_.tag===7){s($,_.sibling),se=o(_,X.props.children),us(se,X),se.return=$,$=se;break e}}else if(_.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===de&&Js(Se)===_.type){s($,_.sibling),se=o(_,X.props),us(se,X),se.return=$,$=se;break e}s($,_);break}else t($,_);_=_.sibling}X.type===ne?(se=Xs(X.props.children,$.mode,se,X.key),us(se,X),se.return=$,$=se):(se=uo(X.type,X.key,X.props,null,$.mode,se),us(se,X),se.return=$,$=se)}return v($);case I:e:{for(Se=X.key;_!==null;){if(_.key===Se)if(_.tag===4&&_.stateNode.containerInfo===X.containerInfo&&_.stateNode.implementation===X.implementation){s($,_.sibling),se=o(_,X.children||[]),se.return=$,$=se;break e}else{s($,_);break}else t($,_);_=_.sibling}se=Ku(X,$.mode,se),se.return=$,$=se}return v($);case de:return X=Js(X),Le($,_,X,se)}if(xe(X))return pe($,_,X,se);if(re(X)){if(Se=re(X),typeof Se!="function")throw Error(c(150));return X=Se.call(X),Ce($,_,X,se)}if(typeof X.then=="function")return Le($,_,jo(X),se);if(X.$$typeof===ce)return Le($,_,go($,X),se);No($,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,_!==null&&_.tag===6?(s($,_.sibling),se=o(_,X),se.return=$,$=se):(s($,_),se=Xu(X,$.mode,se),se.return=$,$=se),v($)):s($,_)}return function($,_,X,se){try{Yi=0;var Se=Le($,_,X,se);return Bl=null,Se}catch(ze){if(ze===Hl||ze===yo)throw ze;var Ye=Sn(29,ze,null,$.mode);return Ye.lanes=se,Ye.return=$,Ye}finally{}}}var el=kp(!0),Cp=kp(!1),ds=!1;function nd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ad(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 fs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hs(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(We&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,t=co(e),cp(e,null,s),t}return oo(e,l,t,s),co(e)}function Vi(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,hm(e,s)}}function sd(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var o=null,u=null;if(s=s.firstBaseUpdate,s!==null){do{var v={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};u===null?o=u=v:u=u.next=v,s=s.next}while(s!==null);u===null?o=u=t:u=u.next=t}else o=u=t;s={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var ld=!1;function Xi(){if(ld){var e=Ul;if(e!==null)throw e}}function Ki(e,t,s,l){ld=!1;var o=e.updateQueue;ds=!1;var u=o.firstBaseUpdate,v=o.lastBaseUpdate,N=o.shared.pending;if(N!==null){o.shared.pending=null;var z=N,G=z.next;z.next=null,v===null?u=G:v.next=G,v=z;var P=e.alternate;P!==null&&(P=P.updateQueue,N=P.lastBaseUpdate,N!==v&&(N===null?P.firstBaseUpdate=G:N.next=G,P.lastBaseUpdate=z))}if(u!==null){var le=o.baseState;v=0,P=G=z=null,N=u;do{var B=N.lane&-536870913,Q=B!==N.lane;if(Q?(Ge&B)===B:(l&B)===B){B!==0&&B===Ps&&(ld=!0),P!==null&&(P=P.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var pe=e,Ce=N;B=t;var Le=s;switch(Ce.tag){case 1:if(pe=Ce.payload,typeof pe=="function"){le=pe.call(Le,le,B);break e}le=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ce.payload,B=typeof pe=="function"?pe.call(Le,le,B):pe,B==null)break e;le=A({},le,B);break e;case 2:ds=!0}}B=N.callback,B!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=o.callbacks,Q===null?o.callbacks=[B]:Q.push(B))}else Q={lane:B,tag:N.tag,payload:N.payload,callback:N.callback,next:null},P===null?(G=P=Q,z=le):P=P.next=Q,v|=B;if(N=N.next,N===null){if(N=o.shared.pending,N===null)break;Q=N,N=Q.next,Q.next=null,o.lastBaseUpdate=Q,o.shared.pending=null}}while(!0);P===null&&(z=le),o.baseState=z,o.firstBaseUpdate=G,o.lastBaseUpdate=P,u===null&&(o.shared.lanes=0),bs|=v,e.lanes=v,e.memoizedState=le}}function Tp(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Ep(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Tp(s[e],t)}var ms=ue(null),wo=ue(0);function Rp(e,t){e=Pa,we(wo,e),we(ms,t),Pa=e|t.baseLanes}function id(){we(wo,Pa),we(ms,ms.current)}function rd(){Pa=wo.current,De(ms),De(wo)}var Jt=ue(null),sn=null;function ps(e){var t=e.alternate;we(Wt,Wt.current&1),we(Jt,e),sn===null&&(t===null||ms.current!==null||t.memoizedState!==null)&&(sn=e)}function od(e){we(Wt,Wt.current),we(Jt,e),sn===null&&(sn=e)}function zp(e){e.tag===22?(we(Wt,Wt.current),we(Jt,e),sn===null&&(sn=e)):xs()}function xs(){we(Wt,Wt.current),we(Jt,Jt.current)}function Mn(e){De(Jt),sn===e&&(sn=null),De(Wt)}var Wt=ue(0);function Zi(e,t){we(Jt,Jt.current),we(Wt,t)}function cd(e){De(Wt),De(Jt),sn===e&&(sn=null)}function So(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Af(s)||Of(s)))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 Ka=0,_e=null,ot=null,Mt=null,ko=!1,$l=!1,tl=!1,Co=0,Qi=0,ql=null,r1=0;function wt(){throw Error(c(321))}function ud(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!On(e[s],t[s]))return!1;return!0}function dd(e,t,s,l,o,u){return Ka=u,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?hx:mx,tl=!1,u=s(l,o),tl=!1,$l&&(u=Ap(t,s,l,o)),Dp(e),u}function Dp(e){me.H=Oo;var t=ot!==null&&ot.next!==null;if(Ka=0,Mt=ot=_e=null,ko=!1,Qi=0,ql=null,t)throw Error(c(300));e===null||_t||(e=e.dependencies,e!==null&&xo(e)&&(_t=!0))}function Ap(e,t,s,l){_e=e;var o=0;do{if($l&&(ql=null),Qi=0,$l=!1,25<=o)throw Error(c(301));if(o+=1,Mt=ot=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}me.H=p1,u=t(s,l)}while($l);return u}function o1(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Ii(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(_e.flags|=1024),t}function fd(){var e=Co!==0;return Co=0,e}function hd(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function md(e){if(ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ko=!1}Ka=0,Mt=ot=_e=null,$l=!1,Qi=Co=0,ql=null}function dn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function zt(){if(ot===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Mt===null?_e.memoizedState:Mt.next;if(t!==null)Mt=t,ot=e;else{if(e===null)throw _e.alternate===null?Error(c(467)):Error(c(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ii(e){var t=Qi;return Qi+=1,ql===null&&(ql=[]),e=Np(ql,e,t),t=_e,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?hx:mx),e}function Eo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ii(e);if(e.$$typeof===q)return;if(e.$$typeof===ce)return Ft(e)}throw Error(c(438,String(e)))}function pd(e){var t=null,s=_e.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=_e.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=To(),_e.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=Ee;return t.index++,s}function Za(e,t){return typeof t=="function"?t(e):t}function Ro(e){var t=zt();return xd(t,ot,e)}function xd(e,t,s){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=s;var o=e.baseQueue,u=l.pending;if(u!==null){if(o!==null){var v=o.next;o.next=u.next,u.next=v}t.baseQueue=o=u,l.pending=null}if(u=e.baseState,o===null)e.memoizedState=u;else{t=o.next;var N=v=null,z=null,G=t,P=!1;do{var le=G.lane&-536870913;if(le!==G.lane?(Ge&le)===le:(Ka&le)===le){var B=G.revertLane;if(B===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),le===Ps&&(P=!0);else if((Ka&B)===B){G=G.next,B===Ps&&(P=!0);continue}else le={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},z===null?(N=z=le,v=u):z=z.next=le,_e.lanes|=B,bs|=B;le=G.action,tl&&s(u,le),u=G.hasEagerState?G.eagerState:s(u,le)}else B={lane:le,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},z===null?(N=z=B,v=u):z=z.next=B,_e.lanes|=le,bs|=le;G=G.next}while(G!==null&&G!==t);if(z===null?v=u:z.next=N,!On(u,e.memoizedState)&&(_t=!0,P&&(s=Ul,s!==null)))throw s;e.memoizedState=u,e.baseState=v,e.baseQueue=z,l.lastRenderedState=u}return o===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function gd(e){var t=zt(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var l=s.dispatch,o=s.pending,u=t.memoizedState;if(o!==null){s.pending=null;var v=o=o.next;do u=e(u,v.action),v=v.next;while(v!==o);On(u,t.memoizedState)||(_t=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),s.lastRenderedState=u}return[u,l]}function Op(e,t,s){var l=_e,o=zt(),u=Be;if(u){if(s===void 0)throw Error(c(407));s=s()}else s=t();var v=!On((ot||o).memoizedState,s);if(v&&(o.memoizedState=s,_t=!0),o=o.queue,bd(Lp.bind(null,l,o,e),[e]),e=o.getSnapshot!==t||v||Mt!==null&&(Mt.memoizedState.tag&1)!==0,Gl(e?9:8,{destroy:void 0},_p.bind(null,l,o,s,t),null),e){if(l.flags|=2048,dt===null)throw Error(c(349));u||(Ka&127)!==0||Mp(l,t,s)}return s}function Mp(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=_e.updateQueue,t===null?(t=To(),_e.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function _p(e,t,s,l){t.value=s,t.getSnapshot=l,Up(t)&&Hp(e)}function Lp(e,t,s){return s(function(){Up(t)&&Hp(e)})}function Up(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!On(e,s)}catch{return!0}}function Hp(e){var t=Vs(e,2);t!==null&&En(t,e,2)}function vd(e){var t=dn();if(typeof e=="function"){var s=e;if(e=s(),tl){ft(!0);try{s()}finally{ft(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:e},t}function Bp(e,t,s,l){return e.baseState=s,xd(e,ot,typeof l=="function"?l:Za)}function c1(e,t,s,l,o){if(Ao(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){u.listeners.push(v)}};me.T!==null?s(!0):u.isTransition=!1,l(u),s=t.pending,s===null?(u.next=t.pending=u,$p(t,u)):(u.next=s.next,t.pending=s.next=u)}}function $p(e,t){var s=t.action,l=t.payload,o=e.state;if(t.isTransition){var u=me.T,v={};v.types=u!==null?u.types:null,me.T=v;try{var N=s(o,l),z=me.S;z!==null&&z(v,N),qp(e,t,N)}catch(G){yd(e,t,G)}finally{u!==null&&v.types!==null&&(u.types=v.types),me.T=u}}else try{u=s(o,l),qp(e,t,u)}catch(G){yd(e,t,G)}}function qp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Gp(e,t,l)},function(l){return yd(e,t,l)}):Gp(e,t,s)}function Gp(e,t,s){t.status="fulfilled",t.value=s,Yp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,$p(e,s)))}function yd(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,Yp(t),t=t.next;while(t!==l)}e.action=null}function Yp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Vp(e,t){return t}function Xp(e,t){if(Be){var s=dt.formState;if(s!==null){e:{var l=_e;if(Be){if(ht){t:{for(var o=ht,u=Qn;o.nodeType!==8;){if(!u){o=null;break t}if(o=Pn(o.nextSibling),o===null){o=null;break t}}u=o.data,o=u==="F!"||u==="F"?o:null}if(o){ht=Pn(o.nextSibling),l=o.data==="F!";break e}}os(l)}l=!1}l&&(t=s[0])}}return s=dn(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vp,lastRenderedState:t},s.queue=l,s=ux.bind(null,_e,l),l.dispatch=s,l=vd(!1),u=kd.bind(null,_e,!1,l.queue),l=dn(),o={state:t,dispatch:null,action:e,pending:null},l.queue=o,s=c1.bind(null,_e,o,u,s),o.dispatch=s,l.memoizedState=e,[t,s,!1]}function Kp(e){var t=zt();return Zp(t,ot,e)}function Zp(e,t,s){if(t=xd(e,t,Vp)[0],e=Ro(Za)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ii(t)}catch(v){throw v===Hl?yo:v}else l=t;t=zt();var o=t.queue,u=o.dispatch;return s!==t.memoizedState&&(_e.flags|=2048,Gl(9,{destroy:void 0},u1.bind(null,o,s),null)),[l,u,e]}function u1(e,t){e.action=t}function Qp(e){var t=zt(),s=ot;if(s!==null)return Zp(t,s,e);zt(),t=t.memoizedState,s=zt();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function Gl(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=_e.updateQueue,t===null&&(t=To(),_e.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Ip(){return zt().memoizedState}function zo(e,t,s,l){var o=dn();_e.flags|=e,o.memoizedState=Gl(1|t,{destroy:void 0},s,l===void 0?null:l)}function Do(e,t,s,l){var o=zt();l=l===void 0?null:l;var u=o.memoizedState.inst;ot!==null&&l!==null&&ud(l,ot.memoizedState.deps)?o.memoizedState=Gl(t,u,s,l):(_e.flags|=e,o.memoizedState=Gl(1|t,u,s,l))}function Pp(e,t){zo(8390656,8,e,t)}function bd(e,t){Do(2048,8,e,t)}function d1(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=To(),_e.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Fp(e){var t=zt().memoizedState;return d1({ref:t,nextImpl:e}),function(){if((We&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Jp(e,t){return Do(4,2,e,t)}function Wp(e,t){return Do(4,4,e,t)}function ex(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tx(e,t,s){s=s!=null?s.concat([e]):null,Do(4,4,ex.bind(null,t,e),s)}function jd(){}function nx(e,t){var s=zt();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&ud(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function ax(e,t){var s=zt();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&ud(t,l[1]))return l[0];if(l=e(),tl){ft(!0);try{e()}finally{ft(!1)}}return s.memoizedState=[l,t],l}function Nd(e,t,s){return s===void 0||(Ka&1073741824)!==0&&(Ge&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=hg(),_e.lanes|=e,bs|=e,s)}function sx(e,t,s,l){return On(s,t)?s:ms.current!==null?(e=Nd(e,s,l),On(e,t)||(_t=!0),e):(Ka&106)===0||(Ka&1073741824)!==0&&(Ge&261930)===0?(_t=!0,e.memoizedState=s):(e=hg(),_e.lanes|=e,bs|=e,t)}function lx(e,t,s,l,o){var u=ie.p;ie.p=u!==0&&8>u?u:8;var v=me.T,N={};N.types=v!==null?v.types:null,me.T=N,kd(e,!1,t,s);try{var z=o(),G=me.S;if(G!==null&&G(N,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var P=i1(z,l);Pi(e,t,P,Hn(e))}else Pi(e,t,l,Hn(e))}catch(le){Pi(e,t,{then:function(){},status:"rejected",reason:le},Hn())}finally{ie.p=u,v!==null&&N.types!==null&&(v.types=N.types),me.T=v}}function f1(){}function wd(e,t,s,l){if(e.tag!==5)throw Error(c(476));var o=ix(e).queue;lx(e,o,t,Pe,s===null?f1:function(){return rx(e),s(l)})}function ix(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Pe,baseState:Pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:Pe},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rx(e){var t=ix(e);t.next===null&&(t=e.alternate.memoizedState),Pi(e,t.next.queue,{},Hn())}function Sd(){return Ft(ri)}function ox(){return zt().memoizedState}function cx(){return zt().memoizedState}function h1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Hn();e=fs(s);var l=hs(t,e,s);l!==null&&(En(l,t,s),Vi(l,t,s)),t={cache:Ju()},e.payload=t;return}t=t.return}}function m1(e,t,s){var l=Hn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ao(e)?dx(t,s):(s=Yu(e,t,s,l),s!==null&&(En(s,e,l),fx(s,t,l)))}function ux(e,t,s){var l=Hn();Pi(e,t,s,l)}function Pi(e,t,s,l){var o={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ao(e))dx(t,o);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var v=t.lastRenderedState,N=u(v,s);if(o.hasEagerState=!0,o.eagerState=N,On(N,v))return oo(e,t,o,0),dt===null&&ro(),!1}catch{}finally{}if(s=Yu(e,t,o,l),s!==null)return En(s,e,l),fx(s,t,l),!0}return!1}function kd(e,t,s,l){if(l={lane:2,revertLane:xf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ao(e)){if(t)throw Error(c(479))}else t=Yu(e,s,l,2),t!==null&&En(t,e,2)}function Ao(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function dx(e,t){$l=ko=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function fx(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,hm(e,s)}}var Oo={readContext:Ft,use:Eo,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},hx={readContext:Ft,use:Eo,useCallback:function(e,t){return dn().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:Pp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,zo(4194308,4,ex.bind(null,t,e),s)},useLayoutEffect:function(e,t){return zo(4194308,4,e,t)},useInsertionEffect:function(e,t){zo(4,2,e,t)},useMemo:function(e,t){var s=dn();t=t===void 0?null:t;var l=e();if(tl){ft(!0);try{e()}finally{ft(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=dn();if(s!==void 0){var o=s(t);if(tl){ft(!0);try{s(t)}finally{ft(!1)}}}else o=t;return l.memoizedState=l.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},l.queue=e,e=e.dispatch=m1.bind(null,_e,e),[l.memoizedState,e]},useRef:function(e){var t=dn();return e={current:e},t.memoizedState=e},useState:function(e){e=vd(e);var t=e.queue,s=ux.bind(null,_e,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:jd,useDeferredValue:function(e,t){var s=dn();return Nd(s,e,t)},useTransition:function(){var e=vd(!1);return e=lx.bind(null,_e,e.queue,!0,!1),dn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=_e,o=dn();if(Be){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),dt===null)throw Error(c(349));(Ge&127)!==0||Mp(l,t,s)}o.memoizedState=s;var u={value:s,getSnapshot:t};return o.queue=u,Pp(Lp.bind(null,l,u,e),[e]),l.flags|=2048,Gl(9,{destroy:void 0},_p.bind(null,l,u,s,t),null),s},useId:function(){var e=dn(),t=dt.identifierPrefix;if(Be){var s=Ca,l=ka;s=(l&~(1<<32-Nt(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Co++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=r1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Sd,useFormState:Xp,useActionState:Xp,useOptimistic:function(e){var t=dn();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=kd.bind(null,_e,!0,s),s.dispatch=t,[e,t]},useMemoCache:pd,useCacheRefresh:function(){return dn().memoizedState=h1.bind(null,_e)},useEffectEvent:function(e){var t=dn(),s={impl:e};return t.memoizedState=s,function(){if((We&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}},mx={readContext:Ft,use:Eo,useCallback:nx,useContext:Ft,useEffect:bd,useImperativeHandle:tx,useInsertionEffect:Jp,useLayoutEffect:Wp,useMemo:ax,useReducer:Ro,useRef:Ip,useState:function(){return Ro(Za)},useDebugValue:jd,useDeferredValue:function(e,t){var s=zt();return sx(s,ot.memoizedState,e,t)},useTransition:function(){var e=Ro(Za)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:Ii(e),t]},useSyncExternalStore:Op,useId:ox,useHostTransitionStatus:Sd,useFormState:Kp,useActionState:Kp,useOptimistic:function(e,t){var s=zt();return Bp(s,ot,e,t)},useMemoCache:pd,useCacheRefresh:cx,useEffectEvent:Fp},p1={readContext:Ft,use:Eo,useCallback:nx,useContext:Ft,useEffect:bd,useImperativeHandle:tx,useInsertionEffect:Jp,useLayoutEffect:Wp,useMemo:ax,useReducer:gd,useRef:Ip,useState:function(){return gd(Za)},useDebugValue:jd,useDeferredValue:function(e,t){var s=zt();return ot===null?Nd(s,e,t):sx(s,ot.memoizedState,e,t)},useTransition:function(){var e=gd(Za)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:Ii(e),t]},useSyncExternalStore:Op,useId:ox,useHostTransitionStatus:Sd,useFormState:Qp,useActionState:Qp,useOptimistic:function(e,t){var s=zt();return ot!==null?Bp(s,ot,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:pd,useCacheRefresh:cx,useEffectEvent:Fp};function Cd(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:A({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Td={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=Hn(),o=fs(l);o.payload=t,s!=null&&(o.callback=s),t=hs(e,o,l),t!==null&&(En(t,e,l),Vi(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=Hn(),o=fs(l);o.tag=1,o.payload=t,s!=null&&(o.callback=s),t=hs(e,o,l),t!==null&&(En(t,e,l),Vi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Hn(),l=fs(s);l.tag=2,t!=null&&(l.callback=t),t=hs(e,l,s),t!==null&&(En(t,e,s),Vi(t,e,s))}};function px(e,t,s,l,o,u,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,v):t.prototype&&t.prototype.isPureReactComponent?!Li(s,l)||!Li(o,u):!0}function xx(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&Td.enqueueReplaceState(t,t.state,null)}function nl(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=A({},s));for(var o in e)s[o]===void 0&&(s[o]=e[o])}return s}function gx(e){io(e)}function vx(e){console.error(e)}function yx(e){io(e)}function Mo(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function bx(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Ed(e,t,s){return s=fs(s),s.tag=3,s.payload={element:null},s.callback=function(){Mo(e,t)},s}function jx(e){return e=fs(e),e.tag=3,e}function Nx(e,t,s,l){var o=s.type.getDerivedStateFromError;if(typeof o=="function"){var u=l.value;e.payload=function(){return o(u)},e.callback=function(){bx(t,s,l)}}var v=s.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){bx(t,s,l),typeof o!="function"&&(js===null?js=new Set([this]):js.add(this));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})})}function x1(e,t,s,l,o){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&Qs(t,s,o,!0),s=Jt.current,s!==null){switch(s.tag){case 31:case 13:case 19:return sn===null?tc():s.alternate===null&&St===0&&(St=3),s.flags&=-257,s.flags|=65536,s.lanes=o,l===bo?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),hf(e,l,o)),!1;case 22:return s.flags|=65536,l===bo?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),hf(e,l,o)),!1}throw Error(c(435,s.tag))}return hf(e,l,o),tc(),!1}if(Be)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,l!==Qu&&(e=Error(c(422),{cause:l}),Bi(Xn(e,s)))):(l!==Qu&&(t=Error(c(423),{cause:l}),Bi(Xn(t,s))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,l=Xn(l,s),o=Ed(e.stateNode,l,o),sd(e,o),St!==4&&(St=2)),!1;var u=Error(c(520),{cause:l});if(u=Xn(u,s),sr===null?sr=[u]:sr.push(u),St!==4&&(St=2),t===null)return!0;l=Xn(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=o&-o,s.lanes|=e,e=Ed(s.stateNode,l,e),sd(s,e),!1;case 1:if(t=s.type,u=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(js===null||!js.has(u))))return s.flags|=65536,o&=-o,s.lanes|=o,o=jx(o),Nx(o,e,s,l),sd(s,o),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var Rd=Error(c(461)),_t=!1;function Bt(e,t,s,l){t.child=e===null?Cp(t,null,s,l):el(t,e.child,s,l)}function wx(e,t,s,l,o){s=s.render;var u=t.ref;if("ref"in l){var v={};for(var N in l)N!=="ref"&&(v[N]=l[N])}else v=l;return Is(t),l=dd(e,t,s,v,u,o),N=fd(),e!==null&&!_t?(hd(e,t,o),Qa(e,t,o)):(Be&&N&&ho(t),t.flags|=1,Bt(e,t,l,o),t.child)}function Sx(e,t,s,l,o){if(e===null){var u=s.type;return typeof u=="function"&&!Vu(u)&&u.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=u,kx(e,t,u,l,o)):(e=uo(s.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Ud(e,o)){var v=u.memoizedProps;if(s=s.compare,s=s!==null?s:Li,s(v,l)&&e.ref===t.ref)return Qa(e,t,o)}return t.flags|=1,e=Ga(u,l),e.ref=t.ref,e.return=t,t.child=e}function kx(e,t,s,l,o){if(e!==null){var u=e.memoizedProps;if(Li(u,l)&&e.ref===t.ref)if(_t=!1,t.pendingProps=l=u,Ud(e,o))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,Qa(e,t,o)}return zd(e,t,s,l,o)}function Cx(e,t,s,l){var o=l.children,u=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(u=u!==null?u.baseLanes|s:s,e!==null){for(l=t.child=e.child,o=0;l!==null;)o=o|l.lanes|l.childLanes,l=l.sibling;l=o&~u}else l=0,t.child=null;return Tx(e,t,u,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vo(t,u!==null?u.cachePool:null),u!==null?Rp(t,u):id(),zp(t);else return l=t.lanes=536870912,Tx(e,t,u!==null?u.baseLanes|s:s,s,l)}else u!==null?(vo(t,u.cachePool),Rp(t,u),xs(),t.memoizedState=null):(e!==null&&vo(t,null),id(),xs());return Bt(e,t,o,s),t.child}function Fi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Tx(e,t,s,l,o){var u=ed();return u=u===null?null:{parent:Ot._currentValue,pool:u},t.memoizedState={baseLanes:s,cachePool:u},e!==null&&vo(t,null),id(),zp(t),e!==null&&Qs(e,t,l,!0),t.childLanes=o,null}function _o(e,t){return t=Lo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ex(e,t,s){return el(t,e.child,null,s),e=_o(t,t.pendingProps),e.flags|=2,Mn(t),t.memoizedState=null,e}function g1(e,t,s){var l=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(l.mode==="hidden")return e=_o(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Fi(null,e);if(od(t),(e=ht)?(e=ev(e,Qn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:is!==null?{id:ka,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},s=dp(e),s.return=t,t.child=s,Vt=t,ht=null)):e=null,e===null)throw os(t);return t.lanes=536870912,null}return _o(t,l)}var u=e.memoizedState;if(u!==null){var v=u.dehydrated;if(od(t),o)if(t.flags&256)t.flags&=-257,t=Ex(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(_t||Qs(e,t,s,!1),o=(s&e.childLanes)!==0,_t||o){if(ms.current===null){if(l=dt,l!==null&&(v=mm(l,s),v!==0&&v!==u.retryLane))throw u.retryLane=v,Vs(e,v),En(l,e,v),Rd;tc()}t=Ex(e,t,s)}else e=u.treeContext,ht=Pn(v.nextSibling),Vt=t,Be=!0,rs=null,Qn=!1,e!==null&&mp(t,e),t=_o(t,l),t.flags|=134221824;return t}return e=Ga(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Yl(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(c(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function zd(e,t,s,l,o){return Is(t),s=dd(e,t,s,l,void 0,o),l=fd(),e!==null&&!_t?(hd(e,t,o),Qa(e,t,o)):(Be&&l&&ho(t),t.flags|=1,Bt(e,t,s,o),t.child)}function Rx(e,t,s,l,o,u){return Is(t),t.updateQueue=null,s=Ap(t,l,s,o),Dp(e),l=fd(),e!==null&&!_t?(hd(e,t,u),Qa(e,t,u)):(Be&&l&&ho(t),t.flags|=1,Bt(e,t,s,u),t.child)}function zx(e,t,s,l,o){if(Is(t),t.stateNode===null){var u=Ol,v=s.contextType;typeof v=="object"&&v!==null&&(u=Ft(v)),u=new s(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Td,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},nd(t),v=s.contextType,u.context=typeof v=="object"&&v!==null?Ft(v):Ol,u.state=t.memoizedState,v=s.getDerivedStateFromProps,typeof v=="function"&&(Cd(t,s,v,l),u.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(v=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),v!==u.state&&Td.enqueueReplaceState(u,u.state,null),Ki(t,l,u,o),Xi(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var N=t.memoizedProps,z=nl(s,N);u.props=z;var G=u.context,P=s.contextType;v=Ol,typeof P=="object"&&P!==null&&(v=Ft(P));var le=s.getDerivedStateFromProps;P=typeof le=="function"||typeof u.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,P||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(N||G!==v)&&xx(t,u,l,v),ds=!1;var B=t.memoizedState;u.state=B,Ki(t,l,u,o),Xi(),G=t.memoizedState,N||B!==G||ds?(typeof le=="function"&&(Cd(t,s,le,l),G=t.memoizedState),(z=ds||px(t,s,z,l,B,G,v))?(P||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=G),u.props=l,u.state=G,u.context=v,l=z):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,ad(e,t),v=t.memoizedProps,P=nl(s,v),u.props=P,le=t.pendingProps,B=u.context,G=s.contextType,z=Ol,typeof G=="object"&&G!==null&&(z=Ft(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(v!==le||B!==z)&&xx(t,u,l,z),ds=!1,B=t.memoizedState,u.state=B,Ki(t,l,u,o),Xi();var Q=t.memoizedState;v!==le||B!==Q||ds||e!==null&&e.dependencies!==null&&xo(e.dependencies)?(typeof N=="function"&&(Cd(t,s,N,l),Q=t.memoizedState),(P=ds||px(t,s,P,l,B,Q,z)||e!==null&&e.dependencies!==null&&xo(e.dependencies))?(G||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,Q,z),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,Q,z)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||v===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Q),u.props=l,u.state=Q,u.context=z,l=P):(typeof u.componentDidUpdate!="function"||v===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,Yl(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=el(t,e.child,null,o),t.child=el(t,null,s,o)):Bt(e,t,s,o),t.memoizedState=u.state,e=t.child):e=Qa(e,t,o),e}function Dx(e,t,s,l){return Ks(),t.flags|=256,Bt(e,t,s,l),t.child}var Dd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ad(e){return{baseLanes:e,cachePool:bp()}}function Od(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Un),e}function Ax(e,t,s){var l=t.pendingProps,o=!1,u=(t.flags&128)!==0,v;if((v=u)||(v=e!==null&&e.memoizedState===null?!1:(Wt.current&2)!==0),v&&(o=!0,t.flags&=-129),v=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(o?ps(t):xs(),(e=ht)?(e=ev(e,Qn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:is!==null?{id:ka,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},s=dp(e),s.return=t,t.child=s,Vt=t,ht=null)):e=null,e===null)throw os(t);return Of(e)?t.lanes=32:t.lanes=536870912,null}return u=l.children,l=l.fallback,o?(xs(),o=t.mode,u=Lo({mode:"hidden",children:u},o),l=Xs(l,o,s,null),u.return=t,l.return=t,u.sibling=l,t.child=u,l=t.child,l.memoizedState=Ad(s),l.childLanes=Od(e,v,s),t.memoizedState=Dd,Fi(null,l)):(ps(t),Md(t,u))}var N=e.memoizedState;if(N!==null){var z=N.dehydrated;if(z!==null)return v1(e,t,u,v,l,z,N,s)}return o?(xs(),o=l.fallback,u=t.mode,N=e.child,z=N.sibling,l=Ga(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&1206910976,z!==null?o=Ga(z,o):(o=Xs(o,u,s,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,Fi(null,l),l=t.child,o=e.child.memoizedState,o===null?o=Ad(s):(u=o.cachePool,u!==null?(N=Ot._currentValue,u=u.parent!==N?{parent:N,pool:N}:u):u=bp(),o={baseLanes:o.baseLanes|s,cachePool:u}),l.memoizedState=o,l.childLanes=Od(e,v,s),t.memoizedState=Dd,Fi(e.child,l)):(ps(t),s=e.child,e=s.sibling,s=Ga(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(v=t.deletions,v===null?(t.deletions=[e],t.flags|=16):v.push(e)),t.child=s,t.memoizedState=null,s)}function Md(e,t){return t=Lo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Lo(e,t){return e=Sn(22,e,null,t),e.lanes=0,e}function Uo(e,t,s){return el(t,e.child,null,s),e=Md(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function v1(e,t,s,l,o,u,v,N){if(s)return t.flags&256?(ps(t),t.flags&=-257,Uo(e,t,N)):t.memoizedState!==null?(xs(),t.child=e.child,t.flags|=128,null):(xs(),u=o.fallback,v=t.mode,o=Lo({mode:"visible",children:o.children},v),u=Xs(u,v,N,null),u.flags|=2,o.return=t,u.return=t,o.sibling=u,t.child=o,el(t,e.child,null,N),o=t.child,o.memoizedState=Ad(N),o.childLanes=Od(e,l,N),t.memoizedState=Dd,Fi(null,o));if(ps(t),Of(u)){if(l=u.nextSibling&&u.nextSibling.dataset,l)var z=l.dgst;return l=z,l!==""&&(o=Error(c(419)),o.stack="",o.digest=l,Bi({value:o,source:null,stack:null})),Uo(e,t,N)}if(_t||Qs(e,t,N,!1),l=(N&e.childLanes)!==0,_t||l){if(ms.current!==null)return Uo(e,t,N);if(l=dt,l!==null&&(o=mm(l,N),o!==0&&o!==v.retryLane))throw v.retryLane=o,Vs(e,o),En(l,e,o),Rd;return Af(u)||tc(),Uo(e,t,N)}return Af(u)?(t.flags|=192,t.child=e.child,null):(e=v.treeContext,ht=Pn(u.nextSibling),Vt=t,Be=!0,rs=null,Qn=!1,e!==null&&mp(t,e),t=Md(t,o.children),t.flags|=134221824,t)}function Ox(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),po(e.return,t,s)}function Mx(e){for(var t=null;e!==null;){var s=e.alternate;s!==null&&So(s)===null&&(t=e),e=e.sibling}return t}function Ho(e,t,s,l,o,u){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:o,treeForkCount:u}:(v.isBackwards=t,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=s,v.tailMode=o,v.treeForkCount=u)}function _d(e){var t=e.child;for(e.child=null;t!==null;){var s=t.sibling;t.sibling=e.child,e.child=t,t=s}}function Ld(e,t,s){var l=t.pendingProps,o=l.revealOrder,u=l.tail;l=l.children;var v=Wt.current;if(t.flags&128)return Zi(t,v),null;var N=(v&2)!==0;if(N?(v=v&1|2,t.flags|=128):v&=1,Zi(t,v),o==="backwards"&&e!==null?(_d(e),Bt(e,t,l,s),_d(e)):Bt(e,t,l,s),l=Be?Hi:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ox(e,s,t);else if(e.tag===19)Ox(e,s,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(o){case"backwards":s=Mx(t.child),s===null?(o=t.child,t.child=null):(o=s.sibling,s.sibling=null,_d(t)),Ho(t,!0,o,null,u,l);break;case"unstable_legacy-backwards":for(s=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&So(e)===null){t.child=o;break}e=o.sibling,o.sibling=s,s=o,o=e}Ho(t,!0,s,null,u,l);break;case"together":Ho(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:s=Mx(t.child),s===null?(o=t.child,t.child=null):(o=s.sibling,s.sibling=null),Ho(t,!1,o,s,u,l)}return t.child}function _x(e,t,s){var l=t.pendingProps;return cs(t,t.type,l.value),Bt(e,t,l.children,s),t.child}function Qa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),bs|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Qs(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,s=Ga(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Ga(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Ud(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&xo(e)))}function y1(e,t,s){switch(t.tag){case 3:zn(t,t.stateNode.containerInfo),cs(t,Ot,e.memoizedState.cache),Ks();break;case 27:case 5:na(t);break;case 4:zn(t,t.stateNode.containerInfo);break;case 10:cs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,od(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return ps(t),t.flags|=128,null;l=Qs(e,t,s,!1);var o=t.child.childLanes;return l||(s&o)!==0?Ax(e,t,s):(ps(t),e=Qa(e,t,s),e!==null?e.sibling:null)}ps(t);break;case 19:if(t.flags&128)return Ld(e,t,s);if(o=(e.flags&128)!==0,l=(s&t.childLanes)!==0,l||(Qs(e,t,s,!1),l=(s&t.childLanes)!==0),o){if(l)return Ld(e,t,s);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Zi(t,Wt.current),l)break;return null;case 22:return t.lanes=0,Cx(e,t,s,t.pendingProps);case 24:cs(t,Ot,e.memoizedState.cache)}return Qa(e,t,s)}function Lx(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!Ud(e,s)&&(t.flags&128)===0)return _t=!1,y1(e,t,s);_t=(e.flags&131072)!==0}else _t=!1,Be&&(t.flags&1048576)!==0&&hp(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Js(t.elementType),t.type=e,typeof e=="function")Vu(e)?(l=nl(e,l),t.tag=1,t=zx(null,t,e,l,s)):(t.tag=0,t=zd(null,t,e,l,s));else{if(e!=null){var o=e.$$typeof;if(o===K){t.tag=11,t=wx(null,t,e,l,s);break e}else if(o===ee){t.tag=14,t=Sx(null,t,e,l,s);break e}else if(o===ce){t.tag=10,t.type=e,t=_x(null,t,s);break e}}throw t=Re(e)||e,Error(c(306,t,""))}}return t;case 0:return zd(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,o=nl(l,t.pendingProps),zx(e,t,l,o,s);case 3:e:{if(zn(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var u=t.memoizedState;o=u.element,ad(e,t),Ki(t,l,null,s);var v=t.memoizedState;if(l=v.cache,cs(t,Ot,l),l!==u.cache&&Fu(t,[Ot],s,!0),Xi(),l=v.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:v.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Dx(e,t,l,s);break e}else if(l!==o){o=Xn(Error(c(424)),t),Bi(o),t=Dx(e,t,l,s);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(ht=Pn(e.firstChild),Vt=t,Be=!0,rs=null,Qn=!0,s=Cp(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(Ks(),l===o){t=Qa(e,t,s);break e}Bt(e,t,l,s)}t=t.child}return t;case 26:return Yl(e,t),e===null?(s=rv(t.type,null,t.pendingProps,null))?t.memoizedState=s:Be||(t.stateNode=$g(t.type,t.pendingProps,xt.current,t)):t.memoizedState=rv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return na(t),e===null&&Be&&(l=t.stateNode=av(t.type,t.pendingProps,xt.current),Vt=t,Qn=!0,o=ht,Ss(t.type)?(Mf=o,ht=Pn(l.firstChild)):ht=o),Bt(e,t,t.pendingProps.children,s),Yl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((o=l=ht)&&(l=hN(l,t.type,t.pendingProps,Qn),l!==null?(t.stateNode=l,Vt=t,ht=Pn(l.firstChild),Qn=!1,o=!0):o=!1),o||os(t)),na(t),o=t.type,u=t.pendingProps,v=e!==null?e.memoizedProps:null,l=u.children,kf(o,u)?l=null:v!==null&&kf(o,v)&&(t.flags|=32),t.memoizedState!==null&&(o=dd(e,t,o1,null,null,s),ri._currentValue=o),Yl(e,t),Bt(e,t,l,s),t.child;case 6:return e===null&&Be&&((e=s=ht)&&(s=mN(s,t.pendingProps,Qn),s!==null?(t.stateNode=s,Vt=t,ht=null,e=!0):e=!1),e||os(t)),null;case 13:return Ax(e,t,s);case 4:return zn(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=el(t,null,l,s):Bt(e,t,l,s),t.child;case 11:return wx(e,t,t.type,t.pendingProps,s);case 7:return l=t.pendingProps,Yl(e,t),Bt(e,t,l,s),t.child;case 8:return Bt(e,t,t.pendingProps.children,s),t.child;case 12:return Bt(e,t,t.pendingProps.children,s),t.child;case 10:return _x(e,t,s);case 9:return o=t.type._context,l=t.pendingProps.children,Is(t),o=Ft(o),l=l(o),t.flags|=1,Bt(e,t,l,s),t.child;case 14:return Sx(e,t,t.type,t.pendingProps,s);case 15:return kx(e,t,t.type,t.pendingProps,s);case 19:return Ld(e,t,s);case 31:return g1(e,t,s);case 22:return Cx(e,t,s,t.pendingProps);case 24:return Is(t),l=Ft(Ot),e===null?(o=ed(),o===null&&(o=dt,u=Ju(),o.pooledCache=u,u.refCount++,u!==null&&(o.pooledCacheLanes|=s),o=u),t.memoizedState={parent:l,cache:o},nd(t),cs(t,Ot,o)):((e.lanes&s)!==0&&(ad(e,t),Ki(t,null,null,s),Xi()),o=e.memoizedState,u=t.memoizedState,o.parent!==l?(o={parent:l,cache:l},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),cs(t,Ot,l)):(l=u.cache,cs(t,Ot,l),l!==o.cache&&Fu(t,[Ot],s,!0))),Bt(e,t,t.pendingProps.children,s),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:Be&&ho(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Yl(e,t),Bt(e,t,l.children,s),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ia(e){e.flags|=4}function Hd(e,t,s,l,o){var u;if((u=(e.mode&32)!==0)&&(u=s===null?dv(t,l):dv(t,l)&&(l.src!==s.src||l.srcSet!==s.srcSet)),u){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(gg())e.flags|=8192;else throw Ws=bo,td}else e.flags&=-16777217}function Ux(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fv(t))if(gg())e.flags|=8192;else throw Ws=bo,td}function Bo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?dm():536870912,e.lanes|=t,Ql|=t)}function Ji(e,t){if(!Be)switch(e.tailMode){case"visible":break;case"collapsed":for(var s=e.tail,l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var o=e.child;o!==null;)s|=o.lanes|o.childLanes,l|=o.subtreeFlags&1206910976,l|=o.flags&1206910976,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)s|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function b1(e,t,s){var l=t.pendingProps;switch(Zu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Xa(Ot),jn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?Ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Iu())),mt(t),null;case 26:var o=t.type,u=t.memoizedState;return e===null?(Ia(t),u!==null?(mt(t),Ux(t,u)):(mt(t),Hd(t,o,null,l,s))):u?u!==e.memoizedState?(Ia(t),mt(t),Ux(t,u)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ia(t),mt(t),Hd(t,o,e,l,s)),null;case 27:if(J(t),s=xt.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return mt(t),t.subtreeFlags&=-33554433,null}e=nt.current,Ll(t)?pp(t):(e=av(o,l,s),t.stateNode=e,Ia(t))}return mt(t),t.subtreeFlags&=-33554433,null;case 5:if(J(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return mt(t),t.subtreeFlags&=-33554433,null}if(u=nt.current,Ll(t))pp(t);else{var v=cr(xt.current);switch(u){case 1:u=v.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:u=v.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":u=v.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":u=v.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":u=v.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?v.createElement(o,{is:l.is}):v.createElement(o)}}u[Pt]=t,u[wn]=l;e:for(v=t.child;v!==null;){if(v.tag===5||v.tag===6)u.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===t)break e;for(;v.sibling===null;){if(v.return===null||v.return===t)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}t.stateNode=u;e:switch(tn(u,o,l),o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ia(t)}}return mt(t),t.subtreeFlags&=-33554433,Hd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=xt.current,Ll(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,o=Vt,o!==null)switch(o.tag){case 27:case 5:l=o.memoizedProps}e[Pt]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||Lg(e.nodeValue,s)),e||os(t,!0)}else e=cr(e).createTextNode(l),e[Pt]=t,t.stateNode=e}return mt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ll(t),s!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Pt]=t}else Ks(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else s=Iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Mn(t),t):(Mn(t),null);if((t.flags&128)!==0)throw Error(c(558))}return mt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Ll(t),l!==null&&l.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[Pt]=t}else Ks(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),o=!1}else o=Iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Mn(t),t):(Mn(t),null)}return Mn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,o=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(o=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==o&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Bo(t,t.updateQueue),mt(t),null);case 4:return jn(),e===null&&bf(t.stateNode.containerInfo),t.flags|=67108864,mt(t),null;case 10:return Xa(t.type),mt(t),null;case 19:if(cd(t),l=t.memoizedState,l===null)return mt(t),null;if(o=(t.flags&128)!==0,u=l.rendering,u===null)if(o)Ji(l,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=So(e),u!==null){for(t.flags|=128,Ji(l,!1),e=u.updateQueue,t.updateQueue=e,Bo(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)up(s,e),s=s.sibling;return Zi(t,Wt.current&1|2),Be&&Ya(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ze()>Fo&&(t.flags|=128,o=!0,Ji(l,!1),t.lanes=4194304)}else{if(!o)if(e=So(u),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Bo(t,e),Ji(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!u.alternate&&!Be)return mt(t),null}else 2*Ze()-l.renderingStartTime>Fo&&s!==536870912&&(t.flags|=128,o=!0,Ji(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(s=e;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ze(),e.sibling=null,u=Wt.current,u=o?u&1|2:u&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!s||Be?Zi(t,u):(s=u,we(Jt,t),we(Wt,s),sn===null&&(sn=t)),Be&&Ya(t,l.treeForkCount),e}return mt(t),null;case 22:case 23:return Mn(t),rd(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),s=t.updateQueue,s!==null&&Bo(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&De(Fs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Xa(Ot),mt(t),null;case 25:return null;case 30:return t.flags|=33554432,mt(t),null}throw Error(c(156,t.tag))}function j1(e,t){switch(Zu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xa(Ot),jn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return J(t),null;case 31:if(t.memoizedState!==null){if(Mn(t),t.alternate===null)throw Error(c(340));Ks()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ks()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return cd(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 jn(),null;case 10:return Xa(t.type),null;case 22:case 23:return Mn(t),rd(),e!==null&&De(Fs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xa(Ot),null;case 25:return null;default:return null}}function Hx(e,t){switch(Zu(t),t.tag){case 3:Xa(Ot),jn();break;case 26:case 27:case 5:J(t);break;case 4:jn();break;case 31:t.memoizedState!==null&&Mn(t);break;case 13:Mn(t);break;case 19:cd(t);break;case 10:Xa(t.type);break;case 22:case 23:Mn(t),rd(),e!==null&&De(Fs);break;case 24:Xa(Ot)}}function Wi(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var o=l.next;s=o;do{if((s.tag&e)===e){l=void 0;var u=s.create,v=s.inst;l=u(),v.destroy=l}s=s.next}while(s!==o)}}catch(N){lt(t,t.return,N)}}function gs(e,t,s){try{var l=t.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var u=o.next;l=u;do{if((l.tag&e)===e){var v=l.inst,N=v.destroy;if(N!==void 0){v.destroy=void 0,o=t;var z=s,G=N;try{G()}catch(P){lt(o,z,P)}}}l=l.next}while(l!==u)}}catch(P){lt(t,t.return,P)}}function Bx(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Ep(t,s)}catch(l){lt(e,e.return,l)}}}function $x(e,t,s){s.props=nl(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){lt(e,t,l)}}function Ta(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var o=e.stateNode,u=$a(e.memoizedProps,o);(o.ref===null||o.ref.name!==u)&&(o.ref=Zg(u)),l=o.ref;break;case 7:if(e.stateNode===null){var v=new Bn(e);x(e.child,!1,dN,v,void 0,void 0),e.stateNode=v}l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(N){lt(e,t,N)}}function en(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(o){lt(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(o){lt(e,t,o)}else s.current=null}function $o(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var s=0;s<t.length;s++)Wg(e.stateNode,t[s])}function qx(e){for(var t=e.return;t!==null&&($d(t)&&Wg(e.stateNode,t.stateNode),!Bd(t));)t=t.return}function er(e){for(var t=e.return;t!==null&&($d(t)&&fN(e.stateNode,t.stateNode),!Bd(t));)t=t.return}function Bd(e){return e.tag===5||e.tag===3||e.tag===27}function $d(e){return e&&e.tag===7&&e.stateNode!==null}function qd(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(o){lt(e,e.return,o)}}function Gd(e,t,s){try{var l=e.stateNode;Z1(l,e.type,s,t),l[wn]=t}catch(o){lt(e,e.return,o)}}function Gx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ss(e.type)||e.tag===4}function Yd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gx(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&&Ss(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 Vd(e,t,s,l){var o=e.tag;if(o===5||o===6)o=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(o,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(o),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Sa)),$o(e,l),Je=!0;else if(o!==4&&(o===27&&($o(e,l),l=null,Ss(e.type)&&(s=e.stateNode,t=null)),e=e.child,e!==null))for(Vd(e,t,s,l),e=e.sibling;e!==null;)Vd(e,t,s,l),e=e.sibling}function qo(e,t,s,l){var o=e.tag;if(o===5||o===6)o=e.stateNode,t?s.insertBefore(o,t):s.appendChild(o),$o(e,l),Je=!0;else if(o!==4&&(o===27&&($o(e,l),l=null,Ss(e.type)&&(s=e.stateNode)),e=e.child,e!==null))for(qo(e,t,s,l),e=e.sibling;e!==null;)qo(e,t,s,l),e=e.sibling}function Yx(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);tn(t,l,s),t[Pt]=e,t[wn]=s}catch(u){lt(e,e.return,u)}}var Go=!1,_n=null;function Vx(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Go=!0)}var Ea=null;function Xx(){var e=Ea;return Ea=null,e}var kn=0;function Vl(e,t,s,l,o){return kn=0,Kx(e.child,t,s,l,o)}function Kx(e,t,s,l,o){for(var u=!1;e!==null;){if(e.tag===5){var v=e.stateNode;if(l!==null){var N=Ef(v);l.push(N),N.view&&(u=!0)}else u||Ef(v).view&&(u=!0);Go=!0,Xg(v,kn===0?t:t+"_"+kn,s),kn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&o||Kx(e.child,t,s,l,o)&&(u=!0));e=e.sibling}return u}function Ra(e,t){for(;e!==null;)e.tag===5?Kg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ra(e.child,t)),e=e.sibling}function Yo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(c(544));var s=t.name;t=qa(t.default,t.share),t!=="none"&&(Vl(e,s,t,null,!1)||Ra(e.child,!1))}e=e.sibling}}function Xd(e,t){if(e.tag===30){var s=e.stateNode,l=e.memoizedProps,o=$a(l,s),u=qa(l.default,s.paired?l.share:l.enter);u!=="none"?Vl(e,o,u,null,!1)?(Yo(e),s.paired||t||Jl(e,l.onEnter)):Ra(e.child,!1):Yo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Xd(e,t),e=e.sibling;else Yo(e)}function Kd(e){if(_n!==null&&_n.size!==0){var t=_n;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 s=e.memoizedProps,l=s.name;if(l!=null&&l!=="auto"){var o=t.get(l);if(o!==void 0){var u=qa(s.default,s.share);if(u!=="none"&&(Vl(e,l,u,null,!1)?(u=e.stateNode,o.paired=u,u.paired=o,Jl(e,s.onShare)):Ra(e.child,!1)),t.delete(l),t.size===0)break}}}Kd(e)}e=e.sibling}}}function Zd(e){if(e.tag===30){var t=e.memoizedProps,s=$a(t,e.stateNode),l=_n!==null?_n.get(s):void 0,o=qa(t.default,l!==void 0?t.share:t.exit);o!=="none"&&(Vl(e,s,o,null,!1)?l!==void 0?(o=e.stateNode,l.paired=o,o.paired=l,_n.delete(s),Jl(e,t.onShare)):Jl(e,t.onExit):Ra(e.child,!1)),_n!==null&&Kd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Zd(e),e=e.sibling;else _n!==null&&Kd(e)}function Zx(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,s=$a(t,e.stateNode);t=qa(t.default,t.update),e.flags&=-5,t!=="none"&&Vl(e,s,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Zx(e);e=e.sibling}}function Qd(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,Ra(e.child,!1))}Qd(e)}e=e.sibling}}function Vo(e){if(e.tag===30)e.stateNode.paired=null,Ra(e.child,!1),Qd(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Vo(e),e=e.sibling;else Qd(e)}function Qx(e){for(e=e.child;e!==null;)e.tag===30?Ra(e.child,!1):(e.subtreeFlags&33554432)!==0&&Qx(e),e=e.sibling}function Id(e,t,s,l,o,u,v){for(var N=!1;t!==null;){if(t.tag===5){var z=t.stateNode;if(u!==null&&kn<u.length){var G=u[kn],P=Ef(z);(G.view||P.view)&&(N=!0);var le;if(le=(e.flags&4)===0)if(P.clip)le=!0;else{le=G.rect;var B=P.rect;le=le.y!==B.y||le.x!==B.x||le.height!==B.height||le.width!==B.width}le&&(e.flags|=4),P.abs?P=!G.abs:(G=G.rect,P=P.rect,P=G.height!==P.height||G.width!==P.width),P&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Xg(z,kn===0?s:s+"_"+kn,o),N&&(e.flags&4)!==0||(Ea===null&&(Ea=[]),Ea.push(z,kn===0?l:l+"_"+kn,t.memoizedProps)),kn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&v?e.flags|=t.flags&32:Id(e,t.child,s,l,o,u,v)&&(N=!0));t=t.sibling}return N}function Ix(e,t){for(e=e.child;e!==null;){if(e.tag===30){var s=e.memoizedProps,l=e.stateNode,o=$a(s,l),u=qa(s.default,s.update),v;v=e.memoizedState,e.memoizedState=null,l=e;var N=e.child;kn=0,o=Id(l,N,o,o,u,v,!1),(e.flags&4)!==0&&o&&Jl(e,s.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Ix(e);e=e.sibling}}var Xt=!1,at=!1,za=!1,Pd=!1,Px=typeof WeakSet=="function"?WeakSet:Set,Kt=null,Da=!1,tr=!1,Xo=!1,Fd=!1;function N1(e,t,s){if(e=e.containerInfo,wf=oi,e=ep(e),Uu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var u=o.anchorOffset,v=o.focusNode;o=o.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var N=0,z=-1,G=-1,P=0,le=0,B=e,Q=null;t:for(;;){for(var pe;B!==l||u!==0&&B.nodeType!==3||(z=N+u),B!==v||o!==0&&B.nodeType!==3||(G=N+o),B.nodeType===3&&(N+=B.nodeValue.length),(pe=B.firstChild)!==null;)Q=B,B=pe;for(;;){if(B===e)break t;if(Q===l&&++P===u&&(z=N),Q===v&&++le===o&&(G=N),(pe=B.nextSibling)!==null)break;B=Q,Q=B.parentNode}B=pe}l=z===-1||G===-1?null:{start:z,end:G}}else l=null}l=l||{start:0,end:0}}else l=null;for(Sf={focusedElem:e,selectionRange:l},oi=!1,s=(s&335544064)===s,Kt=t,t=s?9270:1024;Kt!==null;){if(e=Kt,s&&(l=e.deletions,l!==null))for(u=0;u<l.length;u++)s&&Zd(l[u]);if(e.alternate===null&&(e.flags&2)!==0)s&&Vx(e),Ko(s);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&s&&Zd(l),Ko(s);continue}else if(l!==null&&l.memoizedState!==null){s&&Vx(e),Ko(s);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Kt=l):(s&&Zx(e),Ko(s))}}_n=null}function Ko(e){for(;Kt!==null;){var t=Kt,s=e,l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((o&1024)!==0&&l!==null){s=void 0,o=l.memoizedProps,l=l.memoizedState;var u=t.stateNode;try{var v=nl(t.type,o);s=u.getSnapshotBeforeUpdate(v,l),u.__reactInternalSnapshotBeforeUpdate=s}catch(N){lt(t,t.return,N)}}break;case 3:if((o&1024)!==0){if(l=t.stateNode.containerInfo,s=l.nodeType,s===9)Df(l);else if(s===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Df(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&l!==null&&(s=$a(l.memoizedProps,l.stateNode),o=t.memoizedProps,o=qa(o.default,o.update),o!=="none"&&Vl(l,s,o,l.memoizedState=[],!0));break;default:if((o&1024)!==0)throw Error(c(163))}if(l=t.sibling,l!==null){l.return=t.return,Kt=l;break}Kt=t.return}}function Fx(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Aa(e,s),l&4&&Wi(5,s);break;case 1:if(Aa(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(v){lt(s,s.return,v)}else{var o=nl(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(v){lt(s,s.return,v)}}l&64&&Bx(s),l&512&&Ta(s,s.return);break;case 3:if(Aa(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Ep(e,t)}catch(v){lt(s,s.return,v)}}break;case 27:t===null&&l&4&&Yx(s);case 26:case 5:Aa(e,s),t===null&&l&4&&qd(s),l&512&&Ta(s,s.return);break;case 12:Aa(e,s);break;case 31:Aa(e,s),l&4&&tg(e,s);break;case 13:Aa(e,s),l&4&&ng(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=M1.bind(null,s),pN(e,s))));break;case 22:if(l=s.memoizedState!==null||Xt,!l){var u=t!==null&&t.memoizedState!==null||at;t=Xt,o=at,Xt=l,(at=u)&&!o?(l=2,(s.subtreeFlags&8772)!==0&&(l|=1),ua(e,s,l)):Aa(e,s),Xt=t,at=o}break;case 30:Aa(e,s),l&512&&Ta(s,s.return);break;case 7:l&512&&Ta(s,s.return);default:Aa(e,s)}}function Jd(e,t){for(e=e.child;e!==null;)Jx(e,t),e=e.sibling}function Jx(e,t){switch(e.tag){case 5:case 26:try{var s=e.stateNode;if(t){var l=s.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var o=e.stateNode,u=e.memoizedProps.style,v=u!=null&&u.hasOwnProperty("display")?u.display:null;o.style.display=v==null||typeof v=="boolean"?"":(""+v).trim()}}catch(z){lt(e,e.return,z)}Wd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Je=!0}catch(z){lt(e,e.return,z)}break;case 18:try{var N=e.stateNode;t?Vg(N,!0):Vg(e.stateNode,!1)}catch(z){lt(e,e.return,z)}break;case 22:case 23:e.memoizedState===null&&Jd(e,t);break;default:Jd(e,t)}}function Wd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var s=e,l=t;switch(s.tag){case 4:Jx(s,l);break e;case 22:s.memoizedState===null&&Wd(s,l);break e;default:Wd(s,l)}}e=e.sibling}}function Wx(e){var t=e.alternate;t!==null&&(e.alternate=null,Wx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pr(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 pt=null,Cn=!1;function oa(e,t,s){for(s=s.child;s!==null;)eg(e,t,s),s=s.sibling}function eg(e,t,s){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(an,s)}catch{}switch(s.tag){case 26:at||en(s,t),oa(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!at&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:at||en(s,t),er(s);var l=pt,o=Cn;Ss(s.type)&&(pt=s.stateNode,Cn=!1),oa(e,t,s),sv(s.stateNode,s.type,s.memoizedProps),pt=l,Cn=o;break;case 5:at||en(s,t),er(s);case 6:if(s.tag===6&&er(s),l=pt,o=Cn,pt=null,oa(e,t,s),pt=l,Cn=o,pt!==null)if(Cn)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(s.stateNode),Je=!0}catch(u){lt(s,t,u)}else try{pt.removeChild(s.stateNode),Je=!0}catch(u){lt(s,t,u)}break;case 18:pt!==null&&(Cn?(e=pt,Yg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),ci(e)):Yg(pt,s.stateNode));break;case 4:l=pt,o=Cn,pt=s.stateNode.containerInfo,Cn=!0,oa(e,t,s),pt=l,Cn=o;break;case 0:case 11:case 14:case 15:gs(2,s,t),at||gs(4,s,t),oa(e,t,s);break;case 1:at||(en(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&$x(s,t,l)),oa(e,t,s);break;case 21:oa(e,t,s);break;case 22:at=(l=at)||s.memoizedState!==null,oa(e,t,s),at=l;break;case 30:en(s,t),oa(e,t,s);break;case 7:at||en(s,t),oa(e,t,s);break;default:oa(e,t,s)}}function tg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ci(e)}catch(s){lt(t,t.return,s)}}}function ng(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ci(e)}catch(s){lt(t,t.return,s)}}function w1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Px),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Px),t;default:throw Error(c(435,e.tag))}}function Zo(e,t){var s=w1(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var o=_1.bind(null,e,l);l.then(o,o)}})}function fn(e,t,s){var l=t.deletions;if(l!==null)for(var o=0;o<l.length;o++){var u=l[o],v=e,N=t,z=N;e:for(;z!==null;){switch(z.tag){case 27:if(Ss(z.type)){pt=z.stateNode,Cn=!1;break e}break;case 5:pt=z.stateNode,Cn=!1;break e;case 3:case 4:pt=z.stateNode.containerInfo,Cn=!0;break e}z=z.return}if(pt===null)throw Error(c(160));eg(v,N,u),pt=null,Cn=!1,v=u.alternate,v!==null&&(v.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ag(t,e,s),t=t.sibling}var ca=null;function ag(e,t,s){var l=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(o&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var u=0;u<l.length;u++){var v=l[u];v.ref.impl=v.nextImpl}fn(t,e,s),hn(e),o&4&&(gs(3,e,e.return),Wi(3,e),gs(5,e,e.return));break;case 1:fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),o&64&&Xt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?t:s.concat(t))));break;case 26:if(u=ca,fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),o&4)if(o=l!==null?l.memoizedState:null,s=e.memoizedState,l===null)if(s===null)if(e.stateNode===null)if(Xt)e.stateNode=$g(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,s=e.memoizedProps,o=u.ownerDocument||u;t:switch(t){case"title":l=o.getElementsByTagName("title")[0],(!l||l[Ti]||l[Pt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=o.createElement(t),o.head.insertBefore(l,o.querySelector("head > title"))),tn(l,t,s),l[Pt]=e,Yt(l),t=l;break e;case"link":if(u=uv("link","href",o).get(t+(s.href||""))){for(v=0;v<u.length;v++)if(l=u[v],l.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&l.getAttribute("rel")===(s.rel==null?null:s.rel)&&l.getAttribute("title")===(s.title==null?null:s.title)&&l.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){u.splice(v,1);break t}}l=o.createElement(t),tn(l,t,s),o.head.appendChild(l);break;case"meta":if(u=uv("meta","content",o).get(t+(s.content||""))){for(v=0;v<u.length;v++)if(l=u[v],l.getAttribute("content")===(s.content==null?null:""+s.content)&&l.getAttribute("name")===(s.name==null?null:s.name)&&l.getAttribute("property")===(s.property==null?null:s.property)&&l.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&l.getAttribute("charset")===(s.charSet==null?null:s.charSet)){u.splice(v,1);break t}}l=o.createElement(t),tn(l,t,s),o.head.appendChild(l);break;default:throw Error(c(468,t))}l[Pt]=e,Yt(l),t=l}e.stateNode=t}else Xt||Hf(u,e.type,e.stateNode);else e.stateNode=cv(u,s,e.memoizedProps);else o!==s?(o===null?(t=l.stateNode,t===null||at||t.parentNode.removeChild(t)):o.count--,s===null?Xt||Hf(u,e.type,e.stateNode):cv(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Gd(e,e.memoizedProps,l.memoizedProps);break;case 27:fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),l!==null&&o&4&&Gd(e,e.memoizedProps,l.memoizedProps);break;case 5:if(u=za,za=!1,fn(t,e,s),za=u,hn(e),o&512&&(at||l===null||en(l,l.return)),e.flags&32){t=e.stateNode;try{Cl(t,""),Je=!0}catch(P){lt(e,e.return,P)}}o&4&&e.stateNode!=null&&(t=e.memoizedProps,Gd(e,t,l!==null?l.memoizedProps:t)),o&1024&&(Pd=!0);break;case 6:if(fn(t,e,s),hn(e),o&4){if(e.stateNode===null)throw Error(c(162));t=e.memoizedProps,s=e.stateNode;try{s.nodeValue=t,Je=!0}catch(P){lt(e,e.return,P)}}break;case 3:if(Je=!1,oc=null,u=ca,ca=ur(t.containerInfo),fn(t,e,s),ca=u,hn(e),o&4&&l!==null&&l.memoizedState.isDehydrated)try{ci(t.containerInfo)}catch(P){lt(e,e.return,P)}Pd&&(Pd=!1,sg(e)),Je=!1;break;case 4:o=za,za=Xt,l=Sm(),u=ca,ca=ur(e.stateNode.containerInfo),fn(t,e,s),hn(e),ca=u,Je&&tr&&(Xo=!0),Je=l,za=o;break;case 12:fn(t,e,s),hn(e);break;case 31:fn(t,e,s),hn(e),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Zo(e,t)));break;case 13:fn(t,e,s),hn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Po=Ze()),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Zo(e,t)));break;case 22:u=e.memoizedState!==null,v=l!==null&&l.memoizedState!==null;var N=Xt,z=at,G=za;Xt=N||u,za=G||u,at=z||v,fn(t,e,s),at=z,za=G,Xt=N,hn(e),o&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||l===null||v||Xt||at||(t=v||at,s=Xt,l=at,Xt=u||Xt,at=t,vs(e,2),Xt=s,at=l),!u&&za||Jd(e,u)),o&4&&(t=e.updateQueue,t!==null&&(s=t.retryQueue,s!==null&&(t.retryQueue=null,Zo(e,s))));break;case 19:fn(t,e,s),hn(e),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Zo(e,t)));break;case 30:o&512&&(at||l===null||en(l,l.return)),o=Sm(),u=tr,v=(s&335544064)===s,N=e.memoizedProps,tr=v&&qa(N.default,N.update)!=="none",fn(t,e,s),hn(e),v&&l!==null&&Je&&(e.flags|=4),tr=u,Je=o;break;case 21:break;case 7:o&512&&(at||l===null||en(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:fn(t,e,s),hn(e)}}function hn(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(Gx(l)){s=l;break}l=l.return}l=null;for(var o=e.return;o!==null;){if($d(o)){var u=o.stateNode;l===null?l=[u]:l.push(u)}if(Bd(o))break;o=o.return}var v=l;if(s==null)throw Error(c(160));switch(s.tag){case 27:var N=s.stateNode,z=Yd(e);qo(e,z,N,v);break;case 5:var G=s.stateNode;s.flags&32&&(Cl(G,""),s.flags&=-33);var P=Yd(e);qo(e,P,G,v);break;case 3:case 4:var le=s.stateNode.containerInfo,B=Yd(e);Vd(e,B,le,v);break;default:throw Error(c(161))}}catch(Q){lt(e,e.return,Q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function sg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;sg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,oi=!0,t.reset(),oi=!1),e=e.sibling}}function Xl(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)lg(t,e),t=t.sibling;else Ix(t)}function lg(e,t){var s=e.alternate;if(s===null)Xd(e,!1);else switch(e.tag){case 3:if(Fd=Da=!1,Xx(),Xl(t,e),!Da&&!Xo){if(e=Ea,e!==null)for(var l=0;l<e.length;l+=3){s=e[l];var o=e[l+1];Kg(s,e[l+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+o+")"})}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"})),Fd=!0}Ea=null;break;case 5:Xl(t,e);break;case 4:l=Da,Da=!1,Xl(t,e),Da&&(Xo=!0),Da=l;break;case 22:e.memoizedState===null&&(s.memoizedState!==null?Xd(e,!1):Xl(t,e));break;case 30:l=Da,o=Xx(),Da=!1,Xl(t,e),Da&&(e.flags|=4);var u=e.memoizedProps,v=e.stateNode;t=$a(u,v),v=$a(s.memoizedProps,v);var N=qa(u.default,u.update);N==="none"?t=!1:(u=s.memoizedState,s.memoizedState=null,s=e.child,kn=0,t=Id(e,s,t,v,N,u,!0),kn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Jl(e,e.memoizedProps.onUpdate),Ea=o):o!==null&&(o.push.apply(o,Ea),Ea=o),Da=(e.flags&32)!==0?!0:l;break;default:Xl(t,e)}}function Aa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Fx(e,t.alternate,t),t=t.sibling}function vs(e,t){for(e=e.child;e!==null;){var s=e,l=t;switch(s.tag){case 0:case 11:case 14:case 15:gs(4,s,s.return),vs(s,l);break;case 1:en(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&$x(s,s.return,o),vs(s,l);break;case 27:(l&2)!==0&&sv(s.stateNode,s.type,s.memoizedProps);case 5:en(s,s.return),s.tag!==5&&s.tag!==27||er(s),vs(s,l);break;case 6:er(s);break;case 26:en(s,s.return),o=s.stateNode,s.memoizedState!==null||o===null||at||o.parentNode.removeChild(o),vs(s,l);break;case 22:s.memoizedState===null&&vs(s,l);break;case 30:en(s,s.return),vs(s,l);break;case 7:en(s,s.return);default:vs(s,l)}e=e.sibling}}function ua(e,t,s){for(s=(t.subtreeFlags&8772)!==0?s:s&-2,t=t.child;t!==null;){var l=t.alternate,o=e,u=t,v=u.flags,N=(s&1)!==0;switch(u.tag){case 0:case 11:case 15:ua(o,u,s),Wi(4,u);break;case 1:if(ua(o,u,s),l=u,o=l.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(P){lt(l,l.return,P)}if(l=u,o=l.updateQueue,o!==null){var z=l.stateNode;try{var G=o.shared.hiddenCallbacks;if(G!==null)for(o.shared.hiddenCallbacks=null,o=0;o<G.length;o++)Tp(G[o],z)}catch(P){lt(l,l.return,P)}}N&&v&64&&Bx(u),Ta(u,u.return);break;case 27:(s&2)!==0&&Yx(u);case 5:u.tag!==5&&u.tag!==27||qx(u),ua(o,u,s),N&&l===null&&v&4&&qd(u),Ta(u,u.return);break;case 6:qx(u);break;case 26:z=u.stateNode,u.memoizedState!==null||z===null||Xt||Hf(ur(z.ownerDocument),u.type,z),ua(o,u,s),N&&l===null&&v&4&&qd(u),Ta(u,u.return);break;case 12:ua(o,u,s);break;case 31:ua(o,u,s),N&&v&4&&tg(o,u);break;case 13:ua(o,u,s),N&&v&4&&ng(o,u);break;case 22:u.memoizedState===null&&ua(o,u,s),Ta(u,u.return);break;case 30:ua(o,u,s),Ta(u,u.return);break;case 7:Ta(u,u.return);default:ua(o,u,s)}t=t.sibling}}function ef(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&$i(s))}function tf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e))}function In(e,t,s,l){var o=(s&335544064)===s;if(t.subtreeFlags&(o?10262:10256))for(t=t.child;t!==null;)ig(e,t,s,l),t=t.sibling;else o&&Qx(t)}function ig(e,t,s,l){var o=(s&335544064)===s;o&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Vo(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:In(e,t,s,l),u&2048&&Wi(9,t);break;case 1:In(e,t,s,l);break;case 3:In(e,t,s,l),o&&Fd&&(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="")),u&2048&&(u=null,t.alternate!==null&&(u=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==u&&(t.refCount++,u!=null&&$i(u)));break;case 12:if(u&2048){In(e,t,s,l),u=t.stateNode;try{var v=t.memoizedProps,N=v.id,z=v.onPostCommit;typeof z=="function"&&z(N,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(G){lt(t,t.return,G)}}else In(e,t,s,l);break;case 31:In(e,t,s,l);break;case 13:In(e,t,s,l);break;case 23:break;case 22:v=t.stateNode,N=t.alternate,t.memoizedState!==null?(o&&N!==null&&N.memoizedState===null&&Vo(N),v._visibility&2?In(e,t,s,l):nr(e,t)):(o&&N!==null&&N.memoizedState!==null&&Vo(t),v._visibility&2?In(e,t,s,l):(v._visibility|=2,Kl(e,t,s,l,(t.subtreeFlags&10256)!==0||!1))),u&2048&&ef(N,t);break;case 24:In(e,t,s,l),u&2048&&tf(t.alternate,t);break;case 30:o&&(u=t.alternate,u!==null&&(Ra(u.child,!0),Ra(t.child,!0))),In(e,t,s,l);break;default:In(e,t,s,l)}}function Kl(e,t,s,l,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,v=t,N=s,z=l,G=v.flags;switch(v.tag){case 0:case 11:case 15:Kl(u,v,N,z,o),Wi(8,v);break;case 23:break;case 22:var P=v.stateNode;v.memoizedState!==null?P._visibility&2?Kl(u,v,N,z,o):nr(u,v):(P._visibility|=2,Kl(u,v,N,z,o)),o&&G&2048&&ef(v.alternate,v);break;case 24:Kl(u,v,N,z,o),o&&G&2048&&tf(v.alternate,v);break;default:Kl(u,v,N,z,o)}t=t.sibling}}function nr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,o=l.flags;switch(l.tag){case 22:nr(s,l),o&2048&&ef(l.alternate,l);break;case 24:nr(s,l),o&2048&&tf(l.alternate,l);break;default:nr(s,l)}t=t.sibling}}var al=8192;function sl(e,t,s){if(e.subtreeFlags&al)for(e=e.child;e!==null;)rg(e,t,s),e=e.sibling}function rg(e,t,s){switch(e.tag){case 26:sl(e,t,s),e.flags&al&&(e.memoizedState!==null?RN(s,ca,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&mv(s,e)));break;case 5:sl(e,t,s),e.flags&al&&(e=e.stateNode,(t&335544128)===t&&mv(s,e));break;case 3:case 4:var l=ca;ca=ur(e.stateNode.containerInfo),sl(e,t,s),ca=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=al,al=16777216,sl(e,t,s),al=l):sl(e,t,s));break;case 30:if((e.flags&al)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var o=e.stateNode;o.paired=null,_n===null&&(_n=new Map),_n.set(l,o)}sl(e,t,s);break;default:sl(e,t,s)}}function og(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 ar(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Kt=l,ug(l,e)}og(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)cg(e),e=e.sibling}function cg(e){switch(e.tag){case 0:case 11:case 15:ar(e),e.flags&2048&&gs(9,e,e.return);break;case 3:ar(e);break;case 12:ar(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qo(e)):ar(e);break;default:ar(e)}}function Qo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Kt=l,ug(l,e)}og(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gs(8,t,t.return),Qo(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Qo(t));break;default:Qo(t)}e=e.sibling}}function ug(e,t){for(;Kt!==null;){var s=Kt;switch(s.tag){case 0:case 11:case 15:gs(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:$i(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Kt=l;else e:for(s=e;Kt!==null;){l=Kt;var o=l.sibling,u=l.return;if(Wx(l),l===s){Kt=null;break e}if(o!==null){o.return=u,Kt=o;break e}Kt=u}}}var S1={getCacheForType:function(e){var t=Ft(Ot),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ft(Ot).controller.signal}},k1=typeof WeakMap=="function"?WeakMap:Map,We=0,dt=null,$e=null,Ge=0,st=0,Ln=null,ys=!1,Zl=!1,nf=!1,Pa=0,St=0,bs=0,ll=0,Io=0,Un=0,Ql=0,sr=null,Tn=null,af=!1,Po=0,dg=0,Fo=1/0,Jo=null,js=null,gt=0,da=null,il=null,Oa=0,sf=0,lf=null,fg=null,Il=null,Pl=null,Fl=null,lr=0,Wo=null;function Hn(){return(We&2)!==0&&Ge!==0?Ge&-Ge:me.T!==null?xf():pm()}function hg(){if(Un===0)if((Ge&536870912)===0||Be){var e=Dn;Dn<<=1,(Dn&3932160)===0&&(Dn=262144),Un=e}else Un=536870912;return e=Jt.current,e!==null&&(e.flags|=32),Un}function Jl(e,t){if(t!=null){var s=e.stateNode,l=s.ref;l===null&&(l=s.ref=Zg($a(e.memoizedProps,s))),Pl===null&&(Pl=[]),Pl.push(t.bind(null,l))}}function En(e,t,s){(e===dt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(Wl(e,0),Ns(e,Ge,Un,!1)),Ci(e,s),((We&2)===0||e!==dt)&&(e===dt&&((We&2)===0&&(ll|=s),St===4&&Ns(e,Ge,Un,!1)),Ma(e))}function mg(e,t,s){if((We&6)!==0)throw Error(c(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||ki(e,t),o=l?E1(e,t):of(e,t,!0),u=l;do{if(o===0){Zl&&!l&&Ns(e,t,0,!1);break}else{if(s=e.current.alternate,u&&!C1(s)){o=of(e,t,!1),u=!1;continue}if(o===2){if(u=t,e.errorRecoveryDisabledLanes&u)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){t=v;e:{var N=e;o=sr;var z=N.current.memoizedState.isDehydrated;if(z&&(Wl(N,v).flags|=256),v=of(N,v,!1),v!==2&&v!==6){if(nf&&!z){N.errorRecoveryDisabledLanes|=u,ll|=u,o=4;break e}u=Tn,Tn=o,u!==null&&(Tn===null?Tn=u:Tn.push.apply(Tn,u))}o=v}if(u=!1,o!==2)continue}}if(o===1){Wl(e,0),Ns(e,t,0,!0);break}e:{switch(l=e,u=o,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ns(l,t,Un,!ys);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Po+300-Ze(),10<o)){if(Ns(l,t,Un,!ys),Qr(l,0,!0)!==0)break e;Oa=t,l.timeoutHandle=Tf(pg.bind(null,l,s,Tn,Jo,af,t,Un,ll,Ql,ys,u,"Throttled",-0,0),o);break e}pg(l,s,Tn,Jo,af,t,Un,ll,Ql,ys,u,null,-0,0)}}break}while(!0);Ma(e)}function pg(e,t,s,l,o,u,v,N,z,G,P,le,B,Q){e.timeoutHandle=-1;var pe=t.subtreeFlags,Ce=(u&335544064)===u;if(le=null,(Ce||pe&8192||(pe&16785408)===16785408)&&(le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sa},_n=null,rg(t,u,le),Ce&&(pe=le,Ce=e.containerInfo,Ce=(Ce.nodeType===9?Ce:Ce.ownerDocument).__reactViewTransition,Ce!=null&&(pe.count++,pe.waitingForViewTransition=!0,pe=hr.bind(pe),Ce.finished.then(pe,pe))),pe=(u&62914560)===u?Po-Ze():(u&4194048)===u?dg-Ze():0,pe=zN(le,pe),pe!==null)){Oa=u,e.cancelPendingCommit=pe(wg.bind(null,e,t,u,s,l,o,v,N,z,G,P,le,null,B,Q)),Ns(e,u,v,!G);return}wg(e,t,u,s,l,o,v,N,z,G,P,le)}function C1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var o=s[l],u=o.getSnapshot;o=o.value;try{if(!On(u(),o))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Ns(e,t,s,l){t=um(e,t),t&=~Io,t&=~ll,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var o=t;0<o;){var u=31-Nt(o),v=1<<u;l[u]=-1,o&=~v}s!==0&&fm(e,s,t)}function ec(){return(We&6)===0?(ir(0),!1):!0}function rf(){if($e!==null){if(st===0)var e=$e.return;else e=$e,Va=Zs=null,md(e),Bl=null,Yi=0,e=$e;for(;e!==null;)Hx(e.alternate,e),e=e.return;$e=null}}function Wl(e,t){var s=e.timeoutHandle;return s!==-1&&(e.timeoutHandle=-1,P1(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Oa=0,rf(),dt=e,$e=s=Ga(e.current,null),Ge=t,st=0,Ln=null,ys=!1,Zl=ki(e,t),nf=!1,Ql=Un=Io=ll=bs=St=0,Tn=sr=null,af=!1,Pa=um(e,t),ro(),s}function xg(e,t){_e=null,me.H=Oo,t===Hl||t===yo?(t=wp(),st=3):t===td?(t=wp(),st=4):st=t===Rd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ln=t,$e===null&&(St=1,Mo(e,Xn(t,e.current)))}function gg(){var e=Jt.current;return e===null?!0:(Ge&4194048)===Ge?sn===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?e===sn:!1}function vg(){var e=me.H;return me.H=Oo,e===null?Oo:e}function yg(){var e=me.A;return me.A=S1,e}function tc(){St=4,ys||(Ge&4194048)!==Ge&&Jt.current!==null||(Zl=!0),(bs&134217727)===0&&(ll&134217727)===0||dt===null||Ns(dt,Ge,Un,!1)}function of(e,t,s){var l=We;We|=2;var o=vg(),u=yg();(dt!==e||Ge!==t)&&(Jo=null,Wl(e,t)),t=!1;var v=St;e:do try{if(st!==0&&$e!==null){var N=$e,z=Ln;switch(st){case 8:rf(),v=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var G=st;if(st=0,Ln=null,ei(e,N,z,G),s&&Zl){v=0;break e}break;default:G=st,st=0,Ln=null,ei(e,N,z,G)}}T1(),v=St;break}catch(P){xg(e,P)}while(!0);return t&&e.shellSuspendCounter++,Va=Zs=null,We=l,me.H=o,me.A=u,$e===null&&(dt=null,Ge=0,ro()),v}function T1(){for(;$e!==null;)bg($e)}function E1(e,t){var s=We;We|=2;var l=vg(),o=yg();dt!==e||Ge!==t?(Jo=null,Fo=Ze()+500,Wl(e,t)):Zl=ki(e,t);e:do try{if(st!==0&&$e!==null){t=$e;var u=Ln;t:switch(st){case 1:st=0,Ln=null,ei(e,t,u,1);break;case 2:case 9:if(jp(u)){st=0,Ln=null,jg(t);break}t=function(){st!==2&&st!==9||dt!==e||(st=7),Ma(e)},u.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:jp(u)?(st=0,Ln=null,jg(t)):(st=0,Ln=null,ei(e,t,u,7));break;case 5:var v=null;switch($e.tag){case 26:v=$e.memoizedState;case 5:case 27:var N=$e;if(v?fv(v):N.stateNode.complete){st=0,Ln=null;var z=N.sibling;if(z!==null)$e=z;else{var G=N.return;G!==null?($e=G,nc(G)):$e=null}break t}}st=0,Ln=null,ei(e,t,u,5);break;case 6:st=0,Ln=null,ei(e,t,u,6);break;case 8:rf(),St=6;break e;default:throw Error(c(462))}}R1();break}catch(P){xg(e,P)}while(!0);return Va=Zs=null,me.H=l,me.A=o,We=s,$e!==null?0:(dt=null,Ge=0,ro(),St)}function R1(){for(;$e!==null&&!Rt();)bg($e)}function bg(e){var t=Lx(e.alternate,e,Pa);e.memoizedProps=e.pendingProps,t===null?nc(e):$e=t}function jg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Rx(s,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=Rx(s,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:md(t);var l=t;l===Vt&&(Be?(mo(l),l.tag===5&&l.stateNode!=null&&(ht=l.stateNode)):(mo(l),Be=!0));default:Hx(s,t),t=$e=up(t,Pa),t=Lx(s,t,Pa)}e.memoizedProps=e.pendingProps,t===null?nc(e):$e=t}function ei(e,t,s,l){Va=Zs=null,md(t),Bl=null,Yi=0;var o=t.return;try{if(x1(e,o,t,s,Ge)){St=1,Mo(e,Xn(s,e.current)),$e=null;return}}catch(u){if(o!==null)throw $e=o,u;St=1,Mo(e,Xn(s,e.current)),$e=null;return}t.flags&32768?(Be||l===1?e=!0:Zl||(Ge&536870912)!==0?e=!1:(ys=e=!0,(l===2||l===9||l===3||l===6)&&(l=Jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Ng(t,e)):nc(t)}function nc(e){var t=e;do{if((t.flags&32768)!==0){Ng(t,ys);return}e=t.return;var s=b1(t.alternate,t,Pa);if(s!==null){$e=s;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);St===0&&(St=5)}function Ng(e,t){do{var s=j1(e.alternate,e);if(s!==null){s.flags&=32767,$e=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=s}while(e!==null);St=6,$e=null}function wg(e,t,s,l,o,u,v,N,z,G,P,le){e.cancelPendingCommit=null;do ac();while(gt!==0);if((We&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));e===dt&&($e=dt=null,Ge=0),il=t,da=e,Oa=s,lf=o,fg=l,z1(e,t,s,v,N,z,le)}}function z1(e,t,s,l,o,u,v){var N=t.lanes|t.childLanes;if(sf=N,N|=Gu,nj(e,s,N,l,o,u),Pl=null,(s&335544064)===s?(Fl=s1(e),l=10262):(Fl=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,L1(Gt,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Go=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null,o=ie.p,ie.p=2,u=We,We|=4;try{N1(e,t,s)}finally{We=u,ie.p=o,me.T=l}}gt=1,Go?Il=nN(v,e.containerInfo,Fl,cf,uf,A1,df,ff,D1):(cf(),uf(),df())}function D1(e){if(gt!==0){var t=da.onRecoverableError;t(e,{componentStack:null})}}function A1(){gt===3&&(gt=0,lg(il,da),gt=4)}function cf(){if(gt===1){gt=0;var e=da,t=il,s=Oa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null;var o=ie.p;ie.p=2;var u=We;We|=4;try{tr=Xo=!1,ag(t,e,s),s=Sf;var v=ep(e.containerInfo),N=s.focusedElem,z=s.selectionRange;if(v!==N&&N&&N.ownerDocument&&Wm(N.ownerDocument.documentElement,N)){if(z!==null&&Uu(N)){var G=z.start,P=z.end;if(P===void 0&&(P=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(P,N.value.length);else{var le=N.ownerDocument||document,B=le&&le.defaultView||window;if(B.getSelection){var Q=B.getSelection(),pe=N.textContent.length,Ce=Math.min(z.start,pe),Le=z.end===void 0?Ce:Math.min(z.end,pe);!Q.extend&&Ce>Le&&(v=Le,Le=Ce,Ce=v);var $=Jm(N,Ce),_=Jm(N,Le);if($&&_&&(Q.rangeCount!==1||Q.anchorNode!==$.node||Q.anchorOffset!==$.offset||Q.focusNode!==_.node||Q.focusOffset!==_.offset)){var X=le.createRange();X.setStart($.node,$.offset),Q.removeAllRanges(),Ce>Le?(Q.addRange(X),Q.extend(_.node,_.offset)):(X.setEnd(_.node,_.offset),Q.addRange(X))}}}}for(le=[],Q=N;Q=Q.parentNode;)Q.nodeType===1&&le.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<le.length;N++){var se=le[N];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}oi=!!wf,Sf=wf=null}finally{We=u,ie.p=o,me.T=l}}e.current=t,gt=2}}function uf(){if(gt===2){gt=0;var e=da,t=il,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=me.T,me.T=null;var l=ie.p;ie.p=2;var o=We;We|=4;try{Fx(e,t.alternate,t)}finally{We=o,ie.p=l,me.T=s}}gt=3}}function df(){if(gt===4||gt===3){gt=0;var e=Il;Il=null,jt();var t=da,s=il,l=Oa,o=fg,u=(l&335544064)===l?10262:10256;if((s.subtreeFlags&u)!==0||(s.flags&u)!==0?gt=5:(gt=0,il=da=null,Sg(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(js=null),yu(l),s=s.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(an,s,void 0,(s.current.flags&128)===128)}catch{}if(o!==null){s=me.T,u=ie.p,ie.p=2,me.T=null;try{for(var v=t.onRecoverableError,N=0;N<o.length;N++){var z=o[N];v(z.value,{componentStack:z.stack})}}finally{me.T=s,ie.p=u}}if(o=Pl,v=Fl,Fl=null,o!==null&&(Pl=null,v===null&&(v=[]),e!==null))for(z=0;z<o.length;z++)s=(0,o[z])(v),s!==void 0&&e.finished.finally(s);(Oa&3)!==0&&ac(),Ma(t),u=t.pendingLanes,(l&261930)!==0&&(u&42)!==0?t===Wo?lr++:(lr=0,Wo=t):(lr=0,Wo=null),ir(0)}}function Sg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$i(t)))}function ac(){return Il!==null&&(Il.skipTransition(),Il=null),cf(),uf(),df(),ff()}function ff(){if(gt!==5)return!1;var e=da,t=sf;sf=0;var s=yu(Oa),l=me.T,o=ie.p;try{ie.p=32>s?32:s,me.T=null,s=lf,lf=null;var u=da,v=Oa;if(gt=0,il=da=null,Oa=0,(We&6)!==0)throw Error(c(331));var N=We;if(We|=4,cg(u.current),ig(u,u.current,v,s),We=N,ir(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(an,u)}catch{}return!0}finally{ie.p=o,me.T=l,Sg(e,t)}}function kg(e,t,s){t=Xn(s,t),t=Ed(e.stateNode,t,2),e=hs(e,t,2),e!==null&&(Ci(e,2),Ma(e))}function lt(e,t,s){if(e.tag===3)kg(e,e,s);else for(;t!==null;){if(t.tag===3){kg(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(js===null||!js.has(l))){e=Xn(s,e),s=jx(2),l=hs(t,s,2),l!==null&&(Nx(s,l,t,e),Ci(l,2),Ma(l));break}}t=t.return}}function hf(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new k1;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(s)||(nf=!0,o.add(s),e=O1.bind(null,e,t,s),t.then(e,e))}function O1(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,dt===e&&(Ge&s)===s&&((St===4||St===3&&(Ge&62914560)===Ge&&300>Ze()-Po)&&(We&2)===0?Wl(e,0):Io|=s,Ql===Ge&&(Ql=0)),Ma(e)}function Cg(e,t){t===0&&(t=dm()),e=Vs(e,t),e!==null&&(Ci(e,t),Ma(e))}function M1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Cg(e,s)}function _1(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(s=o.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),Cg(e,s)}function L1(e,t){return Te(e,t)}var ti=null,ni=null,mf=!1,sc=!1,pf=!1,ws=0;function Ma(e){e!==ni&&e.next===null&&(ni===null?ti=ni=e:ni=ni.next=e),sc=!0,mf||(mf=!0,H1())}function ir(e,t){if(!pf&&sc){pf=!0;do for(var s=!1,l=ti;l!==null;){if(e!==0){var o=l.pendingLanes;if(o===0)var u=0;else{var v=l.suspendedLanes,N=l.pingedLanes;u=(1<<31-Nt(42|e)+1)-1,u&=o&~(v&~N),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(s=!0,zg(l,u))}else u=Ge,u=Qr(l,l===dt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||ki(l,u)||(s=!0,zg(l,u));l=l.next}while(s);pf=!1}}function U1(){Tg()}function Tg(){sc=mf=!1;var e=0;ws!==0&&I1()&&(e=ws);for(var t=Ze(),s=null,l=ti;l!==null;){var o=l.next,u=Eg(l,t);u===0?(l.next=null,s===null?ti=o:s.next=o,o===null&&(ni=s)):(s=l,(e!==0||(u&3)!==0)&&(sc=!0)),l=o}gt!==0&&gt!==5||ir(e),ws!==0&&(ws=0)}function Eg(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var v=31-Nt(u),N=1<<v,z=o[v];z===-1?((N&s)===0||(N&l)!==0)&&(o[v]=tj(N,t)):z<=t&&(e.expiredLanes|=N),u&=~N}if(t=dt,s=Ge,s=Qr(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ut(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||ki(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&ut(l),yu(s)){case 2:case 8:s=Ht;break;case 32:s=Gt;break;case 268435456:s=sa;break;default:s=Gt}return l=Rg.bind(null,e),s=Te(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&ut(l),e.callbackPriority=2,e.callbackNode=null,2}function Rg(e,t){if(gt!==0&&gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(ac()&&e.callbackNode!==s)return null;var l=Ge;return l=Qr(e,e===dt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(mg(e,l,t),Eg(e,Ze()),e.callbackNode!=null&&e.callbackNode===s?Rg.bind(null,e):null)}function zg(e,t){if(ac())return null;mg(e,t,!0)}function H1(){F1(function(){(We&6)!==0?Te(Zr,U1):Tg()})}function xf(){if(ws===0){var e=Ps;e===0&&(e=Na,Na<<=1,(Na&261888)===0&&(Na=256)),ws=e}return ws}function Dg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Wr(e)}function B1(e,t,s,l,o){if(t==="submit"&&s&&s.stateNode===o){var u=Dg((o[wn]||null).action),v=l.submitter;v&&(t=(t=v[wn]||null)?Dg(t.formAction):v.getAttribute("formAction"),t!==null&&(u=t,v=null));var N=new ao("action","action",null,l,o);e.push({event:N,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ws!==0){var z=new FormData(o,v);wd(s,{pending:!0,data:z,method:o.method,action:u},null,z)}}else typeof u=="function"&&(N.preventDefault(),z=new FormData(o,v),wd(s,{pending:!0,data:z,method:o.method,action:u},u,z))},currentTarget:o}]})}}for(var gf=0;gf<qu.length;gf++){var vf=qu[gf],$1=vf.toLowerCase(),q1=vf[0].toUpperCase()+vf.slice(1);ra($1,"on"+q1)}ra(ap,"onAnimationEnd"),ra(sp,"onAnimationIteration"),ra(lp,"onAnimationStart"),ra("dblclick","onDoubleClick"),ra("focusin","onFocus"),ra("focusout","onBlur"),ra(Pj,"onTransitionRun"),ra(Fj,"onTransitionStart"),ra(Jj,"onTransitionCancel"),ra(ip,"onTransitionEnd"),Sl("onMouseEnter",["mouseout","mouseover"]),Sl("onMouseLeave",["mouseout","mouseover"]),Sl("onPointerEnter",["pointerout","pointerover"]),Sl("onPointerLeave",["pointerout","pointerover"]),qs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qs("onBeforeInput",["compositionend","keypress","textInput","paste"]),qs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rr="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(" "),G1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rr));function Ag(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],o=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var v=l.length-1;0<=v;v--){var N=l[v],z=N.instance,G=N.currentTarget;if(N=N.listener,z!==u&&o.isPropagationStopped())break e;u=N,o.currentTarget=G;try{u(o)}catch(P){io(P)}o.currentTarget=null,u=z}else for(v=0;v<l.length;v++){if(N=l[v],z=N.instance,G=N.currentTarget,N=N.listener,z!==u&&o.isPropagationStopped())break e;u=N,o.currentTarget=G;try{u(o)}catch(P){io(P)}o.currentTarget=null,u=z}}}}function qe(e,t){var s=t[gm];s===void 0&&(s=t[gm]=new Set);var l=e+"__bubble";s.has(l)||(Og(t,e,2,!1),s.add(l))}function yf(e,t,s){var l=0;t&&(l|=4),Og(s,e,l,t)}var lc="_reactListening"+Math.random().toString(36).slice(2);function bf(e){if(!e[lc]){e[lc]=!0,bm.forEach(function(s){s!=="selectionchange"&&(G1.has(s)||yf(s,!1,e),yf(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lc]||(t[lc]=!0,yf("selectionchange",!1,t))}}function Og(e,t,s,l){switch(Nv(t)){case 2:var o=MN;break;case 8:o=_N;break;default:o=$f}s=o.bind(null,t,s,e),o=void 0,!Tu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?o!==void 0?e.addEventListener(t,s,{capture:!0,passive:o}):e.addEventListener(t,s,!0):o!==void 0?e.addEventListener(t,s,{passive:o}):e.addEventListener(t,s,!1)}function jf(e,t,s,l,o){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var N=l.stateNode.containerInfo;if(N===o)break;if(v===4)for(v=l.return;v!==null;){var z=v.tag;if((z===3||z===4)&&v.stateNode.containerInfo===o)return;v=v.return}for(;N!==null;){if(v=$s(N),v===null)return;if(z=v.tag,z===5||z===6||z===26||z===27){l=u=v;continue e}N=N.parentNode}}l=l.return}Om(function(){var G=u,P=ku(s),le=[];e:{var B=rp.get(e);if(B!==void 0){var Q=ao,pe=e;switch(e){case"keypress":if(to(s)===0)break e;case"keydown":case"keyup":Q=Cj;break;case"focusin":pe="focus",Q=Du;break;case"focusout":pe="blur",Q=Du;break;case"beforeblur":case"afterblur":Q=Du;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Lm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=mj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Dj;break;case ap:case sp:case lp:Q=gj;break;case ip:Q=Oj;break;case"scroll":case"scrollend":Q=fj;break;case"wheel":Q=_j;break;case"copy":case"cut":case"paste":Q=yj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Hm;break;case"submit":Q=Rj;break;case"toggle":case"beforetoggle":Q=Uj}var Ce=(t&4)!==0,Le=!Ce&&(e==="scroll"||e==="scrollend"),$=Ce?B!==null?B+"Capture":null:B;Ce=[];for(var _=G,X;_!==null;){var se=_;if(X=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||X===null||$===null||(se=Ri(_,$),se!=null&&Ce.push(or(_,se,X))),Le)break;_=_.return}0<Ce.length&&(B=new Q(B,pe,null,s,P),le.push({event:B,listeners:Ce}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",Q&&s!==Su&&(pe=s.relatedTarget||s.fromElement)&&($s(pe)||pe[jl]))break e;(B||Q)&&(pe=P.window===P?P:(Q=P.ownerDocument)?Q.defaultView||Q.parentWindow:window,B?(Q=s.relatedTarget||s.toElement,B=G,Q=Q?$s(Q):null,Q!==null&&(Le=f(Q),Ce=Q.tag,Q!==Le||Ce!==5&&Ce!==27&&Ce!==6)&&(Q=null)):(B=null,Q=G),B!==Q&&(Ce=Lm,se="onMouseLeave",$="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Hm,se="onPointerLeave",$="onPointerEnter",_="pointer"),Le=B==null?pe:Ei(B),X=Q==null?pe:Ei(Q),pe=new Ce(se,_+"leave",B,s,P),pe.target=Le,pe.relatedTarget=X,se=null,$s(P)===G&&(Ce=new Ce($,_+"enter",Q,s,P),Ce.target=X,Ce.relatedTarget=Le,se=Ce),Le=se,Ce=B&&Q?Y(B,Q,Y1):null,B!==null&&Mg(le,pe,B,Ce,!1),Q!==null&&Le!==null&&Mg(le,Le,Q,Ce,!0)))}e:{if(B=G?Ei(G):window,Q=B.nodeName&&B.nodeName.toLowerCase(),Q==="select"||Q==="input"&&B.type==="file")var Se=Km;else if(Vm(B))if(Zm)Se=Zj;else{Se=Xj;var Ye=Vj}else Q=B.nodeName,!Q||Q.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?G&&wu(G.elementType)&&(Se=Km):Se=Kj;if(Se&&(Se=Se(e,G))){Xm(le,Se,s,P);break e}Ye&&Ye(e,B,G)}switch(Ye=G?Ei(G):window,e){case"focusin":(Vm(Ye)||Ye.contentEditable==="true")&&(zl=Ye,Hu=G,Ui=null);break;case"focusout":Ui=Hu=zl=null;break;case"mousedown":Bu=!0;break;case"contextmenu":case"mouseup":case"dragend":Bu=!1,tp(le,s,P);break;case"selectionchange":if(Ij)break;case"keydown":case"keyup":tp(le,s,P)}var ze;if(Ou)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Rl?Gm(e,s)&&(Ae="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ae="onCompositionStart");Ae&&(Bm&&s.locale!=="ko"&&(Rl||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Rl&&(ze=Mm()):(ss=P,Eu="value"in ss?ss.value:ss.textContent,Rl=!0)),Ye=ic(G,Ae),0<Ye.length&&(Ae=new Um(Ae,e,null,s,P),le.push({event:Ae,listeners:Ye}),ze?Ae.data=ze:(ze=Ym(s),ze!==null&&(Ae.data=ze)))),(ze=Bj?$j(e,s):qj(e,s))&&(Ae=ic(G,"onBeforeInput"),0<Ae.length&&(Ye=new Um("onBeforeInput","beforeinput",null,s,P),le.push({event:Ye,listeners:Ae}),Ye.data=ze)),B1(le,e,G,s,P)}Ag(le,t)})}function or(e,t,s){return{instance:e,listener:t,currentTarget:s}}function ic(e,t){for(var s=t+"Capture",l=[];e!==null;){var o=e,u=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||u===null||(o=Ri(e,s),o!=null&&l.unshift(or(e,o,u)),o=Ri(e,t),o!=null&&l.push(or(e,o,u))),e.tag===3)return l;e=e.return}return[]}function Y1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Mg(e,t,s,l,o){for(var u=t._reactName,v=[];s!==null&&s!==l;){var N=s,z=N.alternate,G=N.stateNode;if(N=N.tag,z!==null&&z===l)break;N!==5&&N!==26&&N!==27||G===null||(z=G,o?(G=Ri(s,u),G!=null&&v.unshift(or(s,G,z))):o||(G=Ri(s,u),G!=null&&v.push(or(s,G,z)))),s=s.return}v.length!==0&&e.push({event:t,listeners:v})}var V1=/\r\n?/g,X1=/\u0000|\uFFFD/g;function _g(e){return(typeof e=="string"?e:""+e).replace(V1,`
49
+ `).replace(X1,"")}function Lg(e,t){return t=_g(t),_g(e)===t}function it(e,t,s,l,o,u){switch(s){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Cl(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Cl(e,""+l);else return;break;case"className":Jr(e,"class",l);break;case"tabIndex":Jr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Jr(e,s,l);break;case"style":Dm(e,l,u);return;case"data":if(t!=="object"){Jr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Wr(l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(s==="formAction"?(t!=="input"&&it(e,t,"name",o.name,o,null),it(e,t,"formEncType",o.formEncType,o,null),it(e,t,"formMethod",o.formMethod,o,null),it(e,t,"formTarget",o.formTarget,o,null)):(it(e,t,"encType",o.encType,o,null),it(e,t,"method",o.method,o,null),it(e,t,"target",o.target,o,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Wr(l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=Sa);return;case"onScroll":l!=null&&qe("scroll",e);return;case"onScrollEnd":l!=null&&qe("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(s=l.__html,s!=null){if(o.children!=null)throw Error(c(60));u?.__html!==s&&(e.innerHTML=s)}}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}s=Wr(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);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(s,l):e.removeAttribute(s);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(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":qe("beforetoggle",e),qe("toggle",e),Fr(e,"popover",l);break;case"xlinkActuate":Ha(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ha(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ha(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ha(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ha(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ha(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Fr(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=uj.get(s)||s,Fr(e,s,l);else return}Je=!0}function Nf(e,t,s,l,o,u){switch(s){case"style":Dm(e,l,u);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(s=l.__html,s!=null){if(o.children!=null)throw Error(c(60));u?.__html!==s&&(e.innerHTML=s)}}break;case"children":if(typeof l=="string")Cl(e,l);else if(typeof l=="number"||typeof l=="bigint")Cl(e,""+l);else return;break;case"onScroll":l!=null&&qe("scroll",e);return;case"onScrollEnd":l!=null&&qe("scrollend",e);return;case"onClick":l!=null&&(e.onclick=Sa);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!jm.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(o=s.endsWith("Capture"),u=s.slice(2,o?s.length-7:void 0),t=e[wn]||null,t=t!=null?t[s]:null,typeof t=="function"&&e.removeEventListener(u,t,o),typeof l=="function")){typeof t!="function"&&t!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(u,l,o);break e}Je=!0,s in e?e[s]=l:l===!0?e.setAttribute(s,""):Fr(e,s,l)}return}Je=!0}function tn(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var l=!1,o=!1,u;for(u in s)if(s.hasOwnProperty(u)){var v=s[u];if(v!=null)switch(u){case"src":l=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:it(e,t,u,v,s,null)}}o&&it(e,t,"srcSet",s.srcSet,s,null),l&&it(e,t,"src",s.src,s,null);return;case"input":qe("invalid",e);var N=u=v=o=null,z=null,G=null;for(l in s)if(s.hasOwnProperty(l)){var P=s[l];if(P!=null)switch(l){case"name":o=P;break;case"type":v=P;break;case"checked":z=P;break;case"defaultChecked":G=P;break;case"value":u=P;break;case"defaultValue":N=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(c(137,t));break;default:it(e,t,l,P,s,null)}}Tm(e,u,N,z,G,v,o,!1);return;case"select":qe("invalid",e),l=v=u=null;for(o in s)if(s.hasOwnProperty(o)&&(N=s[o],N!=null))switch(o){case"value":u=N;break;case"defaultValue":v=N;break;case"multiple":l=N;default:it(e,t,o,N,s,null)}t=u,s=v,e.multiple=!!l,t!=null?kl(e,!!l,t,!1):s!=null&&kl(e,!!l,s,!0);return;case"textarea":qe("invalid",e),u=o=l=null;for(v in s)if(s.hasOwnProperty(v)&&(N=s[v],N!=null))switch(v){case"value":l=N;break;case"defaultValue":o=N;break;case"children":u=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(91));break;default:it(e,t,v,N,s,null)}Rm(e,l,o,u);return;case"option":for(z in s)if(s.hasOwnProperty(z)&&(l=s[z],l!=null))switch(z){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:it(e,t,z,l,s,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(l=0;l<rr.length;l++)qe(rr[l],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("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(G in s)if(s.hasOwnProperty(G)&&(l=s[G],l!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:it(e,t,G,l,s,null)}return;default:if(wu(t)){for(P in s)s.hasOwnProperty(P)&&(l=s[P],l!==void 0&&Nf(e,t,P,l,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(l=s[N],l!=null&&it(e,t,N,l,s,null))}var K1={};function Z1(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,u=null,v=null,N=null,z=null,G=null,P=null;for(Q in s){var le=s[Q];if(s.hasOwnProperty(Q)&&le!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":z=le;default:l.hasOwnProperty(Q)||it(e,t,Q,null,l,le)}}for(var B in l){var Q=l[B];if(le=s[B],l.hasOwnProperty(B)&&(Q!=null||le!=null))switch(B){case"type":Q!==le&&(Je=!0),u=Q;break;case"name":Q!==le&&(Je=!0),o=Q;break;case"checked":Q!==le&&(Je=!0),G=Q;break;case"defaultChecked":Q!==le&&(Je=!0),P=Q;break;case"value":Q!==le&&(Je=!0),v=Q;break;case"defaultValue":Q!==le&&(Je=!0),N=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(c(137,t));break;default:Q!==le&&it(e,t,B,Q,l,le)}}ju(e,v,N,z,G,P,u,o);return;case"select":Q=v=N=B=null;for(u in s)if(z=s[u],s.hasOwnProperty(u)&&z!=null)switch(u){case"value":break;case"multiple":Q=z;default:l.hasOwnProperty(u)||it(e,t,u,null,l,z)}for(o in l)if(u=l[o],z=s[o],l.hasOwnProperty(o)&&(u!=null||z!=null))switch(o){case"value":u!==z&&(Je=!0),B=u;break;case"defaultValue":u!==z&&(Je=!0),N=u;break;case"multiple":u!==z&&(Je=!0),v=u;default:u!==z&&it(e,t,o,u,l,z)}t=N,s=v,l=Q,B!=null?kl(e,!!s,B,!1):!!l!=!!s&&(t!=null?kl(e,!!s,t,!0):kl(e,!!s,s?[]:"",!1));return;case"textarea":Q=B=null;for(N in s)if(o=s[N],s.hasOwnProperty(N)&&o!=null&&!l.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:it(e,t,N,null,l,o)}for(v in l)if(o=l[v],u=s[v],l.hasOwnProperty(v)&&(o!=null||u!=null))switch(v){case"value":o!==u&&(Je=!0),B=o;break;case"defaultValue":o!==u&&(Je=!0),Q=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==u&&it(e,t,v,o,l,u)}Em(e,B,Q);return;case"option":for(var pe in s)if(B=s[pe],s.hasOwnProperty(pe)&&B!=null&&!l.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:it(e,t,pe,null,l,B)}for(z in l)if(B=l[z],Q=s[z],l.hasOwnProperty(z)&&B!==Q&&(B!=null||Q!=null))switch(z){case"selected":B!==Q&&(Je=!0),e.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:it(e,t,z,B,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 Ce in s)B=s[Ce],s.hasOwnProperty(Ce)&&B!=null&&!l.hasOwnProperty(Ce)&&it(e,t,Ce,null,l,B);for(G in l)if(B=l[G],Q=s[G],l.hasOwnProperty(G)&&B!==Q&&(B!=null||Q!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(c(137,t));break;default:it(e,t,G,B,l,Q)}return;default:if(wu(t)){for(var Le in s)B=s[Le],s.hasOwnProperty(Le)&&B!==void 0&&!l.hasOwnProperty(Le)&&Nf(e,t,Le,void 0,l,B);for(P in l)B=l[P],Q=s[P],!l.hasOwnProperty(P)||B===Q||B===void 0&&Q===void 0||Nf(e,t,P,B,l,Q);return}}for(var $ in s)B=s[$],s.hasOwnProperty($)&&B!=null&&!l.hasOwnProperty($)&&it(e,t,$,null,l,B);for(le in l)B=l[le],Q=s[le],!l.hasOwnProperty(le)||B===Q||B==null&&Q==null||it(e,t,le,B,l,Q)}function Ug(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var o=s[l],u=o.transferSize,v=o.initiatorType,N=o.duration;if(u&&N&&Ug(v)){for(v=0,N=o.responseEnd,l+=1;l<s.length;l++){var z=s[l],G=z.startTime;if(G>N)break;var P=z.transferSize,le=z.initiatorType;P&&Ug(le)&&(z=z.responseEnd,v+=P*(z<N?1:(N-G)/(z-G)))}if(--l,t+=8*(u+v)/(o.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 wf=null,Sf=null;function cr(e){return e.nodeType===9?e:e.ownerDocument}function Hg(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 Bg(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 $g(e,t,s,l){return s=cr(s).createElement(e),s[Pt]=l,s[wn]=t,tn(s,e,t),Yt(s),s}function kf(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 Cf=null;function I1(){var e=window.event;return e&&e.type==="popstate"?e===Cf?!1:(Cf=e,!0):(Cf=null,!1)}var Tf=typeof setTimeout=="function"?setTimeout:void 0,P1=typeof clearTimeout=="function"?clearTimeout:void 0,qg=typeof Promise=="function"?Promise:void 0,Gg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Tf,F1=typeof queueMicrotask=="function"?queueMicrotask:typeof qg<"u"?function(e){return qg.resolve(null).then(e).catch(J1)}:Tf;function J1(e){setTimeout(function(){throw e})}function Ss(e){return e==="head"}function Yg(e,t){var s=t,l=0;do{var o=s.nextSibling;if(e.removeChild(s),o&&o.nodeType===8)if(s=o.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(o),ci(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")_f(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,_f(s);for(var u=s.firstChild;u;){var v=u.nextSibling,N=u.nodeName;u[Ti]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&u.rel.toLowerCase()==="stylesheet"||s.removeChild(u),u=v}}else s==="body"&&_f(e.ownerDocument.body);s=o}while(s);ci(t)}function Vg(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Xg(e,t,s){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,s!=null&&(e.style.viewTransitionClass=s),s=getComputedStyle(e),s.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var o=l=0;o<t.length;o++){var u=t[o];0<u.width&&0<u.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+s.paddingTop,e.marginBottom="-"+s.paddingBottom)}}function Kg(e,t){e=e.style,t=t.style;var s=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(s=t.display,e.display=s==null||typeof s=="boolean"?"":s,s=t.margin,s!=null?e.margin=s:(s=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=s==null||typeof s=="boolean"?"":s,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function W1(e,t,s){return s=s.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<=s.innerHeight&&e.left<=s.innerWidth}}function Ef(e){var t=e.getBoundingClientRect(),s=getComputedStyle(e);return W1(t,s,e)}function eN(e){return e.documentElement.clientHeight}function tN(e){this.addEventListener("load",e),this.addEventListener("error",e)}function nN(e,t,s,l,o,u,v,N,z){var G=t.nodeType===9?t:t.ownerDocument;try{var P=G.startViewTransition({update:function(){var B=G.defaultView,Q=B.navigation&&B.navigation.transition,pe=G.fonts.status;l();var Ce=[];if(pe==="loaded"&&(eN(G),G.fonts.status==="loading"&&Ce.push(G.fonts.ready)),pe=Ce.length,e!==null)for(var Le=e.suspenseyImages,$=0,_=0;_<Le.length;_++){var X=Le[_];if(!X.complete){var se=X.getBoundingClientRect();if(0<se.bottom&&0<se.right&&se.top<B.innerHeight&&se.left<B.innerWidth){if($+=hv(X),$>cc){Ce.length=pe;break}X=new Promise(tN.bind(X)),Ce.push(X)}}}if(0<Ce.length)return B=Promise.race([Promise.all(Ce),new Promise(function(Se){return setTimeout(Se,500)})]).then(o,o),(Q?Promise.allSettled([Q.finished,B]):B).then(u,u);if(o(),Q)return Q.finished.then(u,u);u()},types:s});G.__reactViewTransition=P;var le=[];return P.ready.then(function(){for(var B=G.documentElement.getAnimations({subtree:!0}),Q=0;Q<B.length;Q++){var pe=B[Q],Ce=pe.effect,Le=Ce.pseudoElement;if(Le!=null&&Le.startsWith("::view-transition")){le.push(pe),pe=Ce.getKeyframes();for(var $=Le=void 0,_=!0,X=0;X<pe.length;X++){var se=pe[X],Se=se.width;if(Le===void 0)Le=Se;else if(Le!==Se){_=!1;break}if(Se=se.height,$===void 0)$=Se;else if($!==Se){_=!1;break}delete se.width,delete se.height,se.transform==="none"&&delete se.transform}_&&Le!==void 0&&$!==void 0&&(Ce.setKeyframes(pe),_=getComputedStyle(Ce.target,Ce.pseudoElement),_.width!==Le||_.height!==$)&&(_=pe[0],_.width=Le,_.height=$,_=pe[pe.length-1],_.width=Le,_.height=$,Ce.setKeyframes(pe))}}v()},function(B){G.__reactViewTransition===P&&(G.__reactViewTransition=null);try{if(typeof B=="object"&&B!==null)switch(B.name){case"InvalidStateError":(B.message==="View transition was skipped because document visibility state is hidden."||B.message==="Skipping view transition because document visibility state has become hidden."||B.message==="Skipping view transition because viewport size changed."||B.message==="Transition was aborted because of invalid state")&&(B=null)}B!==null&&z(B)}finally{l(),o(),v()}}),P.finished.finally(function(){for(var B=0;B<le.length;B++)le[B].cancel();G.__reactViewTransition===P&&(G.__reactViewTransition=null),N()}),P}catch{return l(),o(),v(),null}}function rl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}rl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:A({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},rl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,s=e.getAnimations({subtree:!0}),l=[],o=0;o<s.length;o++){var u=s[o].effect;u!==null&&u.target===e&&u.pseudoElement===t&&l.push(s[o])}return l},rl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Zg(e){return{name:e,group:new rl("group",e),imagePair:new rl("image-pair",e),old:new rl("old",e),new:new rl("new",e)}}function Bn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Bn.prototype.addEventListener=function(e,t,s){var l=null,o=null;if(!(s!=null&&typeof s!="boolean"&&(l=s.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(Ig(u,e,t,s)===-1){var v=this,N=t;s!=null&&typeof s!="boolean"&&s.once===!0&&(N=function(z){v.removeEventListener(e,t,s),typeof t=="function"?t.call(this,z):t.handleEvent(z)}),l!==null&&(o=v.removeEventListener.bind(v,e,t,s),l.addEventListener("abort",o,{once:!0}),o=l.removeEventListener.bind(l,"abort",o)),l=ai(s),u.push({type:e,listener:t,optionsOrUseCapture:s,attachedListener:N,cleanup:o}),x(this._fragmentFiber.child,!1,aN,e,N,l)}this._eventListeners=u}};function aN(e,t,s,l){return C(e).addEventListener(t,s,l),!1}Bn.prototype.removeEventListener=function(e,t,s){var l=this._eventListeners;if(l!==null&&(t=Ig(l,e,t,s),t!==-1)){var o=l[t];s=o.attachedListener;var u=o.cleanup;o=ai(o.optionsOrUseCapture),x(this._fragmentFiber.child,!1,sN,e,s,o),l.splice(t,1),u!==null&&u()}};function sN(e,t,s,l){return C(e).removeEventListener(t,s,l),!1}function ai(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Qg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Ig(e,t,s,l){if(e.length===0)return-1;l=Qg(l);for(var o=0;o<e.length;o++){var u=e[o];if(u.type===t&&u.listener===s&&Qg(u.optionsOrUseCapture)===l)return o}return-1}Bn.prototype.dispatchEvent=function(e){var t=j(this._fragmentFiber);if(t===null)return!0;t=C(t);var s=this._eventListeners;if(s!==null&&0<s.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(s)for(var o=0;o<s.length;o++){var u=s[o];l.addEventListener(u.type,u.attachedListener,ai(u.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),s)for(o=0;o<s.length;o++)u=s[o],l.removeEventListener(u.type,u.attachedListener,ai(u.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},Bn.prototype.focus=function(e){x(this._fragmentFiber.child,!0,Pg,e,void 0,void 0)};function Pg(e,t){return e.tag===6?!1:(e=C(e),xN(e,t))}Bn.prototype.focusLast=function(e){var t=[];x(this._fragmentFiber.child,!0,Rf,t,void 0,void 0);for(var s=t.length-1;0<=s&&!Pg(t[s],e);s--);};function Rf(e,t){return t.push(e),!1}Bn.prototype.blur=function(){var e=j(this._fragmentFiber);e!==null&&(e=C(e),e=cr(e).activeElement,e!==null&&x(this._fragmentFiber.child,!1,lN,e,void 0,void 0))};function lN(e,t){return e.tag===6?!1:(e=C(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Bn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),x(this._fragmentFiber.child,!1,iN,e,void 0,void 0)};function iN(e,t){return e.tag===6||(e=C(e),t.observe(e)),!1}Bn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),x(this._fragmentFiber.child,!1,rN,e,void 0,void 0);for(var s=t=0;s<fa.length;s++){var l=fa[s];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):fa[t++]=l}fa.length=t}};function rN(e,t){return e.tag===6||(e=C(e),t.unobserve(e)),!1}var fa=[],zf=!1;function oN(e,t,s){fa.push({fragmentInstance:e,observer:t,instance:s}),zf||(zf=!0,gN(function(){zf=!1;var l=fa;fa=[];for(var o=0;o<l.length;o++){var u=l[o];u.observer.unobserve(u.instance)}}))}Bn.prototype.getClientRects=function(){var e=[];return x(this._fragmentFiber.child,!1,cN,e,void 0,void 0),e};function cN(e,t){if(e.tag===6){e=e.stateNode;var s=e.ownerDocument.createRange();s.selectNodeContents(e),t.push.apply(t,s.getClientRects())}else e=C(e),t.push.apply(t,e.getClientRects());return!1}Bn.prototype.getRootNode=function(e){var t=j(this._fragmentFiber);return t===null?this:C(t).getRootNode(e)},Bn.prototype.compareDocumentPosition=function(e){var t=j(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];x(this._fragmentFiber.child,!1,Rf,s,void 0,void 0);var l=C(t);if(s.length===0){if(s=l,S(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&&(s=t)}t=this._fragmentFiber;var o=l=s.compareDocumentPosition(e);return s===e?o=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=R(t)[1],s===null?o=Node.DOCUMENT_POSITION_PRECEDING:(e=C(s).compareDocumentPosition(e),o=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),o|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=C(s[0]),o=C(s[s.length-1]);var u=S(this._fragmentFiber)?t.parentElement:l;if(u==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=u.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,u=u.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY;var v=t.compareDocumentPosition(e),N=o.compareDocumentPosition(e),z=v&Node.DOCUMENT_POSITION_CONTAINED_BY||N&Node.DOCUMENT_POSITION_CONTAINED_BY;return N=l&&u&&v&Node.DOCUMENT_POSITION_FOLLOWING&&N&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||u&&o===e||z||N?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!u&&o===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:v,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||uN(t,this._fragmentFiber,s[0],s[s.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function uN(e,t,s,l,o){var u=$s(o);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){s=!0;break e}u=u.return}s=!1}return s}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(u===null)return u=o.ownerDocument,o===u||o===u.documentElement||o===u.body;e:{for(u=t,t=j(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===s)&&(t=Y(s,u,U),t===null?t=!1:(x(t,!0,O,u,s),u=D,D=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===l)&&(t=Y(l,u,U),t===null?t=!1:(x(t,!0,w,u,l),u=D,E=D=null,t=u!==null)),t):!1}function Fg(e,t){var s=e.ownerDocument.createRange();s.selectNodeContents(e),e=s.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Bn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(c(566));var t=[];x(this._fragmentFiber.child,!1,Rf,t,void 0,void 0);var s=e!==!1;if(t.length===0){var l=R(this._fragmentFiber);if(l=s?l[1]||l[0]||j(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=C(l),Fg(e,s);return}if(l=C(l),l.nodeType!==9){if(l.nodeType===11){s="host"in l?l.host:null,s!==null&&s.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=s?t.length-1:0;l!==(s?-1:t.length);){var o=t[l];o.tag===6?(o=C(o),Fg(o,s)):C(o).scrollIntoView(e),l+=s?-1:1}};function dN(e,t){return e=C(e),Jg(e,t),!1}function Jg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Wg(e,t){var s=t._eventListeners;if(s!==null)for(var l=0;l<s.length;l++){var o=s[l];e.addEventListener(o.type,o.attachedListener,ai(o.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(u){for(var v=0,N=0;N<fa.length;N++){var z=fa[N];(z.fragmentInstance!==t||z.observer!==u||z.instance!==e)&&(fa[v++]=z)}fa.length=v,u.observe(e)}),Jg(e,t))}function fN(e,t){var s=t._eventListeners;if(s!==null)for(var l=0;l<s.length;l++){var o=s[l];e.removeEventListener(o.type,o.attachedListener,ai(o.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(u){typeof u.rootMargin=="string"?oN(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Df(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Df(s),Pr(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function hN(e,t,s,l){for(;e.nodeType===1;){var o=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ti])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Pn(e.nextSibling),e===null)break}return null}function mN(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Pn(e.nextSibling),e===null))return null;return e}function ev(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Pn(e.nextSibling),e===null))return null;return e}function Af(e){return e.data==="$?"||e.data==="$~"}function Of(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function pN(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Pn(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 Mf=null;function tv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Pn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function nv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function xN(e,t){function s(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",s,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",s,!0)}return l}function gN(e){Gg(function(){Gg(function(t){return e(t)})})}function av(e,t,s){switch(t=cr(s),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function sv(e,t,s){for(var l in s){var o=s[l];s.hasOwnProperty(l)&&o!=null&&it(e,t,l,null,K1,o)}s.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Sa&&(e.onclick=null),Pr(e)}function _f(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pr(e)}var Fn=new Map,lv=new Set;function ur(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 Fa=ie.d;ie.d={f:vN,r:yN,D:bN,C:jN,L:NN,m:wN,X:kN,S:SN,M:CN};function vN(){var e=Fa.f(),t=ec();return e||t}function yN(e){var t=Nl(e);t!==null&&t.tag===5&&t.type==="form"?rx(t):Fa.r(e)}var si=typeof document>"u"?null:document;function iv(e,t,s){var l=si;if(l&&typeof t=="string"&&t){var o=Yn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof s=="string"&&(o+='[crossorigin="'+s+'"]'),lv.has(o)||(lv.add(o),e={rel:e,crossOrigin:s,href:t},l.querySelector(o)===null&&(t=l.createElement("link"),tn(t,"link",e),Yt(t),l.head.appendChild(t)))}}function bN(e){Fa.D(e),iv("dns-prefetch",e,null)}function jN(e,t){Fa.C(e,t),iv("preconnect",e,t)}function NN(e,t,s){Fa.L(e,t,s);var l=si;if(l&&e&&t){var o='link[rel="preload"][as="'+Yn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(o+='[imagesrcset="'+Yn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(o+='[imagesizes="'+Yn(s.imageSizes)+'"]')):o+='[href="'+Yn(e)+'"]';var u=o;switch(t){case"style":u=li(e);break;case"script":u=ii(e)}if(!(Fn.has(u)||(e=A({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Fn.set(u,e),l.querySelector(o)!==null||t==="style"&&l.querySelector(dr(u))||t==="script"&&l.querySelector(fr(u))))){var v=l.createElement("link");tn(v,"link",e),t==="style"&&(v[Ir]=!0,v.onload=v.onerror=function(){ym(v)}),Yt(v),l.head.appendChild(v)}}}function wN(e,t){Fa.m(e,t);var s=si;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Yn(l)+'"][href="'+Yn(e)+'"]',u=o;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ii(e)}if(!Fn.has(u)&&(e=A({rel:"modulepreload",href:e},t),Fn.set(u,e),s.querySelector(o)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(fr(u)))return}l=s.createElement("link"),tn(l,"link",e),Yt(l),s.head.appendChild(l)}}}function SN(e,t,s){Fa.S(e,t,s);var l=si;if(l&&e){var o=wl(l).hoistableStyles,u=li(e);t=t||"default";var v=o.get(u);if(!v){var N={loading:0,preload:null};if(v=l.querySelector(dr(u)))N.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Fn.get(u))&&Lf(e,s);var z=v=l.createElement("link");Yt(z),tn(z,"link",e),z._p=new Promise(function(G,P){z.onload=G,z.onerror=P}),z.addEventListener("load",function(){N.loading|=1}),z.addEventListener("error",function(){N.loading|=2}),N.loading|=4,rc(v,t,l)}v={type:"stylesheet",instance:v,count:1,state:N},o.set(u,v)}}}function kN(e,t){Fa.X(e,t);var s=si;if(s&&e){var l=wl(s).hoistableScripts,o=ii(e),u=l.get(o);u||(u=s.querySelector(fr(o)),u||(e=A({src:e,async:!0},t),(t=Fn.get(o))&&Uf(e,t),u=s.createElement("script"),Yt(u),tn(u,"link",e),s.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function CN(e,t){Fa.M(e,t);var s=si;if(s&&e){var l=wl(s).hoistableScripts,o=ii(e),u=l.get(o);u||(u=s.querySelector(fr(o)),u||(e=A({src:e,async:!0,type:"module"},t),(t=Fn.get(o))&&Uf(e,t),u=s.createElement("script"),Yt(u),tn(u,"link",e),s.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function rv(e,t,s,l){var o=(o=xt.current)?ur(o):null;if(!o)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=li(s.href),t=wl(o).hoistableStyles,l=t.get(s),l||(l={type:"style",instance:null,count:0,state:null},t.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=li(s.href);var u=wl(o).hoistableStyles,v=u.get(e);if(v||(o=o.ownerDocument||o,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,v),(u=o.querySelector(dr(e)))?u._p||(v.instance=u,v.state.loading=5):(u=Fn.get(e),u||(u={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Fn.set(e,u)),TN(o,e,u,v.state))),t&&l===null)throw Error(c(528,""));return v}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(s=ii(s),t=wl(o).hoistableScripts,l=t.get(s),l||(l={type:"script",instance:null,count:0,state:null},t.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function li(e){return'href="'+Yn(e)+'"'}function dr(e){return'link[rel="stylesheet"]['+e+"]"}function ov(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function TN(e,t,s,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ir]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Ir]=!0,t.onload=t.onerror=ym.bind(null,t),tn(t,"link",s),Yt(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 ii(e){return'[src="'+Yn(e)+'"]'}function fr(e){return"script[async]"+e}function cv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Yn(s.href)+'"]');if(l)return t.instance=l,Yt(l),l;var o=A({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Yt(l),tn(l,"style",o),rc(l,s.precedence,e),t.instance=l;case"stylesheet":o=li(s.href);var u=e.querySelector(dr(o));if(u)return t.state.loading|=4,t.instance=u,Yt(u),u;l=ov(s),(o=Fn.get(o))&&Lf(l,o),u=(e.ownerDocument||e).createElement("link"),Yt(u);var v=u;return v._p=new Promise(function(N,z){v.onload=N,v.onerror=z}),tn(u,"link",l),t.state.loading|=4,rc(u,s.precedence,e),t.instance=u;case"script":return u=ii(s.src),(o=e.querySelector(fr(u)))?(t.instance=o,Yt(o),o):(l=s,(o=Fn.get(u))&&(l=A({},s),Uf(l,o)),e=e.ownerDocument||e,o=e.createElement("script"),Yt(o),tn(o,"link",l),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,rc(l,s.precedence,e));return t.instance}function rc(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=l.length?l[l.length-1]:null,u=o,v=0;v<l.length;v++){var N=l[v];if(N.dataset.precedence===t)u=N;else if(u!==o)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Lf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var oc=null;function uv(e,t,s){if(oc===null){var l=new Map,o=oc=new Map;o.set(s,l)}else o=oc,l=o.get(s),l||(l=new Map,o.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),o=0;o<s.length;o++){var u=s[o];if(!(u[Ti]||u[Pt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var v=u.getAttribute(t)||"";v=e+v;var N=l.get(v);N?N.push(u):l.set(v,[u])}}return l}function Hf(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function EN(e,t,s){if(s===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 dv(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function fv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function hv(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function mv(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=hv(t),e.suspenseyImages.push(t)),e=DN.bind(e),t.decode().then(e,e))}function RN(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var o=li(l.href),u=t.querySelector(dr(o));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=u,Yt(u);return}u=t.ownerDocument||t,l=ov(l),(o=Fn.get(o))&&Lf(l,o),u=u.createElement("link"),Yt(u);var v=u;v._p=new Promise(function(N,z){v.onload=N,v.onerror=z}),tn(u,"link",l),s.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=hr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var cc=0;function zN(e,t){return e.stylesheets&&e.count===0&&dc(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&dc(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&cc===0&&(cc=62500*Q1());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dc(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>cc?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(o)}}:null}function pv(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function hr(){this.count--,pv(this)}function DN(){this.imgCount--,pv(this)}var uc=null;function dc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uc=new Map,t.forEach(AN,e),uc=null,hr.call(e))}function AN(e,t){if(!(t.state.loading&4)){var s=uc.get(e);if(s)var l=s.get(null);else{s=new Map,uc.set(e,s);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<o.length;u++){var v=o[u];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(s.set(v.dataset.precedence,v),l=v)}l&&s.set(null,l)}o=t.instance,v=o.getAttribute("data-precedence"),u=s.get(v)||l,u===l&&s.set(null,o),s.set(v,o),this.count++,l=hr.bind(this),o.addEventListener("load",l),o.addEventListener("error",l),u?u.parentNode.insertBefore(o,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ri={$$typeof:ce,Provider:null,Consumer:null,_currentValue:Pe,_currentValue2:Pe,_threadCount:0};function ON(e,t,s,l,o,u,v,N,z){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=gu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gu(0),this.hiddenUpdates=gu(null),this.identifierPrefix=l,this.onUncaughtError=o,this.onCaughtError=u,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.transitionTypes=null,this.incompleteTransitions=new Map}function xv(e,t,s,l,o,u,v,N,z,G,P,le){return e=new ON(e,t,s,v,z,G,P,le,N),t=1,u===!0&&(t|=24),u=Sn(3,null,null,t),e.current=u,u.stateNode=e,t=Ju(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:s,cache:t},nd(u),e}function gv(e){return e?(e=Ol,e):Ol}function vv(e,t,s,l,o,u){o=gv(o),l.context===null?l.context=o:l.pendingContext=o,l=fs(t),l.payload={element:s},u=u===void 0?null:u,u!==null&&(l.callback=u),s=hs(e,l,t),s!==null&&(En(s,e,t),Vi(s,e,t))}function yv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Bf(e,t){yv(e,t),(e=e.alternate)&&yv(e,t)}function bv(e){if(e.tag===13||e.tag===31){var t=Vs(e,67108864);t!==null&&En(t,e,67108864),Bf(e,67108864)}}function jv(e){if(e.tag===13||e.tag===31){var t=Hn();t=vu(t);var s=Vs(e,t);s!==null&&En(s,e,t),Bf(e,t)}}var oi=!0;function MN(e,t,s,l){var o=me.T;me.T=null;var u=ie.p;try{ie.p=2,$f(e,t,s,l)}finally{ie.p=u,me.T=o}}function _N(e,t,s,l){var o=me.T;me.T=null;var u=ie.p;try{ie.p=8,$f(e,t,s,l)}finally{ie.p=u,me.T=o}}function $f(e,t,s,l){if(oi){var o=qf(l);if(o===null)jf(e,t,l,fc,s),wv(e,l);else if(UN(o,e,t,s,l))l.stopPropagation();else if(wv(e,l),t&4&&-1<LN.indexOf(e)){for(;o!==null;){var u=Nl(o);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var v=ia(u.pendingLanes);if(v!==0){var N=u;for(N.pendingLanes|=2,N.entangledLanes|=2;v;){var z=1<<31-Nt(v);N.entanglements[1]|=z,v&=~z}Ma(u),(We&6)===0&&(Fo=Ze()+500,ir(0))}}break;case 31:case 13:N=Vs(u,2),N!==null&&En(N,u,2),ec(),Bf(u,2)}if(u=qf(l),u===null&&jf(e,t,l,fc,s),u===o)break;o=u}o!==null&&l.stopPropagation()}else jf(e,t,l,null,s)}}function qf(e){return e=ku(e),Gf(e)}var fc=null;function Gf(e){if(fc=null,e=$s(e),e!==null){var t=f(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=m(t),e!==null)return e;e=null}else if(s===31){if(e=h(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fc=e,null}function Nv(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(It()){case Zr:return 2;case Ht:return 8;case Gt:case on:return 32;case sa:return 268435456;default:return 32}default:return 32}}var Yf=!1,ks=null,Cs=null,Ts=null,mr=new Map,pr=new Map,Es=[],LN="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 wv(e,t){switch(e){case"focusin":case"focusout":ks=null;break;case"dragenter":case"dragleave":Cs=null;break;case"mouseover":case"mouseout":Ts=null;break;case"pointerover":case"pointerout":mr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pr.delete(t.pointerId)}}function xr(e,t,s,l,o,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:u,targetContainers:[o]},t!==null&&(t=Nl(t),t!==null&&bv(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function UN(e,t,s,l,o){switch(t){case"focusin":return ks=xr(ks,e,t,s,l,o),!0;case"dragenter":return Cs=xr(Cs,e,t,s,l,o),!0;case"mouseover":return Ts=xr(Ts,e,t,s,l,o),!0;case"pointerover":var u=o.pointerId;return mr.set(u,xr(mr.get(u)||null,e,t,s,l,o)),!0;case"gotpointercapture":return u=o.pointerId,pr.set(u,xr(pr.get(u)||null,e,t,s,l,o)),!0}return!1}function Sv(e){var t=$s(e.target);if(t!==null){var s=f(t);if(s!==null){if(t=s.tag,t===13){if(t=m(s),t!==null){e.blockedOn=t,xm(e.priority,function(){jv(s)});return}}else if(t===31){if(t=h(s),t!==null){e.blockedOn=t,xm(e.priority,function(){jv(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function hc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=qf(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Su=l,s.target.dispatchEvent(l),Su=null}else return t=Nl(s),t!==null&&bv(t),e.blockedOn=s,!1;t.shift()}return!0}function kv(e,t,s){hc(e)&&s.delete(t)}function HN(){Yf=!1,ks!==null&&hc(ks)&&(ks=null),Cs!==null&&hc(Cs)&&(Cs=null),Ts!==null&&hc(Ts)&&(Ts=null),mr.forEach(kv),pr.forEach(kv)}function mc(e,t){e.blockedOn===t&&(e.blockedOn=null,Yf||(Yf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,HN)))}var pc=null;function Cv(e){pc!==e&&(pc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){pc===e&&(pc=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],o=e[t+2];if(typeof l!="function"){if(Gf(l||s)===null)continue;break}var u=Nl(s);u!==null&&(e.splice(t,3),t-=3,wd(u,{pending:!0,data:o,method:s.method,action:l},l,o))}}))}function ci(e){function t(z){return mc(z,e)}ks!==null&&mc(ks,e),Cs!==null&&mc(Cs,e),Ts!==null&&mc(Ts,e),mr.forEach(t),pr.forEach(t);for(var s=0;s<Es.length;s++){var l=Es[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Es.length&&(s=Es[0],s.blockedOn===null);)Sv(s),s.blockedOn===null&&Es.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var o=s[l],u=s[l+1],v=o[wn]||null;if(typeof u=="function")v||Cv(s);else if(v){var N=null;if(u&&u.hasAttribute("formAction")){if(o=u,v=u[wn]||null)N=v.formAction;else if(Gf(o)!==null)continue}else N=v.action;typeof N=="function"?s[l+1]=N:(s.splice(l,3),l-=3),Cv(s)}}}function Tv(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(v){return o=v})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Vf(e){this._internalRoot=e}xc.prototype.render=Vf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var s=t.current,l=Hn();vv(s,l,e,t,null,null)},xc.prototype.unmount=Vf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vv(e.current,2,null,e,null,null),ec(),t[jl]=null}};function xc(e){this._internalRoot=e}xc.prototype.unstable_scheduleHydration=function(e){if(e){var t=pm();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Es.length&&t!==0&&t<Es[s].priority;s++);Es.splice(s,0,e),s===0&&Sv(e)}};var Ev=i.version;if(Ev!=="19.3.1")throw Error(c(527,Ev,"19.3.1"));ie.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=y(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var BN={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gc.isDisabled&&gc.supportsFiber)try{an=gc.inject(BN),At=gc}catch{}}return vr.createRoot=function(e,t){if(!d(e))throw Error(c(299));var s=!1,l="",o=gx,u=vx,v=yx;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(v=t.onRecoverableError)),t=xv(e,1,!1,null,null,s,l,null,o,u,v,Tv),e[jl]=t.current,bf(e),new Vf(t)},vr.hydrateRoot=function(e,t,s){if(!d(e))throw Error(c(299));var l=!1,o="",u=gx,v=vx,N=yx,z=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(o=s.identifierPrefix),s.onUncaughtError!==void 0&&(u=s.onUncaughtError),s.onCaughtError!==void 0&&(v=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(z=s.formState)),t=xv(e,1,!0,t,s??null,l,o,z,u,v,N,Tv),t.context=gv(null),s=t.current,l=Hn(),l=vu(l),o=fs(l),o.callback=null,hs(s,o,l),s=l,t.current.lanes=s,Ci(t,s),Ma(t),e[jl]=t.current,bf(e),new xc(t)},vr.version="19.3.1",vr}var Hv;function IN(){if(Hv)return Zf.exports;Hv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Zf.exports=QN(),Zf.exports}var PN=IN();/**
50
50
  * react-router v7.18.6
51
51
  *
52
52
  * Copyright (c) Remix Software Inc.
@@ -55,478 +55,478 @@ Error generating stack: `+l.message+`
55
55
  * LICENSE.md file in the root directory of this source tree.
56
56
  *
57
57
  * @license MIT
58
- */var Zc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Jv=/^[\\/]{2}/;function VN(n,i){return i+n.replace(/\\/g,"/")}var Uy="popstate";function Hy(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function XN(n={}){function i(d,f){let{pathname:m="/",search:h="",hash:g=""}=xl(d.location.hash.substring(1));return!m.startsWith("/")&&!m.startsWith(".")&&(m="/"+m),hh("",{pathname:m,search:h,hash:g},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function r(d,f){let m=d.document.querySelector("base"),h="";if(m&&m.getAttribute("href")){let g=d.location.href,v=g.indexOf("#");h=v===-1?g:g.slice(0,v)}return h+"#"+(typeof f=="string"?f:pi(f))}function c(d,f){ea(d.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(f)})`)}return ZN(i,r,c,n)}function vt(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function ea(n,i){if(!n){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function KN(){return Math.random().toString(36).substring(2,10)}function By(n,i){return{usr:n.state,key:n.key,idx:i,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function hh(n,i,r=null,c,d){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof i=="string"?xl(i):i,state:r,key:i&&i.key||c||KN(),mask:d}}function pi({pathname:n="/",search:i="",hash:r=""}){return i&&i!=="?"&&(n+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(n+=r.charAt(0)==="#"?r:"#"+r),n}function xl(n){let i={};if(n){let r=n.indexOf("#");r>=0&&(i.hash=n.substring(r),n=n.substring(0,r));let c=n.indexOf("?");c>=0&&(i.search=n.substring(c),n=n.substring(0,c)),n&&(i.pathname=n)}return i}function ZN(n,i,r,c={}){let{window:d=document.defaultView,v5Compat:f=!1}=c,m=d.history,h="POP",g=null,v=b();v==null&&(v=0,m.replaceState({...m.state,idx:v},""));function b(){return(m.state||{idx:null}).idx}function x(){h="POP";let C=b(),z=C==null?null:C-v;v=C,g&&g({action:h,location:k.location,delta:z})}function j(C,z){h="PUSH";let w=Hy(C)?C:hh(k.location,C,z);r&&r(w,C),v=b()+1;let O=By(w,v),E=k.createHref(w.mask||w);try{m.pushState(O,"",E)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;d.location.assign(E)}f&&g&&g({action:h,location:k.location,delta:1})}function S(C,z){h="REPLACE";let w=Hy(C)?C:hh(k.location,C,z);r&&r(w,C),v=b();let O=By(w,v),E=k.createHref(w.mask||w);m.replaceState(O,"",E),f&&g&&g({action:h,location:k.location,delta:0})}function R(C){return QN(d,C)}let k={get action(){return h},get location(){return n(d,m)},listen(C){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Uy,x),g=C,()=>{d.removeEventListener(Uy,x),g=null}},createHref(C){return i(d,C)},createURL:R,encodeLocation(C){let z=R(C);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:j,replace:S,go(C){return m.go(C)}};return k}function QN(n,i,r=!1){let c="http://localhost";n&&(c=n.location.origin!=="null"?n.location.origin:n.location.href),vt(c,"No window.location.(origin|href) available to create URL");let d=typeof i=="string"?i:pi(i);return d=d.replace(/ $/,"%20"),!r&&Jv.test(d)&&(d=c+d),new URL(d,c)}var mh=new URL("http://localhost");function Wv(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),mh)}catch{return mh}}function If(n,i){return n.origin===i.origin&&(n.origin!=="null"||n.protocol===i.protocol&&n.host===i.host)}function eb(n,i){if(n.startsWith("//"))return!0;let r=i.protocol.toLowerCase();return n.toLowerCase().startsWith(r)?i.host===""||n.slice(r.length).startsWith("//"):!1}function tb(n){let i=n.replace(/[\t\n\r]/g,""),r=0;for(;i.charCodeAt(r)<=32;)r++;if(i=i.slice(r),!Zc.test(i))return;let c;try{c=new URL(n,mh)}catch{return}if(!eb(n,c))throw new Error("External navigation is not allowed")}function nb(n,i,r,c){let d=null;try{d=n==null?null:new URL(n,r)}catch{}let f=new URL(i,r),m=d!=null&&!If(d,r),h=!If(f,r);if(c==="reject"){if(m||h)throw new Error("External navigation is not allowed")}else if(h&&(d==null||!eb(n,d)||!If(d,f)))throw new Error("External navigation is not allowed")}function ab(n,i,r="/"){return IN(n,i,r,!1)}function IN(n,i,r,c,d){let f=typeof i=="string"?xl(i):i,m=es(f.pathname||"/",r);if(m==null)return null;let h=PN(n),g=null,v=r2(m);for(let b=0;g==null&&b<h.length;++b)g=i2(h[b],v,c);return g}function PN(n){let i=sb(n);return FN(i),i}function sb(n,i=[],r=[],c="",d=!1){let f=(m,h,g=d,v)=>{let b={relativePath:v===void 0?m.path||"":v,caseSensitive:m.caseSensitive===!0,childrenIndex:h,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(c)&&g)return;vt(b.relativePath.startsWith(c),`Absolute route path "${b.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(c.length)}let x=ha([c,b.relativePath]),j=r.concat(b);m.children&&m.children.length>0&&(vt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),sb(m.children,i,j,x,g)),!(m.path==null&&!m.index)&&i.push({path:x,score:s2(x,m.index),routesMeta:j.map((S,R)=>{let[k,C]=rb(S.relativePath,S.caseSensitive,R===j.length-1);return{...S,matcher:k,compiledParams:C}})})};return n.forEach((m,h)=>{if(m.path===""||!m.path?.includes("?"))f(m,h);else for(let g of lb(m.path))f(m,h,!0,g)}),i}function lb(n){let i=n.split("/");if(i.length===0)return[];let[r,...c]=i,d=r.endsWith("?"),f=r.replace(/\?$/,"");if(c.length===0)return d?[f,""]:[f];let m=lb(c.join("/")),h=[];return h.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&h.push(...m),h.map(g=>n.startsWith("/")&&g===""?"/":g)}function FN(n){n.sort((i,r)=>i.score!==r.score?r.score-i.score:l2(i.routesMeta.map(c=>c.childrenIndex),r.routesMeta.map(c=>c.childrenIndex)))}var JN=/^:[\w-]+$/,WN=3,e2=2,t2=1,n2=10,a2=-2,$y=n=>n==="*";function s2(n,i){let r=n.split("/"),c=r.length;return r.some($y)&&(c+=a2),i&&(c+=e2),r.filter(d=>!$y(d)).reduce((d,f)=>d+(JN.test(f)?WN:f===""?t2:n2),c)}function l2(n,i){return n.length===i.length&&n.slice(0,-1).every((c,d)=>c===i[d])?n[n.length-1]-i[i.length-1]:0}function i2(n,i,r=!1){let{routesMeta:c}=n,d={},f="/",m=[];for(let h=0;h<c.length;++h){let g=c[h],v=h===c.length-1,b=f==="/"?i:i.slice(f.length)||"/",x={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},j=g.matcher&&g.compiledParams?ib(x,b,g.matcher,g.compiledParams):Oc(x,b),S=g.route;if(!j&&v&&r&&!c[c.length-1].route.index&&(j=Oc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!j)return null;Object.assign(d,j.params),m.push({params:d,pathname:ha([f,j.pathname]),pathnameBase:u2(ha([f,j.pathnameBase])),route:S}),j.pathnameBase!=="/"&&(f=ha([f,j.pathnameBase]))}return m}function Oc(n,i){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[r,c]=rb(n.path,n.caseSensitive,n.end);return ib(n,i,r,c)}function ib(n,i,r,c){let d=i.match(r);if(!d)return null;let f=d[0],m=xi(f,1),h=d.slice(1);return{params:c.reduce((v,{paramName:b,isOptional:x},j)=>{if(b==="*"){let R=h[j]||"";m=xi(f.slice(0,f.length-R.length),1)}const S=h[j];return x&&!S?v[b]=void 0:v[b]=(S||"").replace(/%2F/g,"/"),v},{}),pathname:f,pathnameBase:m,pattern:n}}function rb(n,i=!1,r=!0){ea(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let c=[],d="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,h,g,v,b)=>{if(c.push({paramName:h,isOptional:g!=null}),g){let x=b.charAt(v+m.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(c.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),c]}function r2(n){try{return n.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return ea(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),n}}function es(n,i){if(i==="/")return n;if(!n.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,c=n.charAt(r);return c&&c!=="/"?null:n.slice(r)||"/"}function o2(n,i="/"){let{pathname:r,search:c="",hash:d=""}=typeof n=="string"?xl(n):n,f;return r?(r=cb(r),r.startsWith("/")||r.startsWith("\\")?f=qy(r.substring(1),"/"):f=qy(r,i)):f=i,{pathname:f,search:d2(c),hash:f2(d)}}function qy(n,i){let r=xi(i).split("/");return n.split("/").forEach(d=>{d===".."?r.length>1&&r.pop():d!=="."&&r.push(d)}),r.length>1?r.join("/"):"/"}function Pf(n,i,r,c){return`Cannot include a '${n}' character in a manually specified \`to.${i}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function c2(n){return n.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function ob(n){let i=c2(n);return i.map((r,c)=>c===i.length-1?r.pathname:r.pathnameBase)}function _h(n,i,r,c=!1){let d;typeof n=="string"?d=xl(n):(d={...n},vt(!d.pathname||!d.pathname.includes("?"),Pf("?","pathname","search",d)),vt(!d.pathname||!d.pathname.includes("#"),Pf("#","pathname","hash",d)),vt(!d.search||!d.search.includes("#"),Pf("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,h;if(m==null)h=r;else{let x=i.length-1;if(!c&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),x-=1;d.pathname=j.join("/")}h=x>=0?i[x]:"/"}let g=o2(d,h),v=m&&m!=="/"&&m.endsWith("/"),b=(f||m===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(v||b)&&(g.pathname+="/"),g}var cb=n=>n.replace(/[\\/]{2,}/g,"/"),ha=n=>cb(n.join("/"));function xi(n,i=0){let r=n.length;for(;r>i&&n.charCodeAt(r-1)===47;)r--;return r===n.length?n:n.slice(0,r)}var u2=n=>xi(n).replace(/^\/*/,"/"),d2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,f2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,h2=class{constructor(n,i,r,c=!1){this.status=n,this.statusText=i||"",this.internal=c,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function m2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function p2(n){let i=n.map(r=>r.route.path).filter(Boolean);return ha(i)||"/"}var ub=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function db(n,i){let r=n;if(typeof r!="string"||!Zc.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let c=r,d=!1;if(ub)try{let f=new URL(window.location.href),m=Jv.test(r)?new URL(VN(r,f.protocol)):new URL(r),h=es(m.pathname,i);m.origin===f.origin&&h!=null?r=h+m.search+m.hash:d=!0}catch{ea(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var fb=["POST","PUT","PATCH","DELETE"];new Set(fb);var x2=["GET",...fb];new Set(x2);var g2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function y2(n){try{return g2.includes(new URL(n).protocol)}catch{return!1}}var yi=p.createContext(null);yi.displayName="DataRouter";var Qc=p.createContext(null);Qc.displayName="DataRouterState";var hb=p.createContext(!1);function v2(){return p.useContext(hb)}var mb=p.createContext({isTransitioning:!1});mb.displayName="ViewTransition";var b2=p.createContext(new Map);b2.displayName="Fetchers";var j2=p.createContext(null);j2.displayName="Await";var ta=p.createContext(null);ta.displayName="Navigation";var Mr=p.createContext(null);Mr.displayName="Location";var _a=p.createContext({outlet:null,matches:[],isDataRoute:!1});_a.displayName="Route";var Lh=p.createContext(null);Lh.displayName="RouteError";var pb="REACT_ROUTER_ERROR",N2="REDIRECT",w2="ROUTE_ERROR_RESPONSE";function S2(n){if(n.startsWith(`${pb}:${N2}:{`))try{let i=JSON.parse(n.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function k2(n){if(n.startsWith(`${pb}:${w2}:{`))try{let i=JSON.parse(n.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new h2(i.status,i.statusText,i.data)}catch{}}function C2(n,{relative:i}={}){vt(_r(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:c}=p.useContext(ta),{hash:d,pathname:f,search:m}=Lr(n,{relative:i}),h=f;return r!=="/"&&(h=f==="/"?r:ha([r,f])),c.createHref({pathname:h,search:m,hash:d})}function _r(){return p.useContext(Mr)!=null}function qn(){return vt(_r(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Mr).location}var xb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function gb(n){p.useContext(ta).static||p.useLayoutEffect(n)}function Ic(){let{isDataRoute:n}=p.useContext(_a);return n?q2():T2()}function T2(){vt(_r(),"useNavigate() may be used only in the context of a <Router> component.");let n=p.useContext(yi),{basename:i,navigator:r}=p.useContext(ta),{matches:c}=p.useContext(_a),{pathname:d}=qn(),f=JSON.stringify(ob(c)),m=p.useRef(!1);return gb(()=>{m.current=!0}),p.useCallback((g,v={})=>{if(ea(m.current,xb),!m.current)return;if(typeof g=="number"){r.go(g);return}let b=_h(g,JSON.parse(f),d,v.relative==="path");n==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:ha([i,b.pathname])),nb(typeof g=="string"?g:pi(g),r.createHref(b),Wv(r),"reject"),(v.replace?r.replace:r.push)(b,v.state,v)},[i,r,f,d,n])}var E2=p.createContext(null);function R2(n){let i=p.useContext(_a).outlet;return p.useMemo(()=>i&&p.createElement(E2.Provider,{value:n},i),[i,n])}function Lr(n,{relative:i}={}){let{matches:r}=p.useContext(_a),{pathname:c}=qn(),d=JSON.stringify(ob(r));return p.useMemo(()=>_h(n,JSON.parse(d),c,i==="path"),[n,d,c,i])}function z2(n,i){return yb(n,i)}function yb(n,i,r){vt(_r(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=p.useContext(ta),{matches:d}=p.useContext(_a),f=d[d.length-1],m=f?f.params:{},h=f?f.pathname:"/",g=f?f.pathnameBase:"/",v=f&&f.route;{let C=v&&v.path||"";bb(h,!v||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${C}">) 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.
58
+ */var Pc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,eb=/^[\\/]{2}/;function FN(n,i){return i+n.replace(/\\/g,"/")}var Bv="popstate";function $v(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function JN(n={}){function i(d,f){let{pathname:m="/",search:h="",hash:g=""}=xl(d.location.hash.substring(1));return!m.startsWith("/")&&!m.startsWith(".")&&(m="/"+m),mh("",{pathname:m,search:h,hash:g},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function r(d,f){let m=d.document.querySelector("base"),h="";if(m&&m.getAttribute("href")){let g=d.location.href,y=g.indexOf("#");h=y===-1?g:g.slice(0,y)}return h+"#"+(typeof f=="string"?f:xi(f))}function c(d,f){ea(d.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(f)})`)}return e2(i,r,c,n)}function yt(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function ea(n,i){if(!n){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function WN(){return Math.random().toString(36).substring(2,10)}function qv(n,i){return{usr:n.state,key:n.key,idx:i,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function mh(n,i,r=null,c,d){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof i=="string"?xl(i):i,state:r,key:i&&i.key||c||WN(),mask:d}}function xi({pathname:n="/",search:i="",hash:r=""}){return i&&i!=="?"&&(n+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(n+=r.charAt(0)==="#"?r:"#"+r),n}function xl(n){let i={};if(n){let r=n.indexOf("#");r>=0&&(i.hash=n.substring(r),n=n.substring(0,r));let c=n.indexOf("?");c>=0&&(i.search=n.substring(c),n=n.substring(0,c)),n&&(i.pathname=n)}return i}function e2(n,i,r,c={}){let{window:d=document.defaultView,v5Compat:f=!1}=c,m=d.history,h="POP",g=null,y=b();y==null&&(y=0,m.replaceState({...m.state,idx:y},""));function b(){return(m.state||{idx:null}).idx}function x(){h="POP";let C=b(),D=C==null?null:C-y;y=C,g&&g({action:h,location:k.location,delta:D})}function j(C,D){h="PUSH";let E=$v(C)?C:mh(k.location,C,D);r&&r(E,C),y=b()+1;let O=qv(E,y),w=k.createHref(E.mask||E);try{m.pushState(O,"",w)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;d.location.assign(w)}f&&g&&g({action:h,location:k.location,delta:1})}function S(C,D){h="REPLACE";let E=$v(C)?C:mh(k.location,C,D);r&&r(E,C),y=b();let O=qv(E,y),w=k.createHref(E.mask||E);m.replaceState(O,"",w),f&&g&&g({action:h,location:k.location,delta:0})}function R(C){return t2(d,C)}let k={get action(){return h},get location(){return n(d,m)},listen(C){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Bv,x),g=C,()=>{d.removeEventListener(Bv,x),g=null}},createHref(C){return i(d,C)},createURL:R,encodeLocation(C){let D=R(C);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:j,replace:S,go(C){return m.go(C)}};return k}function t2(n,i,r=!1){let c="http://localhost";n&&(c=n.location.origin!=="null"?n.location.origin:n.location.href),yt(c,"No window.location.(origin|href) available to create URL");let d=typeof i=="string"?i:xi(i);return d=d.replace(/ $/,"%20"),!r&&eb.test(d)&&(d=c+d),new URL(d,c)}var ph=new URL("http://localhost");function tb(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),ph)}catch{return ph}}function Ff(n,i){return n.origin===i.origin&&(n.origin!=="null"||n.protocol===i.protocol&&n.host===i.host)}function nb(n,i){if(n.startsWith("//"))return!0;let r=i.protocol.toLowerCase();return n.toLowerCase().startsWith(r)?i.host===""||n.slice(r.length).startsWith("//"):!1}function ab(n){let i=n.replace(/[\t\n\r]/g,""),r=0;for(;i.charCodeAt(r)<=32;)r++;if(i=i.slice(r),!Pc.test(i))return;let c;try{c=new URL(n,ph)}catch{return}if(!nb(n,c))throw new Error("External navigation is not allowed")}function sb(n,i,r,c){let d=null;try{d=n==null?null:new URL(n,r)}catch{}let f=new URL(i,r),m=d!=null&&!Ff(d,r),h=!Ff(f,r);if(c==="reject"){if(m||h)throw new Error("External navigation is not allowed")}else if(h&&(d==null||!nb(n,d)||!Ff(d,f)))throw new Error("External navigation is not allowed")}function lb(n,i,r="/"){return n2(n,i,r,!1)}function n2(n,i,r,c,d){let f=typeof i=="string"?xl(i):i,m=es(f.pathname||"/",r);if(m==null)return null;let h=a2(n),g=null,y=m2(m);for(let b=0;g==null&&b<h.length;++b)g=h2(h[b],y,c);return g}function a2(n){let i=ib(n);return s2(i),i}function ib(n,i=[],r=[],c="",d=!1){let f=(m,h,g=d,y)=>{let b={relativePath:y===void 0?m.path||"":y,caseSensitive:m.caseSensitive===!0,childrenIndex:h,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(c)&&g)return;yt(b.relativePath.startsWith(c),`Absolute route path "${b.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(c.length)}let x=ha([c,b.relativePath]),j=r.concat(b);m.children&&m.children.length>0&&(yt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),ib(m.children,i,j,x,g)),!(m.path==null&&!m.index)&&i.push({path:x,score:d2(x,m.index),routesMeta:j.map((S,R)=>{let[k,C]=cb(S.relativePath,S.caseSensitive,R===j.length-1);return{...S,matcher:k,compiledParams:C}})})};return n.forEach((m,h)=>{if(m.path===""||!m.path?.includes("?"))f(m,h);else for(let g of rb(m.path))f(m,h,!0,g)}),i}function rb(n){let i=n.split("/");if(i.length===0)return[];let[r,...c]=i,d=r.endsWith("?"),f=r.replace(/\?$/,"");if(c.length===0)return d?[f,""]:[f];let m=rb(c.join("/")),h=[];return h.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&h.push(...m),h.map(g=>n.startsWith("/")&&g===""?"/":g)}function s2(n){n.sort((i,r)=>i.score!==r.score?r.score-i.score:f2(i.routesMeta.map(c=>c.childrenIndex),r.routesMeta.map(c=>c.childrenIndex)))}var l2=/^:[\w-]+$/,i2=3,r2=2,o2=1,c2=10,u2=-2,Gv=n=>n==="*";function d2(n,i){let r=n.split("/"),c=r.length;return r.some(Gv)&&(c+=u2),i&&(c+=r2),r.filter(d=>!Gv(d)).reduce((d,f)=>d+(l2.test(f)?i2:f===""?o2:c2),c)}function f2(n,i){return n.length===i.length&&n.slice(0,-1).every((c,d)=>c===i[d])?n[n.length-1]-i[i.length-1]:0}function h2(n,i,r=!1){let{routesMeta:c}=n,d={},f="/",m=[];for(let h=0;h<c.length;++h){let g=c[h],y=h===c.length-1,b=f==="/"?i:i.slice(f.length)||"/",x={path:g.relativePath,caseSensitive:g.caseSensitive,end:y},j=g.matcher&&g.compiledParams?ob(x,b,g.matcher,g.compiledParams):_c(x,b),S=g.route;if(!j&&y&&r&&!c[c.length-1].route.index&&(j=_c({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!j)return null;Object.assign(d,j.params),m.push({params:d,pathname:ha([f,j.pathname]),pathnameBase:g2(ha([f,j.pathnameBase])),route:S}),j.pathnameBase!=="/"&&(f=ha([f,j.pathnameBase]))}return m}function _c(n,i){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[r,c]=cb(n.path,n.caseSensitive,n.end);return ob(n,i,r,c)}function ob(n,i,r,c){let d=i.match(r);if(!d)return null;let f=d[0],m=gi(f,1),h=d.slice(1);return{params:c.reduce((y,{paramName:b,isOptional:x},j)=>{if(b==="*"){let R=h[j]||"";m=gi(f.slice(0,f.length-R.length),1)}const S=h[j];return x&&!S?y[b]=void 0:y[b]=(S||"").replace(/%2F/g,"/"),y},{}),pathname:f,pathnameBase:m,pattern:n}}function cb(n,i=!1,r=!0){ea(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let c=[],d="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,h,g,y,b)=>{if(c.push({paramName:h,isOptional:g!=null}),g){let x=b.charAt(y+m.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(c.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),c]}function m2(n){try{return n.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return ea(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),n}}function es(n,i){if(i==="/")return n;if(!n.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,c=n.charAt(r);return c&&c!=="/"?null:n.slice(r)||"/"}function p2(n,i="/"){let{pathname:r,search:c="",hash:d=""}=typeof n=="string"?xl(n):n,f;return r?(r=db(r),r.startsWith("/")||r.startsWith("\\")?f=Yv(r.substring(1),"/"):f=Yv(r,i)):f=i,{pathname:f,search:v2(c),hash:y2(d)}}function Yv(n,i){let r=gi(i).split("/");return n.split("/").forEach(d=>{d===".."?r.length>1&&r.pop():d!=="."&&r.push(d)}),r.length>1?r.join("/"):"/"}function Jf(n,i,r,c){return`Cannot include a '${n}' character in a manually specified \`to.${i}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function x2(n){return n.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function ub(n){let i=x2(n);return i.map((r,c)=>c===i.length-1?r.pathname:r.pathnameBase)}function Uh(n,i,r,c=!1){let d;typeof n=="string"?d=xl(n):(d={...n},yt(!d.pathname||!d.pathname.includes("?"),Jf("?","pathname","search",d)),yt(!d.pathname||!d.pathname.includes("#"),Jf("#","pathname","hash",d)),yt(!d.search||!d.search.includes("#"),Jf("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,h;if(m==null)h=r;else{let x=i.length-1;if(!c&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),x-=1;d.pathname=j.join("/")}h=x>=0?i[x]:"/"}let g=p2(d,h),y=m&&m!=="/"&&m.endsWith("/"),b=(f||m===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(y||b)&&(g.pathname+="/"),g}var db=n=>n.replace(/[\\/]{2,}/g,"/"),ha=n=>db(n.join("/"));function gi(n,i=0){let r=n.length;for(;r>i&&n.charCodeAt(r-1)===47;)r--;return r===n.length?n:n.slice(0,r)}var g2=n=>gi(n).replace(/^\/*/,"/"),v2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,y2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,b2=class{constructor(n,i,r,c=!1){this.status=n,this.statusText=i||"",this.internal=c,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function j2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function N2(n){let i=n.map(r=>r.route.path).filter(Boolean);return ha(i)||"/"}var fb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hb(n,i){let r=n;if(typeof r!="string"||!Pc.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let c=r,d=!1;if(fb)try{let f=new URL(window.location.href),m=eb.test(r)?new URL(FN(r,f.protocol)):new URL(r),h=es(m.pathname,i);m.origin===f.origin&&h!=null?r=h+m.search+m.hash:d=!0}catch{ea(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var mb=["POST","PUT","PATCH","DELETE"];new Set(mb);var w2=["GET",...mb];new Set(w2);var S2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function k2(n){try{return S2.includes(new URL(n).protocol)}catch{return!1}}var yi=p.createContext(null);yi.displayName="DataRouter";var Fc=p.createContext(null);Fc.displayName="DataRouterState";var pb=p.createContext(!1);function C2(){return p.useContext(pb)}var xb=p.createContext({isTransitioning:!1});xb.displayName="ViewTransition";var T2=p.createContext(new Map);T2.displayName="Fetchers";var E2=p.createContext(null);E2.displayName="Await";var ta=p.createContext(null);ta.displayName="Navigation";var _r=p.createContext(null);_r.displayName="Location";var _a=p.createContext({outlet:null,matches:[],isDataRoute:!1});_a.displayName="Route";var Hh=p.createContext(null);Hh.displayName="RouteError";var gb="REACT_ROUTER_ERROR",R2="REDIRECT",z2="ROUTE_ERROR_RESPONSE";function D2(n){if(n.startsWith(`${gb}:${R2}:{`))try{let i=JSON.parse(n.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function A2(n){if(n.startsWith(`${gb}:${z2}:{`))try{let i=JSON.parse(n.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new b2(i.status,i.statusText,i.data)}catch{}}function O2(n,{relative:i}={}){yt(Lr(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:c}=p.useContext(ta),{hash:d,pathname:f,search:m}=Ur(n,{relative:i}),h=f;return r!=="/"&&(h=f==="/"?r:ha([r,f])),c.createHref({pathname:h,search:m,hash:d})}function Lr(){return p.useContext(_r)!=null}function qn(){return yt(Lr(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(_r).location}var vb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yb(n){p.useContext(ta).static||p.useLayoutEffect(n)}function Jc(){let{isDataRoute:n}=p.useContext(_a);return n?Q2():M2()}function M2(){yt(Lr(),"useNavigate() may be used only in the context of a <Router> component.");let n=p.useContext(yi),{basename:i,navigator:r}=p.useContext(ta),{matches:c}=p.useContext(_a),{pathname:d}=qn(),f=JSON.stringify(ub(c)),m=p.useRef(!1);return yb(()=>{m.current=!0}),p.useCallback((g,y={})=>{if(ea(m.current,vb),!m.current)return;if(typeof g=="number"){r.go(g);return}let b=Uh(g,JSON.parse(f),d,y.relative==="path");n==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:ha([i,b.pathname])),sb(typeof g=="string"?g:xi(g),r.createHref(b),tb(r),"reject"),(y.replace?r.replace:r.push)(b,y.state,y)},[i,r,f,d,n])}var _2=p.createContext(null);function L2(n){let i=p.useContext(_a).outlet;return p.useMemo(()=>i&&p.createElement(_2.Provider,{value:n},i),[i,n])}function Ur(n,{relative:i}={}){let{matches:r}=p.useContext(_a),{pathname:c}=qn(),d=JSON.stringify(ub(r));return p.useMemo(()=>Uh(n,JSON.parse(d),c,i==="path"),[n,d,c,i])}function U2(n,i){return bb(n,i)}function bb(n,i,r){yt(Lr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=p.useContext(ta),{matches:d}=p.useContext(_a),f=d[d.length-1],m=f?f.params:{},h=f?f.pathname:"/",g=f?f.pathnameBase:"/",y=f&&f.route;{let C=y&&y.path||"";Nb(h,!y||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${C}">) 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
59
 
60
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let b=qn(),x;if(i){let C=typeof i=="string"?xl(i):i;vt(g==="/"||C.pathname?.startsWith(g),`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 "${g}" but pathname "${C.pathname}" was given in the \`location\` prop.`),x=C}else x=b;let j=x.pathname||"/",S=j;if(g!=="/"){let C=g.replace(/^\//,"").split("/");S="/"+j.replace(/^\//,"").split("/").slice(C.length).join("/")}let R=r&&r.state.matches.length?r.state.matches.map(C=>Object.assign(C,{route:r.manifest[C.route.id]||C.route})):ab(n,{pathname:S});ea(v||R!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),ea(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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 k=_2(R&&R.map(C=>Object.assign({},C,{params:Object.assign({},m,C.params),pathname:ha([g,c.encodeLocation?c.encodeLocation(C.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?g:ha([g,c.encodeLocation?c.encodeLocation(C.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),d,r);return i&&k?p.createElement(Mr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...x},navigationType:"POP"}},k):k}function D2(){let n=$2(),i=m2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),r=n instanceof Error?n.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},f={padding:"2px 4px",backgroundColor:c},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=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:f},"ErrorBoundary")," or"," ",p.createElement("code",{style:f},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},i),r?p.createElement("pre",{style:d},r):null,m)}var A2=p.createElement(D2,null),vb=class extends p.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,i){return i.location!==n.location||i.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:i.error,location:i.location,revalidation:n.revalidation||i.revalidation}}componentDidCatch(n,i){this.props.onError?this.props.onError(n,i):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const r=k2(n.digest);r&&(n=r)}let i=n!==void 0?p.createElement(_a.Provider,{value:this.props.routeContext},p.createElement(Lh.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?p.createElement(O2,{error:n},i):i}};vb.contextType=hb;var Ff=new WeakMap;function O2({children:n,error:i}){let{basename:r,navigator:c}=p.useContext(ta);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let d=S2(i.digest);if(d){let f=Ff.get(i);if(f)throw f;let m=db(d.location,r),h=m.absoluteURL||m.to;if(nb(d.location,h,Wv(c),"allow-explicit"),y2(h))throw new Error("Invalid redirect location");if(ub&&!Ff.get(i))if(m.isExternal||d.reloadDocument)window.location.href=h;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:d.replace}));throw Ff.set(i,g),g}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return n}function M2({routeContext:n,match:i,children:r}){let c=p.useContext(yi);return c&&c.static&&c.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=i.route.id),p.createElement(_a.Provider,{value:n},r)}function _2(n,i=[],r){let c=r?.state;if(n==null){if(!c)return null;if(c.errors)n=c.matches;else if(i.length===0&&!c.initialized&&c.matches.length>0)n=c.matches;else return null}let d=n,f=c?.errors;if(f!=null){let b=d.findIndex(x=>x.route.id&&f?.[x.route.id]!==void 0);vt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,b+1))}let m=!1,h=-1;if(r&&c){m=c.renderFallback;for(let b=0;b<d.length;b++){let x=d[b];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=b),x.route.id){let{loaderData:j,errors:S}=c,R=x.route.loader&&!j.hasOwnProperty(x.route.id)&&(!S||S[x.route.id]===void 0);if(x.route.lazy||R){r.isStatic&&(m=!0),h>=0?d=d.slice(0,h+1):d=[d[0]];break}}}}let g=r?.onError,v=c&&g?(b,x)=>{g(b,{location:c.location,params:c.matches?.[0]?.params??{},pattern:p2(c.matches),errorInfo:x})}:void 0;return d.reduceRight((b,x,j)=>{let S,R=!1,k=null,C=null;c&&(S=f&&x.route.id?f[x.route.id]:void 0,k=x.route.errorElement||A2,m&&(h<0&&j===0?(bb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,C=null):h===j&&(R=!0,C=x.route.hydrateFallbackElement||null)));let z=i.concat(d.slice(0,j+1)),w=()=>{let O;return S?O=k:R?O=C:x.route.Component?O=p.createElement(x.route.Component,null):x.route.element?O=x.route.element:O=b,p.createElement(M2,{match:x,routeContext:{outlet:b,matches:z,isDataRoute:c!=null},children:O})};return c&&(x.route.ErrorBoundary||x.route.errorElement||j===0)?p.createElement(vb,{location:c.location,revalidation:c.revalidation,component:k,error:S,children:w(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:v}):w()},null)}function Uh(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L2(n){let i=p.useContext(yi);return vt(i,Uh(n)),i}function U2(n){let i=p.useContext(Qc);return vt(i,Uh(n)),i}function H2(n){let i=p.useContext(_a);return vt(i,Uh(n)),i}function Hh(n){let i=H2(n),r=i.matches[i.matches.length-1];return vt(r.route.id,`${n} can only be used on routes that contain a unique "id"`),r.route.id}function B2(){return Hh("useRouteId")}function $2(){let n=p.useContext(Lh),i=U2("useRouteError"),r=Hh("useRouteError");return n!==void 0?n:i.errors?.[r]}function q2(){let{router:n}=L2("useNavigate"),i=Hh("useNavigate"),r=p.useRef(!1);return gb(()=>{r.current=!0}),p.useCallback(async(d,f={})=>{ea(r.current,xb),r.current&&(typeof d=="number"?await n.navigate(d):await n.navigate(d,{fromRouteId:i,...f}))},[n,i])}var Gy={};function bb(n,i,r){!i&&!Gy[n]&&(Gy[n]=!0,ea(!1,r))}p.memo(G2);function G2({routes:n,manifest:i,future:r,state:c,isStatic:d,onError:f}){return yb(n,void 0,{manifest:i,state:c,isStatic:d,onError:f})}function Y2(n){return R2(n.context)}function Jn(n){vt(!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 V2({basename:n="/",children:i=null,location:r,navigationType:c="POP",navigator:d,static:f=!1,useTransitions:m}){vt(!_r(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=n.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:h,navigator:d,static:f,useTransitions:m,future:{}}),[h,d,f,m]);typeof r=="string"&&(r=xl(r));let{pathname:v="/",search:b="",hash:x="",state:j=null,key:S="default",mask:R}=r,k=p.useMemo(()=>{let C=es(v,h);return C==null?null:{location:{pathname:C,search:b,hash:x,state:j,key:S,mask:R},navigationType:c}},[h,v,b,x,j,S,c,R]);return ea(k!=null,`<Router basename="${h}"> is not able to match the URL "${v}${b}${x}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:p.createElement(ta.Provider,{value:g},p.createElement(Mr.Provider,{children:i,value:k}))}function X2({children:n,location:i}){return z2(ph(n),i)}function ph(n,i=[]){let r=[];return p.Children.forEach(n,(c,d)=>{if(!p.isValidElement(c))return;let f=[...i,d];if(c.type===p.Fragment){r.push.apply(r,ph(c.props.children,f));return}vt(c.type===Jn,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),vt(!c.props.index||!c.props.children,"An index route cannot have child routes.");let m={id:c.props.id||f.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(m.children=ph(c.props.children,f)),r.push(m)}),r}var kc="get",Cc="application/x-www-form-urlencoded";function Pc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function K2(n){return Pc(n)&&n.tagName.toLowerCase()==="button"}function Z2(n){return Pc(n)&&n.tagName.toLowerCase()==="form"}function Q2(n){return Pc(n)&&n.tagName.toLowerCase()==="input"}function I2(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function P2(n,i){return n.button===0&&(!i||i==="_self")&&!I2(n)}function xh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((i,r)=>{let c=n[r];return i.concat(Array.isArray(c)?c.map(d=>[r,d]):[[r,c]])},[]))}function F2(n,i){let r=xh(n);return i&&i.forEach((c,d)=>{r.has(d)||i.getAll(d).forEach(f=>{r.append(d,f)})}),r}var gc=null;function J2(){if(gc===null)try{new FormData(document.createElement("form"),0),gc=!1}catch{gc=!0}return gc}var W2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jf(n){return n!=null&&!W2.has(n)?(ea(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cc}"`),null):n}function ew(n,i){let r,c,d,f,m;if(Z2(n)){let h=n.getAttribute("action");c=h?es(h,i):null,r=n.getAttribute("method")||kc,d=Jf(n.getAttribute("enctype"))||Cc,f=new FormData(n)}else if(K2(n)||Q2(n)&&(n.type==="submit"||n.type==="image")){let h=n.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||h.getAttribute("action");if(c=g?es(g,i):null,r=n.getAttribute("formmethod")||h.getAttribute("method")||kc,d=Jf(n.getAttribute("formenctype"))||Jf(h.getAttribute("enctype"))||Cc,f=new FormData(h,n),!J2()){let{name:v,type:b,value:x}=n;if(b==="image"){let j=v?`${v}.`:"";f.append(`${j}x`,"0"),f.append(`${j}y`,"0")}else v&&f.append(v,x)}}else{if(Pc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=kc,c=null,d=Cc,m=n}return f&&d==="text/plain"&&(m=f,f=void 0),{action:c,method:r.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Bh(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function jb(n,i,r,c){let d=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return r?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${c}`:d.pathname=`${d.pathname}.${c}`:d.pathname==="/"?d.pathname=`_root.${c}`:i&&es(d.pathname,i)==="/"?d.pathname=`${xi(i)}/_root.${c}`:d.pathname=`${xi(d.pathname)}.${c}`,d}async function tw(n,i){if(n.id in i)return i[n.id];try{let r=await import(n.module);return i[n.id]=r,r}catch(r){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function nw(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function aw(n,i,r){let c=await Promise.all(n.map(async d=>{let f=i.routes[d.route.id];if(f){let m=await tw(f,r);return m.links?m.links():[]}return[]}));return rw(c.flat(1).filter(nw).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Yy(n,i,r,c,d,f){let m=(g,v)=>r[v]?g.route.id!==r[v].route.id:!0,h=(g,v)=>r[v].pathname!==g.pathname||r[v].route.path?.endsWith("*")&&r[v].params["*"]!==g.params["*"];return f==="assets"?i.filter((g,v)=>m(g,v)||h(g,v)):f==="data"?i.filter((g,v)=>{let b=c.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,v)||h(g,v))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function sw(n,i,{includeHydrateFallback:r}={}){return lw(n.map(c=>{let d=i.routes[c.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),r&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function lw(n){return[...new Set(n)]}function iw(n){let i={},r=Object.keys(n).sort();for(let c of r)i[c]=n[c];return i}function rw(n,i){let r=new Set;return new Set(i),n.reduce((c,d)=>{let f=JSON.stringify(iw(d));return r.has(f)||(r.add(f),c.push({key:f,link:d})),c},[])}function $h(){let n=p.useContext(yi);return Bh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function ow(){let n=p.useContext(Qc);return Bh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var qh=p.createContext(void 0);qh.displayName="FrameworkContext";function Fc(){let n=p.useContext(qh);return Bh(n,"You must render this element inside a <HydratedRouter> element"),n}function cw(n,i){let r=p.useContext(qh),[c,d]=p.useState(!1),[f,m]=p.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:v,onMouseLeave:b,onTouchStart:x}=i,j=p.useRef(null);p.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let k=z=>{z.forEach(w=>{m(w.isIntersecting)})},C=new IntersectionObserver(k,{threshold:.5});return j.current&&C.observe(j.current),()=>{C.disconnect()}}},[n]),p.useEffect(()=>{if(c){let k=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(k)}}},[c]);let S=()=>{d(!0)},R=()=>{d(!1),m(!1)};return r?n!=="intent"?[f,j,{}]:[f,j,{onFocus:yr(h,S),onBlur:yr(g,R),onMouseEnter:yr(v,S),onMouseLeave:yr(b,R),onTouchStart:yr(x,S)}]:[!1,j,{}]}function yr(n,i){return r=>{n&&n(r),r.defaultPrevented||i(r)}}function uw({page:n,...i}){let r=v2(),{nonce:c}=Fc(),{router:d}=$h(),f=p.useMemo(()=>ab(d.routes,n,d.basename),[d.routes,n,d.basename]);return f?(i.nonce==null&&c&&(i={...i,nonce:c}),r?p.createElement(fw,{page:n,matches:f,...i}):p.createElement(hw,{page:n,matches:f,...i})):null}function dw(n){let{manifest:i,routeModules:r}=Fc(),[c,d]=p.useState([]);return p.useEffect(()=>{let f=!1;return aw(n,i,r).then(m=>{f||d(m)}),()=>{f=!0}},[n,i,r]),c}function fw({page:n,matches:i,...r}){let c=qn(),{future:d}=Fc(),{basename:f}=$h(),m=p.useMemo(()=>{if(n===c.pathname+c.search+c.hash)return[];let h=jb(n,f,d.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let b of i)typeof b.route.shouldRevalidate=="function"?g=!0:v.push(b.route.id);return g&&v.length>0&&h.searchParams.set("_routes",v.join(",")),[h.pathname+h.search]},[f,d.v8_trailingSlashAwareDataRequests,n,c,i]);return p.createElement(p.Fragment,null,m.map(h=>p.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...r})))}function hw({page:n,matches:i,...r}){let c=qn(),{future:d,manifest:f,routeModules:m}=Fc(),{basename:h}=$h(),{loaderData:g,matches:v}=ow(),b=p.useMemo(()=>Yy(n,i,v,f,c,"data"),[n,i,v,f,c]),x=p.useMemo(()=>Yy(n,i,v,f,c,"assets"),[n,i,v,f,c]),j=p.useMemo(()=>{if(n===c.pathname+c.search+c.hash)return[];let k=new Set,C=!1;if(i.forEach(w=>{let O=f.routes[w.route.id];!O||!O.hasLoader||(!b.some(E=>E.route.id===w.route.id)&&w.route.id in g&&m[w.route.id]?.shouldRevalidate||O.hasClientLoader?C=!0:k.add(w.route.id))}),k.size===0)return[];let z=jb(n,h,d.v8_trailingSlashAwareDataRequests,"data");return C&&k.size>0&&z.searchParams.set("_routes",i.filter(w=>k.has(w.route.id)).map(w=>w.route.id).join(",")),[z.pathname+z.search]},[h,d.v8_trailingSlashAwareDataRequests,g,c,f,b,i,n,m]),S=p.useMemo(()=>sw(x,f),[x,f]),R=dw(x);return p.createElement(p.Fragment,null,j.map(k=>p.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...r})),S.map(k=>p.createElement("link",{key:k,rel:"modulepreload",href:k,...r})),R.map(({key:k,link:C})=>p.createElement("link",{key:k,nonce:r.nonce,...C,crossOrigin:C.crossOrigin??r.crossOrigin})))}function mw(...n){return i=>{n.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var pw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{pw&&(window.__reactRouterVersion="7.18.6")}catch{}function xw({basename:n,children:i,useTransitions:r,window:c}){let d=p.useRef();d.current==null&&(d.current=XN({window:c,v5Compat:!0}));let f=d.current,[m,h]=p.useState({action:f.action,location:f.location}),g=p.useCallback(v=>{r===!1?h(v):p.startTransition(()=>h(v))},[r]);return p.useLayoutEffect(()=>f.listen(g),[f,g]),p.createElement(V2,{basename:n,children:i,location:m.location,navigationType:m.action,navigator:f,useTransitions:r})}var kt=p.forwardRef(function({onClick:i,discover:r="render",prefetch:c="none",relative:d,reloadDocument:f,replace:m,mask:h,state:g,target:v,to:b,preventScrollReset:x,viewTransition:j,defaultShouldRevalidate:S,...R},k){let{basename:C,navigator:z,useTransitions:w}=p.useContext(ta),O=typeof b=="string"&&Zc.test(b),E=db(b,C);b=E.to;let M=C2(b,{relative:d}),Y=qn(),A=null;if(h){let K=_h(h,[],Y.mask?Y.mask.pathname:"/",!0);C!=="/"&&(K.pathname=K.pathname==="/"?C:ha([C,K.pathname])),A=z.createHref(K)}let[H,W,I]=cw(c,R),ne=vw(b,{replace:m,mask:h,state:g,target:v,preventScrollReset:x,relative:d,viewTransition:j,defaultShouldRevalidate:S,useTransitions:w});function J(K){i&&i(K),K.defaultPrevented||ne(K)}let Z=!(E.isExternal||f),ee=(Z?A:void 0)||E.absoluteURL||M;tb(ee);let ue=p.createElement("a",{...R,...I,href:ee,onClick:Z?J:i,ref:mw(k,W),target:v,"data-discover":!O&&r==="render"?"true":void 0});return H&&!O?p.createElement(p.Fragment,null,ue,p.createElement(uw,{page:M})):ue});kt.displayName="Link";var Nb=p.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:c="",end:d=!1,style:f,to:m,viewTransition:h,children:g,...v},b){let x=Lr(m,{relative:v.relative}),j=qn(),S=p.useContext(Qc),{navigator:R,basename:k}=p.useContext(ta),C=S!=null&&Sw(x)&&h===!0,z=R.encodeLocation?R.encodeLocation(x).pathname:x.pathname,w=j.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(w=w.toLowerCase(),O=O?O.toLowerCase():null,z=z.toLowerCase()),O&&k&&(O=es(O,k)||O);const E=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let M=w===z||!d&&w.startsWith(z)&&w.charAt(E)==="/",Y=O!=null&&(O===z||!d&&O.startsWith(z)&&O.charAt(z.length)==="/"),A={isActive:M,isPending:Y,isTransitioning:C},H=M?i:void 0,W;typeof c=="function"?W=c(A):W=[c,M?"active":null,Y?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let I=typeof f=="function"?f(A):f;return p.createElement(kt,{...v,"aria-current":H,className:W,ref:b,style:I,to:m,viewTransition:h},typeof g=="function"?g(A):g)});Nb.displayName="NavLink";var gw=p.forwardRef(({discover:n="render",fetcherKey:i,navigate:r,reloadDocument:c,replace:d,state:f,method:m=kc,action:h,onSubmit:g,relative:v,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:j,...S},R)=>{let{useTransitions:k}=p.useContext(ta),C=Nw(),z=ww(h,{relative:v}),w=m.toLowerCase()==="get"?"get":"post",O=typeof h=="string"&&Zc.test(h),E=M=>{if(g&&g(M),M.defaultPrevented)return;M.preventDefault();let Y=M.nativeEvent.submitter,A=Y?.getAttribute("formmethod")||m,H=()=>C(Y||M.currentTarget,{fetcherKey:i,method:A,navigate:r,replace:d,state:f,relative:v,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:j});k&&r!==!1?p.startTransition(()=>H()):H()};return p.createElement("form",{ref:R,method:w,action:z,onSubmit:c?g:E,...S,"data-discover":!O&&n==="render"?"true":void 0})});gw.displayName="Form";function yw(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wb(n){let i=p.useContext(yi);return vt(i,yw(n)),i}function vw(n,{target:i,replace:r,mask:c,state:d,preventScrollReset:f,relative:m,viewTransition:h,defaultShouldRevalidate:g,useTransitions:v}={}){let b=Ic(),x=qn(),j=Lr(n,{relative:m});return p.useCallback(S=>{if(P2(S,i)){S.preventDefault();let R=r!==void 0?r:pi(x)===pi(j),k=()=>b(n,{replace:R,mask:c,state:d,preventScrollReset:f,relative:m,viewTransition:h,defaultShouldRevalidate:g});v?p.startTransition(()=>k()):k()}},[x,b,j,r,c,d,i,n,f,m,h,g,v])}function Jc(n){ea(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 i=p.useRef(xh(n)),r=p.useRef(!1),c=qn(),d=p.useMemo(()=>F2(c.search,r.current?null:i.current),[c.search]),f=Ic(),m=p.useCallback((h,g)=>{const v=xh(typeof h=="function"?h(new URLSearchParams(d)):h);r.current=!0,f("?"+v,g)},[f,d]);return[d,m]}var bw=0,jw=()=>`__${String(++bw)}__`;function Nw(){let{router:n}=wb("useSubmit"),{basename:i}=p.useContext(ta),r=B2(),c=n.fetch,d=n.navigate;return p.useCallback(async(f,m={})=>{let{action:h,method:g,encType:v,formData:b,body:x}=ew(f,i);if(m.navigate===!1){let j=m.fetcherKey||jw();await c(j,r,m.action||h,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||v,flushSync:m.flushSync})}else await d(m.action||h,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||v,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[c,d,i,r])}function ww(n,{relative:i}={}){let{basename:r}=p.useContext(ta),c=p.useContext(_a);vt(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),f={...Lr(n||".",{relative:i})},m=qn();if(n==null){f.search=m.search;let g=new URLSearchParams(f.search),v=g.getAll("index");if(v.some(x=>x==="")){g.delete("index"),v.filter(j=>j).forEach(j=>g.append("index",j));let x=g.toString();f.search=x?`?${x}`:""}}(!n||n===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:ha([r,f.pathname]));let h=pi(f);return tb(h),h}function Sw(n,{relative:i}={}){let r=p.useContext(mb);vt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=wb("useViewTransitionState"),d=Lr(n,{relative:i});if(!r.isTransitioning)return!1;let f=es(r.currentLocation.pathname,c)||r.currentLocation.pathname,m=es(r.nextLocation.pathname,c)||r.nextLocation.pathname;return Oc(d.pathname,m)!=null||Oc(d.pathname,f)!=null}var ol=Fv();const Sb="ez-theme",kb=p.createContext(null);function kw(){try{const n=localStorage.getItem(Sb);if(n==="light"||n==="dark")return n}catch{}return"dark"}function Cw({children:n}){const[i,r]=p.useState(kw);p.useEffect(()=>{document.documentElement.dataset.theme=i;try{localStorage.setItem(Sb,i)}catch{}},[i]);const c=p.useCallback(()=>{r(f=>f==="dark"?"light":"dark")},[]),d=p.useMemo(()=>({theme:i,setTheme:r,toggleTheme:c}),[i,c]);return a.jsx(kb.Provider,{value:d,children:n})}function Cb(){const n=p.useContext(kb);if(!n)throw new Error("useTheme must be used inside ThemeProvider");return n}/**
60
+ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let b=qn(),x;if(i){let C=typeof i=="string"?xl(i):i;yt(g==="/"||C.pathname?.startsWith(g),`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 "${g}" but pathname "${C.pathname}" was given in the \`location\` prop.`),x=C}else x=b;let j=x.pathname||"/",S=j;if(g!=="/"){let C=g.replace(/^\//,"").split("/");S="/"+j.replace(/^\//,"").split("/").slice(C.length).join("/")}let R=r&&r.state.matches.length?r.state.matches.map(C=>Object.assign(C,{route:r.manifest[C.route.id]||C.route})):lb(n,{pathname:S});ea(y||R!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),ea(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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 k=G2(R&&R.map(C=>Object.assign({},C,{params:Object.assign({},m,C.params),pathname:ha([g,c.encodeLocation?c.encodeLocation(C.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?g:ha([g,c.encodeLocation?c.encodeLocation(C.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),d,r);return i&&k?p.createElement(_r.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...x},navigationType:"POP"}},k):k}function H2(){let n=Z2(),i=j2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),r=n instanceof Error?n.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},f={padding:"2px 4px",backgroundColor:c},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=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:f},"ErrorBoundary")," or"," ",p.createElement("code",{style:f},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},i),r?p.createElement("pre",{style:d},r):null,m)}var B2=p.createElement(H2,null),jb=class extends p.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,i){return i.location!==n.location||i.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:i.error,location:i.location,revalidation:n.revalidation||i.revalidation}}componentDidCatch(n,i){this.props.onError?this.props.onError(n,i):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const r=A2(n.digest);r&&(n=r)}let i=n!==void 0?p.createElement(_a.Provider,{value:this.props.routeContext},p.createElement(Hh.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?p.createElement($2,{error:n},i):i}};jb.contextType=pb;var Wf=new WeakMap;function $2({children:n,error:i}){let{basename:r,navigator:c}=p.useContext(ta);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let d=D2(i.digest);if(d){let f=Wf.get(i);if(f)throw f;let m=hb(d.location,r),h=m.absoluteURL||m.to;if(sb(d.location,h,tb(c),"allow-explicit"),k2(h))throw new Error("Invalid redirect location");if(fb&&!Wf.get(i))if(m.isExternal||d.reloadDocument)window.location.href=h;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:d.replace}));throw Wf.set(i,g),g}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return n}function q2({routeContext:n,match:i,children:r}){let c=p.useContext(yi);return c&&c.static&&c.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=i.route.id),p.createElement(_a.Provider,{value:n},r)}function G2(n,i=[],r){let c=r?.state;if(n==null){if(!c)return null;if(c.errors)n=c.matches;else if(i.length===0&&!c.initialized&&c.matches.length>0)n=c.matches;else return null}let d=n,f=c?.errors;if(f!=null){let b=d.findIndex(x=>x.route.id&&f?.[x.route.id]!==void 0);yt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,b+1))}let m=!1,h=-1;if(r&&c){m=c.renderFallback;for(let b=0;b<d.length;b++){let x=d[b];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=b),x.route.id){let{loaderData:j,errors:S}=c,R=x.route.loader&&!j.hasOwnProperty(x.route.id)&&(!S||S[x.route.id]===void 0);if(x.route.lazy||R){r.isStatic&&(m=!0),h>=0?d=d.slice(0,h+1):d=[d[0]];break}}}}let g=r?.onError,y=c&&g?(b,x)=>{g(b,{location:c.location,params:c.matches?.[0]?.params??{},pattern:N2(c.matches),errorInfo:x})}:void 0;return d.reduceRight((b,x,j)=>{let S,R=!1,k=null,C=null;c&&(S=f&&x.route.id?f[x.route.id]:void 0,k=x.route.errorElement||B2,m&&(h<0&&j===0?(Nb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,C=null):h===j&&(R=!0,C=x.route.hydrateFallbackElement||null)));let D=i.concat(d.slice(0,j+1)),E=()=>{let O;return S?O=k:R?O=C:x.route.Component?O=p.createElement(x.route.Component,null):x.route.element?O=x.route.element:O=b,p.createElement(q2,{match:x,routeContext:{outlet:b,matches:D,isDataRoute:c!=null},children:O})};return c&&(x.route.ErrorBoundary||x.route.errorElement||j===0)?p.createElement(jb,{location:c.location,revalidation:c.revalidation,component:k,error:S,children:E(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:y}):E()},null)}function Bh(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y2(n){let i=p.useContext(yi);return yt(i,Bh(n)),i}function V2(n){let i=p.useContext(Fc);return yt(i,Bh(n)),i}function X2(n){let i=p.useContext(_a);return yt(i,Bh(n)),i}function $h(n){let i=X2(n),r=i.matches[i.matches.length-1];return yt(r.route.id,`${n} can only be used on routes that contain a unique "id"`),r.route.id}function K2(){return $h("useRouteId")}function Z2(){let n=p.useContext(Hh),i=V2("useRouteError"),r=$h("useRouteError");return n!==void 0?n:i.errors?.[r]}function Q2(){let{router:n}=Y2("useNavigate"),i=$h("useNavigate"),r=p.useRef(!1);return yb(()=>{r.current=!0}),p.useCallback(async(d,f={})=>{ea(r.current,vb),r.current&&(typeof d=="number"?await n.navigate(d):await n.navigate(d,{fromRouteId:i,...f}))},[n,i])}var Vv={};function Nb(n,i,r){!i&&!Vv[n]&&(Vv[n]=!0,ea(!1,r))}p.memo(I2);function I2({routes:n,manifest:i,future:r,state:c,isStatic:d,onError:f}){return bb(n,void 0,{manifest:i,state:c,isStatic:d,onError:f})}function P2(n){return L2(n.context)}function Jn(n){yt(!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 F2({basename:n="/",children:i=null,location:r,navigationType:c="POP",navigator:d,static:f=!1,useTransitions:m}){yt(!Lr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=n.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:h,navigator:d,static:f,useTransitions:m,future:{}}),[h,d,f,m]);typeof r=="string"&&(r=xl(r));let{pathname:y="/",search:b="",hash:x="",state:j=null,key:S="default",mask:R}=r,k=p.useMemo(()=>{let C=es(y,h);return C==null?null:{location:{pathname:C,search:b,hash:x,state:j,key:S,mask:R},navigationType:c}},[h,y,b,x,j,S,c,R]);return ea(k!=null,`<Router basename="${h}"> is not able to match the URL "${y}${b}${x}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:p.createElement(ta.Provider,{value:g},p.createElement(_r.Provider,{children:i,value:k}))}function J2({children:n,location:i}){return U2(xh(n),i)}function xh(n,i=[]){let r=[];return p.Children.forEach(n,(c,d)=>{if(!p.isValidElement(c))return;let f=[...i,d];if(c.type===p.Fragment){r.push.apply(r,xh(c.props.children,f));return}yt(c.type===Jn,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yt(!c.props.index||!c.props.children,"An index route cannot have child routes.");let m={id:c.props.id||f.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(m.children=xh(c.props.children,f)),r.push(m)}),r}var Tc="get",Ec="application/x-www-form-urlencoded";function Wc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function W2(n){return Wc(n)&&n.tagName.toLowerCase()==="button"}function ew(n){return Wc(n)&&n.tagName.toLowerCase()==="form"}function tw(n){return Wc(n)&&n.tagName.toLowerCase()==="input"}function nw(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function aw(n,i){return n.button===0&&(!i||i==="_self")&&!nw(n)}function gh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((i,r)=>{let c=n[r];return i.concat(Array.isArray(c)?c.map(d=>[r,d]):[[r,c]])},[]))}function sw(n,i){let r=gh(n);return i&&i.forEach((c,d)=>{r.has(d)||i.getAll(d).forEach(f=>{r.append(d,f)})}),r}var vc=null;function lw(){if(vc===null)try{new FormData(document.createElement("form"),0),vc=!1}catch{vc=!0}return vc}var iw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function eh(n){return n!=null&&!iw.has(n)?(ea(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ec}"`),null):n}function rw(n,i){let r,c,d,f,m;if(ew(n)){let h=n.getAttribute("action");c=h?es(h,i):null,r=n.getAttribute("method")||Tc,d=eh(n.getAttribute("enctype"))||Ec,f=new FormData(n)}else if(W2(n)||tw(n)&&(n.type==="submit"||n.type==="image")){let h=n.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||h.getAttribute("action");if(c=g?es(g,i):null,r=n.getAttribute("formmethod")||h.getAttribute("method")||Tc,d=eh(n.getAttribute("formenctype"))||eh(h.getAttribute("enctype"))||Ec,f=new FormData(h,n),!lw()){let{name:y,type:b,value:x}=n;if(b==="image"){let j=y?`${y}.`:"";f.append(`${j}x`,"0"),f.append(`${j}y`,"0")}else y&&f.append(y,x)}}else{if(Wc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Tc,c=null,d=Ec,m=n}return f&&d==="text/plain"&&(m=f,f=void 0),{action:c,method:r.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function qh(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function wb(n,i,r,c){let d=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return r?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${c}`:d.pathname=`${d.pathname}.${c}`:d.pathname==="/"?d.pathname=`_root.${c}`:i&&es(d.pathname,i)==="/"?d.pathname=`${gi(i)}/_root.${c}`:d.pathname=`${gi(d.pathname)}.${c}`,d}async function ow(n,i){if(n.id in i)return i[n.id];try{let r=await import(n.module);return i[n.id]=r,r}catch(r){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function cw(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function uw(n,i,r){let c=await Promise.all(n.map(async d=>{let f=i.routes[d.route.id];if(f){let m=await ow(f,r);return m.links?m.links():[]}return[]}));return mw(c.flat(1).filter(cw).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Xv(n,i,r,c,d,f){let m=(g,y)=>r[y]?g.route.id!==r[y].route.id:!0,h=(g,y)=>r[y].pathname!==g.pathname||r[y].route.path?.endsWith("*")&&r[y].params["*"]!==g.params["*"];return f==="assets"?i.filter((g,y)=>m(g,y)||h(g,y)):f==="data"?i.filter((g,y)=>{let b=c.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,y)||h(g,y))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function dw(n,i,{includeHydrateFallback:r}={}){return fw(n.map(c=>{let d=i.routes[c.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),r&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function fw(n){return[...new Set(n)]}function hw(n){let i={},r=Object.keys(n).sort();for(let c of r)i[c]=n[c];return i}function mw(n,i){let r=new Set;return new Set(i),n.reduce((c,d)=>{let f=JSON.stringify(hw(d));return r.has(f)||(r.add(f),c.push({key:f,link:d})),c},[])}function Gh(){let n=p.useContext(yi);return qh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function pw(){let n=p.useContext(Fc);return qh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Yh=p.createContext(void 0);Yh.displayName="FrameworkContext";function eu(){let n=p.useContext(Yh);return qh(n,"You must render this element inside a <HydratedRouter> element"),n}function xw(n,i){let r=p.useContext(Yh),[c,d]=p.useState(!1),[f,m]=p.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:y,onMouseLeave:b,onTouchStart:x}=i,j=p.useRef(null);p.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let k=D=>{D.forEach(E=>{m(E.isIntersecting)})},C=new IntersectionObserver(k,{threshold:.5});return j.current&&C.observe(j.current),()=>{C.disconnect()}}},[n]),p.useEffect(()=>{if(c){let k=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(k)}}},[c]);let S=()=>{d(!0)},R=()=>{d(!1),m(!1)};return r?n!=="intent"?[f,j,{}]:[f,j,{onFocus:yr(h,S),onBlur:yr(g,R),onMouseEnter:yr(y,S),onMouseLeave:yr(b,R),onTouchStart:yr(x,S)}]:[!1,j,{}]}function yr(n,i){return r=>{n&&n(r),r.defaultPrevented||i(r)}}function gw({page:n,...i}){let r=C2(),{nonce:c}=eu(),{router:d}=Gh(),f=p.useMemo(()=>lb(d.routes,n,d.basename),[d.routes,n,d.basename]);return f?(i.nonce==null&&c&&(i={...i,nonce:c}),r?p.createElement(yw,{page:n,matches:f,...i}):p.createElement(bw,{page:n,matches:f,...i})):null}function vw(n){let{manifest:i,routeModules:r}=eu(),[c,d]=p.useState([]);return p.useEffect(()=>{let f=!1;return uw(n,i,r).then(m=>{f||d(m)}),()=>{f=!0}},[n,i,r]),c}function yw({page:n,matches:i,...r}){let c=qn(),{future:d}=eu(),{basename:f}=Gh(),m=p.useMemo(()=>{if(n===c.pathname+c.search+c.hash)return[];let h=wb(n,f,d.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,y=[];for(let b of i)typeof b.route.shouldRevalidate=="function"?g=!0:y.push(b.route.id);return g&&y.length>0&&h.searchParams.set("_routes",y.join(",")),[h.pathname+h.search]},[f,d.v8_trailingSlashAwareDataRequests,n,c,i]);return p.createElement(p.Fragment,null,m.map(h=>p.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...r})))}function bw({page:n,matches:i,...r}){let c=qn(),{future:d,manifest:f,routeModules:m}=eu(),{basename:h}=Gh(),{loaderData:g,matches:y}=pw(),b=p.useMemo(()=>Xv(n,i,y,f,c,"data"),[n,i,y,f,c]),x=p.useMemo(()=>Xv(n,i,y,f,c,"assets"),[n,i,y,f,c]),j=p.useMemo(()=>{if(n===c.pathname+c.search+c.hash)return[];let k=new Set,C=!1;if(i.forEach(E=>{let O=f.routes[E.route.id];!O||!O.hasLoader||(!b.some(w=>w.route.id===E.route.id)&&E.route.id in g&&m[E.route.id]?.shouldRevalidate||O.hasClientLoader?C=!0:k.add(E.route.id))}),k.size===0)return[];let D=wb(n,h,d.v8_trailingSlashAwareDataRequests,"data");return C&&k.size>0&&D.searchParams.set("_routes",i.filter(E=>k.has(E.route.id)).map(E=>E.route.id).join(",")),[D.pathname+D.search]},[h,d.v8_trailingSlashAwareDataRequests,g,c,f,b,i,n,m]),S=p.useMemo(()=>dw(x,f),[x,f]),R=vw(x);return p.createElement(p.Fragment,null,j.map(k=>p.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...r})),S.map(k=>p.createElement("link",{key:k,rel:"modulepreload",href:k,...r})),R.map(({key:k,link:C})=>p.createElement("link",{key:k,nonce:r.nonce,...C,crossOrigin:C.crossOrigin??r.crossOrigin})))}function jw(...n){return i=>{n.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var Nw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Nw&&(window.__reactRouterVersion="7.18.6")}catch{}function ww({basename:n,children:i,useTransitions:r,window:c}){let d=p.useRef();d.current==null&&(d.current=JN({window:c,v5Compat:!0}));let f=d.current,[m,h]=p.useState({action:f.action,location:f.location}),g=p.useCallback(y=>{r===!1?h(y):p.startTransition(()=>h(y))},[r]);return p.useLayoutEffect(()=>f.listen(g),[f,g]),p.createElement(F2,{basename:n,children:i,location:m.location,navigationType:m.action,navigator:f,useTransitions:r})}var kt=p.forwardRef(function({onClick:i,discover:r="render",prefetch:c="none",relative:d,reloadDocument:f,replace:m,mask:h,state:g,target:y,to:b,preventScrollReset:x,viewTransition:j,defaultShouldRevalidate:S,...R},k){let{basename:C,navigator:D,useTransitions:E}=p.useContext(ta),O=typeof b=="string"&&Pc.test(b),w=hb(b,C);b=w.to;let U=O2(b,{relative:d}),Y=qn(),A=null;if(h){let K=Uh(h,[],Y.mask?Y.mask.pathname:"/",!0);C!=="/"&&(K.pathname=K.pathname==="/"?C:ha([C,K.pathname])),A=D.createHref(K)}let[M,W,I]=xw(c,R),ne=Cw(b,{replace:m,mask:h,state:g,target:y,preventScrollReset:x,relative:d,viewTransition:j,defaultShouldRevalidate:S,useTransitions:E});function F(K){i&&i(K),K.defaultPrevented||ne(K)}let Z=!(w.isExternal||f),te=(Z?A:void 0)||w.absoluteURL||U;ab(te);let ce=p.createElement("a",{...R,...I,href:te,onClick:Z?F:i,ref:jw(k,W),target:y,"data-discover":!O&&r==="render"?"true":void 0});return M&&!O?p.createElement(p.Fragment,null,ce,p.createElement(gw,{page:U})):ce});kt.displayName="Link";var Sb=p.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:c="",end:d=!1,style:f,to:m,viewTransition:h,children:g,...y},b){let x=Ur(m,{relative:y.relative}),j=qn(),S=p.useContext(Fc),{navigator:R,basename:k}=p.useContext(ta),C=S!=null&&Dw(x)&&h===!0,D=R.encodeLocation?R.encodeLocation(x).pathname:x.pathname,E=j.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(E=E.toLowerCase(),O=O?O.toLowerCase():null,D=D.toLowerCase()),O&&k&&(O=es(O,k)||O);const w=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let U=E===D||!d&&E.startsWith(D)&&E.charAt(w)==="/",Y=O!=null&&(O===D||!d&&O.startsWith(D)&&O.charAt(D.length)==="/"),A={isActive:U,isPending:Y,isTransitioning:C},M=U?i:void 0,W;typeof c=="function"?W=c(A):W=[c,U?"active":null,Y?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let I=typeof f=="function"?f(A):f;return p.createElement(kt,{...y,"aria-current":M,className:W,ref:b,style:I,to:m,viewTransition:h},typeof g=="function"?g(A):g)});Sb.displayName="NavLink";var Sw=p.forwardRef(({discover:n="render",fetcherKey:i,navigate:r,reloadDocument:c,replace:d,state:f,method:m=Tc,action:h,onSubmit:g,relative:y,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:j,...S},R)=>{let{useTransitions:k}=p.useContext(ta),C=Rw(),D=zw(h,{relative:y}),E=m.toLowerCase()==="get"?"get":"post",O=typeof h=="string"&&Pc.test(h),w=U=>{if(g&&g(U),U.defaultPrevented)return;U.preventDefault();let Y=U.nativeEvent.submitter,A=Y?.getAttribute("formmethod")||m,M=()=>C(Y||U.currentTarget,{fetcherKey:i,method:A,navigate:r,replace:d,state:f,relative:y,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:j});k&&r!==!1?p.startTransition(()=>M()):M()};return p.createElement("form",{ref:R,method:E,action:D,onSubmit:c?g:w,...S,"data-discover":!O&&n==="render"?"true":void 0})});Sw.displayName="Form";function kw(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kb(n){let i=p.useContext(yi);return yt(i,kw(n)),i}function Cw(n,{target:i,replace:r,mask:c,state:d,preventScrollReset:f,relative:m,viewTransition:h,defaultShouldRevalidate:g,useTransitions:y}={}){let b=Jc(),x=qn(),j=Ur(n,{relative:m});return p.useCallback(S=>{if(aw(S,i)){S.preventDefault();let R=r!==void 0?r:xi(x)===xi(j),k=()=>b(n,{replace:R,mask:c,state:d,preventScrollReset:f,relative:m,viewTransition:h,defaultShouldRevalidate:g});y?p.startTransition(()=>k()):k()}},[x,b,j,r,c,d,i,n,f,m,h,g,y])}function tu(n){ea(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 i=p.useRef(gh(n)),r=p.useRef(!1),c=qn(),d=p.useMemo(()=>sw(c.search,r.current?null:i.current),[c.search]),f=Jc(),m=p.useCallback((h,g)=>{const y=gh(typeof h=="function"?h(new URLSearchParams(d)):h);r.current=!0,f("?"+y,g)},[f,d]);return[d,m]}var Tw=0,Ew=()=>`__${String(++Tw)}__`;function Rw(){let{router:n}=kb("useSubmit"),{basename:i}=p.useContext(ta),r=K2(),c=n.fetch,d=n.navigate;return p.useCallback(async(f,m={})=>{let{action:h,method:g,encType:y,formData:b,body:x}=rw(f,i);if(m.navigate===!1){let j=m.fetcherKey||Ew();await c(j,r,m.action||h,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||y,flushSync:m.flushSync})}else await d(m.action||h,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||y,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[c,d,i,r])}function zw(n,{relative:i}={}){let{basename:r}=p.useContext(ta),c=p.useContext(_a);yt(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),f={...Ur(n||".",{relative:i})},m=qn();if(n==null){f.search=m.search;let g=new URLSearchParams(f.search),y=g.getAll("index");if(y.some(x=>x==="")){g.delete("index"),y.filter(j=>j).forEach(j=>g.append("index",j));let x=g.toString();f.search=x?`?${x}`:""}}(!n||n===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:ha([r,f.pathname]));let h=xi(f);return ab(h),h}function Dw(n,{relative:i}={}){let r=p.useContext(xb);yt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=kb("useViewTransitionState"),d=Ur(n,{relative:i});if(!r.isTransitioning)return!1;let f=es(r.currentLocation.pathname,c)||r.currentLocation.pathname,m=es(r.nextLocation.pathname,c)||r.nextLocation.pathname;return _c(d.pathname,m)!=null||_c(d.pathname,f)!=null}var ol=Wy();const Cb="ez-theme",Tb=p.createContext(null);function Aw(){try{const n=localStorage.getItem(Cb);if(n==="light"||n==="dark")return n}catch{}return"dark"}function Ow({children:n}){const[i,r]=p.useState(Aw);p.useEffect(()=>{document.documentElement.dataset.theme=i;try{localStorage.setItem(Cb,i)}catch{}},[i]);const c=p.useCallback(()=>{r(f=>f==="dark"?"light":"dark")},[]),d=p.useMemo(()=>({theme:i,setTheme:r,toggleTheme:c}),[i,c]);return a.jsx(Tb.Provider,{value:d,children:n})}function Eb(){const n=p.useContext(Tb);if(!n)throw new Error("useTheme must be used inside ThemeProvider");return n}/**
61
61
  * @license lucide-react v0.511.0 - ISC
62
62
  *
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
- */const Tw=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ew=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,c)=>c?c.toUpperCase():r.toLowerCase()),Vy=n=>{const i=Ew(n);return i.charAt(0).toUpperCase()+i.slice(1)},Tb=(...n)=>n.filter((i,r,c)=>!!i&&i.trim()!==""&&c.indexOf(i)===r).join(" ").trim(),Rw=n=>{for(const i in n)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};/**
65
+ */const Mw=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_w=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,c)=>c?c.toUpperCase():r.toLowerCase()),Kv=n=>{const i=_w(n);return i.charAt(0).toUpperCase()+i.slice(1)},Rb=(...n)=>n.filter((i,r,c)=>!!i&&i.trim()!==""&&c.indexOf(i)===r).join(" ").trim(),Lw=n=>{for(const i in n)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};/**
66
66
  * @license lucide-react v0.511.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
- */var zw={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"};/**
70
+ */var Uw={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
71
  * @license lucide-react v0.511.0 - ISC
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
- */const Dw=p.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:d="",children:f,iconNode:m,...h},g)=>p.createElement("svg",{ref:g,...zw,width:i,height:i,stroke:n,strokeWidth:c?Number(r)*24/Number(i):r,className:Tb("lucide",d),...!f&&!Rw(h)&&{"aria-hidden":"true"},...h},[...m.map(([v,b])=>p.createElement(v,b)),...Array.isArray(f)?f:[f]]));/**
75
+ */const Hw=p.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:d="",children:f,iconNode:m,...h},g)=>p.createElement("svg",{ref:g,...Uw,width:i,height:i,stroke:n,strokeWidth:c?Number(r)*24/Number(i):r,className:Rb("lucide",d),...!f&&!Lw(h)&&{"aria-hidden":"true"},...h},[...m.map(([y,b])=>p.createElement(y,b)),...Array.isArray(f)?f:[f]]));/**
76
76
  * @license lucide-react v0.511.0 - ISC
77
77
  *
78
78
  * This source code is licensed under the ISC license.
79
79
  * See the LICENSE file in the root directory of this source tree.
80
- */const he=(n,i)=>{const r=p.forwardRef(({className:c,...d},f)=>p.createElement(Dw,{ref:f,iconNode:i,className:Tb(`lucide-${Tw(Vy(n))}`,`lucide-${n}`,c),...d}));return r.displayName=Vy(n),r};/**
80
+ */const he=(n,i)=>{const r=p.forwardRef(({className:c,...d},f)=>p.createElement(Hw,{ref:f,iconNode:i,className:Rb(`lucide-${Mw(Kv(n))}`,`lucide-${n}`,c),...d}));return r.displayName=Kv(n),r};/**
81
81
  * @license lucide-react v0.511.0 - ISC
82
82
  *
83
83
  * This source code is licensed under the ISC license.
84
84
  * See the LICENSE file in the root directory of this source tree.
85
- */const Aw=[["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"}]],Mc=he("activity",Aw);/**
85
+ */const Bw=[["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"}]],Lc=he("activity",Bw);/**
86
86
  * @license lucide-react v0.511.0 - ISC
87
87
  *
88
88
  * This source code is licensed under the ISC license.
89
89
  * See the LICENSE file in the root directory of this source tree.
90
- */const Ow=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Eb=he("arrow-down",Ow);/**
90
+ */const $w=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],zb=he("arrow-down",$w);/**
91
91
  * @license lucide-react v0.511.0 - ISC
92
92
  *
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
- */const Mw=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_w=he("arrow-left",Mw);/**
95
+ */const qw=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Gw=he("arrow-left",qw);/**
96
96
  * @license lucide-react v0.511.0 - ISC
97
97
  *
98
98
  * This source code is licensed under the ISC license.
99
99
  * See the LICENSE file in the root directory of this source tree.
100
- */const Lw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],vi=he("arrow-right",Lw);/**
100
+ */const Yw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],bi=he("arrow-right",Yw);/**
101
101
  * @license lucide-react v0.511.0 - ISC
102
102
  *
103
103
  * This source code is licensed under the ISC license.
104
104
  * See the LICENSE file in the root directory of this source tree.
105
- */const Uw=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Hw=he("arrow-up-right",Uw);/**
105
+ */const Vw=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Xw=he("arrow-up-right",Vw);/**
106
106
  * @license lucide-react v0.511.0 - ISC
107
107
  *
108
108
  * This source code is licensed under the ISC license.
109
109
  * See the LICENSE file in the root directory of this source tree.
110
- */const Bw=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],$w=he("arrow-up",Bw);/**
110
+ */const Kw=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Zw=he("arrow-up",Kw);/**
111
111
  * @license lucide-react v0.511.0 - ISC
112
112
  *
113
113
  * This source code is licensed under the ISC license.
114
114
  * See the LICENSE file in the root directory of this source tree.
115
- */const qw=[["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"}]],Gw=he("bell-off",qw);/**
115
+ */const Qw=[["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"}]],Iw=he("bell-off",Qw);/**
116
116
  * @license lucide-react v0.511.0 - ISC
117
117
  *
118
118
  * This source code is licensed under the ISC license.
119
119
  * See the LICENSE file in the root directory of this source tree.
120
- */const Yw=[["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"}]],Tc=he("bell-ring",Yw);/**
120
+ */const Pw=[["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"}]],Rc=he("bell-ring",Pw);/**
121
121
  * @license lucide-react v0.511.0 - ISC
122
122
  *
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
- */const Vw=[["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"}]],Gh=he("bell",Vw);/**
125
+ */const Fw=[["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"}]],Vh=he("bell",Fw);/**
126
126
  * @license lucide-react v0.511.0 - ISC
127
127
  *
128
128
  * This source code is licensed under the ISC license.
129
129
  * See the LICENSE file in the root directory of this source tree.
130
- */const Xw=[["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"}]],Rb=he("boxes",Xw);/**
130
+ */const Jw=[["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"}]],Db=he("boxes",Jw);/**
131
131
  * @license lucide-react v0.511.0 - ISC
132
132
  *
133
133
  * This source code is licensed under the ISC license.
134
134
  * See the LICENSE file in the root directory of this source tree.
135
- */const Kw=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Zw=he("braces",Kw);/**
135
+ */const Ww=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],eS=he("braces",Ww);/**
136
136
  * @license lucide-react v0.511.0 - ISC
137
137
  *
138
138
  * This source code is licensed under the ISC license.
139
139
  * See the LICENSE file in the root directory of this source tree.
140
- */const Qw=[["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"}]],Iw=he("cable",Qw);/**
140
+ */const tS=[["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"}]],nS=he("cable",tS);/**
141
141
  * @license lucide-react v0.511.0 - ISC
142
142
  *
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
- */const Pw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dl=he("check",Pw);/**
145
+ */const aS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dl=he("check",aS);/**
146
146
  * @license lucide-react v0.511.0 - ISC
147
147
  *
148
148
  * This source code is licensed under the ISC license.
149
149
  * See the LICENSE file in the root directory of this source tree.
150
- */const Fw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Jw=he("chevron-down",Fw);/**
150
+ */const sS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],lS=he("chevron-down",sS);/**
151
151
  * @license lucide-react v0.511.0 - ISC
152
152
  *
153
153
  * This source code is licensed under the ISC license.
154
154
  * See the LICENSE file in the root directory of this source tree.
155
- */const Ww=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eS=he("chevron-right",Ww);/**
155
+ */const iS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],rS=he("chevron-right",iS);/**
156
156
  * @license lucide-react v0.511.0 - ISC
157
157
  *
158
158
  * This source code is licensed under the ISC license.
159
159
  * See the LICENSE file in the root directory of this source tree.
160
- */const tS=[["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"}]],nS=he("circle-alert",tS);/**
160
+ */const oS=[["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"}]],cS=he("circle-alert",oS);/**
161
161
  * @license lucide-react v0.511.0 - ISC
162
162
  *
163
163
  * This source code is licensed under the ISC license.
164
164
  * See the LICENSE file in the root directory of this source tree.
165
- */const aS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ts=he("circle-check",aS);/**
165
+ */const uS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ts=he("circle-check",uS);/**
166
166
  * @license lucide-react v0.511.0 - ISC
167
167
  *
168
168
  * This source code is licensed under the ISC license.
169
169
  * See the LICENSE file in the root directory of this source tree.
170
- */const sS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],zb=he("circle-minus",sS);/**
170
+ */const dS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],Ab=he("circle-minus",dS);/**
171
171
  * @license lucide-react v0.511.0 - ISC
172
172
  *
173
173
  * This source code is licensed under the ISC license.
174
174
  * See the LICENSE file in the root directory of this source tree.
175
- */const lS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],iS=he("circle-slash",lS);/**
175
+ */const fS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],hS=he("circle-slash",fS);/**
176
176
  * @license lucide-react v0.511.0 - ISC
177
177
  *
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
- */const rS=[["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"}]],Cr=he("circle-x",rS);/**
180
+ */const mS=[["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"}]],Cr=he("circle-x",mS);/**
181
181
  * @license lucide-react v0.511.0 - ISC
182
182
  *
183
183
  * This source code is licensed under the ISC license.
184
184
  * See the LICENSE file in the root directory of this source tree.
185
- */const oS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Db=he("circle",oS);/**
185
+ */const pS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ob=he("circle",pS);/**
186
186
  * @license lucide-react v0.511.0 - ISC
187
187
  *
188
188
  * This source code is licensed under the ISC license.
189
189
  * See the LICENSE file in the root directory of this source tree.
190
- */const cS=[["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"}]],uS=he("code-xml",cS);/**
190
+ */const xS=[["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"}]],gS=he("code-xml",xS);/**
191
191
  * @license lucide-react v0.511.0 - ISC
192
192
  *
193
193
  * This source code is licensed under the ISC license.
194
194
  * See the LICENSE file in the root directory of this source tree.
195
- */const dS=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fS=he("compass",dS);/**
195
+ */const vS=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],yS=he("compass",vS);/**
196
196
  * @license lucide-react v0.511.0 - ISC
197
197
  *
198
198
  * This source code is licensed under the ISC license.
199
199
  * See the LICENSE file in the root directory of this source tree.
200
- */const hS=[["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"}]],mS=he("copy",hS);/**
200
+ */const bS=[["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"}]],jS=he("copy",bS);/**
201
201
  * @license lucide-react v0.511.0 - ISC
202
202
  *
203
203
  * This source code is licensed under the ISC license.
204
204
  * See the LICENSE file in the root directory of this source tree.
205
- */const pS=[["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"}]],gh=he("download",pS);/**
205
+ */const NS=[["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"}]],vh=he("download",NS);/**
206
206
  * @license lucide-react v0.511.0 - ISC
207
207
  *
208
208
  * This source code is licensed under the ISC license.
209
209
  * See the LICENSE file in the root directory of this source tree.
210
- */const xS=[["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"}]],Os=he("earth",xS);/**
210
+ */const wS=[["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"}]],Os=he("earth",wS);/**
211
211
  * @license lucide-react v0.511.0 - ISC
212
212
  *
213
213
  * This source code is licensed under the ISC license.
214
214
  * See the LICENSE file in the root directory of this source tree.
215
- */const gS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],yS=he("external-link",gS);/**
215
+ */const SS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],kS=he("external-link",SS);/**
216
216
  * @license lucide-react v0.511.0 - ISC
217
217
  *
218
218
  * This source code is licensed under the ISC license.
219
219
  * See the LICENSE file in the root directory of this source tree.
220
- */const vS=[["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"}]],bS=he("eye-off",vS);/**
220
+ */const CS=[["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"}]],Mb=he("eye-off",CS);/**
221
221
  * @license lucide-react v0.511.0 - ISC
222
222
  *
223
223
  * This source code is licensed under the ISC license.
224
224
  * See the LICENSE file in the root directory of this source tree.
225
- */const jS=[["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"}]],NS=he("eye",jS);/**
225
+ */const TS=[["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"}]],_b=he("eye",TS);/**
226
226
  * @license lucide-react v0.511.0 - ISC
227
227
  *
228
228
  * This source code is licensed under the ISC license.
229
229
  * See the LICENSE file in the root directory of this source tree.
230
- */const wS=[["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"}]],SS=he("flask-conical",wS);/**
230
+ */const ES=[["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"}]],RS=he("flask-conical",ES);/**
231
231
  * @license lucide-react v0.511.0 - ISC
232
232
  *
233
233
  * This source code is licensed under the ISC license.
234
234
  * See the LICENSE file in the root directory of this source tree.
235
- */const kS=[["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"}]],CS=he("folder-input",kS);/**
235
+ */const zS=[["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"}]],DS=he("folder-input",zS);/**
236
236
  * @license lucide-react v0.511.0 - ISC
237
237
  *
238
238
  * This source code is licensed under the ISC license.
239
239
  * See the LICENSE file in the root directory of this source tree.
240
- */const TS=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],ES=he("gauge",TS);/**
240
+ */const AS=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],OS=he("gauge",AS);/**
241
241
  * @license lucide-react v0.511.0 - ISC
242
242
  *
243
243
  * This source code is licensed under the ISC license.
244
244
  * See the LICENSE file in the root directory of this source tree.
245
- */const RS=[["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"}]],zS=he("git-branch",RS);/**
245
+ */const MS=[["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"}]],_S=he("git-branch",MS);/**
246
246
  * @license lucide-react v0.511.0 - ISC
247
247
  *
248
248
  * This source code is licensed under the ISC license.
249
249
  * See the LICENSE file in the root directory of this source tree.
250
- */const DS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],AS=he("globe",DS);/**
250
+ */const LS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],US=he("globe",LS);/**
251
251
  * @license lucide-react v0.511.0 - ISC
252
252
  *
253
253
  * This source code is licensed under the ISC license.
254
254
  * See the LICENSE file in the root directory of this source tree.
255
- */const OS=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ab=he("grip-vertical",OS);/**
255
+ */const HS=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Lb=he("grip-vertical",HS);/**
256
256
  * @license lucide-react v0.511.0 - ISC
257
257
  *
258
258
  * This source code is licensed under the ISC license.
259
259
  * See the LICENSE file in the root directory of this source tree.
260
- */const MS=[["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"}]],_S=he("history",MS);/**
260
+ */const BS=[["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"}]],$S=he("history",BS);/**
261
261
  * @license lucide-react v0.511.0 - ISC
262
262
  *
263
263
  * This source code is licensed under the ISC license.
264
264
  * See the LICENSE file in the root directory of this source tree.
265
- */const LS=[["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"}]],US=he("inbox",LS);/**
265
+ */const qS=[["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"}]],GS=he("inbox",qS);/**
266
266
  * @license lucide-react v0.511.0 - ISC
267
267
  *
268
268
  * This source code is licensed under the ISC license.
269
269
  * See the LICENSE file in the root directory of this source tree.
270
- */const HS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ob=he("info",HS);/**
270
+ */const YS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ub=he("info",YS);/**
271
271
  * @license lucide-react v0.511.0 - ISC
272
272
  *
273
273
  * This source code is licensed under the ISC license.
274
274
  * See the LICENSE file in the root directory of this source tree.
275
- */const BS=[["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"}]],Ur=he("key-round",BS);/**
275
+ */const VS=[["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"}]],Hr=he("key-round",VS);/**
276
276
  * @license lucide-react v0.511.0 - ISC
277
277
  *
278
278
  * This source code is licensed under the ISC license.
279
279
  * See the LICENSE file in the root directory of this source tree.
280
- */const $S=[["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"}]],qS=he("layout-dashboard",$S);/**
280
+ */const XS=[["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"}]],KS=he("layout-dashboard",XS);/**
281
281
  * @license lucide-react v0.511.0 - ISC
282
282
  *
283
283
  * This source code is licensed under the ISC license.
284
284
  * See the LICENSE file in the root directory of this source tree.
285
- */const GS=[["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"}]],YS=he("link-2-off",GS);/**
285
+ */const ZS=[["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"}]],QS=he("link-2-off",ZS);/**
286
286
  * @license lucide-react v0.511.0 - ISC
287
287
  *
288
288
  * This source code is licensed under the ISC license.
289
289
  * See the LICENSE file in the root directory of this source tree.
290
- */const VS=[["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"}]],XS=he("link-2",VS);/**
290
+ */const IS=[["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"}]],PS=he("link-2",IS);/**
291
291
  * @license lucide-react v0.511.0 - ISC
292
292
  *
293
293
  * This source code is licensed under the ISC license.
294
294
  * See the LICENSE file in the root directory of this source tree.
295
- */const KS=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],ZS=he("list",KS);/**
295
+ */const FS=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],JS=he("list",FS);/**
296
296
  * @license lucide-react v0.511.0 - ISC
297
297
  *
298
298
  * This source code is licensed under the ISC license.
299
299
  * See the LICENSE file in the root directory of this source tree.
300
- */const QS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gn=he("loader-circle",QS);/**
300
+ */const WS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gn=he("loader-circle",WS);/**
301
301
  * @license lucide-react v0.511.0 - ISC
302
302
  *
303
303
  * This source code is licensed under the ISC license.
304
304
  * See the LICENSE file in the root directory of this source tree.
305
- */const IS=[["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"}]],Yh=he("lock",IS);/**
305
+ */const ek=[["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"}]],Xh=he("lock",ek);/**
306
306
  * @license lucide-react v0.511.0 - ISC
307
307
  *
308
308
  * This source code is licensed under the ISC license.
309
309
  * See the LICENSE file in the root directory of this source tree.
310
- */const PS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],FS=he("log-out",PS);/**
310
+ */const tk=[["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"}]],nk=he("log-out",tk);/**
311
311
  * @license lucide-react v0.511.0 - ISC
312
312
  *
313
313
  * This source code is licensed under the ISC license.
314
314
  * See the LICENSE file in the root directory of this source tree.
315
- */const JS=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],WS=he("menu",JS);/**
315
+ */const ak=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],sk=he("menu",ak);/**
316
316
  * @license lucide-react v0.511.0 - ISC
317
317
  *
318
318
  * This source code is licensed under the ISC license.
319
319
  * See the LICENSE file in the root directory of this source tree.
320
- */const ek=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Mb=he("moon",ek);/**
320
+ */const lk=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Hb=he("moon",lk);/**
321
321
  * @license lucide-react v0.511.0 - ISC
322
322
  *
323
323
  * This source code is licensed under the ISC license.
324
324
  * See the LICENSE file in the root directory of this source tree.
325
- */const tk=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],Xy=he("package-check",tk);/**
325
+ */const ik=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],Zv=he("package-check",ik);/**
326
326
  * @license lucide-react v0.511.0 - ISC
327
327
  *
328
328
  * This source code is licensed under the ISC license.
329
329
  * See the LICENSE file in the root directory of this source tree.
330
- */const nk=[["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"}]],_b=he("pause",nk);/**
330
+ */const rk=[["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"}]],Bb=he("pause",rk);/**
331
331
  * @license lucide-react v0.511.0 - ISC
332
332
  *
333
333
  * This source code is licensed under the ISC license.
334
334
  * See the LICENSE file in the root directory of this source tree.
335
- */const ak=[["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"}]],Vh=he("pencil",ak);/**
335
+ */const ok=[["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"}]],Kh=he("pencil",ok);/**
336
336
  * @license lucide-react v0.511.0 - ISC
337
337
  *
338
338
  * This source code is licensed under the ISC license.
339
339
  * See the LICENSE file in the root directory of this source tree.
340
- */const sk=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Hr=he("play",sk);/**
340
+ */const ck=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Br=he("play",ck);/**
341
341
  * @license lucide-react v0.511.0 - ISC
342
342
  *
343
343
  * This source code is licensed under the ISC license.
344
344
  * See the LICENSE file in the root directory of this source tree.
345
- */const lk=[["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"}]],ik=he("plug-zap",lk);/**
345
+ */const uk=[["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"}]],dk=he("plug-zap",uk);/**
346
346
  * @license lucide-react v0.511.0 - ISC
347
347
  *
348
348
  * This source code is licensed under the ISC license.
349
349
  * See the LICENSE file in the root directory of this source tree.
350
- */const rk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xa=he("plus",rk);/**
350
+ */const fk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xa=he("plus",fk);/**
351
351
  * @license lucide-react v0.511.0 - ISC
352
352
  *
353
353
  * This source code is licensed under the ISC license.
354
354
  * See the LICENSE file in the root directory of this source tree.
355
- */const ok=[["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"}]],ck=he("power-off",ok);/**
355
+ */const hk=[["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"}]],mk=he("power-off",hk);/**
356
356
  * @license lucide-react v0.511.0 - ISC
357
357
  *
358
358
  * This source code is licensed under the ISC license.
359
359
  * See the LICENSE file in the root directory of this source tree.
360
- */const uk=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],dk=he("power",uk);/**
360
+ */const pk=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],xk=he("power",pk);/**
361
361
  * @license lucide-react v0.511.0 - ISC
362
362
  *
363
363
  * This source code is licensed under the ISC license.
364
364
  * See the LICENSE file in the root directory of this source tree.
365
- */const fk=[["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"}]],Ct=he("refresh-cw",fk);/**
365
+ */const gk=[["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"}]],Ct=he("refresh-cw",gk);/**
366
366
  * @license lucide-react v0.511.0 - ISC
367
367
  *
368
368
  * This source code is licensed under the ISC license.
369
369
  * See the LICENSE file in the root directory of this source tree.
370
- */const hk=[["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"}]],Tr=he("rocket",hk);/**
370
+ */const vk=[["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"}]],Tr=he("rocket",vk);/**
371
371
  * @license lucide-react v0.511.0 - ISC
372
372
  *
373
373
  * This source code is licensed under the ISC license.
374
374
  * See the LICENSE file in the root directory of this source tree.
375
- */const mk=[["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"}]],pk=he("rotate-ccw",mk);/**
375
+ */const yk=[["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"}]],bk=he("rotate-ccw",yk);/**
376
376
  * @license lucide-react v0.511.0 - ISC
377
377
  *
378
378
  * This source code is licensed under the ISC license.
379
379
  * See the LICENSE file in the root directory of this source tree.
380
- */const xk=[["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"}]],Xh=he("rotate-cw",xk);/**
380
+ */const jk=[["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"}]],Zh=he("rotate-cw",jk);/**
381
381
  * @license lucide-react v0.511.0 - ISC
382
382
  *
383
383
  * This source code is licensed under the ISC license.
384
384
  * See the LICENSE file in the root directory of this source tree.
385
- */const gk=[["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"}]],yh=he("save",gk);/**
385
+ */const Nk=[["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"}]],yh=he("save",Nk);/**
386
386
  * @license lucide-react v0.511.0 - ISC
387
387
  *
388
388
  * This source code is licensed under the ISC license.
389
389
  * See the LICENSE file in the root directory of this source tree.
390
- */const yk=[["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"}]],Er=he("scroll-text",yk);/**
390
+ */const wk=[["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"}]],Er=he("scroll-text",wk);/**
391
391
  * @license lucide-react v0.511.0 - ISC
392
392
  *
393
393
  * This source code is licensed under the ISC license.
394
394
  * See the LICENSE file in the root directory of this source tree.
395
- */const vk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Lb=he("search",vk);/**
395
+ */const Sk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$b=he("search",Sk);/**
396
396
  * @license lucide-react v0.511.0 - ISC
397
397
  *
398
398
  * This source code is licensed under the ISC license.
399
399
  * See the LICENSE file in the root directory of this source tree.
400
- */const bk=[["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"}]],Ub=he("send",bk);/**
400
+ */const kk=[["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"}]],qb=he("send",kk);/**
401
401
  * @license lucide-react v0.511.0 - ISC
402
402
  *
403
403
  * This source code is licensed under the ISC license.
404
404
  * See the LICENSE file in the root directory of this source tree.
405
- */const jk=[["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"}]],Hb=he("server-cog",jk);/**
405
+ */const Ck=[["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"}]],Gb=he("server-cog",Ck);/**
406
406
  * @license lucide-react v0.511.0 - ISC
407
407
  *
408
408
  * This source code is licensed under the ISC license.
409
409
  * See the LICENSE file in the root directory of this source tree.
410
- */const Nk=[["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"}]],Bb=he("settings-2",Nk);/**
410
+ */const Tk=[["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"}]],Yb=he("settings-2",Tk);/**
411
411
  * @license lucide-react v0.511.0 - ISC
412
412
  *
413
413
  * This source code is licensed under the ISC license.
414
414
  * See the LICENSE file in the root directory of this source tree.
415
- */const wk=[["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"}]],gl=he("server",wk);/**
415
+ */const Ek=[["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"}]],gl=he("server",Ek);/**
416
416
  * @license lucide-react v0.511.0 - ISC
417
417
  *
418
418
  * This source code is licensed under the ISC license.
419
419
  * See the LICENSE file in the root directory of this source tree.
420
- */const Sk=[["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"}]],kk=he("settings",Sk);/**
420
+ */const Rk=[["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"}]],zk=he("settings",Rk);/**
421
421
  * @license lucide-react v0.511.0 - ISC
422
422
  *
423
423
  * This source code is licensed under the ISC license.
424
424
  * See the LICENSE file in the root directory of this source tree.
425
- */const Ck=[["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"}]],as=he("shield-alert",Ck);/**
425
+ */const Dk=[["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"}]],as=he("shield-alert",Dk);/**
426
426
  * @license lucide-react v0.511.0 - ISC
427
427
  *
428
428
  * This source code is licensed under the ISC license.
429
429
  * See the LICENSE file in the root directory of this source tree.
430
- */const Tk=[["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"}]],Rn=he("shield-check",Tk);/**
430
+ */const Ak=[["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"}]],Rn=he("shield-check",Ak);/**
431
431
  * @license lucide-react v0.511.0 - ISC
432
432
  *
433
433
  * This source code is licensed under the ISC license.
434
434
  * See the LICENSE file in the root directory of this source tree.
435
- */const Ek=[["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"}]],Rk=he("shield-off",Ek);/**
435
+ */const Ok=[["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"}]],Mk=he("shield-off",Ok);/**
436
436
  * @license lucide-react v0.511.0 - ISC
437
437
  *
438
438
  * This source code is licensed under the ISC license.
439
439
  * See the LICENSE file in the root directory of this source tree.
440
- */const zk=[["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"}]],Kh=he("sparkles",zk);/**
440
+ */const _k=[["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"}]],Qh=he("sparkles",_k);/**
441
441
  * @license lucide-react v0.511.0 - ISC
442
442
  *
443
443
  * This source code is licensed under the ISC license.
444
444
  * See the LICENSE file in the root directory of this source tree.
445
- */const Dk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Zh=he("square",Dk);/**
445
+ */const Lk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ih=he("square",Lk);/**
446
446
  * @license lucide-react v0.511.0 - ISC
447
447
  *
448
448
  * This source code is licensed under the ISC license.
449
449
  * See the LICENSE file in the root directory of this source tree.
450
- */const Ak=[["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"}]],$b=he("sun",Ak);/**
450
+ */const Uk=[["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"}]],Vb=he("sun",Uk);/**
451
451
  * @license lucide-react v0.511.0 - ISC
452
452
  *
453
453
  * This source code is licensed under the ISC license.
454
454
  * See the LICENSE file in the root directory of this source tree.
455
- */const Ok=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],Mk=he("table-2",Ok);/**
455
+ */const Hk=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],Bk=he("table-2",Hk);/**
456
456
  * @license lucide-react v0.511.0 - ISC
457
457
  *
458
458
  * This source code is licensed under the ISC license.
459
459
  * See the LICENSE file in the root directory of this source tree.
460
- */const _k=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Lk=he("terminal",_k);/**
460
+ */const $k=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],qk=he("terminal",$k);/**
461
461
  * @license lucide-react v0.511.0 - ISC
462
462
  *
463
463
  * This source code is licensed under the ISC license.
464
464
  * See the LICENSE file in the root directory of this source tree.
465
- */const Uk=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7",key:"10he05"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2",key:"15f7sh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M12 12v-2",key:"fwoke6"}]],Hk=he("timer-off",Uk);/**
465
+ */const Gk=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7",key:"10he05"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2",key:"15f7sh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M12 12v-2",key:"fwoke6"}]],Yk=he("timer-off",Gk);/**
466
466
  * @license lucide-react v0.511.0 - ISC
467
467
  *
468
468
  * This source code is licensed under the ISC license.
469
469
  * See the LICENSE file in the root directory of this source tree.
470
- */const Bk=[["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"}]],Us=he("trash-2",Bk);/**
470
+ */const Vk=[["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"}]],Us=he("trash-2",Vk);/**
471
471
  * @license lucide-react v0.511.0 - ISC
472
472
  *
473
473
  * This source code is licensed under the ISC license.
474
474
  * See the LICENSE file in the root directory of this source tree.
475
- */const $k=[["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"}]],fl=he("triangle-alert",$k);/**
475
+ */const Xk=[["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"}]],fl=he("triangle-alert",Xk);/**
476
476
  * @license lucide-react v0.511.0 - ISC
477
477
  *
478
478
  * This source code is licensed under the ISC license.
479
479
  * See the LICENSE file in the root directory of this source tree.
480
- */const qk=[["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"}]],Gk=he("undo-2",qk);/**
480
+ */const Kk=[["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"}]],Zk=he("undo-2",Kk);/**
481
481
  * @license lucide-react v0.511.0 - ISC
482
482
  *
483
483
  * This source code is licensed under the ISC license.
484
484
  * See the LICENSE file in the root directory of this source tree.
485
- */const Yk=[["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"}]],Vk=he("unplug",Yk);/**
485
+ */const Qk=[["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"}]],Ik=he("unplug",Qk);/**
486
486
  * @license lucide-react v0.511.0 - ISC
487
487
  *
488
488
  * This source code is licensed under the ISC license.
489
489
  * See the LICENSE file in the root directory of this source tree.
490
- */const Xk=[["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"}]],Kk=he("upload",Xk);/**
490
+ */const Pk=[["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"}]],Fk=he("upload",Pk);/**
491
491
  * @license lucide-react v0.511.0 - ISC
492
492
  *
493
493
  * This source code is licensed under the ISC license.
494
494
  * See the LICENSE file in the root directory of this source tree.
495
- */const Zk=[["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"}]],Qk=he("wand-sparkles",Zk);/**
495
+ */const Jk=[["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"}]],Wk=he("wand-sparkles",Jk);/**
496
496
  * @license lucide-react v0.511.0 - ISC
497
497
  *
498
498
  * This source code is licensed under the ISC license.
499
499
  * See the LICENSE file in the root directory of this source tree.
500
- */const Ik=[["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"}]],Wc=he("webhook",Ik);/**
500
+ */const e5=[["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"}]],nu=he("webhook",e5);/**
501
501
  * @license lucide-react v0.511.0 - ISC
502
502
  *
503
503
  * This source code is licensed under the ISC license.
504
504
  * See the LICENSE file in the root directory of this source tree.
505
- */const Pk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ms=he("x",Pk);/**
505
+ */const t5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ms=he("x",t5);/**
506
506
  * @license lucide-react v0.511.0 - ISC
507
507
  *
508
508
  * This source code is licensed under the ISC license.
509
509
  * See the LICENSE file in the root directory of this source tree.
510
- */const Fk=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],Jk=he("wrench",Fk);function oe(...n){return n.filter(Boolean).join(" ")}const qb=p.createContext(null),Wk={success:{icon:ts,iconClass:"text-ok"},error:{icon:nS,iconClass:"text-bad"},warning:{icon:fl,iconClass:"text-warn"},info:{icon:Ob,iconClass:"text-info"}},e5=6e3;let Ky=0;function t5(){return Ky+=1,`toast-${Date.now().toString(36)}-${Ky}`}function n5({children:n}){const[i,r]=p.useState([]),c=p.useRef(new Map),d=h=>{const g=c.current.get(h);g&&clearTimeout(g),c.current.delete(h),r(v=>v.filter(b=>b.id!==h))},f=h=>{const g=t5(),v={id:g,title:h.title,description:h.description,tone:h.tone??"info"};r(x=>{const j=[...x,v];return j.length>5?j.slice(j.length-5):j});const b=setTimeout(()=>d(g),h.durationMs??e5);return c.current.set(g,b),g},m=p.useMemo(()=>({push:f,dismiss:d,success:(h,g)=>f({title:h,description:g,tone:"success"}),error:(h,g)=>f({title:h,description:g,tone:"error"}),warning:(h,g)=>f({title:h,description:g,tone:"warning"}),info:(h,g)=>f({title:h,description:g,tone:"info"})}),[]);return p.useEffect(()=>{const h=c.current;return()=>{for(const g of h.values())clearTimeout(g);h.clear()}},[]),a.jsxs(qb.Provider,{value:m,children:[n,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:i.map(h=>{const{icon:g,iconClass:v}=Wk[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(g,{className:oe("mt-0.5 size-4 shrink-0",v),"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:()=>d(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(Ms,{className:"size-3.5","aria-hidden":"true"})})]},h.id)})})]})}function Et(){const n=p.useContext(qb);if(!n)throw new Error("useToast must be used inside ToastProvider");return n}const a5={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"},s5={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 ma(n="secondary",i="md",r){return oe("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",a5[n],s5[i],r)}const se=p.forwardRef(function({variant:i="secondary",size:r="md",loading:c=!1,icon:d,className:f,children:m,disabled:h,...g},v){return a.jsxs("button",{ref:v,type:"button",className:ma(i,r,f),disabled:h||c,"aria-busy":c||void 0,...g,children:[c?a.jsx(gn,{className:"spin size-4","aria-hidden":"true"}):d,m]})}),ct=p.forwardRef(function({label:i,variant:r="ghost",size:c="md",className:d,children:f,...m},h){return a.jsx("button",{ref:h,type:"button","aria-label":i,title:i,className:ma(r,c==="sm"?"sm":"md",oe("!px-0",c==="sm"?"size-8":"size-9",d)),...m,children:f})}),hi=[],vh=new Set;function Zy(){for(const n of vh)n()}function bh(n){return hi.length>0&&hi[hi.length-1]===n}function l5(n){const i=p.useId(),[r,c]=p.useState(()=>bh(i));return p.useEffect(()=>{const d=()=>c(bh(i));return vh.add(d),d(),()=>{vh.delete(d)}},[i]),p.useEffect(()=>{if(n)return hi.push(i),Zy(),()=>{const d=hi.lastIndexOf(i);d!==-1&&hi.splice(d,1),Zy()}},[n,i]),{id:i,isTop:r}}const i5={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-4xl"},r5='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function yn({open:n,onClose:i,title:r,description:c,children:d,footer:f,size:m="md",preventClose:h=!1,bodyClassName:g}){const v=p.useId(),b=p.useId(),{id:x,isTop:j}=l5(n),S=p.useRef(null),R=p.useRef(null),k=p.useRef(i);k.current=i;const C=p.useRef(h);return C.current=h,p.useEffect(()=>{if(!n)return;R.current=document.activeElement;const z=document.body.style.overflow;document.body.style.overflow="hidden";const w=window.setTimeout(()=>{const E=S.current;if(!E)return;(E.querySelector("[data-autofocus]")??E).focus()},0),O=E=>{if(!bh(x))return;if(E.key==="Escape"&&!C.current){if(E.defaultPrevented)return;E.stopPropagation(),k.current();return}if(E.key!=="Tab")return;const M=S.current;if(!M)return;const Y=Array.from(M.querySelectorAll(r5)).filter(I=>I.offsetParent!==null&&!I.closest("[inert]"));if(Y.length===0){E.preventDefault(),M.focus();return}const A=Y[0],H=Y[Y.length-1],W=document.activeElement;E.shiftKey&&(W===A||W===M)?(E.preventDefault(),H.focus()):!E.shiftKey&&W===H&&(E.preventDefault(),A.focus())};return document.addEventListener("keydown",O,!0),()=>{window.clearTimeout(w),document.removeEventListener("keydown",O,!0),document.body.style.overflow=z,R.current?.focus()}},[n,x]),n?ol.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:z=>{z.target!==z.currentTarget||!j||h||i()},children:a.jsxs("div",{ref:S,role:"dialog","aria-modal":j||void 0,"aria-labelledby":v,"aria-describedby":c?b:void 0,tabIndex:-1,className:oe("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",i5[m]),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:v,className:"text-base font-semibold text-ink",children:r}),c&&a.jsx("p",{id:b,className:"mt-1 text-sm text-muted",children:c})]}),a.jsx(ct,{label:"Close",size:"sm",onClick:i,disabled:h,className:"-mr-1 -mt-1",children:a.jsx(Ms,{className:"size-4","aria-hidden":"true"})})]}),d&&a.jsx("div",{className:oe("min-h-0 flex-1 overflow-y-auto px-5 py-4",g),children:d}),f&&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:f})]})}),document.body):null}class He extends Error{status;payload;constructor(i,r,c){super(c??o5(i,r)),this.name="ApiError",this.status=i,this.payload=r}get code(){const{error:i}=this.payload;if(typeof i=="string")return i;if(i&&typeof i=="object")return i.step}get blockedReason(){return this.status!==403?null:this.payload.reason??null}}function o5(n,i){const{error:r}=i;return typeof r=="string"&&r&&r!=="Forbidden"?r:r&&typeof r=="object"?r.cause||r.consequence||"The request failed.":n===403?"Request blocked by the dashboard.":n===401?"Your session ended. Please sign in again.":n===0?"Cannot reach the dashboard.":`Request failed (HTTP ${n}).`}function c5(n){if(n instanceof He)return n;const i=n instanceof Error?n.message:"Something went wrong.";return new He(0,{error:i})}function Tt(n,i=[],r={}){const c=r.enabled??!0,d=p.useRef(n);d.current=n;const[f,m]=p.useState(0),h=p.useRef(!1),[g,v]=p.useState({data:null,error:null,loading:c});p.useEffect(()=>{if(!c){h.current=!1,v({data:null,error:null,loading:!1});return}const S=new AbortController,R=h.current;return h.current=!1,R||v(k=>({...k,loading:!0,error:null})),d.current(S.signal).then(k=>{S.signal.aborted||v({data:k,error:null,loading:!1})}).catch(k=>{S.signal.aborted||k?.name!=="AbortError"&&v(C=>({...C,error:c5(k),loading:!1}))}),()=>S.abort()},[...i,c,f]);const b=p.useCallback(()=>m(S=>S+1),[]),x=p.useCallback(()=>{h.current=!0,m(S=>S+1)},[]),j=p.useCallback(S=>{v(R=>({...R,data:typeof S=="function"?S(R.data):S}))},[]);return{data:g.data,error:g.error,loading:g.loading,reload:b,reloadSilent:x,setData:j}}function hl(n,i,r=!0){const c=p.useRef(n);c.current=n,p.useEffect(()=>{if(!r)return;const d=setInterval(()=>c.current(),i);return()=>clearInterval(d)},[i,r])}function yl(n){const i=p.useRef(n);i.current=n,p.useEffect(()=>{const r=()=>{document.visibilityState==="visible"&&i.current()};return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[])}function ba(n){p.useEffect(()=>{document.title=n?`${n} · Easy DevOps`:"Easy DevOps"},[n])}let jh=null;function Qy(n){jh=n}function rn(){return p.useCallback(n=>jh?jh(n):Promise.resolve(!1),[])}function u5({children:n}){const[i,r]=p.useState(null),c=p.useRef(null),d=p.useCallback(h=>(c.current?.resolve(!1),new Promise(g=>{c.current={resolve:g},r(h)})),[]);p.useEffect(()=>(Qy(d),()=>Qy(null)),[d]);const f=p.useCallback(h=>{r(null);const g=c.current;c.current=null,g?.resolve(h)},[]),m=i?.tone==="danger";return a.jsxs(a.Fragment,{children:[n,a.jsx(yn,{open:i!==null,onClose:()=>f(!1),title:i?.title??"",size:"sm",bodyClassName:"px-5 py-4",footer:a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"ghost",onClick:()=>f(!1),"data-autofocus":!0,children:i?.cancelLabel??"Cancel"}),a.jsx(se,{variant:m?"danger":"primary",onClick:()=>f(!0),children:i?.confirmLabel??"Confirm"})]}),children:a.jsx("div",{className:"text-sm text-muted",children:i?.body})})]})}const d5="modulepreload",f5=function(n,i){return new URL(n,i).href},Iy={},h5=function(i,r,c){let d=Promise.resolve();if(r&&r.length>0){let m=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const h=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),v=g?.nonce||g?.getAttribute("nonce");d=m(r.map(b=>{if(b=f5(b,c),b in Iy)return;Iy[b]=!0;const x=b.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(!!c)for(let k=h.length-1;k>=0;k--){const C=h[k];if(C.href===b&&(!x||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${j}`))return;const R=document.createElement("link");if(R.rel=x?"stylesheet":d5,x||(R.as="script"),R.crossOrigin="",R.href=b,v&&R.setAttribute("nonce",v),document.head.appendChild(R),x)return new Promise((k,C)=>{R.addEventListener("load",k),R.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${b}`)))})}))}function f(m){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=m,window.dispatchEvent(h),!h.defaultPrevented)throw m}return d.then(m=>{for(const h of m||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},m5="/api",p5=new Set(["POST","PUT","PATCH","DELETE"]),x5=!1,g5="Your session ended. Please sign in again.",Nh=new Set,wh=new Set;function y5(n){return Nh.add(n),()=>Nh.delete(n)}function v5(n){return wh.add(n),()=>wh.delete(n)}function b5(n){if(!n)return"";const i=new URLSearchParams;for(const[c,d]of Object.entries(n))d!=null&&i.set(c,String(d));const r=i.toString();return r?`?${r}`:""}async function j5(n){const i=await n.text();if(!i)return{};try{const r=JSON.parse(i);return r&&typeof r=="object"?r:{error:String(r)}}catch{return{error:i.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,240)}}}async function ge(n,i={}){const r=i.method??"GET",c={Accept:"application/json"};let d;i.body!==void 0&&(c["Content-Type"]="application/json",d=JSON.stringify(i.body)),p5.has(r)&&(c["X-EZ-Request"]="1");let f;try{f=await fetch(`${m5}${n}${b5(i.query)}`,{method:r,headers:c,body:d,credentials:"same-origin",signal:i.signal})}catch(h){throw h?.name==="AbortError"?h:new He(0,{error:"Cannot reach the dashboard."})}if(f.status===204)return;if(!f.ok){const h=await j5(f),g=new He(f.status,h);if(!i.skipAuthEvents){if(f.status===401)for(const v of Nh)v(g5);else if(f.status===403)for(const v of wh)v(g)}throw g}const m=await f.text();if(m)return JSON.parse(m)}function Qe(n){return encodeURIComponent(n)}const fe={auth:{status:n=>ge("/auth",{signal:n}),login:n=>ge("/login",{method:"POST",body:{password:n},skipAuthEvents:!0}),setup:n=>ge("/setup",{method:"POST",body:n,skipAuthEvents:!0}),logout:()=>ge("/logout",{method:"POST"})},domains:{list:n=>ge("/domains",{signal:n}),create:n=>ge("/domains",{method:"POST",body:n}),update:(n,i)=>ge(`/domains/${Qe(n)}`,{method:"PUT",body:i}),remove:(n,i)=>ge(`/domains/${Qe(n)}`,{method:"DELETE",query:{deleteCert:i}}),toggle:n=>ge(`/domains/${Qe(n)}/toggle`,{method:"PUT"}),reload:n=>ge(`/domains/${Qe(n)}/reload`,{method:"POST"}),notifications:(n,i)=>ge(`/domains/${Qe(n)}/notifications`,{signal:i}),saveNotifications:(n,i)=>ge(`/domains/${Qe(n)}/notifications`,{method:"PUT",body:i}),sslSuggestion:(n,i)=>ge(`/domains/${Qe(n)}/ssl-suggestion`,{signal:i})},ssl:{list:n=>ge("/ssl",{signal:n}),create:n=>ge("/ssl/create",{method:"POST",body:n}),confirmDns:n=>ge("/ssl/create-confirm",{method:"POST",body:{domain:n}}),cancelDns:n=>ge("/ssl/create-cancel",{method:"POST",body:{domain:n}}),renew:(n,i)=>ge(`/ssl/renew/${Qe(n)}`,{method:"POST",body:i?{opId:i}:{}}),renewAll:n=>ge("/ssl/renew-all",{method:"POST",body:n?{opId:n}:{}}),remove:n=>ge(`/ssl/${Qe(n)}`,{method:"DELETE"})},nginx:{status:n=>ge("/nginx/status",{signal:n}),reload:()=>ge("/nginx/reload",{method:"POST"}),restart:()=>ge("/nginx/restart",{method:"POST"}),start:()=>ge("/nginx/start",{method:"POST"}),stop:()=>ge("/nginx/stop",{method:"POST"}),test:()=>ge("/nginx/test",{method:"POST"}),configs:n=>ge("/nginx/configs",{signal:n}),getConfig:(n,i)=>ge(`/nginx/config/${Qe(n)}`,{signal:i}),saveConfig:(n,i)=>ge(`/nginx/config/${Qe(n)}`,{method:"POST",body:{content:i}}),logs:n=>ge("/nginx/logs",{signal:n})},processes:{list:n=>ge("/processes",{signal:n}),action:(n,i)=>ge(`/processes/${Qe(n)}/${i}`,{method:"POST"}),logs:(n,i=200,r)=>ge(`/processes/${Qe(n)}/logs`,{signal:r,query:{lines:i}})},deployments:{list:n=>ge("/deployments",{signal:n}),get:(n,i)=>ge(`/deployments/${Qe(n)}`,{signal:i}),create:n=>ge("/deployments",{method:"POST",body:n}),update:(n,i)=>ge(`/deployments/${Qe(n)}`,{method:"PUT",body:i}),remove:(n,i={})=>ge(`/deployments/${Qe(n)}`,{method:"DELETE",query:{deleteDomain:i.deleteDomain?1:void 0,purgeData:i.purgeData?1:void 0}}),linkDomain:(n,i)=>ge(`/deployments/${Qe(n)}/domain`,{method:"PUT",body:i}),unlinkDomain:n=>ge(`/deployments/${Qe(n)}/domain`,{method:"DELETE"}),move:(n,i)=>ge(`/deployments/${Qe(n)}/move`,{method:"POST",body:{path:i}}),deploy:(n,i)=>ge(`/deployments/${Qe(n)}/deploy`,{method:"POST",body:i?{ref:i}:{}}),rollback:(n,i)=>ge(`/deployments/${Qe(n)}/rollback`,{method:"POST",body:i?{releaseId:i}:{}}),removeRelease:(n,i)=>ge(`/deployments/${Qe(n)}/releases/${Qe(i)}`,{method:"DELETE"}),run:(n,i,r)=>ge(`/deployments/${Qe(n)}/runs/${Qe(i)}`,{signal:r}),issueHookToken:n=>ge(`/deployments/${Qe(n)}/hook-token`,{method:"POST"}),revokeHookToken:n=>ge(`/deployments/${Qe(n)}/hook-token`,{method:"DELETE"}),generateDeployKey:n=>ge(`/deployments/${Qe(n)}/deploy-key`,{method:"POST"}),testDeployKey:n=>ge(`/deployments/${Qe(n)}/deploy-key/test`,{method:"POST"}),addDeployKeyToGithub:(n,i)=>ge(`/deployments/${Qe(n)}/deploy-key/github`,{method:"POST",body:i?{token:i}:{}}),github:(n,i)=>ge(`/deployments/${Qe(n)}/github`,{signal:i}),applyGithub:(n,i)=>ge(`/deployments/${Qe(n)}/github/apply`,{method:"POST",body:i}),hook:n=>ge("/deployments/hook",{signal:n}),updateHook:n=>ge("/deployments/hook",{method:"PUT",body:n})},service:{status:n=>ge("/service",{signal:n}),start:()=>ge("/service/start",{method:"POST"}),stop:()=>ge("/service/stop",{method:"POST"}),restart:()=>ge("/service/restart",{method:"POST"})},settings:{get:n=>ge("/settings",{signal:n}),update:n=>ge("/settings",{method:"POST",body:n}),permissions:n=>ge("/settings/permissions",{signal:n}),setupPermissions:()=>ge("/settings/permissions/setup",{method:"POST"}),backup:n=>ge("/settings/backup",{signal:n}),restore:n=>ge("/settings/restore",{method:"POST",body:n}),channels:{list:n=>ge("/settings/channels",{signal:n}),create:n=>ge("/settings/channels",{method:"POST",body:n}),update:(n,i)=>ge(`/settings/channels/${Qe(n)}`,{method:"PUT",body:i}),remove:n=>ge(`/settings/channels/${Qe(n)}`,{method:"DELETE"}),test:n=>ge(`/settings/channels/${Qe(n)}/test`,{method:"POST"})}},hub:{status:n=>ge("/hub/status",{signal:n}),connect:n=>ge("/hub/connect",{method:"POST",body:{connectionString:n}}),unlink:()=>ge("/hub/link",{method:"DELETE"}),updatePermissions:n=>ge("/hub/permissions",{method:"PUT",body:n})},update:{check:n=>ge("/update",{signal:n}),status:n=>ge("/update/status",{signal:n}),start:n=>ge("/update",{method:"POST",body:{version:n}})}},Gb=p.createContext(null);function N5(n){if(n instanceof He)return n;const i=n instanceof Error?n.message:"Cannot reach the dashboard.";return new He(0,{error:i})}function w5({children:n}){const[i,r]=p.useState("loading"),[c,d]=p.useState(null),[f,m]=p.useState(null),[h,g]=p.useState(null),[v,b]=p.useState(null),x=p.useRef("loading");x.current=i;const j=p.useCallback(M=>{d(M),m(null),r(M.authenticated?"authenticated":"unauthenticated")},[]),S=p.useCallback(async()=>{r("loading");try{j(await fe.auth.status())}catch(M){m(N5(M)),r("error")}},[j]);p.useEffect(()=>{S()},[S]);const R=p.useCallback(M=>{g(M??"Your session ended. Please sign in again."),b(null),d(Y=>Y&&{...Y,authenticated:!1}),r("unauthenticated")},[]);p.useEffect(()=>{const M=y5(A=>{x.current==="authenticated"&&R(A)}),Y=v5(A=>b(A));return()=>{M(),Y()}},[R]);const k=p.useCallback(async()=>{try{j(await fe.auth.status())}catch{d(M=>M&&{...M,authenticated:!0}),r("authenticated")}g(null),b(null)},[j]),C=p.useCallback(async M=>{await fe.auth.login(M),await k()},[k]),z=p.useCallback(async M=>{await fe.auth.setup(M),await k()},[k]),w=p.useCallback(async()=>{try{await fe.auth.logout()}catch{}d(M=>M&&{...M,authenticated:!1}),g(null),b(null),r("unauthenticated")},[]),O=p.useCallback(()=>b(null),[]),E=p.useMemo(()=>({phase:i,auth:c,bootError:f,sessionMessage:h,blocked:v,login:C,setup:z,logout:w,retryBoot:S,dismissBlocked:O,reportUnauthorized:R}),[i,c,f,h,v,C,z,w,S,O,R]);return a.jsx(Gb.Provider,{value:E,children:n})}function ja(){const n=p.useContext(Gb);if(!n)throw new Error("useAuth must be used inside AuthProvider");return n}const Py=50,Yb=p.createContext(null);function S5({children:n}){const{phase:i,reportUnauthorized:r}=ja(),c=i==="authenticated",[d,f]=p.useState(null),[m,h]=p.useState(!1),[g,v]=p.useState(null),[b,x]=p.useState(null),[j,S]=p.useState(null),[R,k]=p.useState([]),[C,z]=p.useState(0),[w,O]=p.useState(null),[E,M]=p.useState(0),Y=p.useCallback(()=>z(0),[]),A=p.useCallback(()=>{k([]),z(0)},[]);p.useEffect(()=>{if(!c){f(null),h(!1),v(null),x(null),S(null),k([]),z(0),O(null);return}let W=!1,I=null;const ne=()=>{h(!0),v(null)},J=()=>h(!1),Z=L=>{h(!1);const te=L.data;if(L.message==="UNAUTHORIZED"||te?.reason==="unauthorized"){r();return}if(L.message==="FORBIDDEN"||te?.reason){v(te?.detail??"Live updates were blocked by the dashboard.");return}v("Live updates are unavailable. Data still refreshes on the page.")},ee=L=>x(L),ue=L=>S(L),K=L=>{k(te=>{const de=te.filter(Ne=>Ne.id!==L.id),ke=[L,...de];return ke.length>Py?ke.slice(0,Py):ke}),z(te=>Math.min(te+1,99))},B=L=>{O(L),M(te=>te+1)};return(async()=>{try{if(!x5){const{createRealtimeClient:L}=await h5(async()=>{const{createRealtimeClient:te}=await import("./socket-DwLPrgsr.js");return{createRealtimeClient:te}},[],import.meta.url);I=L()}if(W){I.disconnect();return}I.on("connect",ne),I.on("disconnect",J),I.on("connect_error",Z),I.on("nginx:status",ee),I.on("domain:health",ue),I.on("notification:new",K),I.on("local:changed",B),f(I),I.connect()}catch{W||v("Could not start the live connection.")}})(),()=>{W=!0,I&&(I.off("connect",ne),I.off("disconnect",J),I.off("connect_error",Z),I.off("nginx:status",ee),I.off("domain:health",ue),I.off("notification:new",K),I.off("local:changed",B),I.disconnect()),h(!1)}},[c,r]);const H=p.useMemo(()=>({client:d,connected:m,connectionError:g,nginxStatus:b,domainHealth:j,notifications:R,unread:C,markAllRead:Y,clearNotifications:A,lastChange:w,changeSeq:E}),[d,m,g,b,j,R,C,Y,A,w,E]);return a.jsx(Yb.Provider,{value:H,children:n})}function vn(){const n=p.useContext(Yb);if(!n)throw new Error("useRealtime must be used inside RealtimeProvider");return n}const Vb=p.createContext(null);function k5({children:n}){const{phase:i}=ja(),r=i==="authenticated",{client:c,connected:d}=vn(),f=Tt(w=>fe.service.status(w),[r],{enabled:r}),{setData:m,reload:h,reloadSilent:g}=f;hl(h,6e4,r);const v=p.useRef(!1);p.useEffect(()=>{if(!r){v.current=!1;return}const w=f.data?.probes;if(!w)return;if(!w.pending){v.current=!1;return}if(v.current)return;const O=setTimeout(()=>{v.current=!0,g()},1500);return()=>clearTimeout(O)},[r,f.data,g]);const b=p.useCallback(w=>{m(O=>O&&{...O,backgroundService:{...O.backgroundService,...w}})},[m]),x=p.useRef(null),j=p.useRef(!1),S=p.useRef(!1);S.current=f.loading;const R=p.useCallback(()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{if(x.current=null,S.current){j.current=!0;return}h()},250)},[h]);p.useEffect(()=>{!f.loading&&j.current&&(j.current=!1,h())},[f.loading,h]),p.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),p.useEffect(()=>{if(!r||!c)return;const w=O=>{b(O),R()};return c.on("service:changed",w),()=>c.off("service:changed",w)},[r,c,b,R]);const k=p.useRef(!1),C=p.useRef(!1);p.useEffect(()=>{if(!r){k.current=!1,C.current=!1;return}d&&!k.current&&(C.current&&R(),C.current=!0),k.current=d},[r,d,R]);const z=p.useMemo(()=>({service:f.data,loading:f.loading,error:f.error,reload:f.reload,applyBackgroundService:b}),[f.data,f.loading,f.error,f.reload,b]);return a.jsx(Vb.Provider,{value:z,children:n})}function Br(){const n=p.useContext(Vb);if(!n)throw new Error("useService must be used inside ServiceProvider");return n}const Xb=[{label:"Manage",items:[{to:"/",label:"Overview",title:"Overview",description:"The state of nginx, your domains and their certificates at a glance.",icon:qS},{to:"/domains",label:"Domains",title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",icon:Os},{to:"/ssl",label:"SSL certificates",title:"SSL certificates",description:"Issue and renew Let’s Encrypt certificates for your domains.",icon:Rn},{to:"/nginx",label:"Nginx",title:"Nginx",description:"Service status, configuration files and live logs.",icon:gl},{to:"/deployments",label:"Deployments",title:"Deployments",description:"Put a project from a git repository on this server and keep it deployed.",icon:Tr}]},{label:"Monitor",items:[{to:"/notifications",label:"Notifications",title:"Notifications",description:"Delivery channels, test messages and recent events.",icon:Gh},{to:"/processes",label:"Processes",title:"Processes",description:"The Easy DevOps background service and your own PM2 apps.",icon:Rb},{to:"/logs",label:"Logs",title:"Logs",description:"nginx access and error output as it is written.",icon:Er}]},{label:"System",items:[{to:"/settings",label:"Settings",title:"Settings",description:"Access, authentication, Hub pairing and backup.",icon:kk}]}],C5=Xb.flatMap(n=>n.items);function Kb(n){return C5.find(i=>i.to==="/"?n==="/":n===i.to||n.startsWith(`${i.to}/`))}function Zb({className:n}){return a.jsxs("span",{className:oe("inline-flex shrink-0 items-center",n),"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 T5=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",year:"numeric"}),E5=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"});function Qh(n){if(n==null||n==="")return"—";const i=typeof n=="number"?new Date(n):new Date(n);return Number.isNaN(i.getTime())?"—":T5.format(i)}function Ih(n){if(n==null||n==="")return"—";const i=typeof n=="number"?new Date(n):new Date(n);return Number.isNaN(i.getTime())?"—":E5.format(i)}function $r(n){const i=Math.max(0,Math.round((Date.now()-n)/1e3));if(i<10)return"just now";if(i<60)return`${i}s ago`;const r=Math.floor(i/60);if(r<60)return`${r}m ago`;const c=Math.floor(r/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Qb(){return new Date().getFullYear()}function Ib(n){if(n==null)return"—";if(n<1024)return`${n} B`;const i=["KB","MB","GB","TB"];let r=n/1024,c=0;for(;r>=1024&&c<i.length-1;)r/=1024,c+=1;return`${r.toFixed(r<10?1:0)} ${i[c]}`}function eu(n){if(n==null||n<0)return"—";const i=Math.floor(n/6e4);if(i<1)return"<1m";if(i<60)return`${i}m`;const r=Math.floor(i/60);return r<24?`${r}h ${i%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function gi(n){return n===null?"Unknown":n<0?`Expired ${Math.abs(n)} day${Math.abs(n)===1?"":"s"} ago`:n===0?"Expires today":`${n} day${n===1?"":"s"} left`}function R5(n){return n==null?"—":`${n.toFixed(1)}%`}function $n(n,i,r=`${i}s`){return`${n} ${n===1?i:r}`}function z5(n,i=48){if(n.length<=i)return n;const r=Math.ceil((i-1)/2),c=Math.floor((i-1)/2);return`${n.slice(0,r)}…${n.slice(-c)}`}const D5={personal:"Personal","windows-service":"Windows service",systemd:"systemd",unknown:"Unknown"},A5={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"},O5={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 M5(n){switch(n.backgroundService.mechanism){case"startup-supervisor":return"personal";case"winsw":return"windows-service";case"systemd":return"systemd";default:return"unknown"}}function _5(n){return n==="logon"?"At logon":n==="boot"?"At boot":"Unknown"}function L5(n){return n.jobsRunningHere?"This dashboard":n.jobsOwnerRole==="daemon"?"Background service":n.jobsOwnerRole==="dashboard"?"Another dashboard process":n.running?"Background service":"Paused — no owner"}function qr(n){if(!n)return null;const i=n.backgroundService,r=M5(n),c=i.startsAt==="logon"||i.startsAt==="boot"?i.startsAt:"unknown",d=i.runtime??null,f=i.stoppedAt??null,m=Array.from(new Set([...i.warnings??[],...d?.warnings??[]]));return{running:i.running,connected:i.connected,jobsRunningHere:i.jobsRunningHere,jobsOwnerLabel:L5(i),pid:i.pid,version:i.version,startedAt:i.startedAt,uptimeMs:i.startedAt?Math.max(0,Date.now()-i.startedAt):null,heartbeatAgeMs:i.heartbeatAgeMs??null,mechanism:r,mechanismLabel:D5[r],mechanismDetail:A5[r],startsAt:c,startsAtLabel:_5(c),installed:i.installed===!0,stoppedByUser:i.stoppedByUser===!0,stoppedAt:f,stoppedAtLabel:f?Ih(f):null,state:i.state??null,detail:i.detail??null,enabledOnBoot:i.enabledOnBoot??null,restarts:i.restarts??0,crashLooping:i.crashLooping===!0,dataDir:i.dataDir,installCommand:n.install.command,installGuidance:O5[r],runtime:d,warnings:m}}function _c(n){return n?n.running?"Running":n.stoppedByUser?"Stopped by you":n.installed?"Not running":"Not installed":"Unknown"}function U5(n){if(!n)return null;const i=n.pinned,r=i?.version??null,c=n.systemNode.version??null,d=!!(i&&i.kind!=="none"&&i.exists!==!1),f=d&&!!(r&&c)&&r===c&&!i?.differsFromSystem;return{serviceVersion:r,servicePath:i?.path??null,systemVersion:c,systemPath:n.systemNode.path??null,sameAsSystem:f,broken:i?.broken===!0,pinned:d,kind:i?.kind??null,manager:n.manager?.managed?n.manager.manager??null:null}}const H5={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"},Pb={neutral:"bg-faint",accent:"bg-accent",ok:"bg-ok",warn:"bg-warn",bad:"bg-bad",info:"bg-info"};function je({tone:n="neutral",children:i,className:r,dot:c=!1}){return a.jsxs("span",{className:oe("inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-2xs font-medium tracking-wide",H5[n],r),children:[c&&a.jsx("span",{className:oe("size-1.5 rounded-full",Pb[n]),"aria-hidden":"true"}),i]})}function ln({tone:n="ok",pulse:i=!1,className:r}){return a.jsx("span",{className:oe("inline-block size-2 shrink-0 rounded-full",Pb[n],i&&"live-dot",r),"aria-hidden":"true"})}const B5='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Fy({onNavigate:n}){const{service:i}=Br(),r=qr(i),c=r?r.running?{tone:"ok",label:"Service running"}:r.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:oe("flex h-[var(--ez-topbar-height)] shrink-0 items-center gap-2.5 border-b border-line px-4",n&&"pr-12"),children:[a.jsx(Zb,{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:Xb.map((d,f)=>a.jsxs("div",{className:oe(f>0&&"mt-5"),children:[a.jsx("div",{className:"mb-1.5 px-2 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:d.label}),a.jsx("div",{className:"space-y-0.5",children:d.items.map(m=>{const h=m.icon;return a.jsx(Nb,{to:m.to,end:m.to==="/",onClick:n,className:({isActive:g})=>oe("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)]",g?"bg-accent-soft text-ink":"text-muted hover:bg-inset hover:text-ink"),children:({isActive:g})=>a.jsxs(a.Fragment,{children:[a.jsx("span",{className:oe("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)]",g?"opacity-100":"opacity-0"),"aria-hidden":"true"}),a.jsx(h,{className:oe("size-4 shrink-0 transition-colors",g?"text-accent-text":"text-faint group-hover:text-muted"),"aria-hidden":"true"}),m.label]})},m.to)})})]},d.label))}),a.jsx("div",{className:"border-t border-line p-3",children:a.jsxs(kt,{to:"/processes",onClick:n,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: ${c.label}. Open Processes.`,children:[a.jsx(ln,{tone:c.tone,pulse:c.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:c.label})]})]})})]})}function $5({open:n,onClose:i}){const r=p.useRef(null),c=p.useRef(null);return p.useEffect(()=>{if(!n)return;const d=document.activeElement,f=document.body.style.overflow;document.body.style.overflow="hidden";const m=window.setTimeout(()=>c.current?.focus(),0),h=g=>{if(g.key==="Escape"){g.preventDefault(),i();return}if(g.key!=="Tab")return;const v=r.current;if(!v)return;const b=Array.from(v.querySelectorAll(B5)).filter(R=>R.offsetParent!==null);if(b.length===0)return;const x=b[0],j=b[b.length-1],S=document.activeElement;g.shiftKey&&(S===x||S===v)?(g.preventDefault(),j.focus()):!g.shiftKey&&S===j&&(g.preventDefault(),x.focus())};return document.addEventListener("keydown",h,!0),()=>{window.clearTimeout(m),document.removeEventListener("keydown",h,!0),document.body.style.overflow=f,d?.focus()}},[n,i]),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(Fy,{})}),n&&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:i,"aria-hidden":"true"}),a.jsxs("aside",{ref:r,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(ct,{ref:c,label:"Close navigation",size:"sm",onClick:i,className:"absolute right-2 top-2 z-10",children:a.jsx(Ms,{className:"size-4","aria-hidden":"true"})}),a.jsx(Fy,{onNavigate:i})]})]})]})}function q5(n){return n.type==="nginx_down"?gl:n.type==="cert_expiry"?as:n.type==="domain_health"?Mc:n.type==="deploy"?Tr:Kh}function G5(n){return n==="danger"?"text-bad":n==="warning"?"text-warn":n==="success"?"text-ok":n==="info"?"text-info":"text-muted"}function Y5(){const{notifications:n,unread:i,markAllRead:r,clearNotifications:c}=vn(),[d,f]=p.useState(!1),[,m]=p.useState(0),h=p.useRef(null),g=p.useRef(null);p.useEffect(()=>{if(!d)return;r();const b=j=>{h.current&&!h.current.contains(j.target)&&f(!1)},x=j=>{j.key==="Escape"&&(f(!1),g.current?.focus())};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",x),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",x)}},[d,r]),p.useEffect(()=>{d&&r()},[d,n.length,r]),p.useEffect(()=>{if(!d)return;const b=setInterval(()=>m(x=>x+1),3e4);return()=>clearInterval(b)},[d]);const v=i>0?`Notifications, ${i} unread`:"Notifications";return a.jsxs("div",{ref:h,className:"sm:relative",children:[a.jsxs("div",{className:"relative",children:[a.jsx(ct,{ref:g,label:v,onClick:()=>f(b=>!b),"aria-expanded":d,"aria-haspopup":"dialog","aria-controls":"notifications-panel",className:oe(d&&"bg-inset text-ink"),children:a.jsx(Gh,{className:"size-4.5","aria-hidden":"true"})}),i>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:i>9?"9+":i})]}),d&&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"}),n.length>0&&a.jsx("button",{type:"button",onClick:c,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:n.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[a.jsx(Gw,{className:"size-5 text-faint","aria-hidden":"true"}),a.jsx("div",{className:"text-xs text-muted",children:"All clear — no notifications yet."})]}):n.map(b=>{const x=q5(b);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(x,{className:oe("mt-0.5 size-4 shrink-0",G5(b.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:b.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:$r(b.timestamp)})]})]},b.id)})}),a.jsx("div",{className:"border-t border-line bg-raised/50 px-4 py-2",children:a.jsx(kt,{to:"/notifications",onClick:()=>f(!1),className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Open notification settings"})})]})]})}function V5({onMenu:n}){const{pathname:i}=qn(),{theme:r,toggleTheme:c}=Cb(),{nginxStatus:d,connected:f,connectionError:m}=vn(),{logout:h}=ja(),g=Et(),[v,b]=p.useState(!1),x=Kb(i)?.title??"Easy DevOps",j=d?.running===!0,S=d===null?"Unknown":j?"Running":"Stopped",R=async()=>{if(!v){b(!0);try{await h(),g.success("Signed out","Your dashboard session has ended.")}finally{b(!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(ct,{label:"Open navigation",size:"sm",onClick:n,className:"lg:hidden",children:a.jsx(WS,{className:"size-4.5","aria-hidden":"true"})}),a.jsx("div",{className:"truncate text-sm font-semibold text-ink",children:x})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1 sm:gap-1.5",children:[a.jsxs(kt,{to:"/nginx","aria-label":`Nginx is ${S.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(ln,{tone:d===null?"neutral":j?"ok":"bad",pulse:j&&f}),a.jsx("span",{className:"font-medium text-ink",children:"nginx"}),a.jsx("span",{className:"text-faint",children:S})]}),a.jsx(kt,{to:"/nginx","aria-label":`Nginx is ${S.toLowerCase()}. Open Nginx.`,className:"flex size-9 items-center justify-center rounded-md transition-colors hover:bg-inset sm:hidden",children:a.jsx(ln,{tone:d===null?"neutral":j?"ok":"bad",pulse:j&&f})}),a.jsxs("span",{className:"hidden items-center gap-1.5 pl-1 pr-2 text-2xs text-faint md:flex",title:m??(f?"Live updates are connected.":"Reconnecting to live updates…"),children:[a.jsx("span",{className:oe("size-1.5 rounded-full",m?"bg-bad":f?"bg-ok live-dot":"bg-faint"),"aria-hidden":"true"}),m?"Live blocked":f?"Live":"Connecting"]}),a.jsx(Y5,{}),a.jsx(ct,{label:r==="dark"?"Switch to light theme":"Switch to dark theme",onClick:c,children:r==="dark"?a.jsx($b,{className:"size-4.5","aria-hidden":"true"}):a.jsx(Mb,{className:"size-4.5","aria-hidden":"true"})}),a.jsx(ct,{label:"Sign out",onClick:R,disabled:v,className:"hover:text-bad",children:a.jsx(FS,{className:"size-4.5","aria-hidden":"true"})})]})]})}function et({className:n,children:i,...r}){return a.jsx("div",{className:oe("rounded-lg border border-line bg-surface shadow-card",n),...r,children:i})}function pn({title:n,description:i,actions:r,className:c,icon:d}){return a.jsxs("div",{className:oe("flex flex-wrap items-start justify-between gap-3 border-b border-line px-4 py-3.5 sm:px-5",c),children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[d&&a.jsx("div",{className:"mt-0.5 text-muted",children:d}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:n}),i&&a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i})]})]}),r&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]})}function xn({className:n,children:i,...r}){return a.jsx("div",{className:oe("px-4 py-4 sm:px-5",n),...r,children:i})}function Ec({className:n,children:i}){return a.jsx("div",{className:oe("flex flex-wrap items-center justify-between gap-2 border-t border-line bg-raised/50 px-4 py-3 sm:px-5",n),children:i})}function _s({className:n}){return a.jsx(gn,{className:oe("spin size-4 text-muted",n),"aria-hidden":"true"})}function tt({className:n}){return a.jsx("div",{className:oe("skeleton",n),"aria-hidden":"true"})}function ns({children:n}){return a.jsx("div",{className:"page-enter space-y-5","aria-busy":"true","aria-label":"Loading",children:n})}function X5(){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(gn,{className:"spin size-5 text-accent-text","aria-hidden":"true"}),a.jsx("span",{className:"text-sm",children:"Loading Easy DevOps…"})]})})}function ga({title:n,description:i,action:r,icon:c,className:d}){return a.jsxs("div",{className:oe("flex flex-col items-center justify-center px-6 py-12 text-center",d),children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-inset text-faint",children:c??a.jsx(US,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-medium text-ink",children:n}),i&&a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:i}),r&&a.jsx("div",{className:"mt-4",children:r})]})}function ve({tone:n="info",title:i,children:r,action:c,className:d}){const f={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"}[n],m={info:Ob,warning:fl,danger:fl,success:ts}[n];return a.jsx("div",{className:oe("rounded-md border px-3.5 py-3 text-xs",f,d),role:"status",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(m,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 text-muted",children:[i&&a.jsx("div",{className:"font-medium text-ink",children:i}),r&&a.jsx("div",{className:oe(i?"mt-0.5":void 0,"break-words"),children:r})]}),c&&a.jsx("div",{className:"shrink-0",children:c})]})})}function $t({error:n,onRetry:i,title:r,className:c}){const d=n instanceof He?n:null,f=d?.status===403,m=typeof d?.payload?.detail=="string"?d.payload.detail:void 0,h=d?.message??(n instanceof Error?n.message:"Something went wrong while loading this section.");return a.jsx(et,{className:oe("border-bad/25",c),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:f?a.jsx(as,{className:"size-5","aria-hidden":"true"}):a.jsx(fl,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-semibold text-ink",children:r??(f?"Request blocked":"Could not load this section")}),a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:h}),m&&a.jsx("p",{className:"mt-1 max-w-md break-all font-mono text-2xs text-faint",children:m}),d&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",d.status,d.code?` · ${d.code}`:""]}),i&&a.jsx(se,{className:"mt-4",variant:"secondary",size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:i,children:"Try again"})]})})}const Jy="ez-service-banner-dismissed";function Wf({children:n}){return a.jsx("code",{className:"font-mono text-ink",children:n})}function K5(n){return n.startsAt==="logon"?"at your next logon":n.startsAt==="boot"?"at the next boot":"when the service starts"}function Z5(n){return n.running?{code:"running",tone:"info",title:"Background service is running",body:"This dashboard is the interface only.",action:"Open Processes"}:n.stoppedByUser?{code:"stopped_by_user",tone:"warning",title:"The background service is stopped",body:a.jsxs(a.Fragment,{children:["You stopped it",n.stoppedAtLabel?` on ${n.stoppedAtLabel}`:"",", so monitoring and notifications are paused. It starts again ",K5(n),", or run"," ",a.jsx(Wf,{children:"ezz service start"})," to start it now."]}),action:"Open Processes"}:{code:"not_running",tone:"warning",title:"The background service is not running",body:n.installed?a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Start the service with ",a.jsx(Wf,{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(Wf,{children:n.installCommand}),"."]}),action:"Open Processes"}}function Q5(){const{service:n}=Br(),{pathname:i}=qn(),[r,c]=p.useState(()=>{try{return sessionStorage.getItem(Jy)}catch{return null}}),d=qr(n),f=d?Z5(d):null,m=i!=="/processes",h=p.useMemo(()=>!d||!f?"":[f.code,d.pid,d.startedAt,d.stoppedByUser,d.stoppedAt,d.startsAt,d.installed].join("|"),[d,f]);if(!d||!f||r===h)return null;const g=()=>{c(h);try{sessionStorage.setItem(Jy,h)}catch{}};return a.jsx("div",{className:"fade-enter mb-5",children:a.jsx(ve,{tone:f.tone,title:f.title,action:a.jsxs("div",{className:"flex items-center gap-1",children:[m&&a.jsxs(kt,{to:"/processes",className:oe("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:[f.action,a.jsx(vi,{className:"size-3","aria-hidden":"true"})]}),a.jsx(ct,{label:"Dismiss banner",size:"sm",onClick:g,children:a.jsx(Ms,{className:"size-3.5","aria-hidden":"true"})})]}),children:f.body})})}const I5={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 P5(){const{blocked:n,dismissBlocked:i}=ja();if(!n)return null;const r=n.blockedReason,c=typeof n.payload.detail=="string"?n.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(as,{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:r?I5[r]??"The dashboard refused this request.":n.message}),c&&a.jsx("div",{className:"mt-1 break-all font-mono text-2xs text-faint",children:c}),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(se,{variant:"ghost",size:"sm",onClick:i,className:"-mr-1 -mt-1 shrink-0",children:"Dismiss"})]})})}class F5 extends p.Component{state={error:null};static getDerivedStateFromError(i){return{error:i}}componentDidCatch(i,r){console.error(`[ui] ${this.props.area??"page"} crashed`,i,r.componentStack)}render(){return this.state.error?a.jsx(et,{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(as,{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(se,{className:"mt-4",size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>this.setState({error:null}),children:"Try again"})]})}):this.props.children}}function J5(){const[n,i]=p.useState(!1),{pathname:r}=qn(),c=p.useRef(null),d=p.useCallback(()=>i(!1),[]);p.useEffect(()=>{i(!1),c.current?.scrollTo({top:0}),c.current?.focus({preventScroll:!0})},[r]),p.useEffect(()=>{const m=window.matchMedia("(min-width: 1024px)"),h=()=>{m.matches&&i(!1)};return m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]);const f=Kb(r);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($5,{open:n,onClose:d}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx(V5,{onMenu:()=>i(!0)}),a.jsx("main",{ref:c,id:"main-content",tabIndex:-1,className:"min-h-0 flex-1 overflow-y-auto outline-none",children:a.jsxs("div",{className:"relative isolate 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("div",{className:"dashboard-ambient -z-10","aria-hidden":"true"}),a.jsx(Q5,{}),a.jsx(P5,{}),a.jsx("div",{className:"page-enter",children:a.jsx(F5,{area:f?.title,children:a.jsx(Y2,{})})},r)]})}),a.jsxs("footer",{className:"shrink-0 border-t border-line bg-canvas px-3 py-1.5 text-center text-[10px] text-faint sm:px-5",children:["© ",Qb()," Easy DevOps · provided by"," ",a.jsx("a",{href:"https://devxor.team",target:"_blank",rel:"noopener noreferrer",className:"text-muted underline-offset-2 transition-colors hover:text-ink hover:underline",children:"DevXor Team"})]})]})]})}function W5(){const{bootError:n,retryBoot:i}=ja(),[r,c]=p.useState(!1),d=async()=>{c(!0),await i(),c(!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(ik,{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:[n?.message??"The dashboard did not answer."," Check that Easy DevOps is running, then try again."]}),n&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",n.status===0?"connection failed":n.status]}),a.jsx(se,{variant:"primary",loading:r,onClick:d,icon:a.jsx(Ct,{className:"size-4","aria-hidden":"true"}),className:"mt-5",children:"Try again"})]})})}const Ph="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",tu="border-bad/60 hover:border-bad focus:border-bad focus:ring-bad/25";function nu({htmlFor:n,children:i,optional:r,trailing:c}){return a.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between gap-2",children:[a.jsxs("label",{htmlFor:n,className:"flex items-baseline gap-2 text-xs font-medium text-muted",children:[a.jsx("span",{children:i}),r&&a.jsx("span",{className:"text-2xs font-normal text-faint",children:"Optional"})]}),c]})}function au({id:n,children:i}){return a.jsx("p",{id:n,className:"mt-1.5 text-xs text-bad",role:"alert",children:i})}function ml({id:n,children:i}){return a.jsx("p",{id:n,className:"mt-1.5 text-xs text-faint",children:i})}function Me({label:n,hint:i,error:r,optional:c,trailing:d,id:f,className:m,...h}){const g=p.useId(),v=f??g,b=`${v}-error`,x=`${v}-hint`;return a.jsxs("div",{className:m,children:[n&&a.jsx(nu,{htmlFor:v,optional:c,children:n}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{id:v,className:oe(Ph,"h-9",!!d&&"pr-10",r&&tu),"aria-invalid":r?!0:void 0,"aria-describedby":r?b:i?x:void 0,...h}),d&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-1.5",children:d})]}),r?a.jsx(au,{id:b,children:r}):i?a.jsx(ml,{id:x,children:i}):null]})}function Lc({label:n,hint:i,error:r,optional:c,id:d,className:f,...m}){const h=p.useId(),g=d??h,v=`${g}-error`,b=`${g}-hint`;return a.jsxs("div",{className:f,children:[n&&a.jsx(nu,{htmlFor:g,optional:c,children:n}),a.jsx("textarea",{id:g,className:oe(Ph,"min-h-24 py-2 leading-relaxed",r&&tu),"aria-invalid":r?!0:void 0,"aria-describedby":r?v:i?b:void 0,...m}),r?a.jsx(au,{id:v,children:r}):i?a.jsx(ml,{id:b,children:i}):null]})}function pa({label:n,hint:i,error:r,optional:c,id:d,className:f,children:m,...h}){const g=p.useId(),v=d??g,b=`${v}-error`,x=`${v}-hint`;return a.jsxs("div",{className:f,children:[n&&a.jsx(nu,{htmlFor:v,optional:c,children:n}),a.jsx("select",{id:v,className:oe(Ph,"h-9 cursor-pointer pr-8",r&&tu),"aria-invalid":r?!0:void 0,"aria-describedby":r?b:i?x:void 0,...h,children:m}),r?a.jsx(au,{id:b,children:r}):i?a.jsx(ml,{id:x,children:i}):null]})}function eC({label:n,hint:i,error:r,optional:c,value:d,onChange:f,normalize:m,max:h,placeholder:g,className:v,id:b}){const x=p.useId(),j=b??x,[S,R]=p.useState(""),[k,C]=p.useState(null),z=`${j}-error`,w=`${j}-hint`,O=k??r??null,E=()=>{const M=S.trim();if(!M)return;let Y=d;for(const A of M.split(/[\n,]/)){if(!A.trim())continue;const H=m(A,Y);if(H.error||!H.value){C(H.error??"This path cannot be added."),R(A.trim());return}Y.includes(H.value)||(Y=[...Y,H.value])}f(Y),R(""),C(null)};return a.jsxs("div",{className:v,children:[n&&a.jsx(nu,{htmlFor:j,optional:c,trailing:h?a.jsxs("span",{className:"text-2xs font-normal text-faint",children:[d.length,"/",h]}):void 0,children:n}),a.jsxs("div",{className:oe("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-canvas px-2 py-1.5 transition-colors duration-[var(--ez-motion-fast)]",O?tu:"border-line hover:border-line-strong focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/25"),children:[d.map(M=>a.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded-sm border border-line bg-inset py-0.5 pl-2 pr-1 font-mono text-xs text-ink",children:[a.jsx("span",{className:"truncate",children:M}),a.jsx("button",{type:"button",onClick:()=>{f(d.filter(Y=>Y!==M)),C(null)},className:"shrink-0 rounded-sm p-0.5 text-faint transition-colors hover:bg-canvas hover:text-bad focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50","aria-label":`Remove ${M}`,children:a.jsx(Ms,{className:"size-3","aria-hidden":"true"})})]},M)),a.jsx("input",{id:j,value:S,onChange:M=>{R(M.target.value),k&&C(null)},onKeyDown:M=>{(M.key==="Enter"||M.key===",")&&(M.preventDefault(),E()),M.key==="Backspace"&&!S&&d.length>0&&f(d.slice(0,-1))},onBlur:E,placeholder:d.length===0?g:void 0,"aria-invalid":O?!0:void 0,"aria-describedby":O?z:i?w:void 0,className:"h-6 min-w-24 flex-1 bg-transparent font-mono text-sm text-ink placeholder:text-faint focus:outline-none",spellCheck:!1,autoComplete:"off"}),a.jsx("button",{type:"button",onClick:E,disabled:!S.trim(),className:"shrink-0 rounded-sm p-1 text-faint transition-colors hover:bg-inset hover:text-ink focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:pointer-events-none disabled:opacity-40","aria-label":"Add path",children:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"})})]}),O?a.jsx(au,{id:z,children:O}):i?a.jsx(ml,{id:w,children:i}):null]})}function pl({label:n,hint:i,checked:r,onChange:c,disabled:d,className:f,id:m}){const h=p.useId(),g=m??h;return a.jsxs("div",{className:oe("flex items-start gap-2.5",f),children:[a.jsx("input",{id:g,type:"checkbox",checked:r,disabled:d,onChange:v=>c(v.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:g,className:oe("cursor-pointer text-sm text-ink",d&&"cursor-not-allowed opacity-60"),children:n}),i&&a.jsx("p",{className:"mt-0.5 text-xs text-faint",children:i})]})]})}function Zt({checked:n,onChange:i,label:r,ariaLabel:c,description:d,disabled:f,className:m}){const h=p.useId();return a.jsxs("div",{className:oe("flex items-start justify-between gap-4",m),children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{id:h,className:"text-sm text-ink",children:r}),d&&a.jsx("div",{className:"mt-0.5 text-xs text-faint",children:d})]}),a.jsx("button",{type:"button",role:"switch","aria-checked":n,"aria-labelledby":c?void 0:h,"aria-label":c,disabled:f,onClick:()=>i(!n),className:oe("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",n?"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:oe("inline-block size-3.5 rounded-full bg-white shadow-sm transition-transform duration-[var(--ez-motion-fast)]",n?"translate-x-[18px]":"translate-x-[3px]")})})]})}function Ja({children:n,className:i}){return a.jsx("div",{className:oe("grid gap-4 sm:grid-cols-2",i),children:n})}const tC=["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"],nC="This code has expired. Get a new one with: ezz dashboard setup-code";function Wy(n){return n?.setupCodeRequired!==!0?!1:n.setupCodeExpiresAt===null||n.setupCodeExpiresAt<=Date.now()}function ev({compact:n=!1}){return a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(Zb,{className:"h-6"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold tracking-tight text-ink",children:"Easy DevOps"}),!n&&a.jsx("div",{className:"text-2xs text-faint",children:"Server control plane"})]})]})}function aC({children:n}){const{theme:i,toggleTheme:r}=Cb();return a.jsxs("div",{className:"relative flex min-h-full flex-col 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 my-auto grid w-full max-w-4xl self-center 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(ev,{}),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:tC.map(c=>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(dl,{className:"size-2.5","aria-hidden":"true"})}),c]},c))})]}),a.jsxs("div",{className:"flex items-center gap-2 text-2xs text-faint",children:[a.jsx(Yh,{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(ev,{compact:!0})}),a.jsx(ct,{label:i==="dark"?"Switch to light theme":"Switch to dark theme",onClick:r,children:i==="dark"?a.jsx($b,{className:"size-4.5","aria-hidden":"true"}):a.jsx(Mb,{className:"size-4.5","aria-hidden":"true"})})]}),n]})]}),a.jsxs("footer",{className:"relative py-4 text-center text-2xs text-faint",children:["© ",Qb()," Easy DevOps · provided by"," ",a.jsx("a",{href:"https://devxor.team",target:"_blank",rel:"noopener noreferrer",className:"text-muted underline-offset-2 transition-colors hover:text-ink hover:underline",children:"DevXor Team"})]})]})}function Fb({show:n,onToggle:i}){return a.jsx(ct,{label:n?"Hide password":"Show password",size:"sm",onClick:i,className:"text-faint hover:text-ink",children:n?a.jsx(bS,{className:"size-4","aria-hidden":"true"}):a.jsx(NS,{className:"size-4","aria-hidden":"true"})})}function Jb({error:n,cooldown:i=0}){if(!n)return null;const r=typeof n.payload.hint=="string"?n.payload.hint:void 0,c=Wb(n),d=i>0?i:c;return a.jsx(ve,{tone:"danger",title:c===null?n.message:"Too many attempts",className:"mb-4",children:r??(d===null?void 0:i>0?`Try again in ${sC(d)}.`:"You can try again now.")})}function Wb(n){if(n?.status!==429)return null;const i=n.payload.retryAfterSeconds;return typeof i!="number"||!Number.isFinite(i)||i<=0?null:Math.ceil(i)}function sC(n){return n>=120?`${Math.ceil(n/60)} minutes`:n>=60?"1 minute":`${n} second${n===1?"":"s"}`}function e0(){const[n,i]=p.useState(0);return p.useEffect(()=>{if(n<=0)return;const c=window.setTimeout(()=>i(d=>Math.max(0,d-1)),1e3);return()=>window.clearTimeout(c)},[n]),{remaining:n,start:c=>{const d=Wb(c);d!==null&&i(d)}}}function lC(){const{login:n,retryBoot:i,sessionMessage:r}=ja(),[c,d]=p.useState(""),[f,m]=p.useState(!1),[h,g]=p.useState(null),[v,b]=p.useState(null),[x,j]=p.useState(!1),S=e0(),R=S.remaining,k=async C=>{if(C.preventDefault(),!(R>0)){if(!c){g("Enter your password.");return}g(null),b(null),j(!0);try{await n(c)}catch(z){const w=z instanceof He?z:null;if(w?.payload.needsSetup){await i();return}if(w?.status===409){await i();return}w?.status===429&&S.start(w),b(w)}finally{j(!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."})]}),r&&a.jsx(ve,{tone:"info",title:"You were signed out",className:"mb-4",children:r}),a.jsx(Jb,{error:v,cooldown:R}),a.jsxs("form",{onSubmit:k,noValidate:!0,children:[a.jsx(Me,{label:"Password",type:f?"text":"password",value:c,onChange:C=>{d(C.target.value),h&&g(null)},error:h,autoComplete:"current-password",autoFocus:!0,trailing:a.jsx(Fb,{show:f,onToggle:()=>m(C=>!C)})}),a.jsxs(se,{type:"submit",variant:"primary",size:"lg",loading:x,disabled:R>0,className:"mt-5 w-full",children:[R>0?`Try again in ${R}s`:"Sign in",!x&&R===0&&a.jsx(vi,{className:"size-4","aria-hidden":"true"})]})]})]})}function iC(){const{auth:n,setup:i,retryBoot:r}=ja(),c=n?.minPasswordLength??8,d=n?.canUseNoPassword===!0,f=n?.setupCodeRequired===!0,m=Wy(n),[h,g]=p.useState("password"),[v,b]=p.useState(""),[x,j]=p.useState(""),[S,R]=p.useState(""),[k,C]=p.useState(!1),[z,w]=p.useState({}),[O,E]=p.useState(null),[M,Y]=p.useState(!1),A=e0(),H=A.remaining,W=async I=>{if(I.preventDefault(),H>0)return;const ne={};if(f&&!v.trim()&&(ne.code="Enter the setup code shown by the server."),h==="password"&&(x.length<c&&(ne.password=`Use at least ${c} characters.`),S!==x&&(ne.confirm="The two passwords do not match.")),w(ne),!(Object.keys(ne).length>0)){E(null),Y(!0);try{if(h==="none")await i({mode:"none"});else{const J=v.trim();await i({password:x,mode:"password",...J?{setupCode:J}:{}})}}catch(J){const Z=J instanceof He?J:null;if(Z?.status===409){await r();return}if(Z?.status===400&&Wy(n)){E(null);return}Z?.status===429&&A.start(Z),E(Z)}finally{Y(!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(Jb,{error:O,cooldown:H}),a.jsxs("form",{onSubmit:W,noValidate:!0,children:[a.jsxs("div",{className:oe("grid gap-2",d&&"grid-cols-2"),role:"group","aria-label":"Authentication method",children:[a.jsxs("button",{type:"button","aria-pressed":h==="password",onClick:()=>g("password"),className:oe("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(Ur,{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."})]}),d&&a.jsxs("button",{type:"button","aria-pressed":h==="none",onClick:()=>g("none"),className:oe("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(Rk,{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."})]})]}),f&&m&&a.jsx(ve,{tone:"warning",title:nC,className:"mt-4",children:"Run that on the server, then reload this page to enter the new code."}),f&&a.jsx(Me,{className:"mt-4",label:"Setup code",value:v,onChange:I=>{b(I.target.value),z.code&&w(ne=>({...ne,code:void 0}))},error:z.code,hint:"Printed in the terminal where the dashboard was started.",autoComplete:"one-time-code"}),h==="password"?a.jsxs(a.Fragment,{children:[a.jsx(Me,{className:"mt-4",label:"Password",type:k?"text":"password",value:x,onChange:I=>{j(I.target.value),z.password&&w(ne=>({...ne,password:void 0}))},error:z.password,hint:`At least ${c} characters. Stored as a scrypt hash on this server.`,autoComplete:"new-password",autoFocus:!f,trailing:a.jsx(Fb,{show:k,onToggle:()=>C(I=>!I)})}),a.jsx(Me,{className:"mt-4",label:"Confirm password",type:k?"text":"password",value:S,onChange:I=>{R(I.target.value),z.confirm&&w(ne=>({...ne,confirm:void 0}))},error:z.confirm,autoComplete:"new-password"})]}):a.jsxs(ve,{tone:"warning",title:"The dashboard will have no password",className:"mt-4",children:["Anyone who can reach ",n?.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(se,{type:"submit",variant:"primary",size:"lg",loading:M,disabled:H>0,className:"mt-5 w-full",children:[H>0?`Try again in ${H}s`:h==="password"?"Save password and sign in":"Start without a password",!M&&H===0&&a.jsx(vi,{className:"size-4","aria-hidden":"true"})]})]})]})}function rC(){const{auth:n,retryBoot:i}=ja(),[r,c]=p.useState(!1),d=async()=>{c(!0),await i(),c(!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:n?.bindAddress??"this machine"}),"."]})]}),a.jsxs(se,{variant:"primary",size:"lg",loading:r,onClick:d,className:"w-full",children:["Continue to dashboard",!r&&a.jsx(vi,{className:"size-4","aria-hidden":"true"})]})]})}function oC(){const{auth:n}=ja();return ba(n?.needsSetup?"Set up this dashboard":n?.authMode==="none"?"Open the dashboard":"Sign in"),a.jsxs(aC,{children:[n?.needsSetup?a.jsx(iC,{}):n?.authMode==="none"?a.jsx(rC,{}):a.jsx(lC,{}),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(Yh,{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:n?.bindAddress??"…"})]})]}),a.jsx("span",{children:"Easy DevOps"})]}),!1]})]})}function bi(n,i){const{lastChange:r,changeSeq:c}=vn(),d=p.useRef(i);d.current=i,p.useEffect(()=>{if(!r)return;(Array.isArray(n)?n:[n]).includes(r.section)&&d.current()},[c])}function La({title:n,description:i,actions:r,meta:c,eyebrow:d}){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:[d&&a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:d}),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:n}),c]}),i&&a.jsx("p",{className:"mt-1 max-w-2xl text-sm text-muted",children:i})]}),r&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]})}function cC(n){return Promise.all([fe.domains.list(n),fe.ssl.list(n),fe.nginx.status(n)]).then(([i,r,c])=>({domains:i,certs:r,nginx:c}))}const uC={neutral:"text-muted",accent:"text-accent-text",ok:"text-ok",warn:"text-warn",bad:"text-bad",info:"text-info"},dC={neutral:"border-line/70 bg-inset text-muted group-hover:text-ink",accent:"border-accent/25 bg-accent-soft text-accent-text",ok:"border-ok/25 bg-ok-soft text-ok",warn:"border-warn/25 bg-warn-soft text-warn",bad:"border-bad/25 bg-bad-soft text-bad",info:"border-info/25 bg-info-soft text-info"};function yc({label:n,value:i,hint:r,icon:c,tone:d="neutral",pulse:f=!1,to:m}){return a.jsx(kt,{to:m,className:"group block rounded-lg",children:a.jsxs(et,{className:"stat-card h-full px-4 py-3.5",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:n}),a.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[a.jsx("span",{className:oe("text-2xl font-semibold tracking-tight",uC[d]),children:i}),(d==="ok"||d==="bad"||d==="warn")&&a.jsx(ln,{tone:d,pulse:f})]})]}),a.jsx("div",{className:oe("flex size-9 shrink-0 items-center justify-center rounded-lg border transition-transform duration-[var(--ez-motion-base)] group-hover:scale-105",dC[d]),children:a.jsx(c,{className:"size-4","aria-hidden":"true"})})]}),a.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a.jsx("div",{className:"truncate text-2xs text-muted",children:r}),a.jsxs("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-2xs font-medium text-faint opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",children:["Open",a.jsx(Hw,{className:"size-3","aria-hidden":"true"})]})]})]})})}function fC(n,i,r,c){const d=[];n&&!n.running&&d.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 f of r)f.status==="unreadable"||f.status==="error"?d.push({id:`cert-error-${f.domain}`,tone:"bad",title:`Certificate for ${f.domain} cannot be read`,detail:"The certificate files are missing or unreadable.",to:"/ssl"}):f.status==="expired"||f.daysLeft!==null&&f.daysLeft<0?d.push({id:`cert-expired-${f.domain}`,tone:"bad",title:`Certificate for ${f.domain} has expired`,detail:gi(f.daysLeft),to:"/ssl"}):f.status==="expiring"&&d.push({id:`cert-expiring-${f.domain}`,tone:"warn",title:`Certificate for ${f.domain} expires soon`,detail:gi(f.daysLeft),to:"/ssl"});for(const f of i)c.get(f.name)?.up===!1&&d.push({id:`domain-down-${f.name}`,tone:"bad",title:`${f.name} is not responding`,detail:`The backend ${f.backendHost}:${f.port} did not answer a health check.`,to:"/domains"});return d}function hC({entry:n}){return n?n.up===null?a.jsx(je,{tone:"neutral",dot:!0,children:"External"}):n.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 mC({days:n}){const i=n<=0?"bg-bad":n<30?"bg-warn":"bg-ok",r=n<=0?100:Math.max(8,Math.min(n,90)/90*100);return a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:oe("text-2xs tabular-nums",n<30?"text-warn":"text-muted"),children:gi(n)}),a.jsx("span",{className:"h-1 w-10 shrink-0 overflow-hidden rounded-full bg-inset","aria-hidden":"true",children:a.jsx("span",{className:oe("block h-full rounded-full",i),style:{width:`${r}%`}})})]})}function pC(n){return n.type==="nginx_down"?{icon:gl,tone:"text-muted"}:n.type==="cert_expiry"?{icon:as,tone:"text-warn"}:n.type==="domain_health"?{icon:Mc,tone:"text-info"}:{icon:Mc,tone:"text-muted"}}function xC(){ba("Overview");const n=Et(),i=rn(),{nginxStatus:r,domainHealth:c,notifications:d}=vn(),{service:f}=Br(),m=qr(f),h=Tt(cC),[g,v]=p.useState(!1);yl(h.reload),bi(["domains","ssl","nginx"],h.reload);const b=h.data,x=r??b?.nginx??null,j=b?.domains??[],S=b?.certs??[],R=new Map((c??[]).map(A=>[A.name,A])),k=j.filter(A=>A.enabled).length,C=S.filter(A=>A.status==="expiring"),z=S.filter(A=>A.status==="expired"||A.status==="unreadable"||A.status==="error"),w=b?fC(x,j,S,R):[],O=w.filter(A=>A.tone==="bad").length,E=b!==null&&x?.running===!0&&w.length===0,M=z.length>0?`${$n(z.length,"certificate")} expired or unreadable`:C.length>0?`${C.length} expiring within 30 days`:S.length>0?"All certificates healthy":"No certificates yet",Y=async()=>{if(await i({title:"Reload nginx?",body:"Reloading applies configuration changes. Existing connections are kept open.",confirmLabel:"Reload nginx"})){v(!0);try{const H=await fe.nginx.reload();H.success?(n.success("Nginx reloaded",H.output.trim()||"Configuration reloaded."),h.reload()):n.error("Nginx reload failed",H.output.trim()||"nginx refused the reload.")}catch(H){n.error("Nginx reload failed",H instanceof He?H.message:"The dashboard could not complete the reload.")}finally{v(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Overview",description:"The state of nginx, your domains and their certificates, live.",actions:a.jsx(se,{variant:"secondary",size:"sm",loading:h.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:h.reload,children:"Refresh"})}),h.error&&!b?a.jsx($t,{error:h.error,onRetry:h.reload}):b?a.jsxs("div",{className:"space-y-4",children:[h.error&&a.jsx(ve,{tone:"warning",title:"Showing the last known state",action:a.jsx(se,{variant:"ghost",size:"sm",onClick:h.reload,children:"Try again"}),children:h.error.message}),a.jsxs(et,{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:oe("relative isolate mt-0.5 flex size-11 shrink-0 items-center justify-center rounded-full border",O>0?"border-bad/30 bg-bad-soft text-bad":w.length>0?"border-warn/30 bg-warn-soft text-warn":"border-ok/30 bg-ok-soft text-ok"),children:[a.jsx("span",{className:oe("pointer-events-none absolute -inset-3 -z-10 rounded-full blur-lg",O>0?"bg-bad/25":w.length>0?"bg-warn/25":"bg-ok/25"),"aria-hidden":"true"}),O>0||w.length>0?a.jsx(fl,{className:"size-5","aria-hidden":"true"}):a.jsx(ts,{className:"size-5","aria-hidden":"true"}),a.jsx("span",{className:oe("absolute -inset-px rounded-full border",O>0?"border-bad/20":w.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:O>0?"Attention needed":w.length>0?"A few things to check":"All systems healthy"}),a.jsxs("div",{className:"mt-0.5 text-xs text-muted",children:[x?.running?"nginx running":"nginx stopped"," · ",$n(j.length,"domain")," · ",$n(S.length,"certificate"),w.length>0&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("span",{className:O>0?"text-bad":"text-warn",children:[$n(w.length,"item")," need attention"]})]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-3 sm:flex-col sm:items-end",children:[a.jsx(je,{tone:E?"ok":O>0?"bad":"warn",dot:!0,children:E?"Healthy":O>0?"Degraded":"Check"}),a.jsxs("span",{className:"text-2xs text-faint",children:["Checked ",b.nginx?"live":"—",x?.version?` · ${x.version}`:""]})]})]})]}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[a.jsx(yc,{label:"Nginx",value:x?x.running?"Active":"Offline":"Unknown",hint:x?.running?`PID ${x.pid??"—"}${x.version?` · ${x.version}`:""}`:"Traffic is not being proxied.",icon:gl,tone:x?x.running?"ok":"bad":"neutral",pulse:x?.running===!0,to:"/nginx"}),a.jsx(yc,{label:"Domains",value:`${k}/${j.length}`,hint:j.length===0?"No domains configured yet.":k===j.length?"All domains enabled.":`${j.length-k} disabled.`,icon:Os,tone:j.length===0?"neutral":k>0?"accent":"warn",to:"/domains"}),a.jsx(yc,{label:"Certificates",value:String(S.length),hint:M,icon:Rn,tone:z.length>0?"bad":C.length>0?"warn":S.length>0?"ok":"neutral",to:"/ssl"}),a.jsx(yc,{label:"Background service",value:m?m.running?"Running":"Stopped":"Unknown",hint:m?m.running?m.startsAt==="unknown"?m.mechanismDetail:`${m.mechanismLabel} · starts ${m.startsAtLabel.toLowerCase()}`:m.stoppedByUser?m.installed?`You stopped it${m.stoppedAtLabel?` on ${m.stoppedAtLabel}`:""}; it starts again automatically.`:"You stopped it; start it to resume monitoring.":m.installed?"Monitoring runs in this window.":"Not installed; monitoring runs in this window.":"Checking…",icon:Rb,tone:m?m.running?"ok":"warn":"neutral",pulse:m?.running===!0,to:"/processes"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(kt,{to:"/domains?new=1",className:ma("primary","sm"),children:[a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),"Add domain"]}),a.jsxs(kt,{to:"/ssl?new=1",className:ma("secondary","sm"),children:[a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),"Issue certificate"]}),a.jsx(se,{variant:"secondary",size:"sm",loading:g,disabled:!x?.running,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:Y,children:"Reload nginx"})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsxs(et,{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(kt,{to:"/domains",className:"text-2xs font-medium text-muted hover:text-ink",children:"Manage"})]}),j.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[a.jsx(Os,{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(kt,{to:"/domains?new=1",className:ma("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:j.map(A=>{const H=R.get(A.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(kt,{to:`/domains?domain=${encodeURIComponent(A.name)}`,className:"flex items-center gap-2 font-medium text-ink hover:text-accent-text",children:[a.jsx("span",{className:"truncate",children:A.name}),!A.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:[A.backendHost,":",A.port]}),a.jsx("td",{className:"px-3 py-2.5",children:a.jsx(hC,{entry:H})}),a.jsx("td",{className:"hidden px-3 py-2.5 text-2xs md:table-cell",children:A.ssl.enabled?A.daysLeft!==null?a.jsx(mC,{days:A.daysLeft}):a.jsx("span",{className:"text-muted",children:"Unknown"}):a.jsx("span",{className:"text-faint",children:"Not enabled"})})]},A.name)})})]})}),c===null&&j.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(et,{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:w.length})]}),w.length===0?a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-5 text-xs text-muted",children:[a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}),"Nothing needs attention right now."]}):a.jsx("div",{className:"max-h-[280px] overflow-y-auto",children:w.map(A=>a.jsxs(kt,{to:A.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(ln,{tone:A.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:A.title}),a.jsx("div",{className:"mt-0.5 text-2xs text-muted",children:A.detail})]}),a.jsx(eS,{className:"mt-0.5 size-3.5 shrink-0 text-faint transition-transform group-hover:translate-x-0.5","aria-hidden":"true"})]},A.id))})]}),a.jsxs(et,{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(kt,{to:"/notifications",className:"text-2xs font-medium text-muted hover:text-ink",children:"All events"})]}),d.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",{className:"event-timeline",children:d.slice(0,6).map(A=>{const{icon:H,tone:W}=pC(A);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("span",{className:"relative z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-line bg-raised",children:a.jsx(H,{className:oe("size-3",W),"aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs leading-snug text-ink",children:A.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:$r(A.timestamp)})]})]},A.id)})})]})]})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{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(A=>a.jsx(tt,{className:"h-[92px] rounded-lg"},A))}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsx(tt,{className:"h-64 rounded-lg xl:col-span-2"}),a.jsx(tt,{className:"h-64 rounded-lg"})]})]})]})}function Fh(n){if(!n||!n.trim())return"A domain name is required.";const r=(n.startsWith("*.")?n.slice(2):n).split(".");if(r.length<2)return"Use at least two labels, for example example.com.";const c=/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/;return r.some(d=>!d||!c.test(d))?"Use letters, digits and hyphens only; each label must start and end with a letter or digit.":null}function su(n){const i=Number(n);return!Number.isInteger(i)||i<1||i>65535?"Port must be a whole number between 1 and 65535.":null}function t0(n){return n&&(!n.includes("@")||n.trim()!==n)?"Enter a valid email address.":null}function gC(n){return n?/^\d+[kmgKMG]?$/.test(n)?null:"Use a size like 10m, 1g or 512k.":null}function vr(n,i){const r=Number(n);return!Number.isInteger(r)||r<1?`${i} must be a positive whole number.`:null}function tv(n,i){return n?n.length<i?`Use at least ${i} characters.`:null:"Enter a password."}const yC=2048,nv=/^[A-Za-z0-9._~-]{1,200}$/;function vC(n){if(!n)return"The Hub URL is missing.";if(n!==n.trim())return"The Hub URL must not have spaces around it.";if(n.includes("://")&&!/^https?:\/\//i.test(n))return"The Hub URL must use http or https.";const i=/^https?:\/\//i.test(n)?n:`https://${n}`;let r;try{r=new URL(i)}catch{return"The Hub URL is not valid."}return r.protocol!=="http:"&&r.protocol!=="https:"?"The Hub URL must use http or https.":r.hostname?r.username||r.password?"The Hub URL must not contain credentials.":null:"The Hub URL is missing a host."}function bC(n){const i=n.trim();if(!i)return"Paste the connection string the Hub gave you.";if(i.length>yC)return"That connection string is too long.";if(!i.toLowerCase().startsWith("ezops://"))return"The connection string must start with ezops://.";const r=i.slice(8).split("|");if(r.length!==3)return"Expected the form ezops://hubUrl|serverId|secret.";const[c,d,f]=r.map(h=>h.trim()),m=vC(c);return m||(d?f?nv.test(d)?nv.test(f)?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 lu({title:n,description:i,icon:r,headerExtra:c,open:d,onOpenChange:f,id:m,className:h,headerClassName:g,contentClassName:v,children:b}){const x=p.useId().replace(/:/g,""),j=m?`section-${m}`:`collapsible-${x}`,S=`${j}-header`,R=p.useRef(null),k=p.useRef(null),C=p.useRef(d);return p.useEffect(()=>{if(C.current&&!d){const z=k.current,w=document.activeElement;z&&w instanceof HTMLElement&&z.contains(w)&&R.current?.focus()}C.current=d},[d]),a.jsxs("div",{className:h,children:[a.jsx("h3",{children:a.jsxs("button",{ref:R,type:"button",id:S,"aria-expanded":d,"aria-controls":j,onClick:()=>f(!d),className:oe("group flex w-full items-center gap-3 text-left transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/50",g),children:[r,a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:n}),i&&a.jsx("span",{className:"mt-0.5 block break-words text-xs text-muted",children:i})]}),c&&a.jsx("span",{className:"shrink-0",children:c}),a.jsx(Jw,{className:oe("size-4 shrink-0 text-faint transition-transform duration-[var(--ez-motion-base)] ease-[var(--ez-ease-out)] motion-reduce:transition-none",d&&"rotate-180"),"aria-hidden":"true"})]})}),a.jsx("div",{ref:k,id:j,role:"region","aria-labelledby":S,"aria-hidden":d?void 0:!0,inert:!d,className:oe("grid transition-[grid-template-rows] duration-[var(--ez-motion-base)] ease-[var(--ez-ease-out)] motion-reduce:transition-none",d?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:a.jsx("div",{className:"min-h-0 overflow-hidden",children:a.jsx("div",{className:v,children:b})})})]})}function jC(n){const i=document.activeElement,r=document.getSelection(),c=[];if(r)for(let m=0;m<r.rangeCount;m+=1)c.push(r.getRangeAt(m));const d=document.createElement("textarea");d.value=n,d.setAttribute("readonly",""),d.style.position="fixed",d.style.top="0",d.style.left="0",d.style.opacity="0",d.style.pointerEvents="none",document.body.appendChild(d);let f;try{d.select(),d.setSelectionRange(0,n.length),f=document.execCommand("copy")}catch{f=!1}finally{if(d.remove(),r){r.removeAllRanges();for(const m of c)r.addRange(m)}i?.focus({preventScroll:!0})}return f}async function NC(n){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(n),!0}catch{}return jC(n)}function qt({value:n,label:i="Copy",withText:r=!1,className:c}){const[d,f]=p.useState("idle"),m=p.useRef(null),h=Et();p.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const g=async()=>{const x=await NC(n);f(x?"copied":"failed"),x||h.error("Could not copy","The browser blocked clipboard access. Select the text and copy it manually."),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>f("idle"),1600)},v=d==="copied"?a.jsx(dl,{className:"size-3.5 text-ok","aria-hidden":"true"}):d==="failed"?a.jsx(fl,{className:"size-3.5 text-bad","aria-hidden":"true"}):a.jsx(mS,{className:"size-3.5","aria-hidden":"true"}),b=d==="copied"?"Copied":d==="failed"?"Copy failed":i;return r?a.jsx(se,{size:"sm",variant:"secondary",icon:v,onClick:g,className:c,children:a.jsx("span",{"aria-live":"polite",children:b})}):a.jsx(ct,{label:b,size:"sm",variant:"ghost",onClick:g,className:oe(d==="copied"&&"text-ok",d==="failed"&&"text-bad",c),children:v})}const wC={discord:{label:"Discord",badgeClassName:"bg-discord-soft text-discord",icon:Wc},telegram:{label:"Telegram",badgeClassName:"bg-telegram-soft text-telegram",icon:Ub}},av={label:"Channel",badgeClassName:"bg-inset text-muted",icon:Tc};function n0(n){const i=n.trim(),r=wC[i.toLowerCase()];return r||{...av,label:i?i.charAt(0).toUpperCase()+i.slice(1):av.label}}function SC(n){return n0(n).label}function a0({type:n,className:i}){const r=n0(n),c=r.icon;return a.jsxs("span",{className:oe("inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-2xs font-medium tracking-wide",r.badgeClassName,i),children:[a.jsx(c,{className:"size-3 shrink-0","aria-hidden":"true"}),r.label]})}const sv="rounded-sm font-medium text-accent-text underline-offset-2 transition-colors hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:cursor-not-allowed disabled:text-faint disabled:no-underline disabled:opacity-60";function kC({lastTest:n}){return n==="passed"?a.jsx(je,{tone:"ok",children:"Test passed"}):n==="failed"?a.jsx(je,{tone:"bad",children:"Test failed"}):n===null?a.jsx("span",{className:"text-2xs text-faint",children:"Not tested"}):null}function Sh({channels:n,value:i,onChange:r,disabled:c,disabledIds:d,label:f,emptyHref:m,compact:h}){const g=p.useId(),v=p.useId(),[b,x]=p.useState("");if(n.length===0)return a.jsxs("div",{role:"group","aria-labelledby":g,className:"space-y-2",children:[a.jsx("span",{id:g,className:"block text-xs font-medium text-ink",children:f}),a.jsxs("div",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:["No notification channels yet."," ",a.jsx(kt,{to:m,className:"font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:"Add a channel"})]})]});const j=b.trim(),S=j.toLowerCase(),R=S?n.filter(E=>E.name.toLowerCase().includes(S)||E.type.toLowerCase().includes(S)||SC(E.type).toLowerCase().includes(S)):n,k=n.filter(E=>!d?.[E.id]),C=n.filter(E=>i.includes(E.id)).length,z=k.length>0&&k.every(E=>i.includes(E.id)),w=(E,M)=>{r(M?Array.from(new Set([...i,E])):i.filter(Y=>Y!==E))},O=()=>{r(Array.from(new Set([...i,...k.map(E=>E.id)])))};return a.jsxs("div",{role:"group","aria-labelledby":g,className:"space-y-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[a.jsx("span",{id:g,className:"text-xs font-medium text-ink",children:f}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-2xs",children:[a.jsxs("span",{className:"text-faint","aria-live":"polite",children:[C," of ",n.length," selected"]}),a.jsx("button",{type:"button",className:sv,onClick:O,disabled:c||z,children:"Select all"}),a.jsx("button",{type:"button",className:sv,onClick:()=>r([]),disabled:c||C===0,children:"Clear"})]})]}),n.length>6&&a.jsxs("div",{className:"relative",children:[a.jsx(Lb,{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",{id:v,type:"search",value:b,onChange:E=>x(E.target.value),onKeyDown:E=>{E.key==="Enter"&&E.preventDefault()},placeholder:"Search channels","aria-label":"Search channels",className:"h-8 w-full rounded-md border border-line bg-canvas pl-8 pr-3 text-xs 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"})]}),R.length===0?a.jsx("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-3 text-xs text-muted",children:`No channels match "${j}"`}):a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:R.map(E=>{const M=i.includes(E.id),Y=d?.[E.id],A=c||!!Y;return a.jsxs("label",{title:Y,className:oe("relative flex min-w-0 cursor-pointer items-start gap-2.5 rounded-md border px-3 text-left transition-colors duration-[var(--ez-motion-fast)]",h?"py-2":"py-2.5",M?"border-accent bg-accent-soft":"border-line bg-raised/40",!M&&!A&&"hover:border-line-strong hover:bg-raised",A&&"cursor-not-allowed opacity-60","focus-within:outline-none focus-within:ring-2 focus-within:ring-accent/50"),children:[a.jsx("input",{type:"checkbox",className:"sr-only",checked:M,disabled:A,onChange:H=>w(E.id,H.target.checked)}),a.jsxs("span",{className:"min-w-0 flex-1 pr-4 pt-0.5",children:[a.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("span",{className:"truncate text-xs font-medium text-ink",children:E.name}),a.jsx(a0,{type:E.type}),a.jsx(kC,{lastTest:E.lastTest})]}),Y&&a.jsx("span",{className:"mt-1 block text-2xs text-faint",children:Y})]}),M&&a.jsx("span",{className:"absolute right-2 top-2 inline-flex size-4 items-center justify-center rounded-full bg-accent text-accent-ink",children:a.jsx(dl,{className:"size-2.5","aria-hidden":"true"})})]},E.id)})})]})}function CC({label:n,items:i,onChange:r,onToggleAll:c,disabled:d,children:f}){const m=p.useId(),h=p.useId(),g=p.useRef(null),v=i.length>0&&i.every(x=>x.enabled),b=i.every(x=>!x.enabled);return p.useEffect(()=>{g.current&&(g.current.indeterminate=!v&&!b)},[v,b]),a.jsxs("div",{role:"group","aria-labelledby":m,className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[a.jsx("h4",{id:m,className:"text-xs font-medium text-ink",children:n}),a.jsxs("label",{htmlFor:h,className:"inline-flex cursor-pointer items-center gap-2 text-2xs text-muted",children:[a.jsx("input",{id:h,ref:g,type:"checkbox",checked:v,disabled:d||i.length===0,onChange:()=>c(!v),className:"size-3.5 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)] disabled:cursor-not-allowed"}),a.jsx("span",{className:"select-none",children:v?"All on":b?"All off":"Mixed"})]})]}),a.jsx("div",{className:"space-y-3",children:i.map(x=>a.jsxs("div",{className:"rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:x.enabled,onChange:j=>r(x.id,j),label:x.label,description:x.description,disabled:d}),x.enabled&&f?.(x)]},x.id))})]})}const TC="text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript",kh=[{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."}],s0=()=>({domain_health:{enabled:!0,channelIds:[]},cert_expiry:{enabled:!0,channelIds:[]},nginx_down:{enabled:!0,channelIds:[]}});function EC(){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:TC},security:{rateLimit:!1,rateLimitRate:10,rateLimitBurst:20,securityHeaders:!1,custom404:!1,custom50x:!1},advanced:{accessLog:!0,customLocations:""},notifications:s0()}}function RC(n){const i=s0();for(const r of kh){const c=n.notifications?.[r.id];c&&(i[r.id]={enabled:c.enabled,channelIds:[...c.channelIds??[]]})}return{name:n.name,port:n.port,backendHost:n.backendHost||"127.0.0.1",upstreamType:n.upstreamType||"http",www:n.www,wildcard:n.wildcard,enabled:n.enabled,ssl:{enabled:!!n.ssl?.enabled,certPath:n.ssl?.certPath??"",keyPath:n.ssl?.keyPath??"",redirect:n.ssl?.redirect??!0,hsts:n.ssl?.hsts??!1,hstsMaxAge:n.ssl?.hstsMaxAge||31536e3},performance:{...n.performance},security:{...n.security},advanced:{...n.advanced},notifications:i}}const lv={http:"HTTP",https:"HTTPS",ws:"WebSocket"};function Ch(n){return n.trim().replace(/^\*\./,"")}function zC(n){return"status"in n&&n.status==="waiting_dns"}function DC(n,i){const r={};if(i){const h=Fh(Ch(n.name));h&&(r["domain-name"]=h)}if(n.backendHost.trim()||(r["backend-host"]="A backend host or URL is required."),!/^https?:\/\//i.test(n.backendHost.trim())){const h=su(n.port);h&&(r["backend-port"]=h)}const d=gC(n.performance.maxBodySize);d&&(r["max-body"]=d);const f=vr(n.performance.readTimeout,"Read timeout");f&&(r["read-timeout"]=f);const m=vr(n.performance.connectTimeout,"Connect timeout");if(m&&(r["connect-timeout"]=m),n.ssl.enabled&&n.ssl.hsts){const h=vr(n.ssl.hstsMaxAge,"HSTS max-age");h&&(r["hsts-max-age"]=h)}if(n.security.rateLimit){const h=vr(n.security.rateLimitRate,"Rate");h&&(r["rate-limit-rate"]=h);const g=vr(n.security.rateLimitBurst,"Burst");g&&(r["rate-limit-burst"]=g)}return r}function iv(n){if(n instanceof He){const i=n.payload.error;if(i&&typeof i=="object")return{message:"Certificate creation failed",detail:[i.step?`Step: ${i.step}`:"",i.cause?`Cause: ${i.cause}`:"",i.consequence?`Note: ${i.consequence}`:""].filter(Boolean).join(`
511
- `)||"The certificate authority did not issue a certificate.",hint:"nginx is left as it was."};const r=n.code==="email_required"?"Set the ACME email in Settings → General, then try again.":typeof n.payload.hint=="string"?n.payload.hint:void 0;return{message:"Certificate creation failed",detail:(typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.output=="string"?n.payload.output:void 0)??n.message,hint:r}}return{message:"Certificate creation failed",detail:n instanceof Error?n.message:"The request could not be completed."}}function ui({id:n,title:i,description:r,icon:c,open:d,onToggle:f,children:m}){return a.jsx(lu,{id:n,title:i,description:r,open:d,onOpenChange:f,className:"border-b border-line last:border-b-0",headerClassName:"px-5 py-3.5",contentClassName:"px-5 pb-5 pt-1",icon: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(c,{className:"size-3.5","aria-hidden":"true"})}),children:m})}const di=n=>Number.isFinite(n)&&n!==0?n:"";function rv({wildcard:n,certMethod:i,onMethodChange:r,certFailure:c,dnsPending:d,certAction:f,onCreate:m,onConfirmDns:h,onCancelDns:g,disabledReason:v,extraActions:b}){const x=f!==null;return a.jsxs("div",{className:"space-y-3",children:[c&&a.jsxs(ve,{tone:"danger",title:c.message,children:[c.hint&&a.jsx("div",{children:c.hint}),c.detail&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:c.detail})]}),d?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:d.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:d.txtName})]}),a.jsx(qt,{value:d.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:d.txtValue})]}),a.jsx(qt,{value:d.txtValue,label:"Copy record value"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(se,{variant:"primary",size:"sm",loading:f==="confirm",onClick:h,children:"I added the record, continue"}),a.jsx(se,{variant:"secondary",size:"sm",onClick:g,disabled:x,children:"Cancel issuance"})]})]}):a.jsxs("div",{className:"space-y-3",children:[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:oe("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",i==="http"?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong",n&&"cursor-not-allowed opacity-50"),children:[a.jsx("input",{type:"radio",name:"cert-method",value:"http",checked:i==="http",disabled:n||x,onChange:()=>r("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:oe("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",i==="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:i==="dns",disabled:x,onChange:()=>r("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"})]})]})]}),n&&a.jsx("p",{className:"mt-2 text-2xs text-warn",children:"Wildcard certificates require the DNS challenge."})]}),v&&a.jsx("p",{className:"text-2xs text-warn",children:v}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(se,{variant:"primary",size:"sm",loading:f==="issue",onClick:m,disabled:!!v,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Create certificate"}),b]})]})]})}function AC(n,i,r){return n==="exact"?`A certificate for ${i} already exists`:n==="wildcard"?`A wildcard certificate covers ${i}`:`The certificate in ${r} covers ${i}`}function OC({domainName:n,match:i,certificate:r,onAccept:c}){const d=r.daysLeft,f=d===null?"text-muted":d<=0?"text-bad":d<30?"text-warn":"text-ok",m=d===null?"expiry unknown":d<=0?"expired":`${d} days left`;return a.jsx("div",{className:"rounded-md border border-accent/40 bg-accent-soft/30 p-3.5",children:a.jsxs("div",{className:"flex flex-wrap items-start gap-x-3 gap-y-3",children:[a.jsx(Kh,{className:"mt-0.5 size-4 shrink-0 text-accent-text","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:AC(i,n,r.domain)}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i==="exact"?"Turning SSL on will use this certificate.":`Stored in ${r.domain}, which lists this domain as a name. Turning SSL on will use it.`}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs",children:[a.jsx("span",{className:oe("font-medium",f),children:m}),r.names.length>1&&a.jsxs("span",{className:"break-all text-muted",children:["covers ",r.names.join(", ")]})]}),a.jsxs("div",{className:"mt-2 space-y-0.5 font-mono text-2xs text-faint",children:[a.jsx("div",{className:"break-all",children:r.certPath}),a.jsx("div",{className:"break-all",children:r.keyPath})]})]}),a.jsx(se,{size:"sm",onClick:c,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Use this certificate"})]})})}function MC({editor:n,onClose:i,onSaved:r}){const c=n.mode==="edit"?n.domain:null,d=Et(),f=rn(),m=p.useId(),[h,g]=p.useState(()=>c?RC(c):EC()),v=p.useRef(JSON.stringify(h)),b=JSON.stringify(h)!==v.current,[x,j]=p.useState(()=>c?{basic:!0,ssl:!0,performance:!0,security:!0,advanced:!0,notifications:!0}:{basic:!0,ssl:!0,performance:!1,security:!1,advanced:!1,notifications:!1}),[S,R]=p.useState({}),[k,C]=p.useState(null),[z,w]=p.useState(!1),[O,E]=p.useState(null),[M,Y]=p.useState("http"),[A,H]=p.useState(null),[W,I]=p.useState(null),[ne,J]=p.useState(null),Z=Tt(F=>fe.settings.channels.list(F),[],{enabled:!!c}),ee=Tt(F=>fe.ssl.list(F),[],{enabled:h.ssl.enabled}),ue=Tt(F=>fe.domains.sslSuggestion(c?.name??"",F),[c?.name],{enabled:!!c});p.useEffect(()=>{if(!b)return;const F=be=>{be.preventDefault(),be.returnValue=""};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[b]),p.useEffect(()=>{O&&h.wildcard&&Y("dns")},[O,h.wildcard]);const K=/^https?:\/\//i.test(h.backendHost.trim()),B=c?c.name:Ch(h.name),L=Fh(B),te=h.ssl.certPath.trim()===""&&h.ssl.keyPath.trim()==="",de=ee.data?.some(F=>F.domain===B)??!1,ke=ue.data?.found?ue.data:null,Ne=te&&ke!==null,Ee=h.ssl.enabled&&te&&!ee.loading&&!de&&!O&&!ue.loading&&ke===null;function T(F,be){g(Ue=>({...Ue,[F]:be}))}function q(F,be){g(Ue=>({...Ue,ssl:{...Ue.ssl,[F]:be}}))}function V(F){g(be=>({...be,ssl:{...be.ssl,enabled:!0,certPath:F.certPath,keyPath:F.keyPath}}))}function re(F,be){g(Ue=>({...Ue,performance:{...Ue.performance,[F]:be}}))}function ye(F,be){g(Ue=>({...Ue,security:{...Ue.security,[F]:be}}))}function Re(F,be){g(Ue=>({...Ue,advanced:{...Ue.advanced,[F]:be}}))}function xe(F,be){g(Ue=>({...Ue,notifications:{...Ue.notifications,[F]:{...Ue.notifications[F],...be}}}))}const me=F=>j(be=>({...be,[F]:!0})),ie=F=>({...h,...F,ssl:{...h.ssl,...F?.ssl??{}},name:c?c.name:Ch(h.name)}),Pe=F=>{const be=DC(F,!c);if(Object.keys(be).length===0)return!0;R(be),C({message:"Check the highlighted fields before saving."}),(be["domain-name"]||be["backend-host"]||be["backend-port"])&&me("basic"),(be["max-body"]||be["read-timeout"]||be["connect-timeout"])&&me("performance"),(be["rate-limit-rate"]||be["rate-limit-burst"])&&me("security"),be["hsts-max-age"]&&me("ssl");const Ue=Object.keys(be)[0];return queueMicrotask(()=>document.getElementById(Ue)?.focus()),!1},Ve=async F=>{const be=ie(F);if(!Pe(be))return;const Ue=c?.name??be.name;R({}),C(null),w(!0);let Dt;try{Dt=c?await fe.domains.update(c.name,be):await fe.domains.create(be)}catch(aa){const Ke=aa instanceof He?aa:null;if(!Ke){E(null),I(null),H(null),d.warning("The dashboard’s reply could not be read","The domain list was reloaded. Check that the change is there before saving again."),r();return}Ke.status===422&&Ke.code==="cert_missing"?(E({certPath:typeof Ke.payload.certPath=="string"?Ke.payload.certPath:"",keyPath:typeof Ke.payload.keyPath=="string"?Ke.payload.keyPath:"",hint:typeof Ke.payload.hint=="string"?Ke.payload.hint:"The SSL certificate files do not exist at the configured paths."}),H(null),I(null),C(null),Y(h.wildcard?"dns":"http"),me("ssl")):Ke.status===0?(C({message:"The dashboard did not answer.",detail:Ke.message,hint:"Saving may still have worked: check the domain list before trying again."}),d.error("The dashboard did not answer","The change may already have been saved.")):(C({message:Ke.message??"The domain could not be saved.",detail:typeof Ke.payload.detail=="string"?Ke.payload.detail:typeof Ke.payload.output=="string"?Ke.payload.output:void 0,hint:typeof Ke.payload.hint=="string"?Ke.payload.hint:void 0}),d.error("Could not save the domain",Ke.message??void 0));return}finally{w(!1)}E(null),I(null),H(null),d.success(c?"Domain saved":"Domain created",c?`${Dt?.name??Ue} was updated and its nginx config regenerated.`:`${Dt?.name??Ue} is configured; nginx will start serving it on the next reload.`),r()},Xe=async()=>{if(Pe(ie({ssl:{...h.ssl,enabled:!0}}))){J("issue"),H(null);try{const F=await fe.ssl.create({domain:B,www:h.www,validationMethod:h.wildcard?"dns":M});if(zC(F)){I(F);return}const be={...h.ssl,enabled:!0,certPath:F.certPath,keyPath:F.keyPath};g(Ue=>({...Ue,ssl:be})),E(null),I(null),await Ve({ssl:be})}catch(F){H(iv(F))}finally{J(null)}}},ce=async()=>{if(W){J("confirm"),H(null);try{const F=await fe.ssl.confirmDns(W.domain),be={...h.ssl,enabled:!0,certPath:F.certPath,keyPath:F.keyPath};g(Ue=>({...Ue,ssl:be})),I(null),E(null),await Ve({ssl:be})}catch(F){H(iv(F)),I(null)}finally{J(null)}}},De=async()=>{if(W){J("confirm");try{await fe.ssl.cancelDns(W.domain),d.info("DNS challenge cancelled","No certificate was requested.")}catch{d.warning("Could not cancel the DNS challenge")}finally{I(null),J(null)}}},we=()=>{const F={...h.ssl,enabled:!1};g(be=>({...be,ssl:F})),E(null),H(null),I(null),Ve({ssl:F})},nt=()=>{E(null),H(null),I(null)},rt=z||ne!==null,xt=async()=>b?f({title:"Discard changes?",body:"The changes to this domain have not been saved.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}):!0,bt=()=>{W&&fe.ssl.cancelDns(W.domain).catch(()=>{})},zn=async()=>{rt||await xt()&&(bt(),i())},jn=p.useRef(zn);jn.current=zn;const na=p.useCallback(()=>{jn.current()},[]);return a.jsxs(yn,{open:!0,onClose:na,title:c?`Edit ${c.name}`:"New domain",description:"Changes are written to nginx, tested, and rolled back automatically if nginx rejects them.",size:"xl",preventClose:rt,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:c?"The domain name cannot change after creation.":"The domain is enabled as soon as it is created."}),a.jsx(se,{variant:"ghost",onClick:na,disabled:rt,children:"Cancel"}),a.jsx(se,{variant:"primary",type:"submit",form:m,loading:z,disabled:ne!==null,children:c?"Save changes":"Create domain"})]}),children:[(k||O)&&a.jsxs("div",{className:"space-y-3 border-b border-line px-5 py-4",children:[k&&!O&&a.jsxs(ve,{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})]}),O&&a.jsxs(a.Fragment,{children:[a.jsx(ve,{tone:"warning",title:"SSL certificate not found",action:a.jsx(se,{variant:"ghost",size:"sm",onClick:nt,disabled:rt,children:"Keep editing"}),children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"break-all font-mono text-2xs",children:O.certPath||O.keyPath}),a.jsx("div",{children:O.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:a.jsx(rv,{wildcard:h.wildcard,certMethod:M,onMethodChange:Y,certFailure:A,dnsPending:W,certAction:ne,onCreate:Xe,onConfirmDns:ce,onCancelDns:De,extraActions:a.jsx(se,{variant:"dangerGhost",size:"sm",onClick:we,disabled:ne!==null,children:"Disable SSL and save"})})})]})]}),a.jsxs("form",{id:m,onSubmit:F=>{F.preventDefault(),rt||Ve()},children:[a.jsx(ui,{id:"basic",title:"Basic configuration",description:"What nginx serves and where traffic goes.",icon:Os,open:x.basic??!1,onToggle:()=>j(F=>({...F,basic:!F.basic})),children:a.jsxs(Ja,{children:[a.jsx(Me,{id:"domain-name",className:"sm:col-span-2",label:"Domain name",placeholder:"api.example.com",value:h.name,disabled:!!c,onChange:F=>T("name",F.target.value),error:S["domain-name"],hint:h.wildcard?"Enter the bare domain — the *. prefix is added automatically.":c?"The domain name cannot be changed after creation.":void 0,autoComplete:"off",spellCheck:!1}),a.jsx(Me,{id:"backend-host",className:"sm:col-span-2",label:"Backend host or URL",placeholder:"127.0.0.1 or https://app.vercel.app",value:h.backendHost,onChange:F=>T("backendHost",F.target.value),error:S["backend-host"],hint:"A host and port, or a full http(s) URL to proxy to.",autoComplete:"off",spellCheck:!1}),a.jsx(Me,{id:"backend-port",label:"Backend port",type:"number",inputMode:"numeric",min:1,max:65535,value:di(h.port),disabled:K,onChange:F=>T("port",Number(F.target.value)),error:S["backend-port"],hint:K?"Taken from the URL.":void 0}),a.jsx(pa,{label:"Upstream type",value:h.upstreamType,onChange:F=>T("upstreamType",F.target.value),children:Object.keys(lv).map(F=>a.jsx("option",{value:F,children:lv[F]},F))}),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(Zt,{checked:h.wildcard,onChange:F=>g(be=>({...be,wildcard:F,www:F?!1:be.www})),label:"Wildcard domain",description:"Serve *.example.com. Requires a DNS-01 certificate."}),!h.wildcard&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Zt,{checked:h.www,onChange:F=>T("www",F),label:"Include www subdomain",description:"Adds www.example.com to server_name."})})]})]})}),a.jsx(ui,{id:"ssl",title:"SSL",description:"Serve this domain over HTTPS.",icon:Rn,open:x.ssl??!1,onToggle:()=>j(F=>({...F,ssl:!F.ssl})),children:a.jsxs("div",{className:"space-y-4",children:[Ne&&ke&&a.jsx(OC,{domainName:B,match:ke.match,certificate:ke.certificate,onAccept:()=>V(ke.certificate)}),h.ssl.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(Me,{label:"Certificate path",value:h.ssl.certPath,onChange:F=>q("certPath",F.target.value),placeholder:"fullchain.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"}),a.jsx(Me,{label:"Private key path",value:h.ssl.keyPath,onChange:F=>q("keyPath",F.target.value),placeholder:"privkey.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"})]}),Ee&&a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"No certificate paths set"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Create a certificate for ",B||"this domain"," now. On success, the certificate and key paths are filled in automatically."]})]}),a.jsx(rv,{wildcard:h.wildcard,certMethod:M,onMethodChange:Y,certFailure:A,dnsPending:W,certAction:ne,onCreate:Xe,onConfirmDns:ce,onCancelDns:De,disabledReason:B?L??null:"Enter the domain name above to create a certificate."})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:h.ssl.redirect,onChange:F=>q("redirect",F),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(Zt,{checked:h.ssl.hsts,onChange:F=>q("hsts",F),label:"Enable HSTS",description:"Tells browsers to use HTTPS for this domain only."})}),h.ssl.hsts&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Me,{id:"hsts-max-age",label:"HSTS max-age",type:"number",inputMode:"numeric",min:1,value:di(h.ssl.hstsMaxAge),onChange:F=>q("hstsMaxAge",Number(F.target.value)),error:S["hsts-max-age"],hint:"Seconds. 31536000 is one year.",className:"max-w-56"})})]})]}):a.jsx(Zt,{checked:h.ssl.enabled,onChange:F=>q("enabled",F),label:"Enable SSL / HTTPS",description:"Adds a 443 server block with the certificate below."}),h.ssl.enabled&&a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(as,{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(ui,{id:"performance",title:"Performance",description:"Request limits, timeouts and compression.",icon:ES,open:x.performance??!1,onToggle:()=>j(F=>({...F,performance:!F.performance})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[a.jsx(Me,{id:"max-body",label:"Max body size",value:h.performance.maxBodySize,onChange:F=>re("maxBodySize",F.target.value),error:S["max-body"],placeholder:"10m",hint:"For uploads: 10m, 512k or 1g.",autoComplete:"off"}),a.jsx(Me,{id:"read-timeout",label:"Read timeout",type:"number",inputMode:"numeric",min:1,value:di(h.performance.readTimeout),onChange:F=>re("readTimeout",Number(F.target.value)),error:S["read-timeout"],hint:"Seconds."}),a.jsx(Me,{id:"connect-timeout",label:"Connect timeout",type:"number",inputMode:"numeric",min:1,value:di(h.performance.connectTimeout),onChange:F=>re("connectTimeout",Number(F.target.value)),error:S["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(Zt,{checked:h.performance.proxyBuffers,onChange:F=>re("proxyBuffers",F),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(Zt,{checked:h.performance.gzip,onChange:F=>re("gzip",F),label:"Gzip compression",description:"Compress text responses before sending them."})}),h.performance.gzip&&a.jsxs("div",{className:"border-t border-line pt-3",children:[a.jsx(Lc,{label:"Gzip MIME types",value:h.performance.gzipTypes,onChange:F=>re("gzipTypes",F.target.value),rows:3,spellCheck:!1,className:"font-mono"}),a.jsx(ml,{children:"Space-separated list of content types."})]})]})]})}),a.jsx(ui,{id:"security",title:"Security",description:"Rate limiting and response headers.",icon:Yh,open:x.security??!1,onToggle:()=>j(F=>({...F,security:!F.security})),children:a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:h.security.rateLimit,onChange:F=>ye("rateLimit",F),label:"Rate limiting",description:"Limit requests per IP address."}),h.security.rateLimit&&a.jsxs("div",{className:"grid gap-4 border-t border-line pt-3 sm:grid-cols-2",children:[a.jsx(Me,{id:"rate-limit-rate",label:"Requests per second",type:"number",inputMode:"numeric",min:1,value:di(h.security.rateLimitRate),onChange:F=>ye("rateLimitRate",Number(F.target.value)),error:S["rate-limit-rate"]}),a.jsx(Me,{id:"rate-limit-burst",label:"Burst",type:"number",inputMode:"numeric",min:1,value:di(h.security.rateLimitBurst),onChange:F=>ye("rateLimitBurst",Number(F.target.value)),error:S["rate-limit-burst"],hint:"Requests allowed to exceed the rate briefly."})]}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Zt,{checked:h.security.securityHeaders,onChange:F=>ye("securityHeaders",F),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(Zt,{checked:h.security.custom404,onChange:F=>ye("custom404",F),label:"Custom 404 form",description:"Return the dashboard's 404 page."}),a.jsx(Zt,{checked:h.security.custom50x,onChange:F=>ye("custom50x",F),label:"Custom 50x page",description:"Return the dashboard's error page when the backend fails."})]})]})}),a.jsx(ui,{id:"advanced",title:"Advanced",description:"Raw nginx additions for this domain.",icon:uS,open:x.advanced??!1,onToggle:()=>j(F=>({...F,advanced:!F.advanced})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Zt,{checked:h.advanced.accessLog,onChange:F=>Re("accessLog",F),label:"Domain-specific access log",description:"Writes this domain's requests to its own log file."}),a.jsx(Lc,{label:"Custom location blocks",value:h.advanced.customLocations,onChange:F=>Re("customLocations",F.target.value),rows:6,spellCheck:!1,placeholder:`location /api/v2 {
510
+ */const n5=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],a5=he("wrench",n5);function oe(...n){return n.filter(Boolean).join(" ")}const Xb=p.createContext(null),s5={success:{icon:ts,iconClass:"text-ok"},error:{icon:cS,iconClass:"text-bad"},warning:{icon:fl,iconClass:"text-warn"},info:{icon:Ub,iconClass:"text-info"}},l5=6e3;let Qv=0;function i5(){return Qv+=1,`toast-${Date.now().toString(36)}-${Qv}`}function r5({children:n}){const[i,r]=p.useState([]),c=p.useRef(new Map),d=h=>{const g=c.current.get(h);g&&clearTimeout(g),c.current.delete(h),r(y=>y.filter(b=>b.id!==h))},f=h=>{const g=i5(),y={id:g,title:h.title,description:h.description,tone:h.tone??"info"};r(x=>{const j=[...x,y];return j.length>5?j.slice(j.length-5):j});const b=setTimeout(()=>d(g),h.durationMs??l5);return c.current.set(g,b),g},m=p.useMemo(()=>({push:f,dismiss:d,success:(h,g)=>f({title:h,description:g,tone:"success"}),error:(h,g)=>f({title:h,description:g,tone:"error"}),warning:(h,g)=>f({title:h,description:g,tone:"warning"}),info:(h,g)=>f({title:h,description:g,tone:"info"})}),[]);return p.useEffect(()=>{const h=c.current;return()=>{for(const g of h.values())clearTimeout(g);h.clear()}},[]),a.jsxs(Xb.Provider,{value:m,children:[n,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:i.map(h=>{const{icon:g,iconClass:y}=s5[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(g,{className:oe("mt-0.5 size-4 shrink-0",y),"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:()=>d(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(Ms,{className:"size-3.5","aria-hidden":"true"})})]},h.id)})})]})}function Et(){const n=p.useContext(Xb);if(!n)throw new Error("useToast must be used inside ToastProvider");return n}const o5={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"},c5={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 ma(n="secondary",i="md",r){return oe("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",o5[n],c5[i],r)}const ae=p.forwardRef(function({variant:i="secondary",size:r="md",loading:c=!1,icon:d,className:f,children:m,disabled:h,...g},y){return a.jsxs("button",{ref:y,type:"button",className:ma(i,r,f),disabled:h||c,"aria-busy":c||void 0,...g,children:[c?a.jsx(gn,{className:"spin size-4","aria-hidden":"true"}):d,m]})}),ct=p.forwardRef(function({label:i,variant:r="ghost",size:c="md",className:d,children:f,...m},h){return a.jsx("button",{ref:h,type:"button","aria-label":i,title:i,className:ma(r,c==="sm"?"sm":"md",oe("!px-0",c==="sm"?"size-8":"size-9",d)),...m,children:f})}),mi=[],bh=new Set;function Iv(){for(const n of bh)n()}function jh(n){return mi.length>0&&mi[mi.length-1]===n}function u5(n){const i=p.useId(),[r,c]=p.useState(()=>jh(i));return p.useEffect(()=>{const d=()=>c(jh(i));return bh.add(d),d(),()=>{bh.delete(d)}},[i]),p.useEffect(()=>{if(n)return mi.push(i),Iv(),()=>{const d=mi.lastIndexOf(i);d!==-1&&mi.splice(d,1),Iv()}},[n,i]),{id:i,isTop:r}}const d5={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-4xl"},f5='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function vn({open:n,onClose:i,title:r,description:c,children:d,footer:f,size:m="md",preventClose:h=!1,bodyClassName:g}){const y=p.useId(),b=p.useId(),{id:x,isTop:j}=u5(n),S=p.useRef(null),R=p.useRef(null),k=p.useRef(i);k.current=i;const C=p.useRef(h);return C.current=h,p.useEffect(()=>{if(!n)return;R.current=document.activeElement;const D=document.body.style.overflow;document.body.style.overflow="hidden";const E=window.setTimeout(()=>{const w=S.current;if(!w)return;(w.querySelector("[data-autofocus]")??w).focus()},0),O=w=>{if(!jh(x))return;if(w.key==="Escape"&&!C.current){if(w.defaultPrevented)return;w.stopPropagation(),k.current();return}if(w.key!=="Tab")return;const U=S.current;if(!U)return;const Y=Array.from(U.querySelectorAll(f5)).filter(I=>I.offsetParent!==null&&!I.closest("[inert]"));if(Y.length===0){w.preventDefault(),U.focus();return}const A=Y[0],M=Y[Y.length-1],W=document.activeElement;w.shiftKey&&(W===A||W===U)?(w.preventDefault(),M.focus()):!w.shiftKey&&W===M&&(w.preventDefault(),A.focus())};return document.addEventListener("keydown",O,!0),()=>{window.clearTimeout(E),document.removeEventListener("keydown",O,!0),document.body.style.overflow=D,R.current?.focus()}},[n,x]),n?ol.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:D=>{D.target!==D.currentTarget||!j||h||i()},children:a.jsxs("div",{ref:S,role:"dialog","aria-modal":j||void 0,"aria-labelledby":y,"aria-describedby":c?b:void 0,tabIndex:-1,className:oe("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",d5[m]),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:y,className:"text-base font-semibold text-ink",children:r}),c&&a.jsx("p",{id:b,className:"mt-1 text-sm text-muted",children:c})]}),a.jsx(ct,{label:"Close",size:"sm",onClick:i,disabled:h,className:"-mr-1 -mt-1",children:a.jsx(Ms,{className:"size-4","aria-hidden":"true"})})]}),d&&a.jsx("div",{className:oe("min-h-0 flex-1 overflow-y-auto px-5 py-4",g),children:d}),f&&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:f})]})}),document.body):null}class Ue extends Error{status;payload;constructor(i,r,c){super(c??h5(i,r)),this.name="ApiError",this.status=i,this.payload=r}get code(){const{error:i}=this.payload;if(typeof i=="string")return i;if(i&&typeof i=="object")return i.step}get blockedReason(){return this.status!==403?null:this.payload.reason??null}}function h5(n,i){const{error:r}=i;return typeof r=="string"&&r&&r!=="Forbidden"?r:r&&typeof r=="object"?r.cause||r.consequence||"The request failed.":n===403?"Request blocked by the dashboard.":n===401?"Your session ended. Please sign in again.":n===0?"Cannot reach the dashboard.":`Request failed (HTTP ${n}).`}function m5(n){if(n instanceof Ue)return n;const i=n instanceof Error?n.message:"Something went wrong.";return new Ue(0,{error:i})}function Tt(n,i=[],r={}){const c=r.enabled??!0,d=p.useRef(n);d.current=n;const[f,m]=p.useState(0),h=p.useRef(!1),[g,y]=p.useState({data:null,error:null,loading:c});p.useEffect(()=>{if(!c){h.current=!1,y({data:null,error:null,loading:!1});return}const S=new AbortController,R=h.current;return h.current=!1,R||y(k=>({...k,loading:!0,error:null})),d.current(S.signal).then(k=>{S.signal.aborted||y({data:k,error:null,loading:!1})}).catch(k=>{S.signal.aborted||k?.name!=="AbortError"&&y(C=>({...C,error:m5(k),loading:!1}))}),()=>S.abort()},[...i,c,f]);const b=p.useCallback(()=>m(S=>S+1),[]),x=p.useCallback(()=>{h.current=!0,m(S=>S+1)},[]),j=p.useCallback(S=>{y(R=>({...R,data:typeof S=="function"?S(R.data):S}))},[]);return{data:g.data,error:g.error,loading:g.loading,reload:b,reloadSilent:x,setData:j}}function hl(n,i,r=!0){const c=p.useRef(n);c.current=n,p.useEffect(()=>{if(!r)return;const d=setInterval(()=>c.current(),i);return()=>clearInterval(d)},[i,r])}function vl(n){const i=p.useRef(n);i.current=n,p.useEffect(()=>{const r=()=>{document.visibilityState==="visible"&&i.current()};return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[])}function ba(n){p.useEffect(()=>{document.title=n?`${n} · Easy DevOps`:"Easy DevOps"},[n])}let Nh=null;function Pv(n){Nh=n}function rn(){return p.useCallback(n=>Nh?Nh(n):Promise.resolve(!1),[])}function p5({children:n}){const[i,r]=p.useState(null),c=p.useRef(null),d=p.useCallback(h=>(c.current?.resolve(!1),new Promise(g=>{c.current={resolve:g},r(h)})),[]);p.useEffect(()=>(Pv(d),()=>Pv(null)),[d]);const f=p.useCallback(h=>{r(null);const g=c.current;c.current=null,g?.resolve(h)},[]),m=i?.tone==="danger";return a.jsxs(a.Fragment,{children:[n,a.jsx(vn,{open:i!==null,onClose:()=>f(!1),title:i?.title??"",size:"sm",bodyClassName:"px-5 py-4",footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:()=>f(!1),"data-autofocus":!0,children:i?.cancelLabel??"Cancel"}),a.jsx(ae,{variant:m?"danger":"primary",onClick:()=>f(!0),children:i?.confirmLabel??"Confirm"})]}),children:a.jsx("div",{className:"text-sm text-muted",children:i?.body})})]})}const x5="modulepreload",g5=function(n,i){return new URL(n,i).href},Fv={},v5=function(i,r,c){let d=Promise.resolve();if(r&&r.length>0){let m=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const h=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),y=g?.nonce||g?.getAttribute("nonce");d=m(r.map(b=>{if(b=g5(b,c),b in Fv)return;Fv[b]=!0;const x=b.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(!!c)for(let k=h.length-1;k>=0;k--){const C=h[k];if(C.href===b&&(!x||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${j}`))return;const R=document.createElement("link");if(R.rel=x?"stylesheet":x5,x||(R.as="script"),R.crossOrigin="",R.href=b,y&&R.setAttribute("nonce",y),document.head.appendChild(R),x)return new Promise((k,C)=>{R.addEventListener("load",k),R.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${b}`)))})}))}function f(m){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=m,window.dispatchEvent(h),!h.defaultPrevented)throw m}return d.then(m=>{for(const h of m||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},y5="/api",b5=new Set(["POST","PUT","PATCH","DELETE"]),j5=!1,N5="Your session ended. Please sign in again.",wh=new Set,Sh=new Set;function w5(n){return wh.add(n),()=>wh.delete(n)}function S5(n){return Sh.add(n),()=>Sh.delete(n)}function k5(n){if(!n)return"";const i=new URLSearchParams;for(const[c,d]of Object.entries(n))d!=null&&i.set(c,String(d));const r=i.toString();return r?`?${r}`:""}async function C5(n){const i=await n.text();if(!i)return{};try{const r=JSON.parse(i);return r&&typeof r=="object"?r:{error:String(r)}}catch{return{error:i.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,240)}}}async function ge(n,i={}){const r=i.method??"GET",c={Accept:"application/json"};let d;i.body!==void 0&&(c["Content-Type"]="application/json",d=JSON.stringify(i.body)),b5.has(r)&&(c["X-EZ-Request"]="1");let f;try{f=await fetch(`${y5}${n}${k5(i.query)}`,{method:r,headers:c,body:d,credentials:"same-origin",signal:i.signal})}catch(h){throw h?.name==="AbortError"?h:new Ue(0,{error:"Cannot reach the dashboard."})}if(f.status===204)return;if(!f.ok){const h=await C5(f),g=new Ue(f.status,h);if(!i.skipAuthEvents){if(f.status===401)for(const y of wh)y(N5);else if(f.status===403)for(const y of Sh)y(g)}throw g}const m=await f.text();if(m)return JSON.parse(m)}function Qe(n){return encodeURIComponent(n)}const fe={auth:{status:n=>ge("/auth",{signal:n}),login:n=>ge("/login",{method:"POST",body:{password:n},skipAuthEvents:!0}),setup:n=>ge("/setup",{method:"POST",body:n,skipAuthEvents:!0}),logout:()=>ge("/logout",{method:"POST"})},domains:{list:n=>ge("/domains",{signal:n}),create:n=>ge("/domains",{method:"POST",body:n}),update:(n,i)=>ge(`/domains/${Qe(n)}`,{method:"PUT",body:i}),remove:(n,i)=>ge(`/domains/${Qe(n)}`,{method:"DELETE",query:{deleteCert:i}}),toggle:n=>ge(`/domains/${Qe(n)}/toggle`,{method:"PUT"}),reload:n=>ge(`/domains/${Qe(n)}/reload`,{method:"POST"}),notifications:(n,i)=>ge(`/domains/${Qe(n)}/notifications`,{signal:i}),saveNotifications:(n,i)=>ge(`/domains/${Qe(n)}/notifications`,{method:"PUT",body:i}),sslSuggestion:(n,i)=>ge(`/domains/${Qe(n)}/ssl-suggestion`,{signal:i})},ssl:{list:n=>ge("/ssl",{signal:n}),create:n=>ge("/ssl/create",{method:"POST",body:n}),confirmDns:n=>ge("/ssl/create-confirm",{method:"POST",body:{domain:n}}),cancelDns:n=>ge("/ssl/create-cancel",{method:"POST",body:{domain:n}}),renew:(n,i)=>ge(`/ssl/renew/${Qe(n)}`,{method:"POST",body:i?{opId:i}:{}}),renewAll:n=>ge("/ssl/renew-all",{method:"POST",body:n?{opId:n}:{}}),remove:n=>ge(`/ssl/${Qe(n)}`,{method:"DELETE"})},nginx:{status:n=>ge("/nginx/status",{signal:n}),reload:()=>ge("/nginx/reload",{method:"POST"}),restart:()=>ge("/nginx/restart",{method:"POST"}),start:()=>ge("/nginx/start",{method:"POST"}),stop:()=>ge("/nginx/stop",{method:"POST"}),test:()=>ge("/nginx/test",{method:"POST"}),configs:n=>ge("/nginx/configs",{signal:n}),getConfig:(n,i)=>ge(`/nginx/config/${Qe(n)}`,{signal:i}),saveConfig:(n,i)=>ge(`/nginx/config/${Qe(n)}`,{method:"POST",body:{content:i}}),logs:n=>ge("/nginx/logs",{signal:n})},processes:{list:n=>ge("/processes",{signal:n}),action:(n,i)=>ge(`/processes/${Qe(n)}/${i}`,{method:"POST"}),logs:(n,i=200,r)=>ge(`/processes/${Qe(n)}/logs`,{signal:r,query:{lines:i}})},deployments:{list:n=>ge("/deployments",{signal:n}),get:(n,i)=>ge(`/deployments/${Qe(n)}`,{signal:i}),create:n=>ge("/deployments",{method:"POST",body:n}),update:(n,i)=>ge(`/deployments/${Qe(n)}`,{method:"PUT",body:i}),remove:(n,i={})=>ge(`/deployments/${Qe(n)}`,{method:"DELETE",query:{deleteDomain:i.deleteDomain?1:void 0,purgeData:i.purgeData?1:void 0}}),linkDomain:(n,i)=>ge(`/deployments/${Qe(n)}/domain`,{method:"PUT",body:i}),unlinkDomain:n=>ge(`/deployments/${Qe(n)}/domain`,{method:"DELETE"}),move:(n,i)=>ge(`/deployments/${Qe(n)}/move`,{method:"POST",body:{path:i}}),deploy:(n,i)=>ge(`/deployments/${Qe(n)}/deploy`,{method:"POST",body:i?{ref:i}:{}}),rollback:(n,i)=>ge(`/deployments/${Qe(n)}/rollback`,{method:"POST",body:i?{releaseId:i}:{}}),removeRelease:(n,i)=>ge(`/deployments/${Qe(n)}/releases/${Qe(i)}`,{method:"DELETE"}),run:(n,i,r)=>ge(`/deployments/${Qe(n)}/runs/${Qe(i)}`,{signal:r}),issueHookToken:n=>ge(`/deployments/${Qe(n)}/hook-token`,{method:"POST"}),revokeHookToken:n=>ge(`/deployments/${Qe(n)}/hook-token`,{method:"DELETE"}),generateDeployKey:n=>ge(`/deployments/${Qe(n)}/deploy-key`,{method:"POST"}),testDeployKey:n=>ge(`/deployments/${Qe(n)}/deploy-key/test`,{method:"POST"}),addDeployKeyToGithub:(n,i)=>ge(`/deployments/${Qe(n)}/deploy-key/github`,{method:"POST",body:i?{token:i}:{}}),github:(n,i)=>ge(`/deployments/${Qe(n)}/github`,{signal:i}),applyGithub:(n,i)=>ge(`/deployments/${Qe(n)}/github/apply`,{method:"POST",body:i}),hook:n=>ge("/deployments/hook",{signal:n}),updateHook:n=>ge("/deployments/hook",{method:"PUT",body:n})},service:{status:n=>ge("/service",{signal:n}),start:()=>ge("/service/start",{method:"POST"}),stop:()=>ge("/service/stop",{method:"POST"}),restart:()=>ge("/service/restart",{method:"POST"})},settings:{get:n=>ge("/settings",{signal:n}),update:n=>ge("/settings",{method:"POST",body:n}),permissions:n=>ge("/settings/permissions",{signal:n}),setupPermissions:()=>ge("/settings/permissions/setup",{method:"POST"}),backup:n=>ge("/settings/backup",{signal:n}),restore:n=>ge("/settings/restore",{method:"POST",body:n}),channels:{list:n=>ge("/settings/channels",{signal:n}),create:n=>ge("/settings/channels",{method:"POST",body:n}),update:(n,i)=>ge(`/settings/channels/${Qe(n)}`,{method:"PUT",body:i}),remove:n=>ge(`/settings/channels/${Qe(n)}`,{method:"DELETE"}),test:n=>ge(`/settings/channels/${Qe(n)}/test`,{method:"POST"})}},hub:{status:n=>ge("/hub/status",{signal:n}),connect:n=>ge("/hub/connect",{method:"POST",body:{connectionString:n}}),unlink:()=>ge("/hub/link",{method:"DELETE"}),updatePermissions:n=>ge("/hub/permissions",{method:"PUT",body:n})},update:{check:n=>ge("/update",{signal:n}),status:n=>ge("/update/status",{signal:n}),start:n=>ge("/update",{method:"POST",body:{version:n}})}},Kb=p.createContext(null);function T5(n){if(n instanceof Ue)return n;const i=n instanceof Error?n.message:"Cannot reach the dashboard.";return new Ue(0,{error:i})}function E5({children:n}){const[i,r]=p.useState("loading"),[c,d]=p.useState(null),[f,m]=p.useState(null),[h,g]=p.useState(null),[y,b]=p.useState(null),x=p.useRef("loading");x.current=i;const j=p.useCallback(U=>{d(U),m(null),r(U.authenticated?"authenticated":"unauthenticated")},[]),S=p.useCallback(async()=>{r("loading");try{j(await fe.auth.status())}catch(U){m(T5(U)),r("error")}},[j]);p.useEffect(()=>{S()},[S]);const R=p.useCallback(U=>{g(U??"Your session ended. Please sign in again."),b(null),d(Y=>Y&&{...Y,authenticated:!1}),r("unauthenticated")},[]);p.useEffect(()=>{const U=w5(A=>{x.current==="authenticated"&&R(A)}),Y=S5(A=>b(A));return()=>{U(),Y()}},[R]);const k=p.useCallback(async()=>{try{j(await fe.auth.status())}catch{d(U=>U&&{...U,authenticated:!0}),r("authenticated")}g(null),b(null)},[j]),C=p.useCallback(async U=>{await fe.auth.login(U),await k()},[k]),D=p.useCallback(async U=>{await fe.auth.setup(U),await k()},[k]),E=p.useCallback(async()=>{try{await fe.auth.logout()}catch{}d(U=>U&&{...U,authenticated:!1}),g(null),b(null),r("unauthenticated")},[]),O=p.useCallback(()=>b(null),[]),w=p.useMemo(()=>({phase:i,auth:c,bootError:f,sessionMessage:h,blocked:y,login:C,setup:D,logout:E,retryBoot:S,dismissBlocked:O,reportUnauthorized:R}),[i,c,f,h,y,C,D,E,S,O,R]);return a.jsx(Kb.Provider,{value:w,children:n})}function ja(){const n=p.useContext(Kb);if(!n)throw new Error("useAuth must be used inside AuthProvider");return n}const Jv=50,Zb=p.createContext(null);function R5({children:n}){const{phase:i,reportUnauthorized:r}=ja(),c=i==="authenticated",[d,f]=p.useState(null),[m,h]=p.useState(!1),[g,y]=p.useState(null),[b,x]=p.useState(null),[j,S]=p.useState(null),[R,k]=p.useState([]),[C,D]=p.useState(0),[E,O]=p.useState(null),[w,U]=p.useState(0),Y=p.useCallback(()=>D(0),[]),A=p.useCallback(()=>{k([]),D(0)},[]);p.useEffect(()=>{if(!c){f(null),h(!1),y(null),x(null),S(null),k([]),D(0),O(null);return}let W=!1,I=null;const ne=()=>{h(!0),y(null)},F=()=>h(!1),Z=L=>{h(!1);const ee=L.data;if(L.message==="UNAUTHORIZED"||ee?.reason==="unauthorized"){r();return}if(L.message==="FORBIDDEN"||ee?.reason){y(ee?.detail??"Live updates were blocked by the dashboard.");return}y("Live updates are unavailable. Data still refreshes on the page.")},te=L=>x(L),ce=L=>S(L),K=L=>{k(ee=>{const de=ee.filter(Ne=>Ne.id!==L.id),ke=[L,...de];return ke.length>Jv?ke.slice(0,Jv):ke}),D(ee=>Math.min(ee+1,99))},H=L=>{O(L),U(ee=>ee+1)};return(async()=>{try{if(!j5){const{createRealtimeClient:L}=await v5(async()=>{const{createRealtimeClient:ee}=await import("./socket-DwLPrgsr.js");return{createRealtimeClient:ee}},[],import.meta.url);I=L()}if(W){I.disconnect();return}I.on("connect",ne),I.on("disconnect",F),I.on("connect_error",Z),I.on("nginx:status",te),I.on("domain:health",ce),I.on("notification:new",K),I.on("local:changed",H),f(I),I.connect()}catch{W||y("Could not start the live connection.")}})(),()=>{W=!0,I&&(I.off("connect",ne),I.off("disconnect",F),I.off("connect_error",Z),I.off("nginx:status",te),I.off("domain:health",ce),I.off("notification:new",K),I.off("local:changed",H),I.disconnect()),h(!1)}},[c,r]);const M=p.useMemo(()=>({client:d,connected:m,connectionError:g,nginxStatus:b,domainHealth:j,notifications:R,unread:C,markAllRead:Y,clearNotifications:A,lastChange:E,changeSeq:w}),[d,m,g,b,j,R,C,Y,A,E,w]);return a.jsx(Zb.Provider,{value:M,children:n})}function yn(){const n=p.useContext(Zb);if(!n)throw new Error("useRealtime must be used inside RealtimeProvider");return n}const Qb=p.createContext(null);function z5({children:n}){const{phase:i}=ja(),r=i==="authenticated",{client:c,connected:d}=yn(),f=Tt(E=>fe.service.status(E),[r],{enabled:r}),{setData:m,reload:h,reloadSilent:g}=f;hl(h,6e4,r);const y=p.useRef(!1);p.useEffect(()=>{if(!r){y.current=!1;return}const E=f.data?.probes;if(!E)return;if(!E.pending){y.current=!1;return}if(y.current)return;const O=setTimeout(()=>{y.current=!0,g()},1500);return()=>clearTimeout(O)},[r,f.data,g]);const b=p.useCallback(E=>{m(O=>O&&{...O,backgroundService:{...O.backgroundService,...E}})},[m]),x=p.useRef(null),j=p.useRef(!1),S=p.useRef(!1);S.current=f.loading;const R=p.useCallback(()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{if(x.current=null,S.current){j.current=!0;return}h()},250)},[h]);p.useEffect(()=>{!f.loading&&j.current&&(j.current=!1,h())},[f.loading,h]),p.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),p.useEffect(()=>{if(!r||!c)return;const E=O=>{b(O),R()};return c.on("service:changed",E),()=>c.off("service:changed",E)},[r,c,b,R]);const k=p.useRef(!1),C=p.useRef(!1);p.useEffect(()=>{if(!r){k.current=!1,C.current=!1;return}d&&!k.current&&(C.current&&R(),C.current=!0),k.current=d},[r,d,R]);const D=p.useMemo(()=>({service:f.data,loading:f.loading,error:f.error,reload:f.reload,applyBackgroundService:b}),[f.data,f.loading,f.error,f.reload,b]);return a.jsx(Qb.Provider,{value:D,children:n})}function $r(){const n=p.useContext(Qb);if(!n)throw new Error("useService must be used inside ServiceProvider");return n}const Ib=[{label:"Manage",items:[{to:"/",label:"Overview",title:"Overview",description:"The state of nginx, your domains and their certificates at a glance.",icon:KS},{to:"/domains",label:"Domains",title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",icon:Os},{to:"/ssl",label:"SSL certificates",title:"SSL certificates",description:"Issue and renew Let’s Encrypt certificates for your domains.",icon:Rn},{to:"/nginx",label:"Nginx",title:"Nginx",description:"Service status, configuration files and live logs.",icon:gl},{to:"/deployments",label:"Deployments",title:"Deployments",description:"Put a project from a git repository on this server and keep it deployed.",icon:Tr}]},{label:"Monitor",items:[{to:"/notifications",label:"Notifications",title:"Notifications",description:"Delivery channels, test messages and recent events.",icon:Vh},{to:"/processes",label:"Processes",title:"Processes",description:"The Easy DevOps background service and your own PM2 apps.",icon:Db},{to:"/logs",label:"Logs",title:"Logs",description:"nginx access and error output as it is written.",icon:Er}]},{label:"System",items:[{to:"/settings",label:"Settings",title:"Settings",description:"Access, authentication, Hub pairing and backup.",icon:zk}]}],D5=Ib.flatMap(n=>n.items);function Pb(n){return D5.find(i=>i.to==="/"?n==="/":n===i.to||n.startsWith(`${i.to}/`))}function Fb({className:n}){return a.jsxs("span",{className:oe("inline-flex shrink-0 items-center",n),"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 A5=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",year:"numeric"}),O5=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"});function Ph(n){if(n==null||n==="")return"—";const i=typeof n=="number"?new Date(n):new Date(n);return Number.isNaN(i.getTime())?"—":A5.format(i)}function Fh(n){if(n==null||n==="")return"—";const i=typeof n=="number"?new Date(n):new Date(n);return Number.isNaN(i.getTime())?"—":O5.format(i)}function qr(n){const i=Math.max(0,Math.round((Date.now()-n)/1e3));if(i<10)return"just now";if(i<60)return`${i}s ago`;const r=Math.floor(i/60);if(r<60)return`${r}m ago`;const c=Math.floor(r/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Jb(){return new Date().getFullYear()}function Wb(n){if(n==null)return"—";if(n<1024)return`${n} B`;const i=["KB","MB","GB","TB"];let r=n/1024,c=0;for(;r>=1024&&c<i.length-1;)r/=1024,c+=1;return`${r.toFixed(r<10?1:0)} ${i[c]}`}function au(n){if(n==null||n<0)return"—";const i=Math.floor(n/6e4);if(i<1)return"<1m";if(i<60)return`${i}m`;const r=Math.floor(i/60);return r<24?`${r}h ${i%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function vi(n){return n===null?"Unknown":n<0?`Expired ${Math.abs(n)} day${Math.abs(n)===1?"":"s"} ago`:n===0?"Expires today":`${n} day${n===1?"":"s"} left`}function M5(n){return n==null?"—":`${n.toFixed(1)}%`}function $n(n,i,r=`${i}s`){return`${n} ${n===1?i:r}`}function _5(n,i=48){if(n.length<=i)return n;const r=Math.ceil((i-1)/2),c=Math.floor((i-1)/2);return`${n.slice(0,r)}…${n.slice(-c)}`}const L5={personal:"Personal","windows-service":"Windows service",systemd:"systemd",unknown:"Unknown"},U5={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"},H5={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 B5(n){switch(n.backgroundService.mechanism){case"startup-supervisor":return"personal";case"winsw":return"windows-service";case"systemd":return"systemd";default:return"unknown"}}function $5(n){return n==="logon"?"At logon":n==="boot"?"At boot":"Unknown"}function q5(n){return n.jobsRunningHere?"This dashboard":n.jobsOwnerRole==="daemon"?"Background service":n.jobsOwnerRole==="dashboard"?"Another dashboard process":n.running?"Background service":"Paused — no owner"}function Gr(n){if(!n)return null;const i=n.backgroundService,r=B5(n),c=i.startsAt==="logon"||i.startsAt==="boot"?i.startsAt:"unknown",d=i.runtime??null,f=i.stoppedAt??null,m=Array.from(new Set([...i.warnings??[],...d?.warnings??[]]));return{running:i.running,connected:i.connected,jobsRunningHere:i.jobsRunningHere,jobsOwnerLabel:q5(i),pid:i.pid,version:i.version,startedAt:i.startedAt,uptimeMs:i.startedAt?Math.max(0,Date.now()-i.startedAt):null,heartbeatAgeMs:i.heartbeatAgeMs??null,mechanism:r,mechanismLabel:L5[r],mechanismDetail:U5[r],startsAt:c,startsAtLabel:$5(c),installed:i.installed===!0,stoppedByUser:i.stoppedByUser===!0,stoppedAt:f,stoppedAtLabel:f?Fh(f):null,state:i.state??null,detail:i.detail??null,enabledOnBoot:i.enabledOnBoot??null,restarts:i.restarts??0,crashLooping:i.crashLooping===!0,dataDir:i.dataDir,installCommand:n.install.command,installGuidance:H5[r],runtime:d,warnings:m}}function Uc(n){return n?n.running?"Running":n.stoppedByUser?"Stopped by you":n.installed?"Not running":"Not installed":"Unknown"}function G5(n){if(!n)return null;const i=n.pinned,r=i?.version??null,c=n.systemNode.version??null,d=!!(i&&i.kind!=="none"&&i.exists!==!1),f=d&&!!(r&&c)&&r===c&&!i?.differsFromSystem;return{serviceVersion:r,servicePath:i?.path??null,systemVersion:c,systemPath:n.systemNode.path??null,sameAsSystem:f,broken:i?.broken===!0,pinned:d,kind:i?.kind??null,manager:n.manager?.managed?n.manager.manager??null:null}}const Y5={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"},e0={neutral:"bg-faint",accent:"bg-accent",ok:"bg-ok",warn:"bg-warn",bad:"bg-bad",info:"bg-info"};function je({tone:n="neutral",children:i,className:r,dot:c=!1}){return a.jsxs("span",{className:oe("inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-2xs font-medium tracking-wide",Y5[n],r),children:[c&&a.jsx("span",{className:oe("size-1.5 rounded-full",e0[n]),"aria-hidden":"true"}),i]})}function ln({tone:n="ok",pulse:i=!1,className:r}){return a.jsx("span",{className:oe("inline-block size-2 shrink-0 rounded-full",e0[n],i&&"live-dot",r),"aria-hidden":"true"})}const V5='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Wv({onNavigate:n}){const{service:i}=$r(),r=Gr(i),c=r?r.running?{tone:"ok",label:"Service running"}:r.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:oe("flex h-[var(--ez-topbar-height)] shrink-0 items-center gap-2.5 border-b border-line px-4",n&&"pr-12"),children:[a.jsx(Fb,{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:Ib.map((d,f)=>a.jsxs("div",{className:oe(f>0&&"mt-5"),children:[a.jsx("div",{className:"mb-1.5 px-2 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:d.label}),a.jsx("div",{className:"space-y-0.5",children:d.items.map(m=>{const h=m.icon;return a.jsx(Sb,{to:m.to,end:m.to==="/",onClick:n,className:({isActive:g})=>oe("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)]",g?"bg-accent-soft text-ink":"text-muted hover:bg-inset hover:text-ink"),children:({isActive:g})=>a.jsxs(a.Fragment,{children:[a.jsx("span",{className:oe("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)]",g?"opacity-100":"opacity-0"),"aria-hidden":"true"}),a.jsx(h,{className:oe("size-4 shrink-0 transition-colors",g?"text-accent-text":"text-faint group-hover:text-muted"),"aria-hidden":"true"}),m.label]})},m.to)})})]},d.label))}),a.jsx("div",{className:"border-t border-line p-3",children:a.jsxs(kt,{to:"/processes",onClick:n,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: ${c.label}. Open Processes.`,children:[a.jsx(ln,{tone:c.tone,pulse:c.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:c.label})]})]})})]})}function X5({open:n,onClose:i}){const r=p.useRef(null),c=p.useRef(null);return p.useEffect(()=>{if(!n)return;const d=document.activeElement,f=document.body.style.overflow;document.body.style.overflow="hidden";const m=window.setTimeout(()=>c.current?.focus(),0),h=g=>{if(g.key==="Escape"){g.preventDefault(),i();return}if(g.key!=="Tab")return;const y=r.current;if(!y)return;const b=Array.from(y.querySelectorAll(V5)).filter(R=>R.offsetParent!==null);if(b.length===0)return;const x=b[0],j=b[b.length-1],S=document.activeElement;g.shiftKey&&(S===x||S===y)?(g.preventDefault(),j.focus()):!g.shiftKey&&S===j&&(g.preventDefault(),x.focus())};return document.addEventListener("keydown",h,!0),()=>{window.clearTimeout(m),document.removeEventListener("keydown",h,!0),document.body.style.overflow=f,d?.focus()}},[n,i]),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(Wv,{})}),n&&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:i,"aria-hidden":"true"}),a.jsxs("aside",{ref:r,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(ct,{ref:c,label:"Close navigation",size:"sm",onClick:i,className:"absolute right-2 top-2 z-10",children:a.jsx(Ms,{className:"size-4","aria-hidden":"true"})}),a.jsx(Wv,{onNavigate:i})]})]})]})}function K5(n){return n.type==="nginx_down"?gl:n.type==="cert_expiry"?as:n.type==="domain_health"?Lc:n.type==="deploy"?Tr:Qh}function Z5(n){return n==="danger"?"text-bad":n==="warning"?"text-warn":n==="success"?"text-ok":n==="info"?"text-info":"text-muted"}function Q5(){const{notifications:n,unread:i,markAllRead:r,clearNotifications:c}=yn(),[d,f]=p.useState(!1),[,m]=p.useState(0),h=p.useRef(null),g=p.useRef(null);p.useEffect(()=>{if(!d)return;r();const b=j=>{h.current&&!h.current.contains(j.target)&&f(!1)},x=j=>{j.key==="Escape"&&(f(!1),g.current?.focus())};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",x),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",x)}},[d,r]),p.useEffect(()=>{d&&r()},[d,n.length,r]),p.useEffect(()=>{if(!d)return;const b=setInterval(()=>m(x=>x+1),3e4);return()=>clearInterval(b)},[d]);const y=i>0?`Notifications, ${i} unread`:"Notifications";return a.jsxs("div",{ref:h,className:"sm:relative",children:[a.jsxs("div",{className:"relative",children:[a.jsx(ct,{ref:g,label:y,onClick:()=>f(b=>!b),"aria-expanded":d,"aria-haspopup":"dialog","aria-controls":"notifications-panel",className:oe(d&&"bg-inset text-ink"),children:a.jsx(Vh,{className:"size-4.5","aria-hidden":"true"})}),i>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:i>9?"9+":i})]}),d&&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"}),n.length>0&&a.jsx("button",{type:"button",onClick:c,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:n.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[a.jsx(Iw,{className:"size-5 text-faint","aria-hidden":"true"}),a.jsx("div",{className:"text-xs text-muted",children:"All clear — no notifications yet."})]}):n.map(b=>{const x=K5(b);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(x,{className:oe("mt-0.5 size-4 shrink-0",Z5(b.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:b.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:qr(b.timestamp)})]})]},b.id)})}),a.jsx("div",{className:"border-t border-line bg-raised/50 px-4 py-2",children:a.jsx(kt,{to:"/notifications",onClick:()=>f(!1),className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Open notification settings"})})]})]})}function I5({onMenu:n}){const{pathname:i}=qn(),{theme:r,toggleTheme:c}=Eb(),{nginxStatus:d,connected:f,connectionError:m}=yn(),{logout:h}=ja(),g=Et(),[y,b]=p.useState(!1),x=Pb(i)?.title??"Easy DevOps",j=d?.running===!0,S=d===null?"Unknown":j?"Running":"Stopped",R=async()=>{if(!y){b(!0);try{await h(),g.success("Signed out","Your dashboard session has ended.")}finally{b(!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(ct,{label:"Open navigation",size:"sm",onClick:n,className:"lg:hidden",children:a.jsx(sk,{className:"size-4.5","aria-hidden":"true"})}),a.jsx("div",{className:"truncate text-sm font-semibold text-ink",children:x})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1 sm:gap-1.5",children:[a.jsxs(kt,{to:"/nginx","aria-label":`Nginx is ${S.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(ln,{tone:d===null?"neutral":j?"ok":"bad",pulse:j&&f}),a.jsx("span",{className:"font-medium text-ink",children:"nginx"}),a.jsx("span",{className:"text-faint",children:S})]}),a.jsx(kt,{to:"/nginx","aria-label":`Nginx is ${S.toLowerCase()}. Open Nginx.`,className:"flex size-9 items-center justify-center rounded-md transition-colors hover:bg-inset sm:hidden",children:a.jsx(ln,{tone:d===null?"neutral":j?"ok":"bad",pulse:j&&f})}),a.jsxs("span",{className:"hidden items-center gap-1.5 pl-1 pr-2 text-2xs text-faint md:flex",title:m??(f?"Live updates are connected.":"Reconnecting to live updates…"),children:[a.jsx("span",{className:oe("size-1.5 rounded-full",m?"bg-bad":f?"bg-ok live-dot":"bg-faint"),"aria-hidden":"true"}),m?"Live blocked":f?"Live":"Connecting"]}),a.jsx(Q5,{}),a.jsx(ct,{label:r==="dark"?"Switch to light theme":"Switch to dark theme",onClick:c,children:r==="dark"?a.jsx(Vb,{className:"size-4.5","aria-hidden":"true"}):a.jsx(Hb,{className:"size-4.5","aria-hidden":"true"})}),a.jsx(ct,{label:"Sign out",onClick:R,disabled:y,className:"hover:text-bad",children:a.jsx(nk,{className:"size-4.5","aria-hidden":"true"})})]})]})}function et({className:n,children:i,...r}){return a.jsx("div",{className:oe("rounded-lg border border-line bg-surface shadow-card",n),...r,children:i})}function pn({title:n,description:i,actions:r,className:c,icon:d}){return a.jsxs("div",{className:oe("flex flex-wrap items-start justify-between gap-3 border-b border-line px-4 py-3.5 sm:px-5",c),children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[d&&a.jsx("div",{className:"mt-0.5 text-muted",children:d}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:n}),i&&a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i})]})]}),r&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]})}function xn({className:n,children:i,...r}){return a.jsx("div",{className:oe("px-4 py-4 sm:px-5",n),...r,children:i})}function zc({className:n,children:i}){return a.jsx("div",{className:oe("flex flex-wrap items-center justify-between gap-2 border-t border-line bg-raised/50 px-4 py-3 sm:px-5",n),children:i})}function _s({className:n}){return a.jsx(gn,{className:oe("spin size-4 text-muted",n),"aria-hidden":"true"})}function tt({className:n}){return a.jsx("div",{className:oe("skeleton",n),"aria-hidden":"true"})}function ns({children:n}){return a.jsx("div",{className:"page-enter space-y-5","aria-busy":"true","aria-label":"Loading",children:n})}function P5(){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(gn,{className:"spin size-5 text-accent-text","aria-hidden":"true"}),a.jsx("span",{className:"text-sm",children:"Loading Easy DevOps…"})]})})}function ga({title:n,description:i,action:r,icon:c,className:d}){return a.jsxs("div",{className:oe("flex flex-col items-center justify-center px-6 py-12 text-center",d),children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-inset text-faint",children:c??a.jsx(GS,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-medium text-ink",children:n}),i&&a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:i}),r&&a.jsx("div",{className:"mt-4",children:r})]})}function ve({tone:n="info",title:i,children:r,action:c,className:d}){const f={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"}[n],m={info:Ub,warning:fl,danger:fl,success:ts}[n];return a.jsx("div",{className:oe("rounded-md border px-3.5 py-3 text-xs",f,d),role:"status",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(m,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 text-muted",children:[i&&a.jsx("div",{className:"font-medium text-ink",children:i}),r&&a.jsx("div",{className:oe(i?"mt-0.5":void 0,"break-words"),children:r})]}),c&&a.jsx("div",{className:"shrink-0",children:c})]})})}function qt({error:n,onRetry:i,title:r,className:c}){const d=n instanceof Ue?n:null,f=d?.status===403,m=typeof d?.payload?.detail=="string"?d.payload.detail:void 0,h=d?.message??(n instanceof Error?n.message:"Something went wrong while loading this section.");return a.jsx(et,{className:oe("border-bad/25",c),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:f?a.jsx(as,{className:"size-5","aria-hidden":"true"}):a.jsx(fl,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-semibold text-ink",children:r??(f?"Request blocked":"Could not load this section")}),a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:h}),m&&a.jsx("p",{className:"mt-1 max-w-md break-all font-mono text-2xs text-faint",children:m}),d&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",d.status,d.code?` · ${d.code}`:""]}),i&&a.jsx(ae,{className:"mt-4",variant:"secondary",size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:i,children:"Try again"})]})})}const ey="ez-service-banner-dismissed";function th({children:n}){return a.jsx("code",{className:"font-mono text-ink",children:n})}function F5(n){return n.startsAt==="logon"?"at your next logon":n.startsAt==="boot"?"at the next boot":"when the service starts"}function J5(n){return n.running?{code:"running",tone:"info",title:"Background service is running",body:"This dashboard is the interface only.",action:"Open Processes"}:n.stoppedByUser?{code:"stopped_by_user",tone:"warning",title:"The background service is stopped",body:a.jsxs(a.Fragment,{children:["You stopped it",n.stoppedAtLabel?` on ${n.stoppedAtLabel}`:"",", so monitoring and notifications are paused. It starts again ",F5(n),", or run"," ",a.jsx(th,{children:"ezz service start"})," to start it now."]}),action:"Open Processes"}:{code:"not_running",tone:"warning",title:"The background service is not running",body:n.installed?a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Start the service with ",a.jsx(th,{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(th,{children:n.installCommand}),"."]}),action:"Open Processes"}}function W5(){const{service:n}=$r(),{pathname:i}=qn(),[r,c]=p.useState(()=>{try{return sessionStorage.getItem(ey)}catch{return null}}),d=Gr(n),f=d?J5(d):null,m=i!=="/processes",h=p.useMemo(()=>!d||!f?"":[f.code,d.pid,d.startedAt,d.stoppedByUser,d.stoppedAt,d.startsAt,d.installed].join("|"),[d,f]);if(!d||!f||r===h)return null;const g=()=>{c(h);try{sessionStorage.setItem(ey,h)}catch{}};return a.jsx("div",{className:"fade-enter mb-5",children:a.jsx(ve,{tone:f.tone,title:f.title,action:a.jsxs("div",{className:"flex items-center gap-1",children:[m&&a.jsxs(kt,{to:"/processes",className:oe("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:[f.action,a.jsx(bi,{className:"size-3","aria-hidden":"true"})]}),a.jsx(ct,{label:"Dismiss banner",size:"sm",onClick:g,children:a.jsx(Ms,{className:"size-3.5","aria-hidden":"true"})})]}),children:f.body})})}const eC={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 tC(){const{blocked:n,dismissBlocked:i}=ja();if(!n)return null;const r=n.blockedReason,c=typeof n.payload.detail=="string"?n.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(as,{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:r?eC[r]??"The dashboard refused this request.":n.message}),c&&a.jsx("div",{className:"mt-1 break-all font-mono text-2xs text-faint",children:c}),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(ae,{variant:"ghost",size:"sm",onClick:i,className:"-mr-1 -mt-1 shrink-0",children:"Dismiss"})]})})}class nC extends p.Component{state={error:null};static getDerivedStateFromError(i){return{error:i}}componentDidCatch(i,r){console.error(`[ui] ${this.props.area??"page"} crashed`,i,r.componentStack)}render(){return this.state.error?a.jsx(et,{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(as,{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(ae,{className:"mt-4",size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>this.setState({error:null}),children:"Try again"})]})}):this.props.children}}function aC(){const[n,i]=p.useState(!1),{pathname:r}=qn(),c=p.useRef(null),d=p.useCallback(()=>i(!1),[]);p.useEffect(()=>{i(!1),c.current?.scrollTo({top:0}),c.current?.focus({preventScroll:!0})},[r]),p.useEffect(()=>{const m=window.matchMedia("(min-width: 1024px)"),h=()=>{m.matches&&i(!1)};return m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]);const f=Pb(r);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(X5,{open:n,onClose:d}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx(I5,{onMenu:()=>i(!0)}),a.jsx("main",{ref:c,id:"main-content",tabIndex:-1,className:"min-h-0 flex-1 overflow-y-auto outline-none",children:a.jsxs("div",{className:"relative isolate 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("div",{className:"dashboard-ambient -z-10","aria-hidden":"true"}),a.jsx(W5,{}),a.jsx(tC,{}),a.jsx("div",{className:"page-enter",children:a.jsx(nC,{area:f?.title,children:a.jsx(P2,{})})},r)]})}),a.jsxs("footer",{className:"shrink-0 border-t border-line bg-canvas px-3 py-1.5 text-center text-[10px] text-faint sm:px-5",children:["© ",Jb()," Easy DevOps · provided by"," ",a.jsx("a",{href:"https://devxor.team",target:"_blank",rel:"noopener noreferrer",className:"text-muted underline-offset-2 transition-colors hover:text-ink hover:underline",children:"DevXor Team"})]})]})]})}function sC(){const{bootError:n,retryBoot:i}=ja(),[r,c]=p.useState(!1),d=async()=>{c(!0),await i(),c(!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(dk,{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:[n?.message??"The dashboard did not answer."," Check that Easy DevOps is running, then try again."]}),n&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",n.status===0?"connection failed":n.status]}),a.jsx(ae,{variant:"primary",loading:r,onClick:d,icon:a.jsx(Ct,{className:"size-4","aria-hidden":"true"}),className:"mt-5",children:"Try again"})]})})}const Jh="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",su="border-bad/60 hover:border-bad focus:border-bad focus:ring-bad/25";function lu({htmlFor:n,children:i,optional:r,trailing:c}){return a.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between gap-2",children:[a.jsxs("label",{htmlFor:n,className:"flex items-baseline gap-2 text-xs font-medium text-muted",children:[a.jsx("span",{children:i}),r&&a.jsx("span",{className:"text-2xs font-normal text-faint",children:"Optional"})]}),c]})}function iu({id:n,children:i}){return a.jsx("p",{id:n,className:"mt-1.5 text-xs text-bad",role:"alert",children:i})}function ml({id:n,children:i}){return a.jsx("p",{id:n,className:"mt-1.5 text-xs text-faint",children:i})}function Me({label:n,hint:i,error:r,optional:c,trailing:d,id:f,className:m,...h}){const g=p.useId(),y=f??g,b=`${y}-error`,x=`${y}-hint`;return a.jsxs("div",{className:m,children:[n&&a.jsx(lu,{htmlFor:y,optional:c,children:n}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{id:y,className:oe(Jh,"h-9",!!d&&"pr-10",r&&su),"aria-invalid":r?!0:void 0,"aria-describedby":r?b:i?x:void 0,...h}),d&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-1.5",children:d})]}),r?a.jsx(iu,{id:b,children:r}):i?a.jsx(ml,{id:x,children:i}):null]})}function Hc({label:n,hint:i,error:r,optional:c,id:d,className:f,...m}){const h=p.useId(),g=d??h,y=`${g}-error`,b=`${g}-hint`;return a.jsxs("div",{className:f,children:[n&&a.jsx(lu,{htmlFor:g,optional:c,children:n}),a.jsx("textarea",{id:g,className:oe(Jh,"min-h-24 py-2 leading-relaxed",r&&su),"aria-invalid":r?!0:void 0,"aria-describedby":r?y:i?b:void 0,...m}),r?a.jsx(iu,{id:y,children:r}):i?a.jsx(ml,{id:b,children:i}):null]})}function pa({label:n,hint:i,error:r,optional:c,id:d,className:f,children:m,...h}){const g=p.useId(),y=d??g,b=`${y}-error`,x=`${y}-hint`;return a.jsxs("div",{className:f,children:[n&&a.jsx(lu,{htmlFor:y,optional:c,children:n}),a.jsx("select",{id:y,className:oe(Jh,"h-9 cursor-pointer pr-8",r&&su),"aria-invalid":r?!0:void 0,"aria-describedby":r?b:i?x:void 0,...h,children:m}),r?a.jsx(iu,{id:b,children:r}):i?a.jsx(ml,{id:x,children:i}):null]})}function lC({label:n,hint:i,error:r,optional:c,value:d,onChange:f,normalize:m,max:h,placeholder:g,className:y,id:b}){const x=p.useId(),j=b??x,[S,R]=p.useState(""),[k,C]=p.useState(null),D=`${j}-error`,E=`${j}-hint`,O=k??r??null,w=()=>{const U=S.trim();if(!U)return;let Y=d;for(const A of U.split(/[\n,]/)){if(!A.trim())continue;const M=m(A,Y);if(M.error||!M.value){C(M.error??"This path cannot be added."),R(A.trim());return}Y.includes(M.value)||(Y=[...Y,M.value])}f(Y),R(""),C(null)};return a.jsxs("div",{className:y,children:[n&&a.jsx(lu,{htmlFor:j,optional:c,trailing:h?a.jsxs("span",{className:"text-2xs font-normal text-faint",children:[d.length,"/",h]}):void 0,children:n}),a.jsxs("div",{className:oe("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-canvas px-2 py-1.5 transition-colors duration-[var(--ez-motion-fast)]",O?su:"border-line hover:border-line-strong focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/25"),children:[d.map(U=>a.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded-sm border border-line bg-inset py-0.5 pl-2 pr-1 font-mono text-xs text-ink",children:[a.jsx("span",{className:"truncate",children:U}),a.jsx("button",{type:"button",onClick:()=>{f(d.filter(Y=>Y!==U)),C(null)},className:"shrink-0 rounded-sm p-0.5 text-faint transition-colors hover:bg-canvas hover:text-bad focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50","aria-label":`Remove ${U}`,children:a.jsx(Ms,{className:"size-3","aria-hidden":"true"})})]},U)),a.jsx("input",{id:j,value:S,onChange:U=>{R(U.target.value),k&&C(null)},onKeyDown:U=>{(U.key==="Enter"||U.key===",")&&(U.preventDefault(),w()),U.key==="Backspace"&&!S&&d.length>0&&f(d.slice(0,-1))},onBlur:w,placeholder:d.length===0?g:void 0,"aria-invalid":O?!0:void 0,"aria-describedby":O?D:i?E:void 0,className:"h-6 min-w-24 flex-1 bg-transparent font-mono text-sm text-ink placeholder:text-faint focus:outline-none",spellCheck:!1,autoComplete:"off"}),a.jsx("button",{type:"button",onClick:w,disabled:!S.trim(),className:"shrink-0 rounded-sm p-1 text-faint transition-colors hover:bg-inset hover:text-ink focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:pointer-events-none disabled:opacity-40","aria-label":"Add path",children:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"})})]}),O?a.jsx(iu,{id:D,children:O}):i?a.jsx(ml,{id:E,children:i}):null]})}function pl({label:n,hint:i,checked:r,onChange:c,disabled:d,className:f,id:m}){const h=p.useId(),g=m??h;return a.jsxs("div",{className:oe("flex items-start gap-2.5",f),children:[a.jsx("input",{id:g,type:"checkbox",checked:r,disabled:d,onChange:y=>c(y.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:g,className:oe("cursor-pointer text-sm text-ink",d&&"cursor-not-allowed opacity-60"),children:n}),i&&a.jsx("p",{className:"mt-0.5 text-xs text-faint",children:i})]})]})}function Zt({checked:n,onChange:i,label:r,ariaLabel:c,description:d,disabled:f,className:m}){const h=p.useId();return a.jsxs("div",{className:oe("flex items-start justify-between gap-4",m),children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{id:h,className:"text-sm text-ink",children:r}),d&&a.jsx("div",{className:"mt-0.5 text-xs text-faint",children:d})]}),a.jsx("button",{type:"button",role:"switch","aria-checked":n,"aria-labelledby":c?void 0:h,"aria-label":c,disabled:f,onClick:()=>i(!n),className:oe("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",n?"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:oe("inline-block size-3.5 rounded-full bg-white shadow-sm transition-transform duration-[var(--ez-motion-fast)]",n?"translate-x-[18px]":"translate-x-[3px]")})})]})}function Ja({children:n,className:i}){return a.jsx("div",{className:oe("grid gap-4 sm:grid-cols-2",i),children:n})}const iC=["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"],rC="This code has expired. Get a new one with: ezz dashboard setup-code";function ty(n){return n?.setupCodeRequired!==!0?!1:n.setupCodeExpiresAt===null||n.setupCodeExpiresAt<=Date.now()}function ny({compact:n=!1}){return a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(Fb,{className:"h-6"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold tracking-tight text-ink",children:"Easy DevOps"}),!n&&a.jsx("div",{className:"text-2xs text-faint",children:"Server control plane"})]})]})}function oC({children:n}){const{theme:i,toggleTheme:r}=Eb();return a.jsxs("div",{className:"relative flex min-h-full flex-col 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 my-auto grid w-full max-w-4xl self-center 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(ny,{}),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:iC.map(c=>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(dl,{className:"size-2.5","aria-hidden":"true"})}),c]},c))})]}),a.jsxs("div",{className:"flex items-center gap-2 text-2xs text-faint",children:[a.jsx(Xh,{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(ny,{compact:!0})}),a.jsx(ct,{label:i==="dark"?"Switch to light theme":"Switch to dark theme",onClick:r,children:i==="dark"?a.jsx(Vb,{className:"size-4.5","aria-hidden":"true"}):a.jsx(Hb,{className:"size-4.5","aria-hidden":"true"})})]}),n]})]}),a.jsxs("footer",{className:"relative py-4 text-center text-2xs text-faint",children:["© ",Jb()," Easy DevOps · provided by"," ",a.jsx("a",{href:"https://devxor.team",target:"_blank",rel:"noopener noreferrer",className:"text-muted underline-offset-2 transition-colors hover:text-ink hover:underline",children:"DevXor Team"})]})]})}function t0({show:n,onToggle:i}){return a.jsx(ct,{label:n?"Hide password":"Show password",size:"sm",onClick:i,className:"text-faint hover:text-ink",children:n?a.jsx(Mb,{className:"size-4","aria-hidden":"true"}):a.jsx(_b,{className:"size-4","aria-hidden":"true"})})}function n0({error:n,cooldown:i=0}){if(!n)return null;const r=typeof n.payload.hint=="string"?n.payload.hint:void 0,c=a0(n),d=i>0?i:c;return a.jsx(ve,{tone:"danger",title:c===null?n.message:"Too many attempts",className:"mb-4",children:r??(d===null?void 0:i>0?`Try again in ${cC(d)}.`:"You can try again now.")})}function a0(n){if(n?.status!==429)return null;const i=n.payload.retryAfterSeconds;return typeof i!="number"||!Number.isFinite(i)||i<=0?null:Math.ceil(i)}function cC(n){return n>=120?`${Math.ceil(n/60)} minutes`:n>=60?"1 minute":`${n} second${n===1?"":"s"}`}function s0(){const[n,i]=p.useState(0);return p.useEffect(()=>{if(n<=0)return;const c=window.setTimeout(()=>i(d=>Math.max(0,d-1)),1e3);return()=>window.clearTimeout(c)},[n]),{remaining:n,start:c=>{const d=a0(c);d!==null&&i(d)}}}function uC(){const{login:n,retryBoot:i,sessionMessage:r}=ja(),[c,d]=p.useState(""),[f,m]=p.useState(!1),[h,g]=p.useState(null),[y,b]=p.useState(null),[x,j]=p.useState(!1),S=s0(),R=S.remaining,k=async C=>{if(C.preventDefault(),!(R>0)){if(!c){g("Enter your password.");return}g(null),b(null),j(!0);try{await n(c)}catch(D){const E=D instanceof Ue?D:null;if(E?.payload.needsSetup){await i();return}if(E?.status===409){await i();return}E?.status===429&&S.start(E),b(E)}finally{j(!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."})]}),r&&a.jsx(ve,{tone:"info",title:"You were signed out",className:"mb-4",children:r}),a.jsx(n0,{error:y,cooldown:R}),a.jsxs("form",{onSubmit:k,noValidate:!0,children:[a.jsx(Me,{label:"Password",type:f?"text":"password",value:c,onChange:C=>{d(C.target.value),h&&g(null)},error:h,autoComplete:"current-password",autoFocus:!0,trailing:a.jsx(t0,{show:f,onToggle:()=>m(C=>!C)})}),a.jsxs(ae,{type:"submit",variant:"primary",size:"lg",loading:x,disabled:R>0,className:"mt-5 w-full",children:[R>0?`Try again in ${R}s`:"Sign in",!x&&R===0&&a.jsx(bi,{className:"size-4","aria-hidden":"true"})]})]})]})}function dC(){const{auth:n,setup:i,retryBoot:r}=ja(),c=n?.minPasswordLength??8,d=n?.canUseNoPassword===!0,f=n?.setupCodeRequired===!0,m=ty(n),[h,g]=p.useState("password"),[y,b]=p.useState(""),[x,j]=p.useState(""),[S,R]=p.useState(""),[k,C]=p.useState(!1),[D,E]=p.useState({}),[O,w]=p.useState(null),[U,Y]=p.useState(!1),A=s0(),M=A.remaining,W=async I=>{if(I.preventDefault(),M>0)return;const ne={};if(f&&!y.trim()&&(ne.code="Enter the setup code shown by the server."),h==="password"&&(x.length<c&&(ne.password=`Use at least ${c} characters.`),S!==x&&(ne.confirm="The two passwords do not match.")),E(ne),!(Object.keys(ne).length>0)){w(null),Y(!0);try{if(h==="none")await i({mode:"none"});else{const F=y.trim();await i({password:x,mode:"password",...F?{setupCode:F}:{}})}}catch(F){const Z=F instanceof Ue?F:null;if(Z?.status===409){await r();return}if(Z?.status===400&&ty(n)){w(null);return}Z?.status===429&&A.start(Z),w(Z)}finally{Y(!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(n0,{error:O,cooldown:M}),a.jsxs("form",{onSubmit:W,noValidate:!0,children:[a.jsxs("div",{className:oe("grid gap-2",d&&"grid-cols-2"),role:"group","aria-label":"Authentication method",children:[a.jsxs("button",{type:"button","aria-pressed":h==="password",onClick:()=>g("password"),className:oe("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(Hr,{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."})]}),d&&a.jsxs("button",{type:"button","aria-pressed":h==="none",onClick:()=>g("none"),className:oe("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(Mk,{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."})]})]}),f&&m&&a.jsx(ve,{tone:"warning",title:rC,className:"mt-4",children:"Run that on the server, then reload this page to enter the new code."}),f&&a.jsx(Me,{className:"mt-4",label:"Setup code",value:y,onChange:I=>{b(I.target.value),D.code&&E(ne=>({...ne,code:void 0}))},error:D.code,hint:"Printed in the terminal where the dashboard was started.",autoComplete:"one-time-code"}),h==="password"?a.jsxs(a.Fragment,{children:[a.jsx(Me,{className:"mt-4",label:"Password",type:k?"text":"password",value:x,onChange:I=>{j(I.target.value),D.password&&E(ne=>({...ne,password:void 0}))},error:D.password,hint:`At least ${c} characters. Stored as a scrypt hash on this server.`,autoComplete:"new-password",autoFocus:!f,trailing:a.jsx(t0,{show:k,onToggle:()=>C(I=>!I)})}),a.jsx(Me,{className:"mt-4",label:"Confirm password",type:k?"text":"password",value:S,onChange:I=>{R(I.target.value),D.confirm&&E(ne=>({...ne,confirm:void 0}))},error:D.confirm,autoComplete:"new-password"})]}):a.jsxs(ve,{tone:"warning",title:"The dashboard will have no password",className:"mt-4",children:["Anyone who can reach ",n?.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(ae,{type:"submit",variant:"primary",size:"lg",loading:U,disabled:M>0,className:"mt-5 w-full",children:[M>0?`Try again in ${M}s`:h==="password"?"Save password and sign in":"Start without a password",!U&&M===0&&a.jsx(bi,{className:"size-4","aria-hidden":"true"})]})]})]})}function fC(){const{auth:n,retryBoot:i}=ja(),[r,c]=p.useState(!1),d=async()=>{c(!0),await i(),c(!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:n?.bindAddress??"this machine"}),"."]})]}),a.jsxs(ae,{variant:"primary",size:"lg",loading:r,onClick:d,className:"w-full",children:["Continue to dashboard",!r&&a.jsx(bi,{className:"size-4","aria-hidden":"true"})]})]})}function hC(){const{auth:n}=ja();return ba(n?.needsSetup?"Set up this dashboard":n?.authMode==="none"?"Open the dashboard":"Sign in"),a.jsxs(oC,{children:[n?.needsSetup?a.jsx(dC,{}):n?.authMode==="none"?a.jsx(fC,{}):a.jsx(uC,{}),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(Xh,{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:n?.bindAddress??"…"})]})]}),a.jsx("span",{children:"Easy DevOps"})]}),!1]})]})}function ji(n,i){const{lastChange:r,changeSeq:c}=yn(),d=p.useRef(i);d.current=i,p.useEffect(()=>{if(!r)return;(Array.isArray(n)?n:[n]).includes(r.section)&&d.current()},[c])}function La({title:n,description:i,actions:r,meta:c,eyebrow:d}){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:[d&&a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:d}),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:n}),c]}),i&&a.jsx("p",{className:"mt-1 max-w-2xl text-sm text-muted",children:i})]}),r&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]})}function mC(n){return Promise.all([fe.domains.list(n),fe.ssl.list(n),fe.nginx.status(n)]).then(([i,r,c])=>({domains:i,certs:r,nginx:c}))}const pC={neutral:"text-muted",accent:"text-accent-text",ok:"text-ok",warn:"text-warn",bad:"text-bad",info:"text-info"},xC={neutral:"border-line/70 bg-inset text-muted group-hover:text-ink",accent:"border-accent/25 bg-accent-soft text-accent-text",ok:"border-ok/25 bg-ok-soft text-ok",warn:"border-warn/25 bg-warn-soft text-warn",bad:"border-bad/25 bg-bad-soft text-bad",info:"border-info/25 bg-info-soft text-info"};function yc({label:n,value:i,hint:r,icon:c,tone:d="neutral",pulse:f=!1,to:m}){return a.jsx(kt,{to:m,className:"group block rounded-lg",children:a.jsxs(et,{className:"stat-card h-full px-4 py-3.5",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:n}),a.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[a.jsx("span",{className:oe("text-2xl font-semibold tracking-tight",pC[d]),children:i}),(d==="ok"||d==="bad"||d==="warn")&&a.jsx(ln,{tone:d,pulse:f})]})]}),a.jsx("div",{className:oe("flex size-9 shrink-0 items-center justify-center rounded-lg border transition-transform duration-[var(--ez-motion-base)] group-hover:scale-105",xC[d]),children:a.jsx(c,{className:"size-4","aria-hidden":"true"})})]}),a.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a.jsx("div",{className:"truncate text-2xs text-muted",children:r}),a.jsxs("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-2xs font-medium text-faint opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",children:["Open",a.jsx(Xw,{className:"size-3","aria-hidden":"true"})]})]})]})})}function gC(n,i,r,c){const d=[];n&&!n.running&&d.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 f of r)f.status==="unreadable"||f.status==="error"?d.push({id:`cert-error-${f.domain}`,tone:"bad",title:`Certificate for ${f.domain} cannot be read`,detail:"The certificate files are missing or unreadable.",to:"/ssl"}):f.status==="expired"||f.daysLeft!==null&&f.daysLeft<0?d.push({id:`cert-expired-${f.domain}`,tone:"bad",title:`Certificate for ${f.domain} has expired`,detail:vi(f.daysLeft),to:"/ssl"}):f.status==="expiring"&&d.push({id:`cert-expiring-${f.domain}`,tone:"warn",title:`Certificate for ${f.domain} expires soon`,detail:vi(f.daysLeft),to:"/ssl"});for(const f of i)c.get(f.name)?.up===!1&&d.push({id:`domain-down-${f.name}`,tone:"bad",title:`${f.name} is not responding`,detail:`The backend ${f.backendHost}:${f.port} did not answer a health check.`,to:"/domains"});return d}function vC({entry:n}){return n?n.up===null?a.jsx(je,{tone:"neutral",dot:!0,children:"External"}):n.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 yC({days:n}){const i=n<=0?"bg-bad":n<30?"bg-warn":"bg-ok",r=n<=0?100:Math.max(8,Math.min(n,90)/90*100);return a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:oe("text-2xs tabular-nums",n<30?"text-warn":"text-muted"),children:vi(n)}),a.jsx("span",{className:"h-1 w-10 shrink-0 overflow-hidden rounded-full bg-inset","aria-hidden":"true",children:a.jsx("span",{className:oe("block h-full rounded-full",i),style:{width:`${r}%`}})})]})}function bC(n){return n.type==="nginx_down"?{icon:gl,tone:"text-muted"}:n.type==="cert_expiry"?{icon:as,tone:"text-warn"}:n.type==="domain_health"?{icon:Lc,tone:"text-info"}:{icon:Lc,tone:"text-muted"}}function jC(){ba("Overview");const n=Et(),i=rn(),{nginxStatus:r,domainHealth:c,notifications:d}=yn(),{service:f}=$r(),m=Gr(f),h=Tt(mC),[g,y]=p.useState(!1);vl(h.reload),ji(["domains","ssl","nginx"],h.reload);const b=h.data,x=r??b?.nginx??null,j=b?.domains??[],S=b?.certs??[],R=new Map((c??[]).map(A=>[A.name,A])),k=j.filter(A=>A.enabled).length,C=S.filter(A=>A.status==="expiring"),D=S.filter(A=>A.status==="expired"||A.status==="unreadable"||A.status==="error"),E=b?gC(x,j,S,R):[],O=E.filter(A=>A.tone==="bad").length,w=b!==null&&x?.running===!0&&E.length===0,U=D.length>0?`${$n(D.length,"certificate")} expired or unreadable`:C.length>0?`${C.length} expiring within 30 days`:S.length>0?"All certificates healthy":"No certificates yet",Y=async()=>{if(await i({title:"Reload nginx?",body:"Reloading applies configuration changes. Existing connections are kept open.",confirmLabel:"Reload nginx"})){y(!0);try{const M=await fe.nginx.reload();M.success?(n.success("Nginx reloaded",M.output.trim()||"Configuration reloaded."),h.reload()):n.error("Nginx reload failed",M.output.trim()||"nginx refused the reload.")}catch(M){n.error("Nginx reload failed",M instanceof Ue?M.message:"The dashboard could not complete the reload.")}finally{y(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Overview",description:"The state of nginx, your domains and their certificates, live.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:h.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:h.reload,children:"Refresh"})}),h.error&&!b?a.jsx(qt,{error:h.error,onRetry:h.reload}):b?a.jsxs("div",{className:"space-y-4",children:[h.error&&a.jsx(ve,{tone:"warning",title:"Showing the last known state",action:a.jsx(ae,{variant:"ghost",size:"sm",onClick:h.reload,children:"Try again"}),children:h.error.message}),a.jsxs(et,{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:oe("relative isolate mt-0.5 flex size-11 shrink-0 items-center justify-center rounded-full border",O>0?"border-bad/30 bg-bad-soft text-bad":E.length>0?"border-warn/30 bg-warn-soft text-warn":"border-ok/30 bg-ok-soft text-ok"),children:[a.jsx("span",{className:oe("pointer-events-none absolute -inset-3 -z-10 rounded-full blur-lg",O>0?"bg-bad/25":E.length>0?"bg-warn/25":"bg-ok/25"),"aria-hidden":"true"}),O>0||E.length>0?a.jsx(fl,{className:"size-5","aria-hidden":"true"}):a.jsx(ts,{className:"size-5","aria-hidden":"true"}),a.jsx("span",{className:oe("absolute -inset-px rounded-full border",O>0?"border-bad/20":E.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:O>0?"Attention needed":E.length>0?"A few things to check":"All systems healthy"}),a.jsxs("div",{className:"mt-0.5 text-xs text-muted",children:[x?.running?"nginx running":"nginx stopped"," · ",$n(j.length,"domain")," · ",$n(S.length,"certificate"),E.length>0&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("span",{className:O>0?"text-bad":"text-warn",children:[$n(E.length,"item")," need attention"]})]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-3 sm:flex-col sm:items-end",children:[a.jsx(je,{tone:w?"ok":O>0?"bad":"warn",dot:!0,children:w?"Healthy":O>0?"Degraded":"Check"}),a.jsxs("span",{className:"text-2xs text-faint",children:["Checked ",b.nginx?"live":"—",x?.version?` · ${x.version}`:""]})]})]})]}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[a.jsx(yc,{label:"Nginx",value:x?x.running?"Active":"Offline":"Unknown",hint:x?.running?`PID ${x.pid??"—"}${x.version?` · ${x.version}`:""}`:"Traffic is not being proxied.",icon:gl,tone:x?x.running?"ok":"bad":"neutral",pulse:x?.running===!0,to:"/nginx"}),a.jsx(yc,{label:"Domains",value:`${k}/${j.length}`,hint:j.length===0?"No domains configured yet.":k===j.length?"All domains enabled.":`${j.length-k} disabled.`,icon:Os,tone:j.length===0?"neutral":k>0?"accent":"warn",to:"/domains"}),a.jsx(yc,{label:"Certificates",value:String(S.length),hint:U,icon:Rn,tone:D.length>0?"bad":C.length>0?"warn":S.length>0?"ok":"neutral",to:"/ssl"}),a.jsx(yc,{label:"Background service",value:m?m.running?"Running":"Stopped":"Unknown",hint:m?m.running?m.startsAt==="unknown"?m.mechanismDetail:`${m.mechanismLabel} · starts ${m.startsAtLabel.toLowerCase()}`:m.stoppedByUser?m.installed?`You stopped it${m.stoppedAtLabel?` on ${m.stoppedAtLabel}`:""}; it starts again automatically.`:"You stopped it; start it to resume monitoring.":m.installed?"Monitoring runs in this window.":"Not installed; monitoring runs in this window.":"Checking…",icon:Db,tone:m?m.running?"ok":"warn":"neutral",pulse:m?.running===!0,to:"/processes"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(kt,{to:"/domains?new=1",className:ma("primary","sm"),children:[a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),"Add domain"]}),a.jsxs(kt,{to:"/ssl?new=1",className:ma("secondary","sm"),children:[a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),"Issue certificate"]}),a.jsx(ae,{variant:"secondary",size:"sm",loading:g,disabled:!x?.running,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:Y,children:"Reload nginx"})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsxs(et,{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(kt,{to:"/domains",className:"text-2xs font-medium text-muted hover:text-ink",children:"Manage"})]}),j.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[a.jsx(Os,{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(kt,{to:"/domains?new=1",className:ma("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:j.map(A=>{const M=R.get(A.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(kt,{to:`/domains?domain=${encodeURIComponent(A.name)}`,className:"flex items-center gap-2 font-medium text-ink hover:text-accent-text",children:[a.jsx("span",{className:"truncate",children:A.name}),!A.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:[A.backendHost,":",A.port]}),a.jsx("td",{className:"px-3 py-2.5",children:a.jsx(vC,{entry:M})}),a.jsx("td",{className:"hidden px-3 py-2.5 text-2xs md:table-cell",children:A.ssl.enabled?A.daysLeft!==null?a.jsx(yC,{days:A.daysLeft}):a.jsx("span",{className:"text-muted",children:"Unknown"}):a.jsx("span",{className:"text-faint",children:"Not enabled"})})]},A.name)})})]})}),c===null&&j.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(et,{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:E.length})]}),E.length===0?a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-5 text-xs text-muted",children:[a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}),"Nothing needs attention right now."]}):a.jsx("div",{className:"max-h-[280px] overflow-y-auto",children:E.map(A=>a.jsxs(kt,{to:A.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(ln,{tone:A.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:A.title}),a.jsx("div",{className:"mt-0.5 text-2xs text-muted",children:A.detail})]}),a.jsx(rS,{className:"mt-0.5 size-3.5 shrink-0 text-faint transition-transform group-hover:translate-x-0.5","aria-hidden":"true"})]},A.id))})]}),a.jsxs(et,{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(kt,{to:"/notifications",className:"text-2xs font-medium text-muted hover:text-ink",children:"All events"})]}),d.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",{className:"event-timeline",children:d.slice(0,6).map(A=>{const{icon:M,tone:W}=bC(A);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("span",{className:"relative z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-line bg-raised",children:a.jsx(M,{className:oe("size-3",W),"aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs leading-snug text-ink",children:A.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:qr(A.timestamp)})]})]},A.id)})})]})]})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{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(A=>a.jsx(tt,{className:"h-[92px] rounded-lg"},A))}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsx(tt,{className:"h-64 rounded-lg xl:col-span-2"}),a.jsx(tt,{className:"h-64 rounded-lg"})]})]})]})}function Wh(n){if(!n||!n.trim())return"A domain name is required.";const r=(n.startsWith("*.")?n.slice(2):n).split(".");if(r.length<2)return"Use at least two labels, for example example.com.";const c=/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/;return r.some(d=>!d||!c.test(d))?"Use letters, digits and hyphens only; each label must start and end with a letter or digit.":null}function ru(n){const i=Number(n);return!Number.isInteger(i)||i<1||i>65535?"Port must be a whole number between 1 and 65535.":null}function l0(n){return n&&(!n.includes("@")||n.trim()!==n)?"Enter a valid email address.":null}function NC(n){return n?/^\d+[kmgKMG]?$/.test(n)?null:"Use a size like 10m, 1g or 512k.":null}function br(n,i){const r=Number(n);return!Number.isInteger(r)||r<1?`${i} must be a positive whole number.`:null}function ay(n,i){return n?n.length<i?`Use at least ${i} characters.`:null:"Enter a password."}const wC=2048,sy=/^[A-Za-z0-9._~-]{1,200}$/;function SC(n){if(!n)return"The Hub URL is missing.";if(n!==n.trim())return"The Hub URL must not have spaces around it.";if(n.includes("://")&&!/^https?:\/\//i.test(n))return"The Hub URL must use http or https.";const i=/^https?:\/\//i.test(n)?n:`https://${n}`;let r;try{r=new URL(i)}catch{return"The Hub URL is not valid."}return r.protocol!=="http:"&&r.protocol!=="https:"?"The Hub URL must use http or https.":r.hostname?r.username||r.password?"The Hub URL must not contain credentials.":null:"The Hub URL is missing a host."}function kC(n){const i=n.trim();if(!i)return"Paste the connection string the Hub gave you.";if(i.length>wC)return"That connection string is too long.";if(!i.toLowerCase().startsWith("ezops://"))return"The connection string must start with ezops://.";const r=i.slice(8).split("|");if(r.length!==3)return"Expected the form ezops://hubUrl|serverId|secret.";const[c,d,f]=r.map(h=>h.trim()),m=SC(c);return m||(d?f?sy.test(d)?sy.test(f)?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 ou({title:n,description:i,icon:r,headerExtra:c,open:d,onOpenChange:f,id:m,className:h,headerClassName:g,contentClassName:y,children:b}){const x=p.useId().replace(/:/g,""),j=m?`section-${m}`:`collapsible-${x}`,S=`${j}-header`,R=p.useRef(null),k=p.useRef(null),C=p.useRef(d);return p.useEffect(()=>{if(C.current&&!d){const D=k.current,E=document.activeElement;D&&E instanceof HTMLElement&&D.contains(E)&&R.current?.focus()}C.current=d},[d]),a.jsxs("div",{className:h,children:[a.jsx("h3",{children:a.jsxs("button",{ref:R,type:"button",id:S,"aria-expanded":d,"aria-controls":j,onClick:()=>f(!d),className:oe("group flex w-full items-center gap-3 text-left transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/50",g),children:[r,a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:n}),i&&a.jsx("span",{className:"mt-0.5 block break-words text-xs text-muted",children:i})]}),c&&a.jsx("span",{className:"shrink-0",children:c}),a.jsx(lS,{className:oe("size-4 shrink-0 text-faint transition-transform duration-[var(--ez-motion-base)] ease-[var(--ez-ease-out)] motion-reduce:transition-none",d&&"rotate-180"),"aria-hidden":"true"})]})}),a.jsx("div",{ref:k,id:j,role:"region","aria-labelledby":S,"aria-hidden":d?void 0:!0,inert:!d,className:oe("grid transition-[grid-template-rows] duration-[var(--ez-motion-base)] ease-[var(--ez-ease-out)] motion-reduce:transition-none",d?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:a.jsx("div",{className:"min-h-0 overflow-hidden",children:a.jsx("div",{className:y,children:b})})})]})}function CC(n){const i=document.activeElement,r=document.getSelection(),c=[];if(r)for(let m=0;m<r.rangeCount;m+=1)c.push(r.getRangeAt(m));const d=document.createElement("textarea");d.value=n,d.setAttribute("readonly",""),d.style.position="fixed",d.style.top="0",d.style.left="0",d.style.opacity="0",d.style.pointerEvents="none",document.body.appendChild(d);let f;try{d.select(),d.setSelectionRange(0,n.length),f=document.execCommand("copy")}catch{f=!1}finally{if(d.remove(),r){r.removeAllRanges();for(const m of c)r.addRange(m)}i?.focus({preventScroll:!0})}return f}async function TC(n){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(n),!0}catch{}return CC(n)}function Ut({value:n,label:i="Copy",withText:r=!1,className:c}){const[d,f]=p.useState("idle"),m=p.useRef(null),h=Et();p.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const g=async()=>{const x=await TC(n);f(x?"copied":"failed"),x||h.error("Could not copy","The browser blocked clipboard access. Select the text and copy it manually."),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>f("idle"),1600)},y=d==="copied"?a.jsx(dl,{className:"size-3.5 text-ok","aria-hidden":"true"}):d==="failed"?a.jsx(fl,{className:"size-3.5 text-bad","aria-hidden":"true"}):a.jsx(jS,{className:"size-3.5","aria-hidden":"true"}),b=d==="copied"?"Copied":d==="failed"?"Copy failed":i;return r?a.jsx(ae,{size:"sm",variant:"secondary",icon:y,onClick:g,className:c,children:a.jsx("span",{"aria-live":"polite",children:b})}):a.jsx(ct,{label:b,size:"sm",variant:"ghost",onClick:g,className:oe(d==="copied"&&"text-ok",d==="failed"&&"text-bad",c),children:y})}const EC={discord:{label:"Discord",badgeClassName:"bg-discord-soft text-discord",icon:nu},telegram:{label:"Telegram",badgeClassName:"bg-telegram-soft text-telegram",icon:qb}},ly={label:"Channel",badgeClassName:"bg-inset text-muted",icon:Rc};function i0(n){const i=n.trim(),r=EC[i.toLowerCase()];return r||{...ly,label:i?i.charAt(0).toUpperCase()+i.slice(1):ly.label}}function RC(n){return i0(n).label}function r0({type:n,className:i}){const r=i0(n),c=r.icon;return a.jsxs("span",{className:oe("inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-2xs font-medium tracking-wide",r.badgeClassName,i),children:[a.jsx(c,{className:"size-3 shrink-0","aria-hidden":"true"}),r.label]})}const iy="rounded-sm font-medium text-accent-text underline-offset-2 transition-colors hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:cursor-not-allowed disabled:text-faint disabled:no-underline disabled:opacity-60";function zC({lastTest:n}){return n==="passed"?a.jsx(je,{tone:"ok",children:"Test passed"}):n==="failed"?a.jsx(je,{tone:"bad",children:"Test failed"}):n===null?a.jsx("span",{className:"text-2xs text-faint",children:"Not tested"}):null}function kh({channels:n,value:i,onChange:r,disabled:c,disabledIds:d,label:f,emptyHref:m,compact:h}){const g=p.useId(),y=p.useId(),[b,x]=p.useState("");if(n.length===0)return a.jsxs("div",{role:"group","aria-labelledby":g,className:"space-y-2",children:[a.jsx("span",{id:g,className:"block text-xs font-medium text-ink",children:f}),a.jsxs("div",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:["No notification channels yet."," ",a.jsx(kt,{to:m,className:"font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:"Add a channel"})]})]});const j=b.trim(),S=j.toLowerCase(),R=S?n.filter(w=>w.name.toLowerCase().includes(S)||w.type.toLowerCase().includes(S)||RC(w.type).toLowerCase().includes(S)):n,k=n.filter(w=>!d?.[w.id]),C=n.filter(w=>i.includes(w.id)).length,D=k.length>0&&k.every(w=>i.includes(w.id)),E=(w,U)=>{r(U?Array.from(new Set([...i,w])):i.filter(Y=>Y!==w))},O=()=>{r(Array.from(new Set([...i,...k.map(w=>w.id)])))};return a.jsxs("div",{role:"group","aria-labelledby":g,className:"space-y-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[a.jsx("span",{id:g,className:"text-xs font-medium text-ink",children:f}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-2xs",children:[a.jsxs("span",{className:"text-faint","aria-live":"polite",children:[C," of ",n.length," selected"]}),a.jsx("button",{type:"button",className:iy,onClick:O,disabled:c||D,children:"Select all"}),a.jsx("button",{type:"button",className:iy,onClick:()=>r([]),disabled:c||C===0,children:"Clear"})]})]}),n.length>6&&a.jsxs("div",{className:"relative",children:[a.jsx($b,{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",{id:y,type:"search",value:b,onChange:w=>x(w.target.value),onKeyDown:w=>{w.key==="Enter"&&w.preventDefault()},placeholder:"Search channels","aria-label":"Search channels",className:"h-8 w-full rounded-md border border-line bg-canvas pl-8 pr-3 text-xs 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"})]}),R.length===0?a.jsx("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-3 text-xs text-muted",children:`No channels match "${j}"`}):a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:R.map(w=>{const U=i.includes(w.id),Y=d?.[w.id],A=c||!!Y;return a.jsxs("label",{title:Y,className:oe("relative flex min-w-0 cursor-pointer items-start gap-2.5 rounded-md border px-3 text-left transition-colors duration-[var(--ez-motion-fast)]",h?"py-2":"py-2.5",U?"border-accent bg-accent-soft":"border-line bg-raised/40",!U&&!A&&"hover:border-line-strong hover:bg-raised",A&&"cursor-not-allowed opacity-60","focus-within:outline-none focus-within:ring-2 focus-within:ring-accent/50"),children:[a.jsx("input",{type:"checkbox",className:"sr-only",checked:U,disabled:A,onChange:M=>E(w.id,M.target.checked)}),a.jsxs("span",{className:"min-w-0 flex-1 pr-4 pt-0.5",children:[a.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("span",{className:"truncate text-xs font-medium text-ink",children:w.name}),a.jsx(r0,{type:w.type}),a.jsx(zC,{lastTest:w.lastTest})]}),Y&&a.jsx("span",{className:"mt-1 block text-2xs text-faint",children:Y})]}),U&&a.jsx("span",{className:"absolute right-2 top-2 inline-flex size-4 items-center justify-center rounded-full bg-accent text-accent-ink",children:a.jsx(dl,{className:"size-2.5","aria-hidden":"true"})})]},w.id)})})]})}function DC({label:n,items:i,onChange:r,onToggleAll:c,disabled:d,children:f}){const m=p.useId(),h=p.useId(),g=p.useRef(null),y=i.length>0&&i.every(x=>x.enabled),b=i.every(x=>!x.enabled);return p.useEffect(()=>{g.current&&(g.current.indeterminate=!y&&!b)},[y,b]),a.jsxs("div",{role:"group","aria-labelledby":m,className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[a.jsx("h4",{id:m,className:"text-xs font-medium text-ink",children:n}),a.jsxs("label",{htmlFor:h,className:"inline-flex cursor-pointer items-center gap-2 text-2xs text-muted",children:[a.jsx("input",{id:h,ref:g,type:"checkbox",checked:y,disabled:d||i.length===0,onChange:()=>c(!y),className:"size-3.5 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)] disabled:cursor-not-allowed"}),a.jsx("span",{className:"select-none",children:y?"All on":b?"All off":"Mixed"})]})]}),a.jsx("div",{className:"space-y-3",children:i.map(x=>a.jsxs("div",{className:"rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:x.enabled,onChange:j=>r(x.id,j),label:x.label,description:x.description,disabled:d}),x.enabled&&f?.(x)]},x.id))})]})}const AC="text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript",Ch=[{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."}],o0=()=>({domain_health:{enabled:!0,channelIds:[]},cert_expiry:{enabled:!0,channelIds:[]},nginx_down:{enabled:!0,channelIds:[]}});function OC(){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:AC},security:{rateLimit:!1,rateLimitRate:10,rateLimitBurst:20,securityHeaders:!1,custom404:!1,custom50x:!1},advanced:{accessLog:!0,customLocations:""},notifications:o0()}}function MC(n){const i=o0();for(const r of Ch){const c=n.notifications?.[r.id];c&&(i[r.id]={enabled:c.enabled,channelIds:[...c.channelIds??[]]})}return{name:n.name,port:n.port,backendHost:n.backendHost||"127.0.0.1",upstreamType:n.upstreamType||"http",www:n.www,wildcard:n.wildcard,enabled:n.enabled,ssl:{enabled:!!n.ssl?.enabled,certPath:n.ssl?.certPath??"",keyPath:n.ssl?.keyPath??"",redirect:n.ssl?.redirect??!0,hsts:n.ssl?.hsts??!1,hstsMaxAge:n.ssl?.hstsMaxAge||31536e3},performance:{...n.performance},security:{...n.security},advanced:{...n.advanced},notifications:i}}const ry={http:"HTTP",https:"HTTPS",ws:"WebSocket"};function Th(n){return n.trim().replace(/^\*\./,"")}function _C(n){return"status"in n&&n.status==="waiting_dns"}function LC(n,i){const r={};if(i){const h=Wh(Th(n.name));h&&(r["domain-name"]=h)}if(n.backendHost.trim()||(r["backend-host"]="A backend host or URL is required."),!/^https?:\/\//i.test(n.backendHost.trim())){const h=ru(n.port);h&&(r["backend-port"]=h)}const d=NC(n.performance.maxBodySize);d&&(r["max-body"]=d);const f=br(n.performance.readTimeout,"Read timeout");f&&(r["read-timeout"]=f);const m=br(n.performance.connectTimeout,"Connect timeout");if(m&&(r["connect-timeout"]=m),n.ssl.enabled&&n.ssl.hsts){const h=br(n.ssl.hstsMaxAge,"HSTS max-age");h&&(r["hsts-max-age"]=h)}if(n.security.rateLimit){const h=br(n.security.rateLimitRate,"Rate");h&&(r["rate-limit-rate"]=h);const g=br(n.security.rateLimitBurst,"Burst");g&&(r["rate-limit-burst"]=g)}return r}function oy(n){if(n instanceof Ue){const i=n.payload.error;if(i&&typeof i=="object")return{message:"Certificate creation failed",detail:[i.step?`Step: ${i.step}`:"",i.cause?`Cause: ${i.cause}`:"",i.consequence?`Note: ${i.consequence}`:""].filter(Boolean).join(`
511
+ `)||"The certificate authority did not issue a certificate.",hint:"nginx is left as it was."};const r=n.code==="email_required"?"Set the ACME email in Settings → General, then try again.":typeof n.payload.hint=="string"?n.payload.hint:void 0;return{message:"Certificate creation failed",detail:(typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.output=="string"?n.payload.output:void 0)??n.message,hint:r}}return{message:"Certificate creation failed",detail:n instanceof Error?n.message:"The request could not be completed."}}function ui({id:n,title:i,description:r,icon:c,open:d,onToggle:f,children:m}){return a.jsx(ou,{id:n,title:i,description:r,open:d,onOpenChange:f,className:"border-b border-line last:border-b-0",headerClassName:"px-5 py-3.5",contentClassName:"px-5 pb-5 pt-1",icon: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(c,{className:"size-3.5","aria-hidden":"true"})}),children:m})}const di=n=>Number.isFinite(n)&&n!==0?n:"";function cy({wildcard:n,certMethod:i,onMethodChange:r,certFailure:c,dnsPending:d,certAction:f,onCreate:m,onConfirmDns:h,onCancelDns:g,disabledReason:y,extraActions:b}){const x=f!==null;return a.jsxs("div",{className:"space-y-3",children:[c&&a.jsxs(ve,{tone:"danger",title:c.message,children:[c.hint&&a.jsx("div",{children:c.hint}),c.detail&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:c.detail})]}),d?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:d.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:d.txtName})]}),a.jsx(Ut,{value:d.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:d.txtValue})]}),a.jsx(Ut,{value:d.txtValue,label:"Copy record value"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(ae,{variant:"primary",size:"sm",loading:f==="confirm",onClick:h,children:"I added the record, continue"}),a.jsx(ae,{variant:"secondary",size:"sm",onClick:g,disabled:x,children:"Cancel issuance"})]})]}):a.jsxs("div",{className:"space-y-3",children:[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:oe("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",i==="http"?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong",n&&"cursor-not-allowed opacity-50"),children:[a.jsx("input",{type:"radio",name:"cert-method",value:"http",checked:i==="http",disabled:n||x,onChange:()=>r("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:oe("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",i==="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:i==="dns",disabled:x,onChange:()=>r("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"})]})]})]}),n&&a.jsx("p",{className:"mt-2 text-2xs text-warn",children:"Wildcard certificates require the DNS challenge."})]}),y&&a.jsx("p",{className:"text-2xs text-warn",children:y}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(ae,{variant:"primary",size:"sm",loading:f==="issue",onClick:m,disabled:!!y,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Create certificate"}),b]})]})]})}function UC(n,i,r){return n==="exact"?`A certificate for ${i} already exists`:n==="wildcard"?`A wildcard certificate covers ${i}`:`The certificate in ${r} covers ${i}`}function HC({domainName:n,match:i,certificate:r,onAccept:c}){const d=r.daysLeft,f=d===null?"text-muted":d<=0?"text-bad":d<30?"text-warn":"text-ok",m=d===null?"expiry unknown":d<=0?"expired":`${d} days left`;return a.jsx("div",{className:"rounded-md border border-accent/40 bg-accent-soft/30 p-3.5",children:a.jsxs("div",{className:"flex flex-wrap items-start gap-x-3 gap-y-3",children:[a.jsx(Qh,{className:"mt-0.5 size-4 shrink-0 text-accent-text","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:UC(i,n,r.domain)}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i==="exact"?"Turning SSL on will use this certificate.":`Stored in ${r.domain}, which lists this domain as a name. Turning SSL on will use it.`}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs",children:[a.jsx("span",{className:oe("font-medium",f),children:m}),r.names.length>1&&a.jsxs("span",{className:"break-all text-muted",children:["covers ",r.names.join(", ")]})]}),a.jsxs("div",{className:"mt-2 space-y-0.5 font-mono text-2xs text-faint",children:[a.jsx("div",{className:"break-all",children:r.certPath}),a.jsx("div",{className:"break-all",children:r.keyPath})]})]}),a.jsx(ae,{size:"sm",onClick:c,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Use this certificate"})]})})}function BC({editor:n,onClose:i,onSaved:r}){const c=n.mode==="edit"?n.domain:null,d=Et(),f=rn(),m=p.useId(),[h,g]=p.useState(()=>c?MC(c):OC()),y=p.useRef(JSON.stringify(h)),b=JSON.stringify(h)!==y.current,[x,j]=p.useState(()=>c?{basic:!0,ssl:!0,performance:!0,security:!0,advanced:!0,notifications:!0}:{basic:!0,ssl:!0,performance:!1,security:!1,advanced:!1,notifications:!1}),[S,R]=p.useState({}),[k,C]=p.useState(null),[D,E]=p.useState(!1),[O,w]=p.useState(null),[U,Y]=p.useState("http"),[A,M]=p.useState(null),[W,I]=p.useState(null),[ne,F]=p.useState(null),Z=Tt(J=>fe.settings.channels.list(J),[],{enabled:!!c}),te=Tt(J=>fe.ssl.list(J),[],{enabled:h.ssl.enabled}),ce=Tt(J=>fe.domains.sslSuggestion(c?.name??"",J),[c?.name],{enabled:!!c});p.useEffect(()=>{if(!b)return;const J=be=>{be.preventDefault(),be.returnValue=""};return window.addEventListener("beforeunload",J),()=>window.removeEventListener("beforeunload",J)},[b]),p.useEffect(()=>{O&&h.wildcard&&Y("dns")},[O,h.wildcard]);const K=/^https?:\/\//i.test(h.backendHost.trim()),H=c?c.name:Th(h.name),L=Wh(H),ee=h.ssl.certPath.trim()===""&&h.ssl.keyPath.trim()==="",de=te.data?.some(J=>J.domain===H)??!1,ke=ce.data?.found?ce.data:null,Ne=ee&&ke!==null,Ee=h.ssl.enabled&&ee&&!te.loading&&!de&&!O&&!ce.loading&&ke===null;function T(J,be){g(He=>({...He,[J]:be}))}function q(J,be){g(He=>({...He,ssl:{...He.ssl,[J]:be}}))}function V(J){g(be=>({...be,ssl:{...be.ssl,enabled:!0,certPath:J.certPath,keyPath:J.keyPath}}))}function re(J,be){g(He=>({...He,performance:{...He.performance,[J]:be}}))}function ye(J,be){g(He=>({...He,security:{...He.security,[J]:be}}))}function Re(J,be){g(He=>({...He,advanced:{...He.advanced,[J]:be}}))}function xe(J,be){g(He=>({...He,notifications:{...He.notifications,[J]:{...He.notifications[J],...be}}}))}const me=J=>j(be=>({...be,[J]:!0})),ie=J=>({...h,...J,ssl:{...h.ssl,...J?.ssl??{}},name:c?c.name:Th(h.name)}),Pe=J=>{const be=LC(J,!c);if(Object.keys(be).length===0)return!0;R(be),C({message:"Check the highlighted fields before saving."}),(be["domain-name"]||be["backend-host"]||be["backend-port"])&&me("basic"),(be["max-body"]||be["read-timeout"]||be["connect-timeout"])&&me("performance"),(be["rate-limit-rate"]||be["rate-limit-burst"])&&me("security"),be["hsts-max-age"]&&me("ssl");const He=Object.keys(be)[0];return queueMicrotask(()=>document.getElementById(He)?.focus()),!1},Ve=async J=>{const be=ie(J);if(!Pe(be))return;const He=c?.name??be.name;R({}),C(null),E(!0);let Dt;try{Dt=c?await fe.domains.update(c.name,be):await fe.domains.create(be)}catch(aa){const Ke=aa instanceof Ue?aa:null;if(!Ke){w(null),I(null),M(null),d.warning("The dashboard’s reply could not be read","The domain list was reloaded. Check that the change is there before saving again."),r();return}Ke.status===422&&Ke.code==="cert_missing"?(w({certPath:typeof Ke.payload.certPath=="string"?Ke.payload.certPath:"",keyPath:typeof Ke.payload.keyPath=="string"?Ke.payload.keyPath:"",hint:typeof Ke.payload.hint=="string"?Ke.payload.hint:"The SSL certificate files do not exist at the configured paths."}),M(null),I(null),C(null),Y(h.wildcard?"dns":"http"),me("ssl")):Ke.status===0?(C({message:"The dashboard did not answer.",detail:Ke.message,hint:"Saving may still have worked: check the domain list before trying again."}),d.error("The dashboard did not answer","The change may already have been saved.")):(C({message:Ke.message??"The domain could not be saved.",detail:typeof Ke.payload.detail=="string"?Ke.payload.detail:typeof Ke.payload.output=="string"?Ke.payload.output:void 0,hint:typeof Ke.payload.hint=="string"?Ke.payload.hint:void 0}),d.error("Could not save the domain",Ke.message??void 0));return}finally{E(!1)}w(null),I(null),M(null),d.success(c?"Domain saved":"Domain created",c?`${Dt?.name??He} was updated and its nginx config regenerated.`:`${Dt?.name??He} is configured; nginx will start serving it on the next reload.`),r()},Xe=async()=>{if(Pe(ie({ssl:{...h.ssl,enabled:!0}}))){F("issue"),M(null);try{const J=await fe.ssl.create({domain:H,www:h.www,validationMethod:h.wildcard?"dns":U});if(_C(J)){I(J);return}const be={...h.ssl,enabled:!0,certPath:J.certPath,keyPath:J.keyPath};g(He=>({...He,ssl:be})),w(null),I(null),await Ve({ssl:be})}catch(J){M(oy(J))}finally{F(null)}}},ue=async()=>{if(W){F("confirm"),M(null);try{const J=await fe.ssl.confirmDns(W.domain),be={...h.ssl,enabled:!0,certPath:J.certPath,keyPath:J.keyPath};g(He=>({...He,ssl:be})),I(null),w(null),await Ve({ssl:be})}catch(J){M(oy(J)),I(null)}finally{F(null)}}},De=async()=>{if(W){F("confirm");try{await fe.ssl.cancelDns(W.domain),d.info("DNS challenge cancelled","No certificate was requested.")}catch{d.warning("Could not cancel the DNS challenge")}finally{I(null),F(null)}}},we=()=>{const J={...h.ssl,enabled:!1};g(be=>({...be,ssl:J})),w(null),M(null),I(null),Ve({ssl:J})},nt=()=>{w(null),M(null),I(null)},rt=D||ne!==null,xt=async()=>b?f({title:"Discard changes?",body:"The changes to this domain have not been saved.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}):!0,bt=()=>{W&&fe.ssl.cancelDns(W.domain).catch(()=>{})},zn=async()=>{rt||await xt()&&(bt(),i())},jn=p.useRef(zn);jn.current=zn;const na=p.useCallback(()=>{jn.current()},[]);return a.jsxs(vn,{open:!0,onClose:na,title:c?`Edit ${c.name}`:"New domain",description:"Changes are written to nginx, tested, and rolled back automatically if nginx rejects them.",size:"xl",preventClose:rt,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:c?"The domain name cannot change after creation.":"The domain is enabled as soon as it is created."}),a.jsx(ae,{variant:"ghost",onClick:na,disabled:rt,children:"Cancel"}),a.jsx(ae,{variant:"primary",type:"submit",form:m,loading:D,disabled:ne!==null,children:c?"Save changes":"Create domain"})]}),children:[(k||O)&&a.jsxs("div",{className:"space-y-3 border-b border-line px-5 py-4",children:[k&&!O&&a.jsxs(ve,{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})]}),O&&a.jsxs(a.Fragment,{children:[a.jsx(ve,{tone:"warning",title:"SSL certificate not found",action:a.jsx(ae,{variant:"ghost",size:"sm",onClick:nt,disabled:rt,children:"Keep editing"}),children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"break-all font-mono text-2xs",children:O.certPath||O.keyPath}),a.jsx("div",{children:O.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:a.jsx(cy,{wildcard:h.wildcard,certMethod:U,onMethodChange:Y,certFailure:A,dnsPending:W,certAction:ne,onCreate:Xe,onConfirmDns:ue,onCancelDns:De,extraActions:a.jsx(ae,{variant:"dangerGhost",size:"sm",onClick:we,disabled:ne!==null,children:"Disable SSL and save"})})})]})]}),a.jsxs("form",{id:m,onSubmit:J=>{J.preventDefault(),rt||Ve()},children:[a.jsx(ui,{id:"basic",title:"Basic configuration",description:"What nginx serves and where traffic goes.",icon:Os,open:x.basic??!1,onToggle:()=>j(J=>({...J,basic:!J.basic})),children:a.jsxs(Ja,{children:[a.jsx(Me,{id:"domain-name",className:"sm:col-span-2",label:"Domain name",placeholder:"api.example.com",value:h.name,disabled:!!c,onChange:J=>T("name",J.target.value),error:S["domain-name"],hint:h.wildcard?"Enter the bare domain — the *. prefix is added automatically.":c?"The domain name cannot be changed after creation.":void 0,autoComplete:"off",spellCheck:!1}),a.jsx(Me,{id:"backend-host",className:"sm:col-span-2",label:"Backend host or URL",placeholder:"127.0.0.1 or https://app.vercel.app",value:h.backendHost,onChange:J=>T("backendHost",J.target.value),error:S["backend-host"],hint:"A host and port, or a full http(s) URL to proxy to.",autoComplete:"off",spellCheck:!1}),a.jsx(Me,{id:"backend-port",label:"Backend port",type:"number",inputMode:"numeric",min:1,max:65535,value:di(h.port),disabled:K,onChange:J=>T("port",Number(J.target.value)),error:S["backend-port"],hint:K?"Taken from the URL.":void 0}),a.jsx(pa,{label:"Upstream type",value:h.upstreamType,onChange:J=>T("upstreamType",J.target.value),children:Object.keys(ry).map(J=>a.jsx("option",{value:J,children:ry[J]},J))}),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(Zt,{checked:h.wildcard,onChange:J=>g(be=>({...be,wildcard:J,www:J?!1:be.www})),label:"Wildcard domain",description:"Serve *.example.com. Requires a DNS-01 certificate."}),!h.wildcard&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Zt,{checked:h.www,onChange:J=>T("www",J),label:"Include www subdomain",description:"Adds www.example.com to server_name."})})]})]})}),a.jsx(ui,{id:"ssl",title:"SSL",description:"Serve this domain over HTTPS.",icon:Rn,open:x.ssl??!1,onToggle:()=>j(J=>({...J,ssl:!J.ssl})),children:a.jsxs("div",{className:"space-y-4",children:[Ne&&ke&&a.jsx(HC,{domainName:H,match:ke.match,certificate:ke.certificate,onAccept:()=>V(ke.certificate)}),h.ssl.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(Me,{label:"Certificate path",value:h.ssl.certPath,onChange:J=>q("certPath",J.target.value),placeholder:"fullchain.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"}),a.jsx(Me,{label:"Private key path",value:h.ssl.keyPath,onChange:J=>q("keyPath",J.target.value),placeholder:"privkey.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"})]}),Ee&&a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"No certificate paths set"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Create a certificate for ",H||"this domain"," now. On success, the certificate and key paths are filled in automatically."]})]}),a.jsx(cy,{wildcard:h.wildcard,certMethod:U,onMethodChange:Y,certFailure:A,dnsPending:W,certAction:ne,onCreate:Xe,onConfirmDns:ue,onCancelDns:De,disabledReason:H?L??null:"Enter the domain name above to create a certificate."})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:h.ssl.redirect,onChange:J=>q("redirect",J),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(Zt,{checked:h.ssl.hsts,onChange:J=>q("hsts",J),label:"Enable HSTS",description:"Tells browsers to use HTTPS for this domain only."})}),h.ssl.hsts&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Me,{id:"hsts-max-age",label:"HSTS max-age",type:"number",inputMode:"numeric",min:1,value:di(h.ssl.hstsMaxAge),onChange:J=>q("hstsMaxAge",Number(J.target.value)),error:S["hsts-max-age"],hint:"Seconds. 31536000 is one year.",className:"max-w-56"})})]})]}):a.jsx(Zt,{checked:h.ssl.enabled,onChange:J=>q("enabled",J),label:"Enable SSL / HTTPS",description:"Adds a 443 server block with the certificate below."}),h.ssl.enabled&&a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(as,{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(ui,{id:"performance",title:"Performance",description:"Request limits, timeouts and compression.",icon:OS,open:x.performance??!1,onToggle:()=>j(J=>({...J,performance:!J.performance})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[a.jsx(Me,{id:"max-body",label:"Max body size",value:h.performance.maxBodySize,onChange:J=>re("maxBodySize",J.target.value),error:S["max-body"],placeholder:"10m",hint:"For uploads: 10m, 512k or 1g.",autoComplete:"off"}),a.jsx(Me,{id:"read-timeout",label:"Read timeout",type:"number",inputMode:"numeric",min:1,value:di(h.performance.readTimeout),onChange:J=>re("readTimeout",Number(J.target.value)),error:S["read-timeout"],hint:"Seconds."}),a.jsx(Me,{id:"connect-timeout",label:"Connect timeout",type:"number",inputMode:"numeric",min:1,value:di(h.performance.connectTimeout),onChange:J=>re("connectTimeout",Number(J.target.value)),error:S["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(Zt,{checked:h.performance.proxyBuffers,onChange:J=>re("proxyBuffers",J),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(Zt,{checked:h.performance.gzip,onChange:J=>re("gzip",J),label:"Gzip compression",description:"Compress text responses before sending them."})}),h.performance.gzip&&a.jsxs("div",{className:"border-t border-line pt-3",children:[a.jsx(Hc,{label:"Gzip MIME types",value:h.performance.gzipTypes,onChange:J=>re("gzipTypes",J.target.value),rows:3,spellCheck:!1,className:"font-mono"}),a.jsx(ml,{children:"Space-separated list of content types."})]})]})]})}),a.jsx(ui,{id:"security",title:"Security",description:"Rate limiting and response headers.",icon:Xh,open:x.security??!1,onToggle:()=>j(J=>({...J,security:!J.security})),children:a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:h.security.rateLimit,onChange:J=>ye("rateLimit",J),label:"Rate limiting",description:"Limit requests per IP address."}),h.security.rateLimit&&a.jsxs("div",{className:"grid gap-4 border-t border-line pt-3 sm:grid-cols-2",children:[a.jsx(Me,{id:"rate-limit-rate",label:"Requests per second",type:"number",inputMode:"numeric",min:1,value:di(h.security.rateLimitRate),onChange:J=>ye("rateLimitRate",Number(J.target.value)),error:S["rate-limit-rate"]}),a.jsx(Me,{id:"rate-limit-burst",label:"Burst",type:"number",inputMode:"numeric",min:1,value:di(h.security.rateLimitBurst),onChange:J=>ye("rateLimitBurst",Number(J.target.value)),error:S["rate-limit-burst"],hint:"Requests allowed to exceed the rate briefly."})]}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Zt,{checked:h.security.securityHeaders,onChange:J=>ye("securityHeaders",J),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(Zt,{checked:h.security.custom404,onChange:J=>ye("custom404",J),label:"Custom 404 form",description:"Return the dashboard's 404 page."}),a.jsx(Zt,{checked:h.security.custom50x,onChange:J=>ye("custom50x",J),label:"Custom 50x page",description:"Return the dashboard's error page when the backend fails."})]})]})}),a.jsx(ui,{id:"advanced",title:"Advanced",description:"Raw nginx additions for this domain.",icon:gS,open:x.advanced??!1,onToggle:()=>j(J=>({...J,advanced:!J.advanced})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Zt,{checked:h.advanced.accessLog,onChange:J=>Re("accessLog",J),label:"Domain-specific access log",description:"Writes this domain's requests to its own log file."}),a.jsx(Hc,{label:"Custom location blocks",value:h.advanced.customLocations,onChange:J=>Re("customLocations",J.target.value),rows:6,spellCheck:!1,placeholder:`location /api/v2 {
512
512
  proxy_pass http://localhost:8080;
513
- }`,className:"font-mono"}),a.jsx(ml,{children:"Appended verbatim inside the server block. nginx tests the result before it is kept."})]})}),c&&a.jsx(ui,{id:"notifications",title:"Notifications",description:"Which channels hear about this domain.",icon:Gh,open:x.notifications??!1,onToggle:()=>j(F=>({...F,notifications:!F.notifications})),children:Z.loading&&!Z.data?a.jsxs("div",{className:"space-y-2",children:[a.jsx(tt,{className:"h-14 rounded-md"}),a.jsx(tt,{className:"h-14 rounded-md"}),a.jsx(tt,{className:"h-14 rounded-md"})]}):Z.error&&!Z.data?a.jsx(ve,{tone:"warning",title:"Could not load notification channels",action:a.jsx(se,{variant:"ghost",size:"sm",onClick:Z.reload,children:"Retry"}),children:Z.error.message}):(Z.data??[]).length===0?a.jsx(Sh,{channels:[],value:[],onChange:()=>{},label:"Channels",emptyHref:"/notifications",disabled:rt}):a.jsx(CC,{label:"Events",disabled:rt,items:kh.map(F=>({...F,enabled:h.notifications[F.id].enabled})),onChange:(F,be)=>xe(F,{enabled:be}),onToggleAll:F=>{for(const be of kh)xe(be.id,{enabled:F})},children:F=>{const be=h.notifications[F.id];return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-3 border-t border-line pt-3",children:a.jsx(Sh,{channels:Z.data??[],value:be.channelIds,onChange:Ue=>xe(F.id,{channelIds:Ue}),label:`${F.label} channels`,emptyHref:"/notifications",compact:!0,disabled:rt})}),be.channelIds.length===0&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"No channels selected — the event is recorded but not delivered."})]})}})})]})]})}function _C(n){return/^https?:\/\//i.test(n.backendHost||"")?n.backendHost:`${n.upstreamType||"http"}://${n.backendHost||"127.0.0.1"}:${n.port}`}function LC({domain:n}){if(!n.ssl?.enabled)return a.jsx(je,{tone:"neutral",children:"HTTP only"});const i=n.daysLeft;return i==null?a.jsx(je,{tone:"neutral",children:"SSL"}):i<0?a.jsx(je,{tone:"bad",children:"SSL expired"}):i<30?a.jsx(je,{tone:"warn",children:gi(i)}):a.jsx(je,{tone:"ok",children:gi(i)})}function UC({entry:n}){return n?n.up===null?a.jsx(je,{tone:"neutral",dot:!0,children:"External"}):n.up?a.jsx(je,{tone:"ok",dot:!0,children:"Up"}):a.jsx(je,{tone:"bad",dot:!0,children:"Down"}):null}function HC(){ba("Domains");const n=Et(),i=rn(),{domainHealth:r}=vn(),c=Tt(L=>fe.domains.list(L)),[d,f]=Jc(),[m,h]=p.useState(""),[g,v]=p.useState("all"),[b,x]=p.useState(null),[j,S]=p.useState(null),[R,k]=p.useState(!1),[C,z]=p.useState(!1);yl(c.reload),bi("domains",c.reload);const w=c.data,O=p.useMemo(()=>new Map((r??[]).map(L=>[L.name,L])),[r]),E=d.get("new")==="1",M=d.get("domain"),Y=M?(w??[]).find(L=>L.name===M):void 0,A=E?{mode:"create"}:Y?{mode:"edit",domain:Y}:null,H=p.useRef(null);p.useEffect(()=>{if(!w||!M){H.current=null;return}if(Y){H.current=null;return}H.current!==M&&(H.current=M,n.error("Domain not found",M),f({},{replace:!0}))},[w,M,Y,f,n]);const W=()=>f({new:"1"}),I=L=>f({domain:L}),ne=()=>f({},{replace:!0}),J=p.useMemo(()=>{const L=w??[];return{all:L.length,enabled:L.filter(te=>te.enabled).length,disabled:L.filter(te=>!te.enabled).length}},[w]),Z=p.useMemo(()=>{const L=m.trim().toLowerCase();return(w??[]).filter(te=>g==="enabled"&&!te.enabled||g==="disabled"&&te.enabled?!1:L?[te.name,te.backendHost,String(te.port)].join(" ").toLowerCase().includes(L):!0)},[w,g,m]),ee=async L=>{const te=!L.enabled;if(await i({title:`${te?"Enable":"Disable"} "${L.name}"?`,body:te?"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:te?"Enable":"Disable",tone:te?"accent":"danger"})){x({name:L.name,action:"toggle"});try{const ke=await fe.domains.toggle(L.name);c.setData(Ne=>Ne&&Ne.map(Ee=>Ee.name===L.name?{...Ee,enabled:ke.enabled}:Ee)),n.success(ke.enabled?"Domain enabled":"Domain disabled",ke.enabled?`${L.name} is being served again.`:`${L.name} is no longer served by nginx.`)}catch(ke){n.error(`Could not ${te?"enable":"disable"} the domain`,ke instanceof He?ke.message:void 0)}finally{x(null)}}},ue=async L=>{x({name:L.name,action:"reload"});try{const te=await fe.domains.reload(L.name);n.success("nginx reloaded",te.message||`${L.name} is live with its current configuration.`)}catch(te){n.error("Could not reload nginx",te instanceof He?te.message:void 0)}finally{x(null)}},K=L=>{k(!1),S(L)},B=async()=>{if(j){z(!0);try{const L=await fe.domains.remove(j.name,j.ssl.enabled&&R);n.success("Domain deleted",L.certDeleted?`${j.name}, its nginx config and its certificate files were removed.`:`${j.name} and its nginx config were removed. The certificate files were kept.`),S(null),c.reload()}catch(L){n.error("Could not delete the domain",L instanceof He?L.message:void 0)}finally{z(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",meta:w?a.jsxs("span",{className:"text-2xs text-faint",children:[J.all," total · ",J.enabled," enabled"]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"secondary",size:"sm",loading:c.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:c.reload,children:"Refresh"}),a.jsx(se,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,children:"Add domain"})]})}),c.error&&!w?a.jsx($t,{error:c.error,onRetry:c.reload}):w?w.length===0?a.jsx(et,{children:a.jsx(ga,{icon:a.jsx(Os,{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(se,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,children:"Add your first domain"})})}):a.jsxs("div",{className:"space-y-3",children:[c.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. ",c.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:c.reload,children:"Try again"})]}),a.jsxs(et,{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(Lb,{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:m,onChange:L=>h(L.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",J.all],["enabled","Enabled",J.enabled],["disabled","Disabled",J.disabled]].map(([L,te,de])=>a.jsxs("button",{type:"button","aria-pressed":g===L,onClick:()=>v(L),className:oe("inline-flex items-center gap-1.5 rounded-pill border px-2.5 py-1 text-xs transition-colors duration-[var(--ez-motion-fast)]",g===L?"border-accent/50 bg-accent-soft text-accent-text":"border-line text-muted hover:border-line-strong hover:text-ink"),children:[te,a.jsx("span",{className:oe("rounded-pill px-1 text-2xs",g===L?"bg-accent/15":"bg-inset text-faint"),children:de})]},L))})]}),Z.length===0?a.jsx(ga,{title:"No domains match",description:"Try a different search or show all domains.",action:a.jsx(se,{variant:"secondary",size:"sm",onClick:()=>{h(""),v("all")},children:"Clear filters"})}):a.jsx("ul",{className:"divide-y divide-line",children:Z.map(L=>{const te=O.get(L.name),de=te?.up===!1,ke=b?.name===L.name,Ne=ke?b?.action:null;return a.jsxs("li",{className:oe("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",!L.enabled&&"opacity-60"),children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[a.jsx(ln,{tone:L.enabled?de?"bad":"ok":"neutral",pulse:L.enabled&&!de,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:()=>I(L.name),className:"max-w-full truncate text-left font-mono text-sm font-semibold text-ink transition-colors hover:text-accent-text",children:L.name}),L.wildcard&&a.jsx(je,{tone:"accent",children:"wildcard"}),L.www&&a.jsx(je,{tone:"neutral",children:"www"}),!L.enabled&&a.jsx(je,{tone:"neutral",children:"disabled"}),L.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(as,{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:_C(L)}),L.ssl.enabled&&L.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(LC,{domain:L}),a.jsx(UC,{entry:te})]}),a.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1 pl-7 sm:pl-0",children:[a.jsx(ct,{label:L.enabled?`Disable ${L.name}`:`Enable ${L.name}`,size:"sm",disabled:ke,onClick:()=>ee(L),className:"text-muted hover:text-ink",children:Ne==="toggle"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):L.enabled?a.jsx(ck,{className:"size-3.5","aria-hidden":"true"}):a.jsx(dk,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Reload nginx for ${L.name}`,size:"sm",disabled:ke,onClick:()=>ue(L),className:"text-muted hover:text-ink",children:Ne==="reload"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Edit ${L.name}`,size:"sm",onClick:()=>I(L.name),className:"text-muted hover:text-accent-text",children:a.jsx(Vh,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Delete ${L.name}`,size:"sm",onClick:()=>K(L),className:"text-muted hover:text-bad",children:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"})})]})]},L.name)})})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-14 rounded-lg"}),a.jsx(tt,{className:"h-[320px] rounded-lg"})]}),A&&a.jsx(MC,{editor:A,onClose:ne,onSaved:()=>{ne(),c.reload()}},A.mode==="edit"?`edit:${A.domain.name}`:"create"),a.jsx(yn,{open:j!==null,onClose:()=>{C||S(null)},title:j?`Delete "${j.name}"?`:"Delete domain",description:"This also removes the domain's nginx config. It cannot be undone.",size:"sm",preventClose:C,footer:a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"ghost",onClick:()=>S(null),disabled:C,children:"Cancel"}),a.jsx(se,{variant:"danger",loading:C,onClick:B,children:"Delete domain"})]}),children:j&&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:j.name})," ","as soon as the config is removed."]}),j.ssl.enabled&&a.jsx("div",{className:"rounded-md border border-line bg-raised/40 p-3",children:a.jsx(pl,{checked:R,onChange:k,label:"Also delete the SSL certificate files",hint:`Otherwise ${j.name}'s certificate stays on disk and can be reused.`})})]})})]})}const Wa=Object.freeze([{id:"preflight",label:"Preflight checks"},{id:"account and order",label:"Account and order"},{id:"challenge ready",label:"Challenge ready"},{id:"waiting for validation",label:"Waiting for validation"},{id:"certificate received",label:"Certificate received"},{id:"files written",label:"Files written"},{id:"nginx config test",label:"nginx config test"},{id:"nginx reload",label:"nginx reload"},{id:"https verified",label:"HTTPS verified"}]),l0=Object.freeze([{id:"domain",label:"Domain linked"},...Wa.slice(0,6),{id:"https",label:"SSL settings"},...Wa.slice(6)]),i0=Object.freeze([{id:"domain",label:"Domain linked"},{id:"https",label:"SSL settings"},{id:"nginx config test",label:"nginx config test"},{id:"nginx reload",label:"nginx reload"},{id:"https verified",label:"HTTPS verified"}]),BC=i0;function ov(n){return l0.find(i=>i.id===n)?.label??Wa.find(i=>i.id===n)?.label??n}function cv(n){let i="";for(const r of n)i+=String.fromCharCode(r);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Jh(){const n=globalThis.crypto;if(n?.randomUUID){const r=n.randomUUID().replace(/-/g,""),c=new Uint8Array(16);for(let d=0;d<16;d+=1)c[d]=Number.parseInt(r.slice(d*2,d*2+2),16);return cv(c)}const i=new Uint8Array(16);if(n?.getRandomValues)n.getRandomValues(i);else for(let r=0;r<i.length;r+=1)i[r]=Math.floor(Math.random()*256);return cv(i)}function $C(n,i,r=Date.now()){const c=n[i.stage];if(c?.status==="failed"&&i.status==="running")return n;const d={status:i.status,detail:i.detail??c?.detail,elapsedMs:i.elapsedMs,elapsedAt:r};return{...n,[i.stage]:d}}const qC=new Set([...Wa.map(n=>n.id),"domain","https"]);function jr(n){return typeof n=="string"&&(qC.has(n)||n==="timeout")}function mn(n){return typeof n=="string"&&n.trim()?n.trim():null}function Ds(...n){for(const i of n){const r=mn(i);if(r)return r}return null}function uv(n){if(!n||typeof n!="object")return null;const i=n,r=i.error;if(r&&typeof r=="object"){const c=r;return{stage:jr(mn(c.stage))?mn(c.stage):jr(mn(c.step))?mn(c.step):null,message:Ds(c.cause,c.consequence,i.detail,i.hint)??"No certificate was issued.",fix:Ds(c.fix,i.hint),consequence:mn(c.consequence)}}return typeof r=="string"?{stage:null,message:Ds(i.detail,r)??r,fix:Ds(i.hint),consequence:null}:typeof i.step=="string"||typeof i.cause=="string"||typeof i.stage=="string"?{stage:jr(mn(i.stage))?mn(i.stage):jr(mn(i.step))?mn(i.step):null,message:Ds(i.cause,i.consequence,i.detail)??"No certificate was issued.",fix:Ds(i.fix,i.hint),consequence:mn(i.consequence)}:null}function Uc(n){if(n==null)return null;if(n instanceof He){const i=n.payload,r=uv(i);return r||{stage:null,message:Ds(i.detail,i.hint,n.message)??n.message,fix:Ds(i.hint),consequence:null}}return typeof n=="string"?{stage:null,message:n,fix:null,consequence:null}:uv(n)}function cl(n){let i=null;if(n instanceof He?i=n.payload.preflight:Array.isArray(n)?i=n:n&&typeof n=="object"&&(i=n.preflight??n),!i)return null;const r=!Array.isArray(i)&&i&&typeof i=="object"?i:{},c=Array.isArray(i)?i:Array.isArray(r.results)?r.results:null;if(!c)return null;const d=[];for(const m of c){if(!m||typeof m!="object")continue;const h=m,g=mn(h.id),v=h.status;g&&(v!=="ok"&&v!=="warn"&&v!=="fail"&&v!=="skipped"||d.push({id:g,status:v,message:mn(h.message)??g,fix:mn(h.fix)??void 0}))}if(d.length===0)return null;const f=d.some(m=>m.status==="fail");return{ok:typeof r.ok=="boolean"?r.ok:!f,detail:mn(r.detail)??void 0,results:d,proxied:r.proxied===!0,reachesUs:r.reachesUs===!0}}function GC(n){const i=n.split(":")[0];return i==="dns"?"DNS record":i==="a"?"IPv4 (A record)":i==="aaaa"?"IPv6 (AAAA record)":i==="http"?"HTTP self-check":"Check"}function YC(n){const i=n.split(":");return i.length<2?null:i[1]||null}function VC(n){const i=Math.max(0,Math.floor(n/1e3)),r=Math.floor(i/60),c=i%60;return r>0?`${r}m ${String(c).padStart(2,"0")}s`:`${c}s`}function XC(n,i){const r={},c=d=>({status:"skipped",detail:d});for(const d of i)d.id==="domain"?r[d.id]={status:"ok",detail:"nginx serves this name"}:d.id==="https"?n.ssl?n.ssl.ok?r[d.id]={status:"ok",detail:n.ssl.detail}:r[d.id]={status:"failed",detail:n.ssl.detail}:r[d.id]=c("No certificate was requested"):d.id==="nginx config test"?r[d.id]=n.nginxReloaded?{status:"ok",detail:"nginx accepted the config"}:c("nginx was not reloaded"):d.id==="nginx reload"?r[d.id]=n.nginxReloaded?{status:"ok",detail:"nginx reloaded"}:{status:"failed",detail:"nginx was not reloaded"}:d.id==="https verified"?r[d.id]=c(n.ssl?.ok?"The certificate was checked by the server":"No new certificate to verify"):r[d.id]=c("Not reported for a link that runs in one request");return r}function Wh(n){const{client:i}=vn(),[r,c]=p.useState({}),[d,f]=p.useState(!1),[m,h]=p.useState(null);p.useEffect(()=>{if(!i||!n)return;const v=b=>{!b||b.opId!==n||typeof b.stage!="string"||!jr(b.stage)||b.stage==="timeout"||(f(!0),h(typeof b.elapsedMs=="number"?b.elapsedMs:null),c(x=>{const j=typeof b.domain=="string"?b.domain:"",S=x[j]??{};return{...x,[j]:$C(S,b)}}))};return i.on("ssl:progress",v),()=>i.off("ssl:progress",v)},[i,n]);const g=p.useCallback(v=>{c(b=>{if(v===void 0)return{};const x={...b};return delete x[v],x}),f(!1),h(null)},[]);return{byDomain:r,heard:d,lastElapsedMs:m,clear:g}}function KC(n,i){if(n instanceof He){const r=n.payload.error;if(r&&typeof r=="object")return{title:i,step:r.step,stage:r.stage,cause:r.cause,consequence:r.consequence,fix:r.fix??(typeof n.payload.hint=="string"?n.payload.hint:void 0),nginxRunning:r.nginxRunning};const c=n.code==="email_required"?"Set the ACME email in Settings → General, or provide an email with this request.":typeof n.payload.hint=="string"?n.payload.hint:void 0,d=typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.output=="string"?n.payload.output:n.message;return{title:i,summary:c,detail:d}}if(n&&typeof n=="object"){const r=n;return{title:r.step==="email configuration"?"ACME email is not configured":i,step:r.step,stage:r.stage,cause:r.cause,consequence:r.consequence,fix:r.fix,nginxRunning:r.nginxRunning}}return typeof n=="string"&&n?{title:i,detail:n}:{title:i,summary:"No certificate was issued."}}function r0(n){return n==null?"unknown":n<1e3?`${Math.round(n)} ms`:n<6e4?`${(n/1e3).toFixed(1)} s`:`${Math.round(n/6e4)} min`}function ZC(n){return n?n==="proxy"?"The HTTP-01 challenge was answered through nginx, so nginx stayed running.":n==="standalone"?"The challenge ran in standalone mode.":n==="dns"?"Validated with a DNS TXT record.":`Validation mode: ${n}.`:null}function Rc({value:n,title:i="Certificate issuance failed"}){const r=KC(n,i),c=!!(r.step||r.cause||r.consequence);return a.jsxs(ve,{tone:"danger",title:r.title,children:[r.summary&&a.jsx("p",{children:r.summary}),c&&a.jsxs("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-2xs",children:[r.step&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Step"}),a.jsx("dd",{className:"text-muted",children:r.stage??r.step})]}),r.cause&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Cause"}),a.jsx("dd",{className:"text-muted",children:r.cause})]}),r.consequence&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Note"}),a.jsx("dd",{className:"text-muted",children:r.consequence})]})]}),r.nginxRunning===!1&&a.jsx("p",{className:"mt-2 text-2xs",children:"nginx is not running right now."}),r.fix&&a.jsxs("p",{className:"mt-2 break-words rounded border border-warn/25 bg-warn-soft px-2 py-1 text-2xs text-warn",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",r.fix]}),r.detail&&a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:r.detail})]})}function o0({result:n,title:i="Certificate issued"}){const r=ZC(n.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(ts,{className:"size-4 shrink-0 text-ok","aria-hidden":"true"}),i]}),n.summary&&a.jsx("p",{className:"mt-1 text-xs text-muted",children:n.summary}),n.fellBack&&a.jsxs(ve,{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 ",r0(n.nginxDownMs),"."]}),n.staging&&a.jsx(ve,{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:n.certPath}),a.jsx(qt,{value:n.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:n.keyPath}),a.jsx(qt,{value:n.keyPath,label:"Copy private key path"})]})]}),r&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:r})]})}const QC={ok:"OK",warn:"Warning",fail:"Failed",skipped:"Skipped"};function IC({status:n}){return n==="ok"?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):n==="warn"?a.jsx(fl,{className:"size-4 text-warn","aria-hidden":"true"}):n==="fail"?a.jsx(Cr,{className:"size-4 text-bad","aria-hidden":"true"}):n==="skipped"?a.jsx(iS,{className:"size-4 text-faint","aria-hidden":"true"}):a.jsx(zb,{className:"size-4 text-faint","aria-hidden":"true"})}function Rr({preflight:n,className:i}){if(!n||n.results.length===0)return null;const r=n.results.filter(m=>m.status==="fail").length,c=n.results.filter(m=>m.status==="warn").length,d=r>0?"bad":c>0?"warn":"ok",f=r>0?`${r} ${r===1?"check":"checks"} failed`:c>0?`${c} ${c===1?"warning":"warnings"}`:"All checks passed";return a.jsxs("section",{"aria-label":"Preflight checks",className:oe("rounded-md border border-line bg-raised/30 p-3",i),children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("h3",{className:"text-xs font-medium text-ink",children:"Preflight checks"}),a.jsx(je,{tone:d,children:f})]}),n.detail&&a.jsx("p",{className:"mt-1.5 break-words text-2xs text-muted",children:n.detail}),a.jsx("ul",{className:"mt-2 space-y-2",children:n.results.map((m,h)=>{const g=GC(m.id),v=YC(m.id),b=m.status==="fail"||m.status==="warn";return a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("div",{className:"mt-0.5 shrink-0",children:a.jsx(IC,{status:m.status})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"text-2xs font-medium text-ink",children:g}),v&&a.jsx("span",{className:"break-all font-mono text-2xs text-faint",children:v}),a.jsx("span",{className:oe("text-2xs uppercase tracking-wide",m.status==="fail"?"text-bad":m.status==="warn"?"text-warn":m.status==="ok"?"text-ok":"text-faint"),children:QC[m.status]})]}),a.jsx("p",{className:"mt-0.5 break-words text-2xs text-muted",children:m.message}),b&&m.fix&&a.jsxs("p",{className:"mt-1 break-words rounded border border-warn/25 bg-warn-soft px-2 py-1 text-2xs text-warn",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",m.fix]})]})]},`${m.id}-${h}`)})})]})}const dv={running:"Running",ok:"Done",failed:"Failed",skipped:"Skipped",pending:"Waiting"};function PC({status:n}){return n==="running"?a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}):n==="ok"?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):n==="failed"?a.jsx(Cr,{className:"size-4 text-bad","aria-hidden":"true"}):n==="skipped"?a.jsx(zb,{className:"size-4 text-faint","aria-hidden":"true"}):a.jsx(Db,{className:"size-4 text-faint/60","aria-hidden":"true"})}function ul({stages:n,states:i,ariaLabel:r="Certificate operation stages",failure:c=null,timedOut:d=!1,className:f}){const m=n.some(R=>i[R.id]?.status==="running"),[h,g]=p.useState(()=>Date.now());p.useEffect(()=>{if(!m)return;const R=setInterval(()=>g(Date.now()),1e3);return()=>clearInterval(R)},[m]);const v=p.useMemo(()=>n.map(R=>{const k=i[R.id];return k?`${R.label}: ${dv[k.status]??k.status}`:null}).filter(Boolean).join(". "),[n,i]),b=c?.stage&&c.stage!=="timeout"?c.stage:n.find(R=>i[R.id]?.status==="failed")?.id??null,x=d||c?.stage==="timeout",j=c?.message??null,S=c?.fix??null;return a.jsxs("div",{className:oe("min-w-0",f),children:[a.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:v}),a.jsx("ol",{"aria-label":r,className:"space-y-1",children:n.map((R,k)=>{const C=i[R.id],z=C?.status??"pending",w=!C,O=z==="running",E=z==="failed"||b===R.id,M=C?.detail,Y=O&&C?.elapsedMs!=null?C.elapsedMs+(C.elapsedAt!=null?Math.max(0,h-C.elapsedAt):0):null;return a.jsxs("li",{"aria-busy":O||void 0,className:oe("flex items-start gap-2.5 rounded-md px-2.5 py-2 transition-colors duration-[var(--ez-motion-fast)]",E?"bg-bad-soft/50 ring-1 ring-bad/30":O?"bg-accent-soft/40":"bg-transparent"),children:[a.jsx("div",{className:"mt-0.5 shrink-0",children:a.jsx(PC,{status:E&&z!=="failed"?"failed":z})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"text-2xs font-mono text-faint","aria-hidden":"true",children:String(k+1).padStart(2,"0")}),a.jsx("span",{className:oe("text-xs font-medium",E?"text-bad":w?"text-muted":"text-ink"),children:R.label}),O&&Y!==null&&a.jsx("span",{className:"font-mono text-2xs font-medium text-accent-text","aria-hidden":"true",children:VC(Y)}),a.jsx("span",{className:oe("text-2xs uppercase tracking-wide",E?"text-bad":z==="ok"?"text-ok":z==="running"?"text-accent-text":"text-faint"),children:E&&z!=="failed"?"Failed":dv[z]})]}),M&&a.jsx("p",{className:"mt-0.5 break-words text-2xs text-muted",children:M}),z==="skipped"&&!M&&a.jsx("p",{className:"mt-0.5 text-2xs text-faint",children:"Skipped."})]})]},R.id)})}),x?a.jsxs(ve,{tone:"warning",title:"The five-minute limit was reached",className:"mt-3",children:[a.jsx("p",{className:"break-words",children:j??"The certificate operation ran past its five-minute limit and stopped."}),a.jsxs("p",{className:"mt-1.5 text-2xs text-faint",children:["It stopped at ",b?ov(b):"an unknown stage",". Nothing later in the list ran, and the certificate already on disk was not replaced. Check the preflight checks, then try again."]})]}):j?a.jsxs(ve,{tone:"danger",title:b?`Stopped at ${ov(b)}`:"The certificate operation failed",className:"mt-3",children:[a.jsx("p",{className:"break-words",children:j}),c?.consequence&&a.jsx("p",{className:"mt-1.5 break-words text-2xs text-faint",children:c.consequence})]}):null,S&&!x&&a.jsxs("div",{role:"note",className:"mt-2 flex items-start gap-2 rounded-md border border-warn/30 bg-warn-soft px-3 py-2 text-xs text-warn",children:[a.jsx(Jk,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("p",{className:"break-words",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",S]})]}),x&&a.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(Hk,{className:"size-3.5 shrink-0","aria-hidden":"true"}),"The limit exists so a stuck ACME server cannot hold the dashboard open."]})]})}const fv="ssl-known-domains";function FC(n){return"status"in n&&n.status==="waiting_dns"}function JC({error:n}){const i=Array.isArray(n.payload.found)?n.payload.found.filter(c=>typeof c=="string"):[],r=typeof n.payload.hint=="string"?n.payload.hint:n.message;return a.jsxs(ve,{tone:"warning",title:"The TXT record was not found yet",children:[a.jsx("p",{children:r}),i.length>0&&a.jsxs("p",{className:"mt-1.5 break-all",children:["Records currently visible:"," ",a.jsx("span",{className:"font-mono text-ink",children:i.join(" · ")})]})]})}function WC({domains:n,initialDomain:i="",onClose:r,onIssued:c}){const d=Et(),f=rn(),m=Ic(),{connected:h}=vn(),[g]=p.useState(()=>Jh()),v=Wh(g),[b,x]=p.useState(i),[j,S]=p.useState(""),[R,k]=p.useState(!1),[C,z]=p.useState("http"),[w,O]=p.useState("form"),[E,M]=p.useState({}),[Y,A]=p.useState(null),[H,W]=p.useState(!1),[I,ne]=p.useState(null),[J,Z]=p.useState(!1),[ee,ue]=p.useState(null),[K,B]=p.useState(null),[L,te]=p.useState(""),de=b.trim().startsWith("*."),ke=L?v.byDomain[L]??{}:{},Ne=Uc(Y),Ee=cl(Y),T=K?cl(K.result):null,q=h&&v.heard&&L!=="",V=q?ke:{};p.useEffect(()=>{de&&(z("dns"),k(!1))},[de]);const re=b.trim()!==i||j.trim()!==""||R||C!=="http",ye=async()=>{const we={},nt=Fh(b.trim());nt&&(we.domain=nt);const rt=t0(j.trim());if(rt&&(we.email=rt),we.domain||we.email){M(we),queueMicrotask(()=>document.getElementById(we.domain?"ssl-domain":"ssl-email")?.focus());return}M({}),A(null),ue(null),W(!0);const xt=b.trim();te(xt),v.clear();try{const bt=await fe.ssl.create({domain:xt,www:de?!1:R,validationMethod:de?"dns":C,email:j.trim()||void 0,opId:g});if(FC(bt)){ne(bt),O("dns");return}B({result:bt,domain:xt}),O("success"),c(bt,xt)}catch(bt){A(bt)}finally{W(!1)}},Re=async()=>{if(I){ue(null),Z(!0);try{const we=await fe.ssl.confirmDns(I.domain),nt=I.domain;ne(null),B({result:we,domain:nt}),O("success"),c(we,nt)}catch(we){we instanceof He&&(we.code==="dns_not_propagated"||we.code==="dns_lookup_failed")?ue(we):(ne(null),O("form"),A(we))}finally{Z(!1)}}},xe=async()=>{if(I){Z(!0);try{await fe.ssl.cancelDns(I.domain),d.info("DNS challenge cancelled","No certificate was issued.")}catch{d.warning("Could not cancel the DNS challenge","It will expire on its own after ten minutes.")}finally{ne(null),ue(null),te(""),v.clear(),O("form"),Z(!1)}}},me=()=>{x(""),S(""),k(!1),z("http"),M({}),A(null),ue(null),B(null),te(""),v.clear(),O("form")},ie=H||J,Pe=async()=>{if(!ie){if(w==="dns"&&I){if(!await f({title:"Cancel the pending DNS challenge?",body:`No certificate will be issued for ${I.domain}. The TXT record can be removed afterwards.`,confirmLabel:"Cancel challenge",cancelLabel:"Keep waiting",tone:"danger"}))return;fe.ssl.cancelDns(I.domain).catch(()=>{}),r();return}w==="form"&&re&&!await f({title:"Discard this certificate request?",body:"The form has not been submitted, so nothing has been issued.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"})||r()}},Ve=p.useRef(Pe);Ve.current=Pe;const Xe=p.useCallback(()=>{Ve.current()},[]),ce=Y instanceof He&&Y.code==="email_required",De=w==="success"?"Certificate issued":w==="dns"?"DNS validation":"New certificate";return a.jsxs(yn,{open:!0,onClose:Xe,title:De,description:w==="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:ie,footer:w==="form"?a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"ghost",onClick:Xe,disabled:ie,children:"Cancel"}),a.jsx(se,{variant:"primary",loading:H,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),onClick:ye,children:"Issue certificate"})]}):w==="dns"?a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"ghost",onClick:xe,disabled:ie,children:"Cancel challenge"}),a.jsx(se,{variant:"primary",loading:J,onClick:Re,children:"I’ve added the record"})]}):a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"ghost",onClick:me,children:"Issue another"}),a.jsx(se,{variant:"primary",onClick:Xe,children:"Done"})]}),children:[w==="form"&&a.jsxs("div",{className:"space-y-4",children:[L&&(H||Y!=null)&&a.jsxs("div",{className:"space-y-2.5",children:[q?a.jsx(ul,{stages:Wa,states:V,ariaLabel:`Certificate stages for ${L}`,failure:Y!=null?Ne:null,timedOut:Ne?.stage==="timeout"}):H?a.jsxs("p",{role:"status",className:"flex items-start gap-2 rounded-md border border-line bg-raised/40 px-3 py-2.5 text-xs text-muted",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("span",{className:"break-words",children:["Issuing the certificate for"," ",a.jsx("span",{className:"font-mono text-ink",children:L}),". The live stage list needs the dashboard’s connection; the result appears here when it finishes."]})]}):null,Ee&&a.jsx(Rr,{preflight:Ee})]}),Y!=null&&a.jsxs("div",{className:"space-y-2",children:[!(q&&Ne)&&a.jsx(Rc,{value:Y}),ce&&a.jsx(se,{variant:"secondary",size:"sm",onClick:()=>{r(),m("/settings")},children:"Open settings"})]}),a.jsx(Me,{id:"ssl-domain",label:"Domain name",placeholder:"example.com",value:b,onChange:we=>x(we.target.value),error:E.domain,hint:"An A or AAAA record for this name must point at this server for an HTTP challenge.",list:fv,autoComplete:"off",spellCheck:!1,disabled:ie}),a.jsx("datalist",{id:fv,children:n.map(we=>a.jsx("option",{value:we.name},we.name))}),a.jsx(Me,{id:"ssl-email",label:"ACME email",optional:!0,type:"email",placeholder:"admin@example.com",value:j,onChange:we=>S(we.target.value),error:E.email,hint:"Used by Let’s Encrypt for expiry notices. Falls back to the email saved in Settings.",autoComplete:"email",disabled:ie}),de&&a.jsxs(ve,{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:ie,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:oe("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",C==="http"&&!de?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",(de||ie)&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"http",checked:C==="http"&&!de,disabled:de||ie,onChange:()=>z("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:oe("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",C==="dns"?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",ie&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"dns",checked:C==="dns",disabled:ie,onChange:()=>z("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(pl,{checked:R&&!de,onChange:k,disabled:de||ie,label:b.trim()?`Also cover www.${b.trim().replace(/^\*\./,"")}`:"Also cover the www subdomain",hint:de?"A wildcard certificate already covers every subdomain.":"Both names are added to the same certificate."})]}),w==="dns"&&I&&a.jsxs("div",{className:"space-y-4",children:[q&&a.jsx(ul,{stages:Wa,states:V,ariaLabel:`Certificate stages for ${L||I.domain}`}),a.jsx(ve,{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:I.txtName}),a.jsx(qt,{value:I.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:I.txtValue}),a.jsx(qt,{value:I.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."}),ee&&a.jsx(JC,{error:ee})]}),w==="success"&&K&&a.jsxs("div",{className:"space-y-4",children:[q&&a.jsx(ul,{stages:Wa,states:V,ariaLabel:`Certificate stages for ${K.domain}`}),a.jsx(o0,{result:K.result,title:`Certificate issued for ${K.domain}`}),T&&a.jsx(Rr,{preflight:T}),a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(vi,{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(Ur,{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 eT={valid:{label:"Valid",tone:"ok"},expiring:{label:"Expiring",tone:"warn"},expired:{label:"Expired",tone:"bad"},not_issued:{label:"Not issued yet",tone:"neutral"},unreadable:{label:"Unreadable",tone:"bad"},error:{label:"Unreadable",tone:"bad"}};function hv(n){return n==="unreadable"||n==="error"}function tT(n){return n===null?"text-faint":n<0?"text-bad":n<30?"text-warn":"text-ink"}function eh(n){const i=[];return n.summary&&i.push(n.summary),n.fellBack&&i.push(`nginx was stopped for ${r0(n.nginxDownMs)} while the challenge ran.`),n.staging&&i.push("This is a staging certificate that browsers will not trust."),i.join(" ")||"The certificate was renewed."}function nT(n){return n.error&&typeof n.error=="object"?n.error:typeof n.error=="string"?{step:n.error,cause:n.detail}:n.detail??"No certificate was issued."}function mv({children:n}){return a.jsxs("p",{role:"status",className:"flex items-start gap-2 rounded-md border border-line bg-raised/40 px-3 py-2.5 text-xs text-muted",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{className:"break-words",children:n})]})}function aT(){ba("SSL certificates");const n=Et(),i=rn(),r=Ic(),{connected:c}=vn(),d=Tt(T=>fe.ssl.list(T)),[f,m]=Jc(),[h]=p.useState(()=>Jh()),g=Wh(h),v=f.get("new")==="1"||!!f.get("domain"),b=f.get("domain")??"",x=Tt(T=>fe.domains.list(T),[],{enabled:v}),[j,S]=p.useState(null),[R,k]=p.useState(null),[C,z]=p.useState(null),[w,O]=p.useState(null),[E,M]=p.useState({}),[Y,A]=p.useState(null);yl(d.reload),bi(["ssl","domains"],d.reload);const H=d.data,W=p.useMemo(()=>{const T=H??[];return{total:T.length,valid:T.filter(q=>q.status==="valid").length,expiring:T.filter(q=>q.status==="expiring"||q.daysLeft!==null&&q.daysLeft>=0&&q.daysLeft<30).length,expired:T.filter(q=>q.status==="expired"||q.daysLeft!==null&&q.daysLeft<0).length,unreadable:T.filter(q=>hv(q.status)).length,notIssued:T.filter(q=>q.status==="not_issued").length}},[H]),I=p.useMemo(()=>(H??[]).filter(T=>T.daysLeft!==null&&T.daysLeft<30),[H]),ne=W.expiring>0||W.expired>0||W.unreadable>0,J=()=>m({},{replace:!0}),Z=()=>m({new:"1"}),ee=T=>m({domain:T}),ue=T=>g.byDomain[T]??{},K=T=>c&&Object.keys(g.byDomain[T]??{}).length>0,B=async T=>{if(!(j||R)){g.clear(T.domain),S(T.domain),z({domain:T.domain,done:!1});try{const q=await fe.ssl.renew(T.domain,h);z({domain:T.domain,done:!0,result:q}),n.success(`${T.domain} renewed`,eh(q)),d.reload()}catch(q){z({domain:T.domain,done:!0,error:q})}finally{S(null)}}},L=async T=>{if(!(j||R||!await i({title:`Delete the certificate for ${T.domain}?`,body:"Its files are removed from disk and this cannot be undone. The deletion is refused if any nginx configuration still references the certificate.",confirmLabel:"Delete certificate",tone:"danger"}))){k(T.domain);try{const V=await fe.ssl.remove(T.domain);n.success(`${T.domain} deleted`,`Removed ${V.directory}.`),d.reload()}catch(V){if(V instanceof He&&V.code==="cert_in_use")A({domain:T.domain,directory:typeof V.payload.directory=="string"?V.payload.directory:null,references:Array.isArray(V.payload.references)?V.payload.references:[]});else{const re=V instanceof He&&typeof V.payload.detail=="string"?V.payload.detail:V instanceof Error?V.message:void 0;n.error(`Could not delete ${T.domain}`,re)}}finally{k(null)}}},te=async()=>{if(j||R||I.length===0||!await i({title:`Renew ${$n(I.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"}))return;const q=I.map(V=>V.domain);g.clear(),M({}),S("all"),O({domains:q,done:!1,results:null});try{const V=await fe.ssl.renewAll(h);O({domains:q,done:!0,results:V});const re=V.filter(ye=>!ye.success).length;V.length===0?n.info("Nothing to renew","No certificate expires within 30 days."):re===0?n.success(`${$n(V.length,"certificate")} renewed`,"The new certificates are already on disk."):n.warning("Some certificates were not renewed",`${V.length-re} renewed, ${re} failed.`),d.reload()}catch(V){O({domains:q,done:!0,results:null,error:V})}finally{S(null)}},de=C?.error?Uc(C.error):null,ke=C?.error?cl(C.error):C?.result?cl(C.result):null,Ne=C?.error instanceof He&&C.error.code==="email_required",Ee=w?Array.from(new Set([...w.domains,...(w.results??[]).map(T=>T.domain)])):[];return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"SSL certificates",description:"Let’s Encrypt certificates managed by this installation. Renewals keep nginx running where possible.",meta:H?a.jsxs("span",{className:"text-2xs text-faint",children:[$n(W.total,"certificate")," · ",W.valid," valid",W.notIssued>0?` · ${W.notIssued} not issued`:""]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"secondary",size:"sm",loading:d.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:d.reload,children:"Refresh"}),a.jsxs(se,{variant:"secondary",size:"sm",disabled:I.length===0||j!==null||R!==null,loading:j==="all",onClick:te,children:["Renew expiring",I.length>0?` (${I.length})`:""]}),a.jsx(se,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:Z,children:"New certificate"})]})}),ne&&a.jsxs(ve,{tone:W.expired>0||W.unreadable>0?"danger":"warning",title:"Certificates need attention",className:"mb-4",children:[[W.expired>0?`${W.expired} expired`:null,W.expiring>0?`${W.expiring} expiring within 30 days`:null,W.unreadable>0?`${W.unreadable} unreadable`:null].filter(Boolean).join(" · "),". Renewing uses the same domain; an unreadable certificate is replaced by a freshly issued one."]}),d.error&&!H?a.jsx($t,{error:d.error,onRetry:d.reload}):H?H.length===0?a.jsx(et,{children:a.jsx(ga,{icon:a.jsx(Rn,{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(se,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:Z,children:"Issue a certificate"})})}):a.jsxs("div",{className:"space-y-3",children:[d.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. ",d.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:d.reload,children:"Try again"})]}),a.jsx(et,{className:"overflow-hidden",children:a.jsx("ul",{className:"divide-y divide-line",children:H.map(T=>{const q=eT[T.status]??{label:T.status,tone:"neutral"},V=j===T.domain,re=hv(T.status),ye=T.status==="not_issued";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(ln,{tone:q.tone,pulse:T.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:T.domain}),a.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-muted",children:re?a.jsx("span",{children:"Certificate files are unreadable"}):ye?a.jsx("span",{children:"No certificate has been issued for this domain yet"}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:["Expires ",Qh(T.expiry)]}),a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{className:oe("font-mono font-medium",tT(T.daysLeft)),children:T.daysLeft!==null?T.daysLeft<0?`${Math.abs(T.daysLeft)}d overdue`:`${T.daysLeft}d`:gi(T.daysLeft)}),T.autoRenew&&T.autoRenew!=="off"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{title:T.autoRenew==="auto"?"The background service renews this certificate on its own.":T.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:T.autoRenew==="manual"?"text-warn":void 0,children:T.autoRenew==="auto"?`Auto-renews ${T.autoRenewDays??7}d before expiry`:T.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:q.tone,dot:!0,children:q.label})}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5 pl-7 sm:pl-0",children:[ye?a.jsx(se,{variant:"secondary",size:"sm",disabled:j!==null||R!==null,onClick:()=>ee(T.domain),children:"Issue"}):a.jsx(se,{variant:"secondary",size:"sm",loading:V,disabled:j!==null||R!==null,onClick:()=>B(T),children:"Renew"}),re&&a.jsx(se,{variant:"dangerGhost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),loading:R===T.domain,disabled:j!==null||R!==null,onClick:()=>L(T),children:"Delete"})]})]},T.domain)})})})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-14 rounded-lg"}),a.jsx(tt,{className:"h-[280px] rounded-lg"})]}),v&&a.jsx(WC,{domains:x.data??[],initialDomain:b,onClose:J,onIssued:()=>d.reload()},b||"new"),a.jsx(yn,{open:C!==null,onClose:()=>z(null),title:C?C.done&&C.error?`${C.domain} was not renewed`:C.done?`${C.domain} renewed`:`Renewing ${C.domain}`:"Renewing",description:C?.done&&C.error?"The certificate already on disk was not replaced.":void 0,size:"md",preventClose:!!(C&&!C.done),footer:a.jsxs(a.Fragment,{children:[Ne&&a.jsx(se,{variant:"secondary",onClick:()=>{z(null),r("/settings")},children:"Open settings"}),a.jsx(se,{variant:"primary",disabled:!!(C&&!C.done),onClick:()=>z(null),children:"Close"})]}),children:C&&a.jsxs("div",{className:"space-y-3",children:[K(C.domain)?a.jsx(ul,{stages:Wa,states:ue(C.domain),ariaLabel:`Renewal stages for ${C.domain}`,failure:de,timedOut:de?.stage==="timeout"}):C.done?null:a.jsxs(mv,{children:["Renewing ",a.jsx("span",{className:"font-mono text-ink",children:C.domain}),". The live stage list needs the dashboard’s connection; the result appears here when it finishes."]}),ke&&a.jsx(Rr,{preflight:ke}),C.done&&(C.error?!K(C.domain)&&a.jsx(Rc,{value:C.error,title:"The certificate could not be renewed"}):C.result&&a.jsx(o0,{result:C.result,title:"Certificate renewed"}))]})}),a.jsxs(yn,{open:w!==null,onClose:()=>O(null),title:w?.done?"Renewal results":"Renewing expiring certificates",description:w?w.results?`${w.results.filter(T=>T.success).length} of ${w.results.length} certificates renewed.`:`${$n(w.domains.length,"certificate")} queued, one at a time.`:void 0,size:"lg",preventClose:!!(w&&!w.done),footer:a.jsx(se,{variant:"secondary",disabled:!!(w&&!w.done),onClick:()=>O(null),children:"Close"}),children:[w&&w.done&&w.results?.length===0?a.jsx(ga,{icon:a.jsx(Rn,{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:Ee.map(T=>{const q=w?.results?.find(Ve=>Ve.domain===T)??null,V=ue(T),re=K(T),ye=c&&Object.values(V).some(Ve=>Ve.status==="running"),Re=!!(w&&!w.done&&!q&&!ye),xe=q&&!q.success?Uc(q):null,me=q?cl(q):null,ie=!E[T],Pe=q?q.success?eh(q):xe?.message??"Not renewed":ye?"Renewing…":Re?"Waiting for its turn":"Not started";return a.jsx("li",{children:a.jsx(lu,{id:`renew-${T}`,className:"rounded-md border border-line bg-raised/30",headerClassName:"px-3.5 py-3",contentClassName:"px-3.5 pb-3",open:ie,onOpenChange:Ve=>M(Xe=>({...Xe,[T]:!Ve})),icon:a.jsx("span",{className:"shrink-0",children:q?q.success?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):a.jsx(Cr,{className:"size-4 text-bad","aria-hidden":"true"}):ye?a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}):a.jsx(ln,{tone:"neutral"})}),title:a.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"truncate font-mono text-sm font-medium text-ink",children:T}),q&&a.jsx(je,{tone:q.success?"ok":"bad",children:q.success?"Renewed":"Failed"})]}),description:Pe,children:a.jsxs("div",{className:"mt-2.5 border-t border-line pt-2.5",children:[re?a.jsx(ul,{stages:Wa,states:V,ariaLabel:`Renewal stages for ${T}`,failure:xe,timedOut:xe?.stage==="timeout"}):q?q.success?a.jsx("p",{className:"text-xs text-muted",children:eh(q)}):null:w&&!w.done?a.jsxs(mv,{children:["Renewing ",a.jsx("span",{className:"font-mono text-ink",children:T}),". The live stage list needs the dashboard’s connection."]}):null,me&&a.jsx(Rr,{preflight:me,className:"mt-2.5"}),q&&!q.success&&!re&&a.jsx("div",{className:"mt-2.5",children:a.jsx(Rc,{value:nT(q),title:`${q.domain} was not renewed`})}),q?.success&&q.configRegenerated&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"The nginx config was regenerated so it can answer the ACME challenge."})]})})},T)})}),w?.error!=null&&a.jsx("div",{className:"mt-3",children:a.jsx(Rc,{value:w.error,title:"The renewal run failed"})})]}),a.jsx(yn,{open:Y!==null,onClose:()=>A(null),title:Y?`${Y.domain} is still referenced`:"Certificate is still referenced",description:"Nothing was deleted. At least one nginx configuration file still points at this certificate.",size:"md",footer:a.jsx(se,{variant:"secondary",onClick:()=>A(null),children:"Close"}),children:Y&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs text-muted",children:"Disable SSL on the domain that uses this certificate — or remove the matching lines — then try deleting it again."}),Y.directory&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:Y.directory}),Y.references.length>0&&a.jsx("ul",{className:"space-y-2",children:Y.references.map(T=>a.jsxs("li",{className:"rounded-md border border-line bg-raised/30 px-3 py-2",children:[a.jsxs("div",{className:"break-all font-mono text-2xs font-medium text-ink",children:[T.file,":",T.line]}),a.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:T.text})]},`${T.file}:${T.line}`))})]})})]})}function c0(n,i={}){const{client:r,connected:c}=vn(),d=i.enabled??!0,f=i.limit??500,[m,h]=p.useState([]),[g,v]=p.useState(!1),[b,x]=p.useState(0),j=p.useRef(g);j.current=g,p.useEffect(()=>{if(!r||!d)return;const C=z=>{if(z.logFile===n){if(j.current){x(w=>Math.min(w+1,999));return}h(w=>{const O=[...w,z.line];return O.length>f?O.slice(O.length-f):O})}};return r.on("logs:line",C),()=>r.off("logs:line",C)},[r,d,f,n]),p.useEffect(()=>{h([]),x(0)},[d,n]),p.useEffect(()=>{if(!(!r||!d||!c))return h([]),x(0),r.emit("logs:subscribe",{logFile:n}),()=>r.emit("logs:unsubscribe")},[r,c,d,n]);const S=p.useCallback(()=>{h([]),x(0)},[]),R=p.useCallback(()=>{h([]),x(0),!(!r||!d)&&(r.emit("logs:unsubscribe"),r.emit("logs:subscribe",{logFile:n}))},[r,d,n]),k=p.useCallback(C=>{v(C),C||x(0)},[]);return{lines:m,paused:g,missed:b,connected:c,clear:S,restart:R,setPaused:k}}const vc={start:"Start nginx",stop:"Stop nginx",restart:"Restart nginx",reload:"Reload nginx",test:"Test configuration"},sT={start:()=>fe.nginx.start(),stop:()=>fe.nginx.stop(),restart:()=>fe.nginx.restart(),reload:()=>fe.nginx.reload(),test:()=>fe.nginx.test()};function pv(n){return n instanceof He?typeof n.payload.output=="string"&&n.payload.output?n.payload.output:typeof n.payload.error=="string"&&n.payload.error?n.payload.error:n.message:n instanceof Error?n.message:"The action failed."}function lT(n){return/\[(error|crit|emerg|alert)\]/i.test(n)?"text-bad":/\[warn(ing)?\]/i.test(n)?"text-warn":"text-muted"}function iT(){ba("Nginx");const n=Et(),i=rn(),{nginxStatus:r,connectionError:c}=vn(),d=Tt(V=>fe.nginx.status(V)),f=Tt(V=>fe.nginx.configs(V)),[m,h]=p.useState(null),[g,v]=p.useState(null),[b,x]=p.useState(null),[j,S]=p.useState(null),[R,k]=p.useState(""),[C,z]=p.useState(""),[w,O]=p.useState(!1),[E,M]=p.useState(!1),[Y,A]=p.useState(null),[H,W]=p.useState(null),I=p.useRef(null),ne=p.useRef(null),J=c0("error",{limit:300}),Z=p.useRef(null),[ee,ue]=p.useState(!0);p.useEffect(()=>{d.data&&h(d.data)},[d.data]),p.useEffect(()=>{r&&h(r)},[r]),p.useEffect(()=>{const V=Z.current;V&&ee&&(V.scrollTop=V.scrollHeight)},[J.lines,ee]);const K=j!==null&&R!==C;p.useEffect(()=>{if(!K)return;const V=re=>{re.preventDefault(),re.returnValue=""};return window.addEventListener("beforeunload",V),()=>window.removeEventListener("beforeunload",V)},[K]);const B=()=>{d.reload(),f.reload()};yl(B),bi("nginx",B);async function L(V){if(!(!V||V===j||w||E)&&!(K&&!await i({title:"Discard unsaved changes?",body:`${j} has edits that were not saved.`,confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}))){S(V),O(!0),A(null),W(null);try{const re=await fe.nginx.getConfig(V);k(re.content),z(re.content)}catch(re){A(re),k(""),z("")}finally{O(!1)}}}p.useEffect(()=>{j||!f.data?.length||L(f.data[0])},[f.data,j]);const te=async V=>{if(!g&&!((V==="stop"||V==="restart")&&!await i({title:V==="stop"?"Stop nginx?":"Restart nginx?",body:V==="stop"?"Every site nginx serves goes offline until it is started again.":"Open connections are dropped for a moment while nginx restarts.",confirmLabel:V==="stop"?"Stop nginx":"Restart nginx",tone:"danger"}))){v(V),x(null);try{const re=await sT[V]();x({action:V,ok:re.success,output:re.output}),re.success?(n.success(`${vc[V]} succeeded`,V==="test"?"nginx -t accepted the configuration.":void 0),V!=="test"&&d.reload()):n.error(`${vc[V]} failed`,re.output||void 0)}catch(re){const ye=pv(re);x({action:V,ok:!1,output:ye}),n.error(`${vc[V]} failed`,ye)}finally{v(null)}}},de=async()=>{if(!(!j||E||w||!K)){M(!0),W(null);try{const V=await fe.nginx.saveConfig(j,R);z(R),W({ok:!0,output:V.output||"Saved and tested successfully."}),n.success("Configuration saved","nginx -t passed. Reload nginx to apply it.")}catch(V){W({ok:!1,output:pv(V)}),n.error("Configuration rejected","The previous file was restored.")}finally{M(!1)}}},ke=()=>{k(C),W(null)},Ne=p.useMemo(()=>{const V=R.split(`
514
- `).length;return Array.from({length:Math.max(V,1)},(re,ye)=>ye+1)},[R]),Ee=!!m?.running,T=!m&&(d.loading||!!d.error),q=J.lines.join(`
515
- `);return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Nginx",description:"Service controls, configuration files and the error log, without leaving the dashboard.",actions:a.jsx(se,{variant:"secondary",size:"sm",loading:d.loading||f.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>{B(),J.restart()},children:"Refresh"})}),d.error&&!m?a.jsx($t,{error:d.error,onRetry:d.reload}):T?a.jsxs(ns,{children:[a.jsx(tt,{className:"h-24 rounded-lg"}),a.jsx(tt,{className:"h-[380px] rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[d.error&&m&&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. ",d.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:d.reload,children:"Try again"})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",Ee?"bg-ok/60":"bg-bad/60"),"aria-hidden":"true"}),a.jsxs(xn,{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(gl,{className:"size-5 text-ink","aria-hidden":"true"}),a.jsx(ln,{tone:Ee?"ok":"bad",pulse:Ee,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:Ee?"nginx is running":"nginx is stopped"}),m?.pid!==null&&m?.pid!==void 0&&Ee&&a.jsxs(je,{tone:"neutral",children:["pid ",m.pid]})]}),a.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted",children:m?.version??"Version unavailable"}),m?.error&&a.jsx("p",{className:"mt-1 text-xs text-bad",children:m.error})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ee?a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"secondary",size:"sm",loading:g==="reload",disabled:g!==null&&g!=="reload",onClick:()=>te("reload"),children:"Reload"}),a.jsx(se,{variant:"secondary",size:"sm",loading:g==="restart",disabled:g!==null&&g!=="restart",onClick:()=>te("restart"),children:"Restart"}),a.jsx(se,{variant:"danger",size:"sm",loading:g==="stop",disabled:g!==null&&g!=="stop",onClick:()=>te("stop"),children:"Stop"})]}):a.jsx(se,{variant:"primary",size:"sm",loading:g==="start",disabled:g!==null&&g!=="start",onClick:()=>te("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(se,{variant:"secondary",size:"sm",loading:g==="test",disabled:g!==null&&g!=="test",onClick:()=>te("test"),children:"Test config"})]})]}),b&&a.jsx("div",{className:"border-t border-line px-4 py-3 sm:px-5",children:a.jsx(ve,{tone:b.ok?"success":"danger",title:`${vc[b.action]} ${b.ok?"succeeded":"failed"}`,children:b.output&&a.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:b.output})})})]}),a.jsxs(et,{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"}),K&&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(pa,{"aria-label":"Configuration file",value:j??"",disabled:E||w||!f.data?.length,onChange:V=>void L(V.target.value),className:"w-full sm:w-60",children:[a.jsx("option",{value:"",disabled:!0,children:"Select a config file…"}),(f.data??[]).map(V=>a.jsx("option",{value:V,children:V},V))]}),a.jsx(se,{variant:"ghost",size:"sm",disabled:!K||E,icon:a.jsx(Gk,{className:"size-3.5","aria-hidden":"true"}),onClick:ke,children:"Revert"}),a.jsx(se,{variant:"primary",size:"sm",disabled:!j||!K,loading:E,icon:a.jsx(yh,{className:"size-3.5","aria-hidden":"true"}),onClick:de,children:"Save"})]})]}),f.error&&!f.data?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx($t,{error:f.error,onRetry:f.reload})}):f.data?f.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."}):w?a.jsxs("div",{className:"flex h-[360px] items-center justify-center gap-2 text-sm text-muted",children:[a.jsx(Ct,{className:"spin size-4","aria-hidden":"true"}),"Loading configuration…"]}):Y?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx($t,{error:Y,title:"Could not load this configuration",onRetry:()=>j?void L(j):void 0})}):j?a.jsxs("div",{className:"relative flex h-[min(56vh,520px)] min-h-[280px] overflow-hidden bg-canvas",children:[a.jsx("div",{ref:ne,"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:Ne.map(V=>a.jsx("div",{children:V},V))}),a.jsx("textarea",{ref:I,value:R,onChange:V=>k(V.target.value),onScroll:()=>{ne.current&&I.current&&(ne.current.scrollTop=I.current.scrollTop)},onKeyDown:V=>{(V.metaKey||V.ctrlKey)&&V.key.toLowerCase()==="s"&&(V.preventDefault(),de())},wrap:"off",spellCheck:!1,"aria-label":j?`${j} 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(tt,{className:"h-5 w-48"}),a.jsx(tt,{className:"h-[300px]"})]}),H&&a.jsxs("div",{className:oe("border-t px-4 py-3 sm:px-5",H.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:oe("text-xs font-medium",H.ok?"text-ok":"text-bad"),children:H.ok?"Saved — nginx test passed":"Save rejected — the previous file was restored"}),H.ok&&a.jsx(se,{variant:"secondary",size:"sm",loading:g==="reload",disabled:g!==null&&g!=="reload",onClick:()=>te("reload"),children:"Reload nginx"})]}),H.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:H.output})]})]}),a.jsxs(et,{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(ln,{tone:J.paused?"warn":J.connected?"ok":"neutral",pulse:!J.paused&&J.connected}),J.paused?"Paused":J.connected?"Live":"Connecting…"]}),J.paused&&J.missed>0&&a.jsxs(je,{tone:"warn",children:[J.missed," new"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[q&&a.jsx(qt,{value:q,label:"Copy lines",withText:!0}),a.jsx(ct,{label:J.paused?"Resume the log stream":"Pause the log stream",size:"sm",onClick:()=>J.setPaused(!J.paused),children:J.paused?a.jsx(Hr,{className:"size-3.5","aria-hidden":"true"}):a.jsx(_b,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:"Clear the log view",size:"sm",onClick:J.clear,disabled:J.lines.length===0,children:a.jsx(Ct,{className:"size-3.5 rotate-45","aria-hidden":"true"})})]})]}),a.jsx("div",{ref:Z,"aria-label":"Recent nginx error log",onScroll:V=>{const re=V.currentTarget;ue(re.scrollHeight-re.scrollTop-re.clientHeight<40)},className:"h-64 overflow-y-auto bg-canvas px-4 py-3 font-mono text-2xs leading-relaxed sm:px-5",children:!J.connected&&J.lines.length===0?a.jsx("p",{className:"text-faint",children:"Waiting for the live stream…"}):J.lines.length===0?a.jsx("p",{className:"text-faint",children:"No errors logged."}):J.lines.map((V,re)=>a.jsx("div",{className:oe("whitespace-pre-wrap break-all py-0.5",lT(V)),children:V},re))}),c&&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:J.restart,children:"Try again"})]})]})]})]})}const rT=[{value:"discord",label:"Discord",description:"Post alerts to a channel through a webhook URL.",icon:Wc},{value:"telegram",label:"Telegram",description:"Send alerts through a bot to a chat or group.",icon:Ub}];function oT(n){return{name:n?.name??"",type:n?.type??"discord",webhookUrl:n?.webhookUrl??"",botToken:n?.botToken??"",chatId:n?.chatId??"",message:n?.message??""}}function cT(n){if(n instanceof He){const i=typeof n.payload.detail=="string"?n.payload.detail:null;return i||n.message}return n instanceof Error?n.message:"The channel could not be saved."}function uT({channel:n,onClose:i,onSaved:r}){const c=rn(),d=n!==null,f=p.useRef(oT(n)),[m,h]=p.useState(f.current),[g,v]=p.useState({}),[b,x]=p.useState(null),[j,S]=p.useState(!1),R=Object.keys(m).some(w=>m[w]!==f.current[w]),k=(w,O)=>{h(E=>({...E,[w]:O})),v(E=>({...E,[w]:void 0})),x(null)},C=()=>{if(!j){if(!R){i();return}c({title:d?"Discard channel changes?":"Discard this channel?",body:"Nothing has been sent to the server yet.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}).then(w=>{w&&i()})}},z=async()=>{if(j)return;const w={};if(m.name.trim()||(w.name="Give the channel a name."),m.type==="discord"){const E=m.webhookUrl.trim();E?/^https:\/\/\S+$/i.test(E)||(w.webhookUrl="Enter an https:// URL without spaces."):w.webhookUrl="A Discord webhook URL is required."}else m.botToken.trim()||(w.botToken="The bot token is required."),m.chatId.trim()||(w.chatId="The chat ID is required.");if(v(w),Object.keys(w).length>0)return;const O={name:m.name.trim(),type:m.type,...m.type==="discord"?{webhookUrl:m.webhookUrl.trim(),message:m.message.trim()}:{botToken:m.botToken.trim(),chatId:m.chatId.trim()}};S(!0),x(null);try{const E=n?await fe.settings.channels.update(n.id,O):await fe.settings.channels.create(O);r(E,!d)}catch(E){x(cT(E))}finally{S(!1)}};return a.jsx(yn,{open:!0,onClose:C,title:d?`Edit ${n.name}`:"New notification channel",description:d?"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:j,footer:a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"secondary",onClick:C,disabled:j,children:"Cancel"}),a.jsx(se,{variant:"primary",type:"submit",form:"channel-form",loading:j,children:d?"Save channel":"Create channel"})]}),children:a.jsxs("form",{id:"channel-form",onSubmit:w=>{w.preventDefault(),z()},className:"space-y-4",children:[b&&a.jsx(ve,{tone:"danger",title:"Could not save the channel",children:b}),a.jsx(Me,{label:"Name",value:m.name,onChange:w=>k("name",w.target.value),placeholder:"Production Discord",error:g.name,autoFocus:!0}),a.jsxs("fieldset",{disabled:d||j,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:rT.map(w=>{const O=m.type===w.value;return a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-2.5 rounded-md border p-3 transition-colors duration-[var(--ez-motion-fast)]",O?"border-accent bg-accent-soft":"border-line bg-canvas hover:border-line-strong",(d||j)&&"cursor-not-allowed opacity-70"),children:[a.jsx("input",{type:"radio",name:"channel-type",value:w.value,checked:O,onChange:()=>k("type",w.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(w.icon,{className:"size-3.5 text-muted","aria-hidden":"true"}),w.label]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-faint",children:w.description})]})]},w.value)})}),d&&a.jsx(ml,{children:"The channel type cannot be changed after it is created."})]}),m.type==="discord"?a.jsxs(a.Fragment,{children:[a.jsx(Me,{label:"Webhook URL",value:m.webhookUrl,onChange:w=>k("webhookUrl",w.target.value),placeholder:"https://discord.com/api/webhooks/…",error:g.webhookUrl,hint:"Create one in Discord under Channel settings → Integrations → Webhooks.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsxs("div",{children:[a.jsx(Me,{label:"Message prefix",optional:!0,value:m.message,onChange:w=>k("message",w.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(Me,{label:"Bot token",value:m.botToken,onChange:w=>k("botToken",w.target.value),placeholder:"123456:ABC…",error:g.botToken,hint:"From @BotFather.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(Me,{label:"Chat ID",value:m.chatId,onChange:w=>k("chatId",w.target.value),placeholder:"-1001234567890",error:g.chatId,hint:"Groups start with a minus sign.",className:"font-mono",spellCheck:!1,autoComplete:"off"})]})]})})}const dT={nginx_down:"nginx",cert_expiry:"Certificate",domain_health:"Health check",test:"Test message"};function fT(n){return n.type==="nginx_down"?gl:n.type==="cert_expiry"?as:n.type==="domain_health"?Mc:Kh}function hT(n){return n==="danger"?"text-bad":n==="warning"?"text-warn":n==="success"?"text-ok":n==="info"?"text-info":"text-muted"}function xv(n,i){return n instanceof He?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function mT(n){if(!n)return"Webhook URL not set";try{const i=new URL(n),r=i.pathname.split("/").filter(Boolean).pop()??"";return`${i.host}/…${r.slice(-4)}`}catch{return"Webhook URL configured"}}function pT(n){return n.type==="discord"?mT(n.webhookUrl):`Chat ${n.chatId??"—"} · bot token saved`}function xT(){ba("Notifications");const n=Et(),i=rn(),{notifications:r,clearNotifications:c,connected:d,connectionError:f}=vn(),m=Tt(E=>fe.settings.channels.list(E)),h=Tt(E=>fe.domains.list(E)),[g,v]=p.useState(null),[b,x]=p.useState(null),[j,S]=p.useState(null),[,R]=p.useState(0);p.useEffect(()=>{const E=setInterval(()=>R(M=>M+1),3e4);return()=>clearInterval(E)},[]);const k=()=>{m.reload(),h.reload()};yl(k),bi(["settings","domains"],k);const C=p.useMemo(()=>{const E=new Map;for(const M of h.data??[]){if(!M.enabled)continue;const Y=new Map;for(const A of Object.values(M.notifications))if(A.enabled)for(const H of A.channelIds)Y.set(H,(Y.get(H)??0)+1);for(const[A,H]of Y){const W=E.get(A)??{domains:0,rules:0};W.domains+=1,W.rules+=H,E.set(A,W)}}return E},[h.data]),z=async E=>{if(!b){x(E.id);try{await fe.settings.channels.test(E.id),n.success(`Test sent to ${E.name}`,"Check the channel to confirm the message arrived.")}catch(M){n.error(`Test failed for ${E.name}`,xv(M,"The test message could not be delivered."))}finally{x(null)}}},w=async E=>{if(!(j||!await i({title:`Delete ${E.name}?`,body:"Domains routed to this channel stop delivering alerts there. The domains themselves are not changed.",confirmLabel:"Delete channel",tone:"danger"}))){S(E.id);try{await fe.settings.channels.remove(E.id),n.success("Channel deleted",`${E.name} will no longer receive alerts.`),m.reload()}catch(Y){n.error("Could not delete the channel",xv(Y,"The channel is still configured."))}finally{S(null)}}},O=m.data;return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Notifications",description:"Delivery channels for alerts, and the events received in this session.",actions:a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"secondary",size:"sm",loading:m.loading||h.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:k,children:"Refresh"}),a.jsx(se,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>v({channel:null}),children:"New channel"})]})}),m.error&&!O?a.jsx($t,{error:m.error,onRetry:m.reload}):O?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(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:"Channels",description:"Named Discord and Telegram destinations. Domains choose which channels receive their events.",actions:O.length>0?a.jsx(je,{tone:"neutral",children:$n(O.length,"channel")}):void 0}),m.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. ",m.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:m.reload,children:"Try again"})]}),O.length===0?a.jsx(ga,{icon:a.jsx(Wc,{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(se,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>v({channel:null}),children:"New channel"})}):a.jsx("ul",{className:"divide-y divide-line/70",children:O.map(E=>{const M=C.get(E.id),Y=j===E.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:"flex size-9 shrink-0 items-center justify-center rounded-md border border-line bg-inset text-muted",children:a.jsx(Tc,{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:E.name}),a.jsx(a0,{type:E.type}),h.data&&(M?a.jsxs(je,{tone:"ok",dot:!0,className:"cursor-default",children:[M.domains," ",M.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:pT(E)}),E.type==="discord"&&E.message&&a.jsxs("p",{className:"mt-0.5 truncate text-2xs text-faint",children:["Prefix: ",E.message]})]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 pl-12 sm:pl-0",children:[a.jsx(se,{variant:"secondary",size:"sm",loading:b===E.id,disabled:b!==null&&b!==E.id,icon:a.jsx(SS,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void z(E),children:"Test"}),a.jsx(se,{variant:"ghost",size:"sm",disabled:Y,icon:a.jsx(Vh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>v({channel:E}),children:"Edit"}),a.jsx(ct,{label:`Delete ${E.name}`,size:"sm",disabled:Y,className:"hover:text-bad",onClick:()=>void w(E),children:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"})})]})]},E.id)})}),O.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(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Tc,{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(ln,{tone:d?"ok":"warn",pulse:d}),d?"Live":"Reconnecting…"]})}),f&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(ve,{tone:"warning",children:f})}),r.length===0?a.jsx(ga,{icon:a.jsx(Tc,{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:r.map(E=>{const M=fT(E);return a.jsxs("li",{className:"flex items-start gap-2.5 px-4 py-2.5 sm:px-5",children:[a.jsx(M,{className:oe("mt-0.5 size-4 shrink-0",hT(E.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:E.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:dT[E.type]??"Notification"}),E.domain&&a.jsxs("span",{children:["· ",E.domain]}),a.jsxs("span",{children:["· ",$r(E.timestamp)]})]})]})]},E.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:c,className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Clear all events"})})]})]}),a.jsxs(et,{children:[a.jsx(pn,{title:"How routing works",description:"Channels do nothing until a domain sends to them."}),a.jsxs(xn,{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((E,M)=>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:M+1}),a.jsx("span",{children:E})]},E))}),a.jsxs(kt,{to:"/domains",className:ma("secondary","sm","w-full"),children:["Open domains",a.jsx(vi,{className:"size-3.5","aria-hidden":"true"})]})]})]})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-40 rounded-lg"}),a.jsx(tt,{className:"h-64 rounded-lg"})]}),g&&a.jsx(uT,{channel:g.channel,onClose:()=>v(null),onSaved:(E,M)=>{v(null),m.reload(),n.success(M?"Channel created":"Channel updated",M?`${E.name} is ready to receive alerts.`:`${E.name} was saved.`)}},g.channel?.id??"new")]})}function gv(n,i){return n instanceof He?typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.message=="string"?n.payload.message:n.message:n instanceof Error?n.message:i}function Hc(n){return n==="online"?"ok":n==="errored"?"bad":n==="stopping"||n==="launching"?"warn":"neutral"}function u0(n){return n===null||n===0?"—":R5(n)}function d0(n){return n===null||n===0?"—":Ib(n)}function yv(n,i){const r=i?.replace(/\\/g,"/").replace(/\/+$/,"").toLowerCase()??null;return[n.execPath,n.cwd].some(c=>{if(!c)return!1;const d=c.replace(/\\/g,"/").toLowerCase();return r&&d.startsWith(`${r}/modules/`)?!0:/(^|\/)(\.pm2|pm2)\/modules\//.test(d)})}function bc({label:n,value:i}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:n}),a.jsx("div",{className:"mt-0.5 text-xs tabular-nums text-muted",children:i})]})}function zs({label:n,value:i,detail:r,tone:c}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:n}),a.jsx("div",{className:oe("mt-0.5 text-sm font-medium",c??"text-ink"),children:i}),r&&a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:r})]})}function gT({command:n,guidance:i}){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:n}),a.jsx(qt,{value:n,label:"Copy command",withText:!0})]}),a.jsx("p",{className:"mt-2 text-2xs leading-relaxed text-muted",children:i})]})}function vv({label:n,version:i,path:r,broken:c=!1,emptyLabel:d="Unknown"}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs text-faint",children:n}),a.jsx("div",{className:oe("text-xs font-medium",c?"text-warn":"text-ink"),children:i??(c?"Missing":d)}),a.jsx("div",{className:"break-all font-mono text-2xs text-faint",children:r??"—"})]})}function yT({runtime:n}){const i=U5(n);return i?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"}),i.broken?a.jsx(je,{tone:"warn",children:"service runtime missing"}):i.pinned?i.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(vv,{label:"Service Node",version:i.serviceVersion,path:i.servicePath,broken:i.broken,emptyLabel:i.pinned?"Unknown":"Not pinned"}),a.jsx(vv,{label:"System Node",version:i.systemVersion,path:i.systemPath})]}),i.manager&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["The system Node is managed by ",i.manager,". The service uses its own pinned binary so switching versions cannot break it."]}),!i.pinned&&!i.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."]}),i.pinned&&!i.sameAsSystem&&!i.broken&&i.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 vT({app:n,onClose:i}){const r=Tt(d=>fe.processes.logs(n.name,200,d)),c=(r.data?.lines??[]).join(`
516
- `);return a.jsx(yn,{open:!0,onClose:i,title:`Logs — ${n.name}`,description:"The last 200 lines PM2 has written for this process.",size:"lg",footer:a.jsxs(a.Fragment,{children:[c.trim()&&a.jsx(qt,{value:c,label:"Copy logs",withText:!0}),a.jsx(se,{variant:"secondary",onClick:i,children:"Close"})]}),children:r.error&&!r.data?a.jsx($t,{error:r.error,title:"Could not read the logs",onRetry:r.reload,className:"border-0"}):r.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:c.trim()?c:"(no output)"}):a.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted",children:[a.jsx(_s,{}),"Reading logs…"]})})}function bv({app:n,isModule:i,busy:r,currentUser:c,onAction:d,onLogs:f}){const m=r?.name===n.name,h=!!(n.user&&c&&n.user!==c);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(ln,{tone:Hc(n.status),pulse:n.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:n.name}),a.jsx(je,{tone:Hc(n.status),children:n.status}),i&&a.jsx(je,{tone:"info",children:"module"}),h&&a.jsx(je,{tone:"warn",children:n.user})]}),(n.execPath||n.cwd)&&a.jsx("p",{className:"mt-0.5 truncate font-mono text-2xs text-faint",children:n.execPath??n.cwd})]}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5",children:[n.status==="online"?a.jsx(se,{variant:"secondary",size:"sm",loading:m&&r?.action==="stop",disabled:m||h,icon:a.jsx(Zh,{className:"size-3","aria-hidden":"true"}),onClick:()=>d(n,"stop",i),children:"Stop"}):a.jsx(se,{variant:"secondary",size:"sm",loading:m&&r?.action==="start",disabled:m||h,icon:a.jsx(Hr,{className:"size-3","aria-hidden":"true"}),onClick:()=>d(n,"start",i),children:"Start"}),a.jsx(se,{variant:"ghost",size:"sm",loading:m&&r?.action==="restart",disabled:m||h,icon:a.jsx(Xh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>d(n,"restart",i),children:"Restart"}),a.jsx(se,{variant:"ghost",size:"sm",disabled:m,icon:a.jsx(Er,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>f(n),children:"Logs"})]})]}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[a.jsx(bc,{label:"CPU",value:u0(n.cpu)}),a.jsx(bc,{label:"Memory",value:d0(n.memoryBytes)}),a.jsx(bc,{label:"Uptime",value:eu(n.uptimeMs)}),a.jsx(bc,{label:"Restarts",value:n.unstableRestarts>0?`${n.restarts} · ${n.unstableRestarts} unstable`:String(n.restarts)})]})]})}const f0="ez.processes.view";function bT(){try{return localStorage.getItem(f0)==="table"?"table":"list"}catch{return"list"}}function jT({view:n,onChange:i}){const r=[{id:"list",label:"List view",icon:ZS},{id:"table",label:"Table view",icon:Mk}];return a.jsx("div",{role:"group","aria-label":"Process layout",className:"inline-flex items-center gap-0.5 rounded-md border border-line bg-raised p-0.5",children:r.map(({id:c,label:d,icon:f})=>a.jsxs("button",{type:"button","aria-pressed":n===c,title:d,onClick:()=>i(c),className:oe("inline-flex size-7 items-center justify-center rounded-sm transition-colors duration-[var(--ez-motion-fast)]",n===c?"bg-surface text-ink shadow-sm":"text-faint hover:text-ink"),children:[a.jsx(f,{className:"size-3.5","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:d})]},c))})}function NT({app:n}){return n.unstableRestarts>0?`${n.restarts} · ${n.unstableRestarts} unstable`:String(n.restarts)}function jv({apps:n,isModule:i,busy:r,currentUser:c,onAction:d,onLogs:f}){return a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full min-w-[42rem] text-left text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-line text-2xs uppercase tracking-wider text-faint",children:[a.jsx("th",{scope:"col",className:"px-4 py-2 font-medium sm:px-5",children:"Process"}),a.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"CPU"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Memory"}),a.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Uptime"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Restarts"}),a.jsx("th",{scope:"col",className:"px-4 py-2 text-right font-medium sm:px-5",children:a.jsx("span",{className:"sr-only",children:"Actions"})})]})}),a.jsx("tbody",{children:n.map(m=>{const h=r?.name===m.name,g=!!(m.user&&c&&m.user!==c);return a.jsxs("tr",{className:"border-b border-line/70 last:border-0",children:[a.jsx("td",{className:"px-4 py-2 sm:px-5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ln,{tone:Hc(m.status),pulse:m.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:m.name}),i&&a.jsx(je,{tone:"info",children:"module"}),g&&a.jsx(je,{tone:"warn",children:m.user})]})}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2",children:a.jsx(je,{tone:Hc(m.status),children:m.status})}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:u0(m.cpu)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:d0(m.memoryBytes)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 tabular-nums text-muted",children:eu(m.uptimeMs)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:a.jsx(NT,{app:m})}),a.jsx("td",{className:"px-4 py-2 sm:px-5",children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[m.status==="online"?a.jsx(ct,{label:`Stop ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"stop",i),children:h&&r?.action==="stop"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Zh,{className:"size-3","aria-hidden":"true"})}):a.jsx(ct,{label:`Start ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"start",i),children:h&&r?.action==="start"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Hr,{className:"size-3","aria-hidden":"true"})}),a.jsx(ct,{label:`Restart ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"restart",i),children:h&&r?.action==="restart"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Xh,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`View logs for ${m.name}`,size:"sm",disabled:h,onClick:()=>f(m),children:a.jsx(Er,{className:"size-3.5","aria-hidden":"true"})})]})})]},`${m.name}-${m.pmId??"x"}`)})})]})})}function wT(){ba("Processes");const n=Et(),i=rn(),{service:r,loading:c,error:d,reload:f,applyBackgroundService:m}=Br(),h=qr(r),g=Tt(ee=>fe.processes.list(ee)),[v,b]=p.useState(null),[x,j]=p.useState(null),[S,R]=p.useState(null),[k,C]=p.useState(null),[z,w]=p.useState(bT),[O,E]=p.useState(!1),M=ee=>{w(ee);try{localStorage.setItem(f0,ee)}catch{}},Y=()=>{g.reload(),f()};hl(g.reload,15e3),hl(()=>{c||f()},15e3),yl(Y);const A=async(ee,ue,K)=>{if(!v){if(ue==="stop"||ue==="restart"){const B=K?ue==="stop"?ee.name.toLowerCase().includes("logrotate")?`${ee.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.`:`${ee.name} is a PM2 module, not one of your apps. Stopping it changes how PM2 itself behaves.`:`${ee.name} is a PM2 module. Restarting it briefly stops the behaviour it adds to PM2.`:`${ee.name} is one of your own PM2 apps. ${ue==="stop"?"Stopping":"Restarting"} it affects whatever else relies on it.`;if(!await i({title:`${ue==="stop"?"Stop":"Restart"} ${ee.name}?`,body:B,confirmLabel:K&&ue==="stop"?"Stop module anyway":`${ue==="stop"?"Stop":"Restart"} anyway`,tone:"danger"}))return}b({name:ee.name,action:ue});try{const B=await fe.processes.action(ee.name,ue);n.success(`${ee.name}: ${ue} done`,B.output||void 0),Y()}catch(B){n.error(`Could not ${ue} ${ee.name}`,gv(B,"PM2 refused the action. Check the PM2 log for details."))}finally{b(null)}}},H=async ee=>{if(!h||S)return;const ue=h.startsAt==="logon"?"at your next logon":h.startsAt==="boot"?"at the next boot":"when the service starts";if(await i(ee==="start"?{title:"Start the background service?",body:h.installed?`Monitoring and notifications keep running after this dashboard closes. From now on it also starts ${ue}.`:"The service is not installed; if it cannot start, the exact install command is shown instead.",confirmLabel:"Start service"}:ee==="stop"?{title:"Stop the background service?",body:h.installed?`Monitoring and notifications pause while it is down. It returns ${ue} 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"})){R(ee),C(null);try{const B=await fe.service[ee]();m(B.backgroundService),n.success(ee==="start"?"Background service started":ee==="stop"?"Background service stopped":"Background service restarted",B.output?.trim()||void 0),f()}catch(B){if(B instanceof He){if(B.payload.backgroundService&&m(B.payload.backgroundService),B.status===403&&B.code==="elevation_required"){C({kind:"elevation",action:ee,command:typeof B.payload.command=="string"?B.payload.command:`ezz service ${ee}`,shell:typeof B.payload.shell=="string"?B.payload.shell:null,message:typeof B.payload.message=="string"?B.payload.message:null});return}if(B.status===409&&B.code==="not_installed"){C({kind:"install",action:ee,command:typeof B.payload.command=="string"?B.payload.command:r?.install.command??"ezz service install",shell:r?.install.shell??null,message:typeof B.payload.message=="string"?B.payload.message:null});return}if(B.status===409&&B.code==="already_running"){n.info("The background service is already running.",typeof B.payload.message=="string"?B.payload.message:void 0),f();return}n.error(`Could not ${ee} the background service`,gv(B,"The service manager refused the action.")),f();return}n.error(`Could not ${ee} the background service`,B instanceof Error?B.message:"The dashboard could not complete the action.")}finally{R(null)}}},W=(g.data?.apps??[]).filter(ee=>!ee.managed),I=g.data?.currentUser??null,ne=g.data?.pm2Home??null,J=W.filter(ee=>yv(ee,ne)),Z=W.filter(ee=>!yv(ee,ne));return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Processes",description:"The Easy DevOps background service, plus every PM2 app you run for yourself.",actions:a.jsx(se,{variant:"secondary",size:"sm",loading:g.loading||c,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:Y,children:"Refresh"})}),g.error&&!g.data?a.jsx($t,{error:g.error,onRetry:g.reload}):g.data?a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",h?.running?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Hb,{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:_c(h)}),r?.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(se,{variant:"secondary",size:"sm",loading:S==="stop",disabled:S!==null,icon:a.jsx(Zh,{className:"size-3","aria-hidden":"true"}),onClick:()=>void H("stop"),children:"Stop"}),a.jsx(se,{variant:"secondary",size:"sm",loading:S==="restart",disabled:S!==null,icon:a.jsx(Xh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void H("restart"),children:"Restart"})]}):a.jsx(se,{variant:"primary",size:"sm",loading:S==="start",disabled:S!==null,icon:a.jsx(Hr,{className:"size-3","aria-hidden":"true"}),onClick:()=>void H("start"),children:"Start"}):void 0}),a.jsxs(xn,{className:"space-y-4",children:[k&&a.jsxs(ve,{tone:"warning",title:k.kind==="install"?"The background service is not installed":`${k.action==="start"?"Starting":k.action==="stop"?"Stopping":"Restarting"} needs ${k.shell??"a terminal with extra rights"}`,action:a.jsx(ct,{label:"Dismiss",size:"sm",onClick:()=>C(null),children:a.jsx(Ms,{className:"size-3.5","aria-hidden":"true"})}),children:[k.message&&a.jsx("p",{children:k.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:k.command}),a.jsx(qt,{value:k.command,label:"Copy command",withText:!0})]}),k.shell&&a.jsxs("p",{className:"mt-1.5 text-2xs text-faint",children:["Run it in ",k.shell,"."]})]}),a.jsx("p",{className:"mt-2 text-2xs text-faint",children:k.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."})]}),d&&!r?a.jsx($t,{error:d,title:"Could not read the service state",onRetry:f,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(zs,{label:"Status",value:_c(h),tone:h.running?"text-ok":"text-warn",detail:h.stoppedByUser&&h.stoppedAtLabel?`Stopped ${h.stoppedAtLabel}`:h.detail??void 0}),a.jsx(zs,{label:"PID",value:h.pid===null?"—":String(h.pid)}),a.jsx(zs,{label:"Uptime",value:eu(h.uptimeMs)}),a.jsx(zs,{label:"Installed",value:h.installed?"Yes":"No"}),a.jsx(zs,{label:"Mode",value:h.mechanismLabel,detail:h.mechanismDetail}),a.jsx(zs,{label:"Starts",value:h.startsAtLabel}),a.jsx(zs,{label:"Monitoring runs in",value:h.jobsOwnerLabel}),a.jsx(zs,{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:r?.dataDir??"—"})]}),h.version&&a.jsxs("span",{children:["Daemon ",a.jsx("code",{className:"font-mono text-muted",children:h.version})]})]}),h.runtime?a.jsx(yT,{runtime:h.runtime}):r?.probes?.pending?a.jsxs("p",{className:"flex items-center gap-2 text-2xs text-faint",children:[a.jsx(_s,{}),"Measuring the Node 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(ee=>a.jsx(ve,{tone:"warning",children:a.jsx("span",{className:"whitespace-pre-line",children:ee})},ee)),!h.running&&a.jsx(ve,{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(lu,{id:"service-install",title:"Install or repair the service",open:O,onOpenChange:E,className:"rounded-md border border-line bg-canvas/40",headerClassName:"px-3.5 py-3",contentClassName:"space-y-2.5 px-3.5 pb-3",children:[a.jsx(gT,{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(_s,{}),"Checking the background service…"]})]})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Your PM2 apps",Z.length>0&&a.jsx(je,{tone:"neutral",children:$n(Z.length,"app")})]}),description:I?`Apps PM2 is supervising for ${I}. Easy DevOps itself is not one of them.`:"Apps PM2 is supervising for you. Easy DevOps itself is not one of them.",actions:Z.length>0||J.length>0?a.jsx(jT,{view:z,onChange:M}):void 0}),g.data.pm2.installed&&g.data.hint&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(ve,{tone:"warning",children:g.data.hint})}),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"})]}),g.data.pm2.installed?Z.length===0?a.jsx(ga,{icon:a.jsx(Er,{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("div",{className:"panel-enter",children:z==="table"?a.jsx(jv,{apps:Z,isModule:!1,busy:v,currentUser:I,onAction:A,onLogs:j}):a.jsx("ul",{className:"divide-y divide-line/70",children:Z.map(ee=>a.jsx(bv,{app:ee,isModule:!1,busy:v,currentUser:I,onAction:A,onLogs:j},`${ee.name}-${ee.pmId??"x"}`))})},z):a.jsx(ga,{icon:a.jsx(Er,{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."})]}),J.length>0&&a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["PM2 modules",a.jsx(je,{tone:"neutral",children:$n(J.length,"module")})]}),description:"Modules extend PM2 itself and are not your apps. Stopping pm2-logrotate lets PM2 logs grow without limit."}),a.jsx("div",{className:"panel-enter",children:z==="table"?a.jsx(jv,{apps:J,isModule:!0,busy:v,currentUser:I,onAction:A,onLogs:j}):a.jsx("ul",{className:"divide-y divide-line/70",children:J.map(ee=>a.jsx(bv,{app:ee,isModule:!0,busy:v,currentUser:I,onAction:A,onLogs:j},`${ee.name}-${ee.pmId??"x"}`))})},z)]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-56 rounded-lg"}),a.jsx(tt,{className:"h-72 rounded-lg"})]}),x&&a.jsx(vT,{app:x,onClose:()=>j(null)})]})}function ST(n){return n?!/^[a-z0-9][a-z0-9-]{0,39}$/.test(n)||n.endsWith("-")?"Lower-case letters, digits and dashes, up to 40 characters.":null:"A name is required."}function kT(n){return/^ssh:\/\//.test(n)||/^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+:/.test(n)}function h0(n){if(!n)return null;const i=/^https?:\/\/github\.com\/([^/]+)\/([^/#?]+?)(?:\.git)?\/?$/i.exec(n.trim()),r=/^[A-Za-z0-9._-]+@github\.com:([^/]+)\/(.+?)(?:\.git)?$/i.exec(n.trim()),c=/^ssh:\/\/(?:[A-Za-z0-9._-]+@)?github\.com(?::\d+)?\/([^/]+)\/(.+?)(?:\.git)?$/i.exec(n.trim()),d=i??r??c;return d?`https://github.com/${d[1]}/${d[2]}/settings/keys/new`:null}function CT(n){const i={},r=n.split(/\r?\n/);for(let c=0;c<r.length;c++){const d=r[c];if(!d.trim()||d.trim().startsWith("#"))continue;const f=d.indexOf("=");if(f===-1)return{env:i,error:`Line ${c+1}: expected NAME=value.`};const m=d.slice(0,f).trim().replace(/^export\s+/,"");if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(m))return{env:i,error:`Line ${c+1}: "${m}" is not a valid variable name.`};let h=d.slice(f+1).trim();h.length>=2&&(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))&&(h=h.slice(1,-1)),i[m]=h}return{env:i,error:null}}function TT(n){return Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join(`
517
- `)}let Nv=0;function ET(){return Nv+=1,`step-${Nv}`}function m0(n){return n.map(i=>({key:ET(),run:i.run,kind:i.kind,enabled:i.enabled!==!1}))}function RT(n){return n.filter(i=>i.run.trim()).map(i=>({run:i.run.trim(),kind:i.kind,enabled:i.enabled!==!1}))}function zT(n){if(Array.isArray(n.steps))return n.steps.map(r=>({run:r.run,kind:r.kind,enabled:r.enabled!==!1}));const i=[];for(const r of["install","build","migrate"]){const c=n[r];if(typeof c=="string"&&c.trim()){i.push({run:c.trim(),kind:r,enabled:!0});continue}for(const d of Array.isArray(c)?c:[])d.trim()&&i.push({run:d,kind:r,enabled:!0})}return i}function DT(n){return n.steps!==void 0||n.install!==void 0||n.build!==void 0||n.migrate!==void 0}const jc=5,p0=[{value:"install",label:"Install"},{value:"build",label:"Build"},{value:"migrate",label:"Migrate"},{value:"custom",label:"Custom"}];function AT(n){const i={};n.forEach((d,f)=>{d.enabled!==!1&&i[d.kind]===void 0&&(i[d.kind]=f)});const r=[],c=(d,f,m)=>{const h=i[d],g=i[f];h!==void 0&&g!==void 0&&h<g&&r.push(m)};return c("migrate","install",'The "migrate" step is listed before "install", but dependencies are not installed yet. Put "install" before "migrate".'),c("build","install",'The "build" step is listed before "install", but dependencies are not installed yet. Put "install" before "build".'),c("migrate","build",'The "migrate" step is listed before "build". Build first, then migrate, so the migration runs against the release that is about to start.'),r}function wv(n){return n.startsWith('The "')}const iu=[{id:"node",label:"Default Node app",description:"npm ci, then npm start",start:"npm start",steps:[{run:"npm ci",kind:"install",enabled:!0}]},{id:"next",label:"Next.js",description:"npm ci and npm run build, then npm start",start:"npm start",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]},{id:"nest",label:"NestJS",description:"npm ci and npm run build, then node dist/main.js",start:"node dist/main.js",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]},{id:"express",label:"Express / Fastify",description:"npm ci, then node server.js",start:"node server.js",steps:[{run:"npm ci",kind:"install",enabled:!0}]},{id:"nuxt",label:"Nuxt",description:"npm ci and npm run build, then the Node server",start:"node .output/server/index.mjs",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]}];function OT(n){return[...n.steps,{run:"npm run lint",kind:"custom",enabled:!1},{run:"npx prisma migrate deploy",kind:"migrate",enabled:!1}]}function x0(n,i){return{steps:m0(zT(n)),start:n.start??"",runtime:n.runtime??"node",port:n.port?String(n.port):"",healthPath:n.healthPath??"",persist:Array.isArray(n.persist)?[...n.persist]:n.persist?[n.persist]:[],execMode:n.execMode??i?.execMode??"fork",instances:n.instances!==void 0?String(n.instances):i?.instances!==void 0?String(i.instances):"",stepsOverride:DT(n),startOverride:n.start!==void 0,runtimeOverride:n.runtime!==void 0,execModeOverride:n.execMode!==void 0,instancesOverride:n.instances!==void 0}}function MT(n){const i=n.trim(),r=i.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!r)return{path:null,error:"Enter a folder or file path."};if(r.length>200)return{path:null,error:`"${i}" is longer than 200 characters.`};if(r.startsWith("/")||/^[A-Za-z]:/.test(r))return{path:null,error:`"${i}" must be relative to the project folder.`};const c=r.split("/");return c.some(d=>d===""||d==="."||d==="..")?{path:null,error:`"${i}" must be a relative path without "." or "..".`}:c.includes(".git")?{path:null,error:`"${i}" cannot be ".git".`}:c.includes("node_modules")?{path:null,error:`"${i}" cannot include node_modules.`}:/[<>:"|?*]/.test(r)?{path:null,error:`"${i}" contains characters that are not allowed.`}:{path:r,error:null}}function _T(n,i){const r=MT(n);if(r.error||!r.path)return r;const c=r.path;if(i.includes(c))return{path:null,error:`"${c}" is already listed.`};if(i.length>=20)return{path:null,error:"Use at most 20 paths."};const d=c.toLowerCase();for(const f of i){const m=f.toLowerCase();if(m.startsWith(`${d}/`))return{path:null,error:`"${c}" contains "${f}" — keep only "${c}".`};if(d.startsWith(`${m}/`))return{path:null,error:`"${c}" is inside "${f}" — keep only "${f}".`}}return{path:c,error:null}}function LT(n){const i={};if(n.stepsOverride&&(i.steps=RT(n.steps)),n.startOverride&&n.start.trim()&&(i.start=n.start.trim()),n.runtimeOverride&&(i.runtime=n.runtime),n.port.trim()&&(i.port=Number(n.port)),n.healthPath.trim()&&(i.healthPath=n.healthPath.trim()),n.persist.length>0&&(i.persist=[...n.persist]),n.execModeOverride&&(i.execMode=n.execMode),n.instancesOverride){const r=n.instances.trim();r==="max"?i.instances="max":r&&Number.isInteger(Number(r))&&Number(r)>=1&&(i.instances=Number(r))}return i}const Sv="Cluster mode runs several copies of the app; it must be stateless (no in-memory sessions, sockets, caches or schedulers that assume one process).";function UT(n){const i=n.trim();return i?/^node\s+(?!-)\S+$/.test(i):null}function Bc(n){if(!n.execMode)return null;const i=n.execMode==="cluster"?"Cluster":"Fork",r=n.instancesOnline??0;if(n.instances==="max")return`${i} · ${r} online (max)`;const c=n.instances??1;return`${i} · ${r}/${c} online`}const g0={running:{label:"Deploying",tone:"info"},success:{label:"Succeeded",tone:"ok"},failed:{label:"Failed",tone:"bad"},rolled_back:{label:"Rolled back",tone:"warn"}},HT={fetch:"Fetching the code",settings:"Reading project settings",pre:"Pre-deploy hook",install:"Installing",build:"Building",migrate:"Running migrations",start:"Starting",health:"Health check",post:"Post-deploy hook",finish:"Finishing",done:"Done"};function ru(n){return HT[n]??n}const th=["fetch","settings","pre","install","build","migrate","start","health","post","finish"];function BT(n){const i=n.status==="success"||n.step==="done",r=n.status==="failed"||n.status==="rolled_back",c=th.indexOf(n.step),d=i?th.length:c===-1?0:c;return th.map((f,m)=>i||m<d?{step:f,state:"done"}:m>d?{step:f,state:"pending"}:{step:f,state:r?"failed":"active"})}function $T(n){return n===!0?{tone:"ok",text:"The new release crashed at boot. The previous release was started again and is serving."}:n===!1?{tone:"bad",text:"The automatic rollback could not verify the previous release. The app may be down — check it on the server."}:{tone:"neutral",text:"No automatic rollback was attempted: this was the first release, or automatic rollback is switched off. The failed release was stopped."}}const qT={manual:"Dashboard",webhook:"GitHub Actions",hub:"Hub",rollback:"Rollback"};function zr(n){return n?n.slice(0,7):"—"}function GT(n){const i=n.finishedAt??Date.now(),r=Math.max(0,Math.round((i-n.startedAt)/1e3));return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}function YT(n){return n==="online"?"ok":n==="errored"?"bad":n==="stopped"||n==="stopping"?"warn":"neutral"}function VT(n){const i=(m,h)=>m===!1?!1:Array.isArray(m)?m.length===0?!1:m.length===1?m[0]:m:m&&m.trim()?m:h,r={};if(n.steps!==void 0)r.steps=n.steps.map(m=>({run:m.run,kind:m.kind,...m.enabled===!1?{enabled:!1}:{}}));else{r.install=i(n.install,"npm ci"),r.build=i(n.build,"npm run build");const m=i(n.migrate,"");m&&m!==""&&(r.migrate=m)}r.start=n.start?.trim()||"npm start",r.runtime=n.runtime??"node",r.port=n.port??3e3,r.health=n.healthPath?.trim()||"/";const c=Array.isArray(n.persist)?n.persist:n.persist?.trim()?[n.persist.trim()]:[];c.length>0&&(r.persist=c),n.execMode&&(r.execMode=n.execMode),n.instances!==void 0&&(r.instances=n.instances);const d=i(n.pre,""),f=i(n.post,"");return(d&&d!==""||f&&f!=="")&&(r.hooks={...d&&d!==""?{pre:d}:{},...f&&f!==""?{post:f}:{}}),`${JSON.stringify(r,null,2)}
518
- `}const XT=`${JSON.stringify({install:"pip install -r requirements.txt",build:!1,start:"python app.py",port:8e3,health:"/health"},null,2)}
519
- `,KT=[{name:"steps",meaning:"An ordered list of at most 5 steps, each { run, kind, enabled? }, where kind is install, build, migrate or custom. One field: it replaces the list below, and [] clears it. Disabled steps are skipped.",without:"the equivalent install/build/migrate list below"},{name:"runtime",meaning:'The runtime. "node" is the only one today; cluster mode is Node-only.',without:'"node"'},{name:"install",meaning:"Old format: a command, a list of commands, or false to skip. Read as an install step.",without:"npm ci (yarn and pnpm are detected from the lockfile)"},{name:"build",meaning:"Old format: run after install. Same forms. Read as a build step.",without:'the "build" script, if package.json has one'},{name:"migrate",meaning:"Old format: run after build, before the new release starts. Same forms. Forward-only: a rollback does not undo a migration.",without:"nothing is run"},{name:"start",meaning:"The long-running process. One command, any language.",without:'the "start" script, else node <main>'},{name:"execMode",meaning:'"fork" (one process) or "cluster" (one worker per instance). Cluster needs a start command of the form node <file>.',without:'"fork"'},{name:"instances",meaning:'How many copies to run: a whole number up to the CPU count, or "max".',without:"1"},{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:"persist",meaning:"Folders or single files your app writes to and you need to keep: uploads, SQLite data, logs. A folder is usually the right unit — SQLite creates -wal and -shm files next to its database; list a file only when that file is all there is.",without:"nothing is kept; each deployment starts from the repository"},{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 ZT({items:n,value:i,onChange:r,ariaLabel:c,className:d}){const f=p.useRef(new Map),m=g=>{const v=n[g];v&&(r(v.id),f.current.get(v.id)?.focus())},h=(g,v)=>{g.key==="ArrowRight"?(g.preventDefault(),m((v+1)%n.length)):g.key==="ArrowLeft"?(g.preventDefault(),m((v-1+n.length)%n.length)):g.key==="Home"?(g.preventDefault(),m(0)):g.key==="End"&&(g.preventDefault(),m(n.length-1))};return a.jsx("div",{role:"tablist","aria-label":c,className:oe("flex gap-1 overflow-x-auto border-b border-line",d),children:n.map((g,v)=>{const b=g.id===i;return a.jsxs("button",{ref:x=>{x?f.current.set(g.id,x):f.current.delete(g.id)},id:`tab-${g.id}`,role:"tab",type:"button","aria-selected":b,"aria-controls":`panel-${g.id}`,tabIndex:b?0:-1,onClick:()=>r(g.id),onKeyDown:x=>h(x,v),className:oe("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)]",b?"border-accent text-ink":"border-transparent text-muted hover:border-line-strong hover:text-ink"),children:[g.label,g.count!==void 0&&a.jsx("span",{className:oe("rounded-pill px-1.5 py-0.5 text-2xs",b?"bg-accent-soft text-accent-text":"bg-inset text-faint"),children:g.count})]},g.id)})})}function br({id:n,value:i,children:r}){return n!==i?null:a.jsx("div",{role:"tabpanel",id:`panel-${n}`,"aria-labelledby":`tab-${n}`,className:"page-enter",children:r})}const QT=/^(\*\.)?[a-z0-9-]+(\.[a-z0-9-]+)+$/,IT="A new wildcard certificate needs DNS validation, which linking does not do. Issue it from the SSL page, then link with an existing certificate.",PT=[{mode:"issue",label:"Issue a new Let's Encrypt certificate",hint:"Over HTTP-01, so the domain must already point here."},{mode:"existing",label:"Use an existing certificate",hint:"A certificate already stored on this server."},{mode:"none",label:"No SSL",hint:"The domain is served over HTTP only."}];function FT({open:n,app:i,meta:r,onClose:c,onLinked:d}){const f=Et(),{connected:m}=vn(),[h]=p.useState(()=>Jh()),g=Wh(h),[v,b]=p.useState(""),[x,j]=p.useState(!1),[S,R]=p.useState("issue"),[k,C]=p.useState(!0),[z,w]=p.useState(!1),[O,E]=p.useState(null),[M,Y]=p.useState(!1),[A,H]=p.useState(!1),[W,I]=p.useState(null),[ne,J]=p.useState(null),Z=v.trim().toLowerCase(),ee=Z.startsWith("*."),ue=QT.test(Z),K=O?.found===!0?O:null,B=S==="issue"?l0:S==="existing"?i0:BC,L=g.clear,te=g.byDomain[Z]??{},ke=m&&Object.keys(te).length>0?te:null,Ne=p.useMemo(()=>ne?XC(ne,B):null,[ne,B]),Ee=W!=null?Uc(W):null,T=Ee?.message??(W instanceof Error?W.message:null)??(W!=null?"Nothing was changed.":null),q=p.useMemo(()=>cl(W)??cl(ne),[W,ne]);p.useEffect(()=>{n&&(b(""),j(!1),R("issue"),C(!0),w(!1),E(null),H(!1),I(null),J(null),L())},[n,i.id,L]),p.useEffect(()=>{if(!n||S!=="existing"||!ue){E(null),Y(!1);return}const ie=new AbortController,Pe=setTimeout(()=>{Y(!0),fe.domains.sslSuggestion(Z,ie.signal).then(Ve=>{ie.signal.aborted||E(Ve)}).catch(()=>{ie.signal.aborted||E(null)}).finally(()=>{ie.signal.aborted||Y(!1)})},350);return()=>{clearTimeout(Pe),ie.abort()}},[n,S,Z,ue]);const V=K!==null&&(!ee||[K.certificate.domain,...K.certificate.names].some(ie=>ie.trim().toLowerCase()===Z)),re=ee&&S==="issue",ye=!i.settings.port&&!i.currentRelease,Re=ue&&!ye&&!A&&!re&&(S!=="existing"||V),xe=async()=>{if(!(!Re||A)){L(),H(!0),I(null),J(null);try{const ie=await fe.deployments.linkDomain(i.id,{domain:Z,www:ee?!1:x,ssl:S==="issue"?{mode:"issue"}:S==="existing"&&K?{mode:"existing",certName:K.certificate.domain}:{mode:"none"},redirect:S==="none"?void 0:k,behindCloudflare:z,opId:h});J(ie),d(),ie.ssl&&!ie.ssl.ok||(ie.nginxReloaded?f.success("Domain linked",`${ie.domain} now proxies to port ${ie.port}.`):f.warning("Linked, but nginx was not reloaded","Reload nginx for it to take effect."))}catch(ie){I(ie)}finally{H(!1)}}},me=S==="issue"&&A?"Issuing the certificate, this can take a minute":A?"Linking the domain":null;return a.jsx(yn,{open:n,onClose:c,preventClose:A,size:"md",title:i.domain?"Link a different domain":"Link a domain",description:`Point a domain at ${i.id}. nginx proxies it to the app’s port.`,footer:ne?a.jsx(se,{variant:"secondary",onClick:c,children:"Close"}):a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"secondary",onClick:c,disabled:A,children:"Cancel"}),a.jsx(se,{variant:"primary",onClick:()=>void xe(),loading:A,disabled:!Re,children:"Link domain"})]}),children:a.jsxs("div",{className:"space-y-5",children:[a.jsx(Me,{label:"Domain name",value:v,onChange:ie=>{b(ie.target.value),J(null),I(null),L()},placeholder:"app.example.com",list:"link-domain-options",hint:Z?r.domains.some(ie=>ie.name===Z)?"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:"font-mono",spellCheck:!1,autoComplete:"off",disabled:!!ne}),a.jsx("datalist",{id:"link-domain-options",children:r.domains.map(ie=>a.jsx("option",{value:ie.name},ie.name))}),a.jsx(pl,{label:"Also serve www",hint:ee?"A wildcard already covers the www name.":`Adds www.${Z||"example.com"}.`,checked:x,onChange:j,disabled:ee||!!ne}),a.jsxs("fieldset",{disabled:!!ne,children:[a.jsx("legend",{className:"mb-2 text-xs font-medium text-muted",children:"SSL"}),a.jsx("div",{className:"space-y-2",children:PT.map(ie=>{const Pe=!!ne||ie.mode==="issue"&&ee||ie.mode==="existing"&&!M&&!V;return a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-2.5 rounded-md border px-3 py-2.5 text-xs",S===ie.mode?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong",Pe&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"link-domain-ssl",value:ie.mode,checked:S===ie.mode,disabled:Pe,onChange:()=>R(ie.mode),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex items-center gap-1.5 font-medium text-ink",children:[ie.mode!=="none"?a.jsx(Rn,{className:"size-3.5 shrink-0","aria-hidden":"true"}):null,ie.label]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-faint",children:ie.mode==="existing"&&!Z?"Type the domain name above first.":ie.mode==="existing"&&M?"Looking for a certificate…":ie.mode==="existing"&&ue&&!V?ee?"No certificate on this server lists this wildcard name.":"No certificate on this server covers this name.":ie.hint})]})]},ie.mode)})}),ee&&S==="issue"?a.jsx("p",{className:"mt-2 text-2xs text-warn",children:IT}):null,S==="issue"&&!ee?a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"If issuance fails the domain still works over HTTP; you can issue the certificate later from the SSL page."}):null]}),S==="existing"&&K&&V?a.jsxs("div",{className:"rounded-md border border-accent/40 bg-accent-soft/30 p-3",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:ee?`The certificate in ${K.certificate.domain} lists ${Z}`:K.match==="exact"?`A certificate for ${Z} already exists`:K.match==="wildcard"?`A wildcard certificate covers ${Z}`:`The certificate in ${K.certificate.domain} covers ${Z}`}),a.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-muted",children:[a.jsx("span",{className:"font-mono",children:K.certificate.domain}),a.jsx("span",{children:K.certificate.daysLeft===null?"expiry unknown":K.certificate.daysLeft<=0?"expired":`${K.certificate.daysLeft} days left`})]}),K.certificate.names.length>1?a.jsxs("p",{className:"mt-1 break-all text-2xs text-faint",children:["covers ",K.certificate.names.join(", ")]}):null]}):null,S!=="none"&&!ne?a.jsx(Zt,{checked:k,onChange:C,label:"Redirect HTTP to HTTPS",description:"Port 80 requests are sent to the HTTPS address.",disabled:!!ne}):null,a.jsx(pl,{label:"Behind Cloudflare",hint:"Only when Cloudflare proxies this domain (the orange cloud). The server then reads the visitor’s address from CF-Connecting-IP.",checked:z,onChange:w,disabled:!!ne}),ye&&!ne?a.jsxs(ve,{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."]}):null,ke?a.jsx(ul,{stages:B,states:ke,ariaLabel:`Linking stages for ${Z}`,failure:Ee,timedOut:Ee?.stage==="timeout"}):me?a.jsxs("p",{className:"flex items-start gap-2 text-xs text-muted","aria-live":"polite",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("span",{children:[me,"."," ",m?"The live stage list appears when the server reports its stages; the result is shown here when it finishes.":"This finishes in one request; the result appears here."]})]}):null,!ke&&Ne?a.jsx(ul,{stages:B,states:Ne,ariaLabel:`Link result stages for ${Z}`}):null,q&&a.jsx(Rr,{preflight:q}),W&&!ke&&!Ne?a.jsx(ve,{tone:"danger",title:"The domain was not linked",children:T}):null,ne?ne.ssl&&!ne.ssl.ok?a.jsxs(ve,{tone:"warning",title:"Linked, without a certificate",children:[ne.domain," now proxies to port ",ne.port,", but the certificate was not issued: ",ne.ssl.detail," It works over HTTP until you issue the certificate from the SSL page."]}):a.jsxs(ve,{tone:"success",title:ne.created?"Domain created and linked":"Domain linked",children:[ne.domain," now proxies to port ",ne.port,".",ne.ssl?.ok?` ${ne.ssl.detail}`:" It is served over HTTP.",ne.nginxReloaded?"":" nginx was not reloaded yet; reload it for this to take effect."]}):null]})})}function Th(n,i){return n instanceof He||n instanceof Error?n.message:i}function JT({app:n,onClose:i,onDeleted:r}){const c=Et(),[d,f]=p.useState(!1),[m,h]=p.useState(!1),[g,v]=p.useState(!1);p.useEffect(()=>{n&&(f(!1),h(!1))},[n]);const b=!!(n&&(n.hasSharedData||(Array.isArray(n.settings.persist)?n.settings.persist.length>0:n.settings.persist))),x=async()=>{if(!(!n||g)){v(!0);try{const j=await fe.deployments.remove(n.id,{deleteDomain:d&&!!n.domain,purgeData:m}),S=j.sharedKept&&j.sharedPath?`Persistent data was kept in ${j.sharedPath}.`:"";j.warning?c.warning(`${n.id} deleted`,`${j.warning} ${S}`.trim()):c.success(`${n.id} deleted`,[j.domainDeleted?`${n.domain} was removed too.`:"",S].filter(Boolean).join(" ")||void 0),r()}catch(j){c.error(`Could not delete ${n.id}`,Th(j,"Nothing was changed."))}finally{v(!1)}}};return a.jsx(yn,{open:n!==null,onClose:i,preventClose:g,size:"sm",title:`Delete ${n?.id??""}?`,footer:a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"secondary",onClick:i,disabled:g,children:"Cancel"}),a.jsx(se,{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."}),n?.dir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:n.dir}),b&&n&&a.jsxs("div",{className:"space-y-2 rounded-md border border-line bg-inset/40 p-3",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Persistent data"}),a.jsx("p",{className:"text-xs",children:"Folders this app writes to are kept by default, so a later app with the same name can pick up its database and uploads."}),n.sharedDir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:n.sharedDir}),a.jsx(pl,{label:"Also delete the persistent data",hint:"The shared folders are deleted too and cannot be recovered.",checked:m,onChange:h})]}),n?.domain&&a.jsx(pl,{label:a.jsxs(a.Fragment,{children:["Also delete the domain ",a.jsx("span",{className:"font-mono text-ink",children:n.domain})]}),hint:"Its nginx config is removed and the site stops answering. Leave this off to keep the domain.",checked:d,onChange:f})]})})}function WT({app:n,meta:i,onChanged:r,onDelete:c}){const d=Et(),[f,m]=p.useState(!1),[h,g]=p.useState(""),[v,b]=p.useState(!1),x=n.settings.port??null,j=async()=>{try{await fe.deployments.unlinkDomain(n.id),d.success("Link removed",`${n.domain} is still configured; only the link is gone.`),r()}catch(R){d.error("Could not remove the link",Th(R,"Nothing was changed."))}},S=async()=>{if(!(!h.trim()||v)){b(!0);try{const R=await fe.deployments.move(n.id,h.trim());R.warning?d.warning("Moved",R.warning):d.success("App moved",`${R.to}${R.restarted?" — and started again.":""}`),g(""),r()}catch(R){d.error("Could not move the app",Th(R,"It is still where it was."))}finally{b(!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(Os,{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."})]})]}),n.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:n.domain}),a.jsxs("div",{className:"text-2xs text-faint",children:[x?`Proxies to port ${x}.`:"Proxies to the app’s port."," Edit it on the Domains page."]})]}),a.jsx(se,{size:"sm",icon:a.jsx(YS,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void j(),children:"Remove link"})]}):null,a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(se,{variant:"primary",onClick:()=>m(!0),children:n.domain?"Link a different domain":"Link a domain"}),a.jsx("p",{className:"min-w-0 flex-1 text-xs text-faint",children:"Choose the name, whether www is served too, and the certificate to use."})]}),!x&&!n.currentRelease&&a.jsxs(ve,{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.jsx(FT,{open:f,app:n,meta:i,onClose:()=>m(!1),onLinked:r}),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(CS,{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:n.dir??"—"})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(Me,{label:"Move to",value:h,onChange:R=>g(R.target.value),placeholder:i.deployDir??"/srv/ez_deploys","aria-describedby":"deploy-move-hint",className:"min-w-56 flex-1 font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(se,{onClick:()=>void S(),loading:v,disabled:!h.trim()||!!n.deploying,children:"Move app"})]}),a.jsx("p",{id:"deploy-move-hint",className:"mt-1.5 text-xs text-faint",children:h.trim()?`The app will be in ${h.trim().replace(/[\\/]+$/,"")}/${n.id}`:"A folder on this server. The app goes into a subfolder named after it."})]}),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(se,{variant:"danger",icon:a.jsx(Us,{className:"size-4","aria-hidden":"true"}),onClick:c,disabled:!!n.deploying,children:"Delete app"})]})]})}function e3(n,i){const r=URL.createObjectURL(new Blob([i],{type:"application/json"})),c=document.createElement("a");c.href=r,c.download=n,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(r)}function t3({app:n,locations:i}){const r=VT(n.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:n.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:r}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(qt,{value:r,label:"Copy ez.json",withText:!0}),a.jsx(se,{size:"sm",icon:a.jsx(gh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>e3("ez.json",r),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:"," ",i.map((c,d)=>a.jsxs("span",{children:[a.jsx("code",{className:"font-mono text-ink",children:c}),d<i.length-1?", ":"."]},c))]})]}),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:KT.map(c=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap px-3 py-2 align-top font-mono text-ink",children:c.name}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:c.meaning}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:c.without})]},c.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:XT})]}),a.jsxs(ve,{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 nh(n,i){return n instanceof He||n instanceof Error?n.message:i}function Eh({appId:n,repoUrl:i,publicKey:r,fingerprint:c,createdAt:d,onDisk:f=!1,initialError:m=null,onChanged:h}){const g=Et(),v=rn(),[b,x]=p.useState(r??null),[j,S]=p.useState(c??null),[R,k]=p.useState(d??null),[C,z]=p.useState(null),[w,O]=p.useState(m),[E,M]=p.useState(!1),[Y,A]=p.useState(!1),[H,W]=p.useState(!1),[I,ne]=p.useState(""),[J,Z]=p.useState(null),[ee,ue]=p.useState(!1),[K,B]=p.useState(null),L=h0(i),te=async()=>{if(!(E||!await v({title:"Replace the deploy key?",body:a.jsx(a.Fragment,{children:"The old key stops working here at once. GitHub keeps listing the old public key until you remove it — using “Add it to GitHub for me” afterwards removes the old key with the same title automatically."}),confirmLabel:"Replace the key",tone:"danger"}))){M(!0);try{const Ee=await fe.deployments.generateDeployKey(n);x(Ee.publicKey),S(Ee.fingerprint),k(Ee.createdAt),z(Ee.previousFingerprint??null),O(null),Z(null),B(null),g.success("Deploy key replaced","Add the new public key to the repository."),h?.()}catch(Ee){g.error("Could not replace the key",nh(Ee,"The old key is unchanged."))}finally{M(!1)}}},de=async()=>{if(Y)return;A(!0),Z(null);const Ne=I.trim();try{const Ee=await fe.deployments.addDeployKeyToGithub(n,Ne||void 0);Z(Ee),Ee.ok&&g.success("Key added to GitHub","It is read-only.")}catch(Ee){Z({ok:!1,error:nh(Ee,"GitHub did not accept the key."),steps:void 0})}finally{ne(""),A(!1)}},ke=async()=>{if(!ee){ue(!0),B(null);try{B(await fe.deployments.testDeployKey(n))}catch(Ne){B({ok:!1,status:0,error:nh(Ne,"The test could not run.")})}finally{ue(!1)}}};return a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ur,{className:"size-4 text-muted","aria-hidden":"true"}),a.jsx("span",{className:"text-sm font-medium text-ink",children:"Deploy key"})]}),a.jsx(se,{size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void te(),loading:E,children:b||w?"Regenerate key":"Generate key"})]}),w?a.jsxs(ve,{tone:"danger",title:"The key was not generated",children:[w," Press “Regenerate key” to try again; the app itself was created."]}):null,b?a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsxs("div",{className:"mb-1 flex flex-wrap items-center justify-between gap-2",children:[a.jsx("span",{className:"text-2xs font-medium uppercase tracking-[0.12em] text-faint",children:"Public key"}),a.jsx(qt,{value:b,label:"Copy public key",withText:!0})]}),a.jsx("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap break-all rounded border border-line bg-canvas p-2.5 font-mono text-2xs text-muted",children:b})]}),a.jsxs("p",{className:"break-all font-mono text-2xs text-faint",children:["Fingerprint ",j??"not reported",R?` · created ${new Date(R).toLocaleDateString()}`:""]}),C?a.jsxs("p",{className:"break-all text-2xs text-warn",children:["Replaced ",C,". The old key still needs removing on GitHub."]}):null,f?null:a.jsx("p",{className:"text-2xs text-warn",children:"The private half is not on the server's disk any more; regenerate the key before the next deployment."}),a.jsxs("ol",{className:"list-decimal space-y-1 pl-4 text-xs text-muted",children:[a.jsx("li",{children:"In the repository: Settings → Deploy keys → Add deploy key."}),a.jsx("li",{children:"Paste the key above. The title is up to you."}),a.jsx("li",{children:"Leave “Allow write access” off — deployments only read."})]}),L?a.jsxs("a",{href:L,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-accent-text underline-offset-2 hover:underline",children:[a.jsx(yS,{className:"size-3.5","aria-hidden":"true"}),"Open GitHub's Add deploy key page"]}):null,L?a.jsxs("div",{className:"space-y-2 border-t border-line pt-3",children:[H?a.jsxs("div",{className:"space-y-2",children:[a.jsx(Me,{label:"GitHub token",type:"password",value:I,onChange:Ne=>ne(Ne.target.value),hint:"Used once for this request and not stored. It needs Administration: read and write on this repository.",placeholder:"github_pat_…",autoComplete:"off",spellCheck:!1}),a.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[a.jsx(se,{size:"sm",variant:"secondary",onClick:()=>{ne(""),W(!1)},disabled:Y,children:"Cancel"}),a.jsx(se,{size:"sm",onClick:()=>void de(),loading:Y,children:"Add the key"})]})]}):a.jsx(se,{size:"sm",variant:"secondary",icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>W(!0),disabled:Y,children:"Add it to GitHub for me"}),J?a.jsxs("div",{className:"space-y-1.5",children:[(J.steps??[]).map(Ne=>a.jsxs("p",{className:`flex items-start gap-1.5 text-2xs ${Ne.ok?"text-ok":"text-bad"}`,children:[Ne.ok?a.jsx(dl,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}):a.jsx(Ms,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:Ne.detail})]},Ne.id)),J.error&&(J.steps??[]).length===0?a.jsx(ve,{tone:"danger",children:J.error}):null]}):null]}):a.jsx("p",{className:"text-2xs text-faint",children:"Automatic setup works with github.com repositories only; for another host, add the key there by hand."}),a.jsxs("div",{className:"space-y-2 border-t border-line pt-3",children:[a.jsx(se,{size:"sm",variant:"secondary",onClick:()=>void ke(),loading:ee,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Test connection"}),K?K.ok?a.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-ok",children:[a.jsx(dl,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:K.detail??"The key can read the repository."})]}):a.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-bad",children:[a.jsx(Ms,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:K.error??"The key could not read the repository."})]}):null]})]}):w?null:a.jsx("p",{className:"text-xs text-muted",children:"No key yet. Generate one and add its public half to the repository as a read-only deploy key. The private half stays on this server and is never shown."})]})}function $c(n,i){return n instanceof He||n instanceof Error?n.message:i}const n3={fetch:"Fetch",settings:"Settings",pre:"Pre",install:"Install",build:"Build",migrate:"Migrate",start:"Start",health:"Health",post:"Post",finish:"Finish"},a3={done:"border-ok/30 bg-ok-soft text-ok",active:"border-accent/40 bg-accent-soft text-accent-text",failed:"border-bad/30 bg-bad-soft text-bad",pending:"border-line bg-inset/50 text-faint"};function s3({run:n}){return a.jsx("ol",{className:"flex flex-wrap items-center gap-1","aria-label":"Deployment steps",children:BT(n).map(({step:i,state:r},c)=>a.jsxs("li",{className:"flex items-center gap-1",children:[c>0&&a.jsx("span",{className:"text-2xs text-faint","aria-hidden":"true",children:"›"}),a.jsx("span",{"aria-current":r==="active"?"step":void 0,className:oe("rounded border px-1.5 py-0.5 text-2xs font-medium",a3[r]),children:n3[i]??ru(i)})]},i))})}function l3({run:n}){const i=$T(n.rollbackSucceeded),r=i.tone==="ok"?"text-ok":i.tone==="bad"?"text-bad":"text-muted";return a.jsxs("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-faint",children:"Rollback report"}),a.jsxs("div",{className:"mt-2 space-y-1.5 text-xs text-muted",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-medium text-ink",children:"Reason: "}),n.reason??n.error??"The server did not report a reason."]}),a.jsx("p",{className:r,children:i.text})]}),n.logTail&&n.logTail.length>0&&a.jsxs("div",{className:"mt-2.5",children:[a.jsx("div",{className:"mb-1 text-2xs text-faint",children:"Last lines from the new release (environment values are redacted)"}),a.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded border border-line bg-canvas p-2.5 font-mono text-2xs leading-relaxed text-muted","aria-label":"Boot log of the failed release",children:n.logTail.join(`
520
- `)})]})]})}function i3({appId:n,run:i}){const r=Tt(g=>fe.deployments.run(n,i.id,g),[n,i.id]),c=(r.data?.status??i.status)==="running";hl(r.reload,1500,c);const d=p.useRef(null),f=p.useRef(!0),m=r.data?.log??"";p.useEffect(()=>{const g=d.current;g&&f.current&&(g.scrollTop=g.scrollHeight)},[m]);const h=r.data??i;return a.jsxs("div",{className:"space-y-2.5",children:[a.jsx(s3,{run:h}),h.error&&a.jsxs(ve,{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: ${ru(h.step).toLowerCase()}`,children:[h.error,h.status!=="failed"&&h.reason?a.jsx("span",{className:"mt-1 block",children:h.reason}):null]}),h.warnings?.map(g=>a.jsx(ve,{tone:"warning",children:g},g)),h.status==="failed"&&a.jsx(l3,{run:h}),r.error&&!r.data?a.jsx($t,{error:r.error,onRetry:r.reload,title:"Could not load the log"}):a.jsxs("pre",{ref:d,onScroll:g=>{const v=g.currentTarget;f.current=v.scrollHeight-v.scrollTop-v.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":c,children:[r.data?.logTruncated&&`… earlier output is not shown …
521
- `,m||(r.loading?"Loading…":"No output yet.")]})]})}function r3({app:n,initialRunId:i}){const[r,c]=p.useState(i);if(p.useEffect(()=>{n.activeRunId&&c(n.activeRunId)},[n.activeRunId]),n.runs.length===0)return a.jsx(ga,{icon:a.jsx(_S,{className:"size-5","aria-hidden":"true"}),title:"No deployments yet",description:"Press Deploy to build and start this app for the first time."});const d=n.runs.find(f=>f.id===r)??n.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:n.runs.map(f=>{const m=g0[f.status],h=f.id===d.id;return a.jsx("li",{children:a.jsxs("button",{type:"button",onClick:()=>c(f.id),"aria-current":h?"true":void 0,className:oe("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:m.tone,dot:!0,children:f.status==="running"?ru(f.step):m.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:zr(f.sha)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 text-2xs text-muted",children:[a.jsx("span",{children:qT[f.trigger]??f.trigger}),a.jsxs("span",{title:Ih(f.startedAt),children:[$r(f.startedAt)," · ",GT(f)]})]})]})},f.id)})}),a.jsx(i3,{appId:n.id,run:d},d.id)]})}function o3({app:n,onRollback:i,onDelete:r,deleting:c,busy:d}){return n.releases.length===0?a.jsx(ga,{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 ",n.keepReleases," are kept."]}),a.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:n.releases.map(f=>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:f.id}),f.current&&a.jsx(je,{tone:"ok",children:"Live"}),f.previous&&a.jsx(je,{tone:"neutral",children:"Previous"})]}),a.jsxs("div",{className:"mt-0.5 font-mono text-2xs text-faint",children:[zr(f.sha),f.ref?` · ${f.ref}`:"",f.execMode?` · ${f.execMode==="cluster"?`Cluster ×${f.instances??"?"}`:"Fork"}`:""]})]}),!f.current&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{size:"sm",icon:a.jsx(pk,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>i(f),disabled:d||!f.startable,title:f.startable?void 0:"This release never got as far as starting.",children:"Roll back to this"}),a.jsx(se,{variant:"dangerGhost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>r(f),loading:c===f.id,disabled:d||f.previous,title:f.previous?"An automatic rollback would return to this release. Delete it after the next deployment.":`Delete the files of release ${f.id}`,children:"Delete"})]})]},f.id))})]})}function Nc({n,title:i,children:r}){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:n}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:i}),r]})]})}function kv({name:n,value:i,note:r}){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:n}),a.jsx(qt,{value:n,label:`Copy the name ${n}`})]}),i?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:i}),a.jsx(qt,{value:i,label:`Copy the value of ${n}`,withText:!0})]}):r&&a.jsx("p",{className:"mt-1.5 text-2xs text-faint",children:r})]})}function c3({app:n,hook:i,onConfigureHook:r,onChanged:c}){const d=Et(),f=rn(),m=Tt(Z=>fe.deployments.github(n.id,Z),[n.id,i.enabled,i.domain,i.bind,i.port,n.branch]),[h,g]=p.useState(null),[v,b]=p.useState(!1),[x,j]=p.useState(null),[S,R]=p.useState(""),[k,C]=p.useState(!1),[z,w]=p.useState(null),O=async()=>{if(!v&&!(n.hook.hasToken&&!await f({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"}))){b(!0);try{const Z=await fe.deployments.issueHookToken(n.id);g(Z.token),c()}catch(Z){d.error("Could not create the token",$c(Z,"Try again."))}finally{b(!1)}}};if(m.error&&!m.data)return a.jsx($t,{error:m.error,onRetry:m.reload});if(!m.data)return a.jsx(tt,{className:"h-64 rounded-lg"});const E=m.data,M=n.hook.hasToken||h!==null,Y=E.targets??[{id:"hook",label:"This server’s deploy hook",url:E.hookUrl,secure:E.hookSecure,note:E.hookNote}],A=Z=>!!Z.url&&(Z.id!=="hub"||Z.ready!==!1),H=Y.find(Z=>Z.id===x)??Y.find(A)??Y[0],W=A(H),I=/github\.com[:/]/.test(n.repoUrl),ne=n.authType==="deployKey"?1:0,J=async()=>{if(!k&&!(n.hook.hasToken&&!await f({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"}))){C(!0),w(null);try{const Z=await fe.deployments.applyGithub(n.id,{target:H.id,...S.trim()?{token:S.trim()}:{}});w(Z),R(""),g(null),c(),Z.ok?d.success("GitHub is set up",`${Z.repo} deploys on every push to ${n.branch}.`):d.warning("Partly set up","Some steps need a token with more access. They are listed below.")}catch(Z){const ee=Z instanceof He?Z.payload:null;ee&&Array.isArray(ee.steps)&&w(ee),d.error("Could not set up GitHub",$c(Z,"Nothing was changed on GitHub."))}finally{C(!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:n.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."})]}),Y.length>1&&a.jsx(pa,{label:"How GitHub reaches this server",value:H.id,onChange:Z=>j(Z.target.value),hint:H.note,children:Y.map(Z=>a.jsxs("option",{value:Z.id,children:[Z.label,A(Z)?"":" — not available yet"]},Z.id))}),W?!H.secure&&a.jsx(ve,{tone:"warning",title:"The deploy token would be sent unencrypted",action:H.id==="hook"?a.jsx(se,{size:"sm",onClick:r,children:"Change"}):void 0,children:H.note}):a.jsx(ve,{tone:"warning",title:H.id==="hub"?"Not available through the Hub yet":"GitHub cannot reach this server yet",action:H.id==="hook"?a.jsx(se,{size:"sm",onClick:r,children:"Set up the deploy hook"}):void 0,children:H.note}),I&&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(Qk,{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",n.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"}),n.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(Me,{label:"GitHub token",optional:n.authType==="token"&&n.hasToken,type:"password",value:S,onChange:Z=>R(Z.target.value),placeholder:n.authType==="token"&&n.hasToken?"leave empty to try the app’s token":"github_pat_…",autoComplete:"off",spellCheck:!1,className:"min-w-56 flex-1"}),a.jsx(se,{variant:"primary",onClick:()=>void J(),loading:k,disabled:!W||!S.trim()&&!(n.authType==="token"&&n.hasToken),children:"Set up on GitHub"})]}),z&&a.jsxs("ul",{className:"space-y-1.5","aria-label":"Setup result",children:[z.error&&a.jsxs("li",{className:"flex items-start gap-2 text-xs text-bad",children:[a.jsx(Cr,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:z.error})]}),z.steps.map(Z=>a.jsxs("li",{className:oe("flex items-start gap-2 text-xs",Z.ok?"text-muted":"text-bad"),children:[Z.ok?a.jsx(ts,{className:"mt-0.5 size-3.5 shrink-0 text-ok","aria-hidden":"true"}):a.jsx(Cr,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:Z.detail})]},Z.id))]})]})]})}),a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-faint",children:I?"Or by hand":"Steps"}),a.jsxs("ol",{className:"space-y-5",children:[n.authType==="deployKey"?a.jsx(Nc,{n:1,title:"Let this server read the repository",children:a.jsx(Eh,{appId:n.id,repoUrl:n.repoUrl,publicKey:n.deployKey,fingerprint:n.deployKeyFingerprint??null,createdAt:n.deployKeyCreatedAt??null,onDisk:n.deployKeyOnDisk??!!n.deployKey,onChanged:()=>{m.reload(),c()}})}):null,a.jsxs(Nc,{n:ne+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(ve,{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(qt,{value:h,label:"Copy the deploy token",withText:!0})]})}):a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx(se,{size:"sm",icon:a.jsx(Ur,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void O(),loading:v,children:n.hook.hasToken?"Replace the token":"Create token"}),n.hook.hasToken&&a.jsxs("span",{className:"text-2xs text-faint",children:["One exists, ending in"," ",a.jsx("code",{className:"font-mono",children:n.hook.tokenHint}),n.hook.createdAt?`, created ${Ih(n.hook.createdAt)}`:"","."]})]})]}),a.jsxs(Nc,{n:ne+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(kv,{name:"EZ_DEPLOY_URL",value:W?H.url:null,note:"Available once GitHub can reach this server (see above)."}),a.jsx(kv,{name:"EZ_DEPLOY_TOKEN",value:h,note:M?"The token from the step above. If you no longer have it, replace it.":"Create the token in the step above first."})]})]}),a.jsxs(Nc,{n:ne+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:E.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(qt,{value:E.workflowPath,label:"Copy the file path",withText:!0}),a.jsx(qt,{value:E.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:E.workflow})]})]}),a.jsxs(ve,{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 u3({appId:n,hook:i,meta:r,initialTab:c="activity",onClose:d,onConfigureHook:f,onChanged:m,onDelete:h}){const g=Et(),v=rn(),b=n!==null,[x,j]=p.useState(c),[S,R]=p.useState(!1),[k,C]=p.useState(null),z=Tt(M=>fe.deployments.get(n??"",M),[n],{enabled:b}),w=z.data&&z.data.id===n?z.data:null;p.useEffect(()=>{b&&j(c)},[b,n,c]),hl(z.reload,2e3,b&&!!w?.deploying),hl(z.reload,8e3,b&&!!w&&!w?.deploying);const O=async M=>{if(!(!w||S||!await v({title:`Roll back ${w.id}?`,body:`Release ${M.id} (${zr(M.sha)}) will be started in place of the live one. The app restarts.`,confirmLabel:"Roll back",tone:"danger"}))){R(!0);try{await fe.deployments.rollback(w.id,M.id),g.info("Rollback started"),j("activity"),z.reload(),m()}catch(A){g.error("Could not roll back",$c(A,"Nothing was changed."))}finally{R(!1)}}},E=async M=>{if(!(!w||S||k||!await v({title:`Delete release ${M.id}?`,body:`Its files (${zr(M.sha)}) are removed from this server. The deployment log stays. The live release and the one an automatic rollback would return to cannot be deleted.`,confirmLabel:"Delete release",tone:"danger"}))){C(M.id);try{await fe.deployments.removeRelease(w.id,M.id),g.success("Release deleted"),z.reload(),m()}catch(A){g.error("Could not delete the release",$c(A,"Nothing was changed."))}finally{C(null)}}};return a.jsx(yn,{open:b,onClose:d,size:"xl",title:a.jsxs("span",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("span",{className:"font-mono",children:n}),w&&Bc(w)&&a.jsx(je,{tone:"neutral",children:Bc(w)}),w?.deploying&&a.jsx(je,{tone:"info",dot:!0,children:"Deploying"})]}),description:w?`${w.repoUrl} · ${w.branch}`:void 0,children:z.error&&!w?a.jsx($t,{error:z.error,onRetry:z.reload}):w?a.jsxs("div",{className:"space-y-4",children:[w.warnings?.map(M=>a.jsx(ve,{tone:"warning",children:M},M)),a.jsx(ZT,{ariaLabel:"App sections",value:x,onChange:j,items:[{id:"activity",label:"Deployments",count:w.runs.length},{id:"releases",label:"Releases",count:w.releases.length},{id:"setup",label:"Domain & folder"},{id:"github",label:"GitHub Actions"},{id:"ezjson",label:"ez.json"}]}),a.jsx(br,{id:"activity",value:x,children:a.jsx(r3,{app:w,initialRunId:w.activeRunId??null})}),a.jsx(br,{id:"releases",value:x,children:a.jsx(o3,{app:w,onRollback:M=>void O(M),onDelete:M=>void E(M),deleting:k,busy:S||!!w.deploying})}),a.jsx(br,{id:"setup",value:x,children:a.jsx(WT,{app:w,meta:r,onChanged:()=>{z.reload(),m()},onDelete:()=>h(w)})}),a.jsx(br,{id:"ezjson",value:x,children:a.jsx(t3,{app:w,locations:r.ezFileLocations})}),a.jsx(br,{id:"github",value:x,children:a.jsx(c3,{app:w,hook:i,onConfigureHook:f,onChanged:()=>{z.reload(),m()}})}),!i.enabled&&x!=="github"&&w.hook.hasToken&&a.jsx(ve,{tone:"warning",title:"The deploy hook is switched off",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx(as,{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(_s,{})," Loading…"]})})}const ou="custom";function d3(n){return[...n.steps.filter(r=>r.enabled!==!1).map(r=>r.run),n.start].join(" → ")}function Cv(n){return n?n===ou?"Custom":iu.find(i=>i.id===n)?.label??null:null}function zc(n){if(n===ou)return{start:"",steps:[]};const i=iu.find(r=>r.id===n);return i?{start:i.start,steps:OT(i)}:{start:"",steps:[]}}function Rh(n,i,r,c){return n.length!==r.length||i.trim()!==c.trim()?!1:n.every((d,f)=>d.run.trim()===r[f].run.trim()&&d.kind===r[f].kind&&d.enabled!==!1==(r[f].enabled!==!1))}function f3(n,i){for(const r of iu){const c=zc(r.id);if(Rh(n,i,c.steps,c.start))return r.id}return n.length===0?ou:null}function h3(n){return n.split(/[^A-Za-z0-9]+/).filter(Boolean).slice(0,2).map(i=>i[0].toUpperCase()).join("")}function m3({value:n,modifiedFrom:i,onSelect:r,onReset:c,disabled:d}){const f=p.useRef(new Map),m=[...iu.map(v=>({id:v.id,name:v.label,summary:d3(v)})),{id:ou,name:"Custom",summary:"Start from empty steps"}],h=n??m[0].id,g=v=>{if(d)return;const b=Math.max(0,m.findIndex(S=>S.id===n));let x=null;if(v.key==="ArrowDown"||v.key==="ArrowRight"?x=(b+1)%m.length:v.key==="ArrowUp"||v.key==="ArrowLeft"?x=(b-1+m.length)%m.length:v.key==="Home"?x=0:v.key==="End"&&(x=m.length-1),x===null)return;v.preventDefault();const j=m[x];r(j.id),f.current.get(j.id)?.focus()};return a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{role:"radiogroup","aria-label":"Preset",onKeyDown:g,className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:m.map(v=>{const b=v.id===n;return a.jsxs("button",{ref:x=>{x?f.current.set(v.id,x):f.current.delete(v.id)},type:"button",role:"radio","aria-checked":b,tabIndex:b||v.id===h?0:-1,disabled:d,onClick:()=>r(v.id),className:oe("relative flex items-start gap-2.5 rounded-lg border px-3 py-3 text-left transition-colors duration-[var(--ez-motion-fast)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50",b?"border-accent bg-accent-soft":"border-line bg-raised/40",!b&&!d&&"hover:border-line-strong hover:bg-raised",d&&"cursor-not-allowed opacity-60"),children:[a.jsx("span",{className:oe("mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-md border text-2xs font-semibold",b?"border-accent/40 bg-canvas text-accent-text":"border-line bg-canvas text-muted"),"aria-hidden":"true",children:h3(v.name)}),a.jsxs("span",{className:"min-w-0 flex-1 pr-4",children:[a.jsx("span",{className:"block truncate text-xs font-medium text-ink",children:v.name}),a.jsx("span",{className:"mt-0.5 block truncate text-2xs text-muted",title:v.summary,children:v.summary})]}),b&&a.jsx("span",{className:"absolute right-2 top-2 inline-flex size-4 items-center justify-center rounded-full bg-accent text-accent-ink",children:a.jsx(dl,{className:"size-2.5","aria-hidden":"true"})})]},v.id)})}),i&&a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-faint",children:[a.jsxs("span",{children:["Modified from ",i]}),a.jsx("button",{type:"button",onClick:c,disabled:d,className:"rounded-sm font-medium text-accent-text underline-offset-2 transition-colors hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:cursor-not-allowed disabled:text-faint disabled:opacity-60",children:"Reset to preset"})]}),a.jsx(ve,{tone:"info",children:"Check your project's real start and build commands before relying on a preset; not every project uses the defaults."})]})}const p3=[{id:"node",name:"Node.js",description:"JavaScript and TypeScript: Next.js, NestJS, Express, Fastify, Nuxt.",icon:Zw},{id:"python",name:"Python",description:"Django, FastAPI, Flask.",icon:Lk},{id:"go",name:"Go",description:"A compiled Go binary.",icon:gl},{id:"static",name:"Static site",description:"Files served as they are, with no process.",icon:AS}];function x3({value:n,onChange:i}){return a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:p3.map(r=>{const c=r.id==="node",d=r.id===n,f=r.icon;return a.jsxs("button",{type:"button","aria-pressed":d,disabled:!c,onClick:()=>c&&i(r.id),className:oe("flex items-start gap-3 rounded-lg border px-3 py-3 text-left transition-colors duration-[var(--ez-motion-fast)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50",d?"border-accent bg-accent-soft":"border-line bg-raised/40",c&&!d&&"hover:border-line-strong hover:bg-raised",!c&&"cursor-not-allowed opacity-60"),children:[a.jsx("span",{className:oe("mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-md border",d?"border-accent/40 bg-canvas text-accent-text":"border-line bg-canvas text-muted"),children:a.jsx(f,{className:"size-4","aria-hidden":"true"})}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-ink",children:r.name}),d&&a.jsx(je,{tone:"accent",children:"Selected"}),!c&&a.jsx(je,{tone:"neutral",children:"Coming soon"})]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-muted",children:r.description})]})]},r.id)})})}function g3(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return p.useMemo(()=>c=>{i.forEach(d=>d(c))},i)}const cu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ji(n){const i=Object.prototype.toString.call(n);return i==="[object Window]"||i==="[object global]"}function em(n){return"nodeType"in n}function bn(n){var i,r;return n?ji(n)?n:em(n)&&(i=(r=n.ownerDocument)==null?void 0:r.defaultView)!=null?i:window:window}function tm(n){const{Document:i}=bn(n);return n instanceof i}function Gr(n){return ji(n)?!1:n instanceof bn(n).HTMLElement}function y0(n){return n instanceof bn(n).SVGElement}function Ni(n){return n?ji(n)?n.document:em(n)?tm(n)?n:Gr(n)||y0(n)?n.ownerDocument:document:document:document}const ya=cu?p.useLayoutEffect:p.useEffect;function uu(n){const i=p.useRef(n);return ya(()=>{i.current=n}),p.useCallback(function(){for(var r=arguments.length,c=new Array(r),d=0;d<r;d++)c[d]=arguments[d];return i.current==null?void 0:i.current(...c)},[])}function y3(){const n=p.useRef(null),i=p.useCallback((c,d)=>{n.current=setInterval(c,d)},[]),r=p.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[i,r]}function Dr(n,i){i===void 0&&(i=[n]);const r=p.useRef(n);return ya(()=>{r.current!==n&&(r.current=n)},i),r}function Yr(n,i){const r=p.useRef();return p.useMemo(()=>{const c=n(r.current);return r.current=c,c},[...i])}function qc(n){const i=uu(n),r=p.useRef(null),c=p.useCallback(d=>{d!==r.current&&i?.(d,r.current),r.current=d},[]);return[r,c]}function Gc(n){const i=p.useRef();return p.useEffect(()=>{i.current=n},[n]),i.current}let ah={};function Vr(n,i){return p.useMemo(()=>{if(i)return i;const r=ah[n]==null?0:ah[n]+1;return ah[n]=r,n+"-"+r},[n,i])}function v0(n){return function(i){for(var r=arguments.length,c=new Array(r>1?r-1:0),d=1;d<r;d++)c[d-1]=arguments[d];return c.reduce((f,m)=>{const h=Object.entries(m);for(const[g,v]of h){const b=f[g];b!=null&&(f[g]=b+n*v)}return f},{...i})}}const mi=v0(1),Ar=v0(-1);function v3(n){return"clientX"in n&&"clientY"in n}function du(n){if(!n)return!1;const{KeyboardEvent:i}=bn(n.target);return i&&n instanceof i}function b3(n){if(!n)return!1;const{TouchEvent:i}=bn(n.target);return i&&n instanceof i}function Yc(n){if(b3(n)){if(n.touches&&n.touches.length){const{clientX:i,clientY:r}=n.touches[0];return{x:i,y:r}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:i,clientY:r}=n.changedTouches[0];return{x:i,y:r}}}return v3(n)?{x:n.clientX,y:n.clientY}:null}const Ls=Object.freeze({Translate:{toString(n){if(!n)return;const{x:i,y:r}=n;return"translate3d("+(i?Math.round(i):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:i,scaleY:r}=n;return"scaleX("+i+") scaleY("+r+")"}},Transform:{toString(n){if(n)return[Ls.Translate.toString(n),Ls.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:i,duration:r,easing:c}=n;return i+" "+r+"ms "+c}}}),Tv="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function j3(n){return n.matches(Tv)?n:n.querySelector(Tv)}const N3={display:"none"};function w3(n){let{id:i,value:r}=n;return yt.createElement("div",{id:i,style:N3},r)}function S3(n){let{id:i,announcement:r,ariaLiveType:c="assertive"}=n;const d={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return yt.createElement("div",{id:i,style:d,role:"status","aria-live":c,"aria-atomic":!0},r)}function k3(){const[n,i]=p.useState("");return{announce:p.useCallback(c=>{c!=null&&i(c)},[]),announcement:n}}const b0=p.createContext(null);function C3(n){const i=p.useContext(b0);p.useEffect(()=>{if(!i)throw new Error("useDndMonitor must be used within a children of <DndContext>");return i(n)},[n,i])}function T3(){const[n]=p.useState(()=>new Set),i=p.useCallback(c=>(n.add(c),()=>n.delete(c)),[n]);return[p.useCallback(c=>{let{type:d,event:f}=c;n.forEach(m=>{var h;return(h=m[d])==null?void 0:h.call(m,f)})},[n]),i]}const E3={draggable:`
513
+ }`,className:"font-mono"}),a.jsx(ml,{children:"Appended verbatim inside the server block. nginx tests the result before it is kept."})]})}),c&&a.jsx(ui,{id:"notifications",title:"Notifications",description:"Which channels hear about this domain.",icon:Vh,open:x.notifications??!1,onToggle:()=>j(J=>({...J,notifications:!J.notifications})),children:Z.loading&&!Z.data?a.jsxs("div",{className:"space-y-2",children:[a.jsx(tt,{className:"h-14 rounded-md"}),a.jsx(tt,{className:"h-14 rounded-md"}),a.jsx(tt,{className:"h-14 rounded-md"})]}):Z.error&&!Z.data?a.jsx(ve,{tone:"warning",title:"Could not load notification channels",action:a.jsx(ae,{variant:"ghost",size:"sm",onClick:Z.reload,children:"Retry"}),children:Z.error.message}):(Z.data??[]).length===0?a.jsx(kh,{channels:[],value:[],onChange:()=>{},label:"Channels",emptyHref:"/notifications",disabled:rt}):a.jsx(DC,{label:"Events",disabled:rt,items:Ch.map(J=>({...J,enabled:h.notifications[J.id].enabled})),onChange:(J,be)=>xe(J,{enabled:be}),onToggleAll:J=>{for(const be of Ch)xe(be.id,{enabled:J})},children:J=>{const be=h.notifications[J.id];return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-3 border-t border-line pt-3",children:a.jsx(kh,{channels:Z.data??[],value:be.channelIds,onChange:He=>xe(J.id,{channelIds:He}),label:`${J.label} channels`,emptyHref:"/notifications",compact:!0,disabled:rt})}),be.channelIds.length===0&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"No channels selected — the event is recorded but not delivered."})]})}})})]})]})}function $C(n){return/^https?:\/\//i.test(n.backendHost||"")?n.backendHost:`${n.upstreamType||"http"}://${n.backendHost||"127.0.0.1"}:${n.port}`}function qC({domain:n}){if(!n.ssl?.enabled)return a.jsx(je,{tone:"neutral",children:"HTTP only"});const i=n.daysLeft;return i==null?a.jsx(je,{tone:"neutral",children:"SSL"}):i<0?a.jsx(je,{tone:"bad",children:"SSL expired"}):i<30?a.jsx(je,{tone:"warn",children:vi(i)}):a.jsx(je,{tone:"ok",children:vi(i)})}function GC({entry:n}){return n?n.up===null?a.jsx(je,{tone:"neutral",dot:!0,children:"External"}):n.up?a.jsx(je,{tone:"ok",dot:!0,children:"Up"}):a.jsx(je,{tone:"bad",dot:!0,children:"Down"}):null}function YC(){ba("Domains");const n=Et(),i=rn(),{domainHealth:r}=yn(),c=Tt(L=>fe.domains.list(L)),[d,f]=tu(),[m,h]=p.useState(""),[g,y]=p.useState("all"),[b,x]=p.useState(null),[j,S]=p.useState(null),[R,k]=p.useState(!1),[C,D]=p.useState(!1);vl(c.reload),ji("domains",c.reload);const E=c.data,O=p.useMemo(()=>new Map((r??[]).map(L=>[L.name,L])),[r]),w=d.get("new")==="1",U=d.get("domain"),Y=U?(E??[]).find(L=>L.name===U):void 0,A=w?{mode:"create"}:Y?{mode:"edit",domain:Y}:null,M=p.useRef(null);p.useEffect(()=>{if(!E||!U){M.current=null;return}if(Y){M.current=null;return}M.current!==U&&(M.current=U,n.error("Domain not found",U),f({},{replace:!0}))},[E,U,Y,f,n]);const W=()=>f({new:"1"}),I=L=>f({domain:L}),ne=()=>f({},{replace:!0}),F=p.useMemo(()=>{const L=E??[];return{all:L.length,enabled:L.filter(ee=>ee.enabled).length,disabled:L.filter(ee=>!ee.enabled).length}},[E]),Z=p.useMemo(()=>{const L=m.trim().toLowerCase();return(E??[]).filter(ee=>g==="enabled"&&!ee.enabled||g==="disabled"&&ee.enabled?!1:L?[ee.name,ee.backendHost,String(ee.port)].join(" ").toLowerCase().includes(L):!0)},[E,g,m]),te=async L=>{const ee=!L.enabled;if(await i({title:`${ee?"Enable":"Disable"} "${L.name}"?`,body:ee?"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:ee?"Enable":"Disable",tone:ee?"accent":"danger"})){x({name:L.name,action:"toggle"});try{const ke=await fe.domains.toggle(L.name);c.setData(Ne=>Ne&&Ne.map(Ee=>Ee.name===L.name?{...Ee,enabled:ke.enabled}:Ee)),n.success(ke.enabled?"Domain enabled":"Domain disabled",ke.enabled?`${L.name} is being served again.`:`${L.name} is no longer served by nginx.`)}catch(ke){n.error(`Could not ${ee?"enable":"disable"} the domain`,ke instanceof Ue?ke.message:void 0)}finally{x(null)}}},ce=async L=>{x({name:L.name,action:"reload"});try{const ee=await fe.domains.reload(L.name);n.success("nginx reloaded",ee.message||`${L.name} is live with its current configuration.`)}catch(ee){n.error("Could not reload nginx",ee instanceof Ue?ee.message:void 0)}finally{x(null)}},K=L=>{k(!1),S(L)},H=async()=>{if(j){D(!0);try{const L=await fe.domains.remove(j.name,j.ssl.enabled&&R);n.success("Domain deleted",L.certDeleted?`${j.name}, its nginx config and its certificate files were removed.`:`${j.name} and its nginx config were removed. The certificate files were kept.`),S(null),c.reload()}catch(L){n.error("Could not delete the domain",L instanceof Ue?L.message:void 0)}finally{D(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",meta:E?a.jsxs("span",{className:"text-2xs text-faint",children:[F.all," total · ",F.enabled," enabled"]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:c.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:c.reload,children:"Refresh"}),a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,children:"Add domain"})]})}),c.error&&!E?a.jsx(qt,{error:c.error,onRetry:c.reload}):E?E.length===0?a.jsx(et,{children:a.jsx(ga,{icon:a.jsx(Os,{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(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,children:"Add your first domain"})})}):a.jsxs("div",{className:"space-y-3",children:[c.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. ",c.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:c.reload,children:"Try again"})]}),a.jsxs(et,{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($b,{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:m,onChange:L=>h(L.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",F.all],["enabled","Enabled",F.enabled],["disabled","Disabled",F.disabled]].map(([L,ee,de])=>a.jsxs("button",{type:"button","aria-pressed":g===L,onClick:()=>y(L),className:oe("inline-flex items-center gap-1.5 rounded-pill border px-2.5 py-1 text-xs transition-colors duration-[var(--ez-motion-fast)]",g===L?"border-accent/50 bg-accent-soft text-accent-text":"border-line text-muted hover:border-line-strong hover:text-ink"),children:[ee,a.jsx("span",{className:oe("rounded-pill px-1 text-2xs",g===L?"bg-accent/15":"bg-inset text-faint"),children:de})]},L))})]}),Z.length===0?a.jsx(ga,{title:"No domains match",description:"Try a different search or show all domains.",action:a.jsx(ae,{variant:"secondary",size:"sm",onClick:()=>{h(""),y("all")},children:"Clear filters"})}):a.jsx("ul",{className:"divide-y divide-line",children:Z.map(L=>{const ee=O.get(L.name),de=ee?.up===!1,ke=b?.name===L.name,Ne=ke?b?.action:null;return a.jsxs("li",{className:oe("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",!L.enabled&&"opacity-60"),children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[a.jsx(ln,{tone:L.enabled?de?"bad":"ok":"neutral",pulse:L.enabled&&!de,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:()=>I(L.name),className:"max-w-full truncate text-left font-mono text-sm font-semibold text-ink transition-colors hover:text-accent-text",children:L.name}),L.wildcard&&a.jsx(je,{tone:"accent",children:"wildcard"}),L.www&&a.jsx(je,{tone:"neutral",children:"www"}),!L.enabled&&a.jsx(je,{tone:"neutral",children:"disabled"}),L.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(as,{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:$C(L)}),L.ssl.enabled&&L.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(qC,{domain:L}),a.jsx(GC,{entry:ee})]}),a.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1 pl-7 sm:pl-0",children:[a.jsx(ct,{label:L.enabled?`Disable ${L.name}`:`Enable ${L.name}`,size:"sm",disabled:ke,onClick:()=>te(L),className:"text-muted hover:text-ink",children:Ne==="toggle"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):L.enabled?a.jsx(mk,{className:"size-3.5","aria-hidden":"true"}):a.jsx(xk,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Reload nginx for ${L.name}`,size:"sm",disabled:ke,onClick:()=>ce(L),className:"text-muted hover:text-ink",children:Ne==="reload"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Edit ${L.name}`,size:"sm",onClick:()=>I(L.name),className:"text-muted hover:text-accent-text",children:a.jsx(Kh,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Delete ${L.name}`,size:"sm",onClick:()=>K(L),className:"text-muted hover:text-bad",children:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"})})]})]},L.name)})})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-14 rounded-lg"}),a.jsx(tt,{className:"h-[320px] rounded-lg"})]}),A&&a.jsx(BC,{editor:A,onClose:ne,onSaved:()=>{ne(),c.reload()}},A.mode==="edit"?`edit:${A.domain.name}`:"create"),a.jsx(vn,{open:j!==null,onClose:()=>{C||S(null)},title:j?`Delete "${j.name}"?`:"Delete domain",description:"This also removes the domain's nginx config. It cannot be undone.",size:"sm",preventClose:C,footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:()=>S(null),disabled:C,children:"Cancel"}),a.jsx(ae,{variant:"danger",loading:C,onClick:H,children:"Delete domain"})]}),children:j&&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:j.name})," ","as soon as the config is removed."]}),j.ssl.enabled&&a.jsx("div",{className:"rounded-md border border-line bg-raised/40 p-3",children:a.jsx(pl,{checked:R,onChange:k,label:"Also delete the SSL certificate files",hint:`Otherwise ${j.name}'s certificate stays on disk and can be reused.`})})]})})]})}const Wa=Object.freeze([{id:"preflight",label:"Preflight checks"},{id:"account and order",label:"Account and order"},{id:"challenge ready",label:"Challenge ready"},{id:"waiting for validation",label:"Waiting for validation"},{id:"certificate received",label:"Certificate received"},{id:"files written",label:"Files written"},{id:"nginx config test",label:"nginx config test"},{id:"nginx reload",label:"nginx reload"},{id:"https verified",label:"HTTPS verified"}]),c0=Object.freeze([{id:"domain",label:"Domain linked"},...Wa.slice(0,6),{id:"https",label:"SSL settings"},...Wa.slice(6)]),u0=Object.freeze([{id:"domain",label:"Domain linked"},{id:"https",label:"SSL settings"},{id:"nginx config test",label:"nginx config test"},{id:"nginx reload",label:"nginx reload"},{id:"https verified",label:"HTTPS verified"}]),VC=u0;function uy(n){return c0.find(i=>i.id===n)?.label??Wa.find(i=>i.id===n)?.label??n}function dy(n){let i="";for(const r of n)i+=String.fromCharCode(r);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function em(){const n=globalThis.crypto;if(n?.randomUUID){const r=n.randomUUID().replace(/-/g,""),c=new Uint8Array(16);for(let d=0;d<16;d+=1)c[d]=Number.parseInt(r.slice(d*2,d*2+2),16);return dy(c)}const i=new Uint8Array(16);if(n?.getRandomValues)n.getRandomValues(i);else for(let r=0;r<i.length;r+=1)i[r]=Math.floor(Math.random()*256);return dy(i)}function XC(n,i,r=Date.now()){const c=n[i.stage];if(c?.status==="failed"&&i.status==="running")return n;const d={status:i.status,detail:i.detail??c?.detail,elapsedMs:i.elapsedMs,elapsedAt:r};return{...n,[i.stage]:d}}const KC=new Set([...Wa.map(n=>n.id),"domain","https"]);function jr(n){return typeof n=="string"&&(KC.has(n)||n==="timeout")}function mn(n){return typeof n=="string"&&n.trim()?n.trim():null}function Ds(...n){for(const i of n){const r=mn(i);if(r)return r}return null}function fy(n){if(!n||typeof n!="object")return null;const i=n,r=i.error;if(r&&typeof r=="object"){const c=r;return{stage:jr(mn(c.stage))?mn(c.stage):jr(mn(c.step))?mn(c.step):null,message:Ds(c.cause,c.consequence,i.detail,i.hint)??"No certificate was issued.",fix:Ds(c.fix,i.hint),consequence:mn(c.consequence)}}return typeof r=="string"?{stage:null,message:Ds(i.detail,r)??r,fix:Ds(i.hint),consequence:null}:typeof i.step=="string"||typeof i.cause=="string"||typeof i.stage=="string"?{stage:jr(mn(i.stage))?mn(i.stage):jr(mn(i.step))?mn(i.step):null,message:Ds(i.cause,i.consequence,i.detail)??"No certificate was issued.",fix:Ds(i.fix,i.hint),consequence:mn(i.consequence)}:null}function Bc(n){if(n==null)return null;if(n instanceof Ue){const i=n.payload,r=fy(i);return r||{stage:null,message:Ds(i.detail,i.hint,n.message)??n.message,fix:Ds(i.hint),consequence:null}}return typeof n=="string"?{stage:null,message:n,fix:null,consequence:null}:fy(n)}function cl(n){let i=null;if(n instanceof Ue?i=n.payload.preflight:Array.isArray(n)?i=n:n&&typeof n=="object"&&(i=n.preflight??n),!i)return null;const r=!Array.isArray(i)&&i&&typeof i=="object"?i:{},c=Array.isArray(i)?i:Array.isArray(r.results)?r.results:null;if(!c)return null;const d=[];for(const m of c){if(!m||typeof m!="object")continue;const h=m,g=mn(h.id),y=h.status;g&&(y!=="ok"&&y!=="warn"&&y!=="fail"&&y!=="skipped"||d.push({id:g,status:y,message:mn(h.message)??g,fix:mn(h.fix)??void 0}))}if(d.length===0)return null;const f=d.some(m=>m.status==="fail");return{ok:typeof r.ok=="boolean"?r.ok:!f,detail:mn(r.detail)??void 0,results:d,proxied:r.proxied===!0,reachesUs:r.reachesUs===!0}}function ZC(n){const i=n.split(":")[0];return i==="dns"?"DNS record":i==="a"?"IPv4 (A record)":i==="aaaa"?"IPv6 (AAAA record)":i==="http"?"HTTP self-check":"Check"}function QC(n){const i=n.split(":");return i.length<2?null:i[1]||null}function IC(n){const i=Math.max(0,Math.floor(n/1e3)),r=Math.floor(i/60),c=i%60;return r>0?`${r}m ${String(c).padStart(2,"0")}s`:`${c}s`}function PC(n,i){const r={},c=d=>({status:"skipped",detail:d});for(const d of i)d.id==="domain"?r[d.id]={status:"ok",detail:"nginx serves this name"}:d.id==="https"?n.ssl?n.ssl.ok?r[d.id]={status:"ok",detail:n.ssl.detail}:r[d.id]={status:"failed",detail:n.ssl.detail}:r[d.id]=c("No certificate was requested"):d.id==="nginx config test"?r[d.id]=n.nginxReloaded?{status:"ok",detail:"nginx accepted the config"}:c("nginx was not reloaded"):d.id==="nginx reload"?r[d.id]=n.nginxReloaded?{status:"ok",detail:"nginx reloaded"}:{status:"failed",detail:"nginx was not reloaded"}:d.id==="https verified"?r[d.id]=c(n.ssl?.ok?"The certificate was checked by the server":"No new certificate to verify"):r[d.id]=c("Not reported for a link that runs in one request");return r}function tm(n){const{client:i}=yn(),[r,c]=p.useState({}),[d,f]=p.useState(!1),[m,h]=p.useState(null);p.useEffect(()=>{if(!i||!n)return;const y=b=>{!b||b.opId!==n||typeof b.stage!="string"||!jr(b.stage)||b.stage==="timeout"||(f(!0),h(typeof b.elapsedMs=="number"?b.elapsedMs:null),c(x=>{const j=typeof b.domain=="string"?b.domain:"",S=x[j]??{};return{...x,[j]:XC(S,b)}}))};return i.on("ssl:progress",y),()=>i.off("ssl:progress",y)},[i,n]);const g=p.useCallback(y=>{c(b=>{if(y===void 0)return{};const x={...b};return delete x[y],x}),f(!1),h(null)},[]);return{byDomain:r,heard:d,lastElapsedMs:m,clear:g}}function FC(n,i){if(n instanceof Ue){const r=n.payload.error;if(r&&typeof r=="object")return{title:i,step:r.step,stage:r.stage,cause:r.cause,consequence:r.consequence,fix:r.fix??(typeof n.payload.hint=="string"?n.payload.hint:void 0),nginxRunning:r.nginxRunning};const c=n.code==="email_required"?"Set the ACME email in Settings → General, or provide an email with this request.":typeof n.payload.hint=="string"?n.payload.hint:void 0,d=typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.output=="string"?n.payload.output:n.message;return{title:i,summary:c,detail:d}}if(n&&typeof n=="object"){const r=n;return{title:r.step==="email configuration"?"ACME email is not configured":i,step:r.step,stage:r.stage,cause:r.cause,consequence:r.consequence,fix:r.fix,nginxRunning:r.nginxRunning}}return typeof n=="string"&&n?{title:i,detail:n}:{title:i,summary:"No certificate was issued."}}function d0(n){return n==null?"unknown":n<1e3?`${Math.round(n)} ms`:n<6e4?`${(n/1e3).toFixed(1)} s`:`${Math.round(n/6e4)} min`}function JC(n){return n?n==="proxy"?"The HTTP-01 challenge was answered through nginx, so nginx stayed running.":n==="standalone"?"The challenge ran in standalone mode.":n==="dns"?"Validated with a DNS TXT record.":`Validation mode: ${n}.`:null}function Dc({value:n,title:i="Certificate issuance failed"}){const r=FC(n,i),c=!!(r.step||r.cause||r.consequence);return a.jsxs(ve,{tone:"danger",title:r.title,children:[r.summary&&a.jsx("p",{children:r.summary}),c&&a.jsxs("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-2xs",children:[r.step&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Step"}),a.jsx("dd",{className:"text-muted",children:r.stage??r.step})]}),r.cause&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Cause"}),a.jsx("dd",{className:"text-muted",children:r.cause})]}),r.consequence&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Note"}),a.jsx("dd",{className:"text-muted",children:r.consequence})]})]}),r.nginxRunning===!1&&a.jsx("p",{className:"mt-2 text-2xs",children:"nginx is not running right now."}),r.fix&&a.jsxs("p",{className:"mt-2 break-words rounded border border-warn/25 bg-warn-soft px-2 py-1 text-2xs text-warn",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",r.fix]}),r.detail&&a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:r.detail})]})}function f0({result:n,title:i="Certificate issued"}){const r=JC(n.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(ts,{className:"size-4 shrink-0 text-ok","aria-hidden":"true"}),i]}),n.summary&&a.jsx("p",{className:"mt-1 text-xs text-muted",children:n.summary}),n.fellBack&&a.jsxs(ve,{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 ",d0(n.nginxDownMs),"."]}),n.staging&&a.jsx(ve,{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:n.certPath}),a.jsx(Ut,{value:n.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:n.keyPath}),a.jsx(Ut,{value:n.keyPath,label:"Copy private key path"})]})]}),r&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:r})]})}const WC={ok:"OK",warn:"Warning",fail:"Failed",skipped:"Skipped"};function eT({status:n}){return n==="ok"?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):n==="warn"?a.jsx(fl,{className:"size-4 text-warn","aria-hidden":"true"}):n==="fail"?a.jsx(Cr,{className:"size-4 text-bad","aria-hidden":"true"}):n==="skipped"?a.jsx(hS,{className:"size-4 text-faint","aria-hidden":"true"}):a.jsx(Ab,{className:"size-4 text-faint","aria-hidden":"true"})}function Rr({preflight:n,className:i}){if(!n||n.results.length===0)return null;const r=n.results.filter(m=>m.status==="fail").length,c=n.results.filter(m=>m.status==="warn").length,d=r>0?"bad":c>0?"warn":"ok",f=r>0?`${r} ${r===1?"check":"checks"} failed`:c>0?`${c} ${c===1?"warning":"warnings"}`:"All checks passed";return a.jsxs("section",{"aria-label":"Preflight checks",className:oe("rounded-md border border-line bg-raised/30 p-3",i),children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("h3",{className:"text-xs font-medium text-ink",children:"Preflight checks"}),a.jsx(je,{tone:d,children:f})]}),n.detail&&a.jsx("p",{className:"mt-1.5 break-words text-2xs text-muted",children:n.detail}),a.jsx("ul",{className:"mt-2 space-y-2",children:n.results.map((m,h)=>{const g=ZC(m.id),y=QC(m.id),b=m.status==="fail"||m.status==="warn";return a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("div",{className:"mt-0.5 shrink-0",children:a.jsx(eT,{status:m.status})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"text-2xs font-medium text-ink",children:g}),y&&a.jsx("span",{className:"break-all font-mono text-2xs text-faint",children:y}),a.jsx("span",{className:oe("text-2xs uppercase tracking-wide",m.status==="fail"?"text-bad":m.status==="warn"?"text-warn":m.status==="ok"?"text-ok":"text-faint"),children:WC[m.status]})]}),a.jsx("p",{className:"mt-0.5 break-words text-2xs text-muted",children:m.message}),b&&m.fix&&a.jsxs("p",{className:"mt-1 break-words rounded border border-warn/25 bg-warn-soft px-2 py-1 text-2xs text-warn",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",m.fix]})]})]},`${m.id}-${h}`)})})]})}const hy={running:"Running",ok:"Done",failed:"Failed",skipped:"Skipped",pending:"Waiting"};function tT({status:n}){return n==="running"?a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}):n==="ok"?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):n==="failed"?a.jsx(Cr,{className:"size-4 text-bad","aria-hidden":"true"}):n==="skipped"?a.jsx(Ab,{className:"size-4 text-faint","aria-hidden":"true"}):a.jsx(Ob,{className:"size-4 text-faint/60","aria-hidden":"true"})}function ul({stages:n,states:i,ariaLabel:r="Certificate operation stages",failure:c=null,timedOut:d=!1,className:f}){const m=n.some(R=>i[R.id]?.status==="running"),[h,g]=p.useState(()=>Date.now());p.useEffect(()=>{if(!m)return;const R=setInterval(()=>g(Date.now()),1e3);return()=>clearInterval(R)},[m]);const y=p.useMemo(()=>n.map(R=>{const k=i[R.id];return k?`${R.label}: ${hy[k.status]??k.status}`:null}).filter(Boolean).join(". "),[n,i]),b=c?.stage&&c.stage!=="timeout"?c.stage:n.find(R=>i[R.id]?.status==="failed")?.id??null,x=d||c?.stage==="timeout",j=c?.message??null,S=c?.fix??null;return a.jsxs("div",{className:oe("min-w-0",f),children:[a.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:y}),a.jsx("ol",{"aria-label":r,className:"space-y-1",children:n.map((R,k)=>{const C=i[R.id],D=C?.status??"pending",E=!C,O=D==="running",w=D==="failed"||b===R.id,U=C?.detail,Y=O&&C?.elapsedMs!=null?C.elapsedMs+(C.elapsedAt!=null?Math.max(0,h-C.elapsedAt):0):null;return a.jsxs("li",{"aria-busy":O||void 0,className:oe("flex items-start gap-2.5 rounded-md px-2.5 py-2 transition-colors duration-[var(--ez-motion-fast)]",w?"bg-bad-soft/50 ring-1 ring-bad/30":O?"bg-accent-soft/40":"bg-transparent"),children:[a.jsx("div",{className:"mt-0.5 shrink-0",children:a.jsx(tT,{status:w&&D!=="failed"?"failed":D})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"text-2xs font-mono text-faint","aria-hidden":"true",children:String(k+1).padStart(2,"0")}),a.jsx("span",{className:oe("text-xs font-medium",w?"text-bad":E?"text-muted":"text-ink"),children:R.label}),O&&Y!==null&&a.jsx("span",{className:"font-mono text-2xs font-medium text-accent-text","aria-hidden":"true",children:IC(Y)}),a.jsx("span",{className:oe("text-2xs uppercase tracking-wide",w?"text-bad":D==="ok"?"text-ok":D==="running"?"text-accent-text":"text-faint"),children:w&&D!=="failed"?"Failed":hy[D]})]}),U&&a.jsx("p",{className:"mt-0.5 break-words text-2xs text-muted",children:U}),D==="skipped"&&!U&&a.jsx("p",{className:"mt-0.5 text-2xs text-faint",children:"Skipped."})]})]},R.id)})}),x?a.jsxs(ve,{tone:"warning",title:"The five-minute limit was reached",className:"mt-3",children:[a.jsx("p",{className:"break-words",children:j??"The certificate operation ran past its five-minute limit and stopped."}),a.jsxs("p",{className:"mt-1.5 text-2xs text-faint",children:["It stopped at ",b?uy(b):"an unknown stage",". Nothing later in the list ran, and the certificate already on disk was not replaced. Check the preflight checks, then try again."]})]}):j?a.jsxs(ve,{tone:"danger",title:b?`Stopped at ${uy(b)}`:"The certificate operation failed",className:"mt-3",children:[a.jsx("p",{className:"break-words",children:j}),c?.consequence&&a.jsx("p",{className:"mt-1.5 break-words text-2xs text-faint",children:c.consequence})]}):null,S&&!x&&a.jsxs("div",{role:"note",className:"mt-2 flex items-start gap-2 rounded-md border border-warn/30 bg-warn-soft px-3 py-2 text-xs text-warn",children:[a.jsx(a5,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("p",{className:"break-words",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",S]})]}),x&&a.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(Yk,{className:"size-3.5 shrink-0","aria-hidden":"true"}),"The limit exists so a stuck ACME server cannot hold the dashboard open."]})]})}const my="ssl-known-domains";function nT(n){return"status"in n&&n.status==="waiting_dns"}function aT({error:n}){const i=Array.isArray(n.payload.found)?n.payload.found.filter(c=>typeof c=="string"):[],r=typeof n.payload.hint=="string"?n.payload.hint:n.message;return a.jsxs(ve,{tone:"warning",title:"The TXT record was not found yet",children:[a.jsx("p",{children:r}),i.length>0&&a.jsxs("p",{className:"mt-1.5 break-all",children:["Records currently visible:"," ",a.jsx("span",{className:"font-mono text-ink",children:i.join(" · ")})]})]})}function sT({domains:n,initialDomain:i="",onClose:r,onIssued:c}){const d=Et(),f=rn(),m=Jc(),{connected:h}=yn(),[g]=p.useState(()=>em()),y=tm(g),[b,x]=p.useState(i),[j,S]=p.useState(""),[R,k]=p.useState(!1),[C,D]=p.useState("http"),[E,O]=p.useState("form"),[w,U]=p.useState({}),[Y,A]=p.useState(null),[M,W]=p.useState(!1),[I,ne]=p.useState(null),[F,Z]=p.useState(!1),[te,ce]=p.useState(null),[K,H]=p.useState(null),[L,ee]=p.useState(""),de=b.trim().startsWith("*."),ke=L?y.byDomain[L]??{}:{},Ne=Bc(Y),Ee=cl(Y),T=K?cl(K.result):null,q=h&&y.heard&&L!=="",V=q?ke:{};p.useEffect(()=>{de&&(D("dns"),k(!1))},[de]);const re=b.trim()!==i||j.trim()!==""||R||C!=="http",ye=async()=>{const we={},nt=Wh(b.trim());nt&&(we.domain=nt);const rt=l0(j.trim());if(rt&&(we.email=rt),we.domain||we.email){U(we),queueMicrotask(()=>document.getElementById(we.domain?"ssl-domain":"ssl-email")?.focus());return}U({}),A(null),ce(null),W(!0);const xt=b.trim();ee(xt),y.clear();try{const bt=await fe.ssl.create({domain:xt,www:de?!1:R,validationMethod:de?"dns":C,email:j.trim()||void 0,opId:g});if(nT(bt)){ne(bt),O("dns");return}H({result:bt,domain:xt}),O("success"),c(bt,xt)}catch(bt){A(bt)}finally{W(!1)}},Re=async()=>{if(I){ce(null),Z(!0);try{const we=await fe.ssl.confirmDns(I.domain),nt=I.domain;ne(null),H({result:we,domain:nt}),O("success"),c(we,nt)}catch(we){we instanceof Ue&&(we.code==="dns_not_propagated"||we.code==="dns_lookup_failed")?ce(we):(ne(null),O("form"),A(we))}finally{Z(!1)}}},xe=async()=>{if(I){Z(!0);try{await fe.ssl.cancelDns(I.domain),d.info("DNS challenge cancelled","No certificate was issued.")}catch{d.warning("Could not cancel the DNS challenge","It will expire on its own after ten minutes.")}finally{ne(null),ce(null),ee(""),y.clear(),O("form"),Z(!1)}}},me=()=>{x(""),S(""),k(!1),D("http"),U({}),A(null),ce(null),H(null),ee(""),y.clear(),O("form")},ie=M||F,Pe=async()=>{if(!ie){if(E==="dns"&&I){if(!await f({title:"Cancel the pending DNS challenge?",body:`No certificate will be issued for ${I.domain}. The TXT record can be removed afterwards.`,confirmLabel:"Cancel challenge",cancelLabel:"Keep waiting",tone:"danger"}))return;fe.ssl.cancelDns(I.domain).catch(()=>{}),r();return}E==="form"&&re&&!await f({title:"Discard this certificate request?",body:"The form has not been submitted, so nothing has been issued.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"})||r()}},Ve=p.useRef(Pe);Ve.current=Pe;const Xe=p.useCallback(()=>{Ve.current()},[]),ue=Y instanceof Ue&&Y.code==="email_required",De=E==="success"?"Certificate issued":E==="dns"?"DNS validation":"New certificate";return a.jsxs(vn,{open:!0,onClose:Xe,title:De,description:E==="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:ie,footer:E==="form"?a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:Xe,disabled:ie,children:"Cancel"}),a.jsx(ae,{variant:"primary",loading:M,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),onClick:ye,children:"Issue certificate"})]}):E==="dns"?a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:xe,disabled:ie,children:"Cancel challenge"}),a.jsx(ae,{variant:"primary",loading:F,onClick:Re,children:"I’ve added the record"})]}):a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:me,children:"Issue another"}),a.jsx(ae,{variant:"primary",onClick:Xe,children:"Done"})]}),children:[E==="form"&&a.jsxs("div",{className:"space-y-4",children:[L&&(M||Y!=null)&&a.jsxs("div",{className:"space-y-2.5",children:[q?a.jsx(ul,{stages:Wa,states:V,ariaLabel:`Certificate stages for ${L}`,failure:Y!=null?Ne:null,timedOut:Ne?.stage==="timeout"}):M?a.jsxs("p",{role:"status",className:"flex items-start gap-2 rounded-md border border-line bg-raised/40 px-3 py-2.5 text-xs text-muted",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("span",{className:"break-words",children:["Issuing the certificate for"," ",a.jsx("span",{className:"font-mono text-ink",children:L}),". The live stage list needs the dashboard’s connection; the result appears here when it finishes."]})]}):null,Ee&&a.jsx(Rr,{preflight:Ee})]}),Y!=null&&a.jsxs("div",{className:"space-y-2",children:[!(q&&Ne)&&a.jsx(Dc,{value:Y}),ue&&a.jsx(ae,{variant:"secondary",size:"sm",onClick:()=>{r(),m("/settings")},children:"Open settings"})]}),a.jsx(Me,{id:"ssl-domain",label:"Domain name",placeholder:"example.com",value:b,onChange:we=>x(we.target.value),error:w.domain,hint:"An A or AAAA record for this name must point at this server for an HTTP challenge.",list:my,autoComplete:"off",spellCheck:!1,disabled:ie}),a.jsx("datalist",{id:my,children:n.map(we=>a.jsx("option",{value:we.name},we.name))}),a.jsx(Me,{id:"ssl-email",label:"ACME email",optional:!0,type:"email",placeholder:"admin@example.com",value:j,onChange:we=>S(we.target.value),error:w.email,hint:"Used by Let’s Encrypt for expiry notices. Falls back to the email saved in Settings.",autoComplete:"email",disabled:ie}),de&&a.jsxs(ve,{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:ie,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:oe("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",C==="http"&&!de?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",(de||ie)&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"http",checked:C==="http"&&!de,disabled:de||ie,onChange:()=>D("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:oe("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",C==="dns"?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",ie&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"dns",checked:C==="dns",disabled:ie,onChange:()=>D("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(pl,{checked:R&&!de,onChange:k,disabled:de||ie,label:b.trim()?`Also cover www.${b.trim().replace(/^\*\./,"")}`:"Also cover the www subdomain",hint:de?"A wildcard certificate already covers every subdomain.":"Both names are added to the same certificate."})]}),E==="dns"&&I&&a.jsxs("div",{className:"space-y-4",children:[q&&a.jsx(ul,{stages:Wa,states:V,ariaLabel:`Certificate stages for ${L||I.domain}`}),a.jsx(ve,{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:I.txtName}),a.jsx(Ut,{value:I.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:I.txtValue}),a.jsx(Ut,{value:I.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."}),te&&a.jsx(aT,{error:te})]}),E==="success"&&K&&a.jsxs("div",{className:"space-y-4",children:[q&&a.jsx(ul,{stages:Wa,states:V,ariaLabel:`Certificate stages for ${K.domain}`}),a.jsx(f0,{result:K.result,title:`Certificate issued for ${K.domain}`}),T&&a.jsx(Rr,{preflight:T}),a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(bi,{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(Hr,{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 lT={valid:{label:"Valid",tone:"ok"},expiring:{label:"Expiring",tone:"warn"},expired:{label:"Expired",tone:"bad"},not_issued:{label:"Not issued yet",tone:"neutral"},unreadable:{label:"Unreadable",tone:"bad"},error:{label:"Unreadable",tone:"bad"}};function py(n){return n==="unreadable"||n==="error"}function iT(n){return n===null?"text-faint":n<0?"text-bad":n<30?"text-warn":"text-ink"}function nh(n){const i=[];return n.summary&&i.push(n.summary),n.fellBack&&i.push(`nginx was stopped for ${d0(n.nginxDownMs)} while the challenge ran.`),n.staging&&i.push("This is a staging certificate that browsers will not trust."),i.join(" ")||"The certificate was renewed."}function rT(n){return n.error&&typeof n.error=="object"?n.error:typeof n.error=="string"?{step:n.error,cause:n.detail}:n.detail??"No certificate was issued."}function xy({children:n}){return a.jsxs("p",{role:"status",className:"flex items-start gap-2 rounded-md border border-line bg-raised/40 px-3 py-2.5 text-xs text-muted",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{className:"break-words",children:n})]})}function oT(){ba("SSL certificates");const n=Et(),i=rn(),r=Jc(),{connected:c}=yn(),d=Tt(T=>fe.ssl.list(T)),[f,m]=tu(),[h]=p.useState(()=>em()),g=tm(h),y=f.get("new")==="1"||!!f.get("domain"),b=f.get("domain")??"",x=Tt(T=>fe.domains.list(T),[],{enabled:y}),[j,S]=p.useState(null),[R,k]=p.useState(null),[C,D]=p.useState(null),[E,O]=p.useState(null),[w,U]=p.useState({}),[Y,A]=p.useState(null);vl(d.reload),ji(["ssl","domains"],d.reload);const M=d.data,W=p.useMemo(()=>{const T=M??[];return{total:T.length,valid:T.filter(q=>q.status==="valid").length,expiring:T.filter(q=>q.status==="expiring"||q.daysLeft!==null&&q.daysLeft>=0&&q.daysLeft<30).length,expired:T.filter(q=>q.status==="expired"||q.daysLeft!==null&&q.daysLeft<0).length,unreadable:T.filter(q=>py(q.status)).length,notIssued:T.filter(q=>q.status==="not_issued").length}},[M]),I=p.useMemo(()=>(M??[]).filter(T=>T.daysLeft!==null&&T.daysLeft<30),[M]),ne=W.expiring>0||W.expired>0||W.unreadable>0,F=()=>m({},{replace:!0}),Z=()=>m({new:"1"}),te=T=>m({domain:T}),ce=T=>g.byDomain[T]??{},K=T=>c&&Object.keys(g.byDomain[T]??{}).length>0,H=async T=>{if(!(j||R)){g.clear(T.domain),S(T.domain),D({domain:T.domain,done:!1});try{const q=await fe.ssl.renew(T.domain,h);D({domain:T.domain,done:!0,result:q}),n.success(`${T.domain} renewed`,nh(q)),d.reload()}catch(q){D({domain:T.domain,done:!0,error:q})}finally{S(null)}}},L=async T=>{if(!(j||R||!await i({title:`Delete the certificate for ${T.domain}?`,body:"Its files are removed from disk and this cannot be undone. The deletion is refused if any nginx configuration still references the certificate.",confirmLabel:"Delete certificate",tone:"danger"}))){k(T.domain);try{const V=await fe.ssl.remove(T.domain);n.success(`${T.domain} deleted`,`Removed ${V.directory}.`),d.reload()}catch(V){if(V instanceof Ue&&V.code==="cert_in_use")A({domain:T.domain,directory:typeof V.payload.directory=="string"?V.payload.directory:null,references:Array.isArray(V.payload.references)?V.payload.references:[]});else{const re=V instanceof Ue&&typeof V.payload.detail=="string"?V.payload.detail:V instanceof Error?V.message:void 0;n.error(`Could not delete ${T.domain}`,re)}}finally{k(null)}}},ee=async()=>{if(j||R||I.length===0||!await i({title:`Renew ${$n(I.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"}))return;const q=I.map(V=>V.domain);g.clear(),U({}),S("all"),O({domains:q,done:!1,results:null});try{const V=await fe.ssl.renewAll(h);O({domains:q,done:!0,results:V});const re=V.filter(ye=>!ye.success).length;V.length===0?n.info("Nothing to renew","No certificate expires within 30 days."):re===0?n.success(`${$n(V.length,"certificate")} renewed`,"The new certificates are already on disk."):n.warning("Some certificates were not renewed",`${V.length-re} renewed, ${re} failed.`),d.reload()}catch(V){O({domains:q,done:!0,results:null,error:V})}finally{S(null)}},de=C?.error?Bc(C.error):null,ke=C?.error?cl(C.error):C?.result?cl(C.result):null,Ne=C?.error instanceof Ue&&C.error.code==="email_required",Ee=E?Array.from(new Set([...E.domains,...(E.results??[]).map(T=>T.domain)])):[];return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"SSL certificates",description:"Let’s Encrypt certificates managed by this installation. Renewals keep nginx running where possible.",meta:M?a.jsxs("span",{className:"text-2xs text-faint",children:[$n(W.total,"certificate")," · ",W.valid," valid",W.notIssued>0?` · ${W.notIssued} not issued`:""]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:d.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:d.reload,children:"Refresh"}),a.jsxs(ae,{variant:"secondary",size:"sm",disabled:I.length===0||j!==null||R!==null,loading:j==="all",onClick:ee,children:["Renew expiring",I.length>0?` (${I.length})`:""]}),a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:Z,children:"New certificate"})]})}),ne&&a.jsxs(ve,{tone:W.expired>0||W.unreadable>0?"danger":"warning",title:"Certificates need attention",className:"mb-4",children:[[W.expired>0?`${W.expired} expired`:null,W.expiring>0?`${W.expiring} expiring within 30 days`:null,W.unreadable>0?`${W.unreadable} unreadable`:null].filter(Boolean).join(" · "),". Renewing uses the same domain; an unreadable certificate is replaced by a freshly issued one."]}),d.error&&!M?a.jsx(qt,{error:d.error,onRetry:d.reload}):M?M.length===0?a.jsx(et,{children:a.jsx(ga,{icon:a.jsx(Rn,{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(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:Z,children:"Issue a certificate"})})}):a.jsxs("div",{className:"space-y-3",children:[d.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. ",d.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:d.reload,children:"Try again"})]}),a.jsx(et,{className:"overflow-hidden",children:a.jsx("ul",{className:"divide-y divide-line",children:M.map(T=>{const q=lT[T.status]??{label:T.status,tone:"neutral"},V=j===T.domain,re=py(T.status),ye=T.status==="not_issued";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(ln,{tone:q.tone,pulse:T.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:T.domain}),a.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-muted",children:re?a.jsx("span",{children:"Certificate files are unreadable"}):ye?a.jsx("span",{children:"No certificate has been issued for this domain yet"}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:["Expires ",Ph(T.expiry)]}),a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{className:oe("font-mono font-medium",iT(T.daysLeft)),children:T.daysLeft!==null?T.daysLeft<0?`${Math.abs(T.daysLeft)}d overdue`:`${T.daysLeft}d`:vi(T.daysLeft)}),T.autoRenew&&T.autoRenew!=="off"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{title:T.autoRenew==="auto"?"The background service renews this certificate on its own.":T.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:T.autoRenew==="manual"?"text-warn":void 0,children:T.autoRenew==="auto"?`Auto-renews ${T.autoRenewDays??7}d before expiry`:T.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:q.tone,dot:!0,children:q.label})}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5 pl-7 sm:pl-0",children:[ye?a.jsx(ae,{variant:"secondary",size:"sm",disabled:j!==null||R!==null,onClick:()=>te(T.domain),children:"Issue"}):a.jsx(ae,{variant:"secondary",size:"sm",loading:V,disabled:j!==null||R!==null,onClick:()=>H(T),children:"Renew"}),re&&a.jsx(ae,{variant:"dangerGhost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),loading:R===T.domain,disabled:j!==null||R!==null,onClick:()=>L(T),children:"Delete"})]})]},T.domain)})})})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-14 rounded-lg"}),a.jsx(tt,{className:"h-[280px] rounded-lg"})]}),y&&a.jsx(sT,{domains:x.data??[],initialDomain:b,onClose:F,onIssued:()=>d.reload()},b||"new"),a.jsx(vn,{open:C!==null,onClose:()=>D(null),title:C?C.done&&C.error?`${C.domain} was not renewed`:C.done?`${C.domain} renewed`:`Renewing ${C.domain}`:"Renewing",description:C?.done&&C.error?"The certificate already on disk was not replaced.":void 0,size:"md",preventClose:!!(C&&!C.done),footer:a.jsxs(a.Fragment,{children:[Ne&&a.jsx(ae,{variant:"secondary",onClick:()=>{D(null),r("/settings")},children:"Open settings"}),a.jsx(ae,{variant:"primary",disabled:!!(C&&!C.done),onClick:()=>D(null),children:"Close"})]}),children:C&&a.jsxs("div",{className:"space-y-3",children:[K(C.domain)?a.jsx(ul,{stages:Wa,states:ce(C.domain),ariaLabel:`Renewal stages for ${C.domain}`,failure:de,timedOut:de?.stage==="timeout"}):C.done?null:a.jsxs(xy,{children:["Renewing ",a.jsx("span",{className:"font-mono text-ink",children:C.domain}),". The live stage list needs the dashboard’s connection; the result appears here when it finishes."]}),ke&&a.jsx(Rr,{preflight:ke}),C.done&&(C.error?!K(C.domain)&&a.jsx(Dc,{value:C.error,title:"The certificate could not be renewed"}):C.result&&a.jsx(f0,{result:C.result,title:"Certificate renewed"}))]})}),a.jsxs(vn,{open:E!==null,onClose:()=>O(null),title:E?.done?"Renewal results":"Renewing expiring certificates",description:E?E.results?`${E.results.filter(T=>T.success).length} of ${E.results.length} certificates renewed.`:`${$n(E.domains.length,"certificate")} queued, one at a time.`:void 0,size:"lg",preventClose:!!(E&&!E.done),footer:a.jsx(ae,{variant:"secondary",disabled:!!(E&&!E.done),onClick:()=>O(null),children:"Close"}),children:[E&&E.done&&E.results?.length===0?a.jsx(ga,{icon:a.jsx(Rn,{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:Ee.map(T=>{const q=E?.results?.find(Ve=>Ve.domain===T)??null,V=ce(T),re=K(T),ye=c&&Object.values(V).some(Ve=>Ve.status==="running"),Re=!!(E&&!E.done&&!q&&!ye),xe=q&&!q.success?Bc(q):null,me=q?cl(q):null,ie=!w[T],Pe=q?q.success?nh(q):xe?.message??"Not renewed":ye?"Renewing…":Re?"Waiting for its turn":"Not started";return a.jsx("li",{children:a.jsx(ou,{id:`renew-${T}`,className:"rounded-md border border-line bg-raised/30",headerClassName:"px-3.5 py-3",contentClassName:"px-3.5 pb-3",open:ie,onOpenChange:Ve=>U(Xe=>({...Xe,[T]:!Ve})),icon:a.jsx("span",{className:"shrink-0",children:q?q.success?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):a.jsx(Cr,{className:"size-4 text-bad","aria-hidden":"true"}):ye?a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}):a.jsx(ln,{tone:"neutral"})}),title:a.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"truncate font-mono text-sm font-medium text-ink",children:T}),q&&a.jsx(je,{tone:q.success?"ok":"bad",children:q.success?"Renewed":"Failed"})]}),description:Pe,children:a.jsxs("div",{className:"mt-2.5 border-t border-line pt-2.5",children:[re?a.jsx(ul,{stages:Wa,states:V,ariaLabel:`Renewal stages for ${T}`,failure:xe,timedOut:xe?.stage==="timeout"}):q?q.success?a.jsx("p",{className:"text-xs text-muted",children:nh(q)}):null:E&&!E.done?a.jsxs(xy,{children:["Renewing ",a.jsx("span",{className:"font-mono text-ink",children:T}),". The live stage list needs the dashboard’s connection."]}):null,me&&a.jsx(Rr,{preflight:me,className:"mt-2.5"}),q&&!q.success&&!re&&a.jsx("div",{className:"mt-2.5",children:a.jsx(Dc,{value:rT(q),title:`${q.domain} was not renewed`})}),q?.success&&q.configRegenerated&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"The nginx config was regenerated so it can answer the ACME challenge."})]})})},T)})}),E?.error!=null&&a.jsx("div",{className:"mt-3",children:a.jsx(Dc,{value:E.error,title:"The renewal run failed"})})]}),a.jsx(vn,{open:Y!==null,onClose:()=>A(null),title:Y?`${Y.domain} is still referenced`:"Certificate is still referenced",description:"Nothing was deleted. At least one nginx configuration file still points at this certificate.",size:"md",footer:a.jsx(ae,{variant:"secondary",onClick:()=>A(null),children:"Close"}),children:Y&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs text-muted",children:"Disable SSL on the domain that uses this certificate — or remove the matching lines — then try deleting it again."}),Y.directory&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:Y.directory}),Y.references.length>0&&a.jsx("ul",{className:"space-y-2",children:Y.references.map(T=>a.jsxs("li",{className:"rounded-md border border-line bg-raised/30 px-3 py-2",children:[a.jsxs("div",{className:"break-all font-mono text-2xs font-medium text-ink",children:[T.file,":",T.line]}),a.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:T.text})]},`${T.file}:${T.line}`))})]})})]})}function h0(n,i={}){const{client:r,connected:c}=yn(),d=i.enabled??!0,f=i.limit??500,[m,h]=p.useState([]),[g,y]=p.useState(!1),[b,x]=p.useState(0),j=p.useRef(g);j.current=g,p.useEffect(()=>{if(!r||!d)return;const C=D=>{if(D.logFile===n){if(j.current){x(E=>Math.min(E+1,999));return}h(E=>{const O=[...E,D.line];return O.length>f?O.slice(O.length-f):O})}};return r.on("logs:line",C),()=>r.off("logs:line",C)},[r,d,f,n]),p.useEffect(()=>{h([]),x(0)},[d,n]),p.useEffect(()=>{if(!(!r||!d||!c))return h([]),x(0),r.emit("logs:subscribe",{logFile:n}),()=>r.emit("logs:unsubscribe")},[r,c,d,n]);const S=p.useCallback(()=>{h([]),x(0)},[]),R=p.useCallback(()=>{h([]),x(0),!(!r||!d)&&(r.emit("logs:unsubscribe"),r.emit("logs:subscribe",{logFile:n}))},[r,d,n]),k=p.useCallback(C=>{y(C),C||x(0)},[]);return{lines:m,paused:g,missed:b,connected:c,clear:S,restart:R,setPaused:k}}const bc={start:"Start nginx",stop:"Stop nginx",restart:"Restart nginx",reload:"Reload nginx",test:"Test configuration"},cT={start:()=>fe.nginx.start(),stop:()=>fe.nginx.stop(),restart:()=>fe.nginx.restart(),reload:()=>fe.nginx.reload(),test:()=>fe.nginx.test()};function gy(n){return n instanceof Ue?typeof n.payload.output=="string"&&n.payload.output?n.payload.output:typeof n.payload.error=="string"&&n.payload.error?n.payload.error:n.message:n instanceof Error?n.message:"The action failed."}function uT(n){return/\[(error|crit|emerg|alert)\]/i.test(n)?"text-bad":/\[warn(ing)?\]/i.test(n)?"text-warn":"text-muted"}function dT(){ba("Nginx");const n=Et(),i=rn(),{nginxStatus:r,connectionError:c}=yn(),d=Tt(V=>fe.nginx.status(V)),f=Tt(V=>fe.nginx.configs(V)),[m,h]=p.useState(null),[g,y]=p.useState(null),[b,x]=p.useState(null),[j,S]=p.useState(null),[R,k]=p.useState(""),[C,D]=p.useState(""),[E,O]=p.useState(!1),[w,U]=p.useState(!1),[Y,A]=p.useState(null),[M,W]=p.useState(null),I=p.useRef(null),ne=p.useRef(null),F=h0("error",{limit:300}),Z=p.useRef(null),[te,ce]=p.useState(!0);p.useEffect(()=>{d.data&&h(d.data)},[d.data]),p.useEffect(()=>{r&&h(r)},[r]),p.useEffect(()=>{const V=Z.current;V&&te&&(V.scrollTop=V.scrollHeight)},[F.lines,te]);const K=j!==null&&R!==C;p.useEffect(()=>{if(!K)return;const V=re=>{re.preventDefault(),re.returnValue=""};return window.addEventListener("beforeunload",V),()=>window.removeEventListener("beforeunload",V)},[K]);const H=()=>{d.reload(),f.reload()};vl(H),ji("nginx",H);async function L(V){if(!(!V||V===j||E||w)&&!(K&&!await i({title:"Discard unsaved changes?",body:`${j} has edits that were not saved.`,confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}))){S(V),O(!0),A(null),W(null);try{const re=await fe.nginx.getConfig(V);k(re.content),D(re.content)}catch(re){A(re),k(""),D("")}finally{O(!1)}}}p.useEffect(()=>{j||!f.data?.length||L(f.data[0])},[f.data,j]);const ee=async V=>{if(!g&&!((V==="stop"||V==="restart")&&!await i({title:V==="stop"?"Stop nginx?":"Restart nginx?",body:V==="stop"?"Every site nginx serves goes offline until it is started again.":"Open connections are dropped for a moment while nginx restarts.",confirmLabel:V==="stop"?"Stop nginx":"Restart nginx",tone:"danger"}))){y(V),x(null);try{const re=await cT[V]();x({action:V,ok:re.success,output:re.output}),re.success?(n.success(`${bc[V]} succeeded`,V==="test"?"nginx -t accepted the configuration.":void 0),V!=="test"&&d.reload()):n.error(`${bc[V]} failed`,re.output||void 0)}catch(re){const ye=gy(re);x({action:V,ok:!1,output:ye}),n.error(`${bc[V]} failed`,ye)}finally{y(null)}}},de=async()=>{if(!(!j||w||E||!K)){U(!0),W(null);try{const V=await fe.nginx.saveConfig(j,R);D(R),W({ok:!0,output:V.output||"Saved and tested successfully."}),n.success("Configuration saved","nginx -t passed. Reload nginx to apply it.")}catch(V){W({ok:!1,output:gy(V)}),n.error("Configuration rejected","The previous file was restored.")}finally{U(!1)}}},ke=()=>{k(C),W(null)},Ne=p.useMemo(()=>{const V=R.split(`
514
+ `).length;return Array.from({length:Math.max(V,1)},(re,ye)=>ye+1)},[R]),Ee=!!m?.running,T=!m&&(d.loading||!!d.error),q=F.lines.join(`
515
+ `);return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Nginx",description:"Service controls, configuration files and the error log, without leaving the dashboard.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:d.loading||f.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>{H(),F.restart()},children:"Refresh"})}),d.error&&!m?a.jsx(qt,{error:d.error,onRetry:d.reload}):T?a.jsxs(ns,{children:[a.jsx(tt,{className:"h-24 rounded-lg"}),a.jsx(tt,{className:"h-[380px] rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[d.error&&m&&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. ",d.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:d.reload,children:"Try again"})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",Ee?"bg-ok/60":"bg-bad/60"),"aria-hidden":"true"}),a.jsxs(xn,{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(gl,{className:"size-5 text-ink","aria-hidden":"true"}),a.jsx(ln,{tone:Ee?"ok":"bad",pulse:Ee,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:Ee?"nginx is running":"nginx is stopped"}),m?.pid!==null&&m?.pid!==void 0&&Ee&&a.jsxs(je,{tone:"neutral",children:["pid ",m.pid]})]}),a.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted",children:m?.version??"Version unavailable"}),m?.error&&a.jsx("p",{className:"mt-1 text-xs text-bad",children:m.error})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ee?a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:g==="reload",disabled:g!==null&&g!=="reload",onClick:()=>ee("reload"),children:"Reload"}),a.jsx(ae,{variant:"secondary",size:"sm",loading:g==="restart",disabled:g!==null&&g!=="restart",onClick:()=>ee("restart"),children:"Restart"}),a.jsx(ae,{variant:"danger",size:"sm",loading:g==="stop",disabled:g!==null&&g!=="stop",onClick:()=>ee("stop"),children:"Stop"})]}):a.jsx(ae,{variant:"primary",size:"sm",loading:g==="start",disabled:g!==null&&g!=="start",onClick:()=>ee("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(ae,{variant:"secondary",size:"sm",loading:g==="test",disabled:g!==null&&g!=="test",onClick:()=>ee("test"),children:"Test config"})]})]}),b&&a.jsx("div",{className:"border-t border-line px-4 py-3 sm:px-5",children:a.jsx(ve,{tone:b.ok?"success":"danger",title:`${bc[b.action]} ${b.ok?"succeeded":"failed"}`,children:b.output&&a.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:b.output})})})]}),a.jsxs(et,{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"}),K&&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(pa,{"aria-label":"Configuration file",value:j??"",disabled:w||E||!f.data?.length,onChange:V=>void L(V.target.value),className:"w-full sm:w-60",children:[a.jsx("option",{value:"",disabled:!0,children:"Select a config file…"}),(f.data??[]).map(V=>a.jsx("option",{value:V,children:V},V))]}),a.jsx(ae,{variant:"ghost",size:"sm",disabled:!K||w,icon:a.jsx(Zk,{className:"size-3.5","aria-hidden":"true"}),onClick:ke,children:"Revert"}),a.jsx(ae,{variant:"primary",size:"sm",disabled:!j||!K,loading:w,icon:a.jsx(yh,{className:"size-3.5","aria-hidden":"true"}),onClick:de,children:"Save"})]})]}),f.error&&!f.data?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx(qt,{error:f.error,onRetry:f.reload})}):f.data?f.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."}):E?a.jsxs("div",{className:"flex h-[360px] items-center justify-center gap-2 text-sm text-muted",children:[a.jsx(Ct,{className:"spin size-4","aria-hidden":"true"}),"Loading configuration…"]}):Y?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx(qt,{error:Y,title:"Could not load this configuration",onRetry:()=>j?void L(j):void 0})}):j?a.jsxs("div",{className:"relative flex h-[min(56vh,520px)] min-h-[280px] overflow-hidden bg-canvas",children:[a.jsx("div",{ref:ne,"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:Ne.map(V=>a.jsx("div",{children:V},V))}),a.jsx("textarea",{ref:I,value:R,onChange:V=>k(V.target.value),onScroll:()=>{ne.current&&I.current&&(ne.current.scrollTop=I.current.scrollTop)},onKeyDown:V=>{(V.metaKey||V.ctrlKey)&&V.key.toLowerCase()==="s"&&(V.preventDefault(),de())},wrap:"off",spellCheck:!1,"aria-label":j?`${j} 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(tt,{className:"h-5 w-48"}),a.jsx(tt,{className:"h-[300px]"})]}),M&&a.jsxs("div",{className:oe("border-t px-4 py-3 sm:px-5",M.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:oe("text-xs font-medium",M.ok?"text-ok":"text-bad"),children:M.ok?"Saved — nginx test passed":"Save rejected — the previous file was restored"}),M.ok&&a.jsx(ae,{variant:"secondary",size:"sm",loading:g==="reload",disabled:g!==null&&g!=="reload",onClick:()=>ee("reload"),children:"Reload nginx"})]}),M.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:M.output})]})]}),a.jsxs(et,{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(ln,{tone:F.paused?"warn":F.connected?"ok":"neutral",pulse:!F.paused&&F.connected}),F.paused?"Paused":F.connected?"Live":"Connecting…"]}),F.paused&&F.missed>0&&a.jsxs(je,{tone:"warn",children:[F.missed," new"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[q&&a.jsx(Ut,{value:q,label:"Copy lines",withText:!0}),a.jsx(ct,{label:F.paused?"Resume the log stream":"Pause the log stream",size:"sm",onClick:()=>F.setPaused(!F.paused),children:F.paused?a.jsx(Br,{className:"size-3.5","aria-hidden":"true"}):a.jsx(Bb,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:"Clear the log view",size:"sm",onClick:F.clear,disabled:F.lines.length===0,children:a.jsx(Ct,{className:"size-3.5 rotate-45","aria-hidden":"true"})})]})]}),a.jsx("div",{ref:Z,"aria-label":"Recent nginx error log",onScroll:V=>{const re=V.currentTarget;ce(re.scrollHeight-re.scrollTop-re.clientHeight<40)},className:"h-64 overflow-y-auto bg-canvas px-4 py-3 font-mono text-2xs leading-relaxed sm:px-5",children:!F.connected&&F.lines.length===0?a.jsx("p",{className:"text-faint",children:"Waiting for the live stream…"}):F.lines.length===0?a.jsx("p",{className:"text-faint",children:"No errors logged."}):F.lines.map((V,re)=>a.jsx("div",{className:oe("whitespace-pre-wrap break-all py-0.5",uT(V)),children:V},re))}),c&&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:F.restart,children:"Try again"})]})]})]})]})}const fT=[{value:"discord",label:"Discord",description:"Post alerts to a channel through a webhook URL.",icon:nu},{value:"telegram",label:"Telegram",description:"Send alerts through a bot to a chat or group.",icon:qb}];function hT(n){return{name:n?.name??"",type:n?.type??"discord",webhookUrl:n?.webhookUrl??"",botToken:n?.botToken??"",chatId:n?.chatId??"",message:n?.message??""}}function mT(n){if(n instanceof Ue){const i=typeof n.payload.detail=="string"?n.payload.detail:null;return i||n.message}return n instanceof Error?n.message:"The channel could not be saved."}function pT({channel:n,onClose:i,onSaved:r}){const c=rn(),d=n!==null,f=p.useRef(hT(n)),[m,h]=p.useState(f.current),[g,y]=p.useState({}),[b,x]=p.useState(null),[j,S]=p.useState(!1),R=Object.keys(m).some(E=>m[E]!==f.current[E]),k=(E,O)=>{h(w=>({...w,[E]:O})),y(w=>({...w,[E]:void 0})),x(null)},C=()=>{if(!j){if(!R){i();return}c({title:d?"Discard channel changes?":"Discard this channel?",body:"Nothing has been sent to the server yet.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}).then(E=>{E&&i()})}},D=async()=>{if(j)return;const E={};if(m.name.trim()||(E.name="Give the channel a name."),m.type==="discord"){const w=m.webhookUrl.trim();w?/^https:\/\/\S+$/i.test(w)||(E.webhookUrl="Enter an https:// URL without spaces."):E.webhookUrl="A Discord webhook URL is required."}else m.botToken.trim()||(E.botToken="The bot token is required."),m.chatId.trim()||(E.chatId="The chat ID is required.");if(y(E),Object.keys(E).length>0)return;const O={name:m.name.trim(),type:m.type,...m.type==="discord"?{webhookUrl:m.webhookUrl.trim(),message:m.message.trim()}:{botToken:m.botToken.trim(),chatId:m.chatId.trim()}};S(!0),x(null);try{const w=n?await fe.settings.channels.update(n.id,O):await fe.settings.channels.create(O);r(w,!d)}catch(w){x(mT(w))}finally{S(!1)}};return a.jsx(vn,{open:!0,onClose:C,title:d?`Edit ${n.name}`:"New notification channel",description:d?"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:j,footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:C,disabled:j,children:"Cancel"}),a.jsx(ae,{variant:"primary",type:"submit",form:"channel-form",loading:j,children:d?"Save channel":"Create channel"})]}),children:a.jsxs("form",{id:"channel-form",onSubmit:E=>{E.preventDefault(),D()},className:"space-y-4",children:[b&&a.jsx(ve,{tone:"danger",title:"Could not save the channel",children:b}),a.jsx(Me,{label:"Name",value:m.name,onChange:E=>k("name",E.target.value),placeholder:"Production Discord",error:g.name,autoFocus:!0}),a.jsxs("fieldset",{disabled:d||j,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:fT.map(E=>{const O=m.type===E.value;return a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-2.5 rounded-md border p-3 transition-colors duration-[var(--ez-motion-fast)]",O?"border-accent bg-accent-soft":"border-line bg-canvas hover:border-line-strong",(d||j)&&"cursor-not-allowed opacity-70"),children:[a.jsx("input",{type:"radio",name:"channel-type",value:E.value,checked:O,onChange:()=>k("type",E.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(E.icon,{className:"size-3.5 text-muted","aria-hidden":"true"}),E.label]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-faint",children:E.description})]})]},E.value)})}),d&&a.jsx(ml,{children:"The channel type cannot be changed after it is created."})]}),m.type==="discord"?a.jsxs(a.Fragment,{children:[a.jsx(Me,{label:"Webhook URL",value:m.webhookUrl,onChange:E=>k("webhookUrl",E.target.value),placeholder:"https://discord.com/api/webhooks/…",error:g.webhookUrl,hint:"Create one in Discord under Channel settings → Integrations → Webhooks.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsxs("div",{children:[a.jsx(Me,{label:"Message prefix",optional:!0,value:m.message,onChange:E=>k("message",E.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(Me,{label:"Bot token",value:m.botToken,onChange:E=>k("botToken",E.target.value),placeholder:"123456:ABC…",error:g.botToken,hint:"From @BotFather.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(Me,{label:"Chat ID",value:m.chatId,onChange:E=>k("chatId",E.target.value),placeholder:"-1001234567890",error:g.chatId,hint:"Groups start with a minus sign.",className:"font-mono",spellCheck:!1,autoComplete:"off"})]})]})})}const xT={nginx_down:"nginx",cert_expiry:"Certificate",domain_health:"Health check",test:"Test message"};function gT(n){return n.type==="nginx_down"?gl:n.type==="cert_expiry"?as:n.type==="domain_health"?Lc:Qh}function vT(n){return n==="danger"?"text-bad":n==="warning"?"text-warn":n==="success"?"text-ok":n==="info"?"text-info":"text-muted"}function vy(n,i){return n instanceof Ue?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function yT(n){if(!n)return"Webhook URL not set";try{const i=new URL(n),r=i.pathname.split("/").filter(Boolean).pop()??"";return`${i.host}/…${r.slice(-4)}`}catch{return"Webhook URL configured"}}function bT(n){return n.type==="discord"?yT(n.webhookUrl):`Chat ${n.chatId??"—"} · bot token saved`}function jT(){ba("Notifications");const n=Et(),i=rn(),{notifications:r,clearNotifications:c,connected:d,connectionError:f}=yn(),m=Tt(w=>fe.settings.channels.list(w)),h=Tt(w=>fe.domains.list(w)),[g,y]=p.useState(null),[b,x]=p.useState(null),[j,S]=p.useState(null),[,R]=p.useState(0);p.useEffect(()=>{const w=setInterval(()=>R(U=>U+1),3e4);return()=>clearInterval(w)},[]);const k=()=>{m.reload(),h.reload()};vl(k),ji(["settings","domains"],k);const C=p.useMemo(()=>{const w=new Map;for(const U of h.data??[]){if(!U.enabled)continue;const Y=new Map;for(const A of Object.values(U.notifications))if(A.enabled)for(const M of A.channelIds)Y.set(M,(Y.get(M)??0)+1);for(const[A,M]of Y){const W=w.get(A)??{domains:0,rules:0};W.domains+=1,W.rules+=M,w.set(A,W)}}return w},[h.data]),D=async w=>{if(!b){x(w.id);try{await fe.settings.channels.test(w.id),n.success(`Test sent to ${w.name}`,"Check the channel to confirm the message arrived.")}catch(U){n.error(`Test failed for ${w.name}`,vy(U,"The test message could not be delivered."))}finally{x(null)}}},E=async w=>{if(!(j||!await i({title:`Delete ${w.name}?`,body:"Domains routed to this channel stop delivering alerts there. The domains themselves are not changed.",confirmLabel:"Delete channel",tone:"danger"}))){S(w.id);try{await fe.settings.channels.remove(w.id),n.success("Channel deleted",`${w.name} will no longer receive alerts.`),m.reload()}catch(Y){n.error("Could not delete the channel",vy(Y,"The channel is still configured."))}finally{S(null)}}},O=m.data;return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Notifications",description:"Delivery channels for alerts, and the events received in this session.",actions:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:m.loading||h.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:k,children:"Refresh"}),a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>y({channel:null}),children:"New channel"})]})}),m.error&&!O?a.jsx(qt,{error:m.error,onRetry:m.reload}):O?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(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:"Channels",description:"Named Discord and Telegram destinations. Domains choose which channels receive their events.",actions:O.length>0?a.jsx(je,{tone:"neutral",children:$n(O.length,"channel")}):void 0}),m.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. ",m.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:m.reload,children:"Try again"})]}),O.length===0?a.jsx(ga,{icon:a.jsx(nu,{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(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>y({channel:null}),children:"New channel"})}):a.jsx("ul",{className:"divide-y divide-line/70",children:O.map(w=>{const U=C.get(w.id),Y=j===w.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:"flex size-9 shrink-0 items-center justify-center rounded-md border border-line bg-inset text-muted",children:a.jsx(Rc,{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:w.name}),a.jsx(r0,{type:w.type}),h.data&&(U?a.jsxs(je,{tone:"ok",dot:!0,className:"cursor-default",children:[U.domains," ",U.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:bT(w)}),w.type==="discord"&&w.message&&a.jsxs("p",{className:"mt-0.5 truncate text-2xs text-faint",children:["Prefix: ",w.message]})]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 pl-12 sm:pl-0",children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:b===w.id,disabled:b!==null&&b!==w.id,icon:a.jsx(RS,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void D(w),children:"Test"}),a.jsx(ae,{variant:"ghost",size:"sm",disabled:Y,icon:a.jsx(Kh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>y({channel:w}),children:"Edit"}),a.jsx(ct,{label:`Delete ${w.name}`,size:"sm",disabled:Y,className:"hover:text-bad",onClick:()=>void E(w),children:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"})})]})]},w.id)})}),O.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(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Rc,{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(ln,{tone:d?"ok":"warn",pulse:d}),d?"Live":"Reconnecting…"]})}),f&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(ve,{tone:"warning",children:f})}),r.length===0?a.jsx(ga,{icon:a.jsx(Rc,{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:r.map(w=>{const U=gT(w);return a.jsxs("li",{className:"flex items-start gap-2.5 px-4 py-2.5 sm:px-5",children:[a.jsx(U,{className:oe("mt-0.5 size-4 shrink-0",vT(w.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:w.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:xT[w.type]??"Notification"}),w.domain&&a.jsxs("span",{children:["· ",w.domain]}),a.jsxs("span",{children:["· ",qr(w.timestamp)]})]})]})]},w.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:c,className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Clear all events"})})]})]}),a.jsxs(et,{children:[a.jsx(pn,{title:"How routing works",description:"Channels do nothing until a domain sends to them."}),a.jsxs(xn,{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((w,U)=>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:U+1}),a.jsx("span",{children:w})]},w))}),a.jsxs(kt,{to:"/domains",className:ma("secondary","sm","w-full"),children:["Open domains",a.jsx(bi,{className:"size-3.5","aria-hidden":"true"})]})]})]})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-40 rounded-lg"}),a.jsx(tt,{className:"h-64 rounded-lg"})]}),g&&a.jsx(pT,{channel:g.channel,onClose:()=>y(null),onSaved:(w,U)=>{y(null),m.reload(),n.success(U?"Channel created":"Channel updated",U?`${w.name} is ready to receive alerts.`:`${w.name} was saved.`)}},g.channel?.id??"new")]})}function yy(n,i){return n instanceof Ue?typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.message=="string"?n.payload.message:n.message:n instanceof Error?n.message:i}function $c(n){return n==="online"?"ok":n==="errored"?"bad":n==="stopping"||n==="launching"?"warn":"neutral"}function m0(n){return n===null||n===0?"—":M5(n)}function p0(n){return n===null||n===0?"—":Wb(n)}function by(n,i){const r=i?.replace(/\\/g,"/").replace(/\/+$/,"").toLowerCase()??null;return[n.execPath,n.cwd].some(c=>{if(!c)return!1;const d=c.replace(/\\/g,"/").toLowerCase();return r&&d.startsWith(`${r}/modules/`)?!0:/(^|\/)(\.pm2|pm2)\/modules\//.test(d)})}function jc({label:n,value:i}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:n}),a.jsx("div",{className:"mt-0.5 text-xs tabular-nums text-muted",children:i})]})}function zs({label:n,value:i,detail:r,tone:c}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:n}),a.jsx("div",{className:oe("mt-0.5 text-sm font-medium",c??"text-ink"),children:i}),r&&a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:r})]})}function NT({command:n,guidance:i}){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:n}),a.jsx(Ut,{value:n,label:"Copy command",withText:!0})]}),a.jsx("p",{className:"mt-2 text-2xs leading-relaxed text-muted",children:i})]})}function jy({label:n,version:i,path:r,broken:c=!1,emptyLabel:d="Unknown"}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs text-faint",children:n}),a.jsx("div",{className:oe("text-xs font-medium",c?"text-warn":"text-ink"),children:i??(c?"Missing":d)}),a.jsx("div",{className:"break-all font-mono text-2xs text-faint",children:r??"—"})]})}function wT({runtime:n}){const i=G5(n);return i?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"}),i.broken?a.jsx(je,{tone:"warn",children:"service runtime missing"}):i.pinned?i.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(jy,{label:"Service Node",version:i.serviceVersion,path:i.servicePath,broken:i.broken,emptyLabel:i.pinned?"Unknown":"Not pinned"}),a.jsx(jy,{label:"System Node",version:i.systemVersion,path:i.systemPath})]}),i.manager&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["The system Node is managed by ",i.manager,". The service uses its own pinned binary so switching versions cannot break it."]}),!i.pinned&&!i.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."]}),i.pinned&&!i.sameAsSystem&&!i.broken&&i.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 ST({app:n,onClose:i}){const r=Tt(d=>fe.processes.logs(n.name,200,d)),c=(r.data?.lines??[]).join(`
516
+ `);return a.jsx(vn,{open:!0,onClose:i,title:`Logs — ${n.name}`,description:"The last 200 lines PM2 has written for this process.",size:"lg",footer:a.jsxs(a.Fragment,{children:[c.trim()&&a.jsx(Ut,{value:c,label:"Copy logs",withText:!0}),a.jsx(ae,{variant:"secondary",onClick:i,children:"Close"})]}),children:r.error&&!r.data?a.jsx(qt,{error:r.error,title:"Could not read the logs",onRetry:r.reload,className:"border-0"}):r.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:c.trim()?c:"(no output)"}):a.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted",children:[a.jsx(_s,{}),"Reading logs…"]})})}function Ny({app:n,isModule:i,busy:r,currentUser:c,onAction:d,onLogs:f}){const m=r?.name===n.name,h=!!(n.user&&c&&n.user!==c);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(ln,{tone:$c(n.status),pulse:n.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:n.name}),a.jsx(je,{tone:$c(n.status),children:n.status}),i&&a.jsx(je,{tone:"info",children:"module"}),h&&a.jsx(je,{tone:"warn",children:n.user})]}),(n.execPath||n.cwd)&&a.jsx("p",{className:"mt-0.5 truncate font-mono text-2xs text-faint",children:n.execPath??n.cwd})]}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5",children:[n.status==="online"?a.jsx(ae,{variant:"secondary",size:"sm",loading:m&&r?.action==="stop",disabled:m||h,icon:a.jsx(Ih,{className:"size-3","aria-hidden":"true"}),onClick:()=>d(n,"stop",i),children:"Stop"}):a.jsx(ae,{variant:"secondary",size:"sm",loading:m&&r?.action==="start",disabled:m||h,icon:a.jsx(Br,{className:"size-3","aria-hidden":"true"}),onClick:()=>d(n,"start",i),children:"Start"}),a.jsx(ae,{variant:"ghost",size:"sm",loading:m&&r?.action==="restart",disabled:m||h,icon:a.jsx(Zh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>d(n,"restart",i),children:"Restart"}),a.jsx(ae,{variant:"ghost",size:"sm",disabled:m,icon:a.jsx(Er,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>f(n),children:"Logs"})]})]}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[a.jsx(jc,{label:"CPU",value:m0(n.cpu)}),a.jsx(jc,{label:"Memory",value:p0(n.memoryBytes)}),a.jsx(jc,{label:"Uptime",value:au(n.uptimeMs)}),a.jsx(jc,{label:"Restarts",value:n.unstableRestarts>0?`${n.restarts} · ${n.unstableRestarts} unstable`:String(n.restarts)})]})]})}const x0="ez.processes.view";function kT(){try{return localStorage.getItem(x0)==="table"?"table":"list"}catch{return"list"}}function CT({view:n,onChange:i}){const r=[{id:"list",label:"List view",icon:JS},{id:"table",label:"Table view",icon:Bk}];return a.jsx("div",{role:"group","aria-label":"Process layout",className:"inline-flex items-center gap-0.5 rounded-md border border-line bg-raised p-0.5",children:r.map(({id:c,label:d,icon:f})=>a.jsxs("button",{type:"button","aria-pressed":n===c,title:d,onClick:()=>i(c),className:oe("inline-flex size-7 items-center justify-center rounded-sm transition-colors duration-[var(--ez-motion-fast)]",n===c?"bg-surface text-ink shadow-sm":"text-faint hover:text-ink"),children:[a.jsx(f,{className:"size-3.5","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:d})]},c))})}function TT({app:n}){return n.unstableRestarts>0?`${n.restarts} · ${n.unstableRestarts} unstable`:String(n.restarts)}function wy({apps:n,isModule:i,busy:r,currentUser:c,onAction:d,onLogs:f}){return a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full min-w-[42rem] text-left text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-line text-2xs uppercase tracking-wider text-faint",children:[a.jsx("th",{scope:"col",className:"px-4 py-2 font-medium sm:px-5",children:"Process"}),a.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"CPU"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Memory"}),a.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Uptime"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Restarts"}),a.jsx("th",{scope:"col",className:"px-4 py-2 text-right font-medium sm:px-5",children:a.jsx("span",{className:"sr-only",children:"Actions"})})]})}),a.jsx("tbody",{children:n.map(m=>{const h=r?.name===m.name,g=!!(m.user&&c&&m.user!==c);return a.jsxs("tr",{className:"border-b border-line/70 last:border-0",children:[a.jsx("td",{className:"px-4 py-2 sm:px-5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ln,{tone:$c(m.status),pulse:m.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:m.name}),i&&a.jsx(je,{tone:"info",children:"module"}),g&&a.jsx(je,{tone:"warn",children:m.user})]})}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2",children:a.jsx(je,{tone:$c(m.status),children:m.status})}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:m0(m.cpu)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:p0(m.memoryBytes)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 tabular-nums text-muted",children:au(m.uptimeMs)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:a.jsx(TT,{app:m})}),a.jsx("td",{className:"px-4 py-2 sm:px-5",children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[m.status==="online"?a.jsx(ct,{label:`Stop ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"stop",i),children:h&&r?.action==="stop"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Ih,{className:"size-3","aria-hidden":"true"})}):a.jsx(ct,{label:`Start ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"start",i),children:h&&r?.action==="start"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Br,{className:"size-3","aria-hidden":"true"})}),a.jsx(ct,{label:`Restart ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"restart",i),children:h&&r?.action==="restart"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Zh,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`View logs for ${m.name}`,size:"sm",disabled:h,onClick:()=>f(m),children:a.jsx(Er,{className:"size-3.5","aria-hidden":"true"})})]})})]},`${m.name}-${m.pmId??"x"}`)})})]})})}function ET(){ba("Processes");const n=Et(),i=rn(),{service:r,loading:c,error:d,reload:f,applyBackgroundService:m}=$r(),h=Gr(r),g=Tt(te=>fe.processes.list(te)),[y,b]=p.useState(null),[x,j]=p.useState(null),[S,R]=p.useState(null),[k,C]=p.useState(null),[D,E]=p.useState(kT),[O,w]=p.useState(!1),U=te=>{E(te);try{localStorage.setItem(x0,te)}catch{}},Y=()=>{g.reload(),f()};hl(g.reload,15e3),hl(()=>{c||f()},15e3),vl(Y);const A=async(te,ce,K)=>{if(!y){if(ce==="stop"||ce==="restart"){const H=K?ce==="stop"?te.name.toLowerCase().includes("logrotate")?`${te.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.`:`${te.name} is a PM2 module, not one of your apps. Stopping it changes how PM2 itself behaves.`:`${te.name} is a PM2 module. Restarting it briefly stops the behaviour it adds to PM2.`:`${te.name} is one of your own PM2 apps. ${ce==="stop"?"Stopping":"Restarting"} it affects whatever else relies on it.`;if(!await i({title:`${ce==="stop"?"Stop":"Restart"} ${te.name}?`,body:H,confirmLabel:K&&ce==="stop"?"Stop module anyway":`${ce==="stop"?"Stop":"Restart"} anyway`,tone:"danger"}))return}b({name:te.name,action:ce});try{const H=await fe.processes.action(te.name,ce);n.success(`${te.name}: ${ce} done`,H.output||void 0),Y()}catch(H){n.error(`Could not ${ce} ${te.name}`,yy(H,"PM2 refused the action. Check the PM2 log for details."))}finally{b(null)}}},M=async te=>{if(!h||S)return;const ce=h.startsAt==="logon"?"at your next logon":h.startsAt==="boot"?"at the next boot":"when the service starts";if(await i(te==="start"?{title:"Start the background service?",body:h.installed?`Monitoring and notifications keep running after this dashboard closes. From now on it also starts ${ce}.`:"The service is not installed; if it cannot start, the exact install command is shown instead.",confirmLabel:"Start service"}:te==="stop"?{title:"Stop the background service?",body:h.installed?`Monitoring and notifications pause while it is down. It returns ${ce} 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"})){R(te),C(null);try{const H=await fe.service[te]();m(H.backgroundService),n.success(te==="start"?"Background service started":te==="stop"?"Background service stopped":"Background service restarted",H.output?.trim()||void 0),f()}catch(H){if(H instanceof Ue){if(H.payload.backgroundService&&m(H.payload.backgroundService),H.status===403&&H.code==="elevation_required"){C({kind:"elevation",action:te,command:typeof H.payload.command=="string"?H.payload.command:`ezz service ${te}`,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"){C({kind:"install",action:te,command:typeof H.payload.command=="string"?H.payload.command:r?.install.command??"ezz service install",shell:r?.install.shell??null,message:typeof H.payload.message=="string"?H.payload.message:null});return}if(H.status===409&&H.code==="already_running"){n.info("The background service is already running.",typeof H.payload.message=="string"?H.payload.message:void 0),f();return}n.error(`Could not ${te} the background service`,yy(H,"The service manager refused the action.")),f();return}n.error(`Could not ${te} the background service`,H instanceof Error?H.message:"The dashboard could not complete the action.")}finally{R(null)}}},W=(g.data?.apps??[]).filter(te=>!te.managed),I=g.data?.currentUser??null,ne=g.data?.pm2Home??null,F=W.filter(te=>by(te,ne)),Z=W.filter(te=>!by(te,ne));return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Processes",description:"The Easy DevOps background service, plus every PM2 app you run for yourself.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:g.loading||c,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:Y,children:"Refresh"})}),g.error&&!g.data?a.jsx(qt,{error:g.error,onRetry:g.reload}):g.data?a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",h?.running?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Gb,{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:Uc(h)}),r?.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(ae,{variant:"secondary",size:"sm",loading:S==="stop",disabled:S!==null,icon:a.jsx(Ih,{className:"size-3","aria-hidden":"true"}),onClick:()=>void M("stop"),children:"Stop"}),a.jsx(ae,{variant:"secondary",size:"sm",loading:S==="restart",disabled:S!==null,icon:a.jsx(Zh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void M("restart"),children:"Restart"})]}):a.jsx(ae,{variant:"primary",size:"sm",loading:S==="start",disabled:S!==null,icon:a.jsx(Br,{className:"size-3","aria-hidden":"true"}),onClick:()=>void M("start"),children:"Start"}):void 0}),a.jsxs(xn,{className:"space-y-4",children:[k&&a.jsxs(ve,{tone:"warning",title:k.kind==="install"?"The background service is not installed":`${k.action==="start"?"Starting":k.action==="stop"?"Stopping":"Restarting"} needs ${k.shell??"a terminal with extra rights"}`,action:a.jsx(ct,{label:"Dismiss",size:"sm",onClick:()=>C(null),children:a.jsx(Ms,{className:"size-3.5","aria-hidden":"true"})}),children:[k.message&&a.jsx("p",{children:k.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:k.command}),a.jsx(Ut,{value:k.command,label:"Copy command",withText:!0})]}),k.shell&&a.jsxs("p",{className:"mt-1.5 text-2xs text-faint",children:["Run it in ",k.shell,"."]})]}),a.jsx("p",{className:"mt-2 text-2xs text-faint",children:k.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."})]}),d&&!r?a.jsx(qt,{error:d,title:"Could not read the service state",onRetry:f,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(zs,{label:"Status",value:Uc(h),tone:h.running?"text-ok":"text-warn",detail:h.stoppedByUser&&h.stoppedAtLabel?`Stopped ${h.stoppedAtLabel}`:h.detail??void 0}),a.jsx(zs,{label:"PID",value:h.pid===null?"—":String(h.pid)}),a.jsx(zs,{label:"Uptime",value:au(h.uptimeMs)}),a.jsx(zs,{label:"Installed",value:h.installed?"Yes":"No"}),a.jsx(zs,{label:"Mode",value:h.mechanismLabel,detail:h.mechanismDetail}),a.jsx(zs,{label:"Starts",value:h.startsAtLabel}),a.jsx(zs,{label:"Monitoring runs in",value:h.jobsOwnerLabel}),a.jsx(zs,{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:r?.dataDir??"—"})]}),h.version&&a.jsxs("span",{children:["Daemon ",a.jsx("code",{className:"font-mono text-muted",children:h.version})]})]}),h.runtime?a.jsx(wT,{runtime:h.runtime}):r?.probes?.pending?a.jsxs("p",{className:"flex items-center gap-2 text-2xs text-faint",children:[a.jsx(_s,{}),"Measuring the Node 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(te=>a.jsx(ve,{tone:"warning",children:a.jsx("span",{className:"whitespace-pre-line",children:te})},te)),!h.running&&a.jsx(ve,{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(ou,{id:"service-install",title:"Install or repair the service",open:O,onOpenChange:w,className:"rounded-md border border-line bg-canvas/40",headerClassName:"px-3.5 py-3",contentClassName:"space-y-2.5 px-3.5 pb-3",children:[a.jsx(NT,{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(_s,{}),"Checking the background service…"]})]})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Your PM2 apps",Z.length>0&&a.jsx(je,{tone:"neutral",children:$n(Z.length,"app")})]}),description:I?`Apps PM2 is supervising for ${I}. Easy DevOps itself is not one of them.`:"Apps PM2 is supervising for you. Easy DevOps itself is not one of them.",actions:Z.length>0||F.length>0?a.jsx(CT,{view:D,onChange:U}):void 0}),g.data.pm2.installed&&g.data.hint&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(ve,{tone:"warning",children:g.data.hint})}),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"})]}),g.data.pm2.installed?Z.length===0?a.jsx(ga,{icon:a.jsx(Er,{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("div",{className:"panel-enter",children:D==="table"?a.jsx(wy,{apps:Z,isModule:!1,busy:y,currentUser:I,onAction:A,onLogs:j}):a.jsx("ul",{className:"divide-y divide-line/70",children:Z.map(te=>a.jsx(Ny,{app:te,isModule:!1,busy:y,currentUser:I,onAction:A,onLogs:j},`${te.name}-${te.pmId??"x"}`))})},D):a.jsx(ga,{icon:a.jsx(Er,{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."})]}),F.length>0&&a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["PM2 modules",a.jsx(je,{tone:"neutral",children:$n(F.length,"module")})]}),description:"Modules extend PM2 itself and are not your apps. Stopping pm2-logrotate lets PM2 logs grow without limit."}),a.jsx("div",{className:"panel-enter",children:D==="table"?a.jsx(wy,{apps:F,isModule:!0,busy:y,currentUser:I,onAction:A,onLogs:j}):a.jsx("ul",{className:"divide-y divide-line/70",children:F.map(te=>a.jsx(Ny,{app:te,isModule:!0,busy:y,currentUser:I,onAction:A,onLogs:j},`${te.name}-${te.pmId??"x"}`))})},D)]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-56 rounded-lg"}),a.jsx(tt,{className:"h-72 rounded-lg"})]}),x&&a.jsx(ST,{app:x,onClose:()=>j(null)})]})}function RT(n){return n?!/^[a-z0-9][a-z0-9-]{0,39}$/.test(n)||n.endsWith("-")?"Lower-case letters, digits and dashes, up to 40 characters.":null:"A name is required."}function zT(n){return/^ssh:\/\//.test(n)||/^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+:/.test(n)}function g0(n){if(!n)return null;const i=/^https?:\/\/github\.com\/([^/]+)\/([^/#?]+?)(?:\.git)?\/?$/i.exec(n.trim()),r=/^[A-Za-z0-9._-]+@github\.com:([^/]+)\/(.+?)(?:\.git)?$/i.exec(n.trim()),c=/^ssh:\/\/(?:[A-Za-z0-9._-]+@)?github\.com(?::\d+)?\/([^/]+)\/(.+?)(?:\.git)?$/i.exec(n.trim()),d=i??r??c;return d?`https://github.com/${d[1]}/${d[2]}/settings/keys/new`:null}function DT(n){const i={},r=n.split(/\r?\n/);for(let c=0;c<r.length;c++){const d=r[c];if(!d.trim()||d.trim().startsWith("#"))continue;const f=d.indexOf("=");if(f===-1)return{env:i,error:`Line ${c+1}: expected NAME=value.`};const m=d.slice(0,f).trim().replace(/^export\s+/,"");if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(m))return{env:i,error:`Line ${c+1}: "${m}" is not a valid variable name.`};let h=d.slice(f+1).trim();h.length>=2&&(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))&&(h=h.slice(1,-1)),i[m]=h}return{env:i,error:null}}function AT(n){return Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join(`
517
+ `)}let Sy=0;function OT(){return Sy+=1,`step-${Sy}`}function v0(n){return n.map(i=>({key:OT(),run:i.run,kind:i.kind,enabled:i.enabled!==!1}))}function MT(n){return n.filter(i=>i.run.trim()).map(i=>({run:i.run.trim(),kind:i.kind,enabled:i.enabled!==!1}))}function _T(n){if(Array.isArray(n.steps))return n.steps.map(r=>({run:r.run,kind:r.kind,enabled:r.enabled!==!1}));const i=[];for(const r of["install","build","migrate"]){const c=n[r];if(typeof c=="string"&&c.trim()){i.push({run:c.trim(),kind:r,enabled:!0});continue}for(const d of Array.isArray(c)?c:[])d.trim()&&i.push({run:d,kind:r,enabled:!0})}return i}function LT(n){return n.steps!==void 0||n.install!==void 0||n.build!==void 0||n.migrate!==void 0}const Nc=5,y0=[{value:"install",label:"Install"},{value:"build",label:"Build"},{value:"migrate",label:"Migrate"},{value:"custom",label:"Custom"}];function UT(n){const i={};n.forEach((d,f)=>{d.enabled!==!1&&i[d.kind]===void 0&&(i[d.kind]=f)});const r=[],c=(d,f,m)=>{const h=i[d],g=i[f];h!==void 0&&g!==void 0&&h<g&&r.push(m)};return c("migrate","install",'The "migrate" step is listed before "install", but dependencies are not installed yet. Put "install" before "migrate".'),c("build","install",'The "build" step is listed before "install", but dependencies are not installed yet. Put "install" before "build".'),c("migrate","build",'The "migrate" step is listed before "build". Build first, then migrate, so the migration runs against the release that is about to start.'),r}function ky(n){return n.startsWith('The "')}const cu=[{id:"node",label:"Default Node app",description:"npm ci, then npm start",start:"npm start",steps:[{run:"npm ci",kind:"install",enabled:!0}]},{id:"next",label:"Next.js",description:"npm ci and npm run build, then npm start",start:"npm start",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]},{id:"nest",label:"NestJS",description:"npm ci and npm run build, then node dist/main.js",start:"node dist/main.js",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]},{id:"express",label:"Express / Fastify",description:"npm ci, then node server.js",start:"node server.js",steps:[{run:"npm ci",kind:"install",enabled:!0}]},{id:"nuxt",label:"Nuxt",description:"npm ci and npm run build, then the Node server",start:"node .output/server/index.mjs",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]}];function HT(n){return[...n.steps,{run:"npm run lint",kind:"custom",enabled:!1},{run:"npx prisma migrate deploy",kind:"migrate",enabled:!1}]}function b0(n,i){return{steps:v0(_T(n)),start:n.start??"",runtime:n.runtime??"node",port:n.port?String(n.port):"",healthPath:n.healthPath??"",persist:Array.isArray(n.persist)?[...n.persist]:n.persist?[n.persist]:[],execMode:n.execMode??i?.execMode??"fork",instances:n.instances!==void 0?String(n.instances):i?.instances!==void 0?String(i.instances):"",stepsOverride:LT(n),startOverride:n.start!==void 0,runtimeOverride:n.runtime!==void 0,execModeOverride:n.execMode!==void 0,instancesOverride:n.instances!==void 0}}function BT(n){const i=n.trim(),r=i.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!r)return{path:null,error:"Enter a folder or file path."};if(r.length>200)return{path:null,error:`"${i}" is longer than 200 characters.`};if(r.startsWith("/")||/^[A-Za-z]:/.test(r))return{path:null,error:`"${i}" must be relative to the project folder.`};const c=r.split("/");return c.some(d=>d===""||d==="."||d==="..")?{path:null,error:`"${i}" must be a relative path without "." or "..".`}:c.includes(".git")?{path:null,error:`"${i}" cannot be ".git".`}:c.includes("node_modules")?{path:null,error:`"${i}" cannot include node_modules.`}:/[<>:"|?*]/.test(r)?{path:null,error:`"${i}" contains characters that are not allowed.`}:{path:r,error:null}}function $T(n,i){const r=BT(n);if(r.error||!r.path)return r;const c=r.path;if(i.includes(c))return{path:null,error:`"${c}" is already listed.`};if(i.length>=20)return{path:null,error:"Use at most 20 paths."};const d=c.toLowerCase();for(const f of i){const m=f.toLowerCase();if(m.startsWith(`${d}/`))return{path:null,error:`"${c}" contains "${f}" — keep only "${c}".`};if(d.startsWith(`${m}/`))return{path:null,error:`"${c}" is inside "${f}" — keep only "${f}".`}}return{path:c,error:null}}function qT(n){const i={};if(n.stepsOverride&&(i.steps=MT(n.steps)),n.startOverride&&n.start.trim()&&(i.start=n.start.trim()),n.runtimeOverride&&(i.runtime=n.runtime),n.port.trim()&&(i.port=Number(n.port)),n.healthPath.trim()&&(i.healthPath=n.healthPath.trim()),n.persist.length>0&&(i.persist=[...n.persist]),n.execModeOverride&&(i.execMode=n.execMode),n.instancesOverride){const r=n.instances.trim();r==="max"?i.instances="max":r&&Number.isInteger(Number(r))&&Number(r)>=1&&(i.instances=Number(r))}return i}const Cy="Cluster mode runs several copies of the app; it must be stateless (no in-memory sessions, sockets, caches or schedulers that assume one process).";function GT(n){const i=n.trim();return i?/^node\s+(?!-)\S+$/.test(i):null}function qc(n){if(!n.execMode)return null;const i=n.execMode==="cluster"?"Cluster":"Fork",r=n.instancesOnline??0;if(n.instances==="max")return`${i} · ${r} online (max)`;const c=n.instances??1;return`${i} · ${r}/${c} online`}const j0={running:{label:"Deploying",tone:"info"},success:{label:"Succeeded",tone:"ok"},failed:{label:"Failed",tone:"bad"},rolled_back:{label:"Rolled back",tone:"warn"}},Eh="Done",N0=[{id:"fetch",short:"Fetch",label:"Fetching the code"},{id:"settings",short:"Settings",label:"Reading project settings"},{id:"pre",short:"Pre",label:"Pre-deploy hook"},{id:"install",short:"Install",label:"Installing"},{id:"build",short:"Build",label:"Building"},{id:"migrate",short:"Migrate",label:"Running migrations"},{id:"start",short:"Start",label:"Starting"},{id:"health",short:"Health",label:"Health check"},{id:"post",short:"Post",label:"Post-deploy hook"},{id:"finish",short:"Finish",label:"Finishing"}],wc=N0.map(n=>n.id),zr=new Map(N0.map(n=>[n.id,n]));function w0(n){return n==="done"?Eh:zr.get(n)?.label??n}function YT(n){return zr.get(n)?.short??w0(n)}function VT(n){return n.stage&&(zr.has(n.stage)||n.stage==="done")?n.stage:n.step==="done"?"done":zr.has(n.step)?n.step:"build"}function Gc(n){if(n.stage==="done")return Eh;const i=n.stage?zr.get(n.stage):void 0;if(i)return i.label;if(n.step==="done")return Eh;const r=/^step\s+(\d+)$/i.exec(n.step.trim());return r?`Running step ${r[1]}`:w0(n.step)}function XT(n){const i=VT(n),r=n.status==="success"||i==="done",c=n.status==="failed"||n.status==="rolled_back",d=wc.indexOf(i),f=r?wc.length:d===-1?wc.indexOf("build"):d,m=new Set(n.skippedStages??[]);return wc.map((h,g)=>{let y;return m.has(h)?y="skipped":r||g<f?y="done":g>f?y="pending":y=c?"failed":"active",{step:h,state:y}})}function KT(n){return n===!0?{tone:"ok",text:"The new release crashed at boot. The previous release was started again and is serving."}:n===!1?{tone:"bad",text:"The automatic rollback could not verify the previous release. The app may be down — check it on the server."}:{tone:"neutral",text:"No automatic rollback was attempted: this was the first release, or automatic rollback is switched off. The failed release was stopped."}}const ZT={manual:"Dashboard",webhook:"GitHub Actions",hub:"Hub",rollback:"Rollback"};function Dr(n){return n?n.slice(0,7):"—"}function QT(n){const i=n.finishedAt??Date.now(),r=Math.max(0,Math.round((i-n.startedAt)/1e3));return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}function IT(n){return n==="online"?"ok":n==="errored"?"bad":n==="stopped"||n==="stopping"?"warn":"neutral"}function PT(n){const i=(m,h)=>m===!1?!1:Array.isArray(m)?m.length===0?!1:m.length===1?m[0]:m:m&&m.trim()?m:h,r={};if(n.steps!==void 0)r.steps=n.steps.map(m=>({run:m.run,kind:m.kind,...m.enabled===!1?{enabled:!1}:{}}));else{r.install=i(n.install,"npm ci"),r.build=i(n.build,"npm run build");const m=i(n.migrate,"");m&&m!==""&&(r.migrate=m)}r.start=n.start?.trim()||"npm start",r.runtime=n.runtime??"node",r.port=n.port??3e3,r.health=n.healthPath?.trim()||"/";const c=Array.isArray(n.persist)?n.persist:n.persist?.trim()?[n.persist.trim()]:[];c.length>0&&(r.persist=c),n.execMode&&(r.execMode=n.execMode),n.instances!==void 0&&(r.instances=n.instances);const d=i(n.pre,""),f=i(n.post,"");return(d&&d!==""||f&&f!=="")&&(r.hooks={...d&&d!==""?{pre:d}:{},...f&&f!==""?{post:f}:{}}),`${JSON.stringify(r,null,2)}
518
+ `}const FT=`${JSON.stringify({install:"pip install -r requirements.txt",build:!1,start:"python app.py",port:8e3,health:"/health"},null,2)}
519
+ `,JT=[{name:"steps",meaning:"An ordered list of at most 5 steps, each { run, kind, enabled? }, where kind is install, build, migrate or custom. One field: it replaces the list below, and [] clears it. Disabled steps are skipped.",without:"the equivalent install/build/migrate list below"},{name:"runtime",meaning:'The runtime. "node" is the only one today; cluster mode is Node-only.',without:'"node"'},{name:"install",meaning:"Old format: a command, a list of commands, or false to skip. Read as an install step.",without:"npm ci (yarn and pnpm are detected from the lockfile)"},{name:"build",meaning:"Old format: run after install. Same forms. Read as a build step.",without:'the "build" script, if package.json has one'},{name:"migrate",meaning:"Old format: run after build, before the new release starts. Same forms. Forward-only: a rollback does not undo a migration.",without:"nothing is run"},{name:"start",meaning:"The long-running process. One command, any language.",without:'the "start" script, else node <main>'},{name:"execMode",meaning:'"fork" (one process) or "cluster" (one worker per instance). Cluster needs a start command of the form node <file>.',without:'"fork"'},{name:"instances",meaning:'How many copies to run: a whole number up to the CPU count, or "max".',without:"1"},{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:"persist",meaning:"Folders or single files your app writes to and you need to keep: uploads, SQLite data, logs. A folder is usually the right unit — SQLite creates -wal and -shm files next to its database; list a file only when that file is all there is.",without:"nothing is kept; each deployment starts from the repository"},{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 WT({items:n,value:i,onChange:r,ariaLabel:c,className:d}){const f=p.useRef(new Map),m=g=>{const y=n[g];y&&(r(y.id),f.current.get(y.id)?.focus())},h=(g,y)=>{g.key==="ArrowRight"?(g.preventDefault(),m((y+1)%n.length)):g.key==="ArrowLeft"?(g.preventDefault(),m((y-1+n.length)%n.length)):g.key==="Home"?(g.preventDefault(),m(0)):g.key==="End"&&(g.preventDefault(),m(n.length-1))};return a.jsx("div",{role:"tablist","aria-label":c,className:oe("flex gap-1 overflow-x-auto border-b border-line",d),children:n.map((g,y)=>{const b=g.id===i;return a.jsxs("button",{ref:x=>{x?f.current.set(g.id,x):f.current.delete(g.id)},id:`tab-${g.id}`,role:"tab",type:"button","aria-selected":b,"aria-controls":`panel-${g.id}`,tabIndex:b?0:-1,onClick:()=>r(g.id),onKeyDown:x=>h(x,y),className:oe("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)]",b?"border-accent text-ink":"border-transparent text-muted hover:border-line-strong hover:text-ink"),children:[g.label,g.count!==void 0&&a.jsx("span",{className:oe("rounded-pill px-1.5 py-0.5 text-2xs",b?"bg-accent-soft text-accent-text":"bg-inset text-faint"),children:g.count})]},g.id)})})}function fi({id:n,value:i,children:r}){return n!==i?null:a.jsx("div",{role:"tabpanel",id:`panel-${n}`,"aria-labelledby":`tab-${n}`,className:"page-enter",children:r})}const e3=/^(\*\.)?[a-z0-9-]+(\.[a-z0-9-]+)+$/,t3="A new wildcard certificate needs DNS validation, which linking does not do. Issue it from the SSL page, then link with an existing certificate.",n3=[{mode:"issue",label:"Issue a new Let's Encrypt certificate",hint:"Over HTTP-01, so the domain must already point here."},{mode:"existing",label:"Use an existing certificate",hint:"A certificate already stored on this server."},{mode:"none",label:"No SSL",hint:"The domain is served over HTTP only."}];function a3({open:n,app:i,meta:r,onClose:c,onLinked:d}){const f=Et(),{connected:m}=yn(),[h]=p.useState(()=>em()),g=tm(h),[y,b]=p.useState(""),[x,j]=p.useState(!1),[S,R]=p.useState("issue"),[k,C]=p.useState(!0),[D,E]=p.useState(!1),[O,w]=p.useState(null),[U,Y]=p.useState(!1),[A,M]=p.useState(!1),[W,I]=p.useState(null),[ne,F]=p.useState(null),Z=y.trim().toLowerCase(),te=Z.startsWith("*."),ce=e3.test(Z),K=O?.found===!0?O:null,H=S==="issue"?c0:S==="existing"?u0:VC,L=g.clear,ee=g.byDomain[Z]??{},ke=m&&Object.keys(ee).length>0?ee:null,Ne=p.useMemo(()=>ne?PC(ne,H):null,[ne,H]),Ee=W!=null?Bc(W):null,T=Ee?.message??(W instanceof Error?W.message:null)??(W!=null?"Nothing was changed.":null),q=p.useMemo(()=>cl(W)??cl(ne),[W,ne]);p.useEffect(()=>{n&&(b(""),j(!1),R("issue"),C(!0),E(!1),w(null),M(!1),I(null),F(null),L())},[n,i.id,L]),p.useEffect(()=>{if(!n||S!=="existing"||!ce){w(null),Y(!1);return}const ie=new AbortController,Pe=setTimeout(()=>{Y(!0),fe.domains.sslSuggestion(Z,ie.signal).then(Ve=>{ie.signal.aborted||w(Ve)}).catch(()=>{ie.signal.aborted||w(null)}).finally(()=>{ie.signal.aborted||Y(!1)})},350);return()=>{clearTimeout(Pe),ie.abort()}},[n,S,Z,ce]);const V=K!==null&&(!te||[K.certificate.domain,...K.certificate.names].some(ie=>ie.trim().toLowerCase()===Z)),re=te&&S==="issue",ye=!i.settings.port&&!i.currentRelease,Re=ce&&!ye&&!A&&!re&&(S!=="existing"||V),xe=async()=>{if(!(!Re||A)){L(),M(!0),I(null),F(null);try{const ie=await fe.deployments.linkDomain(i.id,{domain:Z,www:te?!1:x,ssl:S==="issue"?{mode:"issue"}:S==="existing"&&K?{mode:"existing",certName:K.certificate.domain}:{mode:"none"},redirect:S==="none"?void 0:k,behindCloudflare:D,opId:h});F(ie),d(),ie.ssl&&!ie.ssl.ok||(ie.nginxReloaded?f.success("Domain linked",`${ie.domain} now proxies to port ${ie.port}.`):f.warning("Linked, but nginx was not reloaded","Reload nginx for it to take effect."))}catch(ie){I(ie)}finally{M(!1)}}},me=S==="issue"&&A?"Issuing the certificate, this can take a minute":A?"Linking the domain":null;return a.jsx(vn,{open:n,onClose:c,preventClose:A,size:"md",title:i.domain?"Link a different domain":"Link a domain",description:`Point a domain at ${i.id}. nginx proxies it to the app’s port.`,footer:ne?a.jsx(ae,{variant:"secondary",onClick:c,children:"Close"}):a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:c,disabled:A,children:"Cancel"}),a.jsx(ae,{variant:"primary",onClick:()=>void xe(),loading:A,disabled:!Re,children:"Link domain"})]}),children:a.jsxs("div",{className:"space-y-5",children:[a.jsx(Me,{label:"Domain name",value:y,onChange:ie=>{b(ie.target.value),F(null),I(null),L()},placeholder:"app.example.com",list:"link-domain-options",hint:Z?r.domains.some(ie=>ie.name===Z)?"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:"font-mono",spellCheck:!1,autoComplete:"off",disabled:!!ne}),a.jsx("datalist",{id:"link-domain-options",children:r.domains.map(ie=>a.jsx("option",{value:ie.name},ie.name))}),a.jsx(pl,{label:"Also serve www",hint:te?"A wildcard already covers the www name.":`Adds www.${Z||"example.com"}.`,checked:x,onChange:j,disabled:te||!!ne}),a.jsxs("fieldset",{disabled:!!ne,children:[a.jsx("legend",{className:"mb-2 text-xs font-medium text-muted",children:"SSL"}),a.jsx("div",{className:"space-y-2",children:n3.map(ie=>{const Pe=!!ne||ie.mode==="issue"&&te||ie.mode==="existing"&&!U&&!V;return a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-2.5 rounded-md border px-3 py-2.5 text-xs",S===ie.mode?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong",Pe&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"link-domain-ssl",value:ie.mode,checked:S===ie.mode,disabled:Pe,onChange:()=>R(ie.mode),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex items-center gap-1.5 font-medium text-ink",children:[ie.mode!=="none"?a.jsx(Rn,{className:"size-3.5 shrink-0","aria-hidden":"true"}):null,ie.label]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-faint",children:ie.mode==="existing"&&!Z?"Type the domain name above first.":ie.mode==="existing"&&U?"Looking for a certificate…":ie.mode==="existing"&&ce&&!V?te?"No certificate on this server lists this wildcard name.":"No certificate on this server covers this name.":ie.hint})]})]},ie.mode)})}),te&&S==="issue"?a.jsx("p",{className:"mt-2 text-2xs text-warn",children:t3}):null,S==="issue"&&!te?a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"If issuance fails the domain still works over HTTP; you can issue the certificate later from the SSL page."}):null]}),S==="existing"&&K&&V?a.jsxs("div",{className:"rounded-md border border-accent/40 bg-accent-soft/30 p-3",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:te?`The certificate in ${K.certificate.domain} lists ${Z}`:K.match==="exact"?`A certificate for ${Z} already exists`:K.match==="wildcard"?`A wildcard certificate covers ${Z}`:`The certificate in ${K.certificate.domain} covers ${Z}`}),a.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-muted",children:[a.jsx("span",{className:"font-mono",children:K.certificate.domain}),a.jsx("span",{children:K.certificate.daysLeft===null?"expiry unknown":K.certificate.daysLeft<=0?"expired":`${K.certificate.daysLeft} days left`})]}),K.certificate.names.length>1?a.jsxs("p",{className:"mt-1 break-all text-2xs text-faint",children:["covers ",K.certificate.names.join(", ")]}):null]}):null,S!=="none"&&!ne?a.jsx(Zt,{checked:k,onChange:C,label:"Redirect HTTP to HTTPS",description:"Port 80 requests are sent to the HTTPS address.",disabled:!!ne}):null,a.jsx(pl,{label:"Behind Cloudflare",hint:"Only when Cloudflare proxies this domain (the orange cloud). The server then reads the visitor’s address from CF-Connecting-IP.",checked:D,onChange:E,disabled:!!ne}),ye&&!ne?a.jsxs(ve,{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."]}):null,ke?a.jsx(ul,{stages:H,states:ke,ariaLabel:`Linking stages for ${Z}`,failure:Ee,timedOut:Ee?.stage==="timeout"}):me?a.jsxs("p",{className:"flex items-start gap-2 text-xs text-muted","aria-live":"polite",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("span",{children:[me,"."," ",m?"The live stage list appears when the server reports its stages; the result is shown here when it finishes.":"This finishes in one request; the result appears here."]})]}):null,!ke&&Ne?a.jsx(ul,{stages:H,states:Ne,ariaLabel:`Link result stages for ${Z}`}):null,q&&a.jsx(Rr,{preflight:q}),W&&!ke&&!Ne?a.jsx(ve,{tone:"danger",title:"The domain was not linked",children:T}):null,ne?ne.ssl&&!ne.ssl.ok?a.jsxs(ve,{tone:"warning",title:"Linked, without a certificate",children:[ne.domain," now proxies to port ",ne.port,", but the certificate was not issued: ",ne.ssl.detail," It works over HTTP until you issue the certificate from the SSL page."]}):a.jsxs(ve,{tone:"success",title:ne.created?"Domain created and linked":"Domain linked",children:[ne.domain," now proxies to port ",ne.port,".",ne.ssl?.ok?` ${ne.ssl.detail}`:" It is served over HTTP.",ne.nginxReloaded?"":" nginx was not reloaded yet; reload it for this to take effect."]}):null]})})}function Rh(n,i){return n instanceof Ue||n instanceof Error?n.message:i}function s3({app:n,onClose:i,onDeleted:r}){const c=Et(),[d,f]=p.useState(!1),[m,h]=p.useState(!1),[g,y]=p.useState(!1);p.useEffect(()=>{n&&(f(!1),h(!1))},[n]);const b=!!(n&&(n.hasSharedData||(Array.isArray(n.settings.persist)?n.settings.persist.length>0:n.settings.persist))),x=async()=>{if(!(!n||g)){y(!0);try{const j=await fe.deployments.remove(n.id,{deleteDomain:d&&!!n.domain,purgeData:m}),S=j.sharedKept&&j.sharedPath?`Persistent data was kept in ${j.sharedPath}.`:"";j.warning?c.warning(`${n.id} deleted`,`${j.warning} ${S}`.trim()):c.success(`${n.id} deleted`,[j.domainDeleted?`${n.domain} was removed too.`:"",S].filter(Boolean).join(" ")||void 0),r()}catch(j){c.error(`Could not delete ${n.id}`,Rh(j,"Nothing was changed."))}finally{y(!1)}}};return a.jsx(vn,{open:n!==null,onClose:i,preventClose:g,size:"sm",title:`Delete ${n?.id??""}?`,footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:i,disabled:g,children:"Cancel"}),a.jsx(ae,{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."}),n?.dir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:n.dir}),b&&n&&a.jsxs("div",{className:"space-y-2 rounded-md border border-line bg-inset/40 p-3",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Persistent data"}),a.jsx("p",{className:"text-xs",children:"Folders this app writes to are kept by default, so a later app with the same name can pick up its database and uploads."}),n.sharedDir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:n.sharedDir}),a.jsx(pl,{label:"Also delete the persistent data",hint:"The shared folders are deleted too and cannot be recovered.",checked:m,onChange:h})]}),n?.domain&&a.jsx(pl,{label:a.jsxs(a.Fragment,{children:["Also delete the domain ",a.jsx("span",{className:"font-mono text-ink",children:n.domain})]}),hint:"Its nginx config is removed and the site stops answering. Leave this off to keep the domain.",checked:d,onChange:f})]})})}function l3({app:n,meta:i,onChanged:r,onDelete:c}){const d=Et(),[f,m]=p.useState(!1),[h,g]=p.useState(""),[y,b]=p.useState(!1),x=n.settings.port??null,j=async()=>{try{await fe.deployments.unlinkDomain(n.id),d.success("Link removed",`${n.domain} is still configured; only the link is gone.`),r()}catch(R){d.error("Could not remove the link",Rh(R,"Nothing was changed."))}},S=async()=>{if(!(!h.trim()||y)){b(!0);try{const R=await fe.deployments.move(n.id,h.trim());R.warning?d.warning("Moved",R.warning):d.success("App moved",`${R.to}${R.restarted?" — and started again.":""}`),g(""),r()}catch(R){d.error("Could not move the app",Rh(R,"It is still where it was."))}finally{b(!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(Os,{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."})]})]}),n.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:n.domain}),a.jsxs("div",{className:"text-2xs text-faint",children:[x?`Proxies to port ${x}.`:"Proxies to the app’s port."," Edit it on the Domains page."]})]}),a.jsx(ae,{size:"sm",icon:a.jsx(QS,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void j(),children:"Remove link"})]}):null,a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ae,{variant:"primary",onClick:()=>m(!0),children:n.domain?"Link a different domain":"Link a domain"}),a.jsx("p",{className:"min-w-0 flex-1 text-xs text-faint",children:"Choose the name, whether www is served too, and the certificate to use."})]}),!x&&!n.currentRelease&&a.jsxs(ve,{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.jsx(a3,{open:f,app:n,meta:i,onClose:()=>m(!1),onLinked:r}),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(DS,{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:n.dir??"—"})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(Me,{label:"Move to",value:h,onChange:R=>g(R.target.value),placeholder:i.deployDir??"/srv/ez_deploys","aria-describedby":"deploy-move-hint",className:"min-w-56 flex-1 font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(ae,{onClick:()=>void S(),loading:y,disabled:!h.trim()||!!n.deploying,children:"Move app"})]}),a.jsx("p",{id:"deploy-move-hint",className:"mt-1.5 text-xs text-faint",children:h.trim()?`The app will be in ${h.trim().replace(/[\\/]+$/,"")}/${n.id}`:"A folder on this server. The app goes into a subfolder named after it."})]}),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(ae,{variant:"danger",icon:a.jsx(Us,{className:"size-4","aria-hidden":"true"}),onClick:c,disabled:!!n.deploying,children:"Delete app"})]})]})}function i3(n,i){const r=URL.createObjectURL(new Blob([i],{type:"application/json"})),c=document.createElement("a");c.href=r,c.download=n,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(r)}function r3({app:n,locations:i}){const r=PT(n.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:n.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:r}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(Ut,{value:r,label:"Copy ez.json",withText:!0}),a.jsx(ae,{size:"sm",icon:a.jsx(vh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>i3("ez.json",r),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:"," ",i.map((c,d)=>a.jsxs("span",{children:[a.jsx("code",{className:"font-mono text-ink",children:c}),d<i.length-1?", ":"."]},c))]})]}),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:JT.map(c=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap px-3 py-2 align-top font-mono text-ink",children:c.name}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:c.meaning}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:c.without})]},c.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:FT})]}),a.jsxs(ve,{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 ah(n,i){return n instanceof Ue||n instanceof Error?n.message:i}function zh({appId:n,repoUrl:i,publicKey:r,fingerprint:c,createdAt:d,onDisk:f=!1,initialError:m=null,onChanged:h}){const g=Et(),y=rn(),[b,x]=p.useState(r??null),[j,S]=p.useState(c??null),[R,k]=p.useState(d??null),[C,D]=p.useState(null),[E,O]=p.useState(m),[w,U]=p.useState(!1),[Y,A]=p.useState(!1),[M,W]=p.useState(!1),[I,ne]=p.useState(""),[F,Z]=p.useState(null),[te,ce]=p.useState(!1),[K,H]=p.useState(null),L=g0(i),ee=async()=>{if(!(w||!await y({title:"Replace the deploy key?",body:a.jsx(a.Fragment,{children:"The old key stops working here at once. GitHub keeps listing the old public key until you remove it — using “Add it to GitHub for me” afterwards removes the old key with the same title automatically."}),confirmLabel:"Replace the key",tone:"danger"}))){U(!0);try{const Ee=await fe.deployments.generateDeployKey(n);x(Ee.publicKey),S(Ee.fingerprint),k(Ee.createdAt),D(Ee.previousFingerprint??null),O(null),Z(null),H(null),g.success("Deploy key replaced","Add the new public key to the repository."),h?.()}catch(Ee){g.error("Could not replace the key",ah(Ee,"The old key is unchanged."))}finally{U(!1)}}},de=async()=>{if(Y)return;A(!0),Z(null);const Ne=I.trim();try{const Ee=await fe.deployments.addDeployKeyToGithub(n,Ne||void 0);Z(Ee),Ee.ok&&g.success("Key added to GitHub","It is read-only.")}catch(Ee){Z({ok:!1,error:ah(Ee,"GitHub did not accept the key."),steps:void 0})}finally{ne(""),A(!1)}},ke=async()=>{if(!te){ce(!0),H(null);try{H(await fe.deployments.testDeployKey(n))}catch(Ne){H({ok:!1,status:0,error:ah(Ne,"The test could not run.")})}finally{ce(!1)}}};return a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Hr,{className:"size-4 text-muted","aria-hidden":"true"}),a.jsx("span",{className:"text-sm font-medium text-ink",children:"Deploy key"})]}),a.jsx(ae,{size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void ee(),loading:w,children:b||E?"Regenerate key":"Generate key"})]}),E?a.jsxs(ve,{tone:"danger",title:"The key was not generated",children:[E," Press “Regenerate key” to try again; the app itself was created."]}):null,b?a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsxs("div",{className:"mb-1 flex flex-wrap items-center justify-between gap-2",children:[a.jsx("span",{className:"text-2xs font-medium uppercase tracking-[0.12em] text-faint",children:"Public key"}),a.jsx(Ut,{value:b,label:"Copy public key",withText:!0})]}),a.jsx("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap break-all rounded border border-line bg-canvas p-2.5 font-mono text-2xs text-muted",children:b})]}),a.jsxs("p",{className:"break-all font-mono text-2xs text-faint",children:["Fingerprint ",j??"not reported",R?` · created ${new Date(R).toLocaleDateString()}`:""]}),C?a.jsxs("p",{className:"break-all text-2xs text-warn",children:["Replaced ",C,". The old key still needs removing on GitHub."]}):null,f?null:a.jsx("p",{className:"text-2xs text-warn",children:"The private half is not on the server's disk any more; regenerate the key before the next deployment."}),a.jsxs("ol",{className:"list-decimal space-y-1 pl-4 text-xs text-muted",children:[a.jsx("li",{children:"In the repository: Settings → Deploy keys → Add deploy key."}),a.jsx("li",{children:"Paste the key above. The title is up to you."}),a.jsx("li",{children:"Leave “Allow write access” off — deployments only read."})]}),L?a.jsxs("a",{href:L,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-accent-text underline-offset-2 hover:underline",children:[a.jsx(kS,{className:"size-3.5","aria-hidden":"true"}),"Open GitHub's Add deploy key page"]}):null,L?a.jsxs("div",{className:"space-y-2 border-t border-line pt-3",children:[M?a.jsxs("div",{className:"space-y-2",children:[a.jsx(Me,{label:"GitHub token",type:"password",value:I,onChange:Ne=>ne(Ne.target.value),hint:"Used once for this request and not stored. It needs Administration: read and write on this repository.",placeholder:"github_pat_…",autoComplete:"off",spellCheck:!1}),a.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[a.jsx(ae,{size:"sm",variant:"secondary",onClick:()=>{ne(""),W(!1)},disabled:Y,children:"Cancel"}),a.jsx(ae,{size:"sm",onClick:()=>void de(),loading:Y,children:"Add the key"})]})]}):a.jsx(ae,{size:"sm",variant:"secondary",icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>W(!0),disabled:Y,children:"Add it to GitHub for me"}),F?a.jsxs("div",{className:"space-y-1.5",children:[(F.steps??[]).map(Ne=>a.jsxs("p",{className:`flex items-start gap-1.5 text-2xs ${Ne.ok?"text-ok":"text-bad"}`,children:[Ne.ok?a.jsx(dl,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}):a.jsx(Ms,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:Ne.detail})]},Ne.id)),F.error&&(F.steps??[]).length===0?a.jsx(ve,{tone:"danger",children:F.error}):null]}):null]}):a.jsx("p",{className:"text-2xs text-faint",children:"Automatic setup works with github.com repositories only; for another host, add the key there by hand."}),a.jsxs("div",{className:"space-y-2 border-t border-line pt-3",children:[a.jsx(ae,{size:"sm",variant:"secondary",onClick:()=>void ke(),loading:te,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Test connection"}),K?K.ok?a.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-ok",children:[a.jsx(dl,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:K.detail??"The key can read the repository."})]}):a.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-bad",children:[a.jsx(Ms,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:K.error??"The key could not read the repository."})]}):null]})]}):E?null:a.jsx("p",{className:"text-xs text-muted",children:"No key yet. Generate one and add its public half to the repository as a read-only deploy key. The private half stays on this server and is never shown."})]})}const uu="custom";function o3(n){return[...n.steps.filter(r=>r.enabled!==!1).map(r=>r.run),n.start].join(" → ")}function Ty(n){return n?n===uu?"Custom":cu.find(i=>i.id===n)?.label??null:null}function Ac(n){if(n===uu)return{start:"",steps:[]};const i=cu.find(r=>r.id===n);return i?{start:i.start,steps:HT(i)}:{start:"",steps:[]}}function Dh(n,i,r,c){return n.length!==r.length||i.trim()!==c.trim()?!1:n.every((d,f)=>d.run.trim()===r[f].run.trim()&&d.kind===r[f].kind&&d.enabled!==!1==(r[f].enabled!==!1))}function c3(n,i){for(const r of cu){const c=Ac(r.id);if(Dh(n,i,c.steps,c.start))return r.id}return n.length===0?uu:null}function u3(n){return n.split(/[^A-Za-z0-9]+/).filter(Boolean).slice(0,2).map(i=>i[0].toUpperCase()).join("")}function d3({value:n,modifiedFrom:i,onSelect:r,onReset:c,disabled:d}){const f=p.useRef(new Map),m=[...cu.map(y=>({id:y.id,name:y.label,summary:o3(y)})),{id:uu,name:"Custom",summary:"Start from empty steps"}],h=n??m[0].id,g=y=>{if(d)return;const b=Math.max(0,m.findIndex(S=>S.id===n));let x=null;if(y.key==="ArrowDown"||y.key==="ArrowRight"?x=(b+1)%m.length:y.key==="ArrowUp"||y.key==="ArrowLeft"?x=(b-1+m.length)%m.length:y.key==="Home"?x=0:y.key==="End"&&(x=m.length-1),x===null)return;y.preventDefault();const j=m[x];r(j.id),f.current.get(j.id)?.focus()};return a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{role:"radiogroup","aria-label":"Preset",onKeyDown:g,className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:m.map(y=>{const b=y.id===n;return a.jsxs("button",{ref:x=>{x?f.current.set(y.id,x):f.current.delete(y.id)},type:"button",role:"radio","aria-checked":b,tabIndex:b||y.id===h?0:-1,disabled:d,onClick:()=>r(y.id),className:oe("relative flex items-start gap-2.5 rounded-lg border px-3 py-3 text-left transition-colors duration-[var(--ez-motion-fast)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50",b?"border-accent bg-accent-soft":"border-line bg-raised/40",!b&&!d&&"hover:border-line-strong hover:bg-raised",d&&"cursor-not-allowed opacity-60"),children:[a.jsx("span",{className:oe("mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-md border text-2xs font-semibold",b?"border-accent/40 bg-canvas text-accent-text":"border-line bg-canvas text-muted"),"aria-hidden":"true",children:u3(y.name)}),a.jsxs("span",{className:"min-w-0 flex-1 pr-4",children:[a.jsx("span",{className:"block truncate text-xs font-medium text-ink",children:y.name}),a.jsx("span",{className:"mt-0.5 block truncate text-2xs text-muted",title:y.summary,children:y.summary})]}),b&&a.jsx("span",{className:"absolute right-2 top-2 inline-flex size-4 items-center justify-center rounded-full bg-accent text-accent-ink",children:a.jsx(dl,{className:"size-2.5","aria-hidden":"true"})})]},y.id)})}),i&&a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-faint",children:[a.jsxs("span",{children:["Modified from ",i]}),a.jsx("button",{type:"button",onClick:c,disabled:d,className:"rounded-sm font-medium text-accent-text underline-offset-2 transition-colors hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:cursor-not-allowed disabled:text-faint disabled:opacity-60",children:"Reset to preset"})]}),a.jsx(ve,{tone:"info",children:"Check your project's real start and build commands before relying on a preset; not every project uses the defaults."})]})}const f3=[{id:"node",name:"Node.js",description:"JavaScript and TypeScript: Next.js, NestJS, Express, Fastify, Nuxt.",icon:eS},{id:"python",name:"Python",description:"Django, FastAPI, Flask.",icon:qk},{id:"go",name:"Go",description:"A compiled Go binary.",icon:gl},{id:"static",name:"Static site",description:"Files served as they are, with no process.",icon:US}];function h3({value:n,onChange:i}){return a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:f3.map(r=>{const c=r.id==="node",d=r.id===n,f=r.icon;return a.jsxs("button",{type:"button","aria-pressed":d,disabled:!c,onClick:()=>c&&i(r.id),className:oe("flex items-start gap-3 rounded-lg border px-3 py-3 text-left transition-colors duration-[var(--ez-motion-fast)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50",d?"border-accent bg-accent-soft":"border-line bg-raised/40",c&&!d&&"hover:border-line-strong hover:bg-raised",!c&&"cursor-not-allowed opacity-60"),children:[a.jsx("span",{className:oe("mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-md border",d?"border-accent/40 bg-canvas text-accent-text":"border-line bg-canvas text-muted"),children:a.jsx(f,{className:"size-4","aria-hidden":"true"})}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-ink",children:r.name}),d&&a.jsx(je,{tone:"accent",children:"Selected"}),!c&&a.jsx(je,{tone:"neutral",children:"Coming soon"})]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-muted",children:r.description})]})]},r.id)})})}function m3(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return p.useMemo(()=>c=>{i.forEach(d=>d(c))},i)}const du=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ni(n){const i=Object.prototype.toString.call(n);return i==="[object Window]"||i==="[object global]"}function nm(n){return"nodeType"in n}function bn(n){var i,r;return n?Ni(n)?n:nm(n)&&(i=(r=n.ownerDocument)==null?void 0:r.defaultView)!=null?i:window:window}function am(n){const{Document:i}=bn(n);return n instanceof i}function Yr(n){return Ni(n)?!1:n instanceof bn(n).HTMLElement}function S0(n){return n instanceof bn(n).SVGElement}function wi(n){return n?Ni(n)?n.document:nm(n)?am(n)?n:Yr(n)||S0(n)?n.ownerDocument:document:document:document}const va=du?p.useLayoutEffect:p.useEffect;function fu(n){const i=p.useRef(n);return va(()=>{i.current=n}),p.useCallback(function(){for(var r=arguments.length,c=new Array(r),d=0;d<r;d++)c[d]=arguments[d];return i.current==null?void 0:i.current(...c)},[])}function p3(){const n=p.useRef(null),i=p.useCallback((c,d)=>{n.current=setInterval(c,d)},[]),r=p.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[i,r]}function Ar(n,i){i===void 0&&(i=[n]);const r=p.useRef(n);return va(()=>{r.current!==n&&(r.current=n)},i),r}function Vr(n,i){const r=p.useRef();return p.useMemo(()=>{const c=n(r.current);return r.current=c,c},[...i])}function Yc(n){const i=fu(n),r=p.useRef(null),c=p.useCallback(d=>{d!==r.current&&i?.(d,r.current),r.current=d},[]);return[r,c]}function Vc(n){const i=p.useRef();return p.useEffect(()=>{i.current=n},[n]),i.current}let sh={};function Xr(n,i){return p.useMemo(()=>{if(i)return i;const r=sh[n]==null?0:sh[n]+1;return sh[n]=r,n+"-"+r},[n,i])}function k0(n){return function(i){for(var r=arguments.length,c=new Array(r>1?r-1:0),d=1;d<r;d++)c[d-1]=arguments[d];return c.reduce((f,m)=>{const h=Object.entries(m);for(const[g,y]of h){const b=f[g];b!=null&&(f[g]=b+n*y)}return f},{...i})}}const pi=k0(1),Or=k0(-1);function x3(n){return"clientX"in n&&"clientY"in n}function hu(n){if(!n)return!1;const{KeyboardEvent:i}=bn(n.target);return i&&n instanceof i}function g3(n){if(!n)return!1;const{TouchEvent:i}=bn(n.target);return i&&n instanceof i}function Xc(n){if(g3(n)){if(n.touches&&n.touches.length){const{clientX:i,clientY:r}=n.touches[0];return{x:i,y:r}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:i,clientY:r}=n.changedTouches[0];return{x:i,y:r}}}return x3(n)?{x:n.clientX,y:n.clientY}:null}const Ls=Object.freeze({Translate:{toString(n){if(!n)return;const{x:i,y:r}=n;return"translate3d("+(i?Math.round(i):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:i,scaleY:r}=n;return"scaleX("+i+") scaleY("+r+")"}},Transform:{toString(n){if(n)return[Ls.Translate.toString(n),Ls.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:i,duration:r,easing:c}=n;return i+" "+r+"ms "+c}}}),Ey="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function v3(n){return n.matches(Ey)?n:n.querySelector(Ey)}const y3={display:"none"};function b3(n){let{id:i,value:r}=n;return vt.createElement("div",{id:i,style:y3},r)}function j3(n){let{id:i,announcement:r,ariaLiveType:c="assertive"}=n;const d={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return vt.createElement("div",{id:i,style:d,role:"status","aria-live":c,"aria-atomic":!0},r)}function N3(){const[n,i]=p.useState("");return{announce:p.useCallback(c=>{c!=null&&i(c)},[]),announcement:n}}const C0=p.createContext(null);function w3(n){const i=p.useContext(C0);p.useEffect(()=>{if(!i)throw new Error("useDndMonitor must be used within a children of <DndContext>");return i(n)},[n,i])}function S3(){const[n]=p.useState(()=>new Set),i=p.useCallback(c=>(n.add(c),()=>n.delete(c)),[n]);return[p.useCallback(c=>{let{type:d,event:f}=c;n.forEach(m=>{var h;return(h=m[d])==null?void 0:h.call(m,f)})},[n]),i]}const k3={draggable:`
522
520
  To pick up a draggable item, press the space bar.
523
521
  While dragging, use the arrow keys to move the item.
524
522
  Press space again to drop the item in its new position, or press escape to cancel.
525
- `},R3={onDragStart(n){let{active:i}=n;return"Picked up draggable item "+i.id+"."},onDragOver(n){let{active:i,over:r}=n;return r?"Draggable item "+i.id+" was moved over droppable area "+r.id+".":"Draggable item "+i.id+" is no longer over a droppable area."},onDragEnd(n){let{active:i,over:r}=n;return r?"Draggable item "+i.id+" was dropped over droppable area "+r.id:"Draggable item "+i.id+" was dropped."},onDragCancel(n){let{active:i}=n;return"Dragging was cancelled. Draggable item "+i.id+" was dropped."}};function z3(n){let{announcements:i=R3,container:r,hiddenTextDescribedById:c,screenReaderInstructions:d=E3}=n;const{announce:f,announcement:m}=k3(),h=Vr("DndLiveRegion"),[g,v]=p.useState(!1);if(p.useEffect(()=>{v(!0)},[]),C3(p.useMemo(()=>({onDragStart(x){let{active:j}=x;f(i.onDragStart({active:j}))},onDragMove(x){let{active:j,over:S}=x;i.onDragMove&&f(i.onDragMove({active:j,over:S}))},onDragOver(x){let{active:j,over:S}=x;f(i.onDragOver({active:j,over:S}))},onDragEnd(x){let{active:j,over:S}=x;f(i.onDragEnd({active:j,over:S}))},onDragCancel(x){let{active:j,over:S}=x;f(i.onDragCancel({active:j,over:S}))}}),[f,i])),!g)return null;const b=yt.createElement(yt.Fragment,null,yt.createElement(w3,{id:c,value:d.draggable}),yt.createElement(S3,{id:h,announcement:m}));return r?ol.createPortal(b,r):b}var Bt;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Bt||(Bt={}));function Vc(){}function sh(n,i){return p.useMemo(()=>({sensor:n,options:i??{}}),[n,i])}function D3(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return p.useMemo(()=>[...i].filter(c=>c!=null),[...i])}const va=Object.freeze({x:0,y:0});function j0(n,i){return Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2))}function A3(n,i){const r=Yc(n);if(!r)return"0 0";const c={x:(r.x-i.left)/i.width*100,y:(r.y-i.top)/i.height*100};return c.x+"% "+c.y+"%"}function N0(n,i){let{data:{value:r}}=n,{data:{value:c}}=i;return r-c}function O3(n,i){let{data:{value:r}}=n,{data:{value:c}}=i;return c-r}function Ev(n){let{left:i,top:r,height:c,width:d}=n;return[{x:i,y:r},{x:i+d,y:r},{x:i,y:r+c},{x:i+d,y:r+c}]}function w0(n,i){if(!n||n.length===0)return null;const[r]=n;return r[i]}function Rv(n,i,r){return i===void 0&&(i=n.left),r===void 0&&(r=n.top),{x:i+n.width*.5,y:r+n.height*.5}}const M3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=Rv(i,i.left,i.top),f=[];for(const m of c){const{id:h}=m,g=r.get(h);if(g){const v=j0(Rv(g),d);f.push({id:h,data:{droppableContainer:m,value:v}})}}return f.sort(N0)},_3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=Ev(i),f=[];for(const m of c){const{id:h}=m,g=r.get(h);if(g){const v=Ev(g),b=d.reduce((j,S,R)=>j+j0(v[R],S),0),x=Number((b/4).toFixed(4));f.push({id:h,data:{droppableContainer:m,value:x}})}}return f.sort(N0)};function L3(n,i){const r=Math.max(i.top,n.top),c=Math.max(i.left,n.left),d=Math.min(i.left+i.width,n.left+n.width),f=Math.min(i.top+i.height,n.top+n.height),m=d-c,h=f-r;if(c<d&&r<f){const g=i.width*i.height,v=n.width*n.height,b=m*h,x=b/(g+v-b);return Number(x.toFixed(4))}return 0}const U3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=[];for(const f of c){const{id:m}=f,h=r.get(m);if(h){const g=L3(h,i);g>0&&d.push({id:m,data:{droppableContainer:f,value:g}})}}return d.sort(O3)};function H3(n,i,r){return{...n,scaleX:i&&r?i.width/r.width:1,scaleY:i&&r?i.height/r.height:1}}function S0(n,i){return n&&i?{x:n.left-i.left,y:n.top-i.top}:va}function B3(n){return function(r){for(var c=arguments.length,d=new Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];return d.reduce((m,h)=>({...m,top:m.top+n*h.y,bottom:m.bottom+n*h.y,left:m.left+n*h.x,right:m.right+n*h.x}),{...r})}}const $3=B3(1);function k0(n){if(n.startsWith("matrix3d(")){const i=n.slice(9,-1).split(/, /);return{x:+i[12],y:+i[13],scaleX:+i[0],scaleY:+i[5]}}else if(n.startsWith("matrix(")){const i=n.slice(7,-1).split(/, /);return{x:+i[4],y:+i[5],scaleX:+i[0],scaleY:+i[3]}}return null}function q3(n,i,r){const c=k0(i);if(!c)return n;const{scaleX:d,scaleY:f,x:m,y:h}=c,g=n.left-m-(1-d)*parseFloat(r),v=n.top-h-(1-f)*parseFloat(r.slice(r.indexOf(" ")+1)),b=d?n.width/d:n.width,x=f?n.height/f:n.height;return{width:b,height:x,top:v,right:g+b,bottom:v+x,left:g}}const G3={ignoreTransform:!1};function wi(n,i){i===void 0&&(i=G3);let r=n.getBoundingClientRect();if(i.ignoreTransform){const{transform:v,transformOrigin:b}=bn(n).getComputedStyle(n);v&&(r=q3(r,v,b))}const{top:c,left:d,width:f,height:m,bottom:h,right:g}=r;return{top:c,left:d,width:f,height:m,bottom:h,right:g}}function zv(n){return wi(n,{ignoreTransform:!0})}function Y3(n){const i=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:i,bottom:r,width:i,height:r}}function V3(n,i){return i===void 0&&(i=bn(n).getComputedStyle(n)),i.position==="fixed"}function X3(n,i){i===void 0&&(i=bn(n).getComputedStyle(n));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(d=>{const f=i[d];return typeof f=="string"?r.test(f):!1})}function fu(n,i){const r=[];function c(d){if(i!=null&&r.length>=i||!d)return r;if(tm(d)&&d.scrollingElement!=null&&!r.includes(d.scrollingElement))return r.push(d.scrollingElement),r;if(!Gr(d)||y0(d)||r.includes(d))return r;const f=bn(n).getComputedStyle(d);return d!==n&&X3(d,f)&&r.push(d),V3(d,f)?r:c(d.parentNode)}return n?c(n):r}function C0(n){const[i]=fu(n,1);return i??null}function lh(n){return!cu||!n?null:ji(n)?n:em(n)?tm(n)||n===Ni(n).scrollingElement?window:Gr(n)?n:null:null}function T0(n){return ji(n)?n.scrollX:n.scrollLeft}function E0(n){return ji(n)?n.scrollY:n.scrollTop}function zh(n){return{x:T0(n),y:E0(n)}}var Qt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Qt||(Qt={}));function R0(n){return!cu||!n?!1:n===document.scrollingElement}function z0(n){const i={x:0,y:0},r=R0(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},c={x:n.scrollWidth-r.width,y:n.scrollHeight-r.height},d=n.scrollTop<=i.y,f=n.scrollLeft<=i.x,m=n.scrollTop>=c.y,h=n.scrollLeft>=c.x;return{isTop:d,isLeft:f,isBottom:m,isRight:h,maxScroll:c,minScroll:i}}const K3={x:.2,y:.2};function Z3(n,i,r,c,d){let{top:f,left:m,right:h,bottom:g}=r;c===void 0&&(c=10),d===void 0&&(d=K3);const{isTop:v,isBottom:b,isLeft:x,isRight:j}=z0(n),S={x:0,y:0},R={x:0,y:0},k={height:i.height*d.y,width:i.width*d.x};return!v&&f<=i.top+k.height?(S.y=Qt.Backward,R.y=c*Math.abs((i.top+k.height-f)/k.height)):!b&&g>=i.bottom-k.height&&(S.y=Qt.Forward,R.y=c*Math.abs((i.bottom-k.height-g)/k.height)),!j&&h>=i.right-k.width?(S.x=Qt.Forward,R.x=c*Math.abs((i.right-k.width-h)/k.width)):!x&&m<=i.left+k.width&&(S.x=Qt.Backward,R.x=c*Math.abs((i.left+k.width-m)/k.width)),{direction:S,speed:R}}function Q3(n){if(n===document.scrollingElement){const{innerWidth:f,innerHeight:m}=window;return{top:0,left:0,right:f,bottom:m,width:f,height:m}}const{top:i,left:r,right:c,bottom:d}=n.getBoundingClientRect();return{top:i,left:r,right:c,bottom:d,width:n.clientWidth,height:n.clientHeight}}function D0(n){return n.reduce((i,r)=>mi(i,zh(r)),va)}function I3(n){return n.reduce((i,r)=>i+T0(r),0)}function P3(n){return n.reduce((i,r)=>i+E0(r),0)}function A0(n,i){if(i===void 0&&(i=wi),!n)return;const{top:r,left:c,bottom:d,right:f}=i(n);C0(n)&&(d<=0||f<=0||r>=window.innerHeight||c>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const F3=[["x",["left","right"],I3],["y",["top","bottom"],P3]];class nm{constructor(i,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const c=fu(r),d=D0(c);this.rect={...i},this.width=i.width,this.height=i.height;for(const[f,m,h]of F3)for(const g of m)Object.defineProperty(this,g,{get:()=>{const v=h(c),b=d[f]-v;return this.rect[g]+b},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class wr{constructor(i){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var c;return(c=this.target)==null?void 0:c.removeEventListener(...r)})},this.target=i}add(i,r,c){var d;(d=this.target)==null||d.addEventListener(i,r,c),this.listeners.push([i,r,c])}}function J3(n){const{EventTarget:i}=bn(n);return n instanceof i?n:Ni(n)}function ih(n,i){const r=Math.abs(n.x),c=Math.abs(n.y);return typeof i=="number"?Math.sqrt(r**2+c**2)>i:"x"in i&&"y"in i?r>i.x&&c>i.y:"x"in i?r>i.x:"y"in i?c>i.y:!1}var Wn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Wn||(Wn={}));function Dv(n){n.preventDefault()}function W3(n){n.stopPropagation()}var Ie;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Ie||(Ie={}));const O0={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter,Ie.Tab]},eE=(n,i)=>{let{currentCoordinates:r}=i;switch(n.code){case Ie.Right:return{...r,x:r.x+25};case Ie.Left:return{...r,x:r.x-25};case Ie.Down:return{...r,y:r.y+25};case Ie.Up:return{...r,y:r.y-25}}};class am{constructor(i){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=i;const{event:{target:r}}=i;this.props=i,this.listeners=new wr(Ni(r)),this.windowListeners=new wr(bn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Wn.Resize,this.handleCancel),this.windowListeners.add(Wn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Wn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:i,onStart:r}=this.props,c=i.node.current;c&&A0(c),r(va)}handleKeyDown(i){if(du(i)){const{active:r,context:c,options:d}=this.props,{keyboardCodes:f=O0,coordinateGetter:m=eE,scrollBehavior:h="smooth"}=d,{code:g}=i;if(f.end.includes(g)){this.handleEnd(i);return}if(f.cancel.includes(g)){this.handleCancel(i);return}const{collisionRect:v}=c.current,b=v?{x:v.left,y:v.top}:va;this.referenceCoordinates||(this.referenceCoordinates=b);const x=m(i,{active:r,context:c.current,currentCoordinates:b});if(x){const j=Ar(x,b),S={x:0,y:0},{scrollableAncestors:R}=c.current;for(const k of R){const C=i.code,{isTop:z,isRight:w,isLeft:O,isBottom:E,maxScroll:M,minScroll:Y}=z0(k),A=Q3(k),H={x:Math.min(C===Ie.Right?A.right-A.width/2:A.right,Math.max(C===Ie.Right?A.left:A.left+A.width/2,x.x)),y:Math.min(C===Ie.Down?A.bottom-A.height/2:A.bottom,Math.max(C===Ie.Down?A.top:A.top+A.height/2,x.y))},W=C===Ie.Right&&!w||C===Ie.Left&&!O,I=C===Ie.Down&&!E||C===Ie.Up&&!z;if(W&&H.x!==x.x){const ne=k.scrollLeft+j.x,J=C===Ie.Right&&ne<=M.x||C===Ie.Left&&ne>=Y.x;if(J&&!j.y){k.scrollTo({left:ne,behavior:h});return}J?S.x=k.scrollLeft-ne:S.x=C===Ie.Right?k.scrollLeft-M.x:k.scrollLeft-Y.x,S.x&&k.scrollBy({left:-S.x,behavior:h});break}else if(I&&H.y!==x.y){const ne=k.scrollTop+j.y,J=C===Ie.Down&&ne<=M.y||C===Ie.Up&&ne>=Y.y;if(J&&!j.x){k.scrollTo({top:ne,behavior:h});return}J?S.y=k.scrollTop-ne:S.y=C===Ie.Down?k.scrollTop-M.y:k.scrollTop-Y.y,S.y&&k.scrollBy({top:-S.y,behavior:h});break}}this.handleMove(i,mi(Ar(x,this.referenceCoordinates),S))}}}handleMove(i,r){const{onMove:c}=this.props;i.preventDefault(),c(r)}handleEnd(i){const{onEnd:r}=this.props;i.preventDefault(),this.detach(),r()}handleCancel(i){const{onCancel:r}=this.props;i.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}am.activators=[{eventName:"onKeyDown",handler:(n,i,r)=>{let{keyboardCodes:c=O0,onActivation:d}=i,{active:f}=r;const{code:m}=n.nativeEvent;if(c.start.includes(m)){const h=f.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),d?.({event:n.nativeEvent}),!0)}return!1}}];function Av(n){return!!(n&&"distance"in n)}function Ov(n){return!!(n&&"delay"in n)}class sm{constructor(i,r,c){var d;c===void 0&&(c=J3(i.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=i,this.events=r;const{event:f}=i,{target:m}=f;this.props=i,this.events=r,this.document=Ni(m),this.documentListeners=new wr(this.document),this.listeners=new wr(c),this.windowListeners=new wr(bn(m)),this.initialCoordinates=(d=Yc(f))!=null?d:va,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:i,props:{options:{activationConstraint:r,bypassActivationConstraint:c}}}=this;if(this.listeners.add(i.move.name,this.handleMove,{passive:!1}),this.listeners.add(i.end.name,this.handleEnd),i.cancel&&this.listeners.add(i.cancel.name,this.handleCancel),this.windowListeners.add(Wn.Resize,this.handleCancel),this.windowListeners.add(Wn.DragStart,Dv),this.windowListeners.add(Wn.VisibilityChange,this.handleCancel),this.windowListeners.add(Wn.ContextMenu,Dv),this.documentListeners.add(Wn.Keydown,this.handleKeydown),r){if(c!=null&&c({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ov(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Av(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(i,r){const{active:c,onPending:d}=this.props;d(c,i,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:i}=this,{onStart:r}=this.props;i&&(this.activated=!0,this.documentListeners.add(Wn.Click,W3,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Wn.SelectionChange,this.removeTextSelection),r(i))}handleMove(i){var r;const{activated:c,initialCoordinates:d,props:f}=this,{onMove:m,options:{activationConstraint:h}}=f;if(!d)return;const g=(r=Yc(i))!=null?r:va,v=Ar(d,g);if(!c&&h){if(Av(h)){if(h.tolerance!=null&&ih(v,h.tolerance))return this.handleCancel();if(ih(v,h.distance))return this.handleStart()}if(Ov(h)&&ih(v,h.tolerance))return this.handleCancel();this.handlePending(h,v);return}i.cancelable&&i.preventDefault(),m(g)}handleEnd(){const{onAbort:i,onEnd:r}=this.props;this.detach(),this.activated||i(this.props.active),r()}handleCancel(){const{onAbort:i,onCancel:r}=this.props;this.detach(),this.activated||i(this.props.active),r()}handleKeydown(i){i.code===Ie.Esc&&this.handleCancel()}removeTextSelection(){var i;(i=this.document.getSelection())==null||i.removeAllRanges()}}const tE={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class lm extends sm{constructor(i){const{event:r}=i,c=Ni(r.target);super(i,tE,c)}}lm.activators=[{eventName:"onPointerDown",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;return!r.isPrimary||r.button!==0?!1:(c?.({event:r}),!0)}}];const nE={move:{name:"mousemove"},end:{name:"mouseup"}};var Dh;(function(n){n[n.RightClick=2]="RightClick"})(Dh||(Dh={}));class aE extends sm{constructor(i){super(i,nE,Ni(i.event.target))}}aE.activators=[{eventName:"onMouseDown",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;return r.button===Dh.RightClick?!1:(c?.({event:r}),!0)}}];const rh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class M0 extends sm{constructor(i){super(i,rh)}static setup(){return window.addEventListener(rh.move.name,i,{capture:!1,passive:!1}),function(){window.removeEventListener(rh.move.name,i)};function i(){}}}M0.activators=[{eventName:"onTouchStart",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;const{touches:d}=r;return d.length>1?!1:(c?.({event:r}),!0)}}];var Sr;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Sr||(Sr={}));var Xc;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Xc||(Xc={}));function sE(n){let{acceleration:i,activator:r=Sr.Pointer,canScroll:c,draggingRect:d,enabled:f,interval:m=5,order:h=Xc.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:b,delta:x,threshold:j}=n;const S=iE({delta:x,disabled:!f}),[R,k]=y3(),C=p.useRef({x:0,y:0}),z=p.useRef({x:0,y:0}),w=p.useMemo(()=>{switch(r){case Sr.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case Sr.DraggableRect:return d}},[r,d,g]),O=p.useRef(null),E=p.useCallback(()=>{const Y=O.current;if(!Y)return;const A=C.current.x*z.current.x,H=C.current.y*z.current.y;Y.scrollBy(A,H)},[]),M=p.useMemo(()=>h===Xc.TreeOrder?[...v].reverse():v,[h,v]);p.useEffect(()=>{if(!f||!v.length||!w){k();return}for(const Y of M){if(c?.(Y)===!1)continue;const A=v.indexOf(Y),H=b[A];if(!H)continue;const{direction:W,speed:I}=Z3(Y,H,w,i,j);for(const ne of["x","y"])S[ne][W[ne]]||(I[ne]=0,W[ne]=0);if(I.x>0||I.y>0){k(),O.current=Y,R(E,m),C.current=I,z.current=W;return}}C.current={x:0,y:0},z.current={x:0,y:0},k()},[i,E,c,k,f,m,JSON.stringify(w),JSON.stringify(S),R,v,M,b,JSON.stringify(j)])}const lE={x:{[Qt.Backward]:!1,[Qt.Forward]:!1},y:{[Qt.Backward]:!1,[Qt.Forward]:!1}};function iE(n){let{delta:i,disabled:r}=n;const c=Gc(i);return Yr(d=>{if(r||!c||!d)return lE;const f={x:Math.sign(i.x-c.x),y:Math.sign(i.y-c.y)};return{x:{[Qt.Backward]:d.x[Qt.Backward]||f.x===-1,[Qt.Forward]:d.x[Qt.Forward]||f.x===1},y:{[Qt.Backward]:d.y[Qt.Backward]||f.y===-1,[Qt.Forward]:d.y[Qt.Forward]||f.y===1}}},[r,i,c])}function rE(n,i){const r=i!=null?n.get(i):void 0,c=r?r.node.current:null;return Yr(d=>{var f;return i==null?null:(f=c??d)!=null?f:null},[c,i])}function oE(n,i){return p.useMemo(()=>n.reduce((r,c)=>{const{sensor:d}=c,f=d.activators.map(m=>({eventName:m.eventName,handler:i(m.handler,c)}));return[...r,...f]},[]),[n,i])}var Or;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(Or||(Or={}));var Ah;(function(n){n.Optimized="optimized"})(Ah||(Ah={}));const Mv=new Map;function cE(n,i){let{dragging:r,dependencies:c,config:d}=i;const[f,m]=p.useState(null),{frequency:h,measure:g,strategy:v}=d,b=p.useRef(n),x=C(),j=Dr(x),S=p.useCallback(function(z){z===void 0&&(z=[]),!j.current&&m(w=>w===null?z:w.concat(z.filter(O=>!w.includes(O))))},[j]),R=p.useRef(null),k=Yr(z=>{if(x&&!r)return Mv;if(!z||z===Mv||b.current!==n||f!=null){const w=new Map;for(let O of n){if(!O)continue;if(f&&f.length>0&&!f.includes(O.id)&&O.rect.current){w.set(O.id,O.rect.current);continue}const E=O.node.current,M=E?new nm(g(E),E):null;O.rect.current=M,M&&w.set(O.id,M)}return w}return z},[n,f,r,x,g]);return p.useEffect(()=>{b.current=n},[n]),p.useEffect(()=>{x||S()},[r,x]),p.useEffect(()=>{f&&f.length>0&&m(null)},[JSON.stringify(f)]),p.useEffect(()=>{x||typeof h!="number"||R.current!==null||(R.current=setTimeout(()=>{S(),R.current=null},h))},[h,x,S,...c]),{droppableRects:k,measureDroppableContainers:S,measuringScheduled:f!=null};function C(){switch(v){case Or.Always:return!1;case Or.BeforeDragging:return r;default:return!r}}}function im(n,i){return Yr(r=>n?r||(typeof i=="function"?i(n):n):null,[i,n])}function uE(n,i){return im(n,i)}function dE(n){let{callback:i,disabled:r}=n;const c=uu(i),d=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:f}=window;return new f(c)},[c,r]);return p.useEffect(()=>()=>d?.disconnect(),[d]),d}function hu(n){let{callback:i,disabled:r}=n;const c=uu(i),d=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:f}=window;return new f(c)},[r]);return p.useEffect(()=>()=>d?.disconnect(),[d]),d}function fE(n){return new nm(wi(n),n)}function _v(n,i,r){i===void 0&&(i=fE);const[c,d]=p.useState(null);function f(){d(g=>{if(!n)return null;if(n.isConnected===!1){var v;return(v=g??r)!=null?v:null}const b=i(n);return JSON.stringify(g)===JSON.stringify(b)?g:b})}const m=dE({callback(g){if(n)for(const v of g){const{type:b,target:x}=v;if(b==="childList"&&x instanceof HTMLElement&&x.contains(n)){f();break}}}}),h=hu({callback:f});return ya(()=>{f(),n?(h?.observe(n),m?.observe(document.body,{childList:!0,subtree:!0})):(h?.disconnect(),m?.disconnect())},[n]),c}function hE(n){const i=im(n);return S0(n,i)}const Lv=[];function mE(n){const i=p.useRef(n),r=Yr(c=>n?c&&c!==Lv&&n&&i.current&&n.parentNode===i.current.parentNode?c:fu(n):Lv,[n]);return p.useEffect(()=>{i.current=n},[n]),r}function pE(n){const[i,r]=p.useState(null),c=p.useRef(n),d=p.useCallback(f=>{const m=lh(f.target);m&&r(h=>h?(h.set(m,zh(m)),new Map(h)):null)},[]);return p.useEffect(()=>{const f=c.current;if(n!==f){m(f);const h=n.map(g=>{const v=lh(g);return v?(v.addEventListener("scroll",d,{passive:!0}),[v,zh(v)]):null}).filter(g=>g!=null);r(h.length?new Map(h):null),c.current=n}return()=>{m(n),m(f)};function m(h){h.forEach(g=>{const v=lh(g);v?.removeEventListener("scroll",d)})}},[d,n]),p.useMemo(()=>n.length?i?Array.from(i.values()).reduce((f,m)=>mi(f,m),va):D0(n):va,[n,i])}function Uv(n,i){i===void 0&&(i=[]);const r=p.useRef(null);return p.useEffect(()=>{r.current=null},i),p.useEffect(()=>{const c=n!==va;c&&!r.current&&(r.current=n),!c&&r.current&&(r.current=null)},[n]),r.current?Ar(n,r.current):va}function xE(n){p.useEffect(()=>{if(!cu)return;const i=n.map(r=>{let{sensor:c}=r;return c.setup==null?void 0:c.setup()});return()=>{for(const r of i)r?.()}},n.map(i=>{let{sensor:r}=i;return r}))}function gE(n,i){return p.useMemo(()=>n.reduce((r,c)=>{let{eventName:d,handler:f}=c;return r[d]=m=>{f(m,i)},r},{}),[n,i])}function _0(n){return p.useMemo(()=>n?Y3(n):null,[n])}const Hv=[];function yE(n,i){i===void 0&&(i=wi);const[r]=n,c=_0(r?bn(r):null),[d,f]=p.useState(Hv);function m(){f(()=>n.length?n.map(g=>R0(g)?c:new nm(i(g),g)):Hv)}const h=hu({callback:m});return ya(()=>{h?.disconnect(),m(),n.forEach(g=>h?.observe(g))},[n]),d}function L0(n){if(!n)return null;if(n.children.length>1)return n;const i=n.children[0];return Gr(i)?i:n}function vE(n){let{measure:i}=n;const[r,c]=p.useState(null),d=p.useCallback(v=>{for(const{target:b}of v)if(Gr(b)){c(x=>{const j=i(b);return x?{...x,width:j.width,height:j.height}:j});break}},[i]),f=hu({callback:d}),m=p.useCallback(v=>{const b=L0(v);f?.disconnect(),b&&f?.observe(b),c(b?i(b):null)},[i,f]),[h,g]=qc(m);return p.useMemo(()=>({nodeRef:h,rect:r,setRef:g}),[r,h,g])}const bE=[{sensor:lm,options:{}},{sensor:am,options:{}}],jE={current:{}},Dc={draggable:{measure:zv},droppable:{measure:zv,strategy:Or.WhileDragging,frequency:Ah.Optimized},dragOverlay:{measure:wi}};class kr extends Map{get(i){var r;return i!=null&&(r=super.get(i))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(i=>{let{disabled:r}=i;return!r})}getNodeFor(i){var r,c;return(r=(c=this.get(i))==null?void 0:c.node.current)!=null?r:void 0}}const NE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Dc,measureDroppableContainers:Vc,windowRect:null,measuringScheduled:!1},U0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vc,draggableNodes:new Map,over:null,measureDroppableContainers:Vc},Xr=p.createContext(U0),H0=p.createContext(NE);function wE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kr}}}function SE(n,i){switch(i.type){case Bt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:i.initialCoordinates,active:i.active}};case Bt.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:i.coordinates.x-n.draggable.initialCoordinates.x,y:i.coordinates.y-n.draggable.initialCoordinates.y}}};case Bt.DragEnd:case Bt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bt.RegisterDroppable:{const{element:r}=i,{id:c}=r,d=new kr(n.droppable.containers);return d.set(c,r),{...n,droppable:{...n.droppable,containers:d}}}case Bt.SetDroppableDisabled:{const{id:r,key:c,disabled:d}=i,f=n.droppable.containers.get(r);if(!f||c!==f.key)return n;const m=new kr(n.droppable.containers);return m.set(r,{...f,disabled:d}),{...n,droppable:{...n.droppable,containers:m}}}case Bt.UnregisterDroppable:{const{id:r,key:c}=i,d=n.droppable.containers.get(r);if(!d||c!==d.key)return n;const f=new kr(n.droppable.containers);return f.delete(r),{...n,droppable:{...n.droppable,containers:f}}}default:return n}}function kE(n){let{disabled:i}=n;const{active:r,activatorEvent:c,draggableNodes:d}=p.useContext(Xr),f=Gc(c),m=Gc(r?.id);return p.useEffect(()=>{if(!i&&!c&&f&&m!=null){if(!du(f)||document.activeElement===f.target)return;const h=d.get(m);if(!h)return;const{activatorNode:g,node:v}=h;if(!g.current&&!v.current)return;requestAnimationFrame(()=>{for(const b of[g.current,v.current]){if(!b)continue;const x=j3(b);if(x){x.focus();break}}})}},[c,i,d,m,f]),null}function B0(n,i){let{transform:r,...c}=i;return n!=null&&n.length?n.reduce((d,f)=>f({transform:d,...c}),r):r}function CE(n){return p.useMemo(()=>({draggable:{...Dc.draggable,...n?.draggable},droppable:{...Dc.droppable,...n?.droppable},dragOverlay:{...Dc.dragOverlay,...n?.dragOverlay}}),[n?.draggable,n?.droppable,n?.dragOverlay])}function TE(n){let{activeNode:i,measure:r,initialRect:c,config:d=!0}=n;const f=p.useRef(!1),{x:m,y:h}=typeof d=="boolean"?{x:d,y:d}:d;ya(()=>{if(!m&&!h||!i){f.current=!1;return}if(f.current||!c)return;const v=i?.node.current;if(!v||v.isConnected===!1)return;const b=r(v),x=S0(b,c);if(m||(x.x=0),h||(x.y=0),f.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const j=C0(v);j&&j.scrollBy({top:x.y,left:x.x})}},[i,m,h,c,r])}const mu=p.createContext({...va,scaleX:1,scaleY:1});var As;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(As||(As={}));const EE=p.memo(function(i){var r,c,d,f;let{id:m,accessibility:h,autoScroll:g=!0,children:v,sensors:b=bE,collisionDetection:x=U3,measuring:j,modifiers:S,...R}=i;const k=p.useReducer(SE,void 0,wE),[C,z]=k,[w,O]=T3(),[E,M]=p.useState(As.Uninitialized),Y=E===As.Initialized,{draggable:{active:A,nodes:H,translate:W},droppable:{containers:I}}=C,ne=A!=null?H.get(A):null,J=p.useRef({initial:null,translated:null}),Z=p.useMemo(()=>{var Ut;return A!=null?{id:A,data:(Ut=ne?.data)!=null?Ut:jE,rect:J}:null},[A,ne]),ee=p.useRef(null),[ue,K]=p.useState(null),[B,L]=p.useState(null),te=Dr(R,Object.values(R)),de=Vr("DndDescribedBy",m),ke=p.useMemo(()=>I.getEnabled(),[I]),Ne=CE(j),{droppableRects:Ee,measureDroppableContainers:T,measuringScheduled:q}=cE(ke,{dragging:Y,dependencies:[W.x,W.y],config:Ne.droppable}),V=rE(H,A),re=p.useMemo(()=>B?Yc(B):null,[B]),ye=Kr(),Re=uE(V,Ne.draggable.measure);TE({activeNode:A!=null?H.get(A):null,config:ye.layoutShiftCompensation,initialRect:Re,measure:Ne.draggable.measure});const xe=_v(V,Ne.draggable.measure,Re),me=_v(V?V.parentElement:null),ie=p.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:Ee,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Pe=I.getNodeFor((r=ie.current.over)==null?void 0:r.id),Ve=vE({measure:Ne.dragOverlay.measure}),Xe=(c=Ve.nodeRef.current)!=null?c:V,ce=Y?(d=Ve.rect)!=null?d:xe:null,De=!!(Ve.nodeRef.current&&Ve.rect),we=hE(De?null:xe),nt=_0(Xe?bn(Xe):null),rt=mE(Y?Pe??V:null),xt=yE(rt),bt=B0(S,{transform:{x:W.x-we.x,y:W.y-we.y,scaleX:1,scaleY:1},activatorEvent:B,active:Z,activeNodeRect:xe,containerNodeRect:me,draggingNodeRect:ce,over:ie.current.over,overlayNodeRect:Ve.rect,scrollableAncestors:rt,scrollableAncestorRects:xt,windowRect:nt}),zn=re?mi(re,W):null,jn=pE(rt),na=Uv(jn),F=Uv(jn,[xe]),be=mi(bt,na),Ue=ce?$3(ce,bt):null,Dt=Z&&Ue?x({active:Z,collisionRect:Ue,droppableRects:Ee,droppableContainers:ke,pointerCoordinates:zn}):null,aa=w0(Dt,"id"),[Ke,vl]=p.useState(null),bl=De?bt:mi(bt,F),Hs=H3(bl,(f=Ke?.rect)!=null?f:null,xe),Te=p.useRef(null),ut=p.useCallback((Ut,Gt)=>{let{sensor:on,options:sa}=Gt;if(ee.current==null)return;const Nn=H.get(ee.current);if(!Nn)return;const cn=Ut.nativeEvent,an=new on({active:ee.current,activeNode:Nn,event:cn,options:sa,context:ie,onAbort(ft){if(!H.get(ft))return;const{onDragAbort:Gn}=te.current,la={id:ft};Gn?.(la),w({type:"onDragAbort",event:la})},onPending(ft,Nt,Gn,la){if(!H.get(ft))return;const{onDragPending:Na}=te.current,Dn={id:ft,constraint:Nt,initialCoordinates:Gn,offset:la};Na?.(Dn),w({type:"onDragPending",event:Dn})},onStart(ft){const Nt=ee.current;if(Nt==null)return;const Gn=H.get(Nt);if(!Gn)return;const{onDragStart:la}=te.current,Bs={activatorEvent:cn,active:{id:Nt,data:Gn.data,rect:J}};ol.unstable_batchedUpdates(()=>{la?.(Bs),M(As.Initializing),z({type:Bt.DragStart,initialCoordinates:ft,active:Nt}),w({type:"onDragStart",event:Bs}),K(Te.current),L(cn)})},onMove(ft){z({type:Bt.DragMove,coordinates:ft})},onEnd:At(Bt.DragEnd),onCancel:At(Bt.DragCancel)});Te.current=an;function At(ft){return async function(){const{active:Gn,collisions:la,over:Bs,scrollAdjustedTranslate:Na}=ie.current;let Dn=null;if(Gn&&Na){const{cancelDrop:wa}=te.current;Dn={activatorEvent:cn,active:Gn,collisions:la,delta:Na,over:Bs},ft===Bt.DragEnd&&typeof wa=="function"&&await Promise.resolve(wa(Dn))&&(ft=Bt.DragCancel)}ee.current=null,ol.unstable_batchedUpdates(()=>{z({type:ft}),M(As.Uninitialized),vl(null),K(null),L(null),Te.current=null;const wa=ft===Bt.DragEnd?"onDragEnd":"onDragCancel";if(Dn){const ia=te.current[wa];ia?.(Dn),w({type:wa,event:Dn})}})}}},[H]),Rt=p.useCallback((Ut,Gt)=>(on,sa)=>{const Nn=on.nativeEvent,cn=H.get(sa);if(ee.current!==null||!cn||Nn.dndKit||Nn.defaultPrevented)return;const an={active:cn};Ut(on,Gt.options,an)===!0&&(Nn.dndKit={capturedBy:Gt.sensor},ee.current=sa,ut(on,Gt))},[H,ut]),jt=oE(b,Rt);xE(b),ya(()=>{xe&&E===As.Initializing&&M(As.Initialized)},[xe,E]),p.useEffect(()=>{const{onDragMove:Ut}=te.current,{active:Gt,activatorEvent:on,collisions:sa,over:Nn}=ie.current;if(!Gt||!on)return;const cn={active:Gt,activatorEvent:on,collisions:sa,delta:{x:be.x,y:be.y},over:Nn};ol.unstable_batchedUpdates(()=>{Ut?.(cn),w({type:"onDragMove",event:cn})})},[be.x,be.y]),p.useEffect(()=>{const{active:Ut,activatorEvent:Gt,collisions:on,droppableContainers:sa,scrollAdjustedTranslate:Nn}=ie.current;if(!Ut||ee.current==null||!Gt||!Nn)return;const{onDragOver:cn}=te.current,an=sa.get(aa),At=an&&an.rect.current?{id:an.id,rect:an.rect.current,data:an.data,disabled:an.disabled}:null,ft={active:Ut,activatorEvent:Gt,collisions:on,delta:{x:Nn.x,y:Nn.y},over:At};ol.unstable_batchedUpdates(()=>{vl(At),cn?.(ft),w({type:"onDragOver",event:ft})})},[aa]),ya(()=>{ie.current={activatorEvent:B,active:Z,activeNode:V,collisionRect:Ue,collisions:Dt,droppableRects:Ee,draggableNodes:H,draggingNode:Xe,draggingNodeRect:ce,droppableContainers:I,over:Ke,scrollableAncestors:rt,scrollAdjustedTranslate:be},J.current={initial:ce,translated:Ue}},[Z,V,Dt,Ue,H,Xe,ce,Ee,I,Ke,rt,be]),sE({...ye,delta:W,draggingRect:Ue,pointerCoordinates:zn,scrollableAncestors:rt,scrollableAncestorRects:xt});const Ze=p.useMemo(()=>({active:Z,activeNode:V,activeNodeRect:xe,activatorEvent:B,collisions:Dt,containerNodeRect:me,dragOverlay:Ve,draggableNodes:H,droppableContainers:I,droppableRects:Ee,over:Ke,measureDroppableContainers:T,scrollableAncestors:rt,scrollableAncestorRects:xt,measuringConfiguration:Ne,measuringScheduled:q,windowRect:nt}),[Z,V,xe,B,Dt,me,Ve,H,I,Ee,Ke,T,rt,xt,Ne,q,nt]),It=p.useMemo(()=>({activatorEvent:B,activators:jt,active:Z,activeNodeRect:xe,ariaDescribedById:{draggable:de},dispatch:z,draggableNodes:H,over:Ke,measureDroppableContainers:T}),[B,jt,Z,xe,z,de,H,Ke,T]);return yt.createElement(b0.Provider,{value:O},yt.createElement(Xr.Provider,{value:It},yt.createElement(H0.Provider,{value:Ze},yt.createElement(mu.Provider,{value:Hs},v)),yt.createElement(kE,{disabled:h?.restoreFocus===!1})),yt.createElement(z3,{...h,hiddenTextDescribedById:de}));function Kr(){const Ut=ue?.autoScrollEnabled===!1,Gt=typeof g=="object"?g.enabled===!1:g===!1,on=Y&&!Ut&&!Gt;return typeof g=="object"?{...g,enabled:on}:{enabled:on}}}),RE=p.createContext(null),Bv="button",zE="Draggable";function DE(n){let{id:i,data:r,disabled:c=!1,attributes:d}=n;const f=Vr(zE),{activators:m,activatorEvent:h,active:g,activeNodeRect:v,ariaDescribedById:b,draggableNodes:x,over:j}=p.useContext(Xr),{role:S=Bv,roleDescription:R="draggable",tabIndex:k=0}=d??{},C=g?.id===i,z=p.useContext(C?mu:RE),[w,O]=qc(),[E,M]=qc(),Y=gE(m,i),A=Dr(r);ya(()=>(x.set(i,{id:i,key:f,node:w,activatorNode:E,data:A}),()=>{const W=x.get(i);W&&W.key===f&&x.delete(i)}),[x,i]);const H=p.useMemo(()=>({role:S,tabIndex:k,"aria-disabled":c,"aria-pressed":C&&S===Bv?!0:void 0,"aria-roledescription":R,"aria-describedby":b.draggable}),[c,S,k,C,R,b.draggable]);return{active:g,activatorEvent:h,activeNodeRect:v,attributes:H,isDragging:C,listeners:c?void 0:Y,node:w,over:j,setNodeRef:O,setActivatorNodeRef:M,transform:z}}function $0(){return p.useContext(H0)}const AE="Droppable",OE={timeout:25};function ME(n){let{data:i,disabled:r=!1,id:c,resizeObserverConfig:d}=n;const f=Vr(AE),{active:m,dispatch:h,over:g,measureDroppableContainers:v}=p.useContext(Xr),b=p.useRef({disabled:r}),x=p.useRef(!1),j=p.useRef(null),S=p.useRef(null),{disabled:R,updateMeasurementsFor:k,timeout:C}={...OE,...d},z=Dr(k??c),w=p.useCallback(()=>{if(!x.current){x.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{v(Array.isArray(z.current)?z.current:[z.current]),S.current=null},C)},[C]),O=hu({callback:w,disabled:R||!m}),E=p.useCallback((H,W)=>{O&&(W&&(O.unobserve(W),x.current=!1),H&&O.observe(H))},[O]),[M,Y]=qc(E),A=Dr(i);return p.useEffect(()=>{!O||!M.current||(O.disconnect(),x.current=!1,O.observe(M.current))},[M,O]),p.useEffect(()=>(h({type:Bt.RegisterDroppable,element:{id:c,key:f,disabled:r,node:M,rect:j,data:A}}),()=>h({type:Bt.UnregisterDroppable,key:f,id:c})),[c]),p.useEffect(()=>{r!==b.current.disabled&&(h({type:Bt.SetDroppableDisabled,id:c,key:f,disabled:r}),b.current.disabled=r)},[c,f,r,h]),{active:m,rect:j,isOver:g?.id===c,node:M,over:g,setNodeRef:Y}}function _E(n){let{animation:i,children:r}=n;const[c,d]=p.useState(null),[f,m]=p.useState(null),h=Gc(r);return!r&&!c&&h&&d(h),ya(()=>{if(!f)return;const g=c?.key,v=c?.props.id;if(g==null||v==null){d(null);return}Promise.resolve(i(v,f)).then(()=>{d(null)})},[i,c,f]),yt.createElement(yt.Fragment,null,r,c?p.cloneElement(c,{ref:m}):null)}const LE={x:0,y:0,scaleX:1,scaleY:1};function UE(n){let{children:i}=n;return yt.createElement(Xr.Provider,{value:U0},yt.createElement(mu.Provider,{value:LE},i))}const HE={position:"fixed",touchAction:"none"},BE=n=>du(n)?"transform 250ms ease":void 0,$E=p.forwardRef((n,i)=>{let{as:r,activatorEvent:c,adjustScale:d,children:f,className:m,rect:h,style:g,transform:v,transition:b=BE}=n;if(!h)return null;const x=d?v:{...v,scaleX:1,scaleY:1},j={...HE,width:h.width,height:h.height,top:h.top,left:h.left,transform:Ls.Transform.toString(x),transformOrigin:d&&c?A3(c,h):void 0,transition:typeof b=="function"?b(c):b,...g};return yt.createElement(r,{className:m,style:j,ref:i},f)}),qE=n=>i=>{let{active:r,dragOverlay:c}=i;const d={},{styles:f,className:m}=n;if(f!=null&&f.active)for(const[h,g]of Object.entries(f.active))g!==void 0&&(d[h]=r.node.style.getPropertyValue(h),r.node.style.setProperty(h,g));if(f!=null&&f.dragOverlay)for(const[h,g]of Object.entries(f.dragOverlay))g!==void 0&&c.node.style.setProperty(h,g);return m!=null&&m.active&&r.node.classList.add(m.active),m!=null&&m.dragOverlay&&c.node.classList.add(m.dragOverlay),function(){for(const[g,v]of Object.entries(d))r.node.style.setProperty(g,v);m!=null&&m.active&&r.node.classList.remove(m.active)}},GE=n=>{let{transform:{initial:i,final:r}}=n;return[{transform:Ls.Transform.toString(i)},{transform:Ls.Transform.toString(r)}]},YE={duration:250,easing:"ease",keyframes:GE,sideEffects:qE({styles:{active:{opacity:"0"}}})};function VE(n){let{config:i,draggableNodes:r,droppableContainers:c,measuringConfiguration:d}=n;return uu((f,m)=>{if(i===null)return;const h=r.get(f);if(!h)return;const g=h.node.current;if(!g)return;const v=L0(m);if(!v)return;const{transform:b}=bn(m).getComputedStyle(m),x=k0(b);if(!x)return;const j=typeof i=="function"?i:XE(i);return A0(g,d.draggable.measure),j({active:{id:f,data:h.data,node:g,rect:d.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:m,rect:d.dragOverlay.measure(v)},droppableContainers:c,measuringConfiguration:d,transform:x})})}function XE(n){const{duration:i,easing:r,sideEffects:c,keyframes:d}={...YE,...n};return f=>{let{active:m,dragOverlay:h,transform:g,...v}=f;if(!i)return;const b={x:h.rect.left-m.rect.left,y:h.rect.top-m.rect.top},x={scaleX:g.scaleX!==1?m.rect.width*g.scaleX/h.rect.width:1,scaleY:g.scaleY!==1?m.rect.height*g.scaleY/h.rect.height:1},j={x:g.x-b.x,y:g.y-b.y,...x},S=d({...v,active:m,dragOverlay:h,transform:{initial:g,final:j}}),[R]=S,k=S[S.length-1];if(JSON.stringify(R)===JSON.stringify(k))return;const C=c?.({active:m,dragOverlay:h,...v}),z=h.node.animate(S,{duration:i,easing:r,fill:"forwards"});return new Promise(w=>{z.onfinish=()=>{C?.(),w()}})}}let $v=0;function KE(n){return p.useMemo(()=>{if(n!=null)return $v++,$v},[n])}const ZE=yt.memo(n=>{let{adjustScale:i=!1,children:r,dropAnimation:c,style:d,transition:f,modifiers:m,wrapperElement:h="div",className:g,zIndex:v=999}=n;const{activatorEvent:b,active:x,activeNodeRect:j,containerNodeRect:S,draggableNodes:R,droppableContainers:k,dragOverlay:C,over:z,measuringConfiguration:w,scrollableAncestors:O,scrollableAncestorRects:E,windowRect:M}=$0(),Y=p.useContext(mu),A=KE(x?.id),H=B0(m,{activatorEvent:b,active:x,activeNodeRect:j,containerNodeRect:S,draggingNodeRect:C.rect,over:z,overlayNodeRect:C.rect,scrollableAncestors:O,scrollableAncestorRects:E,transform:Y,windowRect:M}),W=im(j),I=VE({config:c,draggableNodes:R,droppableContainers:k,measuringConfiguration:w}),ne=W?C.setRef:void 0;return yt.createElement(UE,null,yt.createElement(_E,{animation:I},x&&A?yt.createElement($E,{key:A,id:x.id,ref:ne,as:h,activatorEvent:b,adjustScale:i,className:g,transition:f,rect:W,style:{zIndex:v,...d},transform:H},r):null))});function QE(n,i,r){const c={...n};return i.top+n.y<=r.top?c.y=r.top-i.top:i.bottom+n.y>=r.top+r.height&&(c.y=r.top+r.height-i.bottom),i.left+n.x<=r.left?c.x=r.left-i.left:i.right+n.x>=r.left+r.width&&(c.x=r.left+r.width-i.right),c}const IE=n=>{let{containerNodeRect:i,draggingNodeRect:r,transform:c}=n;return!r||!i?c:QE(c,r,i)},PE=n=>{let{transform:i}=n;return{...i,x:0}};function rm(n,i,r){const c=n.slice();return c.splice(r<0?c.length+r:r,0,c.splice(i,1)[0]),c}function FE(n,i){return n.reduce((r,c,d)=>{const f=i.get(c);return f&&(r[d]=f),r},Array(n.length))}function wc(n){return n!==null&&n>=0}function JE(n,i){if(n===i)return!0;if(n.length!==i.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==i[r])return!1;return!0}function WE(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const q0=n=>{let{rects:i,activeIndex:r,overIndex:c,index:d}=n;const f=rm(i,c,r),m=i[d],h=f[d];return!h||!m?null:{x:h.left-m.left,y:h.top-m.top,scaleX:h.width/m.width,scaleY:h.height/m.height}},Sc={scaleX:1,scaleY:1},e4=n=>{var i;let{activeIndex:r,activeNodeRect:c,index:d,rects:f,overIndex:m}=n;const h=(i=f[r])!=null?i:c;if(!h)return null;if(d===r){const v=f[m];return v?{x:0,y:r<m?v.top+v.height-(h.top+h.height):v.top-h.top,...Sc}:null}const g=t4(f,d,r);return d>r&&d<=m?{x:0,y:-h.height-g,...Sc}:d<r&&d>=m?{x:0,y:h.height+g,...Sc}:{x:0,y:0,...Sc}};function t4(n,i,r){const c=n[i],d=n[i-1],f=n[i+1];return c?r<i?d?c.top-(d.top+d.height):f?f.top-(c.top+c.height):0:f?f.top-(c.top+c.height):d?c.top-(d.top+d.height):0:0}const G0="Sortable",Y0=yt.createContext({activeIndex:-1,containerId:G0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:q0,disabled:{draggable:!1,droppable:!1}});function n4(n){let{children:i,id:r,items:c,strategy:d=q0,disabled:f=!1}=n;const{active:m,dragOverlay:h,droppableRects:g,over:v,measureDroppableContainers:b}=$0(),x=Vr(G0,r),j=h.rect!==null,S=p.useMemo(()=>c.map(Y=>typeof Y=="object"&&"id"in Y?Y.id:Y),[c]),R=m!=null,k=m?S.indexOf(m.id):-1,C=v?S.indexOf(v.id):-1,z=p.useRef(S),w=!JE(S,z.current),O=C!==-1&&k===-1||w,E=WE(f);ya(()=>{w&&R&&b(S)},[w,S,R,b]),p.useEffect(()=>{z.current=S},[S]);const M=p.useMemo(()=>({activeIndex:k,containerId:x,disabled:E,disableTransforms:O,items:S,overIndex:C,useDragOverlay:j,sortedRects:FE(S,g),strategy:d}),[k,x,E.draggable,E.droppable,O,S,C,g,j,d]);return yt.createElement(Y0.Provider,{value:M},i)}const a4=n=>{let{id:i,items:r,activeIndex:c,overIndex:d}=n;return rm(r,c,d).indexOf(i)},s4=n=>{let{containerId:i,isSorting:r,wasDragging:c,index:d,items:f,newIndex:m,previousItems:h,previousContainerId:g,transition:v}=n;return!v||!c||h!==f&&d===m?!1:r?!0:m!==d&&i===g},l4={duration:200,easing:"ease"},V0="transform",i4=Ls.Transition.toString({property:V0,duration:0,easing:"linear"}),r4={roleDescription:"sortable"};function o4(n){let{disabled:i,index:r,node:c,rect:d}=n;const[f,m]=p.useState(null),h=p.useRef(r);return ya(()=>{if(!i&&r!==h.current&&c.current){const g=d.current;if(g){const v=wi(c.current,{ignoreTransform:!0}),b={x:g.left-v.left,y:g.top-v.top,scaleX:g.width/v.width,scaleY:g.height/v.height};(b.x||b.y)&&m(b)}}r!==h.current&&(h.current=r)},[i,r,c,d]),p.useEffect(()=>{f&&m(null)},[f]),f}function c4(n){let{animateLayoutChanges:i=s4,attributes:r,disabled:c,data:d,getNewIndex:f=a4,id:m,strategy:h,resizeObserverConfig:g,transition:v=l4}=n;const{items:b,containerId:x,activeIndex:j,disabled:S,disableTransforms:R,sortedRects:k,overIndex:C,useDragOverlay:z,strategy:w}=p.useContext(Y0),O=u4(c,S),E=b.indexOf(m),M=p.useMemo(()=>({sortable:{containerId:x,index:E,items:b},...d}),[x,d,E,b]),Y=p.useMemo(()=>b.slice(b.indexOf(m)),[b,m]),{rect:A,node:H,isOver:W,setNodeRef:I}=ME({id:m,data:M,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:Y,...g}}),{active:ne,activatorEvent:J,activeNodeRect:Z,attributes:ee,setNodeRef:ue,listeners:K,isDragging:B,over:L,setActivatorNodeRef:te,transform:de}=DE({id:m,data:M,attributes:{...r4,...r},disabled:O.draggable}),ke=g3(I,ue),Ne=!!ne,Ee=Ne&&!R&&wc(j)&&wc(C),T=!z&&B,q=T&&Ee?de:null,re=Ee?q??(h??w)({rects:k,activeNodeRect:Z,activeIndex:j,overIndex:C,index:E}):null,ye=wc(j)&&wc(C)?f({id:m,items:b,activeIndex:j,overIndex:C}):E,Re=ne?.id,xe=p.useRef({activeId:Re,items:b,newIndex:ye,containerId:x}),me=b!==xe.current.items,ie=i({active:ne,containerId:x,isDragging:B,isSorting:Ne,id:m,index:E,items:b,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:v,wasDragging:xe.current.activeId!=null}),Pe=o4({disabled:!ie,index:E,node:H,rect:A});return p.useEffect(()=>{Ne&&xe.current.newIndex!==ye&&(xe.current.newIndex=ye),x!==xe.current.containerId&&(xe.current.containerId=x),b!==xe.current.items&&(xe.current.items=b)},[Ne,ye,x,b]),p.useEffect(()=>{if(Re===xe.current.activeId)return;if(Re!=null&&xe.current.activeId==null){xe.current.activeId=Re;return}const Xe=setTimeout(()=>{xe.current.activeId=Re},50);return()=>clearTimeout(Xe)},[Re]),{active:ne,activeIndex:j,attributes:ee,data:M,rect:A,index:E,newIndex:ye,items:b,isOver:W,isSorting:Ne,isDragging:B,listeners:K,node:H,overIndex:C,over:L,setNodeRef:ke,setActivatorNodeRef:te,setDroppableNodeRef:I,setDraggableNodeRef:ue,transform:Pe??re,transition:Ve()};function Ve(){if(Pe||me&&xe.current.newIndex===E)return i4;if(!(T&&!du(J)||!v)&&(Ne||ie))return Ls.Transition.toString({...v,property:V0})}}function u4(n,i){var r,c;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(r=n?.draggable)!=null?r:i.draggable,droppable:(c=n?.droppable)!=null?c:i.droppable}}function Kc(n){if(!n)return!1;const i=n.data.current;return!!(i&&"sortable"in i&&typeof i.sortable=="object"&&"containerId"in i.sortable&&"items"in i.sortable&&"index"in i.sortable)}const d4=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],f4=(n,i)=>{let{context:{active:r,collisionRect:c,droppableRects:d,droppableContainers:f,over:m,scrollableAncestors:h}}=i;if(d4.includes(n.code)){if(n.preventDefault(),!r||!c)return;const g=[];f.getEnabled().forEach(x=>{if(!x||x!=null&&x.disabled)return;const j=d.get(x.id);if(j)switch(n.code){case Ie.Down:c.top<j.top&&g.push(x);break;case Ie.Up:c.top>j.top&&g.push(x);break;case Ie.Left:c.left>j.left&&g.push(x);break;case Ie.Right:c.left<j.left&&g.push(x);break}});const v=_3({collisionRect:c,droppableRects:d,droppableContainers:g});let b=w0(v,"id");if(b===m?.id&&v.length>1&&(b=v[1].id),b!=null){const x=f.get(r.id),j=f.get(b),S=j?d.get(j.id):null,R=j?.node.current;if(R&&S&&x&&j){const C=fu(R).some((Y,A)=>h[A]!==Y),z=X0(x,j),w=h4(x,j),O=C||!z?{x:0,y:0}:{x:w?c.width-S.width:0,y:w?c.height-S.height:0},E={x:S.left,y:S.top};return O.x&&O.y?E:Ar(E,O)}}}};function X0(n,i){return!Kc(n)||!Kc(i)?!1:n.data.current.sortable.containerId===i.data.current.sortable.containerId}function h4(n,i){return!Kc(n)||!Kc(i)||!X0(n,i)?!1:n.data.current.sortable.index<i.data.current.sortable.index}const m4={draggable:"To pick up a step, press Space or Enter. Use the arrow keys to move it, Space or Enter to drop it, Escape to cancel."};function p4(){const[n,i]=p.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return p.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)"),c=()=>i(r.matches);return r.addEventListener("change",c),()=>r.removeEventListener("change",c)},[]),n}function K0(n){return n.run.trim()||"new step"}function x4(n){return p0.find(i=>i.value===n)?.label??n}function g4({step:n,index:i,total:r,error:c,disabled:d,reducedMotion:f,registerRow:m,registerHandle:h,onChange:g,onRemove:v,onMove:b}){const{attributes:x,listeners:j,setNodeRef:S,setActivatorNodeRef:R,transform:k,transition:C,isDragging:z}=c4({id:n.key,disabled:d}),w=n.enabled!==!1,O=K0(n);return a.jsx("li",{ref:E=>{S(E),m(n.key,E)},style:{transform:Ls.Transform.toString(k),transition:f?void 0:C},tabIndex:-1,className:oe("rounded-md border p-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",z?"border-dashed border-line bg-raised/20":"border-line bg-raised/40"),children:a.jsxs("div",{className:oe("flex items-start gap-2",z&&"invisible"),children:[a.jsx("button",{ref:E=>{R(E),h(n.key,E)},type:"button","aria-label":`Reorder step ${i+1}: ${O}`,title:"Drag to reorder",disabled:d,className:"mt-2 inline-flex size-6 shrink-0 touch-none cursor-grab items-center justify-center rounded-sm text-faint transition-colors hover:bg-inset hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 active:cursor-grabbing disabled:cursor-not-allowed",...x,...j,children:a.jsx(Ab,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsxs("div",{className:oe("flex flex-wrap items-center gap-2",!w&&"opacity-60"),children:[a.jsxs("span",{className:"text-2xs font-medium text-faint",children:["Step ",i+1]}),a.jsx("span",{className:"min-w-0 truncate font-mono text-2xs text-muted",children:n.run.trim()||"New step"}),!w&&a.jsx(je,{tone:"neutral",children:"Skipped"})]}),a.jsx("div",{className:oe(!w&&"opacity-60"),children:a.jsx(Me,{"aria-label":`Step ${i+1} command`,value:n.run,onChange:E=>g({run:E.target.value}),error:c,placeholder:"npm ci",className:"font-mono",spellCheck:!1,autoComplete:"off",disabled:d})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2",children:[a.jsx(pa,{"aria-label":`Step ${i+1} kind`,value:n.kind,onChange:E=>g({kind:E.target.value}),className:oe("w-28 shrink-0",!w&&"opacity-60"),disabled:d,children:p0.map(E=>a.jsx("option",{value:E.value,children:E.label},E.value))}),a.jsx(Zt,{label:w?"On":"Off",ariaLabel:`Step ${i+1} (${O}) ${w?"enabled":"disabled"}`,checked:w,onChange:E=>g({enabled:E}),disabled:d,className:"min-w-36 flex-1 items-center [&>div>div]:text-xs"}),a.jsxs("div",{className:oe("flex shrink-0 items-center gap-1",!w&&"opacity-60"),children:[a.jsx(ct,{label:`Move step ${i+1} up`,size:"sm",onClick:()=>b(i-1),disabled:d||i===0,children:a.jsx($w,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Move step ${i+1} down`,size:"sm",onClick:()=>b(i+1),disabled:d||i===r-1,children:a.jsx(Eb,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Remove step ${i+1}`,size:"sm",variant:"dangerGhost",onClick:v,disabled:d,children:a.jsx(Us,{className:"size-4","aria-hidden":"true"})})]})]}),n.kind==="migrate"&&a.jsx("p",{className:oe("text-2xs text-warn",!w&&"opacity-60"),children:"Forward-only: a rollback does not undo a migration that has already run."})]})]})})}function y4({step:n,index:i,reducedMotion:r}){const c=n.enabled!==!1;return a.jsx("div",{className:"cursor-grabbing rounded-md border border-line-strong bg-surface p-3 shadow-pop",style:{transform:r?void 0:"scale(1.02)"},children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"mt-2 inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-faint",children:a.jsx(Ab,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{className:"text-2xs font-medium text-faint",children:["Step ",i+1]}),a.jsx("span",{className:"min-w-0 truncate font-mono text-2xs text-muted",children:n.run.trim()||"New step"}),!c&&a.jsx(je,{tone:"neutral",children:"Skipped"})]}),a.jsx("div",{className:"truncate rounded-md border border-line bg-canvas px-3 py-1.5 font-mono text-sm text-ink",children:n.run.trim()||"npm ci"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-2xs text-muted",children:[a.jsx("span",{children:x4(n.kind)}),a.jsx("span",{children:c?"On":"Off"})]})]})]})})}function v4({steps:n,onChange:i,errors:r,apiWarnings:c=[],disabled:d}){const[f,m]=p.useState(null),[h,g]=p.useState(null),[v,b]=p.useState(""),[x,j]=p.useState(null),S=p.useRef(new Map),R=p.useRef(new Map),k=p.useRef(n);k.current=n;const C=p4(),z=D3(sh(lm,{activationConstraint:{distance:4}}),sh(M0,{activationConstraint:{delay:150,tolerance:5}}),sh(am,{coordinateGetter:f4}));p.useEffect(()=>{f&&(S.current.get(f)?.focus(),m(null))},[f,n]),p.useEffect(()=>{h&&(R.current.get(h)?.focus(),g(null))},[h,n]),p.useEffect(()=>{if(!x)return;const B=L=>{L.key==="Escape"&&L.preventDefault()};return window.addEventListener("keydown",B,!0),()=>window.removeEventListener("keydown",B,!0)},[x]);const w=n.length>=jc,O=B=>{const L=k.current.find(te=>te.key===B);return L?K0(L):"this step"},E=B=>{const L=k.current.findIndex(te=>te.key===B);return L===-1?1:L+1},M={onDragStart:({active:B})=>`Picked up step ${O(B.id)}. It is in position ${E(B.id)} of ${k.current.length}.`,onDragOver:({active:B,over:L})=>`Step ${O(B.id)} moved to position ${E(L?.id??B.id)} of ${k.current.length}.`,onDragEnd:({active:B,over:L})=>`Step ${O(B.id)} dropped at position ${E(L?.id??B.id)} of ${k.current.length}.`,onDragCancel:({active:B})=>`Reordering cancelled. Step ${O(B.id)} returned to position ${E(B.id)} of ${k.current.length}.`},Y=(B,L)=>{if(L<0||L>=n.length||B===L)return;const te=[...n],[de]=te.splice(B,1);te.splice(L,0,de),m(de.key),b(`Step ${B+1} moved to position ${L+1}.`),i(te)},A=(B,L)=>{i(n.map((te,de)=>de===B?{...te,...L}:te))},H=B=>{b(`Step ${B+1} removed.`),i(n.filter((L,te)=>te!==B))},W=()=>{w||i([...n,{key:`step-${Date.now()}-${n.length}`,run:"",kind:"custom",enabled:!0}])},I=B=>{j(String(B.active.id))},ne=B=>{const{active:L,over:te}=B;if(j(null),!te||L.id===te.id)return;const de=n.findIndex(Ne=>Ne.key===L.id),ke=n.findIndex(Ne=>Ne.key===te.id);de===-1||ke===-1||de===ke||(g(String(L.id)),b(`Step ${de+1} moved to position ${ke+1}.`),i(rm(n,de,ke)))},J=()=>j(null),Z=AT(n),ee=[...Z,...c.filter(B=>!Z.includes(B))],ue=n.findIndex(B=>B.key===x),K=ue===-1?null:n[ue];return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Steps"}),a.jsxs("span",{className:"text-2xs text-faint",children:[n.length,"/",jc," steps",w?" — remove one to add another.":""]})]}),n.length===0?a.jsx("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:"No steps. Only the start command runs; nothing is installed, built or migrated."}):a.jsxs(EE,{sensors:z,collisionDetection:M3,modifiers:[PE,IE],accessibility:{announcements:M,screenReaderInstructions:m4},onDragStart:I,onDragEnd:ne,onDragCancel:J,children:[a.jsx(n4,{items:n.map(B=>B.key),strategy:e4,children:a.jsx("ul",{className:"space-y-2",children:n.map((B,L)=>a.jsx(g4,{step:B,index:L,total:n.length,error:r?.[L]??null,disabled:d,reducedMotion:C,registerRow:(te,de)=>{de?S.current.set(te,de):S.current.delete(te)},registerHandle:(te,de)=>{de?R.current.set(te,de):R.current.delete(te)},onChange:te=>A(L,te),onRemove:()=>H(L),onMove:te=>Y(L,te)},B.key))})}),ol.createPortal(a.jsx(ZE,{dropAnimation:C?null:void 0,children:K&&a.jsx(y4,{step:K,index:ue,reducedMotion:C})}),document.body)]}),ee.map(B=>a.jsx(ve,{tone:"warning",children:B},B)),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(se,{size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,disabled:d||w,title:w?`At most ${jc} steps. Remove one to add another.`:void 0,children:"Add step"}),w&&a.jsxs("span",{className:"text-2xs text-faint",children:["At most ",jc," steps."]})]}),a.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:v})]})}function qv(n){return{id:"",repoUrl:"",branch:"main",authType:"none",token:"",generateKey:!0,settings:x0({}),envText:"",keepReleases:String(n),autoRollback:!0,notifyChannelIds:[]}}function b4(n){return{id:n.id,repoUrl:n.repoUrl,branch:n.branch,authType:n.authType,token:"",generateKey:!0,settings:x0(n.settings,{execMode:n.execMode,instances:n.instances}),envText:TT(n.env),keepReleases:String(n.keepReleases),autoRollback:n.autoRollback,notifyChannelIds:n.notifyChannelIds}}function j4(n){const i=n.deployKey;return i&&typeof i=="object"&&typeof i.publicKey=="string"?i:typeof i=="string"&&i?{publicKey:i,fingerprint:n.deployKeyFingerprint??"",createdAt:n.deployKeyCreatedAt??"",addUrl:h0(n.repoUrl)}:null}function Gv(n,i){return n instanceof He||n instanceof Error?n.message:i}function fi({overridden:n,note:i,onClear:r,onOverride:c,overrideLabel:d="Override"}){return a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1 text-2xs text-faint",children:[a.jsx("span",{children:n?a.jsxs(a.Fragment,{children:["Override — ",i]}):i}),n?a.jsx("button",{type:"button",onClick:r,className:"rounded-sm font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:"Use ez.json / default"}):c?a.jsx("button",{type:"button",onClick:c,className:"rounded-sm font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:d}):null]})}function N4({open:n,app:i,meta:r,onClose:c,onSaved:d,onCreated:f,onDeployNow:m,onRefresh:h}){const g=Et(),v=rn(),b=i!==null,[x,j]=p.useState(()=>qv(r.limits.keepReleasesDefault)),[S,R]=p.useState(!1),[k,C]=p.useState(!1),[z,w]=p.useState(null),[O,E]=p.useState(null),[M,Y]=p.useState(!1),[A,H]=p.useState(null);p.useEffect(()=>{if(!n)return;const ce=i?b4(i):qv(r.limits.keepReleasesDefault);j(ce),H(f3(ce.settings.steps,ce.settings.start)),E(null),R(!1),w(null)},[n,i?.id]);const W=ce=>{w(null),j(De=>({...De,...ce}))},I=ce=>{w(null),j(De=>({...De,settings:{...De.settings,...ce}}))},ne=ce=>{const De=zc(ce);I({steps:m0(De.steps),stepsOverride:!0,start:De.start,startOverride:!0}),H(ce)},J=async ce=>{const De=A?zc(A):{start:"",steps:[]},we=!Rh(x.settings.steps,x.settings.start,De.steps,De.start);ce===A&&!we||we&&!await v({title:"Replace the current steps?",body:`Your edited steps will be replaced by the ${Cv(ce)??"Custom"} preset.`,confirmLabel:"Replace",cancelLabel:"Keep my steps",tone:"accent"})||ne(ce)},Z=A?zc(A):null,ee=Z!==null&&!Rh(x.settings.steps,x.settings.start,Z.steps,Z.start),ue=()=>I({steps:[],stepsOverride:!1}),K=()=>I({start:"",startOverride:!1}),B=()=>I({runtime:"node",runtimeOverride:!1}),L=()=>I({execMode:i?.execMode??"fork",execModeOverride:!1}),te=()=>I({instances:i?.instances!==void 0?String(i.instances):"",instancesOverride:!1}),de=x.repoUrl.trim(),ke=kT(de),Ne=CT(x.envText),Ee=Number(x.keepReleases),T={id:b?null:ST(x.id.trim()),repoUrl:de?x.authType==="token"&&ke?"Token access needs an https:// URL.":x.authType==="deployKey"&&!ke?"A deploy key needs an SSH URL, like git@github.com:owner/repo.git.":null:"A repository URL is required.",token:x.authType==="token"&&!x.token.trim()&&!(b&&i?.hasToken)?"A token is required.":null,port:x.settings.port.trim()?su(x.settings.port):null,healthPath:x.settings.healthPath.trim()&&!x.settings.healthPath.trim().startsWith("/")?'Must start with "/".':null,start:x.settings.startOverride&&!x.settings.start.trim()?"A start command is required while this app overrides it.":null,env:Ne.error,keepReleases:!Number.isInteger(Ee)||Ee<r.limits.keepReleasesMin||Ee>r.limits.keepReleasesMax?`A whole number from ${r.limits.keepReleasesMin} to ${r.limits.keepReleasesMax}.`:null,instances:(()=>{const ce=x.settings.instances.trim();return!ce||ce==="max"||/^\d+$/.test(ce)&&Number(ce)>=1?null:'A whole number from 1 to this server’s CPU count, or "max".'})()},q=x.settings.stepsOverride?x.settings.steps.map(ce=>ce.run.trim()?null:"A command is required."):[],V=Object.values(T).some(Boolean)||q.some(Boolean),re=UT(x.settings.start),ye=x.settings.execMode==="cluster"&&re===!1,Re=x.settings.execMode==="fork"&&Number(x.settings.instances)>1,xe=(i?.warnings??[]).filter(ce=>!wv(ce)&&!(x.settings.execMode==="cluster"&&ce===Sv)),me=(i?.warnings??[]).filter(wv),ie=b&&i.settings.steps===void 0&&(i.settings.install!==void 0||i.settings.build!==void 0||i.settings.migrate!==void 0),Pe=async()=>{if(k||(R(!0),V))return;const ce={repoUrl:de,branch:x.branch.trim()||"main",authType:x.authType,settings:LT(x.settings),env:Ne.env,keepReleases:Ee,autoRollback:x.autoRollback,notifyChannelIds:x.notifyChannelIds};x.token.trim()&&(ce.token=x.token.trim()),!b&&x.authType==="deployKey"&&(ce.generateKey=x.generateKey),C(!0),w(null);try{if(b){const nt=await fe.deployments.update(i.id,ce);d(nt,!1);return}const De=await fe.deployments.create({...ce,id:x.id.trim()}),we=j4(De);if(x.authType==="deployKey"&&x.generateKey){const nt={...De,deployKey:we?.publicKey??null};E({app:nt,key:we,keyError:we?null:De.deployKeyError??"The key was not generated."}),f?.(nt);return}d(De,!0)}catch(De){w(Gv(De,"Nothing was changed."))}finally{C(!1)}},Ve=async()=>{if(!(!O||M)){Y(!0);try{await fe.deployments.deploy(O.app.id),g.success(`${O.app.id} is deploying`,"Its log is in the Deployments tab."),m?.(O.app.id)}catch(ce){g.error("Could not start the deployment",Gv(ce,"Nothing was started."))}finally{Y(!1)}}},Xe=ce=>S?T[ce]:null;return O?a.jsxs(yn,{open:n,onClose:c,preventClose:M,size:"lg",title:`${O.app.id} created`,description:"Add its public key to the repository so deployments can read the code.",footer:a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"secondary",onClick:c,disabled:M,children:"Close"}),a.jsx(se,{variant:"primary",onClick:()=>void Ve(),loading:M,children:"Deploy now"})]}),children:[a.jsx(Eh,{appId:O.app.id,repoUrl:O.app.repoUrl,publicKey:O.key?.publicKey??null,fingerprint:O.key?.fingerprint??null,createdAt:O.key?.createdAt??null,onDisk:!!O.key,initialError:O.keyError,onChanged:()=>f?.(O.app)}),a.jsx("p",{className:"mt-3 text-2xs text-faint",children:"Closing keeps the app and its key; you can add the key to GitHub later from the app’s GitHub tab."})]}):a.jsx(yn,{open:n,onClose:c,preventClose:k,size:"lg",title:b?`Edit ${i.id}`:"New app",description:b?"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(se,{variant:"secondary",onClick:c,disabled:k,children:"Cancel"}),a.jsx(se,{variant:"primary",type:"submit",form:"deploy-app-form",loading:k,children:b?"Save app":"Create app"})]}),children:a.jsxs("form",{id:"deploy-app-form",className:"space-y-6",onSubmit:ce=>{ce.preventDefault(),Pe()},noValidate:!0,children:[z&&a.jsx(ve,{tone:"danger",title:b?"The app was not saved":"The app was not created",children:z}),a.jsxs("section",{className:"space-y-4",children:[a.jsxs(Ja,{children:[a.jsx(Me,{label:"Name",value:x.id,onChange:ce=>W({id:ce.target.value.toLowerCase()}),disabled:b,error:Xe("id"),hint:b?"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(Me,{label:"Branch",value:x.branch,onChange:ce=>W({branch:ce.target.value}),hint:"Deployed when no specific commit is named.",placeholder:"main",className:"font-mono",spellCheck:!1})]}),a.jsx(Me,{label:"Repository URL",value:x.repoUrl,onChange:ce=>W({repoUrl:ce.target.value}),error:Xe("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(pa,{label:"Repository access",value:x.authType,onChange:ce=>W({authType:ce.target.value}),hint:x.authType==="none"?"For a public repository.":x.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)"})]}),x.authType==="token"&&a.jsx(Me,{label:"Access token",type:"password",value:x.token,onChange:ce=>W({token:ce.target.value}),error:Xe("token"),hint:b&&i.hasToken?"A token is stored. Leave this empty to keep it.":"Read-only access to this one repository is enough.",placeholder:b&&i.hasToken?"••••••••":"github_pat_…",autoComplete:"off",spellCheck:!1}),x.authType==="deployKey"&&ke?b?a.jsx(Eh,{appId:i.id,repoUrl:i.repoUrl,publicKey:i.deployKey,fingerprint:i.deployKeyFingerprint??null,createdAt:i.deployKeyCreatedAt??null,onDisk:i.deployKeyOnDisk??!!i.deployKey,onChanged:h}):a.jsx(pl,{label:"Generate a deploy key for me",hint:"Made in the same step as the app, without deploying anything. You then add its public half to the repository.",checked:x.generateKey,onChange:ce=>W({generateKey:ce})}):null]}),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:"Port and health"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["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"}),"."]})]}),xe.map(ce=>a.jsx(ve,{tone:"warning",children:ce},ce)),a.jsxs(Ja,{children:[a.jsx(Me,{label:"Port",optional:!0,type:"number",min:1,max:65535,inputMode:"numeric",value:x.settings.port,onChange:ce=>I({port:ce.target.value}),error:Xe("port"),hint:"The port the app listens on. Passed to it as PORT, and used for the health check.",placeholder:"3000"}),a.jsx(Me,{label:"Health check path",optional:!0,value:x.settings.healthPath,onChange:ce=>I({healthPath:ce.target.value}),error:Xe("healthPath"),hint:"Must answer before a deployment counts. Defaults to /.",placeholder:"/healthz",className:"font-mono",spellCheck:!1})]})]}),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:"Runtime"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"What runs the app. Node.js is the only runtime Easy DevOps can supervise today; the others are shown so the plan is clear."})]}),a.jsx(x3,{value:x.settings.runtime,onChange:ce=>I({runtime:ce,runtimeOverride:!0})}),x.settings.runtime==="node"&&a.jsx(m3,{value:A,modifiedFrom:ee&&A?Cv(A):null,onSelect:ce=>void J(ce),onReset:()=>{A&&ne(A)}}),a.jsx(fi,{overridden:x.settings.runtimeOverride,note:x.settings.runtimeOverride?"the runtime is saved on this app instead of ez.json.":"No override — the runtime comes from ez.json, else Node.js.",onClear:B})]}),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:"Commands"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["The start command and the steps run in a new release, in this order. Steps are one field: saving them replaces the repository’s list, and clearing the override goes back to ",a.jsx("code",{className:"font-mono",children:"ez.json"}),"."]})]}),ie&&a.jsx(ve,{tone:"info",title:"Saved in the old format",children:"These commands came from the separate install, build and migrate fields. Saving the app stores them as one ordered steps list."}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Me,{label:"Start command",value:x.settings.start,onChange:ce=>I({start:ce.target.value,startOverride:!0}),error:Xe("start"),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.jsx(fi,{overridden:x.settings.startOverride,note:x.settings.startOverride?"the start command is saved on this app instead of ez.json.":"No override — read from ez.json, else package.json’s start script.",onClear:K})]}),x.settings.stepsOverride?a.jsxs("div",{className:"space-y-2",children:[a.jsx(v4,{steps:x.settings.steps,onChange:ce=>I({steps:ce}),errors:S?q:void 0,apiWarnings:me}),a.jsx(fi,{overridden:!0,note:"the steps are saved on this app instead of ez.json.",onClear:ue})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:["No steps are saved on this app. Its install, build and migrate commands come from"," ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", or from"," ",a.jsx("code",{className:"font-mono",children:"package.json"}),"."]}),a.jsx(fi,{overridden:!1,note:"No override — the steps come from ez.json.",onClear:ue,onOverride:()=>I({stepsOverride:!0}),overrideLabel:"Override steps"})]})]}),x.settings.runtime==="node"&&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:"Process mode"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Fork runs one process. Cluster runs one worker per instance, and needs a start command of the form ",a.jsx("code",{className:"font-mono",children:"node <file>"}),"."]})]}),a.jsxs(Ja,{children:[a.jsxs(pa,{label:"Process mode",value:x.settings.execMode,onChange:ce=>I({execMode:ce.target.value,execModeOverride:!0}),hint:"Cluster runs one worker per instance. It needs a start command of the form node <file>.",children:[a.jsx("option",{value:"fork",children:"Fork — one process"}),a.jsx("option",{value:"cluster",disabled:re===!1,children:"Cluster — several workers"})]}),a.jsx(Me,{label:"Instances",optional:!0,value:x.settings.instances,onChange:ce=>I({instances:ce.target.value,instancesOverride:!0}),error:Xe("instances"),hint:"A whole number up to this server’s CPU count, or “max”. Leave empty for 1.",placeholder:"1"})]}),a.jsx(fi,{overridden:x.settings.execModeOverride,note:x.settings.execModeOverride?"the process mode is saved on this app instead of ez.json.":b?"No override — the effective mode comes from ez.json, else the default.":"No override yet — fork is the default.",onClear:L}),a.jsx(fi,{overridden:x.settings.instancesOverride,note:x.settings.instancesOverride?"the instance count is saved on this app instead of ez.json.":b?"No override — the effective count comes from ez.json, else the default (1).":"No override yet — one instance is the default.",onClear:te}),ye&&a.jsxs(ve,{tone:"warning",children:["Cluster mode needs a start command that runs a JS file directly, such as"," ",a.jsx("code",{className:"font-mono",children:"node dist/index.js"})," — not an npm script or another language. Change the start command, or choose Fork."]}),x.settings.execMode==="cluster"&&a.jsx(ve,{tone:"warning",title:"Cluster mode",children:Sv}),Re&&a.jsxs(ve,{tone:"warning",children:["Fork mode starts one process. Several forked copies would all bind the same port — choose Cluster for ",x.settings.instances," instances."]})]}),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:"Persistent data"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Each deployment runs from a fresh copy of your code. Files written to at runtime are lost on the next deploy — and on rollback. Every path listed here, a folder or a single file, lives in a shared location that every deployment and every rollback reuses."})]}),a.jsx(eC,{label:"Folders and files to keep",optional:!0,value:x.settings.persist,onChange:ce=>I({persist:ce}),normalize:(ce,De)=>{const we=_T(ce,De);return{value:we.path,error:we.error}},max:20,hint:"Add folders your app writes to: uploads, SQLite data, logs — or one file, such as prisma/app.db. Press Enter after each path.",placeholder:"data, uploads, prisma/app.db"}),a.jsxs("div",{className:"space-y-1 text-2xs text-faint",children:[a.jsxs("p",{children:["The first deployment copies the current contents into the shared location; after that, the shared copy is what counts — changes to it in the repository are ignored. A folder is usually the safer unit: SQLite creates ",a.jsx("code",{className:"font-mono",children:"-wal"})," and"," ",a.jsx("code",{className:"font-mono",children:"-shm"})," files next to its database. Left empty, the list is read from ",a.jsx("code",{className:"font-mono",children:"ez.json"}),"."]}),b&&i?.sharedDir&&a.jsxs("p",{className:"break-all",children:["Kept in ",a.jsx("span",{className:"font-mono",children:i.sharedDir})]})]})]}),a.jsx("section",{className:"space-y-4 border-t border-line pt-5",children:a.jsx(Lc,{label:"Environment variables",optional:!0,rows:5,value:x.envText,onChange:ce=>W({envText:ce.target.value}),error:Xe("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://…
526
- NODE_ENV=production`,className:"font-mono",spellCheck:!1})}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(Zt,{checked:x.autoRollback,onChange:ce=>W({autoRollback:ce}),label:"Roll back automatically",description:"If a new release starts but fails its health check, the previous release is started again."}),a.jsx(Ja,{children:a.jsx(Me,{label:"Releases to keep",type:"number",min:r.limits.keepReleasesMin,max:r.limits.keepReleasesMax,inputMode:"numeric",value:x.keepReleases,onChange:ce=>W({keepReleases:ce.target.value}),error:Xe("keepReleases"),hint:"Older ones are deleted. The live release and the one before it are always kept."})}),a.jsx(Sh,{channels:r.channels,value:x.notifyChannelIds,onChange:ce=>W({notifyChannelIds:ce}),label:"Notify on every deployment",emptyHref:"/notifications",disabled:k})]})]})})}function Yv(n){return n.domain?"domain":n.bind==="0.0.0.0"?"direct":"local"}function w4({open:n,hook:i,domains:r,onClose:c,onSaved:d}){const f=Et(),[m,h]=p.useState(i.enabled),[g,v]=p.useState(Yv(i)),[b,x]=p.useState(i.domain??""),[j,S]=p.useState(String(i.port)),[R,k]=p.useState(!1),[C,z]=p.useState(!1);p.useEffect(()=>{n&&(h(i.enabled),v(Yv(i)),x(i.domain??""),S(String(i.port)),z(!1))},[n]);const w=r.filter(A=>A.enabled),O=w.find(A=>A.name===b),E=su(j),M=m&&g==="domain"&&!O?"Choose a domain.":null,Y=async()=>{if(!R&&(z(!0),!(E||M))){k(!0);try{const A=await fe.deployments.updateHook({enabled:m,port:Number(j),bind:g==="direct"?"0.0.0.0":"127.0.0.1",domain:g==="domain"?b:null});A.nginxReloaded===!1?f.warning("Saved, but nginx was not reloaded","The domain’s config was written. Reload nginx for the deploy hook to be reachable."):f.success("Deploy hook saved",m?`The background service picks it up within ${A.appliesWithinSeconds??10} seconds.`:"Nothing is listening for deployments now."),d(A)}catch(A){const H=A instanceof He&&typeof A.payload.detail=="string"?A.payload.detail:null;f.error("Could not save the deploy hook",H??(A instanceof Error?A.message:"Nothing was changed."))}finally{k(!1)}}};return a.jsx(yn,{open:n,onClose:c,preventClose:R,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(se,{variant:"secondary",onClick:c,disabled:R,children:"Cancel"}),a.jsx(se,{variant:"primary",onClick:()=>void Y(),loading:R,children:"Save"})]}),children:a.jsxs("div",{className:"space-y-5",children:[a.jsx(Zt,{checked:m,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."}),m&&a.jsxs(a.Fragment,{children:[a.jsxs(pa,{label:"How CI reaches it",value:g,onChange:A=>v(A.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"})]}),g==="domain"&&a.jsxs(a.Fragment,{children:[a.jsxs(pa,{label:"Domain",value:b,onChange:A=>x(A.target.value),error:C?M: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…"}),w.map(A=>a.jsxs("option",{value:A.name,children:[A.name,A.ssl?"":" — no SSL"]},A.name))]}),w.length===0&&a.jsx(ve,{tone:"warning",children:"There is no enabled domain yet. Add one on the Domains page, or reach the hook directly."}),O&&!O.ssl&&a.jsx(ve,{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."})]}),g==="direct"&&a.jsx(ve,{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."}),g==="local"&&a.jsx(ve,{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(Ja,{children:a.jsx(Me,{label:"Listener port",type:"number",min:1,max:65535,inputMode:"numeric",value:j,onChange:A=>S(A.target.value),error:C?E:null,hint:g==="direct"?"The port CI connects to.":"Internal. nginx forwards to it; it is not opened to the network."})})]})]})})}function S4(n,i){return n instanceof He||n instanceof Error?n.message:i}function k4({data:n,onConfigure:i}){const{hook:r}=n,c=r.enabled&&(r.domain!==null||r.bind==="0.0.0.0"),f=!!(r.domain?n.domains.find(v=>v.name===r.domain):void 0)?.ssl;let m="neutral",h="Off",g="Apps are deployed from this dashboard only. Turn it on to deploy from GitHub Actions.";return r.enabled&&!r.listening?(m="warn",h="Not listening",g="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."):r.enabled&&!c?(m="neutral",h="This machine only",g="Listening, but only programs on this server can call it. GitHub cannot reach it."):r.enabled&&r.domain?(m=f?"ok":"warn",h=f?"On":"On — no SSL",g=f?`Reached through https://${r.domain}${r.path}`:`Reached through http://${r.domain}${r.path} — the deploy token travels unencrypted. Issue a certificate for that domain.`):r.enabled&&(m="warn",h="On — plain HTTP",g=`Listening on every interface, port ${r.port}. The deploy token travels unencrypted; prefer a domain with SSL.`),a.jsx(et,{children:a.jsx(pn,{icon:a.jsx(Wc,{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:m,dot:!0,children:h})]}),description:g,actions:a.jsx(se,{size:"sm",icon:a.jsx(Bb,{className:"size-3.5","aria-hidden":"true"}),onClick:i,children:"Configure"})})})}function C4({app:n,canDeploy:i,busy:r,onDeploy:c,onOpen:d,onEdit:f,onDelete:m}){const h=n.lastRun??null,g=n.process??null,v=h?g0[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:()=>d("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(ln,{tone:g?YT(g.status):"neutral",pulse:g?.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:n.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:n.repoUrl,children:z5(n.repoUrl,44)}),a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(zS,{className:"size-3","aria-hidden":"true"}),n.branch]}),n.domain&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-accent-text",children:[a.jsx(Os,{className:"size-3","aria-hidden":"true"}),n.domain]})]}),a.jsxs("span",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-faint",children:[g?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[g.status,g.status==="online"&&g.uptimeMs!==null?` · up ${eu(g.uptimeMs)}`:""]}),g.memoryBytes!==null&&a.jsxs("span",{children:["· ",Ib(g.memoryBytes)]}),g.restarts>0&&a.jsxs("span",{children:["· ",$n(g.restarts,"restart")]})]}):a.jsx("span",{children:n.currentRelease?"Not running":"Never deployed"}),Bc(n)&&a.jsxs("span",{children:["· ",Bc(n)]})]}),n.warnings?.length?a.jsx("span",{className:"mt-1 block text-2xs text-warn",children:n.warnings.join(" ")}):null]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2 pl-7 lg:w-56 lg:shrink-0 lg:pl-0",children:n.deploying?a.jsx(je,{tone:"info",dot:!0,children:h?.status==="running"?ru(h.step):"Deploying"}):v&&h?a.jsxs(a.Fragment,{children:[a.jsx(je,{tone:v.tone,dot:!0,children:v.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:zr(h.sha)}),a.jsx("span",{className:"text-2xs text-faint",children:$r(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(se,{variant:"primary",size:"sm",icon:a.jsx(Tr,{className:"size-3.5","aria-hidden":"true"}),onClick:c,loading:r,disabled:!i||!!n.deploying,children:"Deploy"}),a.jsx(se,{size:"sm",onClick:()=>d("setup"),children:"Domain"}),a.jsx(se,{size:"sm",onClick:()=>d("github"),children:"GitHub"}),a.jsx(ct,{label:`Edit ${n.id}`,size:"sm",onClick:f,children:a.jsx(Vh,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Delete ${n.id}`,size:"sm",variant:"dangerGhost",onClick:m,disabled:!!n.deploying,children:a.jsx(Us,{className:"size-4","aria-hidden":"true"})})]})]})}function T4(){ba("Deployments");const n=Et(),i=Tt(E=>fe.deployments.list(E),[]),r=i.data,c=!!r?.apps.some(E=>E.deploying);yl(i.reload),hl(i.reload,c?2e3:1e4);const[d,f]=p.useState(!1),[m,h]=p.useState(null),[g,v]=p.useState(!1),[b,x]=p.useState(null),[j,S]=p.useState(null),[R,k]=p.useState(null),C=()=>{h(null),f(!0)},z=async E=>{if(!j){S(E.id);try{await fe.deployments.deploy(E.id),x({id:E.id,tab:"activity"}),i.reload()}catch(M){n.error(`Could not deploy ${E.id}`,S4(M,"Nothing was started."))}finally{S(null)}}},w=a.jsx(La,{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(ct,{label:"Refresh",onClick:i.reload,children:a.jsx(Ct,{className:"size-4","aria-hidden":"true"})}),a.jsx(se,{variant:"primary",icon:a.jsx(xa,{className:"size-4","aria-hidden":"true"}),onClick:C,disabled:!r,children:"New app"})]})});if(i.error&&!r)return a.jsxs(a.Fragment,{children:[w,a.jsx($t,{error:i.error,onRetry:i.reload})]});if(!r)return a.jsxs(a.Fragment,{children:[w,a.jsxs(ns,{children:[a.jsx(tt,{className:"h-20 rounded-lg"}),a.jsx(tt,{className:"h-56 rounded-lg"})]})]});const O=r.requirements.git&&r.requirements.pm2;return a.jsxs(a.Fragment,{children:[w,a.jsxs("div",{className:"space-y-5",children:[!r.requirements.git&&a.jsx(ve,{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."}),!r.requirements.pm2&&a.jsxs(ve,{tone:"warning",title:"PM2 is not installed",action:a.jsx(kt,{to:"/processes",className:ma("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(k4,{data:r,onConfigure:()=>v(!0)}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Tr,{className:"size-4","aria-hidden":"true"}),title:"Apps",description:r.apps.length===0?"Nothing is deployed from here yet.":`${$n(r.apps.length,"app")}. Each runs under PM2 as ez-<name>.`}),r.apps.length===0?a.jsx(xn,{children:a.jsx(ga,{icon:a.jsx(Tr,{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(se,{variant:"primary",icon:a.jsx(xa,{className:"size-4","aria-hidden":"true"}),onClick:C,children:"New app"})})}):a.jsx("ul",{className:"divide-y divide-line",children:r.apps.map(E=>a.jsx(C4,{app:E,canDeploy:O,busy:j===E.id,onDeploy:()=>void z(E),onOpen:M=>x({id:E.id,tab:M}),onEdit:()=>{h(E),f(!0)},onDelete:()=>k(E)},E.id))})]})]}),a.jsx(N4,{open:d,app:m,meta:r,onClose:()=>f(!1),onRefresh:i.reload,onCreated:()=>i.reload(),onDeployNow:E=>{f(!1),x({id:E,tab:"activity"}),i.reload()},onSaved:(E,M)=>{f(!1),i.reload(),M?n.success(`${E.id} created`,"Press Deploy to build and start it."):n.success(`${E.id} saved`,"It applies to the next deployment.")}}),a.jsx(w4,{open:g,hook:r.hook,domains:r.domains,onClose:()=>v(!1),onSaved:()=>{v(!1),i.reload()}}),a.jsx(u3,{appId:b?.id??null,initialTab:b?.tab,hook:r.hook,meta:r,onClose:()=>x(null),onConfigureHook:()=>v(!0),onChanged:i.reload,onDelete:E=>k(E)}),a.jsx(JT,{app:R,onClose:()=>k(null),onDeleted:()=>{k(null),x(null),i.reload()}})]})}const Vv=[{id:"error",label:"Error",fileName:"error.log"},{id:"access",label:"Access",fileName:"access.log"}];function E4(n){return/\[(error|crit|emerg|alert)\]/.test(n)?"text-bad":/\[(warn|warning)\]/.test(n)?"text-warn":/\s(2\d\d|3\d\d)\s/.test(n)?"text-ok":"text-muted"}function R4(){ba("Logs");const{connectionError:n}=vn(),[i,r]=Jc(),d=i.get("file")==="access"?"access":"error",f=Vv.find(S=>S.id===d),m=S=>{const R=new URLSearchParams(i);S==="error"?R.delete("file"):R.set("file",S),r(R,{replace:!0})},h=c0(d,{limit:500}),g=p.useRef(null),[v,b]=p.useState(!0);p.useEffect(()=>{const S=g.current;S&&v&&(S.scrollTop=S.scrollHeight)},[h.lines,v]);const x=h.paused,j=h.connected&&!x;return a.jsxs(a.Fragment,{children:[a.jsx(La,{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:x?"warn":h.connected?"ok":"bad",dot:!0,children:x?"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:Vv.map(S=>a.jsx("button",{type:"button","aria-pressed":d===S.id,onClick:()=>m(S.id),className:oe("rounded-sm px-3 py-1 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",d===S.id?"bg-surface text-ink shadow-sm":"text-muted hover:text-ink"),children:S.label},S.id))}),a.jsx(se,{variant:"secondary",size:"sm",icon:x?a.jsx(Hr,{className:"size-3.5","aria-hidden":"true"}):a.jsx(_b,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>h.setPaused(!x),children:x?"Resume":"Pause"}),a.jsx(se,{variant:"ghost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),onClick:h.clear,disabled:h.lines.length===0,children:"Clear"}),a.jsx(se,{variant:"ghost",size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:h.restart,disabled:!h.connected,children:"Reload tail"}),a.jsx(qt,{value:h.lines.join(`
527
- `),label:"Copy logs",withText:!0})]})}),n&&a.jsx(ve,{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(et,{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(ln,{tone:x?"warn":h.connected?"ok":"bad",pulse:j}),x?"Paused":h.connected?"Live":"Reconnecting"]}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:f.fileName}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:h.lines.length===1?"1 line":`${h.lines.length} lines`}),x&&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:v?"Following the tail":"Scrolled back"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{ref:g,role:"log","aria-label":`nginx ${f.label.toLowerCase()} log`,"aria-live":"off",onScroll:()=>{const S=g.current;S&&b(S.scrollHeight-S.scrollTop-S.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?d==="access"?"No access lines yet. They appear here as nginx writes them.":"No error lines yet.":"Waiting for the live stream…"}):h.lines.map((S,R)=>a.jsx("div",{className:oe("whitespace-pre-wrap break-all py-0.5",E4(S)),children:S},`${R}-${S}`))}),!v&&a.jsxs("button",{type:"button",onClick:()=>{const S=g.current;S&&(S.scrollTop=S.scrollHeight),b(!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(Eb,{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 Xv={not_linked:"Not linked",connecting:"Connecting…",connected:"Connected",rejected:"Rejected by the Hub",unreachable:"Hub unreachable"},Kv={connected:"ok",connecting:"warn",unreachable:"warn",rejected:"bad",not_linked:"neutral"};function oh(n,i){return n instanceof He?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function z4({checked:n,indeterminate:i,disabled:r,label:c,onChange:d}){const f=p.useRef(null);return p.useEffect(()=>{f.current&&(f.current.indeterminate=i)},[i]),a.jsx("input",{ref:f,type:"checkbox","aria-label":`All ${c} permissions`,checked:n,disabled:r,onChange:m=>d(m.target.checked),className:"mt-0.5 size-4 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"})}function ch(n,i){return!!n.comingSoon||i.includes(n.id)}function D4(){const n=Et(),i=rn(),r=Tt(J=>fe.hub.status(J)),c=r.setData,[d,f]=p.useState(""),[m,h]=p.useState(null),[g,v]=p.useState(!1),[b,x]=p.useState(!1),[j,S]=p.useState(!1),R=r.data?.status??"not_linked",{client:k}=vn();p.useEffect(()=>{if(!k)return;const J=Z=>{c(ee=>ee&&{...ee,linked:Z.linked,connected:Z.connected,status:Z.status,lastError:Z.lastError,attempts:Z.attempts,...Z.linked?{}:{hubUrl:null,serverId:null,permissions:{}}})};return k.on("hub:agentState",J),()=>k.off("hub:agentState",J)},[k,c]);const C=async()=>{if(g)return;const J=bC(d);if(J){h(J);return}h(null),v(!0);try{const Z=await fe.hub.connect(d.trim());r.setData(Z.status),f(""),n.success("Connection string saved",Z.status.status==="connecting"?"Connecting to the Hub…":"This server is now linked to the Hub.")}catch(Z){h(oh(Z,"The Hub did not accept that connection string."))}finally{v(!1)}},z=async()=>{if(!(b||!await i({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"}))){x(!0);try{await fe.hub.unlink(),r.setData(Z=>Z&&{...Z,linked:!1,hubUrl:null,serverId:null,connected:!1,status:"not_linked",permissions:{},lastError:null,attempts:0}),f(""),h(null),n.success("Unlinked from the Hub")}catch(Z){n.error("Could not unlink",oh(Z,"The link is still in place."))}finally{x(!1)}}},w=r.data?.permissions??{},O=r.data?.tree??[],E=r.data?.comingSoon??[],M=async(J,Z)=>{if(!j){S(!0),r.setData(ee=>{if(!ee)return ee;const ue={...ee.permissions};for(const K of J)ue[K]=Z;return{...ee,permissions:ue}});try{const ee={};for(const K of J)ee[K]=Z;const ue=await fe.hub.updatePermissions(ee);r.setData(K=>K&&{...K,permissions:ue.permissions,tree:ue.tree,comingSoon:ue.comingSoon})}catch(ee){n.error("Could not save permissions",oh(ee,"The change was not kept.")),r.reload()}finally{S(!1)}}},Y=J=>{const Z=J.children.filter(ue=>!ch(ue,E));if(Z.length===0)return"off";const ee=Z.filter(ue=>w[ue.id]===!0).length;return ee===0?"off":ee===Z.length?"on":"partial"},A=(J,Z)=>{const ee=J.children.filter(ue=>!ch(ue,E)).map(ue=>ue.id);ee.length!==0&&M(ee,Z)},H=Object.values(w).filter(Boolean).length,W=J=>a.jsxs("div",{className:"w-full max-w-md space-y-3",children:[a.jsx(Lc,{label:"Connection string",value:d,onChange:Z=>{f(Z.target.value),m&&h(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(se,{variant:"primary",loading:g,disabled:!d.trim(),icon:a.jsx(XS,{className:"size-4","aria-hidden":"true"}),onClick:()=>void C(),children:J})]}),I=Kv[R]??"neutral",ne=(()=>{if(r.error&&!r.data)return a.jsx(xn,{children:a.jsx($t,{error:r.error,title:"Could not read the Hub status",onRetry:r.reload,className:"border-0"})});if(!r.data)return a.jsxs(xn,{className:"space-y-3",children:[a.jsx(tt,{className:"h-5 w-48"}),a.jsx(tt,{className:"h-24 rounded-md"}),a.jsx(tt,{className:"h-40 rounded-md"})]});const J=r.data,Z=Xv[J.status]??"Unknown state",ee=Kv[J.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(ln,{tone:ee,pulse:J.status==="connecting"}),a.jsx("span",{className:"text-sm font-medium text-ink",children:Z}),J.hubUrl&&a.jsx("code",{className:"break-all font-mono text-xs text-muted",children:J.hubUrl}),J.serverId&&a.jsxs("span",{className:"text-2xs text-faint",children:["Server ID ",a.jsx("code",{className:"font-mono text-muted",children:J.serverId})]}),J.linked&&a.jsx("span",{className:"text-2xs text-faint",title:J.agentOwner==="daemon"?"The Hub connection is held by the background service, which keeps it alive with no browser open.":"The Hub connection is held by this dashboard and stops when it closes.",children:J.agentOwner==="daemon"&&!J.agentReported?"waiting for the background service…":J.agentOwner==="daemon"?"via the background service":"via this dashboard"}),J.status==="unreachable"&&J.attempts>0&&a.jsxs("span",{className:"text-2xs text-faint",children:[J.attempts," reconnect attempt",J.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:J.dataDir}),J.devDataDir&&a.jsx(je,{tone:"warn",children:"dev override"}),J.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(xn,{className:"space-y-5",children:[J.lastError&&a.jsx(ve,{tone:J.status==="rejected"?"danger":"warning",title:J.status==="rejected"?"The Hub rejected this server":"The Hub cannot be reached right now",children:J.lastError}),J.linked?a.jsxs(a.Fragment,{children:[J.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."}),W("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:H>0?"accent":"neutral",children:[H," granted"]})]}),a.jsx("div",{className:"space-y-2.5",children:O.map(ue=>{const K=Y(ue);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(z4,{checked:K==="on",indeterminate:K==="partial",disabled:j,label:ue.label,onChange:B=>A(ue,B)}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:ue.label}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:ue.description})]})]}),a.jsx("ul",{className:"divide-y divide-line/60",children:ue.children.map(B=>{const L=ch(B,E),te=w[B.id]===!0;return a.jsx("li",{children:a.jsxs("label",{className:oe("flex items-start gap-3 px-3.5 py-2.5 pl-8",L?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-inset/60"),children:[a.jsx("input",{type:"checkbox",checked:te,disabled:L||j,onChange:()=>void M([B.id],!te),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:[B.label,L&&a.jsx(je,{tone:"warn",children:"Coming soon"})]}),a.jsx("span",{className:"mt-0.5 block text-xs text-faint",children:B.description})]})]})},B.id)})})]},ue.id)})})]}),a.jsx("div",{className:"border-t border-line pt-4",children:a.jsx(se,{variant:"dangerGhost",loading:b,icon:a.jsx(Vk,{className:"size-4","aria-hidden":"true"}),onClick:()=>void z(),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"})]})]}),W("Connect")]})]})]})})();return a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",I==="ok"?"bg-ok/60":I==="bad"?"bg-bad/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Iw,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Easy DevOps Hub",r.data&&a.jsx(je,{tone:I,dot:!0,children:Xv[r.data.status]??"Unknown"}),r.data?.devDataDir&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Monitor and control this server from a central dashboard.",actions:a.jsx(se,{variant:"secondary",size:"sm",loading:r.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:r.reload,children:"Refresh"})}),ne,r.loading&&r.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(_s,{}),"Refreshing the Hub state…"]})]})}const A4=["starting","stopping","updating","restarting"],uh=[{id:"starting",label:"Hand over to the update worker"},{id:"stopping",label:"Stop the dashboard and the service"},{id:"updating",label:"Install the new version"},{id:"restarting",label:"Start the dashboard again"}],Zv={starting:"Starting…",stopping:"Stopping…",updating:"Updating…",restarting:"Restarting…",done:"Completed",failed:"Failed",interrupted:"Interrupted"},O4={starting:"warn",stopping:"warn",updating:"warn",restarting:"warn",done:"ok",failed:"bad",interrupted:"warn"};function M4(n,i){return n instanceof He?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function Qv(n){return n!==void 0&&A4.includes(n)}function Iv({run:n}){const i=[];return n.serviceInstalled?i.push({label:"Background service",value:n.versionConfirmed?`Running v${n.runningVersion} (reported by the daemon)`:`Restarted, reporting ${n.runningVersion?`v${n.runningVersion}`:"an unknown version"}`}):i.push({label:"Background service",value:"Not installed — the package was updated on its own"}),n.refreshedCopy&&i.push({label:"Runtime copy",value:"Refreshed, so the service runs the new code"}),n.dashboardRestarted===!1?i.push({label:"Dashboard",value:"Did not come back automatically — start it from the CLI"}):n.dashboardPort&&i.push({label:"Dashboard",value:`Running again on port ${n.dashboardPort}`}),a.jsx("dl",{className:"grid gap-x-6 gap-y-2 text-xs sm:grid-cols-[auto_1fr]",children:i.map(r=>a.jsxs("div",{className:"contents",children:[a.jsx("dt",{className:"font-medium uppercase tracking-wider text-faint",children:r.label}),a.jsx("dd",{className:"text-muted",children:r.value})]},r.label))})}function _4({run:n}){const i=n.finishedAt?Qh(new Date(n.finishedAt).toISOString()):null;return n.phase==="done"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs(ve,{tone:"success",title:`Updated v${n.from} → v${n.to}`,children:[i?`Finished ${i}. `:"","The dashboard runs the new version from now on."]}),a.jsx(Iv,{run:n}),n.dashboardRestarted===!1&&a.jsxs(ve,{tone:"warning",title:"The dashboard did not come back by itself",children:["Start it again with ",a.jsx("code",{className:"font-mono",children:"ezz --dash"})," in a terminal."]})]}):n.phase==="interrupted"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs(ve,{tone:"warning",title:"The update was interrupted",children:["The worker that performs the update stopped reporting",n.step?` during “${n.step}”`:"",". Nothing here can say what state the files are in — run ",a.jsx("code",{className:"font-mono",children:"ezz update"})," in a terminal; it checks the source, reinstalls and verifies the service from the beginning."]}),a.jsx(se,{variant:"secondary",size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>window.location.reload(),children:"Reload the page"})]}):a.jsxs("div",{className:"space-y-3",children:[a.jsx(ve,{tone:"danger",title:`The update failed${n.step?` (${n.step})`:""}`,children:a.jsx("span",{className:"whitespace-pre-wrap break-words",children:n.reason??"No reason was reported."})}),n.rolledBack?a.jsx(ve,{tone:"success",title:`Rolled back to v${n.from}`,children:n.restored?"The background service is running again on the version you had.":"The service did not come back — start it from Processes."}):n.serviceInstalled?a.jsx(ve,{tone:"warning",title:"The service may not be running",children:"Start it again from Processes once you have checked the log below."}):null,a.jsx(Iv,{run:n})]})}function L4(){const n=Et(),i=rn(),r=Tt(w=>fe.update.check(w)),[c,d]=p.useState(null),[f,m]=p.useState(null),[h,g]=p.useState(!1),[v,b]=p.useState(!1),[x,j]=p.useState(!1),S=p.useRef(null),R=r.reload;p.useEffect(()=>{const w=r.data;w&&(d(w.current),m(O=>O??w.run))},[r.data]);const k=Qv(f?.phase);p.useEffect(()=>{if(!k)return;let w=!1,O;const E=async()=>{try{const M=await fe.update.status();if(w)return;b(!1),d(M.current),m(M.run)}catch(M){if(w)return;M instanceof He&&M.status===0&&b(!0)}w||(O=window.setTimeout(E,v?3e3:1500))};return O=window.setTimeout(E,1200),()=>{w=!0,O&&window.clearTimeout(O)}},[k,v]),p.useEffect(()=>{!f||Qv(f.phase)||S.current!==f.id&&(S.current=f.id,R())},[f,R]);const C=async()=>{const w=r.data?.latest;if(!(!w||h||!await i({title:`Update to v${w}?`,body:"The dashboard stops, installs the new version and starts again on this port. This page loses its connection while that happens and comes back by itself — one or two minutes is normal. Do not close the tab.",confirmLabel:"Update now",tone:"accent"}))){g(!0);try{const E=await fe.update.start(w);b(!1),m(E.run),n.success("Update started","The dashboard will stop for a moment and come back on its own.")}catch(E){n.error("Could not start the update",M4(E,"Nothing was changed.")),r.reload()}finally{g(!1)}}},z=(()=>{if(r.error&&!r.data)return a.jsx(xn,{children:a.jsx($t,{error:r.error,title:"Could not check for updates",onRetry:r.reload,className:"border-0"})});if(!r.data)return a.jsxs(xn,{className:"space-y-3",children:[a.jsx(tt,{className:"h-5 w-56"}),a.jsx(tt,{className:"h-20 rounded-md"})]});const{source:w,latest:O,reachable:E,updateAvailable:M}=r.data,Y=k&&f;return a.jsxs(xn,{className:"space-y-5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Installed"}),a.jsxs("div",{className:"mt-0.5 font-mono text-sm font-medium text-ink",children:["v",c??r.data.current]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Latest"}),a.jsx("div",{className:"mt-0.5 font-mono text-sm font-medium text-ink",children:E&&O?`v${O}`:"—"})]}),a.jsx("div",{className:"pt-4",children:E?M?a.jsx(je,{tone:"accent",dot:!0,children:"Update available"}):a.jsx(je,{tone:"ok",dot:!0,children:"Up to date"}):a.jsx(je,{tone:"warn",dot:!0,children:"Registry unreachable"})})]}),!w.npmUpdatable&&a.jsxs(ve,{tone:"warning",title:"This copy is not managed by npm",children:["This installation is ",w.reason,". Running"," ",a.jsx("code",{className:"font-mono",children:"npm install -g"})," would install a second copy and leave this one running, so updates have to be done by hand:",a.jsx("pre",{className:"mt-2 overflow-x-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-ink",children:w.howToUpdate.join(`
528
- `)})]}),Y&&a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/40 px-4 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}),a.jsxs("span",{className:"text-sm font-medium text-ink",children:["Updating v",Y.from," → v",Y.to]}),a.jsx(je,{tone:"warn",dot:!0,children:Zv[Y.phase]})]}),a.jsx("ol",{className:"space-y-1.5",children:uh.map(A=>{const H=uh.findIndex(ne=>ne.id===Y.phase),W=uh.findIndex(ne=>ne.id===A.id),I=W<H?"done":W===H?"current":"pending";return a.jsxs("li",{className:oe("flex items-center gap-2 text-xs",I==="pending"?"text-faint":"text-muted"),children:[I==="done"?a.jsx(dl,{className:"size-3.5 text-ok","aria-hidden":"true"}):I==="current"?a.jsx(gn,{className:"spin size-3.5 text-accent-text","aria-hidden":"true"}):a.jsx(Db,{className:"size-3.5","aria-hidden":"true"}),A.label]},A.id)})}),v&&a.jsx(ve,{tone:"info",title:"The dashboard is restarting",children:"This page cannot reach it at the moment. It keeps reconnecting and shows the result here as soon as the dashboard is back."}),Y.logTail.length>0&&a.jsx("pre",{className:"max-h-36 overflow-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-muted",children:Y.logTail.join(`
529
- `)})]}),f&&!k&&a.jsxs("div",{className:"space-y-3 border-t border-line pt-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-ink",children:f.phase==="done"?`Last update: v${f.from} → v${f.to}`:`Last update attempt (v${f.to})`}),a.jsx(je,{tone:O4[f.phase],dot:!0,children:Zv[f.phase]})]}),a.jsx(_4,{run:f}),f.logTail.length>0&&a.jsx(lu,{id:"update-log",title:"Update log",open:x,onOpenChange:j,headerClassName:"py-1",contentClassName:"pb-1",children:a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-muted",children:f.logTail.join(`
530
- `)})})]}),!Y&&w.npmUpdatable&&a.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t border-line pt-4",children:[M&&O?a.jsxs(se,{variant:"primary",loading:h,icon:a.jsx(Xy,{className:"size-4","aria-hidden":"true"}),onClick:()=>void C(),children:["Update to v",O]}):f?.phase==="done"?a.jsx(se,{variant:"secondary",icon:a.jsx(Ct,{className:"size-4","aria-hidden":"true"}),onClick:()=>window.location.reload(),children:"Reload the page"}):null,a.jsx("p",{className:"text-xs text-muted",children:"The dashboard stops while the update runs and starts again on this port by itself."})]})]})})();return a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Xy,{className:"size-4","aria-hidden":"true"}),title:"Easy DevOps version",description:"Update the package this dashboard and its service run on. Nothing is installed unless you ask for it.",actions:a.jsx(se,{variant:"secondary",size:"sm",loading:r.loading,disabled:k,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:r.reload,children:"Check again"})}),z,r.loading&&r.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(_s,{}),"Checking the npm registry…"]}),a.jsx(Ec,{children:a.jsxs("span",{className:"text-2xs text-faint",children:["Same flow as ",a.jsx("code",{className:"font-mono",children:"ezz update"})," — stop the service, replace the package, verify, and roll back if the new version does not come up."]})})]})}const Pv=[{id:"general",label:"General"},{id:"access",label:"Access"},{id:"hub",label:"Hub"},{id:"backup",label:"Backup"},{id:"update",label:"Update"}],Oh=[{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 U4(n){return n==="::1"?"This machine only (::1)":Oh.find(i=>i.value===n)?.label??n}const Ac={days:7,min:1,max:30};function dh(n){return{port:String(n.dashboardPort),nginxDir:n.nginxDir,sslDir:n.sslDir,acmeEmail:n.acmeEmail,autoRenew:n.sslAutoRenew??!0,autoRenewDays:String(n.sslAutoRenewDays??Ac.days),deployDir:n.deployDir??"",ui:n.dashboardUi??"classic"}}function fh(n){return{bind:n.dashboardBindAddress,auth:n.dashboardAuth,password:"",confirm:""}}function Nr(n,i){return n instanceof He?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function H4(n){if(n instanceof He){const i=n.payload.reason;if(i==="no_auth_requires_loopback")return"Running without a password requires the dashboard to listen on this machine only.";if(i==="bind_requires_password")return"Set a password before opening the dashboard to the network.";if(i==="no_auth_requires_local_request")return"Turning the password off is only allowed from this machine itself."}return Nr(n,"The previous access settings are still in force.")}function B4(){ba("Settings");const n=Et(),i=rn(),{auth:r}=ja(),c=r?.minPasswordLength??8,[d,f]=Jc(),m=d.get("tab"),h=Pv.some(Te=>Te.id===m)?m:"general",g=Te=>{const ut=new URLSearchParams(d);Te==="general"?ut.delete("tab"):ut.set("tab",Te),f(ut,{replace:!0})},v=Tt(Te=>fe.settings.get(Te)),b=Tt(Te=>fe.settings.permissions(Te),[],{enabled:!!v.data&&v.data?.platform!=="win32"}),{service:x,error:j,reload:S}=Br(),R=qr(x);bi("settings",()=>{v.reload(),b.reload()});const[k,C]=p.useState(null),[z,w]=p.useState(null),[O,E]=p.useState(!1),[M,Y]=p.useState(!1),[A,H]=p.useState(!1),[W,I]=p.useState(!1),[ne,J]=p.useState(!1),[Z,ee]=p.useState(null),[ue,K]=p.useState(null);p.useEffect(()=>{v.data&&!k&&C(dh(v.data))},[v.data,k]),p.useEffect(()=>{v.data&&!z&&w(fh(v.data))},[v.data,z]);const B=k?su(k.port):null,L=k?t0(k.acmeEmail):null,te=k&&!k.nginxDir.trim()?"This directory is required.":null,de=k&&!k.sslDir.trim()?"This directory is required.":null,ke=v.data?.deployDir!==void 0,Ne=!!k&&ke&&k.deployDir.trim()!==(v.data?.deployDir??""),Ee=v.data?.sslAutoRenew!==void 0,T=v.data?.dashboardUi!==void 0,q=v.data?.sslAutoRenewDaysMin??Ac.min,V=v.data?.sslAutoRenewDaysMax??Ac.max,re=k?Number(k.autoRenewDays):NaN,ye=k&&Ee&&k.autoRenew&&(!/^\d+$/.test(k.autoRenewDays.trim())||re<q||re>V)?`Enter a whole number from ${q} to ${V}.`:null,Re=!!(k&&v.data&&(Number(k.port)!==v.data.dashboardPort||k.nginxDir!==v.data.nginxDir||k.sslDir!==v.data.sslDir||k.acmeEmail!==v.data.acmeEmail||T&&k.ui!==(v.data.dashboardUi??"classic")||ke&&k.deployDir.trim()!==(v.data.deployDir??"")||Ee&&(k.autoRenew!==(v.data.sslAutoRenew??!0)||k.autoRenew&&re!==(v.data.sslAutoRenewDays??Ac.days)))),xe=!!(z&&v.data&&(z.bind!==v.data.dashboardBindAddress||z.auth!==v.data.dashboardAuth||z.password!=="")),me=async()=>{if(!k||A||!v.data||(E(!0),B||L||te||de||ye))return;const Te=T&&k.ui!==(v.data.dashboardUi??"classic"),ut=Number(k.port)!==v.data.dashboardPort;H(!0);try{const Rt=await fe.settings.update({dashboardPort:Number(k.port),nginxDir:k.nginxDir.trim(),sslDir:k.sslDir.trim(),acmeEmail:k.acmeEmail.trim(),...T?{dashboardUi:k.ui}:{},...Ne?{deployDir:k.deployDir.trim()}:{},...Ee?{sslAutoRenew:k.autoRenew,...k.autoRenew?{sslAutoRenewDays:re}:{}}:{}});J(Rt.needsRestart),n.success("Settings saved",Rt.needsRestart?Te&&ut?"Restart the dashboard for the new port and interface to take effect.":Te?"The chosen interface applies the next time the dashboard starts.":"Restart the dashboard for the new port to take effect.":void 0),v.reload()}catch(Rt){n.error("Could not save settings",Nr(Rt,"The previous settings are still in force."))}finally{H(!1)}},ie=async()=>{if(!z||!v.data||W)return;if(Y(!0),ee(null),K(null),z.auth==="none"&&z.bind==="0.0.0.0"){ee("Running without a password requires the dashboard to listen here only.");return}if(z.password){const ut=tv(z.password,c)??(z.password!==z.confirm?"The two passwords do not match.":null);if(ut){K(ut);return}}else if(z.auth==="password"&&!v.data.hasPassword){K("Set a password before requiring a password to sign in.");return}const Te=z.password?"password":z.auth;I(!0);try{const ut={dashboardBindAddress:z.bind,dashboardAuth:Te};z.password&&(ut.dashboardPassword=z.password);const Rt=await fe.settings.update(ut);J(Rt.needsRestart),w(jt=>jt&&{...jt,auth:Rt.dashboardAuth,password:"",confirm:""}),n.success("Access settings saved",Rt.needsRestart?"Restart the dashboard for the new listening address to take effect.":void 0),v.reload()}catch(ut){ee(H4(ut))}finally{I(!1)}},[Pe,Ve]=p.useState(null),[Xe,ce]=p.useState(!1),[De,we]=p.useState(null),nt=async()=>{if(!Xe){ce(!0),Ve(null);try{const Te=await fe.settings.setupPermissions();we(Te),Te.configured&&(b.setData({configured:!0}),n.success("Permissions configured","nginx and systemctl no longer prompt for a password."))}catch(Te){Ve(Nr(Te,"The setup commands could not be prepared."))}finally{ce(!1)}}},rt=()=>{Ve(null),b.reload()},xt=p.useRef(null),[bt,zn]=p.useState(!1),[jn,na]=p.useState(!1),[F,be]=p.useState(null),Ue=async()=>{if(!bt){zn(!0);try{const Te=await fe.settings.backup(),ut=new Blob([JSON.stringify(Te,null,2)],{type:"application/json"}),Rt=URL.createObjectURL(ut),jt=document.createElement("a");jt.href=Rt,jt.download=`easy-devops-backup-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(jt),jt.click(),jt.remove(),window.setTimeout(()=>URL.revokeObjectURL(Rt),1e3),n.success("Backup downloaded")}catch(Te){n.error("Could not create the backup",Nr(Te,"Nothing was downloaded."))}finally{zn(!1)}}},Dt=async Te=>{const ut=Te.target.files?.[0];if(!ut)return;be(null);let Rt;try{Rt=JSON.parse(await ut.text())}catch{be({tone:"danger",title:"That file is not valid JSON",body:"Pick the .json file produced by Export backup."}),Te.target.value="";return}const jt=Rt;if(!jt||typeof jt!="object"||typeof jt.config!="object"||jt.config===null){be({tone:"danger",title:"That file is not an Easy DevOps backup",body:"A backup always contains a config section and a domains list."}),Te.target.value="";return}const Ze=await i({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(Te.target.value="",!!Ze){na(!0);try{await fe.settings.restore(Rt);const It=await fe.settings.get();v.setData(It),C(dh(It)),w(fh(It)),E(!1),Y(!1),J(!1),b.reload(),be({tone:"success",title:"Backup restored",body:`Configuration from ${Qh(jt.exportedAt??null)} is now in force. Reload any other open dashboard tabs to pick it up.`}),n.success("Backup restored")}catch(It){be({tone:"danger",title:"The restore failed",body:Nr(It,"Nothing was changed.")})}finally{na(!1)}}},aa=()=>{v.reload(),b.reload(),h==="general"&&S()},Ke=ne&&a.jsx(ve,{tone:"info",title:"Restart needed",children:"The port or listening address changed. It takes effect after the dashboard restarts."}),vl=()=>v.error&&!v.data?a.jsx($t,{error:v.error,title:"Could not read the settings",onRetry:v.reload}):!v.data||!k?a.jsxs(ns,{children:[a.jsx(tt,{className:"h-64 rounded-lg"}),a.jsx(tt,{className:"h-40 rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Bb,{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(xn,{className:"space-y-5",children:[Ke,a.jsxs(Ja,{children:[a.jsx(Me,{label:"Dashboard port",type:"number",min:1,max:65535,inputMode:"numeric",value:k.port,onChange:Te=>C({...k,port:Te.target.value}),error:O?B:null,hint:"Takes effect after the dashboard restarts."}),a.jsx(Me,{label:"ACME email",type:"email",value:k.acmeEmail,onChange:Te=>C({...k,acmeEmail:Te.target.value}),error:O?L:null,hint:"Used when ordering certificates. Usually not shown to anyone.",placeholder:"admin@example.com"}),a.jsx(Me,{label:"Nginx directory",value:k.nginxDir,onChange:Te=>C({...k,nginxDir:Te.target.value}),error:O?te:null,hint:"Where nginx.conf is located.",className:"font-mono",spellCheck:!1}),a.jsx(Me,{label:"SSL settings directory",value:k.sslDir,onChange:Te=>C({...k,sslDir:Te.target.value}),error:O?de:null,hint:"Default directory for certificates the dashboard manages.",className:"font-mono",spellCheck:!1}),ke&&a.jsx(Me,{label:"Deployments folder",value:k.deployDir,onChange:Te=>C({...k,deployDir:Te.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",v.data.deployDirDefault?` (${v.data.deployDirDefault})`:"","."]}),placeholder:v.data.deployDirDefault,className:"font-mono",spellCheck:!1}),T&&a.jsxs(pa,{label:"Dashboard interface",value:k.ui,onChange:Te=>C({...k,ui:Te.target.value}),hint:"Applies the next time the dashboard starts.",children:[a.jsx("option",{value:"new",children:"New — this dashboard"}),a.jsx("option",{value:"classic",children:"Classic — the older page"})]})]}),Ee&&a.jsxs("div",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(Zt,{checked:k.autoRenew,onChange:Te=>C({...k,autoRenew:Te}),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."})}),k.autoRenew&&a.jsx(Ja,{children:a.jsx(Me,{label:"Renew this many days before expiry",type:"number",min:q,max:V,inputMode:"numeric",value:k.autoRenewDays,onChange:Te=>C({...k,autoRenewDays:Te.target.value}),error:O?ye:null,hint:k.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(Ec,{children:[a.jsx("span",{className:"text-2xs text-faint",children:Re?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{variant:"ghost",size:"sm",disabled:!Re,onClick:()=>{C(dh(v.data)),E(!1)},children:"Revert"}),a.jsx(se,{variant:"primary",size:"sm",loading:A,disabled:!Re,icon:a.jsx(yh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void me(),children:"Save settings"})]})]})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Hb,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Background service",R&&a.jsx(je,{tone:R.running?"ok":"warn",dot:!0,children:_c(R)}),x?.dev&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Runs monitoring and notifications without this dashboard open.",actions:a.jsx(kt,{to:"/processes",className:ma("secondary","sm"),children:"Open Processes"})}),a.jsx(xn,{children:j&&!x?a.jsxs(ve,{tone:"warning",title:"Could not read the service state",children:[j.message," ",a.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:S,children:"Try again"})]}):x?R?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:oe("mt-0.5 text-sm font-medium",R.running?"text-ok":"text-warn"),children:_c(R)}),R.stoppedByUser&&R.stoppedAtLabel&&a.jsxs("div",{className:"mt-0.5 text-2xs text-faint",children:["Stopped ",R.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:R.mechanismDetail,children:R.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:R.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:x.pm2.installed===null?"Checking…":x.pm2.installed?x.pm2.version??"Installed":"Not installed"}),x.probes?.pending?a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:"Measuring…"}):x.probes?.refreshing?a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:"Refreshing…"}):null]})]}):null:a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(_s,{}),"Checking the background service…"]})})]})]}),bl=()=>{if(v.error&&!v.data)return a.jsx($t,{error:v.error,title:"Could not read the settings",onRetry:v.reload});if(!v.data||!z)return a.jsxs(ns,{children:[a.jsx(tt,{className:"h-72 rounded-lg"}),a.jsx(tt,{className:"h-40 rounded-lg"})]});const Te=z.bind!=="0.0.0.0",ut=v.data.canUseNoPassword||Te,Rt=z.password?tv(z.password,c)??(z.confirm&&z.password!==z.confirm?"The two passwords do not match.":null):null,jt=ue??(M?Rt:null);return a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Ur,{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(xn,{className:"space-y-5",children:[Ke,Z&&a.jsx(ve,{tone:"danger",title:"Could not save access settings",children:Z}),a.jsxs(Ja,{children:[a.jsxs(pa,{label:"Listen on",value:z.bind,onChange:Ze=>{const It=Ze.target.value;w({...z,bind:It,auth:It==="0.0.0.0"?"password":z.auth})},hint:z.auth==="none"?"Locked to this machine while there is no password.":"Changing this needs a dashboard restart.",children:[Oh.map(Ze=>a.jsx("option",{value:Ze.value,disabled:Ze.value==="0.0.0.0"&&z.auth==="none",children:Ze.label},Ze.value)),!Oh.some(Ze=>Ze.value===z.bind)&&a.jsx("option",{value:z.bind,children:U4(z.bind)})]}),a.jsxs(pa,{label:"Authentication",value:z.auth,onChange:Ze=>{const It=Ze.target.value;w({...z,auth:It,bind:It==="none"?"127.0.0.1":z.bind}),K(null)},hint:z.auth==="none"?"No login — reachable from this machine only.":!v.data.hasPassword&&!z.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:!ut,children:"No password (this machine only)"})]})]}),z.auth==="none"&&a.jsx(ve,{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(Me,{label:"New password",type:"password",autoComplete:"new-password",value:z.password,onChange:Ze=>{w({...z,password:Ze.target.value}),K(null)},error:jt,hint:`Leave blank to keep the current password. At least ${c} characters.`}),a.jsx(Me,{label:"Confirm new password",type:"password",autoComplete:"new-password",value:z.confirm,onChange:Ze=>{w({...z,confirm:Ze.target.value}),K(null)}})]})]}),a.jsxs(Ec,{children:[a.jsx("span",{className:"text-2xs text-faint",children:xe?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{variant:"ghost",size:"sm",disabled:!xe,onClick:()=>{w(fh(v.data)),Y(!1),ee(null),K(null)},children:"Revert"}),a.jsx(se,{variant:"primary",size:"sm",loading:W,disabled:!xe,icon:a.jsx(yh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void ie(),children:"Save access"})]})]})]}),v.data.platform!=="win32"&&a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",b.data?.configured?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Rn,{className:"size-4","aria-hidden":"true"}),title:"Linux permissions",description:"Passwordless sudo for nginx and systemctl.",actions:b.data?a.jsx(je,{tone:b.data.configured?"ok":"warn",dot:!0,children:b.data.configured?"Configured":"Required"}):void 0}),a.jsx(xn,{children:b.error&&!b.data?a.jsx($t,{error:b.error,title:"Could not read the permission state",onRetry:b.reload,className:"border-0"}):b.data?b.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-2xl space-y-4",children:[a.jsx("p",{className:"text-sm text-muted",children:"The dashboard needs passwordless sudo to control nginx and systemctl. Generate the exact commands below, then run them once in a terminal on this server — sudo asks for your password there, never in this browser."}),Pe&&a.jsx(ve,{tone:"danger",title:"Setup commands were not prepared",children:Pe}),De&&De.commands.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("p",{className:"text-xs font-medium text-ink",children:"Run these in a terminal"}),a.jsx(qt,{value:De.commands.join(`
523
+ `},C3={onDragStart(n){let{active:i}=n;return"Picked up draggable item "+i.id+"."},onDragOver(n){let{active:i,over:r}=n;return r?"Draggable item "+i.id+" was moved over droppable area "+r.id+".":"Draggable item "+i.id+" is no longer over a droppable area."},onDragEnd(n){let{active:i,over:r}=n;return r?"Draggable item "+i.id+" was dropped over droppable area "+r.id:"Draggable item "+i.id+" was dropped."},onDragCancel(n){let{active:i}=n;return"Dragging was cancelled. Draggable item "+i.id+" was dropped."}};function T3(n){let{announcements:i=C3,container:r,hiddenTextDescribedById:c,screenReaderInstructions:d=k3}=n;const{announce:f,announcement:m}=N3(),h=Xr("DndLiveRegion"),[g,y]=p.useState(!1);if(p.useEffect(()=>{y(!0)},[]),w3(p.useMemo(()=>({onDragStart(x){let{active:j}=x;f(i.onDragStart({active:j}))},onDragMove(x){let{active:j,over:S}=x;i.onDragMove&&f(i.onDragMove({active:j,over:S}))},onDragOver(x){let{active:j,over:S}=x;f(i.onDragOver({active:j,over:S}))},onDragEnd(x){let{active:j,over:S}=x;f(i.onDragEnd({active:j,over:S}))},onDragCancel(x){let{active:j,over:S}=x;f(i.onDragCancel({active:j,over:S}))}}),[f,i])),!g)return null;const b=vt.createElement(vt.Fragment,null,vt.createElement(b3,{id:c,value:d.draggable}),vt.createElement(j3,{id:h,announcement:m}));return r?ol.createPortal(b,r):b}var $t;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})($t||($t={}));function Kc(){}function lh(n,i){return p.useMemo(()=>({sensor:n,options:i??{}}),[n,i])}function E3(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return p.useMemo(()=>[...i].filter(c=>c!=null),[...i])}const ya=Object.freeze({x:0,y:0});function T0(n,i){return Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2))}function R3(n,i){const r=Xc(n);if(!r)return"0 0";const c={x:(r.x-i.left)/i.width*100,y:(r.y-i.top)/i.height*100};return c.x+"% "+c.y+"%"}function E0(n,i){let{data:{value:r}}=n,{data:{value:c}}=i;return r-c}function z3(n,i){let{data:{value:r}}=n,{data:{value:c}}=i;return c-r}function Ry(n){let{left:i,top:r,height:c,width:d}=n;return[{x:i,y:r},{x:i+d,y:r},{x:i,y:r+c},{x:i+d,y:r+c}]}function R0(n,i){if(!n||n.length===0)return null;const[r]=n;return r[i]}function zy(n,i,r){return i===void 0&&(i=n.left),r===void 0&&(r=n.top),{x:i+n.width*.5,y:r+n.height*.5}}const D3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=zy(i,i.left,i.top),f=[];for(const m of c){const{id:h}=m,g=r.get(h);if(g){const y=T0(zy(g),d);f.push({id:h,data:{droppableContainer:m,value:y}})}}return f.sort(E0)},A3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=Ry(i),f=[];for(const m of c){const{id:h}=m,g=r.get(h);if(g){const y=Ry(g),b=d.reduce((j,S,R)=>j+T0(y[R],S),0),x=Number((b/4).toFixed(4));f.push({id:h,data:{droppableContainer:m,value:x}})}}return f.sort(E0)};function O3(n,i){const r=Math.max(i.top,n.top),c=Math.max(i.left,n.left),d=Math.min(i.left+i.width,n.left+n.width),f=Math.min(i.top+i.height,n.top+n.height),m=d-c,h=f-r;if(c<d&&r<f){const g=i.width*i.height,y=n.width*n.height,b=m*h,x=b/(g+y-b);return Number(x.toFixed(4))}return 0}const M3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=[];for(const f of c){const{id:m}=f,h=r.get(m);if(h){const g=O3(h,i);g>0&&d.push({id:m,data:{droppableContainer:f,value:g}})}}return d.sort(z3)};function _3(n,i,r){return{...n,scaleX:i&&r?i.width/r.width:1,scaleY:i&&r?i.height/r.height:1}}function z0(n,i){return n&&i?{x:n.left-i.left,y:n.top-i.top}:ya}function L3(n){return function(r){for(var c=arguments.length,d=new Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];return d.reduce((m,h)=>({...m,top:m.top+n*h.y,bottom:m.bottom+n*h.y,left:m.left+n*h.x,right:m.right+n*h.x}),{...r})}}const U3=L3(1);function D0(n){if(n.startsWith("matrix3d(")){const i=n.slice(9,-1).split(/, /);return{x:+i[12],y:+i[13],scaleX:+i[0],scaleY:+i[5]}}else if(n.startsWith("matrix(")){const i=n.slice(7,-1).split(/, /);return{x:+i[4],y:+i[5],scaleX:+i[0],scaleY:+i[3]}}return null}function H3(n,i,r){const c=D0(i);if(!c)return n;const{scaleX:d,scaleY:f,x:m,y:h}=c,g=n.left-m-(1-d)*parseFloat(r),y=n.top-h-(1-f)*parseFloat(r.slice(r.indexOf(" ")+1)),b=d?n.width/d:n.width,x=f?n.height/f:n.height;return{width:b,height:x,top:y,right:g+b,bottom:y+x,left:g}}const B3={ignoreTransform:!1};function Si(n,i){i===void 0&&(i=B3);let r=n.getBoundingClientRect();if(i.ignoreTransform){const{transform:y,transformOrigin:b}=bn(n).getComputedStyle(n);y&&(r=H3(r,y,b))}const{top:c,left:d,width:f,height:m,bottom:h,right:g}=r;return{top:c,left:d,width:f,height:m,bottom:h,right:g}}function Dy(n){return Si(n,{ignoreTransform:!0})}function $3(n){const i=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:i,bottom:r,width:i,height:r}}function q3(n,i){return i===void 0&&(i=bn(n).getComputedStyle(n)),i.position==="fixed"}function G3(n,i){i===void 0&&(i=bn(n).getComputedStyle(n));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(d=>{const f=i[d];return typeof f=="string"?r.test(f):!1})}function mu(n,i){const r=[];function c(d){if(i!=null&&r.length>=i||!d)return r;if(am(d)&&d.scrollingElement!=null&&!r.includes(d.scrollingElement))return r.push(d.scrollingElement),r;if(!Yr(d)||S0(d)||r.includes(d))return r;const f=bn(n).getComputedStyle(d);return d!==n&&G3(d,f)&&r.push(d),q3(d,f)?r:c(d.parentNode)}return n?c(n):r}function A0(n){const[i]=mu(n,1);return i??null}function ih(n){return!du||!n?null:Ni(n)?n:nm(n)?am(n)||n===wi(n).scrollingElement?window:Yr(n)?n:null:null}function O0(n){return Ni(n)?n.scrollX:n.scrollLeft}function M0(n){return Ni(n)?n.scrollY:n.scrollTop}function Ah(n){return{x:O0(n),y:M0(n)}}var Qt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Qt||(Qt={}));function _0(n){return!du||!n?!1:n===document.scrollingElement}function L0(n){const i={x:0,y:0},r=_0(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},c={x:n.scrollWidth-r.width,y:n.scrollHeight-r.height},d=n.scrollTop<=i.y,f=n.scrollLeft<=i.x,m=n.scrollTop>=c.y,h=n.scrollLeft>=c.x;return{isTop:d,isLeft:f,isBottom:m,isRight:h,maxScroll:c,minScroll:i}}const Y3={x:.2,y:.2};function V3(n,i,r,c,d){let{top:f,left:m,right:h,bottom:g}=r;c===void 0&&(c=10),d===void 0&&(d=Y3);const{isTop:y,isBottom:b,isLeft:x,isRight:j}=L0(n),S={x:0,y:0},R={x:0,y:0},k={height:i.height*d.y,width:i.width*d.x};return!y&&f<=i.top+k.height?(S.y=Qt.Backward,R.y=c*Math.abs((i.top+k.height-f)/k.height)):!b&&g>=i.bottom-k.height&&(S.y=Qt.Forward,R.y=c*Math.abs((i.bottom-k.height-g)/k.height)),!j&&h>=i.right-k.width?(S.x=Qt.Forward,R.x=c*Math.abs((i.right-k.width-h)/k.width)):!x&&m<=i.left+k.width&&(S.x=Qt.Backward,R.x=c*Math.abs((i.left+k.width-m)/k.width)),{direction:S,speed:R}}function X3(n){if(n===document.scrollingElement){const{innerWidth:f,innerHeight:m}=window;return{top:0,left:0,right:f,bottom:m,width:f,height:m}}const{top:i,left:r,right:c,bottom:d}=n.getBoundingClientRect();return{top:i,left:r,right:c,bottom:d,width:n.clientWidth,height:n.clientHeight}}function U0(n){return n.reduce((i,r)=>pi(i,Ah(r)),ya)}function K3(n){return n.reduce((i,r)=>i+O0(r),0)}function Z3(n){return n.reduce((i,r)=>i+M0(r),0)}function H0(n,i){if(i===void 0&&(i=Si),!n)return;const{top:r,left:c,bottom:d,right:f}=i(n);A0(n)&&(d<=0||f<=0||r>=window.innerHeight||c>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const Q3=[["x",["left","right"],K3],["y",["top","bottom"],Z3]];class sm{constructor(i,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const c=mu(r),d=U0(c);this.rect={...i},this.width=i.width,this.height=i.height;for(const[f,m,h]of Q3)for(const g of m)Object.defineProperty(this,g,{get:()=>{const y=h(c),b=d[f]-y;return this.rect[g]+b},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class wr{constructor(i){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var c;return(c=this.target)==null?void 0:c.removeEventListener(...r)})},this.target=i}add(i,r,c){var d;(d=this.target)==null||d.addEventListener(i,r,c),this.listeners.push([i,r,c])}}function I3(n){const{EventTarget:i}=bn(n);return n instanceof i?n:wi(n)}function rh(n,i){const r=Math.abs(n.x),c=Math.abs(n.y);return typeof i=="number"?Math.sqrt(r**2+c**2)>i:"x"in i&&"y"in i?r>i.x&&c>i.y:"x"in i?r>i.x:"y"in i?c>i.y:!1}var Wn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Wn||(Wn={}));function Ay(n){n.preventDefault()}function P3(n){n.stopPropagation()}var Ie;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Ie||(Ie={}));const B0={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter,Ie.Tab]},F3=(n,i)=>{let{currentCoordinates:r}=i;switch(n.code){case Ie.Right:return{...r,x:r.x+25};case Ie.Left:return{...r,x:r.x-25};case Ie.Down:return{...r,y:r.y+25};case Ie.Up:return{...r,y:r.y-25}}};class lm{constructor(i){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=i;const{event:{target:r}}=i;this.props=i,this.listeners=new wr(wi(r)),this.windowListeners=new wr(bn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Wn.Resize,this.handleCancel),this.windowListeners.add(Wn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Wn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:i,onStart:r}=this.props,c=i.node.current;c&&H0(c),r(ya)}handleKeyDown(i){if(hu(i)){const{active:r,context:c,options:d}=this.props,{keyboardCodes:f=B0,coordinateGetter:m=F3,scrollBehavior:h="smooth"}=d,{code:g}=i;if(f.end.includes(g)){this.handleEnd(i);return}if(f.cancel.includes(g)){this.handleCancel(i);return}const{collisionRect:y}=c.current,b=y?{x:y.left,y:y.top}:ya;this.referenceCoordinates||(this.referenceCoordinates=b);const x=m(i,{active:r,context:c.current,currentCoordinates:b});if(x){const j=Or(x,b),S={x:0,y:0},{scrollableAncestors:R}=c.current;for(const k of R){const C=i.code,{isTop:D,isRight:E,isLeft:O,isBottom:w,maxScroll:U,minScroll:Y}=L0(k),A=X3(k),M={x:Math.min(C===Ie.Right?A.right-A.width/2:A.right,Math.max(C===Ie.Right?A.left:A.left+A.width/2,x.x)),y:Math.min(C===Ie.Down?A.bottom-A.height/2:A.bottom,Math.max(C===Ie.Down?A.top:A.top+A.height/2,x.y))},W=C===Ie.Right&&!E||C===Ie.Left&&!O,I=C===Ie.Down&&!w||C===Ie.Up&&!D;if(W&&M.x!==x.x){const ne=k.scrollLeft+j.x,F=C===Ie.Right&&ne<=U.x||C===Ie.Left&&ne>=Y.x;if(F&&!j.y){k.scrollTo({left:ne,behavior:h});return}F?S.x=k.scrollLeft-ne:S.x=C===Ie.Right?k.scrollLeft-U.x:k.scrollLeft-Y.x,S.x&&k.scrollBy({left:-S.x,behavior:h});break}else if(I&&M.y!==x.y){const ne=k.scrollTop+j.y,F=C===Ie.Down&&ne<=U.y||C===Ie.Up&&ne>=Y.y;if(F&&!j.x){k.scrollTo({top:ne,behavior:h});return}F?S.y=k.scrollTop-ne:S.y=C===Ie.Down?k.scrollTop-U.y:k.scrollTop-Y.y,S.y&&k.scrollBy({top:-S.y,behavior:h});break}}this.handleMove(i,pi(Or(x,this.referenceCoordinates),S))}}}handleMove(i,r){const{onMove:c}=this.props;i.preventDefault(),c(r)}handleEnd(i){const{onEnd:r}=this.props;i.preventDefault(),this.detach(),r()}handleCancel(i){const{onCancel:r}=this.props;i.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}lm.activators=[{eventName:"onKeyDown",handler:(n,i,r)=>{let{keyboardCodes:c=B0,onActivation:d}=i,{active:f}=r;const{code:m}=n.nativeEvent;if(c.start.includes(m)){const h=f.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),d?.({event:n.nativeEvent}),!0)}return!1}}];function Oy(n){return!!(n&&"distance"in n)}function My(n){return!!(n&&"delay"in n)}class im{constructor(i,r,c){var d;c===void 0&&(c=I3(i.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=i,this.events=r;const{event:f}=i,{target:m}=f;this.props=i,this.events=r,this.document=wi(m),this.documentListeners=new wr(this.document),this.listeners=new wr(c),this.windowListeners=new wr(bn(m)),this.initialCoordinates=(d=Xc(f))!=null?d:ya,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:i,props:{options:{activationConstraint:r,bypassActivationConstraint:c}}}=this;if(this.listeners.add(i.move.name,this.handleMove,{passive:!1}),this.listeners.add(i.end.name,this.handleEnd),i.cancel&&this.listeners.add(i.cancel.name,this.handleCancel),this.windowListeners.add(Wn.Resize,this.handleCancel),this.windowListeners.add(Wn.DragStart,Ay),this.windowListeners.add(Wn.VisibilityChange,this.handleCancel),this.windowListeners.add(Wn.ContextMenu,Ay),this.documentListeners.add(Wn.Keydown,this.handleKeydown),r){if(c!=null&&c({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(My(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Oy(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(i,r){const{active:c,onPending:d}=this.props;d(c,i,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:i}=this,{onStart:r}=this.props;i&&(this.activated=!0,this.documentListeners.add(Wn.Click,P3,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Wn.SelectionChange,this.removeTextSelection),r(i))}handleMove(i){var r;const{activated:c,initialCoordinates:d,props:f}=this,{onMove:m,options:{activationConstraint:h}}=f;if(!d)return;const g=(r=Xc(i))!=null?r:ya,y=Or(d,g);if(!c&&h){if(Oy(h)){if(h.tolerance!=null&&rh(y,h.tolerance))return this.handleCancel();if(rh(y,h.distance))return this.handleStart()}if(My(h)&&rh(y,h.tolerance))return this.handleCancel();this.handlePending(h,y);return}i.cancelable&&i.preventDefault(),m(g)}handleEnd(){const{onAbort:i,onEnd:r}=this.props;this.detach(),this.activated||i(this.props.active),r()}handleCancel(){const{onAbort:i,onCancel:r}=this.props;this.detach(),this.activated||i(this.props.active),r()}handleKeydown(i){i.code===Ie.Esc&&this.handleCancel()}removeTextSelection(){var i;(i=this.document.getSelection())==null||i.removeAllRanges()}}const J3={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class rm extends im{constructor(i){const{event:r}=i,c=wi(r.target);super(i,J3,c)}}rm.activators=[{eventName:"onPointerDown",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;return!r.isPrimary||r.button!==0?!1:(c?.({event:r}),!0)}}];const W3={move:{name:"mousemove"},end:{name:"mouseup"}};var Oh;(function(n){n[n.RightClick=2]="RightClick"})(Oh||(Oh={}));class eE extends im{constructor(i){super(i,W3,wi(i.event.target))}}eE.activators=[{eventName:"onMouseDown",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;return r.button===Oh.RightClick?!1:(c?.({event:r}),!0)}}];const oh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class $0 extends im{constructor(i){super(i,oh)}static setup(){return window.addEventListener(oh.move.name,i,{capture:!1,passive:!1}),function(){window.removeEventListener(oh.move.name,i)};function i(){}}}$0.activators=[{eventName:"onTouchStart",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;const{touches:d}=r;return d.length>1?!1:(c?.({event:r}),!0)}}];var Sr;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Sr||(Sr={}));var Zc;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zc||(Zc={}));function tE(n){let{acceleration:i,activator:r=Sr.Pointer,canScroll:c,draggingRect:d,enabled:f,interval:m=5,order:h=Zc.TreeOrder,pointerCoordinates:g,scrollableAncestors:y,scrollableAncestorRects:b,delta:x,threshold:j}=n;const S=aE({delta:x,disabled:!f}),[R,k]=p3(),C=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0}),E=p.useMemo(()=>{switch(r){case Sr.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case Sr.DraggableRect:return d}},[r,d,g]),O=p.useRef(null),w=p.useCallback(()=>{const Y=O.current;if(!Y)return;const A=C.current.x*D.current.x,M=C.current.y*D.current.y;Y.scrollBy(A,M)},[]),U=p.useMemo(()=>h===Zc.TreeOrder?[...y].reverse():y,[h,y]);p.useEffect(()=>{if(!f||!y.length||!E){k();return}for(const Y of U){if(c?.(Y)===!1)continue;const A=y.indexOf(Y),M=b[A];if(!M)continue;const{direction:W,speed:I}=V3(Y,M,E,i,j);for(const ne of["x","y"])S[ne][W[ne]]||(I[ne]=0,W[ne]=0);if(I.x>0||I.y>0){k(),O.current=Y,R(w,m),C.current=I,D.current=W;return}}C.current={x:0,y:0},D.current={x:0,y:0},k()},[i,w,c,k,f,m,JSON.stringify(E),JSON.stringify(S),R,y,U,b,JSON.stringify(j)])}const nE={x:{[Qt.Backward]:!1,[Qt.Forward]:!1},y:{[Qt.Backward]:!1,[Qt.Forward]:!1}};function aE(n){let{delta:i,disabled:r}=n;const c=Vc(i);return Vr(d=>{if(r||!c||!d)return nE;const f={x:Math.sign(i.x-c.x),y:Math.sign(i.y-c.y)};return{x:{[Qt.Backward]:d.x[Qt.Backward]||f.x===-1,[Qt.Forward]:d.x[Qt.Forward]||f.x===1},y:{[Qt.Backward]:d.y[Qt.Backward]||f.y===-1,[Qt.Forward]:d.y[Qt.Forward]||f.y===1}}},[r,i,c])}function sE(n,i){const r=i!=null?n.get(i):void 0,c=r?r.node.current:null;return Vr(d=>{var f;return i==null?null:(f=c??d)!=null?f:null},[c,i])}function lE(n,i){return p.useMemo(()=>n.reduce((r,c)=>{const{sensor:d}=c,f=d.activators.map(m=>({eventName:m.eventName,handler:i(m.handler,c)}));return[...r,...f]},[]),[n,i])}var Mr;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(Mr||(Mr={}));var Mh;(function(n){n.Optimized="optimized"})(Mh||(Mh={}));const _y=new Map;function iE(n,i){let{dragging:r,dependencies:c,config:d}=i;const[f,m]=p.useState(null),{frequency:h,measure:g,strategy:y}=d,b=p.useRef(n),x=C(),j=Ar(x),S=p.useCallback(function(D){D===void 0&&(D=[]),!j.current&&m(E=>E===null?D:E.concat(D.filter(O=>!E.includes(O))))},[j]),R=p.useRef(null),k=Vr(D=>{if(x&&!r)return _y;if(!D||D===_y||b.current!==n||f!=null){const E=new Map;for(let O of n){if(!O)continue;if(f&&f.length>0&&!f.includes(O.id)&&O.rect.current){E.set(O.id,O.rect.current);continue}const w=O.node.current,U=w?new sm(g(w),w):null;O.rect.current=U,U&&E.set(O.id,U)}return E}return D},[n,f,r,x,g]);return p.useEffect(()=>{b.current=n},[n]),p.useEffect(()=>{x||S()},[r,x]),p.useEffect(()=>{f&&f.length>0&&m(null)},[JSON.stringify(f)]),p.useEffect(()=>{x||typeof h!="number"||R.current!==null||(R.current=setTimeout(()=>{S(),R.current=null},h))},[h,x,S,...c]),{droppableRects:k,measureDroppableContainers:S,measuringScheduled:f!=null};function C(){switch(y){case Mr.Always:return!1;case Mr.BeforeDragging:return r;default:return!r}}}function om(n,i){return Vr(r=>n?r||(typeof i=="function"?i(n):n):null,[i,n])}function rE(n,i){return om(n,i)}function oE(n){let{callback:i,disabled:r}=n;const c=fu(i),d=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:f}=window;return new f(c)},[c,r]);return p.useEffect(()=>()=>d?.disconnect(),[d]),d}function pu(n){let{callback:i,disabled:r}=n;const c=fu(i),d=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:f}=window;return new f(c)},[r]);return p.useEffect(()=>()=>d?.disconnect(),[d]),d}function cE(n){return new sm(Si(n),n)}function Ly(n,i,r){i===void 0&&(i=cE);const[c,d]=p.useState(null);function f(){d(g=>{if(!n)return null;if(n.isConnected===!1){var y;return(y=g??r)!=null?y:null}const b=i(n);return JSON.stringify(g)===JSON.stringify(b)?g:b})}const m=oE({callback(g){if(n)for(const y of g){const{type:b,target:x}=y;if(b==="childList"&&x instanceof HTMLElement&&x.contains(n)){f();break}}}}),h=pu({callback:f});return va(()=>{f(),n?(h?.observe(n),m?.observe(document.body,{childList:!0,subtree:!0})):(h?.disconnect(),m?.disconnect())},[n]),c}function uE(n){const i=om(n);return z0(n,i)}const Uy=[];function dE(n){const i=p.useRef(n),r=Vr(c=>n?c&&c!==Uy&&n&&i.current&&n.parentNode===i.current.parentNode?c:mu(n):Uy,[n]);return p.useEffect(()=>{i.current=n},[n]),r}function fE(n){const[i,r]=p.useState(null),c=p.useRef(n),d=p.useCallback(f=>{const m=ih(f.target);m&&r(h=>h?(h.set(m,Ah(m)),new Map(h)):null)},[]);return p.useEffect(()=>{const f=c.current;if(n!==f){m(f);const h=n.map(g=>{const y=ih(g);return y?(y.addEventListener("scroll",d,{passive:!0}),[y,Ah(y)]):null}).filter(g=>g!=null);r(h.length?new Map(h):null),c.current=n}return()=>{m(n),m(f)};function m(h){h.forEach(g=>{const y=ih(g);y?.removeEventListener("scroll",d)})}},[d,n]),p.useMemo(()=>n.length?i?Array.from(i.values()).reduce((f,m)=>pi(f,m),ya):U0(n):ya,[n,i])}function Hy(n,i){i===void 0&&(i=[]);const r=p.useRef(null);return p.useEffect(()=>{r.current=null},i),p.useEffect(()=>{const c=n!==ya;c&&!r.current&&(r.current=n),!c&&r.current&&(r.current=null)},[n]),r.current?Or(n,r.current):ya}function hE(n){p.useEffect(()=>{if(!du)return;const i=n.map(r=>{let{sensor:c}=r;return c.setup==null?void 0:c.setup()});return()=>{for(const r of i)r?.()}},n.map(i=>{let{sensor:r}=i;return r}))}function mE(n,i){return p.useMemo(()=>n.reduce((r,c)=>{let{eventName:d,handler:f}=c;return r[d]=m=>{f(m,i)},r},{}),[n,i])}function q0(n){return p.useMemo(()=>n?$3(n):null,[n])}const By=[];function pE(n,i){i===void 0&&(i=Si);const[r]=n,c=q0(r?bn(r):null),[d,f]=p.useState(By);function m(){f(()=>n.length?n.map(g=>_0(g)?c:new sm(i(g),g)):By)}const h=pu({callback:m});return va(()=>{h?.disconnect(),m(),n.forEach(g=>h?.observe(g))},[n]),d}function G0(n){if(!n)return null;if(n.children.length>1)return n;const i=n.children[0];return Yr(i)?i:n}function xE(n){let{measure:i}=n;const[r,c]=p.useState(null),d=p.useCallback(y=>{for(const{target:b}of y)if(Yr(b)){c(x=>{const j=i(b);return x?{...x,width:j.width,height:j.height}:j});break}},[i]),f=pu({callback:d}),m=p.useCallback(y=>{const b=G0(y);f?.disconnect(),b&&f?.observe(b),c(b?i(b):null)},[i,f]),[h,g]=Yc(m);return p.useMemo(()=>({nodeRef:h,rect:r,setRef:g}),[r,h,g])}const gE=[{sensor:rm,options:{}},{sensor:lm,options:{}}],vE={current:{}},Oc={draggable:{measure:Dy},droppable:{measure:Dy,strategy:Mr.WhileDragging,frequency:Mh.Optimized},dragOverlay:{measure:Si}};class kr extends Map{get(i){var r;return i!=null&&(r=super.get(i))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(i=>{let{disabled:r}=i;return!r})}getNodeFor(i){var r,c;return(r=(c=this.get(i))==null?void 0:c.node.current)!=null?r:void 0}}const yE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Kc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Oc,measureDroppableContainers:Kc,windowRect:null,measuringScheduled:!1},Y0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Kc,draggableNodes:new Map,over:null,measureDroppableContainers:Kc},Kr=p.createContext(Y0),V0=p.createContext(yE);function bE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kr}}}function jE(n,i){switch(i.type){case $t.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:i.initialCoordinates,active:i.active}};case $t.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:i.coordinates.x-n.draggable.initialCoordinates.x,y:i.coordinates.y-n.draggable.initialCoordinates.y}}};case $t.DragEnd:case $t.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $t.RegisterDroppable:{const{element:r}=i,{id:c}=r,d=new kr(n.droppable.containers);return d.set(c,r),{...n,droppable:{...n.droppable,containers:d}}}case $t.SetDroppableDisabled:{const{id:r,key:c,disabled:d}=i,f=n.droppable.containers.get(r);if(!f||c!==f.key)return n;const m=new kr(n.droppable.containers);return m.set(r,{...f,disabled:d}),{...n,droppable:{...n.droppable,containers:m}}}case $t.UnregisterDroppable:{const{id:r,key:c}=i,d=n.droppable.containers.get(r);if(!d||c!==d.key)return n;const f=new kr(n.droppable.containers);return f.delete(r),{...n,droppable:{...n.droppable,containers:f}}}default:return n}}function NE(n){let{disabled:i}=n;const{active:r,activatorEvent:c,draggableNodes:d}=p.useContext(Kr),f=Vc(c),m=Vc(r?.id);return p.useEffect(()=>{if(!i&&!c&&f&&m!=null){if(!hu(f)||document.activeElement===f.target)return;const h=d.get(m);if(!h)return;const{activatorNode:g,node:y}=h;if(!g.current&&!y.current)return;requestAnimationFrame(()=>{for(const b of[g.current,y.current]){if(!b)continue;const x=v3(b);if(x){x.focus();break}}})}},[c,i,d,m,f]),null}function X0(n,i){let{transform:r,...c}=i;return n!=null&&n.length?n.reduce((d,f)=>f({transform:d,...c}),r):r}function wE(n){return p.useMemo(()=>({draggable:{...Oc.draggable,...n?.draggable},droppable:{...Oc.droppable,...n?.droppable},dragOverlay:{...Oc.dragOverlay,...n?.dragOverlay}}),[n?.draggable,n?.droppable,n?.dragOverlay])}function SE(n){let{activeNode:i,measure:r,initialRect:c,config:d=!0}=n;const f=p.useRef(!1),{x:m,y:h}=typeof d=="boolean"?{x:d,y:d}:d;va(()=>{if(!m&&!h||!i){f.current=!1;return}if(f.current||!c)return;const y=i?.node.current;if(!y||y.isConnected===!1)return;const b=r(y),x=z0(b,c);if(m||(x.x=0),h||(x.y=0),f.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const j=A0(y);j&&j.scrollBy({top:x.y,left:x.x})}},[i,m,h,c,r])}const xu=p.createContext({...ya,scaleX:1,scaleY:1});var As;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(As||(As={}));const kE=p.memo(function(i){var r,c,d,f;let{id:m,accessibility:h,autoScroll:g=!0,children:y,sensors:b=gE,collisionDetection:x=M3,measuring:j,modifiers:S,...R}=i;const k=p.useReducer(jE,void 0,bE),[C,D]=k,[E,O]=S3(),[w,U]=p.useState(As.Uninitialized),Y=w===As.Initialized,{draggable:{active:A,nodes:M,translate:W},droppable:{containers:I}}=C,ne=A!=null?M.get(A):null,F=p.useRef({initial:null,translated:null}),Z=p.useMemo(()=>{var Ht;return A!=null?{id:A,data:(Ht=ne?.data)!=null?Ht:vE,rect:F}:null},[A,ne]),te=p.useRef(null),[ce,K]=p.useState(null),[H,L]=p.useState(null),ee=Ar(R,Object.values(R)),de=Xr("DndDescribedBy",m),ke=p.useMemo(()=>I.getEnabled(),[I]),Ne=wE(j),{droppableRects:Ee,measureDroppableContainers:T,measuringScheduled:q}=iE(ke,{dragging:Y,dependencies:[W.x,W.y],config:Ne.droppable}),V=sE(M,A),re=p.useMemo(()=>H?Xc(H):null,[H]),ye=Zr(),Re=rE(V,Ne.draggable.measure);SE({activeNode:A!=null?M.get(A):null,config:ye.layoutShiftCompensation,initialRect:Re,measure:Ne.draggable.measure});const xe=Ly(V,Ne.draggable.measure,Re),me=Ly(V?V.parentElement:null),ie=p.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:Ee,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Pe=I.getNodeFor((r=ie.current.over)==null?void 0:r.id),Ve=xE({measure:Ne.dragOverlay.measure}),Xe=(c=Ve.nodeRef.current)!=null?c:V,ue=Y?(d=Ve.rect)!=null?d:xe:null,De=!!(Ve.nodeRef.current&&Ve.rect),we=uE(De?null:xe),nt=q0(Xe?bn(Xe):null),rt=dE(Y?Pe??V:null),xt=pE(rt),bt=X0(S,{transform:{x:W.x-we.x,y:W.y-we.y,scaleX:1,scaleY:1},activatorEvent:H,active:Z,activeNodeRect:xe,containerNodeRect:me,draggingNodeRect:ue,over:ie.current.over,overlayNodeRect:Ve.rect,scrollableAncestors:rt,scrollableAncestorRects:xt,windowRect:nt}),zn=re?pi(re,W):null,jn=fE(rt),na=Hy(jn),J=Hy(jn,[xe]),be=pi(bt,na),He=ue?U3(ue,bt):null,Dt=Z&&He?x({active:Z,collisionRect:He,droppableRects:Ee,droppableContainers:ke,pointerCoordinates:zn}):null,aa=R0(Dt,"id"),[Ke,yl]=p.useState(null),bl=De?bt:pi(bt,J),Hs=_3(bl,(f=Ke?.rect)!=null?f:null,xe),Te=p.useRef(null),ut=p.useCallback((Ht,Gt)=>{let{sensor:on,options:sa}=Gt;if(te.current==null)return;const Nn=M.get(te.current);if(!Nn)return;const cn=Ht.nativeEvent,an=new on({active:te.current,activeNode:Nn,event:cn,options:sa,context:ie,onAbort(ft){if(!M.get(ft))return;const{onDragAbort:Gn}=ee.current,la={id:ft};Gn?.(la),E({type:"onDragAbort",event:la})},onPending(ft,Nt,Gn,la){if(!M.get(ft))return;const{onDragPending:Na}=ee.current,Dn={id:ft,constraint:Nt,initialCoordinates:Gn,offset:la};Na?.(Dn),E({type:"onDragPending",event:Dn})},onStart(ft){const Nt=te.current;if(Nt==null)return;const Gn=M.get(Nt);if(!Gn)return;const{onDragStart:la}=ee.current,Bs={activatorEvent:cn,active:{id:Nt,data:Gn.data,rect:F}};ol.unstable_batchedUpdates(()=>{la?.(Bs),U(As.Initializing),D({type:$t.DragStart,initialCoordinates:ft,active:Nt}),E({type:"onDragStart",event:Bs}),K(Te.current),L(cn)})},onMove(ft){D({type:$t.DragMove,coordinates:ft})},onEnd:At($t.DragEnd),onCancel:At($t.DragCancel)});Te.current=an;function At(ft){return async function(){const{active:Gn,collisions:la,over:Bs,scrollAdjustedTranslate:Na}=ie.current;let Dn=null;if(Gn&&Na){const{cancelDrop:wa}=ee.current;Dn={activatorEvent:cn,active:Gn,collisions:la,delta:Na,over:Bs},ft===$t.DragEnd&&typeof wa=="function"&&await Promise.resolve(wa(Dn))&&(ft=$t.DragCancel)}te.current=null,ol.unstable_batchedUpdates(()=>{D({type:ft}),U(As.Uninitialized),yl(null),K(null),L(null),Te.current=null;const wa=ft===$t.DragEnd?"onDragEnd":"onDragCancel";if(Dn){const ia=ee.current[wa];ia?.(Dn),E({type:wa,event:Dn})}})}}},[M]),Rt=p.useCallback((Ht,Gt)=>(on,sa)=>{const Nn=on.nativeEvent,cn=M.get(sa);if(te.current!==null||!cn||Nn.dndKit||Nn.defaultPrevented)return;const an={active:cn};Ht(on,Gt.options,an)===!0&&(Nn.dndKit={capturedBy:Gt.sensor},te.current=sa,ut(on,Gt))},[M,ut]),jt=lE(b,Rt);hE(b),va(()=>{xe&&w===As.Initializing&&U(As.Initialized)},[xe,w]),p.useEffect(()=>{const{onDragMove:Ht}=ee.current,{active:Gt,activatorEvent:on,collisions:sa,over:Nn}=ie.current;if(!Gt||!on)return;const cn={active:Gt,activatorEvent:on,collisions:sa,delta:{x:be.x,y:be.y},over:Nn};ol.unstable_batchedUpdates(()=>{Ht?.(cn),E({type:"onDragMove",event:cn})})},[be.x,be.y]),p.useEffect(()=>{const{active:Ht,activatorEvent:Gt,collisions:on,droppableContainers:sa,scrollAdjustedTranslate:Nn}=ie.current;if(!Ht||te.current==null||!Gt||!Nn)return;const{onDragOver:cn}=ee.current,an=sa.get(aa),At=an&&an.rect.current?{id:an.id,rect:an.rect.current,data:an.data,disabled:an.disabled}:null,ft={active:Ht,activatorEvent:Gt,collisions:on,delta:{x:Nn.x,y:Nn.y},over:At};ol.unstable_batchedUpdates(()=>{yl(At),cn?.(ft),E({type:"onDragOver",event:ft})})},[aa]),va(()=>{ie.current={activatorEvent:H,active:Z,activeNode:V,collisionRect:He,collisions:Dt,droppableRects:Ee,draggableNodes:M,draggingNode:Xe,draggingNodeRect:ue,droppableContainers:I,over:Ke,scrollableAncestors:rt,scrollAdjustedTranslate:be},F.current={initial:ue,translated:He}},[Z,V,Dt,He,M,Xe,ue,Ee,I,Ke,rt,be]),tE({...ye,delta:W,draggingRect:He,pointerCoordinates:zn,scrollableAncestors:rt,scrollableAncestorRects:xt});const Ze=p.useMemo(()=>({active:Z,activeNode:V,activeNodeRect:xe,activatorEvent:H,collisions:Dt,containerNodeRect:me,dragOverlay:Ve,draggableNodes:M,droppableContainers:I,droppableRects:Ee,over:Ke,measureDroppableContainers:T,scrollableAncestors:rt,scrollableAncestorRects:xt,measuringConfiguration:Ne,measuringScheduled:q,windowRect:nt}),[Z,V,xe,H,Dt,me,Ve,M,I,Ee,Ke,T,rt,xt,Ne,q,nt]),It=p.useMemo(()=>({activatorEvent:H,activators:jt,active:Z,activeNodeRect:xe,ariaDescribedById:{draggable:de},dispatch:D,draggableNodes:M,over:Ke,measureDroppableContainers:T}),[H,jt,Z,xe,D,de,M,Ke,T]);return vt.createElement(C0.Provider,{value:O},vt.createElement(Kr.Provider,{value:It},vt.createElement(V0.Provider,{value:Ze},vt.createElement(xu.Provider,{value:Hs},y)),vt.createElement(NE,{disabled:h?.restoreFocus===!1})),vt.createElement(T3,{...h,hiddenTextDescribedById:de}));function Zr(){const Ht=ce?.autoScrollEnabled===!1,Gt=typeof g=="object"?g.enabled===!1:g===!1,on=Y&&!Ht&&!Gt;return typeof g=="object"?{...g,enabled:on}:{enabled:on}}}),CE=p.createContext(null),$y="button",TE="Draggable";function EE(n){let{id:i,data:r,disabled:c=!1,attributes:d}=n;const f=Xr(TE),{activators:m,activatorEvent:h,active:g,activeNodeRect:y,ariaDescribedById:b,draggableNodes:x,over:j}=p.useContext(Kr),{role:S=$y,roleDescription:R="draggable",tabIndex:k=0}=d??{},C=g?.id===i,D=p.useContext(C?xu:CE),[E,O]=Yc(),[w,U]=Yc(),Y=mE(m,i),A=Ar(r);va(()=>(x.set(i,{id:i,key:f,node:E,activatorNode:w,data:A}),()=>{const W=x.get(i);W&&W.key===f&&x.delete(i)}),[x,i]);const M=p.useMemo(()=>({role:S,tabIndex:k,"aria-disabled":c,"aria-pressed":C&&S===$y?!0:void 0,"aria-roledescription":R,"aria-describedby":b.draggable}),[c,S,k,C,R,b.draggable]);return{active:g,activatorEvent:h,activeNodeRect:y,attributes:M,isDragging:C,listeners:c?void 0:Y,node:E,over:j,setNodeRef:O,setActivatorNodeRef:U,transform:D}}function K0(){return p.useContext(V0)}const RE="Droppable",zE={timeout:25};function DE(n){let{data:i,disabled:r=!1,id:c,resizeObserverConfig:d}=n;const f=Xr(RE),{active:m,dispatch:h,over:g,measureDroppableContainers:y}=p.useContext(Kr),b=p.useRef({disabled:r}),x=p.useRef(!1),j=p.useRef(null),S=p.useRef(null),{disabled:R,updateMeasurementsFor:k,timeout:C}={...zE,...d},D=Ar(k??c),E=p.useCallback(()=>{if(!x.current){x.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{y(Array.isArray(D.current)?D.current:[D.current]),S.current=null},C)},[C]),O=pu({callback:E,disabled:R||!m}),w=p.useCallback((M,W)=>{O&&(W&&(O.unobserve(W),x.current=!1),M&&O.observe(M))},[O]),[U,Y]=Yc(w),A=Ar(i);return p.useEffect(()=>{!O||!U.current||(O.disconnect(),x.current=!1,O.observe(U.current))},[U,O]),p.useEffect(()=>(h({type:$t.RegisterDroppable,element:{id:c,key:f,disabled:r,node:U,rect:j,data:A}}),()=>h({type:$t.UnregisterDroppable,key:f,id:c})),[c]),p.useEffect(()=>{r!==b.current.disabled&&(h({type:$t.SetDroppableDisabled,id:c,key:f,disabled:r}),b.current.disabled=r)},[c,f,r,h]),{active:m,rect:j,isOver:g?.id===c,node:U,over:g,setNodeRef:Y}}function AE(n){let{animation:i,children:r}=n;const[c,d]=p.useState(null),[f,m]=p.useState(null),h=Vc(r);return!r&&!c&&h&&d(h),va(()=>{if(!f)return;const g=c?.key,y=c?.props.id;if(g==null||y==null){d(null);return}Promise.resolve(i(y,f)).then(()=>{d(null)})},[i,c,f]),vt.createElement(vt.Fragment,null,r,c?p.cloneElement(c,{ref:m}):null)}const OE={x:0,y:0,scaleX:1,scaleY:1};function ME(n){let{children:i}=n;return vt.createElement(Kr.Provider,{value:Y0},vt.createElement(xu.Provider,{value:OE},i))}const _E={position:"fixed",touchAction:"none"},LE=n=>hu(n)?"transform 250ms ease":void 0,UE=p.forwardRef((n,i)=>{let{as:r,activatorEvent:c,adjustScale:d,children:f,className:m,rect:h,style:g,transform:y,transition:b=LE}=n;if(!h)return null;const x=d?y:{...y,scaleX:1,scaleY:1},j={..._E,width:h.width,height:h.height,top:h.top,left:h.left,transform:Ls.Transform.toString(x),transformOrigin:d&&c?R3(c,h):void 0,transition:typeof b=="function"?b(c):b,...g};return vt.createElement(r,{className:m,style:j,ref:i},f)}),HE=n=>i=>{let{active:r,dragOverlay:c}=i;const d={},{styles:f,className:m}=n;if(f!=null&&f.active)for(const[h,g]of Object.entries(f.active))g!==void 0&&(d[h]=r.node.style.getPropertyValue(h),r.node.style.setProperty(h,g));if(f!=null&&f.dragOverlay)for(const[h,g]of Object.entries(f.dragOverlay))g!==void 0&&c.node.style.setProperty(h,g);return m!=null&&m.active&&r.node.classList.add(m.active),m!=null&&m.dragOverlay&&c.node.classList.add(m.dragOverlay),function(){for(const[g,y]of Object.entries(d))r.node.style.setProperty(g,y);m!=null&&m.active&&r.node.classList.remove(m.active)}},BE=n=>{let{transform:{initial:i,final:r}}=n;return[{transform:Ls.Transform.toString(i)},{transform:Ls.Transform.toString(r)}]},$E={duration:250,easing:"ease",keyframes:BE,sideEffects:HE({styles:{active:{opacity:"0"}}})};function qE(n){let{config:i,draggableNodes:r,droppableContainers:c,measuringConfiguration:d}=n;return fu((f,m)=>{if(i===null)return;const h=r.get(f);if(!h)return;const g=h.node.current;if(!g)return;const y=G0(m);if(!y)return;const{transform:b}=bn(m).getComputedStyle(m),x=D0(b);if(!x)return;const j=typeof i=="function"?i:GE(i);return H0(g,d.draggable.measure),j({active:{id:f,data:h.data,node:g,rect:d.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:m,rect:d.dragOverlay.measure(y)},droppableContainers:c,measuringConfiguration:d,transform:x})})}function GE(n){const{duration:i,easing:r,sideEffects:c,keyframes:d}={...$E,...n};return f=>{let{active:m,dragOverlay:h,transform:g,...y}=f;if(!i)return;const b={x:h.rect.left-m.rect.left,y:h.rect.top-m.rect.top},x={scaleX:g.scaleX!==1?m.rect.width*g.scaleX/h.rect.width:1,scaleY:g.scaleY!==1?m.rect.height*g.scaleY/h.rect.height:1},j={x:g.x-b.x,y:g.y-b.y,...x},S=d({...y,active:m,dragOverlay:h,transform:{initial:g,final:j}}),[R]=S,k=S[S.length-1];if(JSON.stringify(R)===JSON.stringify(k))return;const C=c?.({active:m,dragOverlay:h,...y}),D=h.node.animate(S,{duration:i,easing:r,fill:"forwards"});return new Promise(E=>{D.onfinish=()=>{C?.(),E()}})}}let qy=0;function YE(n){return p.useMemo(()=>{if(n!=null)return qy++,qy},[n])}const VE=vt.memo(n=>{let{adjustScale:i=!1,children:r,dropAnimation:c,style:d,transition:f,modifiers:m,wrapperElement:h="div",className:g,zIndex:y=999}=n;const{activatorEvent:b,active:x,activeNodeRect:j,containerNodeRect:S,draggableNodes:R,droppableContainers:k,dragOverlay:C,over:D,measuringConfiguration:E,scrollableAncestors:O,scrollableAncestorRects:w,windowRect:U}=K0(),Y=p.useContext(xu),A=YE(x?.id),M=X0(m,{activatorEvent:b,active:x,activeNodeRect:j,containerNodeRect:S,draggingNodeRect:C.rect,over:D,overlayNodeRect:C.rect,scrollableAncestors:O,scrollableAncestorRects:w,transform:Y,windowRect:U}),W=om(j),I=qE({config:c,draggableNodes:R,droppableContainers:k,measuringConfiguration:E}),ne=W?C.setRef:void 0;return vt.createElement(ME,null,vt.createElement(AE,{animation:I},x&&A?vt.createElement(UE,{key:A,id:x.id,ref:ne,as:h,activatorEvent:b,adjustScale:i,className:g,transition:f,rect:W,style:{zIndex:y,...d},transform:M},r):null))});function XE(n,i,r){const c={...n};return i.top+n.y<=r.top?c.y=r.top-i.top:i.bottom+n.y>=r.top+r.height&&(c.y=r.top+r.height-i.bottom),i.left+n.x<=r.left?c.x=r.left-i.left:i.right+n.x>=r.left+r.width&&(c.x=r.left+r.width-i.right),c}const KE=n=>{let{containerNodeRect:i,draggingNodeRect:r,transform:c}=n;return!r||!i?c:XE(c,r,i)},ZE=n=>{let{transform:i}=n;return{...i,x:0}};function cm(n,i,r){const c=n.slice();return c.splice(r<0?c.length+r:r,0,c.splice(i,1)[0]),c}function QE(n,i){return n.reduce((r,c,d)=>{const f=i.get(c);return f&&(r[d]=f),r},Array(n.length))}function Sc(n){return n!==null&&n>=0}function IE(n,i){if(n===i)return!0;if(n.length!==i.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==i[r])return!1;return!0}function PE(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Z0=n=>{let{rects:i,activeIndex:r,overIndex:c,index:d}=n;const f=cm(i,c,r),m=i[d],h=f[d];return!h||!m?null:{x:h.left-m.left,y:h.top-m.top,scaleX:h.width/m.width,scaleY:h.height/m.height}},kc={scaleX:1,scaleY:1},FE=n=>{var i;let{activeIndex:r,activeNodeRect:c,index:d,rects:f,overIndex:m}=n;const h=(i=f[r])!=null?i:c;if(!h)return null;if(d===r){const y=f[m];return y?{x:0,y:r<m?y.top+y.height-(h.top+h.height):y.top-h.top,...kc}:null}const g=JE(f,d,r);return d>r&&d<=m?{x:0,y:-h.height-g,...kc}:d<r&&d>=m?{x:0,y:h.height+g,...kc}:{x:0,y:0,...kc}};function JE(n,i,r){const c=n[i],d=n[i-1],f=n[i+1];return c?r<i?d?c.top-(d.top+d.height):f?f.top-(c.top+c.height):0:f?f.top-(c.top+c.height):d?c.top-(d.top+d.height):0:0}const Q0="Sortable",I0=vt.createContext({activeIndex:-1,containerId:Q0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Z0,disabled:{draggable:!1,droppable:!1}});function WE(n){let{children:i,id:r,items:c,strategy:d=Z0,disabled:f=!1}=n;const{active:m,dragOverlay:h,droppableRects:g,over:y,measureDroppableContainers:b}=K0(),x=Xr(Q0,r),j=h.rect!==null,S=p.useMemo(()=>c.map(Y=>typeof Y=="object"&&"id"in Y?Y.id:Y),[c]),R=m!=null,k=m?S.indexOf(m.id):-1,C=y?S.indexOf(y.id):-1,D=p.useRef(S),E=!IE(S,D.current),O=C!==-1&&k===-1||E,w=PE(f);va(()=>{E&&R&&b(S)},[E,S,R,b]),p.useEffect(()=>{D.current=S},[S]);const U=p.useMemo(()=>({activeIndex:k,containerId:x,disabled:w,disableTransforms:O,items:S,overIndex:C,useDragOverlay:j,sortedRects:QE(S,g),strategy:d}),[k,x,w.draggable,w.droppable,O,S,C,g,j,d]);return vt.createElement(I0.Provider,{value:U},i)}const e4=n=>{let{id:i,items:r,activeIndex:c,overIndex:d}=n;return cm(r,c,d).indexOf(i)},t4=n=>{let{containerId:i,isSorting:r,wasDragging:c,index:d,items:f,newIndex:m,previousItems:h,previousContainerId:g,transition:y}=n;return!y||!c||h!==f&&d===m?!1:r?!0:m!==d&&i===g},n4={duration:200,easing:"ease"},P0="transform",a4=Ls.Transition.toString({property:P0,duration:0,easing:"linear"}),s4={roleDescription:"sortable"};function l4(n){let{disabled:i,index:r,node:c,rect:d}=n;const[f,m]=p.useState(null),h=p.useRef(r);return va(()=>{if(!i&&r!==h.current&&c.current){const g=d.current;if(g){const y=Si(c.current,{ignoreTransform:!0}),b={x:g.left-y.left,y:g.top-y.top,scaleX:g.width/y.width,scaleY:g.height/y.height};(b.x||b.y)&&m(b)}}r!==h.current&&(h.current=r)},[i,r,c,d]),p.useEffect(()=>{f&&m(null)},[f]),f}function i4(n){let{animateLayoutChanges:i=t4,attributes:r,disabled:c,data:d,getNewIndex:f=e4,id:m,strategy:h,resizeObserverConfig:g,transition:y=n4}=n;const{items:b,containerId:x,activeIndex:j,disabled:S,disableTransforms:R,sortedRects:k,overIndex:C,useDragOverlay:D,strategy:E}=p.useContext(I0),O=r4(c,S),w=b.indexOf(m),U=p.useMemo(()=>({sortable:{containerId:x,index:w,items:b},...d}),[x,d,w,b]),Y=p.useMemo(()=>b.slice(b.indexOf(m)),[b,m]),{rect:A,node:M,isOver:W,setNodeRef:I}=DE({id:m,data:U,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:Y,...g}}),{active:ne,activatorEvent:F,activeNodeRect:Z,attributes:te,setNodeRef:ce,listeners:K,isDragging:H,over:L,setActivatorNodeRef:ee,transform:de}=EE({id:m,data:U,attributes:{...s4,...r},disabled:O.draggable}),ke=m3(I,ce),Ne=!!ne,Ee=Ne&&!R&&Sc(j)&&Sc(C),T=!D&&H,q=T&&Ee?de:null,re=Ee?q??(h??E)({rects:k,activeNodeRect:Z,activeIndex:j,overIndex:C,index:w}):null,ye=Sc(j)&&Sc(C)?f({id:m,items:b,activeIndex:j,overIndex:C}):w,Re=ne?.id,xe=p.useRef({activeId:Re,items:b,newIndex:ye,containerId:x}),me=b!==xe.current.items,ie=i({active:ne,containerId:x,isDragging:H,isSorting:Ne,id:m,index:w,items:b,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:y,wasDragging:xe.current.activeId!=null}),Pe=l4({disabled:!ie,index:w,node:M,rect:A});return p.useEffect(()=>{Ne&&xe.current.newIndex!==ye&&(xe.current.newIndex=ye),x!==xe.current.containerId&&(xe.current.containerId=x),b!==xe.current.items&&(xe.current.items=b)},[Ne,ye,x,b]),p.useEffect(()=>{if(Re===xe.current.activeId)return;if(Re!=null&&xe.current.activeId==null){xe.current.activeId=Re;return}const Xe=setTimeout(()=>{xe.current.activeId=Re},50);return()=>clearTimeout(Xe)},[Re]),{active:ne,activeIndex:j,attributes:te,data:U,rect:A,index:w,newIndex:ye,items:b,isOver:W,isSorting:Ne,isDragging:H,listeners:K,node:M,overIndex:C,over:L,setNodeRef:ke,setActivatorNodeRef:ee,setDroppableNodeRef:I,setDraggableNodeRef:ce,transform:Pe??re,transition:Ve()};function Ve(){if(Pe||me&&xe.current.newIndex===w)return a4;if(!(T&&!hu(F)||!y)&&(Ne||ie))return Ls.Transition.toString({...y,property:P0})}}function r4(n,i){var r,c;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(r=n?.draggable)!=null?r:i.draggable,droppable:(c=n?.droppable)!=null?c:i.droppable}}function Qc(n){if(!n)return!1;const i=n.data.current;return!!(i&&"sortable"in i&&typeof i.sortable=="object"&&"containerId"in i.sortable&&"items"in i.sortable&&"index"in i.sortable)}const o4=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],c4=(n,i)=>{let{context:{active:r,collisionRect:c,droppableRects:d,droppableContainers:f,over:m,scrollableAncestors:h}}=i;if(o4.includes(n.code)){if(n.preventDefault(),!r||!c)return;const g=[];f.getEnabled().forEach(x=>{if(!x||x!=null&&x.disabled)return;const j=d.get(x.id);if(j)switch(n.code){case Ie.Down:c.top<j.top&&g.push(x);break;case Ie.Up:c.top>j.top&&g.push(x);break;case Ie.Left:c.left>j.left&&g.push(x);break;case Ie.Right:c.left<j.left&&g.push(x);break}});const y=A3({collisionRect:c,droppableRects:d,droppableContainers:g});let b=R0(y,"id");if(b===m?.id&&y.length>1&&(b=y[1].id),b!=null){const x=f.get(r.id),j=f.get(b),S=j?d.get(j.id):null,R=j?.node.current;if(R&&S&&x&&j){const C=mu(R).some((Y,A)=>h[A]!==Y),D=F0(x,j),E=u4(x,j),O=C||!D?{x:0,y:0}:{x:E?c.width-S.width:0,y:E?c.height-S.height:0},w={x:S.left,y:S.top};return O.x&&O.y?w:Or(w,O)}}}};function F0(n,i){return!Qc(n)||!Qc(i)?!1:n.data.current.sortable.containerId===i.data.current.sortable.containerId}function u4(n,i){return!Qc(n)||!Qc(i)||!F0(n,i)?!1:n.data.current.sortable.index<i.data.current.sortable.index}const d4={draggable:"To pick up a step, press Space or Enter. Use the arrow keys to move it, Space or Enter to drop it, Escape to cancel."};function f4(){const[n,i]=p.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return p.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)"),c=()=>i(r.matches);return r.addEventListener("change",c),()=>r.removeEventListener("change",c)},[]),n}function J0(n){return n.run.trim()||"new step"}function h4(n){return y0.find(i=>i.value===n)?.label??n}function m4({step:n,index:i,total:r,error:c,disabled:d,reducedMotion:f,registerRow:m,registerHandle:h,onChange:g,onRemove:y,onMove:b}){const{attributes:x,listeners:j,setNodeRef:S,setActivatorNodeRef:R,transform:k,transition:C,isDragging:D}=i4({id:n.key,disabled:d}),E=n.enabled!==!1,O=J0(n);return a.jsx("li",{ref:w=>{S(w),m(n.key,w)},style:{transform:Ls.Transform.toString(k),transition:f?void 0:C},tabIndex:-1,className:oe("rounded-md border p-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",D?"border-dashed border-line bg-raised/20":"border-line bg-raised/40"),children:a.jsxs("div",{className:oe("flex items-start gap-2",D&&"invisible"),children:[a.jsx("button",{ref:w=>{R(w),h(n.key,w)},type:"button","aria-label":`Reorder step ${i+1}: ${O}`,title:"Drag to reorder",disabled:d,className:"mt-2 inline-flex size-6 shrink-0 touch-none cursor-grab items-center justify-center rounded-sm text-faint transition-colors hover:bg-inset hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 active:cursor-grabbing disabled:cursor-not-allowed",...x,...j,children:a.jsx(Lb,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsxs("div",{className:oe("flex flex-wrap items-center gap-2",!E&&"opacity-60"),children:[a.jsxs("span",{className:"text-2xs font-medium text-faint",children:["Step ",i+1]}),a.jsx("span",{className:"min-w-0 truncate font-mono text-2xs text-muted",children:n.run.trim()||"New step"}),!E&&a.jsx(je,{tone:"neutral",children:"Skipped"})]}),a.jsx("div",{className:oe(!E&&"opacity-60"),children:a.jsx(Me,{"aria-label":`Step ${i+1} command`,value:n.run,onChange:w=>g({run:w.target.value}),error:c,placeholder:"npm ci",className:"font-mono",spellCheck:!1,autoComplete:"off",disabled:d})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2",children:[a.jsx(pa,{"aria-label":`Step ${i+1} kind`,value:n.kind,onChange:w=>g({kind:w.target.value}),className:oe("w-28 shrink-0",!E&&"opacity-60"),disabled:d,children:y0.map(w=>a.jsx("option",{value:w.value,children:w.label},w.value))}),a.jsx(Zt,{label:E?"On":"Off",ariaLabel:`Step ${i+1} (${O}) ${E?"enabled":"disabled"}`,checked:E,onChange:w=>g({enabled:w}),disabled:d,className:"min-w-36 flex-1 items-center [&>div>div]:text-xs"}),a.jsxs("div",{className:oe("flex shrink-0 items-center gap-1",!E&&"opacity-60"),children:[a.jsx(ct,{label:`Move step ${i+1} up`,size:"sm",onClick:()=>b(i-1),disabled:d||i===0,children:a.jsx(Zw,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Move step ${i+1} down`,size:"sm",onClick:()=>b(i+1),disabled:d||i===r-1,children:a.jsx(zb,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Remove step ${i+1}`,size:"sm",variant:"dangerGhost",onClick:y,disabled:d,children:a.jsx(Us,{className:"size-4","aria-hidden":"true"})})]})]}),n.kind==="migrate"&&a.jsx("p",{className:oe("text-2xs text-warn",!E&&"opacity-60"),children:"Forward-only: a rollback does not undo a migration that has already run."})]})]})})}function p4({step:n,index:i,reducedMotion:r}){const c=n.enabled!==!1;return a.jsx("div",{className:"cursor-grabbing rounded-md border border-line-strong bg-surface p-3 shadow-pop",style:{transform:r?void 0:"scale(1.02)"},children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"mt-2 inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-faint",children:a.jsx(Lb,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{className:"text-2xs font-medium text-faint",children:["Step ",i+1]}),a.jsx("span",{className:"min-w-0 truncate font-mono text-2xs text-muted",children:n.run.trim()||"New step"}),!c&&a.jsx(je,{tone:"neutral",children:"Skipped"})]}),a.jsx("div",{className:"truncate rounded-md border border-line bg-canvas px-3 py-1.5 font-mono text-sm text-ink",children:n.run.trim()||"npm ci"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-2xs text-muted",children:[a.jsx("span",{children:h4(n.kind)}),a.jsx("span",{children:c?"On":"Off"})]})]})]})})}function x4({steps:n,onChange:i,errors:r,apiWarnings:c=[],disabled:d}){const[f,m]=p.useState(null),[h,g]=p.useState(null),[y,b]=p.useState(""),[x,j]=p.useState(null),S=p.useRef(new Map),R=p.useRef(new Map),k=p.useRef(n);k.current=n;const C=f4(),D=E3(lh(rm,{activationConstraint:{distance:4}}),lh($0,{activationConstraint:{delay:150,tolerance:5}}),lh(lm,{coordinateGetter:c4}));p.useEffect(()=>{f&&(S.current.get(f)?.focus(),m(null))},[f,n]),p.useEffect(()=>{h&&(R.current.get(h)?.focus(),g(null))},[h,n]),p.useEffect(()=>{if(!x)return;const H=L=>{L.key==="Escape"&&L.preventDefault()};return window.addEventListener("keydown",H,!0),()=>window.removeEventListener("keydown",H,!0)},[x]);const E=n.length>=Nc,O=H=>{const L=k.current.find(ee=>ee.key===H);return L?J0(L):"this step"},w=H=>{const L=k.current.findIndex(ee=>ee.key===H);return L===-1?1:L+1},U={onDragStart:({active:H})=>`Picked up step ${O(H.id)}. It is in position ${w(H.id)} of ${k.current.length}.`,onDragOver:({active:H,over:L})=>`Step ${O(H.id)} moved to position ${w(L?.id??H.id)} of ${k.current.length}.`,onDragEnd:({active:H,over:L})=>`Step ${O(H.id)} dropped at position ${w(L?.id??H.id)} of ${k.current.length}.`,onDragCancel:({active:H})=>`Reordering cancelled. Step ${O(H.id)} returned to position ${w(H.id)} of ${k.current.length}.`},Y=(H,L)=>{if(L<0||L>=n.length||H===L)return;const ee=[...n],[de]=ee.splice(H,1);ee.splice(L,0,de),m(de.key),b(`Step ${H+1} moved to position ${L+1}.`),i(ee)},A=(H,L)=>{i(n.map((ee,de)=>de===H?{...ee,...L}:ee))},M=H=>{b(`Step ${H+1} removed.`),i(n.filter((L,ee)=>ee!==H))},W=()=>{E||i([...n,{key:`step-${Date.now()}-${n.length}`,run:"",kind:"custom",enabled:!0}])},I=H=>{j(String(H.active.id))},ne=H=>{const{active:L,over:ee}=H;if(j(null),!ee||L.id===ee.id)return;const de=n.findIndex(Ne=>Ne.key===L.id),ke=n.findIndex(Ne=>Ne.key===ee.id);de===-1||ke===-1||de===ke||(g(String(L.id)),b(`Step ${de+1} moved to position ${ke+1}.`),i(cm(n,de,ke)))},F=()=>j(null),Z=UT(n),te=[...Z,...c.filter(H=>!Z.includes(H))],ce=n.findIndex(H=>H.key===x),K=ce===-1?null:n[ce];return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Steps"}),a.jsxs("span",{className:"text-2xs text-faint",children:[n.length,"/",Nc," steps",E?" — remove one to add another.":""]})]}),n.length===0?a.jsx("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:"No steps. Only the start command runs; nothing is installed, built or migrated."}):a.jsxs(kE,{sensors:D,collisionDetection:D3,modifiers:[ZE,KE],accessibility:{announcements:U,screenReaderInstructions:d4},onDragStart:I,onDragEnd:ne,onDragCancel:F,children:[a.jsx(WE,{items:n.map(H=>H.key),strategy:FE,children:a.jsx("ul",{className:"space-y-2",children:n.map((H,L)=>a.jsx(m4,{step:H,index:L,total:n.length,error:r?.[L]??null,disabled:d,reducedMotion:C,registerRow:(ee,de)=>{de?S.current.set(ee,de):S.current.delete(ee)},registerHandle:(ee,de)=>{de?R.current.set(ee,de):R.current.delete(ee)},onChange:ee=>A(L,ee),onRemove:()=>M(L),onMove:ee=>Y(L,ee)},H.key))})}),ol.createPortal(a.jsx(VE,{dropAnimation:C?null:void 0,children:K&&a.jsx(p4,{step:K,index:ce,reducedMotion:C})}),document.body)]}),te.map(H=>a.jsx(ve,{tone:"warning",children:H},H)),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(ae,{size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,disabled:d||E,title:E?`At most ${Nc} steps. Remove one to add another.`:void 0,children:"Add step"}),E&&a.jsxs("span",{className:"text-2xs text-faint",children:["At most ",Nc," steps."]})]}),a.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:y})]})}function Gy(n){return{id:"",repoUrl:"",branch:"main",authType:"none",token:"",generateKey:!0,settings:b0({}),envText:"",keepReleases:String(n),autoRollback:!0,notifyChannelIds:[]}}function g4(n){return{id:n.id,repoUrl:n.repoUrl,branch:n.branch,authType:n.authType,token:"",generateKey:!0,settings:b0(n.settings,{execMode:n.execMode,instances:n.instances}),envText:AT(n.env),keepReleases:String(n.keepReleases),autoRollback:n.autoRollback,notifyChannelIds:n.notifyChannelIds}}function v4(n){const i=n.deployKey;return i&&typeof i=="object"&&typeof i.publicKey=="string"?i:typeof i=="string"&&i?{publicKey:i,fingerprint:n.deployKeyFingerprint??"",createdAt:n.deployKeyCreatedAt??"",addUrl:g0(n.repoUrl)}:null}function Yy(n,i){return n instanceof Ue||n instanceof Error?n.message:i}function hi({overridden:n,note:i,onClear:r,onOverride:c,overrideLabel:d="Override"}){return a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1 text-2xs text-faint",children:[a.jsx("span",{children:n?a.jsxs(a.Fragment,{children:["Override — ",i]}):i}),n?a.jsx("button",{type:"button",onClick:r,className:"rounded-sm font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:"Use ez.json / default"}):c?a.jsx("button",{type:"button",onClick:c,className:"rounded-sm font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:d}):null]})}function W0({open:n,app:i,meta:r,onClose:c,onSaved:d,onCreated:f,onDeployNow:m,onRefresh:h}){const g=Et(),y=rn(),b=i!==null,[x,j]=p.useState(()=>Gy(r.limits.keepReleasesDefault)),[S,R]=p.useState(!1),[k,C]=p.useState(!1),[D,E]=p.useState(null),[O,w]=p.useState(null),[U,Y]=p.useState(!1),[A,M]=p.useState(null);p.useEffect(()=>{if(!n)return;const ue=i?g4(i):Gy(r.limits.keepReleasesDefault);j(ue),M(c3(ue.settings.steps,ue.settings.start)),w(null),R(!1),E(null)},[n,i?.id]);const W=ue=>{E(null),j(De=>({...De,...ue}))},I=ue=>{E(null),j(De=>({...De,settings:{...De.settings,...ue}}))},ne=ue=>{const De=Ac(ue);I({steps:v0(De.steps),stepsOverride:!0,start:De.start,startOverride:!0}),M(ue)},F=async ue=>{const De=A?Ac(A):{start:"",steps:[]},we=!Dh(x.settings.steps,x.settings.start,De.steps,De.start);ue===A&&!we||we&&!await y({title:"Replace the current steps?",body:`Your edited steps will be replaced by the ${Ty(ue)??"Custom"} preset.`,confirmLabel:"Replace",cancelLabel:"Keep my steps",tone:"accent"})||ne(ue)},Z=A?Ac(A):null,te=Z!==null&&!Dh(x.settings.steps,x.settings.start,Z.steps,Z.start),ce=()=>I({steps:[],stepsOverride:!1}),K=()=>I({start:"",startOverride:!1}),H=()=>I({runtime:"node",runtimeOverride:!1}),L=()=>I({execMode:i?.execMode??"fork",execModeOverride:!1}),ee=()=>I({instances:i?.instances!==void 0?String(i.instances):"",instancesOverride:!1}),de=x.repoUrl.trim(),ke=zT(de),Ne=DT(x.envText),Ee=Number(x.keepReleases),T={id:b?null:RT(x.id.trim()),repoUrl:de?x.authType==="token"&&ke?"Token access needs an https:// URL.":x.authType==="deployKey"&&!ke?"A deploy key needs an SSH URL, like git@github.com:owner/repo.git.":null:"A repository URL is required.",token:x.authType==="token"&&!x.token.trim()&&!(b&&i?.hasToken)?"A token is required.":null,port:x.settings.port.trim()?ru(x.settings.port):null,healthPath:x.settings.healthPath.trim()&&!x.settings.healthPath.trim().startsWith("/")?'Must start with "/".':null,start:x.settings.startOverride&&!x.settings.start.trim()?"A start command is required while this app overrides it.":null,env:Ne.error,keepReleases:!Number.isInteger(Ee)||Ee<r.limits.keepReleasesMin||Ee>r.limits.keepReleasesMax?`A whole number from ${r.limits.keepReleasesMin} to ${r.limits.keepReleasesMax}.`:null,instances:(()=>{const ue=x.settings.instances.trim();return!ue||ue==="max"||/^\d+$/.test(ue)&&Number(ue)>=1?null:'A whole number from 1 to this server’s CPU count, or "max".'})()},q=x.settings.stepsOverride?x.settings.steps.map(ue=>ue.run.trim()?null:"A command is required."):[],V=Object.values(T).some(Boolean)||q.some(Boolean),re=GT(x.settings.start),ye=x.settings.execMode==="cluster"&&re===!1,Re=x.settings.execMode==="fork"&&Number(x.settings.instances)>1,xe=(i?.warnings??[]).filter(ue=>!ky(ue)&&!(x.settings.execMode==="cluster"&&ue===Cy)),me=(i?.warnings??[]).filter(ky),ie=b&&i.settings.steps===void 0&&(i.settings.install!==void 0||i.settings.build!==void 0||i.settings.migrate!==void 0),Pe=async()=>{if(k||(R(!0),V))return;const ue={repoUrl:de,branch:x.branch.trim()||"main",authType:x.authType,settings:qT(x.settings),env:Ne.env,keepReleases:Ee,autoRollback:x.autoRollback,notifyChannelIds:x.notifyChannelIds};x.token.trim()&&(ue.token=x.token.trim()),!b&&x.authType==="deployKey"&&(ue.generateKey=x.generateKey),C(!0),E(null);try{if(b){const nt=await fe.deployments.update(i.id,ue);d(nt,!1);return}const De=await fe.deployments.create({...ue,id:x.id.trim()}),we=v4(De);if(x.authType==="deployKey"&&x.generateKey){const nt={...De,deployKey:we?.publicKey??null};w({app:nt,key:we,keyError:we?null:De.deployKeyError??"The key was not generated."}),f?.(nt);return}d(De,!0)}catch(De){E(Yy(De,"Nothing was changed."))}finally{C(!1)}},Ve=async()=>{if(!(!O||U)){Y(!0);try{await fe.deployments.deploy(O.app.id),g.success(`${O.app.id} is deploying`,"Its log is in the Deployments tab."),m?.(O.app.id)}catch(ue){g.error("Could not start the deployment",Yy(ue,"Nothing was started."))}finally{Y(!1)}}},Xe=ue=>S?T[ue]:null;return O?a.jsxs(vn,{open:n,onClose:c,preventClose:U,size:"lg",title:`${O.app.id} created`,description:"Add its public key to the repository so deployments can read the code.",footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:c,disabled:U,children:"Close"}),a.jsx(ae,{variant:"primary",onClick:()=>void Ve(),loading:U,children:"Deploy now"})]}),children:[a.jsx(zh,{appId:O.app.id,repoUrl:O.app.repoUrl,publicKey:O.key?.publicKey??null,fingerprint:O.key?.fingerprint??null,createdAt:O.key?.createdAt??null,onDisk:!!O.key,initialError:O.keyError,onChanged:()=>f?.(O.app)}),a.jsx("p",{className:"mt-3 text-2xs text-faint",children:"Closing keeps the app and its key; you can add the key to GitHub later from the app’s GitHub tab."})]}):a.jsx(vn,{open:n,onClose:c,preventClose:k,size:"lg",title:b?`Edit ${i.id}`:"New app",description:b?"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(ae,{variant:"secondary",onClick:c,disabled:k,children:"Cancel"}),a.jsx(ae,{variant:"primary",type:"submit",form:"deploy-app-form",loading:k,children:b?"Save app":"Create app"})]}),children:a.jsxs("form",{id:"deploy-app-form",className:"space-y-6",onSubmit:ue=>{ue.preventDefault(),Pe()},noValidate:!0,children:[D&&a.jsx(ve,{tone:"danger",title:b?"The app was not saved":"The app was not created",children:D}),a.jsxs("section",{className:"space-y-4",children:[a.jsxs(Ja,{children:[a.jsx(Me,{label:"Name",value:x.id,onChange:ue=>W({id:ue.target.value.toLowerCase()}),disabled:b,error:Xe("id"),hint:b?"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(Me,{label:"Branch",value:x.branch,onChange:ue=>W({branch:ue.target.value}),hint:"Deployed when no specific commit is named.",placeholder:"main",className:"font-mono",spellCheck:!1})]}),a.jsx(Me,{label:"Repository URL",value:x.repoUrl,onChange:ue=>W({repoUrl:ue.target.value}),error:Xe("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(pa,{label:"Repository access",value:x.authType,onChange:ue=>W({authType:ue.target.value}),hint:x.authType==="none"?"For a public repository.":x.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)"})]}),x.authType==="token"&&a.jsx(Me,{label:"Access token",type:"password",value:x.token,onChange:ue=>W({token:ue.target.value}),error:Xe("token"),hint:b&&i.hasToken?"A token is stored. Leave this empty to keep it.":"Read-only access to this one repository is enough.",placeholder:b&&i.hasToken?"••••••••":"github_pat_…",autoComplete:"off",spellCheck:!1}),x.authType==="deployKey"&&ke?b?a.jsx(zh,{appId:i.id,repoUrl:i.repoUrl,publicKey:i.deployKey,fingerprint:i.deployKeyFingerprint??null,createdAt:i.deployKeyCreatedAt??null,onDisk:i.deployKeyOnDisk??!!i.deployKey,onChanged:h}):a.jsx(pl,{label:"Generate a deploy key for me",hint:"Made in the same step as the app, without deploying anything. You then add its public half to the repository.",checked:x.generateKey,onChange:ue=>W({generateKey:ue})}):null]}),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:"Port and health"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["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"}),"."]})]}),xe.map(ue=>a.jsx(ve,{tone:"warning",children:ue},ue)),a.jsxs(Ja,{children:[a.jsx(Me,{label:"Port",optional:!0,type:"number",min:1,max:65535,inputMode:"numeric",value:x.settings.port,onChange:ue=>I({port:ue.target.value}),error:Xe("port"),hint:"The port the app listens on. Passed to it as PORT, and used for the health check.",placeholder:"3000"}),a.jsx(Me,{label:"Health check path",optional:!0,value:x.settings.healthPath,onChange:ue=>I({healthPath:ue.target.value}),error:Xe("healthPath"),hint:"Must answer before a deployment counts. Defaults to /.",placeholder:"/healthz",className:"font-mono",spellCheck:!1})]})]}),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:"Runtime"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"What runs the app. Node.js is the only runtime Easy DevOps can supervise today; the others are shown so the plan is clear."})]}),a.jsx(h3,{value:x.settings.runtime,onChange:ue=>I({runtime:ue,runtimeOverride:!0})}),x.settings.runtime==="node"&&a.jsx(d3,{value:A,modifiedFrom:te&&A?Ty(A):null,onSelect:ue=>void F(ue),onReset:()=>{A&&ne(A)}}),a.jsx(hi,{overridden:x.settings.runtimeOverride,note:x.settings.runtimeOverride?"the runtime is saved on this app instead of ez.json.":"No override — the runtime comes from ez.json, else Node.js.",onClear:H})]}),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:"Commands"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["The start command and the steps run in a new release, in this order. Steps are one field: saving them replaces the repository’s list, and clearing the override goes back to ",a.jsx("code",{className:"font-mono",children:"ez.json"}),"."]})]}),ie&&a.jsx(ve,{tone:"info",title:"Saved in the old format",children:"These commands came from the separate install, build and migrate fields. Saving the app stores them as one ordered steps list."}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Me,{label:"Start command",value:x.settings.start,onChange:ue=>I({start:ue.target.value,startOverride:!0}),error:Xe("start"),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.jsx(hi,{overridden:x.settings.startOverride,note:x.settings.startOverride?"the start command is saved on this app instead of ez.json.":"No override — read from ez.json, else package.json’s start script.",onClear:K})]}),x.settings.stepsOverride?a.jsxs("div",{className:"space-y-2",children:[a.jsx(x4,{steps:x.settings.steps,onChange:ue=>I({steps:ue}),errors:S?q:void 0,apiWarnings:me}),a.jsx(hi,{overridden:!0,note:"the steps are saved on this app instead of ez.json.",onClear:ce})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:["No steps are saved on this app. Its install, build and migrate commands come from"," ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", or from"," ",a.jsx("code",{className:"font-mono",children:"package.json"}),"."]}),a.jsx(hi,{overridden:!1,note:"No override — the steps come from ez.json.",onClear:ce,onOverride:()=>I({stepsOverride:!0}),overrideLabel:"Override steps"})]})]}),x.settings.runtime==="node"&&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:"Process mode"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Fork runs one process. Cluster runs one worker per instance, and needs a start command of the form ",a.jsx("code",{className:"font-mono",children:"node <file>"}),"."]})]}),a.jsxs(Ja,{children:[a.jsxs(pa,{label:"Process mode",value:x.settings.execMode,onChange:ue=>I({execMode:ue.target.value,execModeOverride:!0}),hint:"Cluster runs one worker per instance. It needs a start command of the form node <file>.",children:[a.jsx("option",{value:"fork",children:"Fork — one process"}),a.jsx("option",{value:"cluster",disabled:re===!1,children:"Cluster — several workers"})]}),a.jsx(Me,{label:"Instances",optional:!0,value:x.settings.instances,onChange:ue=>I({instances:ue.target.value,instancesOverride:!0}),error:Xe("instances"),hint:"A whole number up to this server’s CPU count, or “max”. Leave empty for 1.",placeholder:"1"})]}),a.jsx(hi,{overridden:x.settings.execModeOverride,note:x.settings.execModeOverride?"the process mode is saved on this app instead of ez.json.":b?"No override — the effective mode comes from ez.json, else the default.":"No override yet — fork is the default.",onClear:L}),a.jsx(hi,{overridden:x.settings.instancesOverride,note:x.settings.instancesOverride?"the instance count is saved on this app instead of ez.json.":b?"No override — the effective count comes from ez.json, else the default (1).":"No override yet — one instance is the default.",onClear:ee}),ye&&a.jsxs(ve,{tone:"warning",children:["Cluster mode needs a start command that runs a JS file directly, such as"," ",a.jsx("code",{className:"font-mono",children:"node dist/index.js"})," — not an npm script or another language. Change the start command, or choose Fork."]}),x.settings.execMode==="cluster"&&a.jsx(ve,{tone:"warning",title:"Cluster mode",children:Cy}),Re&&a.jsxs(ve,{tone:"warning",children:["Fork mode starts one process. Several forked copies would all bind the same port — choose Cluster for ",x.settings.instances," instances."]})]}),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:"Persistent data"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Each deployment runs from a fresh copy of your code. Files written to at runtime are lost on the next deploy — and on rollback. Every path listed here, a folder or a single file, lives in a shared location that every deployment and every rollback reuses."})]}),a.jsx(lC,{label:"Folders and files to keep",optional:!0,value:x.settings.persist,onChange:ue=>I({persist:ue}),normalize:(ue,De)=>{const we=$T(ue,De);return{value:we.path,error:we.error}},max:20,hint:"Add folders your app writes to: uploads, SQLite data, logs — or one file, such as prisma/app.db. Press Enter after each path.",placeholder:"data, uploads, prisma/app.db"}),a.jsxs("div",{className:"space-y-1 text-2xs text-faint",children:[a.jsxs("p",{children:["The first deployment copies the current contents into the shared location; after that, the shared copy is what counts — changes to it in the repository are ignored. A folder is usually the safer unit: SQLite creates ",a.jsx("code",{className:"font-mono",children:"-wal"})," and"," ",a.jsx("code",{className:"font-mono",children:"-shm"})," files next to its database. Left empty, the list is read from ",a.jsx("code",{className:"font-mono",children:"ez.json"}),"."]}),b&&i?.sharedDir&&a.jsxs("p",{className:"break-all",children:["Kept in ",a.jsx("span",{className:"font-mono",children:i.sharedDir})]})]})]}),a.jsx("section",{className:"space-y-4 border-t border-line pt-5",children:a.jsx(Hc,{label:"Environment variables",optional:!0,rows:5,value:x.envText,onChange:ue=>W({envText:ue.target.value}),error:Xe("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://…
524
+ NODE_ENV=production`,className:"font-mono",spellCheck:!1})}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(Zt,{checked:x.autoRollback,onChange:ue=>W({autoRollback:ue}),label:"Roll back automatically",description:"If a new release starts but fails its health check, the previous release is started again."}),a.jsx(Ja,{children:a.jsx(Me,{label:"Releases to keep",type:"number",min:r.limits.keepReleasesMin,max:r.limits.keepReleasesMax,inputMode:"numeric",value:x.keepReleases,onChange:ue=>W({keepReleases:ue.target.value}),error:Xe("keepReleases"),hint:"Older ones are deleted. The live release and the one before it are always kept."})}),a.jsx(kh,{channels:r.channels,value:x.notifyChannelIds,onChange:ue=>W({notifyChannelIds:ue}),label:"Notify on every deployment",emptyHref:"/notifications",disabled:k})]})]})})}function Ic(n,i){return n instanceof Ue||n instanceof Error?n.message:i}const y4={done:"border-ok/30 bg-ok-soft text-ok",active:"border-accent/40 bg-accent-soft text-accent-text",failed:"border-bad/30 bg-bad-soft text-bad",pending:"border-line bg-inset/50 text-faint",skipped:"border-dashed border-line bg-transparent text-faint line-through decoration-faint/70"};function b4({run:n}){return a.jsx("ol",{className:"flex flex-wrap items-center gap-1","aria-label":"Deployment stages",children:XT(n).map(({step:i,state:r},c)=>{const d=YT(i);return a.jsxs("li",{className:"flex items-center gap-1",children:[c>0&&a.jsx("span",{className:"text-2xs text-faint","aria-hidden":"true",children:"›"}),a.jsx("span",{"aria-current":r==="active"?"step":void 0,"aria-label":r==="skipped"?`${d}: skipped`:void 0,title:r==="skipped"?`${d}: skipped`:void 0,className:oe("rounded border px-1.5 py-0.5 text-2xs font-medium",y4[r]),children:d})]},i)})})}function j4({run:n}){const i=KT(n.rollbackSucceeded),r=i.tone==="ok"?"text-ok":i.tone==="bad"?"text-bad":"text-muted";return a.jsxs("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-faint",children:"Rollback report"}),a.jsxs("div",{className:"mt-2 space-y-1.5 text-xs text-muted",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-medium text-ink",children:"Reason: "}),n.reason??n.error??"The server did not report a reason."]}),a.jsx("p",{className:r,children:i.text})]}),n.logTail&&n.logTail.length>0&&a.jsxs("div",{className:"mt-2.5",children:[a.jsx("div",{className:"mb-1 text-2xs text-faint",children:"Last lines from the new release (environment values are redacted)"}),a.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded border border-line bg-canvas p-2.5 font-mono text-2xs leading-relaxed text-muted","aria-label":"Boot log of the failed release",children:n.logTail.join(`
525
+ `)})]})]})}function N4({appId:n,run:i}){const r=Tt(g=>fe.deployments.run(n,i.id,g),[n,i.id]),c=(r.data?.status??i.status)==="running";hl(r.reload,1500,c);const d=p.useRef(null),f=p.useRef(!0),m=r.data?.log??"";p.useEffect(()=>{const g=d.current;g&&f.current&&(g.scrollTop=g.scrollHeight)},[m]);const h=r.data??i;return a.jsxs("div",{className:"space-y-2.5",children:[c&&a.jsxs("p",{className:"text-sm font-medium text-ink","aria-live":"polite",children:[Gc(h),"…"]}),a.jsx(b4,{run:h}),h.error&&a.jsxs(ve,{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: ${Gc(h).toLowerCase()}`,children:[h.error,h.status!=="failed"&&h.reason?a.jsx("span",{className:"mt-1 block",children:h.reason}):null]}),h.warnings?.map(g=>a.jsx(ve,{tone:"warning",children:g},g)),h.status==="failed"&&a.jsx(j4,{run:h}),r.error&&!r.data?a.jsx(qt,{error:r.error,onRetry:r.reload,title:"Could not load the log"}):a.jsxs("pre",{ref:d,onScroll:g=>{const y=g.currentTarget;f.current=y.scrollHeight-y.scrollTop-y.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":c,children:[r.data?.logTruncated&&`… earlier output is not shown …
526
+ `,m||(r.loading?"Loading…":"No output yet.")]})]})}function w4({app:n,initialRunId:i}){const[r,c]=p.useState(i);if(p.useEffect(()=>{n.activeRunId&&c(n.activeRunId)},[n.activeRunId]),n.runs.length===0)return a.jsx(ga,{icon:a.jsx($S,{className:"size-5","aria-hidden":"true"}),title:"No deployments yet",description:"Press Deploy to build and start this app for the first time."});const d=n.runs.find(f=>f.id===r)??n.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:n.runs.map(f=>{const m=j0[f.status],h=f.id===d.id;return a.jsx("li",{children:a.jsxs("button",{type:"button",onClick:()=>c(f.id),"aria-current":h?"true":void 0,className:oe("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:m.tone,dot:!0,children:f.status==="running"?Gc(f):m.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:Dr(f.sha)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 text-2xs text-muted",children:[a.jsx("span",{children:ZT[f.trigger]??f.trigger}),a.jsxs("span",{title:Fh(f.startedAt),children:[qr(f.startedAt)," · ",QT(f)]})]})]})},f.id)})}),a.jsx(N4,{appId:n.id,run:d},d.id)]})}function S4({app:n,onRollback:i,onDelete:r,deleting:c,busy:d}){return n.releases.length===0?a.jsx(ga,{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 ",n.keepReleases," are kept."]}),a.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:n.releases.map(f=>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:f.id}),f.current&&a.jsx(je,{tone:"ok",children:"Live"}),f.previous&&a.jsx(je,{tone:"neutral",children:"Previous"})]}),a.jsxs("div",{className:"mt-0.5 font-mono text-2xs text-faint",children:[Dr(f.sha),f.ref?` · ${f.ref}`:"",f.execMode?` · ${f.execMode==="cluster"?`Cluster ×${f.instances??"?"}`:"Fork"}`:""]})]}),!f.current&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ae,{size:"sm",icon:a.jsx(bk,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>i(f),disabled:d||!f.startable,title:f.startable?void 0:"This release never got as far as starting.",children:"Roll back to this"}),a.jsx(ae,{variant:"dangerGhost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>r(f),loading:c===f.id,disabled:d||f.previous,title:f.previous?"An automatic rollback would return to this release. Delete it after the next deployment.":`Delete the files of release ${f.id}`,children:"Delete"})]})]},f.id))})]})}function Cc({n,title:i,children:r}){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:n}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:i}),r]})]})}function Vy({name:n,value:i,note:r}){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:n}),a.jsx(Ut,{value:n,label:`Copy the name ${n}`})]}),i?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:i}),a.jsx(Ut,{value:i,label:`Copy the value of ${n}`,withText:!0})]}):r&&a.jsx("p",{className:"mt-1.5 text-2xs text-faint",children:r})]})}function k4({app:n,hook:i,onConfigureHook:r,onChanged:c}){const d=Et(),f=rn(),m=Tt(Z=>fe.deployments.github(n.id,Z),[n.id,i.enabled,i.domain,i.bind,i.port,n.branch]),[h,g]=p.useState(null),[y,b]=p.useState(!1),[x,j]=p.useState(null),[S,R]=p.useState(""),[k,C]=p.useState(!1),[D,E]=p.useState(null),O=async()=>{if(!y&&!(n.hook.hasToken&&!await f({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"}))){b(!0);try{const Z=await fe.deployments.issueHookToken(n.id);g(Z.token),c()}catch(Z){d.error("Could not create the token",Ic(Z,"Try again."))}finally{b(!1)}}};if(m.error&&!m.data)return a.jsx(qt,{error:m.error,onRetry:m.reload});if(!m.data)return a.jsx(tt,{className:"h-64 rounded-lg"});const w=m.data,U=n.hook.hasToken||h!==null,Y=w.targets??[{id:"hook",label:"This server’s deploy hook",url:w.hookUrl,secure:w.hookSecure,note:w.hookNote}],A=Z=>!!Z.url&&(Z.id!=="hub"||Z.ready!==!1),M=Y.find(Z=>Z.id===x)??Y.find(A)??Y[0],W=A(M),I=/github\.com[:/]/.test(n.repoUrl),ne=n.authType==="deployKey"?1:0,F=async()=>{if(!k&&!(n.hook.hasToken&&!await f({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"}))){C(!0),E(null);try{const Z=await fe.deployments.applyGithub(n.id,{target:M.id,...S.trim()?{token:S.trim()}:{}});E(Z),R(""),g(null),c(),Z.ok?d.success("GitHub is set up",`${Z.repo} deploys on every push to ${n.branch}.`):d.warning("Partly set up","Some steps need a token with more access. They are listed below.")}catch(Z){const te=Z instanceof Ue?Z.payload:null;te&&Array.isArray(te.steps)&&E(te),d.error("Could not set up GitHub",Ic(Z,"Nothing was changed on GitHub."))}finally{C(!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:n.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."})]}),Y.length>1&&a.jsx(pa,{label:"How GitHub reaches this server",value:M.id,onChange:Z=>j(Z.target.value),hint:M.note,children:Y.map(Z=>a.jsxs("option",{value:Z.id,children:[Z.label,A(Z)?"":" — not available yet"]},Z.id))}),W?!M.secure&&a.jsx(ve,{tone:"warning",title:"The deploy token would be sent unencrypted",action:M.id==="hook"?a.jsx(ae,{size:"sm",onClick:r,children:"Change"}):void 0,children:M.note}):a.jsx(ve,{tone:"warning",title:M.id==="hub"?"Not available through the Hub yet":"GitHub cannot reach this server yet",action:M.id==="hook"?a.jsx(ae,{size:"sm",onClick:r,children:"Set up the deploy hook"}):void 0,children:M.note}),I&&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(Wk,{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",n.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"}),n.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(Me,{label:"GitHub token",optional:n.authType==="token"&&n.hasToken,type:"password",value:S,onChange:Z=>R(Z.target.value),placeholder:n.authType==="token"&&n.hasToken?"leave empty to try the app’s token":"github_pat_…",autoComplete:"off",spellCheck:!1,className:"min-w-56 flex-1"}),a.jsx(ae,{variant:"primary",onClick:()=>void F(),loading:k,disabled:!W||!S.trim()&&!(n.authType==="token"&&n.hasToken),children:"Set up on GitHub"})]}),D&&a.jsxs("ul",{className:"space-y-1.5","aria-label":"Setup result",children:[D.error&&a.jsxs("li",{className:"flex items-start gap-2 text-xs text-bad",children:[a.jsx(Cr,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:D.error})]}),D.steps.map(Z=>a.jsxs("li",{className:oe("flex items-start gap-2 text-xs",Z.ok?"text-muted":"text-bad"),children:[Z.ok?a.jsx(ts,{className:"mt-0.5 size-3.5 shrink-0 text-ok","aria-hidden":"true"}):a.jsx(Cr,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:Z.detail})]},Z.id))]})]})]})}),a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-faint",children:I?"Or by hand":"Steps"}),a.jsxs("ol",{className:"space-y-5",children:[n.authType==="deployKey"?a.jsx(Cc,{n:1,title:"Let this server read the repository",children:a.jsx(zh,{appId:n.id,repoUrl:n.repoUrl,publicKey:n.deployKey,fingerprint:n.deployKeyFingerprint??null,createdAt:n.deployKeyCreatedAt??null,onDisk:n.deployKeyOnDisk??!!n.deployKey,onChanged:()=>{m.reload(),c()}})}):null,a.jsxs(Cc,{n:ne+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(ve,{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(Ut,{value:h,label:"Copy the deploy token",withText:!0})]})}):a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx(ae,{size:"sm",icon:a.jsx(Hr,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void O(),loading:y,children:n.hook.hasToken?"Replace the token":"Create token"}),n.hook.hasToken&&a.jsxs("span",{className:"text-2xs text-faint",children:["One exists, ending in"," ",a.jsx("code",{className:"font-mono",children:n.hook.tokenHint}),n.hook.createdAt?`, created ${Fh(n.hook.createdAt)}`:"","."]})]})]}),a.jsxs(Cc,{n:ne+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(Vy,{name:"EZ_DEPLOY_URL",value:W?M.url:null,note:"Available once GitHub can reach this server (see above)."}),a.jsx(Vy,{name:"EZ_DEPLOY_TOKEN",value:h,note:U?"The token from the step above. If you no longer have it, replace it.":"Create the token in the step above first."})]})]}),a.jsxs(Cc,{n:ne+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:w.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(Ut,{value:w.workflowPath,label:"Copy the file path",withText:!0}),a.jsx(Ut,{value:w.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:w.workflow})]})]}),a.jsxs(ve,{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 C4({name:n,value:i}){const[r,c]=p.useState(!1);return a.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 px-3.5 py-2.5",children:[a.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs font-semibold text-ink",children:n}),a.jsx("code",{className:oe("min-w-0 break-all font-mono text-2xs",r?"text-muted":"text-faint"),children:r?i:"••••••••"}),a.jsx(ae,{size:"sm",variant:"ghost",icon:r?a.jsx(Mb,{className:"size-3.5","aria-hidden":"true"}):a.jsx(_b,{className:"size-3.5","aria-hidden":"true"}),"aria-label":`${r?"Hide":"Show"} the value of ${n}`,"aria-pressed":r,onClick:()=>c(d=>!d),children:r?"Hide":"Show"})]})}function T4({app:n,onEdit:i}){const r=Object.keys(n.env).sort((c,d)=>c.localeCompare(d));return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Environment variables"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Stored on this server only, and available to the build and the running app."})]}),a.jsx(ae,{size:"sm",variant:"secondary",onClick:i,"aria-label":"Edit environment variables",children:"Edit"})]}),r.length===0?a.jsx("p",{className:"text-sm text-muted",children:"None set."}):a.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:r.map(c=>a.jsx(C4,{name:c,value:n.env[c]},c))})]})}function E4({appId:n,hook:i,meta:r,initialTab:c="activity",onClose:d,onConfigureHook:f,onChanged:m,onDelete:h}){const g=Et(),y=rn(),b=n!==null,[x,j]=p.useState(c),[S,R]=p.useState(!1),[k,C]=p.useState(null),[D,E]=p.useState(!1),O=Tt(M=>fe.deployments.get(n??"",M),[n],{enabled:b}),w=O.data&&O.data.id===n?O.data:null;p.useEffect(()=>{b&&(j(c),E(!1))},[b,n,c]);const U=!!(w&&(w.deploying||w.activeRunId));hl(O.reload,2e3,b&&U),hl(O.reload,8e3,b&&!!w&&!U);const Y=async M=>{if(!(!w||S||!await y({title:`Roll back ${w.id}?`,body:`Release ${M.id} (${Dr(M.sha)}) will be started in place of the live one. The app restarts.`,confirmLabel:"Roll back",tone:"danger"}))){R(!0);try{await fe.deployments.rollback(w.id,M.id),g.info("Rollback started"),j("activity"),O.reload(),m()}catch(I){g.error("Could not roll back",Ic(I,"Nothing was changed."))}finally{R(!1)}}},A=async M=>{if(!(!w||S||k||!await y({title:`Delete release ${M.id}?`,body:`Its files (${Dr(M.sha)}) are removed from this server. The deployment log stays. The live release and the one an automatic rollback would return to cannot be deleted.`,confirmLabel:"Delete release",tone:"danger"}))){C(M.id);try{await fe.deployments.removeRelease(w.id,M.id),g.success("Release deleted"),O.reload(),m()}catch(I){g.error("Could not delete the release",Ic(I,"Nothing was changed."))}finally{C(null)}}};return a.jsxs(a.Fragment,{children:[a.jsx(vn,{open:b,onClose:d,size:"xl",title:a.jsxs("span",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("span",{className:"font-mono",children:n}),w&&qc(w)&&a.jsx(je,{tone:"neutral",children:qc(w)}),w?.deploying&&a.jsx(je,{tone:"info",dot:!0,children:"Deploying"})]}),description:w?`${w.repoUrl} · ${w.branch}`:void 0,children:O.error&&!w?a.jsx(qt,{error:O.error,onRetry:O.reload}):w?a.jsxs("div",{className:"space-y-4",children:[w.warnings?.map(M=>a.jsx(ve,{tone:"warning",children:M},M)),a.jsx(WT,{ariaLabel:"App sections",value:x,onChange:j,items:[{id:"activity",label:"Deployments",count:w.runs.length},{id:"releases",label:"Releases",count:w.releases.length},{id:"setup",label:"Domain & folder"},{id:"env",label:"Environment"},{id:"github",label:"GitHub Actions"},{id:"ezjson",label:"ez.json"}]}),a.jsx(fi,{id:"activity",value:x,children:a.jsx(w4,{app:w,initialRunId:w.activeRunId??null})}),a.jsx(fi,{id:"releases",value:x,children:a.jsx(S4,{app:w,onRollback:M=>void Y(M),onDelete:M=>void A(M),deleting:k,busy:S||!!w.deploying})}),a.jsx(fi,{id:"setup",value:x,children:a.jsx(l3,{app:w,meta:r,onChanged:()=>{O.reload(),m()},onDelete:()=>h(w)})}),a.jsx(fi,{id:"env",value:x,children:a.jsx(T4,{app:w,onEdit:()=>E(!0)})}),a.jsx(fi,{id:"ezjson",value:x,children:a.jsx(r3,{app:w,locations:r.ezFileLocations})}),a.jsx(fi,{id:"github",value:x,children:a.jsx(k4,{app:w,hook:i,onConfigureHook:f,onChanged:()=>{O.reload(),m()}})}),!i.enabled&&x!=="github"&&w.hook.hasToken&&a.jsx(ve,{tone:"warning",title:"The deploy hook is switched off",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx(as,{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(_s,{})," Loading…"]})}),w&&a.jsx(W0,{open:D,app:w,meta:r,onClose:()=>E(!1),onRefresh:()=>{O.reload(),m()},onSaved:M=>{E(!1),g.success(`${M.id} saved`,"It applies to the next deployment."),O.reload(),m()}})]})}function Xy(n){return n.domain?"domain":n.bind==="0.0.0.0"?"direct":"local"}function R4({open:n,hook:i,domains:r,onClose:c,onSaved:d}){const f=Et(),[m,h]=p.useState(i.enabled),[g,y]=p.useState(Xy(i)),[b,x]=p.useState(i.domain??""),[j,S]=p.useState(String(i.port)),[R,k]=p.useState(!1),[C,D]=p.useState(!1);p.useEffect(()=>{n&&(h(i.enabled),y(Xy(i)),x(i.domain??""),S(String(i.port)),D(!1))},[n]);const E=r.filter(A=>A.enabled),O=E.find(A=>A.name===b),w=ru(j),U=m&&g==="domain"&&!O?"Choose a domain.":null,Y=async()=>{if(!R&&(D(!0),!(w||U))){k(!0);try{const A=await fe.deployments.updateHook({enabled:m,port:Number(j),bind:g==="direct"?"0.0.0.0":"127.0.0.1",domain:g==="domain"?b:null});A.nginxReloaded===!1?f.warning("Saved, but nginx was not reloaded","The domain’s config was written. Reload nginx for the deploy hook to be reachable."):f.success("Deploy hook saved",m?`The background service picks it up within ${A.appliesWithinSeconds??10} seconds.`:"Nothing is listening for deployments now."),d(A)}catch(A){const M=A instanceof Ue&&typeof A.payload.detail=="string"?A.payload.detail:null;f.error("Could not save the deploy hook",M??(A instanceof Error?A.message:"Nothing was changed."))}finally{k(!1)}}};return a.jsx(vn,{open:n,onClose:c,preventClose:R,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(ae,{variant:"secondary",onClick:c,disabled:R,children:"Cancel"}),a.jsx(ae,{variant:"primary",onClick:()=>void Y(),loading:R,children:"Save"})]}),children:a.jsxs("div",{className:"space-y-5",children:[a.jsx(Zt,{checked:m,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."}),m&&a.jsxs(a.Fragment,{children:[a.jsxs(pa,{label:"How CI reaches it",value:g,onChange:A=>y(A.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"})]}),g==="domain"&&a.jsxs(a.Fragment,{children:[a.jsxs(pa,{label:"Domain",value:b,onChange:A=>x(A.target.value),error:C?U: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…"}),E.map(A=>a.jsxs("option",{value:A.name,children:[A.name,A.ssl?"":" — no SSL"]},A.name))]}),E.length===0&&a.jsx(ve,{tone:"warning",children:"There is no enabled domain yet. Add one on the Domains page, or reach the hook directly."}),O&&!O.ssl&&a.jsx(ve,{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."})]}),g==="direct"&&a.jsx(ve,{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."}),g==="local"&&a.jsx(ve,{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(Ja,{children:a.jsx(Me,{label:"Listener port",type:"number",min:1,max:65535,inputMode:"numeric",value:j,onChange:A=>S(A.target.value),error:C?w:null,hint:g==="direct"?"The port CI connects to.":"Internal. nginx forwards to it; it is not opened to the network."})})]})]})})}function z4(n,i){return n instanceof Ue||n instanceof Error?n.message:i}function D4({data:n,onConfigure:i}){const{hook:r}=n,c=r.enabled&&(r.domain!==null||r.bind==="0.0.0.0"),f=!!(r.domain?n.domains.find(y=>y.name===r.domain):void 0)?.ssl;let m="neutral",h="Off",g="Apps are deployed from this dashboard only. Turn it on to deploy from GitHub Actions.";return r.enabled&&!r.listening?(m="warn",h="Not listening",g="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."):r.enabled&&!c?(m="neutral",h="This machine only",g="Listening, but only programs on this server can call it. GitHub cannot reach it."):r.enabled&&r.domain?(m=f?"ok":"warn",h=f?"On":"On — no SSL",g=f?`Reached through https://${r.domain}${r.path}`:`Reached through http://${r.domain}${r.path} — the deploy token travels unencrypted. Issue a certificate for that domain.`):r.enabled&&(m="warn",h="On — plain HTTP",g=`Listening on every interface, port ${r.port}. The deploy token travels unencrypted; prefer a domain with SSL.`),a.jsx(et,{children:a.jsx(pn,{icon:a.jsx(nu,{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:m,dot:!0,children:h})]}),description:g,actions:a.jsx(ae,{size:"sm",icon:a.jsx(Yb,{className:"size-3.5","aria-hidden":"true"}),onClick:i,children:"Configure"})})})}function A4({app:n,canDeploy:i,busy:r,onDeploy:c,onOpen:d,onEdit:f,onDelete:m}){const h=n.lastRun??null,g=n.process??null,y=h?j0[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:()=>d("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(ln,{tone:g?IT(g.status):"neutral",pulse:g?.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:n.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:n.repoUrl,children:_5(n.repoUrl,44)}),a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(_S,{className:"size-3","aria-hidden":"true"}),n.branch]}),n.domain&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-accent-text",children:[a.jsx(Os,{className:"size-3","aria-hidden":"true"}),n.domain]})]}),a.jsxs("span",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-faint",children:[g?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[g.status,g.status==="online"&&g.uptimeMs!==null?` · up ${au(g.uptimeMs)}`:""]}),g.memoryBytes!==null&&a.jsxs("span",{children:["· ",Wb(g.memoryBytes)]}),g.restarts>0&&a.jsxs("span",{children:["· ",$n(g.restarts,"restart")]})]}):a.jsx("span",{children:n.currentRelease?"Not running":"Never deployed"}),qc(n)&&a.jsxs("span",{children:["· ",qc(n)]})]}),n.warnings?.length?a.jsx("span",{className:"mt-1 block text-2xs text-warn",children:n.warnings.join(" ")}):null]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2 pl-7 lg:w-56 lg:shrink-0 lg:pl-0",children:n.deploying?a.jsx(je,{tone:"info",dot:!0,children:h?.status==="running"?Gc(h):"Deploying"}):y&&h?a.jsxs(a.Fragment,{children:[a.jsx(je,{tone:y.tone,dot:!0,children:y.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:Dr(h.sha)}),a.jsx("span",{className:"text-2xs text-faint",children:qr(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(ae,{variant:"primary",size:"sm",icon:a.jsx(Tr,{className:"size-3.5","aria-hidden":"true"}),onClick:c,loading:r,disabled:!i||!!n.deploying,children:"Deploy"}),a.jsx(ae,{size:"sm",onClick:()=>d("setup"),children:"Domain"}),a.jsx(ae,{size:"sm",onClick:()=>d("github"),children:"GitHub"}),a.jsx(ct,{label:`Edit ${n.id}`,size:"sm",onClick:f,children:a.jsx(Kh,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Delete ${n.id}`,size:"sm",variant:"dangerGhost",onClick:m,disabled:!!n.deploying,children:a.jsx(Us,{className:"size-4","aria-hidden":"true"})})]})]})}function O4(){ba("Deployments");const n=Et(),i=Tt(w=>fe.deployments.list(w),[]),r=i.data,c=!!r?.apps.some(w=>w.deploying);vl(i.reload),hl(i.reload,c?2e3:1e4);const[d,f]=p.useState(!1),[m,h]=p.useState(null),[g,y]=p.useState(!1),[b,x]=p.useState(null),[j,S]=p.useState(null),[R,k]=p.useState(null),C=()=>{h(null),f(!0)},D=async w=>{if(!j){S(w.id);try{await fe.deployments.deploy(w.id),x({id:w.id,tab:"activity"}),i.reload()}catch(U){n.error(`Could not deploy ${w.id}`,z4(U,"Nothing was started."))}finally{S(null)}}},E=a.jsx(La,{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(ct,{label:"Refresh",onClick:i.reload,children:a.jsx(Ct,{className:"size-4","aria-hidden":"true"})}),a.jsx(ae,{variant:"primary",icon:a.jsx(xa,{className:"size-4","aria-hidden":"true"}),onClick:C,disabled:!r,children:"New app"})]})});if(i.error&&!r)return a.jsxs(a.Fragment,{children:[E,a.jsx(qt,{error:i.error,onRetry:i.reload})]});if(!r)return a.jsxs(a.Fragment,{children:[E,a.jsxs(ns,{children:[a.jsx(tt,{className:"h-20 rounded-lg"}),a.jsx(tt,{className:"h-56 rounded-lg"})]})]});const O=r.requirements.git&&r.requirements.pm2;return a.jsxs(a.Fragment,{children:[E,a.jsxs("div",{className:"space-y-5",children:[!r.requirements.git&&a.jsx(ve,{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."}),!r.requirements.pm2&&a.jsxs(ve,{tone:"warning",title:"PM2 is not installed",action:a.jsx(kt,{to:"/processes",className:ma("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(D4,{data:r,onConfigure:()=>y(!0)}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Tr,{className:"size-4","aria-hidden":"true"}),title:"Apps",description:r.apps.length===0?"Nothing is deployed from here yet.":`${$n(r.apps.length,"app")}. Each runs under PM2 as ez-<name>.`}),r.apps.length===0?a.jsx(xn,{children:a.jsx(ga,{icon:a.jsx(Tr,{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(ae,{variant:"primary",icon:a.jsx(xa,{className:"size-4","aria-hidden":"true"}),onClick:C,children:"New app"})})}):a.jsx("ul",{className:"divide-y divide-line",children:r.apps.map(w=>a.jsx(A4,{app:w,canDeploy:O,busy:j===w.id,onDeploy:()=>void D(w),onOpen:U=>x({id:w.id,tab:U}),onEdit:()=>{h(w),f(!0)},onDelete:()=>k(w)},w.id))})]})]}),a.jsx(W0,{open:d,app:m,meta:r,onClose:()=>f(!1),onRefresh:i.reload,onCreated:()=>i.reload(),onDeployNow:w=>{f(!1),x({id:w,tab:"activity"}),i.reload()},onSaved:(w,U)=>{f(!1),i.reload(),U?n.success(`${w.id} created`,"Press Deploy to build and start it."):n.success(`${w.id} saved`,"It applies to the next deployment.")}}),a.jsx(R4,{open:g,hook:r.hook,domains:r.domains,onClose:()=>y(!1),onSaved:()=>{y(!1),i.reload()}}),a.jsx(E4,{appId:b?.id??null,initialTab:b?.tab,hook:r.hook,meta:r,onClose:()=>x(null),onConfigureHook:()=>y(!0),onChanged:i.reload,onDelete:w=>k(w)}),a.jsx(s3,{app:R,onClose:()=>k(null),onDeleted:()=>{k(null),x(null),i.reload()}})]})}const Ky=[{id:"error",label:"Error",fileName:"error.log"},{id:"access",label:"Access",fileName:"access.log"}];function M4(n){return/\[(error|crit|emerg|alert)\]/.test(n)?"text-bad":/\[(warn|warning)\]/.test(n)?"text-warn":/\s(2\d\d|3\d\d)\s/.test(n)?"text-ok":"text-muted"}function _4(){ba("Logs");const{connectionError:n}=yn(),[i,r]=tu(),d=i.get("file")==="access"?"access":"error",f=Ky.find(S=>S.id===d),m=S=>{const R=new URLSearchParams(i);S==="error"?R.delete("file"):R.set("file",S),r(R,{replace:!0})},h=h0(d,{limit:500}),g=p.useRef(null),[y,b]=p.useState(!0);p.useEffect(()=>{const S=g.current;S&&y&&(S.scrollTop=S.scrollHeight)},[h.lines,y]);const x=h.paused,j=h.connected&&!x;return a.jsxs(a.Fragment,{children:[a.jsx(La,{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:x?"warn":h.connected?"ok":"bad",dot:!0,children:x?"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:Ky.map(S=>a.jsx("button",{type:"button","aria-pressed":d===S.id,onClick:()=>m(S.id),className:oe("rounded-sm px-3 py-1 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",d===S.id?"bg-surface text-ink shadow-sm":"text-muted hover:text-ink"),children:S.label},S.id))}),a.jsx(ae,{variant:"secondary",size:"sm",icon:x?a.jsx(Br,{className:"size-3.5","aria-hidden":"true"}):a.jsx(Bb,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>h.setPaused(!x),children:x?"Resume":"Pause"}),a.jsx(ae,{variant:"ghost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),onClick:h.clear,disabled:h.lines.length===0,children:"Clear"}),a.jsx(ae,{variant:"ghost",size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:h.restart,disabled:!h.connected,children:"Reload tail"}),a.jsx(Ut,{value:h.lines.join(`
527
+ `),label:"Copy logs",withText:!0})]})}),n&&a.jsx(ve,{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(et,{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(ln,{tone:x?"warn":h.connected?"ok":"bad",pulse:j}),x?"Paused":h.connected?"Live":"Reconnecting"]}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:f.fileName}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:h.lines.length===1?"1 line":`${h.lines.length} lines`}),x&&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:y?"Following the tail":"Scrolled back"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{ref:g,role:"log","aria-label":`nginx ${f.label.toLowerCase()} log`,"aria-live":"off",onScroll:()=>{const S=g.current;S&&b(S.scrollHeight-S.scrollTop-S.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?d==="access"?"No access lines yet. They appear here as nginx writes them.":"No error lines yet.":"Waiting for the live stream…"}):h.lines.map((S,R)=>a.jsx("div",{className:oe("whitespace-pre-wrap break-all py-0.5",M4(S)),children:S},`${R}-${S}`))}),!y&&a.jsxs("button",{type:"button",onClick:()=>{const S=g.current;S&&(S.scrollTop=S.scrollHeight),b(!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(zb,{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 Zy={not_linked:"Not linked",connecting:"Connecting…",connected:"Connected",rejected:"Rejected by the Hub",unreachable:"Hub unreachable"},Qy={connected:"ok",connecting:"warn",unreachable:"warn",rejected:"bad",not_linked:"neutral"};function ch(n,i){return n instanceof Ue?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function L4({checked:n,indeterminate:i,disabled:r,label:c,onChange:d}){const f=p.useRef(null);return p.useEffect(()=>{f.current&&(f.current.indeterminate=i)},[i]),a.jsx("input",{ref:f,type:"checkbox","aria-label":`All ${c} permissions`,checked:n,disabled:r,onChange:m=>d(m.target.checked),className:"mt-0.5 size-4 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"})}function uh(n,i){return!!n.comingSoon||i.includes(n.id)}function U4(){const n=Et(),i=rn(),r=Tt(F=>fe.hub.status(F)),c=r.setData,[d,f]=p.useState(""),[m,h]=p.useState(null),[g,y]=p.useState(!1),[b,x]=p.useState(!1),[j,S]=p.useState(!1),R=r.data?.status??"not_linked",{client:k}=yn();p.useEffect(()=>{if(!k)return;const F=Z=>{c(te=>te&&{...te,linked:Z.linked,connected:Z.connected,status:Z.status,lastError:Z.lastError,attempts:Z.attempts,...Z.linked?{}:{hubUrl:null,serverId:null,permissions:{}}})};return k.on("hub:agentState",F),()=>k.off("hub:agentState",F)},[k,c]);const C=async()=>{if(g)return;const F=kC(d);if(F){h(F);return}h(null),y(!0);try{const Z=await fe.hub.connect(d.trim());r.setData(Z.status),f(""),n.success("Connection string saved",Z.status.status==="connecting"?"Connecting to the Hub…":"This server is now linked to the Hub.")}catch(Z){h(ch(Z,"The Hub did not accept that connection string."))}finally{y(!1)}},D=async()=>{if(!(b||!await i({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"}))){x(!0);try{await fe.hub.unlink(),r.setData(Z=>Z&&{...Z,linked:!1,hubUrl:null,serverId:null,connected:!1,status:"not_linked",permissions:{},lastError:null,attempts:0}),f(""),h(null),n.success("Unlinked from the Hub")}catch(Z){n.error("Could not unlink",ch(Z,"The link is still in place."))}finally{x(!1)}}},E=r.data?.permissions??{},O=r.data?.tree??[],w=r.data?.comingSoon??[],U=async(F,Z)=>{if(!j){S(!0),r.setData(te=>{if(!te)return te;const ce={...te.permissions};for(const K of F)ce[K]=Z;return{...te,permissions:ce}});try{const te={};for(const K of F)te[K]=Z;const ce=await fe.hub.updatePermissions(te);r.setData(K=>K&&{...K,permissions:ce.permissions,tree:ce.tree,comingSoon:ce.comingSoon})}catch(te){n.error("Could not save permissions",ch(te,"The change was not kept.")),r.reload()}finally{S(!1)}}},Y=F=>{const Z=F.children.filter(ce=>!uh(ce,w));if(Z.length===0)return"off";const te=Z.filter(ce=>E[ce.id]===!0).length;return te===0?"off":te===Z.length?"on":"partial"},A=(F,Z)=>{const te=F.children.filter(ce=>!uh(ce,w)).map(ce=>ce.id);te.length!==0&&U(te,Z)},M=Object.values(E).filter(Boolean).length,W=F=>a.jsxs("div",{className:"w-full max-w-md space-y-3",children:[a.jsx(Hc,{label:"Connection string",value:d,onChange:Z=>{f(Z.target.value),m&&h(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(ae,{variant:"primary",loading:g,disabled:!d.trim(),icon:a.jsx(PS,{className:"size-4","aria-hidden":"true"}),onClick:()=>void C(),children:F})]}),I=Qy[R]??"neutral",ne=(()=>{if(r.error&&!r.data)return a.jsx(xn,{children:a.jsx(qt,{error:r.error,title:"Could not read the Hub status",onRetry:r.reload,className:"border-0"})});if(!r.data)return a.jsxs(xn,{className:"space-y-3",children:[a.jsx(tt,{className:"h-5 w-48"}),a.jsx(tt,{className:"h-24 rounded-md"}),a.jsx(tt,{className:"h-40 rounded-md"})]});const F=r.data,Z=Zy[F.status]??"Unknown state",te=Qy[F.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(ln,{tone:te,pulse:F.status==="connecting"}),a.jsx("span",{className:"text-sm font-medium text-ink",children:Z}),F.hubUrl&&a.jsx("code",{className:"break-all font-mono text-xs text-muted",children:F.hubUrl}),F.serverId&&a.jsxs("span",{className:"text-2xs text-faint",children:["Server ID ",a.jsx("code",{className:"font-mono text-muted",children:F.serverId})]}),F.linked&&a.jsx("span",{className:"text-2xs text-faint",title:F.agentOwner==="daemon"?"The Hub connection is held by the background service, which keeps it alive with no browser open.":"The Hub connection is held by this dashboard and stops when it closes.",children:F.agentOwner==="daemon"&&!F.agentReported?"waiting for the background service…":F.agentOwner==="daemon"?"via the background service":"via this dashboard"}),F.status==="unreachable"&&F.attempts>0&&a.jsxs("span",{className:"text-2xs text-faint",children:[F.attempts," reconnect attempt",F.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:F.dataDir}),F.devDataDir&&a.jsx(je,{tone:"warn",children:"dev override"}),F.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(xn,{className:"space-y-5",children:[F.lastError&&a.jsx(ve,{tone:F.status==="rejected"?"danger":"warning",title:F.status==="rejected"?"The Hub rejected this server":"The Hub cannot be reached right now",children:F.lastError}),F.linked?a.jsxs(a.Fragment,{children:[F.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."}),W("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:M>0?"accent":"neutral",children:[M," granted"]})]}),a.jsx("div",{className:"space-y-2.5",children:O.map(ce=>{const K=Y(ce);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(L4,{checked:K==="on",indeterminate:K==="partial",disabled:j,label:ce.label,onChange:H=>A(ce,H)}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:ce.label}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:ce.description})]})]}),a.jsx("ul",{className:"divide-y divide-line/60",children:ce.children.map(H=>{const L=uh(H,w),ee=E[H.id]===!0;return a.jsx("li",{children:a.jsxs("label",{className:oe("flex items-start gap-3 px-3.5 py-2.5 pl-8",L?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-inset/60"),children:[a.jsx("input",{type:"checkbox",checked:ee,disabled:L||j,onChange:()=>void U([H.id],!ee),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:[H.label,L&&a.jsx(je,{tone:"warn",children:"Coming soon"})]}),a.jsx("span",{className:"mt-0.5 block text-xs text-faint",children:H.description})]})]})},H.id)})})]},ce.id)})})]}),a.jsx("div",{className:"border-t border-line pt-4",children:a.jsx(ae,{variant:"dangerGhost",loading:b,icon:a.jsx(Ik,{className:"size-4","aria-hidden":"true"}),onClick:()=>void D(),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"})]})]}),W("Connect")]})]})]})})();return a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",I==="ok"?"bg-ok/60":I==="bad"?"bg-bad/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(nS,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Easy DevOps Hub",r.data&&a.jsx(je,{tone:I,dot:!0,children:Zy[r.data.status]??"Unknown"}),r.data?.devDataDir&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Monitor and control this server from a central dashboard.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:r.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:r.reload,children:"Refresh"})}),ne,r.loading&&r.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(_s,{}),"Refreshing the Hub state…"]})]})}const H4=["starting","stopping","updating","restarting"],dh=[{id:"starting",label:"Hand over to the update worker"},{id:"stopping",label:"Stop the dashboard and the service"},{id:"updating",label:"Install the new version"},{id:"restarting",label:"Start the dashboard again"}],Iy={starting:"Starting…",stopping:"Stopping…",updating:"Updating…",restarting:"Restarting…",done:"Completed",failed:"Failed",interrupted:"Interrupted"},B4={starting:"warn",stopping:"warn",updating:"warn",restarting:"warn",done:"ok",failed:"bad",interrupted:"warn"};function $4(n,i){return n instanceof Ue?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function Py(n){return n!==void 0&&H4.includes(n)}function q4(n){return!(n instanceof Ue)||n.status!==403||n.payload.error!=="elevation_required"?null:{command:typeof n.payload.command=="string"&&n.payload.command?n.payload.command:"ezz update",shell:typeof n.payload.shell=="string"?n.payload.shell:null}}function Fy({run:n}){const i=[];return n.serviceInstalled?i.push({label:"Background service",value:n.versionConfirmed?`Running v${n.runningVersion} (reported by the daemon)`:`Restarted, reporting ${n.runningVersion?`v${n.runningVersion}`:"an unknown version"}`}):i.push({label:"Background service",value:"Not installed — the package was updated on its own"}),n.refreshedCopy&&i.push({label:"Runtime copy",value:"Refreshed, so the service runs the new code"}),n.dashboardRestarted===!1?i.push({label:"Dashboard",value:"Did not come back automatically — start it from the CLI"}):n.dashboardPort&&i.push({label:"Dashboard",value:`Running again on port ${n.dashboardPort}`}),a.jsx("dl",{className:"grid gap-x-6 gap-y-2 text-xs sm:grid-cols-[auto_1fr]",children:i.map(r=>a.jsxs("div",{className:"contents",children:[a.jsx("dt",{className:"font-medium uppercase tracking-wider text-faint",children:r.label}),a.jsx("dd",{className:"text-muted",children:r.value})]},r.label))})}function G4({run:n}){const i=n.finishedAt?Ph(new Date(n.finishedAt).toISOString()):null;return n.phase==="done"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs(ve,{tone:"success",title:`Updated v${n.from} → v${n.to}`,children:[i?`Finished ${i}. `:"","The dashboard runs the new version from now on."]}),a.jsx(Fy,{run:n}),n.dashboardRestarted===!1&&a.jsxs(ve,{tone:"warning",title:"The dashboard did not come back by itself",children:["Start it again with ",a.jsx("code",{className:"font-mono",children:"ezz --dash"})," in a terminal."]})]}):n.phase==="interrupted"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs(ve,{tone:"warning",title:"The update was interrupted",children:["The worker that performs the update stopped reporting",n.step?` during “${n.step}”`:"",". Nothing here can say what state the files are in — run ",a.jsx("code",{className:"font-mono",children:"ezz update"})," in a terminal; it checks the source, reinstalls and verifies the service from the beginning."]}),a.jsx(ae,{variant:"secondary",size:"sm",icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>window.location.reload(),children:"Reload the page"})]}):a.jsxs("div",{className:"space-y-3",children:[a.jsx(ve,{tone:"danger",title:`The update failed${n.step?` (${n.step})`:""}`,children:a.jsx("span",{className:"whitespace-pre-wrap break-words",children:n.reason??"No reason was reported."})}),n.rolledBack?a.jsx(ve,{tone:"success",title:`Rolled back to v${n.from}`,children:n.restored?"The background service is running again on the version you had.":"The service did not come back — start it from Processes."}):n.serviceInstalled?a.jsx(ve,{tone:"warning",title:"The service may not be running",children:"Start it again from Processes once you have checked the log below."}):null,a.jsx(Fy,{run:n})]})}function Y4(){const n=Et(),i=rn(),r=Tt(w=>fe.update.check(w)),[c,d]=p.useState(null),[f,m]=p.useState(null),[h,g]=p.useState(!1),[y,b]=p.useState(!1),[x,j]=p.useState(!1),[S,R]=p.useState(null),k=p.useRef(null),C=r.reload;p.useEffect(()=>{const w=r.data;w&&(d(w.current),m(U=>U??w.run),w.elevation?.required!==!0&&R(null))},[r.data]);const D=Py(f?.phase);p.useEffect(()=>{if(!D)return;let w=!1,U;const Y=async()=>{try{const A=await fe.update.status();if(w)return;b(!1),d(A.current),m(A.run)}catch(A){if(w)return;A instanceof Ue&&A.status===0&&b(!0)}w||(U=window.setTimeout(Y,y?3e3:1500))};return U=window.setTimeout(Y,1200),()=>{w=!0,U&&window.clearTimeout(U)}},[D,y]),p.useEffect(()=>{!f||Py(f.phase)||k.current!==f.id&&(k.current=f.id,C())},[f,C]);const E=async()=>{const w=r.data?.latest;if(!(!w||h||!await i({title:`Update to v${w}?`,body:"The dashboard stops, installs the new version and starts again on this port. This page loses its connection while that happens and comes back by itself — one or two minutes is normal. Do not close the tab.",confirmLabel:"Update now",tone:"accent"}))){g(!0);try{const Y=await fe.update.start(w);b(!1),m(Y.run),n.success("Update started","The dashboard will stop for a moment and come back on its own.")}catch(Y){const A=q4(Y);if(A){R(A),r.reload();return}n.error("Could not start the update",$4(Y,"Nothing was changed.")),r.reload()}finally{g(!1)}}},O=(()=>{if(r.error&&!r.data)return a.jsx(xn,{children:a.jsx(qt,{error:r.error,title:"Could not check for updates",onRetry:r.reload,className:"border-0"})});if(!r.data)return a.jsxs(xn,{className:"space-y-3",children:[a.jsx(tt,{className:"h-5 w-56"}),a.jsx(tt,{className:"h-20 rounded-md"})]});const{source:w,latest:U,reachable:Y,updateAvailable:A}=r.data,M=D&&f,W=r.data.elevation,I=W?.required===!0||S!==null,ne=S?.command??W?.command??"ezz update",F=S?.shell??W?.shell??"Administrator PowerShell",Z=F.startsWith("Administrator ")?`Update from an ${F}`:`Update from ${F}`,te=I&&A;return a.jsxs(xn,{className:"space-y-5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Installed"}),a.jsxs("div",{className:"mt-0.5 font-mono text-sm font-medium text-ink",children:["v",c??r.data.current]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Latest"}),a.jsx("div",{className:"mt-0.5 font-mono text-sm font-medium text-ink",children:Y&&U?`v${U}`:"—"})]}),a.jsx("div",{className:"pt-4",children:Y?A?a.jsx(je,{tone:"accent",dot:!0,children:"Update available"}):a.jsx(je,{tone:"ok",dot:!0,children:"Up to date"}):a.jsx(je,{tone:"warn",dot:!0,children:"Registry unreachable"})})]}),!w.npmUpdatable&&a.jsxs(ve,{tone:"warning",title:"This copy is not managed by npm",children:["This installation is ",w.reason,". Running"," ",a.jsx("code",{className:"font-mono",children:"npm install -g"})," would install a second copy and leave this one running, so updates have to be done by hand:",a.jsx("pre",{className:"mt-2 overflow-x-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-ink",children:w.howToUpdate.join(`
528
+ `)})]}),te&&a.jsxs(ve,{tone:"warning",title:Z,children:[a.jsx("p",{children:"This server runs Easy DevOps as a Windows service in Server mode. Updating replaces files only administrators can change, so the dashboard cannot do it."}),a.jsx("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:ne}),a.jsx(Ut,{value:ne,label:"Copy command",withText:!0})]})}),a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"If you run it from a normal PowerShell, Easy DevOps offers to relaunch itself as administrator (one Windows prompt, no password)."})]}),M&&a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/40 px-4 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}),a.jsxs("span",{className:"text-sm font-medium text-ink",children:["Updating v",M.from," → v",M.to]}),a.jsx(je,{tone:"warn",dot:!0,children:Iy[M.phase]})]}),a.jsx("ol",{className:"space-y-1.5",children:dh.map(ce=>{const K=dh.findIndex(ee=>ee.id===M.phase),H=dh.findIndex(ee=>ee.id===ce.id),L=H<K?"done":H===K?"current":"pending";return a.jsxs("li",{className:oe("flex items-center gap-2 text-xs",L==="pending"?"text-faint":"text-muted"),children:[L==="done"?a.jsx(dl,{className:"size-3.5 text-ok","aria-hidden":"true"}):L==="current"?a.jsx(gn,{className:"spin size-3.5 text-accent-text","aria-hidden":"true"}):a.jsx(Ob,{className:"size-3.5","aria-hidden":"true"}),ce.label]},ce.id)})}),y&&a.jsx(ve,{tone:"info",title:"The dashboard is restarting",children:"This page cannot reach it at the moment. It keeps reconnecting and shows the result here as soon as the dashboard is back."}),M.logTail.length>0&&a.jsx("pre",{className:"max-h-36 overflow-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-muted",children:M.logTail.join(`
529
+ `)})]}),f&&!D&&a.jsxs("div",{className:"space-y-3 border-t border-line pt-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-ink",children:f.phase==="done"?`Last update: v${f.from} → v${f.to}`:`Last update attempt (v${f.to})`}),a.jsx(je,{tone:B4[f.phase],dot:!0,children:Iy[f.phase]})]}),a.jsx(G4,{run:f}),f.logTail.length>0&&a.jsx(ou,{id:"update-log",title:"Update log",open:x,onOpenChange:j,headerClassName:"py-1",contentClassName:"pb-1",children:a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-muted",children:f.logTail.join(`
530
+ `)})})]}),!M&&w.npmUpdatable&&a.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t border-line pt-4",children:[A&&U&&!te?a.jsxs(ae,{variant:"primary",loading:h,icon:a.jsx(Zv,{className:"size-4","aria-hidden":"true"}),onClick:()=>void E(),children:["Update to v",U]}):f?.phase==="done"?a.jsx(ae,{variant:"secondary",icon:a.jsx(Ct,{className:"size-4","aria-hidden":"true"}),onClick:()=>window.location.reload(),children:"Reload the page"}):null,a.jsx("p",{className:"text-xs text-muted",children:"The dashboard stops while the update runs and starts again on this port by itself."})]})]})})();return a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Zv,{className:"size-4","aria-hidden":"true"}),title:"Easy DevOps version",description:"Update the package this dashboard and its service run on. Nothing is installed unless you ask for it.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:r.loading,disabled:D,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:r.reload,children:"Check again"})}),O,r.loading&&r.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(_s,{}),"Checking the npm registry…"]}),a.jsx(zc,{children:a.jsxs("span",{className:"text-2xs text-faint",children:["Same flow as ",a.jsx("code",{className:"font-mono",children:"ezz update"})," — stop the service, replace the package, verify, and roll back if the new version does not come up."]})})]})}const Jy=[{id:"general",label:"General"},{id:"access",label:"Access"},{id:"hub",label:"Hub"},{id:"backup",label:"Backup"},{id:"update",label:"Update"}],_h=[{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 V4(n){return n==="::1"?"This machine only (::1)":_h.find(i=>i.value===n)?.label??n}const Mc={days:7,min:1,max:30};function fh(n){return{port:String(n.dashboardPort),nginxDir:n.nginxDir,sslDir:n.sslDir,acmeEmail:n.acmeEmail,autoRenew:n.sslAutoRenew??!0,autoRenewDays:String(n.sslAutoRenewDays??Mc.days),deployDir:n.deployDir??"",ui:n.dashboardUi??"classic"}}function hh(n){return{bind:n.dashboardBindAddress,auth:n.dashboardAuth,password:"",confirm:""}}function Nr(n,i){return n instanceof Ue?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function X4(n){if(n instanceof Ue){const i=n.payload.reason;if(i==="no_auth_requires_loopback")return"Running without a password requires the dashboard to listen on this machine only.";if(i==="bind_requires_password")return"Set a password before opening the dashboard to the network.";if(i==="no_auth_requires_local_request")return"Turning the password off is only allowed from this machine itself."}return Nr(n,"The previous access settings are still in force.")}function K4(){ba("Settings");const n=Et(),i=rn(),{auth:r}=ja(),c=r?.minPasswordLength??8,[d,f]=tu(),m=d.get("tab"),h=Jy.some(Te=>Te.id===m)?m:"general",g=Te=>{const ut=new URLSearchParams(d);Te==="general"?ut.delete("tab"):ut.set("tab",Te),f(ut,{replace:!0})},y=Tt(Te=>fe.settings.get(Te)),b=Tt(Te=>fe.settings.permissions(Te),[],{enabled:!!y.data&&y.data?.platform!=="win32"}),{service:x,error:j,reload:S}=$r(),R=Gr(x);ji("settings",()=>{y.reload(),b.reload()});const[k,C]=p.useState(null),[D,E]=p.useState(null),[O,w]=p.useState(!1),[U,Y]=p.useState(!1),[A,M]=p.useState(!1),[W,I]=p.useState(!1),[ne,F]=p.useState(!1),[Z,te]=p.useState(null),[ce,K]=p.useState(null);p.useEffect(()=>{y.data&&!k&&C(fh(y.data))},[y.data,k]),p.useEffect(()=>{y.data&&!D&&E(hh(y.data))},[y.data,D]);const H=k?ru(k.port):null,L=k?l0(k.acmeEmail):null,ee=k&&!k.nginxDir.trim()?"This directory is required.":null,de=k&&!k.sslDir.trim()?"This directory is required.":null,ke=y.data?.deployDir!==void 0,Ne=!!k&&ke&&k.deployDir.trim()!==(y.data?.deployDir??""),Ee=y.data?.sslAutoRenew!==void 0,T=y.data?.dashboardUi!==void 0,q=y.data?.sslAutoRenewDaysMin??Mc.min,V=y.data?.sslAutoRenewDaysMax??Mc.max,re=k?Number(k.autoRenewDays):NaN,ye=k&&Ee&&k.autoRenew&&(!/^\d+$/.test(k.autoRenewDays.trim())||re<q||re>V)?`Enter a whole number from ${q} to ${V}.`:null,Re=!!(k&&y.data&&(Number(k.port)!==y.data.dashboardPort||k.nginxDir!==y.data.nginxDir||k.sslDir!==y.data.sslDir||k.acmeEmail!==y.data.acmeEmail||T&&k.ui!==(y.data.dashboardUi??"classic")||ke&&k.deployDir.trim()!==(y.data.deployDir??"")||Ee&&(k.autoRenew!==(y.data.sslAutoRenew??!0)||k.autoRenew&&re!==(y.data.sslAutoRenewDays??Mc.days)))),xe=!!(D&&y.data&&(D.bind!==y.data.dashboardBindAddress||D.auth!==y.data.dashboardAuth||D.password!=="")),me=async()=>{if(!k||A||!y.data||(w(!0),H||L||ee||de||ye))return;const Te=T&&k.ui!==(y.data.dashboardUi??"classic"),ut=Number(k.port)!==y.data.dashboardPort;M(!0);try{const Rt=await fe.settings.update({dashboardPort:Number(k.port),nginxDir:k.nginxDir.trim(),sslDir:k.sslDir.trim(),acmeEmail:k.acmeEmail.trim(),...T?{dashboardUi:k.ui}:{},...Ne?{deployDir:k.deployDir.trim()}:{},...Ee?{sslAutoRenew:k.autoRenew,...k.autoRenew?{sslAutoRenewDays:re}:{}}:{}});F(Rt.needsRestart),n.success("Settings saved",Rt.needsRestart?Te&&ut?"Restart the dashboard for the new port and interface to take effect.":Te?"The chosen interface applies the next time the dashboard starts.":"Restart the dashboard for the new port to take effect.":void 0),y.reload()}catch(Rt){n.error("Could not save settings",Nr(Rt,"The previous settings are still in force."))}finally{M(!1)}},ie=async()=>{if(!D||!y.data||W)return;if(Y(!0),te(null),K(null),D.auth==="none"&&D.bind==="0.0.0.0"){te("Running without a password requires the dashboard to listen here only.");return}if(D.password){const ut=ay(D.password,c)??(D.password!==D.confirm?"The two passwords do not match.":null);if(ut){K(ut);return}}else if(D.auth==="password"&&!y.data.hasPassword){K("Set a password before requiring a password to sign in.");return}const Te=D.password?"password":D.auth;I(!0);try{const ut={dashboardBindAddress:D.bind,dashboardAuth:Te};D.password&&(ut.dashboardPassword=D.password);const Rt=await fe.settings.update(ut);F(Rt.needsRestart),E(jt=>jt&&{...jt,auth:Rt.dashboardAuth,password:"",confirm:""}),n.success("Access settings saved",Rt.needsRestart?"Restart the dashboard for the new listening address to take effect.":void 0),y.reload()}catch(ut){te(X4(ut))}finally{I(!1)}},[Pe,Ve]=p.useState(null),[Xe,ue]=p.useState(!1),[De,we]=p.useState(null),nt=async()=>{if(!Xe){ue(!0),Ve(null);try{const Te=await fe.settings.setupPermissions();we(Te),Te.configured&&(b.setData({configured:!0}),n.success("Permissions configured","nginx and systemctl no longer prompt for a password."))}catch(Te){Ve(Nr(Te,"The setup commands could not be prepared."))}finally{ue(!1)}}},rt=()=>{Ve(null),b.reload()},xt=p.useRef(null),[bt,zn]=p.useState(!1),[jn,na]=p.useState(!1),[J,be]=p.useState(null),He=async()=>{if(!bt){zn(!0);try{const Te=await fe.settings.backup(),ut=new Blob([JSON.stringify(Te,null,2)],{type:"application/json"}),Rt=URL.createObjectURL(ut),jt=document.createElement("a");jt.href=Rt,jt.download=`easy-devops-backup-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(jt),jt.click(),jt.remove(),window.setTimeout(()=>URL.revokeObjectURL(Rt),1e3),n.success("Backup downloaded")}catch(Te){n.error("Could not create the backup",Nr(Te,"Nothing was downloaded."))}finally{zn(!1)}}},Dt=async Te=>{const ut=Te.target.files?.[0];if(!ut)return;be(null);let Rt;try{Rt=JSON.parse(await ut.text())}catch{be({tone:"danger",title:"That file is not valid JSON",body:"Pick the .json file produced by Export backup."}),Te.target.value="";return}const jt=Rt;if(!jt||typeof jt!="object"||typeof jt.config!="object"||jt.config===null){be({tone:"danger",title:"That file is not an Easy DevOps backup",body:"A backup always contains a config section and a domains list."}),Te.target.value="";return}const Ze=await i({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(Te.target.value="",!!Ze){na(!0);try{await fe.settings.restore(Rt);const It=await fe.settings.get();y.setData(It),C(fh(It)),E(hh(It)),w(!1),Y(!1),F(!1),b.reload(),be({tone:"success",title:"Backup restored",body:`Configuration from ${Ph(jt.exportedAt??null)} is now in force. Reload any other open dashboard tabs to pick it up.`}),n.success("Backup restored")}catch(It){be({tone:"danger",title:"The restore failed",body:Nr(It,"Nothing was changed.")})}finally{na(!1)}}},aa=()=>{y.reload(),b.reload(),h==="general"&&S()},Ke=ne&&a.jsx(ve,{tone:"info",title:"Restart needed",children:"The port or listening address changed. It takes effect after the dashboard restarts."}),yl=()=>y.error&&!y.data?a.jsx(qt,{error:y.error,title:"Could not read the settings",onRetry:y.reload}):!y.data||!k?a.jsxs(ns,{children:[a.jsx(tt,{className:"h-64 rounded-lg"}),a.jsx(tt,{className:"h-40 rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Yb,{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(xn,{className:"space-y-5",children:[Ke,a.jsxs(Ja,{children:[a.jsx(Me,{label:"Dashboard port",type:"number",min:1,max:65535,inputMode:"numeric",value:k.port,onChange:Te=>C({...k,port:Te.target.value}),error:O?H:null,hint:"Takes effect after the dashboard restarts."}),a.jsx(Me,{label:"ACME email",type:"email",value:k.acmeEmail,onChange:Te=>C({...k,acmeEmail:Te.target.value}),error:O?L:null,hint:"Used when ordering certificates. Usually not shown to anyone.",placeholder:"admin@example.com"}),a.jsx(Me,{label:"Nginx directory",value:k.nginxDir,onChange:Te=>C({...k,nginxDir:Te.target.value}),error:O?ee:null,hint:"Where nginx.conf is located.",className:"font-mono",spellCheck:!1}),a.jsx(Me,{label:"SSL settings directory",value:k.sslDir,onChange:Te=>C({...k,sslDir:Te.target.value}),error:O?de:null,hint:"Default directory for certificates the dashboard manages.",className:"font-mono",spellCheck:!1}),ke&&a.jsx(Me,{label:"Deployments folder",value:k.deployDir,onChange:Te=>C({...k,deployDir:Te.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",y.data.deployDirDefault?` (${y.data.deployDirDefault})`:"","."]}),placeholder:y.data.deployDirDefault,className:"font-mono",spellCheck:!1}),T&&a.jsxs(pa,{label:"Dashboard interface",value:k.ui,onChange:Te=>C({...k,ui:Te.target.value}),hint:"Applies the next time the dashboard starts.",children:[a.jsx("option",{value:"new",children:"New — this dashboard"}),a.jsx("option",{value:"classic",children:"Classic — the older page"})]})]}),Ee&&a.jsxs("div",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(Zt,{checked:k.autoRenew,onChange:Te=>C({...k,autoRenew:Te}),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."})}),k.autoRenew&&a.jsx(Ja,{children:a.jsx(Me,{label:"Renew this many days before expiry",type:"number",min:q,max:V,inputMode:"numeric",value:k.autoRenewDays,onChange:Te=>C({...k,autoRenewDays:Te.target.value}),error:O?ye:null,hint:k.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(zc,{children:[a.jsx("span",{className:"text-2xs text-faint",children:Re?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ae,{variant:"ghost",size:"sm",disabled:!Re,onClick:()=>{C(fh(y.data)),w(!1)},children:"Revert"}),a.jsx(ae,{variant:"primary",size:"sm",loading:A,disabled:!Re,icon:a.jsx(yh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void me(),children:"Save settings"})]})]})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Gb,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Background service",R&&a.jsx(je,{tone:R.running?"ok":"warn",dot:!0,children:Uc(R)}),x?.dev&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Runs monitoring and notifications without this dashboard open.",actions:a.jsx(kt,{to:"/processes",className:ma("secondary","sm"),children:"Open Processes"})}),a.jsx(xn,{children:j&&!x?a.jsxs(ve,{tone:"warning",title:"Could not read the service state",children:[j.message," ",a.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:S,children:"Try again"})]}):x?R?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:oe("mt-0.5 text-sm font-medium",R.running?"text-ok":"text-warn"),children:Uc(R)}),R.stoppedByUser&&R.stoppedAtLabel&&a.jsxs("div",{className:"mt-0.5 text-2xs text-faint",children:["Stopped ",R.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:R.mechanismDetail,children:R.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:R.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:x.pm2.installed===null?"Checking…":x.pm2.installed?x.pm2.version??"Installed":"Not installed"}),x.probes?.pending?a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:"Measuring…"}):x.probes?.refreshing?a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:"Refreshing…"}):null]})]}):null:a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(_s,{}),"Checking the background service…"]})})]})]}),bl=()=>{if(y.error&&!y.data)return a.jsx(qt,{error:y.error,title:"Could not read the settings",onRetry:y.reload});if(!y.data||!D)return a.jsxs(ns,{children:[a.jsx(tt,{className:"h-72 rounded-lg"}),a.jsx(tt,{className:"h-40 rounded-lg"})]});const Te=D.bind!=="0.0.0.0",ut=y.data.canUseNoPassword||Te,Rt=D.password?ay(D.password,c)??(D.confirm&&D.password!==D.confirm?"The two passwords do not match.":null):null,jt=ce??(U?Rt:null);return a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Hr,{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(xn,{className:"space-y-5",children:[Ke,Z&&a.jsx(ve,{tone:"danger",title:"Could not save access settings",children:Z}),a.jsxs(Ja,{children:[a.jsxs(pa,{label:"Listen on",value:D.bind,onChange:Ze=>{const It=Ze.target.value;E({...D,bind:It,auth:It==="0.0.0.0"?"password":D.auth})},hint:D.auth==="none"?"Locked to this machine while there is no password.":"Changing this needs a dashboard restart.",children:[_h.map(Ze=>a.jsx("option",{value:Ze.value,disabled:Ze.value==="0.0.0.0"&&D.auth==="none",children:Ze.label},Ze.value)),!_h.some(Ze=>Ze.value===D.bind)&&a.jsx("option",{value:D.bind,children:V4(D.bind)})]}),a.jsxs(pa,{label:"Authentication",value:D.auth,onChange:Ze=>{const It=Ze.target.value;E({...D,auth:It,bind:It==="none"?"127.0.0.1":D.bind}),K(null)},hint:D.auth==="none"?"No login — reachable from this machine only.":!y.data.hasPassword&&!D.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:!ut,children:"No password (this machine only)"})]})]}),D.auth==="none"&&a.jsx(ve,{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(Me,{label:"New password",type:"password",autoComplete:"new-password",value:D.password,onChange:Ze=>{E({...D,password:Ze.target.value}),K(null)},error:jt,hint:`Leave blank to keep the current password. At least ${c} characters.`}),a.jsx(Me,{label:"Confirm new password",type:"password",autoComplete:"new-password",value:D.confirm,onChange:Ze=>{E({...D,confirm:Ze.target.value}),K(null)}})]})]}),a.jsxs(zc,{children:[a.jsx("span",{className:"text-2xs text-faint",children:xe?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ae,{variant:"ghost",size:"sm",disabled:!xe,onClick:()=>{E(hh(y.data)),Y(!1),te(null),K(null)},children:"Revert"}),a.jsx(ae,{variant:"primary",size:"sm",loading:W,disabled:!xe,icon:a.jsx(yh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void ie(),children:"Save access"})]})]})]}),y.data.platform!=="win32"&&a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",b.data?.configured?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Rn,{className:"size-4","aria-hidden":"true"}),title:"Linux permissions",description:"Passwordless sudo for nginx and systemctl.",actions:b.data?a.jsx(je,{tone:b.data.configured?"ok":"warn",dot:!0,children:b.data.configured?"Configured":"Required"}):void 0}),a.jsx(xn,{children:b.error&&!b.data?a.jsx(qt,{error:b.error,title:"Could not read the permission state",onRetry:b.reload,className:"border-0"}):b.data?b.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-2xl space-y-4",children:[a.jsx("p",{className:"text-sm text-muted",children:"The dashboard needs passwordless sudo to control nginx and systemctl. Generate the exact commands below, then run them once in a terminal on this server — sudo asks for your password there, never in this browser."}),Pe&&a.jsx(ve,{tone:"danger",title:"Setup commands were not prepared",children:Pe}),De&&De.commands.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("p",{className:"text-xs font-medium text-ink",children:"Run these in a terminal"}),a.jsx(Ut,{value:De.commands.join(`
531
531
  `),label:"Copy commands",withText:!0})]}),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:De.commands.join(`
532
- `)})]}),De&&De.refusedDirs.length>0&&a.jsx(ve,{tone:"warning",title:"These folders need root by hand",children:a.jsx("ul",{className:"mt-1.5 space-y-1",children:De.refusedDirs.map(({dir:Ze,reason:It})=>a.jsxs("li",{children:[a.jsx("code",{className:"font-mono text-2xs",children:Ze})," — ",It]},Ze))})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(se,{variant:"primary",loading:Xe,onClick:()=>void nt(),children:"Generate setup commands"}),a.jsx(se,{variant:"secondary",icon:a.jsx(Ct,{className:"size-4","aria-hidden":"true"}),loading:b.loading,onClick:rt,children:"Check again"})]})]}):a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(_s,{}),"Checking sudoers…"]})})]})]})},Hs=()=>a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(gh,{className:"size-4","aria-hidden":"true"}),title:"Backup and restore",description:"Export or restore settings and domains as JSON."}),a.jsxs(xn,{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(se,{variant:"secondary",loading:bt,icon:a.jsx(gh,{className:"size-4","aria-hidden":"true"}),onClick:()=>void Ue(),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:xt,type:"file",accept:".json,application/json",className:"sr-only",onChange:Te=>void Dt(Te)}),a.jsx(se,{variant:"secondary",loading:jn,disabled:bt,icon:a.jsx(Kk,{className:"size-4","aria-hidden":"true"}),onClick:()=>xt.current?.click(),children:"Choose backup file…"})]})]}),F&&a.jsx(ve,{tone:F.tone,title:F.title,children:F.body})]}),a.jsx(Ec,{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(La,{title:"Settings",description:"Configuration, access, Hub pairing and backups for this dashboard.",actions:h!=="hub"&&h!=="update"?a.jsx(se,{variant:"secondary",size:"sm",loading:v.loading||b.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:aa,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:Pv.map(Te=>a.jsx("button",{type:"button",role:"tab",id:`settings-tab-${Te.id}`,"aria-selected":h===Te.id,"aria-controls":`settings-panel-${Te.id}`,onClick:()=>g(Te.id),className:oe("rounded-sm border px-3 py-1.5 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",h===Te.id?"border-line bg-surface text-ink shadow-sm":"border-transparent text-muted hover:text-ink"),children:Te.label},Te.id))}),a.jsxs("div",{role:"tabpanel",id:`settings-panel-${h}`,"aria-labelledby":`settings-tab-${h}`,tabIndex:-1,className:"outline-none",children:[h==="general"&&vl(),h==="access"&&bl(),h==="hub"&&a.jsx(D4,{}),h==="backup"&&Hs(),h==="update"&&a.jsx(L4,{})]})]})}function $4(){return ba("Page not found"),a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Page not found",description:"That address does not match a dashboard section."}),a.jsxs(et,{className:"relative overflow-hidden",children:[a.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-linear-to-r from-transparent via-accent/60 to-transparent","aria-hidden":"true"}),a.jsx("div",{className:"pointer-events-none absolute -top-28 left-1/2 size-72 -translate-x-1/2 rounded-full bg-accent-soft blur-3xl","aria-hidden":"true"}),a.jsxs("div",{className:"relative flex flex-col items-center px-6 py-14 text-center",children:[a.jsx("span",{className:"font-mono text-2xs font-semibold uppercase tracking-[0.22em] text-faint",children:"HTTP 404 · route not found"}),a.jsx("span",{className:"mt-3 bg-linear-to-b from-ink to-ink/25 bg-clip-text font-mono text-6xl font-bold tracking-tighter text-transparent",children:"404"}),a.jsx("span",{className:"mt-5 flex size-11 items-center justify-center rounded-full border border-line-strong bg-raised text-muted",children:a.jsx(fS,{className:"size-5","aria-hidden":"true"})}),a.jsx("h2",{className:"mt-4 text-lg font-semibold tracking-tight text-ink",children:"This section isn't in the dashboard"}),a.jsx("p",{className:"mt-1.5 max-w-md text-sm leading-6 text-muted",children:"The link may be old, or the page moved. Everything else is one click away — nginx, domains and certificates are untouched."}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-2",children:[a.jsxs(kt,{to:"/",className:ma("primary","sm"),children:[a.jsx(_w,{className:"size-3.5","aria-hidden":"true"}),"Back to Overview"]}),a.jsxs(kt,{to:"/domains",className:ma("secondary","sm"),children:[a.jsx(Os,{className:"size-3.5","aria-hidden":"true"}),"Domains"]}),a.jsxs(kt,{to:"/ssl",className:ma("secondary","sm"),children:[a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),"Certificates"]})]})]})]})]})}function q4(){const{phase:n}=ja();return n==="loading"?a.jsx(X5,{}):n==="error"?a.jsx(W5,{}):n==="unauthenticated"?a.jsx(oC,{}):a.jsx(X2,{children:a.jsxs(Jn,{element:a.jsx(J5,{}),children:[a.jsx(Jn,{index:!0,element:a.jsx(xC,{})}),a.jsx(Jn,{path:"domains",element:a.jsx(HC,{})}),a.jsx(Jn,{path:"ssl",element:a.jsx(aT,{})}),a.jsx(Jn,{path:"nginx",element:a.jsx(iT,{})}),a.jsx(Jn,{path:"notifications",element:a.jsx(xT,{})}),a.jsx(Jn,{path:"deployments",element:a.jsx(T4,{})}),a.jsx(Jn,{path:"processes",element:a.jsx(wT,{})}),a.jsx(Jn,{path:"logs",element:a.jsx(R4,{})}),a.jsx(Jn,{path:"settings",element:a.jsx(B4,{})}),a.jsx(Jn,{path:"*",element:a.jsx($4,{})})]})})}function G4(){return a.jsx(Cw,{children:a.jsx(n5,{children:a.jsx(u5,{children:a.jsx(w5,{children:a.jsx(S5,{children:a.jsx(k5,{children:a.jsx(xw,{children:a.jsx(q4,{})})})})})})})})}const Z0=document.getElementById("root");if(!Z0)throw new Error("Missing #root element");YN.createRoot(Z0).render(a.jsx(p.StrictMode,{children:a.jsx(G4,{})}));
532
+ `)})]}),De&&De.refusedDirs.length>0&&a.jsx(ve,{tone:"warning",title:"These folders need root by hand",children:a.jsx("ul",{className:"mt-1.5 space-y-1",children:De.refusedDirs.map(({dir:Ze,reason:It})=>a.jsxs("li",{children:[a.jsx("code",{className:"font-mono text-2xs",children:Ze})," — ",It]},Ze))})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ae,{variant:"primary",loading:Xe,onClick:()=>void nt(),children:"Generate setup commands"}),a.jsx(ae,{variant:"secondary",icon:a.jsx(Ct,{className:"size-4","aria-hidden":"true"}),loading:b.loading,onClick:rt,children:"Check again"})]})]}):a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(_s,{}),"Checking sudoers…"]})})]})]})},Hs=()=>a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(vh,{className:"size-4","aria-hidden":"true"}),title:"Backup and restore",description:"Export or restore settings and domains as JSON."}),a.jsxs(xn,{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(ae,{variant:"secondary",loading:bt,icon:a.jsx(vh,{className:"size-4","aria-hidden":"true"}),onClick:()=>void He(),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:xt,type:"file",accept:".json,application/json",className:"sr-only",onChange:Te=>void Dt(Te)}),a.jsx(ae,{variant:"secondary",loading:jn,disabled:bt,icon:a.jsx(Fk,{className:"size-4","aria-hidden":"true"}),onClick:()=>xt.current?.click(),children:"Choose backup file…"})]})]}),J&&a.jsx(ve,{tone:J.tone,title:J.title,children:J.body})]}),a.jsx(zc,{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(La,{title:"Settings",description:"Configuration, access, Hub pairing and backups for this dashboard.",actions:h!=="hub"&&h!=="update"?a.jsx(ae,{variant:"secondary",size:"sm",loading:y.loading||b.loading,icon:a.jsx(Ct,{className:"size-3.5","aria-hidden":"true"}),onClick:aa,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:Jy.map(Te=>a.jsx("button",{type:"button",role:"tab",id:`settings-tab-${Te.id}`,"aria-selected":h===Te.id,"aria-controls":`settings-panel-${Te.id}`,onClick:()=>g(Te.id),className:oe("rounded-sm border px-3 py-1.5 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",h===Te.id?"border-line bg-surface text-ink shadow-sm":"border-transparent text-muted hover:text-ink"),children:Te.label},Te.id))}),a.jsxs("div",{role:"tabpanel",id:`settings-panel-${h}`,"aria-labelledby":`settings-tab-${h}`,tabIndex:-1,className:"outline-none",children:[h==="general"&&yl(),h==="access"&&bl(),h==="hub"&&a.jsx(U4,{}),h==="backup"&&Hs(),h==="update"&&a.jsx(Y4,{})]})]})}function Z4(){return ba("Page not found"),a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Page not found",description:"That address does not match a dashboard section."}),a.jsxs(et,{className:"relative overflow-hidden",children:[a.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-linear-to-r from-transparent via-accent/60 to-transparent","aria-hidden":"true"}),a.jsx("div",{className:"pointer-events-none absolute -top-28 left-1/2 size-72 -translate-x-1/2 rounded-full bg-accent-soft blur-3xl","aria-hidden":"true"}),a.jsxs("div",{className:"relative flex flex-col items-center px-6 py-14 text-center",children:[a.jsx("span",{className:"font-mono text-2xs font-semibold uppercase tracking-[0.22em] text-faint",children:"HTTP 404 · route not found"}),a.jsx("span",{className:"mt-3 bg-linear-to-b from-ink to-ink/25 bg-clip-text font-mono text-6xl font-bold tracking-tighter text-transparent",children:"404"}),a.jsx("span",{className:"mt-5 flex size-11 items-center justify-center rounded-full border border-line-strong bg-raised text-muted",children:a.jsx(yS,{className:"size-5","aria-hidden":"true"})}),a.jsx("h2",{className:"mt-4 text-lg font-semibold tracking-tight text-ink",children:"This section isn't in the dashboard"}),a.jsx("p",{className:"mt-1.5 max-w-md text-sm leading-6 text-muted",children:"The link may be old, or the page moved. Everything else is one click away — nginx, domains and certificates are untouched."}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-2",children:[a.jsxs(kt,{to:"/",className:ma("primary","sm"),children:[a.jsx(Gw,{className:"size-3.5","aria-hidden":"true"}),"Back to Overview"]}),a.jsxs(kt,{to:"/domains",className:ma("secondary","sm"),children:[a.jsx(Os,{className:"size-3.5","aria-hidden":"true"}),"Domains"]}),a.jsxs(kt,{to:"/ssl",className:ma("secondary","sm"),children:[a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),"Certificates"]})]})]})]})]})}function Q4(){const{phase:n}=ja();return n==="loading"?a.jsx(P5,{}):n==="error"?a.jsx(sC,{}):n==="unauthenticated"?a.jsx(hC,{}):a.jsx(J2,{children:a.jsxs(Jn,{element:a.jsx(aC,{}),children:[a.jsx(Jn,{index:!0,element:a.jsx(jC,{})}),a.jsx(Jn,{path:"domains",element:a.jsx(YC,{})}),a.jsx(Jn,{path:"ssl",element:a.jsx(oT,{})}),a.jsx(Jn,{path:"nginx",element:a.jsx(dT,{})}),a.jsx(Jn,{path:"notifications",element:a.jsx(jT,{})}),a.jsx(Jn,{path:"deployments",element:a.jsx(O4,{})}),a.jsx(Jn,{path:"processes",element:a.jsx(ET,{})}),a.jsx(Jn,{path:"logs",element:a.jsx(_4,{})}),a.jsx(Jn,{path:"settings",element:a.jsx(K4,{})}),a.jsx(Jn,{path:"*",element:a.jsx(Z4,{})})]})})}function I4(){return a.jsx(Ow,{children:a.jsx(r5,{children:a.jsx(p5,{children:a.jsx(E5,{children:a.jsx(R5,{children:a.jsx(z5,{children:a.jsx(ww,{children:a.jsx(Q4,{})})})})})})})})}const ej=document.getElementById("root");if(!ej)throw new Error("Missing #root element");PN.createRoot(ej).render(a.jsx(p.StrictMode,{children:a.jsx(I4,{})}));