moadim 3.10.0

Loop engine for AI agents — routines over REST, MCP, and a built-in web UI
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>MOADIM</title>
    <script>
      (function () {
        if (localStorage.getItem("moadim.client.theme") === "light") {
          document.documentElement.classList.add("theme-light");
        }
      })();
    </script>
    <script type="module" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=j(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(ne(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ae=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&&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)};function oe(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ae)}catch(e){ae(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function se(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else oe(se.bind(null,e))}var ce={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ce,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=se,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=oe,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){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 v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(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 E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),ee=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),ne=Symbol.for(`react.profiler`),j=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),ie=Symbol.for(`react.forward_ref`),ae=Symbol.for(`react.suspense`),oe=Symbol.for(`react.suspense_list`),se=Symbol.for(`react.memo`),ce=Symbol.for(`react.lazy`),le=Symbol.for(`react.activity`),ue=Symbol.for(`react.legacy_hidden`),de=Symbol.for(`react.memo_cache_sentinel`),fe=Symbol.for(`react.view_transition`),pe=Symbol.for(`react.recoverable`),me=Symbol.iterator;function he(e){return typeof e!=`object`||!e?null:(e=me&&e[me]||e[`@@iterator`],typeof e==`function`?e:null)}var ge=Symbol.for(`react.client.reference`);function _e(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ee:return`Fragment`;case ne:return`Profiler`;case te:return`StrictMode`;case ae:return`Suspense`;case oe:return`SuspenseList`;case le:return`Activity`;case fe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case re:return e.displayName||`Context`;case j:return(e._context.displayName||`Context`)+`.Consumer`;case ie:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case se:return t=e.displayName||null,t===null?_e(e.type)||`Memo`:t;case ce:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var ve=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},be=[],xe=-1;function Se(e){return{current:e}}function Ce(e){0>xe||(e.current=be[xe],be[xe]=null,xe--)}function we(e,t){xe++,be[xe]=e.current,e.current=t}var Te=Se(null),Ee=Se(null),De=Se(null),Oe=Se(null);function ke(e,t){switch(we(De,t),we(Ee,e),we(Te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ce(Te),we(Te,e)}function Ae(){Ce(Te),Ce(Ee),Ce(De)}function je(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,we(Oe,e)),t=Te.current;var n=dp(t,e.type);t!==n&&(we(Ee,e),we(Te,n))}function Me(e){Ee.current===e&&(Ce(Te),Ce(Ee)),Oe.current===e&&(Ce(Oe),sh._currentValue=ye)}var Ne,P;function Pe(e){if(Ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||``,P=-1<e.stack.indexOf(`
    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+Ne+e+P}var Fe=!1;function Ie(e,t){if(!e||Fe)return``;Fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Pe(n):``}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe(`Lazy`);case 13:return e.child!==t&&t!==null?Pe(`Suspense Fallback`):Pe(`Suspense`);case 19:return Pe(`SuspenseList`);case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return Pe(`Activity`);case 30:return Pe(`ViewTransition`);default:return``}}function Re(e){try{var t=``,n=null;do t+=Le(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var ze=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,He=t.unstable_shouldYield,Ue=t.unstable_requestPaint,We=t.unstable_now,Ge=t.unstable_getCurrentPriorityLevel,Ke=t.unstable_ImmediatePriority,qe=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,Ye=t.unstable_LowPriority,Xe=t.unstable_IdlePriority,Ze=t.log,Qe=t.unstable_setDisableYieldValue,F=null,I=null;function $e(e){if(typeof Ze==`function`&&Qe(e),I&&typeof I.setStrictMode==`function`)try{I.setStrictMode(F,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(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 ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(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 ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function L(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-et(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(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 yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function xt(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[Ct])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=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]*$`),Wt={},Gt={};function Kt(e){return ze.call(Gt,e)?!0:ze.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var R=!1;function qt(){var e=R;return R=!1,e}function Jt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Xt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Zt(s):e.removeAttribute(`name`)}function on(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Zt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ln(e,t,n){t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ve(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,R=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),R=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(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 gn=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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));an(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Rd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Nn=i.slice(e,1<r?1-r:void 0)}function Fn(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 In(){return!0}function Ln(){return!1}function Rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?In:Ln,this.isPropagationStopped=Ln,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var z={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zn=Rn(z),Bn=D({},z,{view:0,detail:0}),Vn=Rn(Bn),Hn,Un,Wn,Gn=D({},Bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,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!==Wn&&(Wn&&e.type===`mousemove`?(Hn=e.screenX-Wn.screenX,Un=e.screenY-Wn.screenY):Un=Hn=0,Wn=e),Hn)},movementY:function(e){return`movementY`in e?e.movementY:Un}}),Kn=Rn(Gn),qn=Rn(D({},Gn,{dataTransfer:0})),Jn=Rn(D({},Bn,{relatedTarget:0})),Yn=Rn(D({},z,{animationName:0,elapsedTime:0,pseudoElement:0})),Xn=Rn(D({},z,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Zn=Rn(D({},z,{data:0})),Qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},$n={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`},er={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function tr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=er[e])?!!t[e]:!1}function nr(){return tr}var rr=Rn(D({},Bn,{key:function(e){if(e.key){var t=Qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?$n[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ir=Rn(D({},Gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ar=Rn(D({},z,{submitter:0})),or=Rn(D({},Bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr})),sr=Rn(D({},z,{propertyName:0,elapsedTime:0,pseudoElement:0})),cr=Rn(D({},Gn,{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})),lr=Rn(D({},z,{newState:0,oldState:0,source:0})),ur=[9,13,27,32],dr=On&&`CompositionEvent`in window,fr=null;On&&`documentMode`in document&&(fr=document.documentMode);var pr=On&&`TextEvent`in window&&!fr,mr=On&&(!dr||fr&&8<fr&&11>=fr),hr=` `,gr=!1;function _r(e,t){switch(e){case`keyup`:return ur.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function vr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var yr=!1;function br(e,t){switch(e){case`compositionend`:return vr(t);case`keypress`:return t.which===32?(gr=!0,hr):null;case`textInput`:return e=t.data,e===hr&&gr?null:e;default:return null}}function xr(e,t){if(yr)return e===`compositionend`||!dr&&_r(e,t)?(e=Pn(),Nn=Mn=jn=null,yr=!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 mr&&t.locale!==`ko`?null:t.data;default:return null}}var Sr={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 Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Sr[e.type]:t===`textarea`}function wr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=qf(t,`onChange`),0<t.length&&(n=new zn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Tr=null,Er=null;function Dr(e){Bf(e,0)}function Or(e){if(tn(Ft(e)))return e}function kr(e,t){if(e===`change`)return t}var Ar=!1;if(On){var jr;if(On){var Mr=`oninput`in document;if(!Mr){var B=document.createElement(`div`);B.setAttribute(`oninput`,`return;`),Mr=typeof B.oninput==`function`}jr=Mr}else jr=!1;Ar=jr&&(!document.documentMode||9<document.documentMode)}function Nr(){Tr&&(Tr.detachEvent(`onpropertychange`,Pr),Er=Tr=null)}function Pr(e){if(e.propertyName===`value`&&Or(Er)){var t=[];wr(t,Er,e,xn(e)),En(Dr,t)}}function Fr(e,t,n){e===`focusin`?(Nr(),Tr=t,Er=n,Tr.attachEvent(`onpropertychange`,Pr)):e===`focusout`&&Nr()}function Ir(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Or(Er)}function Lr(e,t){if(e===`click`)return Or(t)}function Rr(e,t){if(e===`input`||e===`change`)return Or(t)}function zr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Br=typeof Object.is==`function`?Object.is:zr;function Vr(e,t){if(Br(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ze.call(t,i)||!Br(e[i],t[i]))return!1}return!0}function Hr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wr(e,t){var n=Ur(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ur(n)}}function Gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hr(e.document)}return t}function qr(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 Jr=On&&`documentMode`in document&&11>=document.documentMode,Yr=null,Xr=null,Zr=null,Qr=!1;function $r(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qr||Yr==null||Yr!==Hr(r)||(r=Yr,`selectionStart`in r&&qr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zr&&Vr(Zr,r)||(Zr=r,r=qf(Xr,`onSelect`),0<r.length&&(t=new zn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Yr)))}function ei(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ti={animationend:ei(`Animation`,`AnimationEnd`),animationiteration:ei(`Animation`,`AnimationIteration`),animationstart:ei(`Animation`,`AnimationStart`),transitionrun:ei(`Transition`,`TransitionRun`),transitionstart:ei(`Transition`,`TransitionStart`),transitioncancel:ei(`Transition`,`TransitionCancel`),transitionend:ei(`Transition`,`TransitionEnd`)},ni={},ri={};On&&(ri=document.createElement(`div`).style,`AnimationEvent`in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),`TransitionEvent`in window||delete ti.transitionend.transition);function ii(e){if(ni[e])return ni[e];if(!ti[e])return e;var t=ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ri)return ni[e]=t[n];return e}var ai=ii(`animationend`),oi=ii(`animationiteration`),si=ii(`animationstart`),ci=ii(`transitionrun`),li=ii(`transitionstart`),ui=ii(`transitioncancel`),di=ii(`transitionend`),fi=new Map,pi=`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(` `);pi.push(`scrollEnd`);function mi(e,t){fi.set(e,t),Vt(t,[e])}var hi=0;function gi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=hi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function _i(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function vi(e,t){return e=_i(e),t=_i(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var yi=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&&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)},bi=[],xi=0,Si=0;function Ci(){for(var e=xi,t=Si=xi=0;t<e;){var n=bi[t];bi[t++]=null;var r=bi[t];bi[t++]=null;var i=bi[t];bi[t++]=null;var a=bi[t];if(bi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ei(n,i,a)}}function wi(e,t,n,r){bi[xi++]=e,bi[xi++]=t,bi[xi++]=n,bi[xi++]=r,Si|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function V(e,t,n,r){return wi(e,t,n,r),Di(e)}function Ti(e,t){return wi(e,null,null,t),Di(e)}function Ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Di(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Oi={};function ki(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(e,t,n,r){return new ki(e,t,n,r)}function ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mi(e,t){var n=e.alternate;return n===null?(n=Ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ni(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Pi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ji(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,Te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case le:return e=Ai(31,n,t,a),e.elementType=le,e.lanes=o,e;case ee:return Fi(n.children,a,o,t);case te:s=8,a|=24;break;case ne:return e=Ai(12,n,t,a|2),e.elementType=ne,e.lanes=o,e;case ae:return e=Ai(13,n,t,a),e.elementType=ae,e.lanes=o,e;case oe:return e=Ai(19,n,t,a),e.elementType=oe,e.lanes=o,e;case ue:case fe:return e=a|32,e=Ai(30,n,t,e),e.elementType=fe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case re:s=10;break a;case j:s=9;break a;case ie:s=11;break a;case se:s=14;break a;case ce:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Fi(e,t,n,r){return e=Ai(7,e,r,t),e.lanes=n,e}function Ii(e,t,n){return e=Ai(6,e,null,t),e.lanes=n,e}function Li(e){var t=Ai(18,null,null,0);return t.stateNode=e,t}function Ri(e,t,n){return t=Ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var zi=new WeakMap;function Bi(e,t){if(typeof e==`object`&&e){var n=zi.get(e);return n===void 0?(t={value:e,source:t,stack:Re(t)},zi.set(e,t),t):n}return{value:e,source:t,stack:Re(t)}}var Vi=[],Hi=0,Ui=null,Wi=0,Gi=[],Ki=0,qi=null,Ji=1,Yi=``;function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Ui,Ui=e,Wi=t}function Zi(e,t,n){Gi[Ki++]=Ji,Gi[Ki++]=Yi,Gi[Ki++]=qi,qi=e;var r=Ji;e=Yi;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ji=1<<32-et(t)+i|n<<i|r,Yi=a+e}else Ji=1<<a|n<<i|r,Yi=e}function Qi(e){e.return!==null&&(Xi(e,1),Zi(e,1,0))}function $i(e){for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null;for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Yi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null}function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=Yi,Gi[Ki++]=qi,Ji=t.id,Yi=t.overflow,qi=e}var ta=null,na=null,H=!1,ra=null,ia=!1,aa=Error(i(519));function oa(e){throw fa(Bi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),aa}function sa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),un(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||oa(e,!0)}function ca(e){for(ta=e.return;ta;)switch(ta.tag){case 5:case 31:case 13:ia=!1;return;case 27:case 3:ia=!0;return;default:ta=ta.return}}function la(e){if(e!==ta)return!1;if(!H)return ca(e),H=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&na&&oa(e),ca(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=dm(e)}else t===27?(t=na,Sp(e.type)?(e=um,um=null,na=e):na=t):na=ta?lm(e.stateNode.nextSibling):null;return!0}function ua(){na=ta=null,H=!1}function da(){var e=ra;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),ra=null),e}function fa(e){ra===null?ra=[e]:ra.push(e)}var pa=Se(null),ma=null,ha=null;function ga(e,t,n){we(pa,t._currentValue),t._currentValue=n}function _a(e){e._currentValue=pa.current,Ce(pa)}function va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ya(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),va(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),va(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),va(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ba(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Oe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&ya(t,e,n,r),t.flags|=262144,e!==null}function xa(e){for(e=e.firstContext;e!==null;){if(!Br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Sa(e){ma=e,ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ca(e){return Ta(ma,e)}function wa(e,t){return ma===null&&Sa(e),Ta(e,t)}function Ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ha===null){if(e===null)throw Error(i(308));ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ha=ha.next=t;return n}var Ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Da=t.unstable_scheduleCallback,Oa=t.unstable_NormalPriority,ka={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Aa(){return{controller:new Ea,data:new Map,refCount:0}}function ja(e){e.refCount--,e.refCount===0&&Da(Oa,function(){e.controller.abort()})}function Ma(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Na=null;function Pa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Fa=null,Ia=0,La=0,Ra=null;function za(e,t){if(Fa===null){var n=Fa=[];Ia=0,La=Nf(),Ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ia++,t.then(Ba,Ba),t}function Ba(){if(--Ia===0&&(Na=null,Fa!==null)){Ra!==null&&(Ra.status=`fulfilled`);var e=Fa;Fa=null,La=0,Ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Va(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ha=M.S;M.S=function(e,t){if(md=We(),typeof t==`object`&&t&&typeof t.then==`function`&&za(e,t),Na!==null)for(var n=yf;n!==null;)Ma(n,Na),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Ma(r,n),r=r.next;if(La!==0){r=Na,r===null&&(r=Na=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ha!==null&&Ha(e,t)};var Ua=Se(null);function Wa(){var e=Ua.current;return e===null?Qu.pooledCache:e}function Ga(e,t){t===null?we(Ua,Ua.current):we(Ua,t.pool)}function Ka(){var e=Wa();return e===null?null:{parent:ka._currentValue,pool:e}}var qa=Error(i(460)),Ja=Error(i(474)),Ya=Error(i(542)),Xa={then:function(){}};function Za(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,no(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=Qu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,no(e),e}throw eo=t,qa}}function $a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(eo=e,qa):e}}var eo=null;function to(){if(eo===null)throw Error(i(459));var e=eo;return eo=null,e}function no(e){if(e===qa||e===Ya)throw Error(i(483))}var ro=null,io=0;function ao(e){var t=io;return io+=1,ro===null&&(ro=[]),Qa(ro,e,t)}function oo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function so(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function co(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Mi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===ee?(e=d(e,t,n.props.children,r,n.key),oo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ce&&$a(i)===t.type)?(t=a(t,n.props),oo(t,n),t.return=e,t):(t=Pi(n.type,n.key,n.props,null,e.mode,r),oo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ri(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ii(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Pi(t.type,t.key,t.props,null,e.mode,n),oo(n,t),n.return=e,n;case A:return t=Ri(t,e.mode,n),t.return=e,t;case ce:return t=$a(t),f(e,t,n)}if(ve(t)||he(t))return t=Fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ao(t),n);if(t.$$typeof===re)return f(e,wa(e,t),n);so(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ce:return n=$a(n),p(e,t,n,r)}if(ve(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ao(n),r);if(n.$$typeof===re)return p(e,t,wa(e,n),r);so(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ce:return r=$a(r),m(e,t,n,r,i)}if(ve(r)||he(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ao(r),i);if(r.$$typeof===re)return m(e,t,n,wa(t,r),i);so(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),H&&Xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return H&&Xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),H&&Xi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),H&&Xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return H&&Xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),H&&Xi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ee&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ee){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),oo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ce&&$a(l)===r.type){n(e,r.sibling),c=a(r,o.props),oo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ee?(c=Fi(o.props.children,e.mode,c,o.key),oo(c,o),c.return=e,e=c):(c=Pi(o.type,o.key,o.props,null,e.mode,c),oo(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ri(o,e.mode,c),c.return=e,e=c}return s(e);case ce:return o=$a(o),_(e,r,o,c)}if(ve(o))return h(e,r,o,c);if(he(o)){if(l=he(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ao(o),c);if(o.$$typeof===re)return _(e,r,wa(e,o),c);so(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ii(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{io=0;var i=_(e,t,n,r);return ro=null,i}catch(t){if(t===qa||t===Ya)throw t;var a=Ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var lo=co(!0),uo=co(!1),fo=!1;function po(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mo(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 ho(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function go(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Di(e),Ei(e,null,n),t}return wi(e,r,t,n),Di(e)}function _o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}function vo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var yo=!1;function bo(){if(yo){var e=Ra;if(e!==null)throw e}}function xo(e,t,n,r){yo=!1;var i=e.updateQueue;fo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(X&f)===f:(r&f)===f){f!==0&&f===La&&(yo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:fo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),od|=o,e.lanes=o,e.memoizedState=d}}function So(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Co(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)So(n[e],t)}var wo=Se(null),To=Se(0);function Eo(e,t){e=id,we(To,e),we(wo,t),id=e|t.baseLanes}function Do(){we(To,id),we(wo,wo.current)}function Oo(){id=To.current,Ce(wo),Ce(To)}var ko=Se(null),Ao=null;function jo(e){var t=e.alternate;we(Io,Io.current&1),we(ko,e),Ao===null&&(t===null||wo.current!==null||t.memoizedState!==null)&&(Ao=e)}function Mo(e){we(Io,Io.current),we(ko,e),Ao===null&&(Ao=e)}function No(e){e.tag===22?(we(Io,Io.current),we(ko,e),Ao===null&&(Ao=e)):Po()}function Po(){we(Io,Io.current),we(ko,ko.current)}function Fo(e){Ce(ko),Ao===e&&(Ao=null),Ce(Io)}var Io=Se(0);function Lo(e,t){we(ko,ko.current),we(Io,t)}function Ro(e){Ce(Io),Ce(ko),Ao===e&&(Ao=null)}function zo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)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 Bo=0,U=null,Vo=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,qo=0,Jo=null,Yo=0;function Xo(){throw Error(i(321))}function Zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Br(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,i,a){return Bo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?hc:gc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=es(t,n,r,i)),$o(e),a}function $o(e){M.H=mc;var t=Vo!==null&&Vo.next!==null;if(Bo=0,Ho=Vo=U=null,Uo=!1,qo=0,Jo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&xa(e)&&(Nc=!0))}function es(e,t,n,r){U=e;var a=0;do{if(Wo&&(Jo=null),qo=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=_c,o=t(n,r)}while(Wo);return o}function ts(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?cs(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(U.flags|=1024),t}function ns(){var e=Ko!==0;return Ko=0,e}function rs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function is(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}Bo=0,Ho=Vo=U=null,Wo=!1,qo=Ko=0,Jo=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?U.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function os(){if(Vo===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?U.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?U.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cs(e){var t=qo;return qo+=1,Jo===null&&(Jo=[]),e=Qa(Jo,e,t),t=U,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?hc:gc),e}function ls(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return cs(e);if(e.$$typeof===pe)return;if(e.$$typeof===re)return Ca(e)}throw Error(i(438,String(e)))}function us(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ss(),U.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=de;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(os(),Vo,e)}function ps(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Bo&f)===f:(X&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===La&&(d=!0);else if((Bo&p)===p){u=u.next,p===La&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,U.lanes|=p,od|=p;f=u.action,Go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,U.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Br(o,e.memoizedState)&&(Nc=!0,d&&(n=Ra,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ms(e){var t=os(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Br(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function hs(e,t,n){var r=U,a=os(),o=H;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Br((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Qu===null)throw Error(i(349));o||Bo&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=ss(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _s(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Br(e,n)}catch{return!0}}function bs(e){var t=Ti(e,2);t!==null&&Nd(t,e,2)}function xs(e){var t=as();if(typeof e==`function`){var n=e;if(e=n(),Go){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ps(e,Vo,typeof r==`function`?r:ds)}function Cs(e,t,n,r,a){if(dc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(H){var n=Qu.formState;if(n!==null){a:{var r=U;if(H){if(na){b:{for(var i=na,a=ia;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){na=lm(i.nextSibling),r=i.data===`F!`;break a}}oa(r)}r=!1}r&&(t=n[0])}}return n=as(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,U,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,U,!1,r.queue),r=as(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(os(),Vo,e)}function Ms(e,t,n){if(t=ps(e,t,ks)[0],e=fs(ds)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=cs(t)}catch(e){throw e===qa?Ya:e}else r=t;t=os();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=os(),n=Vo;if(n!==null)return Ms(t,n,e);os(),t=t.memoizedState,n=os();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=ss(),U.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Is(){return os().memoizedState}function Ls(e,t,n,r){var i=as();U.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=os();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Zo(r,Vo.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(U.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=ss(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=os().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(J&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zo(t,r[1]))return r[0];if(r=e(),Go){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||Bo&1073741824&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),U.lanes|=e,od|=e,n)}function Zs(e,t,n,r){return Br(n,t)?n:wo.current===null?!(Bo&106)||Bo&1073741824&&!(X&261930)?(Nc=!0,e.memoizedState=n):(e=jd(),U.lanes|=e,od|=e,t):(e=Xs(e,n,r),Br(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,uc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Va(c,r),Ad(e)):lc(e,t,r,Ad(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,ye,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Ad())}function rc(){return Ca(sh)}function ic(){return os().memoizedState}function ac(){return os().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=ho(n);var r=go(t,e,n);r!==null&&(Nd(r,t,n),_o(r,t,n)),t={cache:Aa()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=V(e,t,n,r),n!==null&&(Nd(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Ad())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Br(s,o))return wi(e,t,i,0),Qu===null&&Ci(),!1}catch{}if(n=V(e,t,i,r),n!==null)return Nd(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=V(e,n,r,2),t!==null&&Nd(t,e,2)}function dc(e){var t=e.alternate;return e===U||t!==null&&t===U}function fc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var mc={readContext:Ca,use:ls,useCallback:Xo,useContext:Xo,useEffect:Xo,useImperativeHandle:Xo,useLayoutEffect:Xo,useInsertionEffect:Xo,useMemo:Xo,useReducer:Xo,useRef:Xo,useState:Xo,useDebugValue:Xo,useDeferredValue:Xo,useTransition:Xo,useSyncExternalStore:Xo,useId:Xo,useHostTransitionStatus:Xo,useFormState:Xo,useActionState:Xo,useOptimistic:Xo,useMemoCache:Xo,useCacheRefresh:Xo,useEffectEvent:Xo},hc={readContext:Ca,use:ls,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:Ca,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=as();t=t===void 0?null:t;var r=e();if(Go){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=as();if(n!==void 0){var i=n(t);if(Go){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=sc.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(as(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,U,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=as();if(H){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Qu===null)throw Error(i(349));X&127||gs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,o,n,t),null),n},useId:function(){var e=as(),t=Qu.identifierPrefix;if(H){var n=Yi,r=Ji;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return as().memoizedState=oc.bind(null,U)},useEffectEvent:function(e){var t=as(),n={impl:e};return t.memoizedState=n,function(){if(J&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Ca,use:ls,useCallback:Js,useContext:Ca,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:fs,useRef:Is,useState:function(){return fs(ds)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(os(),Vo.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(os(),Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Ca,use:ls,useCallback:Js,useContext:Ca,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ms,useRef:Is,useState:function(){return ms(ds)},useDebugValue:qs,useDeferredValue:function(e,t){var n=os();return Vo===null?Xs(n,e,t):Zs(n,Vo.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=os();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function vc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=ho(r);i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(Nd(t,e,r),_o(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=ho(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(Nd(t,e,r),_o(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=ho(n);r.tag=2,t!=null&&(r.callback=t),t=go(e,r,n),t!==null&&(Nd(t,e,n),_o(t,e,n))}};function bc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Vr(n,r)||!Vr(i,a):!0}function xc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yc.enqueueReplaceState(t,t.state,null)}function Sc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Cc(e){yi(e)}function wc(e){console.error(e)}function Tc(e){yi(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){return n=ho(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=ho(e),e.tag=3,e}function Ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ba(t,n,a,!0),n=ko.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ao===null?Wd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,a)),!1;case 22:return n.flags|=65536,r===Xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),pf(e,r,a)),!1}throw Error(i(435,n.tag))}return pf(e,r,a),Wd(),!1}if(H)return t=ko.current,t===null?(r!==aa&&(t=Error(i(423),{cause:r}),fa(Bi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Bi(r,n),a=Oc(e.stateNode,r,a),vo(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==aa&&(e=Error(i(422),{cause:r}),fa(Bi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Bi(o,n),ud===null?ud=[o]:ud.push(o),ad!==4&&(ad=2),t===null)return!0;r=Bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),vo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),vo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?uo(t,null,n,r):lo(t,e.child,n,r)}function Fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Sa(t),r=Qo(e,t,n,o,a,i),s=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(H&&s&&Qi(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ji(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!W(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Vr:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Mi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Vr(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,W(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ga(t,a===null?null:a.cachePool),a===null?Do():Eo(t,a),No(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ga(t,null),Do(),Po()):(Ga(t,a.cachePool),Eo(t,a),Po(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Wa();return a=a===null?null:{parent:ka._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ga(t,null),Do(),No(t),e!==null&&ba(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return lo(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Fo(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(H){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(Mo(t),(e=na)?(e=am(e,ia),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:Ji,overflow:Yi},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Mo(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||ba(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(wo.current===null){if(r=Qu,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ti(e,s),Nd(r,e,s),Mc;Wd()}t=Hc(e,t,n)}else e=o.treeContext,na=lm(s.nextSibling),ta=t,H=!0,ra=null,ia=!1,e!==null&&ea(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Mi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Gc(e,t,n,r,i){return Sa(t),n=Qo(e,t,n,r,void 0,i),r=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(H&&r&&Qi(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return Sa(t),t.updateQueue=null,n=es(t,r,n,i),$o(e),r=ns(),e!==null&&!Nc?(rs(e,t,a),ll(e,t,a)):(H&&r&&Qi(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(Sa(t),t.stateNode===null){var a=Oi,o=n.contextType;typeof o==`object`&&o&&(a=Ca(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},po(t),o=n.contextType,a.context=typeof o==`object`&&o?Ca(o):Oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&yc.enqueueReplaceState(a,a.state,null),xo(t,r,a,i),bo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Oi,typeof u==`object`&&u&&(o=Ca(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&xc(t,a,r,o),fo=!1;var f=t.memoizedState;a.state=f,xo(t,r,a,i),bo(),l=t.memoizedState,s||f!==l||fo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=fo||bc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,mo(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Oi,typeof l==`object`&&l&&(c=Ca(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&xc(t,a,r,c),fo=!1,f=t.memoizedState,a.state=f,xo(t,r,a,i),bo();var p=t.memoizedState;o!==d||f!==p||fo||e!==null&&e.dependencies!==null&&xa(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=fo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&xa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Wc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=lo(t,e.child,null,i),t.child=lo(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return ua(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ka()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Z),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Io.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(H){if(i?jo(t):Po(),(e=na)?(e=am(e,ia),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:Ji,overflow:Yi},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw oa(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Po(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Fi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(jo(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(Po(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Mi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Fi(i,a,n,null),i.flags|=2):i=Mi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ka():(s=ka._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(jo(t),n=e.child,e=n.sibling,n=Mi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Ai(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return lo(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(jo(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(Po(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Fi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,lo(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(Po(),t.child=e.child,t.flags|=128,null);if(jo(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,fa({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||ba(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(wo.current!==null)return tl(e,t,c);if(r=Qu,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ti(e,a),Nd(r,e,a),Mc;return om(o)||Wd(),tl(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,na=lm(o.nextSibling),ta=t,H=!0,ra=null,ia=!1,e!==null&&ea(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),va(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&zo(n)===null&&(t=e),e=e.sibling}return t}function al(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Io.current;if(t.flags&128)return Lo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Lo(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=H?Wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&zo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return ga(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ba(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Mi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function W(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&xa(e)))}function ul(e,t,n){switch(t.tag){case 3:ke(t,t.stateNode.containerInfo),ga(t,ka,e.memoizedState.cache),ua();break;case 27:case 5:je(t);break;case 4:ke(t,t.stateNode.containerInfo);break;case 10:ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return jo(t),t.flags|=128,null;r=ba(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(jo(t),e=ll(e,t,n),e===null?null:e.sibling)}jo(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ba(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lo(t,Io.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:ga(t,ka,e.memoizedState.cache)}return ll(e,t,n)}function dl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!W(e,n)&&!(t.flags&128))return Nc=!1,ul(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,H&&t.flags&1048576&&Zi(t,Wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=$a(t.elementType),t.type=e,typeof e==`function`)ji(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ie){t.tag=11,t=Fc(null,t,e,r,n);break a}if(a===se){t.tag=14,t=Ic(null,t,e,r,n);break a}if(a===re){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=_e(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(ke(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,mo(e,t),xo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ga(t,ka,r),r!==o.cache&&ya(t,[ka],n,!0),bo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Jc(e,t,r,n);break a}if(r!==a){a=Bi(Error(i(424)),t),fa(a),t=Jc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(na=lm(e.firstChild),ta=t,H=!0,ra=null,ia=!0,n=uo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ua(),r===a){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:H||(t.stateNode=fp(t.type,t.pendingProps,De.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&H&&(r=t.stateNode=hm(t.type,t.pendingProps,De.current),ta=t,ia=!0,a=na,Sp(t.type)?(um=a,na=lm(r.firstChild)):na=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&H&&((a=r=na)&&(r=rm(r,t.type,t.pendingProps,ia),r===null?a=!1:(t.stateNode=r,ta=t,na=lm(r.firstChild),ia=!1,a=!0)),a||oa(t)),je(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qo(e,t,ts,null,null,n),sh._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&H&&((e=n=na)&&(n=im(n,t.pendingProps,ia),n===null?e=!1:(t.stateNode=n,ta=t,na=null,e=!0)),e||oa(t)),null;case 13:return Qc(e,t,n);case 4:return ke(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lo(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Sa(t),a=Ca(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return Sa(t),r=Ca(ka),e===null?(a=Wa(),a===null&&(a=Qu,o=Aa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},po(t),ga(t,ka,a)):((e.lanes&n)!==0&&(mo(e,t),xo(t,null,null,n),bo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ga(t,ka,r),r!==a.cache&&ya(t,[ka],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ga(t,ka,r))),Pc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:H&&Qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function fl(e){e.flags|=4}function pl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw eo=Xa,Ja}}else e.flags&=-16777217}function ml(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw eo=Xa,Ja}}function hl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,ld|=t)}function gl(e,t){if(!H)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function _l(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vl(e,t,n){var r=t.pendingProps;switch($i(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _l(t),null;case 1:return _l(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),_a(ka),Ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(la(t)?fl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,da())),_l(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(fl(t),o===null?(_l(t),pl(t,a,null,r,n)):(_l(t),ml(t,o))):o?o===e.memoizedState?(_l(t),t.flags&=-16777217):(fl(t),_l(t),ml(t,o)):(e=e.memoizedProps,e!==r&&fl(t),_l(t),pl(t,a,e,r,n)),null;case 27:if(Me(t),n=De.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}e=Te.current,la(t)?sa(t,e):(e=hm(a,r,n),t.stateNode=e,fl(t))}return _l(t),t.subtreeFlags&=-33554433,null;case 5:if(Me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}if(o=Te.current,la(t))sa(t,o);else{var s=lp(De.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Ct]=t,o[wt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&fl(t)}}return _l(t),t.subtreeFlags&=-33554433,pl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=De.current,la(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ta,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||oa(t,!0)}else e=lp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return _l(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=la(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Ct]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),e=!1}else n=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Fo(t),t):(Fo(t),null);if(t.flags&128)throw Error(i(558))}return _l(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=la(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Ct]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),a=!1}else a=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Fo(t),t):(Fo(t),null)}return Fo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),hl(t,t.updateQueue),_l(t),null);case 4:return Ae(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,_l(t),null;case 10:return _a(t.type),_l(t),null;case 19:if(Ro(t),r=t.memoizedState,r===null)return _l(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)gl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=zo(e),o!==null){for(t.flags|=128,gl(r,!1),e=o.updateQueue,t.updateQueue=e,hl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ni(n,e),n=n.sibling;return Lo(t,Io.current&1|2),H&&Xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&We()>hd&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=zo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,hl(t,e),gl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!H)return _l(t),null}else 2*We()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,o=Io.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||H?Lo(t,o):(n=o,we(ko,t),we(Io,n),Ao===null&&(Ao=t)),H&&Xi(t,r.treeForkCount),e}return _l(t),null;case 22:case 23:return Fo(t),Oo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(_l(t),t.subtreeFlags&6&&(t.flags|=8192)):_l(t),n=t.updateQueue,n!==null&&hl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ce(Ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_a(ka),_l(t),null;case 25:return null;case 30:return t.flags|=33554432,_l(t),null}throw Error(i(156,t.tag))}function G(e,t){switch($i(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _a(ka),Ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Me(t),null;case 31:if(t.memoizedState!==null){if(Fo(t),t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ro(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 Ae(),null;case 10:return _a(t.type),null;case 22:case 23:return Fo(t),Oo(),e!==null&&Ce(Ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _a(ka),null;case 25:return null;default:return null}}function K(e,t){switch($i(t),t.tag){case 3:_a(ka),Ae();break;case 26:case 27:case 5:Me(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Fo(t);break;case 13:Fo(t);break;case 19:Ro(t);break;case 10:_a(t.type);break;case 22:case 23:Fo(t),Oo(),e!==null&&Ce(Ua);break;case 24:_a(ka)}}function yl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ff(t,t.return,e)}}function bl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function xl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Co(t,n)}catch(t){ff(e,e.return,t)}}}function Sl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=gi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ff(e,t,n)}}function wl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ff(e,t,n)}else n.current=null}}function Tl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function El(e){for(var t=e.return;t!==null&&(kl(t)&&em(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Dl(e){for(var t=e.return;t!==null&&(kl(t)&&tm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Ol(e){return e.tag===5||e.tag===3||e.tag===27}function kl(e){return e&&e.tag===7&&e.stateNode!==null}function Al(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ff(e,e.return,t)}}function jl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[wt]=t}catch(t){ff(e,e.return,t)}}function Ml(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ml(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&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Tl(e,r),R=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Tl(e,r),R=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[Ct]=e,t[wt]=n}catch(t){ff(e,e.return,t)}}var Ll=!1,Rl=null;function zl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ll=!0)}var Bl=null;function Vl(){var e=Bl;return Bl=null,e}var Hl=0;function Ul(e,t,n,r,i){return Hl=0,Wl(e.child,t,n,r,i)}function Wl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Ll=!0,Tp(o,Hl===0?t:t+`_`+Hl,n),Hl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Wl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Gl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Gl(e.child,t),e=e.sibling}function Kl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Kl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=vi(t.default,t.share),t!==`none`&&(Ul(e,n,t,null,!1)||Gl(e.child,!1))}e=e.sibling}}function ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=gi(r,n),a=vi(r.default,n.paired?r.share:r.enter);a===`none`?Kl(e):Ul(e,i,a,null,!1)?(Kl(e),n.paired||t||Md(e,r.onEnter)):Gl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e,t),e=e.sibling;else Kl(e)}function Jl(e){if(Rl!==null&&Rl.size!==0){var t=Rl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=vi(n.default,n.share);if(a!==`none`&&(Ul(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Gl(e.child,!1)),t.delete(r),t.size===0)break}}}Jl(e)}e=e.sibling}}}function Yl(e){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode),r=Rl===null?void 0:Rl.get(n),i=vi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ul(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Rl.delete(n),Md(e,t.onShare)):Gl(e.child,!1)),Rl!==null&&Jl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Rl!==null&&Jl(e)}function Xl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode);t=vi(t.default,t.update),e.flags&=-5,t!==`none`&&Ul(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Xl(e);e=e.sibling}}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Gl(e.child,!1))}Zl(e)}e=e.sibling}}function Ql(e){if(e.tag===30)e.stateNode.paired=null,Gl(e.child,!1),Zl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Zl(e)}function $l(e){for(e=e.child;e!==null;)e.tag===30?Gl(e.child,!1):e.subtreeFlags&33554432&&$l(e),e=e.sibling}function eu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Hl<a.length){var l=a[Hl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Hl===0?n:n+`_`+Hl,i),s&&e.flags&4||(Bl===null&&(Bl=[]),Bl.push(c,Hl===0?r:r+`_`+Hl,t.memoizedProps)),Hl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:eu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function tu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=gi(n,r),a=vi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Hl=0,i=eu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&tu(e,t);e=e.sibling}}var nu=!1,q=!1,ru=!1,iu=!1,au=typeof WeakSet==`function`?WeakSet:Set,ou=null,su=!1,cu=!1,lu=!1,uu=!1;function du(e,t,n){if(e=e.containerInfo,sp=gh,e=Kr(e),qr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,ou=t,t=n?9270:1024;ou!==null;){if(e=ou,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Yl(r[a]);if(e.alternate===null&&e.flags&2)n&&zl(e),fu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Yl(r),fu(n);continue}if(r!==null&&r.memoizedState!==null){n&&zl(e),fu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ou=r):(n&&Xl(e),fu(n))}}Rl=null}function fu(e){for(;ou!==null;){var t=ou,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=gi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=vi(a.default,a.update),a!==`none`&&Ul(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ou=r;break}ou=t.return}}function pu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Nu(e,n),r&4&&yl(5,n);break;case 1:if(Nu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&xl(n),r&512&&Cl(n,n.return);break;case 3:if(Nu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Co(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Il(n);case 26:case 5:Nu(e,n),t===null&&r&4&&Al(n),r&512&&Cl(n,n.return);break;case 12:Nu(e,n);break;case 31:Nu(e,n),r&4&&Su(e,n);break;case 13:Nu(e,n),r&4&&Cu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||nu,!r){var a=t!==null&&t.memoizedState!==null||q;t=nu,i=q,nu=r,(q=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Fu(e,n,r)):Nu(e,n),nu=t,q=i}break;case 30:Nu(e,n),r&512&&Cl(n,n.return);break;case 7:r&512&&Cl(n,n.return);default:Nu(e,n)}}function mu(e,t){for(e=e.child;e!==null;)hu(e,t),e=e.sibling}function hu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){ff(e,e.return,t)}gu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,R=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&mu(e,t);break;default:mu(e,t)}}function gu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:hu(n,r);break a;case 22:n.memoizedState===null&&gu(n,r);break a;default:gu(n,r)}}e=e.sibling}}function _u(e){var t=e.alternate;t!==null&&(e.alternate=null,_u(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(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 vu=null,yu=!1;function bu(e,t,n){for(n=n.child;n!==null;)xu(e,t,n),n=n.sibling}function xu(e,t,n){if(I&&typeof I.onCommitFiberUnmount==`function`)try{I.onCommitFiberUnmount(F,n)}catch{}switch(n.tag){case 26:q||wl(n,t),bu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!q&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:q||wl(n,t),Dl(n);var r=vu,i=yu;Sp(n.type)&&(vu=n.stateNode,yu=!1),bu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),vu=r,yu=i;break;case 5:q||wl(n,t),Dl(n);case 6:if(n.tag===6&&Dl(n),r=vu,i=yu,vu=null,bu(e,t,n),vu=r,yu=i,vu!==null){if(yu)try{(vu.nodeType===9?vu.body:vu.nodeName===`HTML`?vu.ownerDocument.body:vu).removeChild(n.stateNode),R=!0}catch(e){ff(n,t,e)}else try{vu.removeChild(n.stateNode),R=!0}catch(e){ff(n,t,e)}}break;case 18:vu!==null&&(yu?(e=vu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(vu,n.stateNode));break;case 4:r=vu,i=yu,vu=n.stateNode.containerInfo,yu=!0,bu(e,t,n),vu=r,yu=i;break;case 0:case 11:case 14:case 15:bl(2,n,t),q||bl(4,n,t),bu(e,t,n);break;case 1:q||(wl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Sl(n,t,r)),bu(e,t,n);break;case 21:bu(e,t,n);break;case 22:q=(r=q)||n.memoizedState!==null,bu(e,t,n),q=r;break;case 30:wl(n,t),bu(e,t,n);break;case 7:q||wl(n,t),bu(e,t,n);break;default:bu(e,t,n)}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){ff(t,t.return,e)}}function wu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new au),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new au),t;default:throw Error(i(435,e.tag))}}function Tu(e,t){var n=wu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function Eu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){vu=l.stateNode,yu=!1;break a}break;case 5:vu=l.stateNode,yu=!1;break a;case 3:case 4:vu=l.stateNode.containerInfo,yu=!0;break a}l=l.return}if(vu===null)throw Error(i(160));xu(s,c,o),vu=null,yu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ou(t,e,n),t=t.sibling}var Du=null;function Ou(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Eu(t,e,n),ku(e),a&4&&(bl(3,e,e.return),yl(3,e),bl(5,e,e.return));break;case 1:Eu(t,e,n),ku(e),a&512&&(q||r===null||wl(r,r.return)),a&64&&nu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Du,Eu(t,e,n),ku(e),a&512&&(q||r===null||wl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(nu)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else nu||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&jl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||q||t.parentNode.removeChild(t)):a.count--,n===null?nu||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Eu(t,e,n),ku(e),a&512&&(q||r===null||wl(r,r.return)),r!==null&&a&4&&jl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ru,ru=!1,Eu(t,e,n),ru=o,ku(e),a&512&&(q||r===null||wl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),R=!0}catch(t){ff(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,jl(e,t,r===null?t:r.memoizedProps)),a&1024&&(iu=!0);break;case 6:if(Eu(t,e,n),ku(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,R=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(R=!1,Wm=null,o=Du,Du=bm(t.containerInfo),Eu(t,e,n),Du=o,ku(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}iu&&(iu=!1,Au(e)),R=!1;break;case 4:a=ru,ru=nu,r=qt(),o=Du,Du=bm(e.stateNode.containerInfo),Eu(t,e,n),ku(e),Du=o,R&&cu&&(lu=!0),R=r,ru=a;break;case 12:Eu(t,e,n),ku(e);break;case 31:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 13:Eu(t,e,n),ku(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=We()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=nu,l=q,u=ru;nu=c||o,ru=u||o,q=l||s,Eu(t,e,n),q=l,ru=u,nu=c,ku(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||nu||q||(t=s||q,n=nu,r=q,nu=o||nu,q=t,Pu(e,2),nu=n,q=r),!o&&ru||mu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Tu(e,n))));break;case 19:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 30:a&512&&(q||r===null||wl(r,r.return)),a=qt(),o=cu,s=(n&335544064)===n,c=e.memoizedProps,cu=s&&vi(c.default,c.update)!==`none`,Eu(t,e,n),ku(e),s&&r!==null&&R&&(e.flags|=4),cu=o,R=a;break;case 21:break;case 7:a&512&&(q||r===null||wl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Eu(t,e,n),ku(e)}}function ku(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ml(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(kl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ol(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Fl(e,Nl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Fl(e,Nl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Pl(e,Nl(e),u,s);break;default:throw Error(i(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Au(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Au(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ju(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Mu(t,e),t=t.sibling;else tu(t,!1)}function Mu(e,t){var n=e.alternate;if(n===null)ql(e,!1);else switch(e.tag){case 3:if(uu=su=!1,Vl(),ju(t,e),!su&&!lu){if(e=Bl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),uu=!0}Bl=null;break;case 5:ju(t,e);break;case 4:r=su,su=!1,ju(t,e),su&&(lu=!0),su=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ju(t,e):ql(e,!1));break;case 30:r=su,i=Vl(),su=!1,ju(t,e),su&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=gi(a,o),o=gi(n.memoizedProps,o);var s=vi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Hl=0,t=eu(e,n,t,o,s,a,!0),Hl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Bl=i):i!==null&&(i.push.apply(i,Bl),Bl=i),su=e.flags&32?!0:r;break;default:ju(t,e)}}function Nu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pu(e,t.alternate,t),t=t.sibling}function Pu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:bl(4,n,n.return),Pu(n,r);break;case 1:wl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Sl(n,n.return,i),Pu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:wl(n,n.return),n.tag!==5&&n.tag!==27||Dl(n),Pu(n,r);break;case 6:Dl(n);break;case 26:wl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||q||i.parentNode.removeChild(i),Pu(n,r);break;case 22:n.memoizedState===null&&Pu(n,r);break;case 30:wl(n,n.return),Pu(n,r);break;case 7:wl(n,n.return);default:Pu(n,r)}e=e.sibling}}function Fu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Fu(i,a,n),yl(4,a);break;case 1:if(Fu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)So(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&xl(a),Cl(a,a.return);break;case 27:n&2&&Il(a);case 5:a.tag!==5&&a.tag!==27||El(a),Fu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 6:El(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||nu||Km(bm(c.ownerDocument),a.type,c),Fu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 12:Fu(i,a,n);break;case 31:Fu(i,a,n),s&&o&4&&Su(i,a);break;case 13:Fu(i,a,n),s&&o&4&&Cu(i,a);break;case 22:a.memoizedState===null&&Fu(i,a,n),Cl(a,a.return);break;case 30:Fu(i,a,n),Cl(a,a.return);break;case 7:Cl(a,a.return);default:Fu(i,a,n)}t=t.sibling}}function Iu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ja(n))}function Lu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ja(e))}function Ru(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)zu(e,t,n,r),t=t.sibling;else i&&$l(t)}function zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ru(e,t,n,r),a&2048&&yl(9,t);break;case 1:Ru(e,t,n,r);break;case 3:Ru(e,t,n,r),i&&uu&&(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=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ja(a)));break;case 12:if(a&2048){Ru(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){ff(t,t.return,e)}}else Ru(e,t,n,r);break;case 31:Ru(e,t,n,r);break;case 13:Ru(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Ql(t),o._visibility&2?Ru(e,t,n,r):(o._visibility|=2,Bu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Ql(s),o._visibility&2?Ru(e,t,n,r):Vu(e,t)),a&2048&&Iu(s,t);break;case 24:Ru(e,t,n,r),a&2048&&Lu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Gl(a.child,!0),Gl(t.child,!0))),Ru(e,t,n,r);break;default:Ru(e,t,n,r)}}function Bu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Bu(a,o,s,c,i),yl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Bu(a,o,s,c,i)):u._visibility&2?Bu(a,o,s,c,i):Vu(a,o),i&&l&2048&&Iu(o.alternate,o);break;case 24:Bu(a,o,s,c,i),i&&l&2048&&Lu(o.alternate,o);break;default:Bu(a,o,s,c,i)}t=t.sibling}}function Vu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Vu(n,r),i&2048&&Iu(r.alternate,r);break;case 24:Vu(n,r),i&2048&&Lu(r.alternate,r);break;default:Vu(n,r)}t=t.sibling}}var Hu=8192;function Uu(e,t,n){if(e.subtreeFlags&Hu)for(e=e.child;e!==null;)Wu(e,t,n),e=e.sibling}function Wu(e,t,n){switch(e.tag){case 26:Uu(e,t,n),e.flags&Hu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Du,e.memoizedState,e.memoizedProps));break;case 5:Uu(e,t,n),e.flags&Hu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Du;Du=bm(e.stateNode.containerInfo),Uu(e,t,n),Du=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Hu,Hu=16777216,Uu(e,t,n),Hu=r):Uu(e,t,n));break;case 30:if((e.flags&Hu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Rl===null&&(Rl=new Map),Rl.set(r,i)}Uu(e,t,n);break;default:Uu(e,t,n)}}function Gu(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 Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ou=r,Yu(r,e)}Gu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qu(e),e=e.sibling}function qu(e){switch(e.tag){case 0:case 11:case 15:Ku(e),e.flags&2048&&bl(9,e,e.return);break;case 3:Ku(e);break;case 12:Ku(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ju(e)):Ku(e);break;default:Ku(e)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ou=r,Yu(r,e)}Gu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Ju(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ju(t));break;default:Ju(t)}e=e.sibling}}function Yu(e,t){for(;ou!==null;){var n=ou;switch(n.tag){case 0:case 11:case 15:bl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ja(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ou=r;else a:for(n=e;ou!==null;){r=ou;var i=r.sibling,a=r.return;if(_u(r),r===n){ou=null;break a}if(i!==null){i.return=a,ou=i;break a}ou=a}}}var Xu={getCacheForType:function(e){var t=Ca(ka),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ca(ka).controller.signal}},Zu=typeof WeakMap==`function`?WeakMap:Map,J=0,Qu=null,Y=null,X=0,$u=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,Z=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return J&2&&X!==0?X&-X:M.T===null?bt():Nf()}function jd(){if(Z===0){if(!(X&536870912)||H){var e=at;at<<=1,!(at&3932160)&&(at=262144),Z=e}else Z=536870912}return e=ko.current,e!==null&&(e.flags|=32),Z}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(gi(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Qu&&($u===2||$u===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Ld(e,X,Z,!1)),mt(e,n),J&2&&e===Qu||(e===Qu&&(!(J&2)&&(sd|=n),ad===4&&Ld(e,X,Z,!1)),Tf(e))}function Pd(e,t,n){if(J&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),a=r?qd(e,t):Gd(e,t,!0),o=r;do{if(a===0){nd&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n))a=Gd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=dd,dd=a,o!==null&&(dd===null?dd=o:dd.push.apply(dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){zd(e,0),Ld(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ld(r,t,Z,!td);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-We(),10<a)){if(Ld(r,t,Z,!td),ct(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=gp(Fd.bind(null,r,n,dd,gd,fd,t,Z,sd,ld,td,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,Z,sd,ld,td,o,null,-0,0)}break}}while(1);Tf(e)}function Fd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Rl=null,Wu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-We():(a&4194048)===a?md-We():0,m=eh(d,m),m!==null)?(xd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Br(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ld(e,t,n,r){t=ut(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Rd(){return J&6?!0:(Ef(0,!1),!1)}function Q(){if(Y!==null){if($u===0)var e=Y.return;else e=Y,ha=ma=null,is(e),ro=null,io=0,e=Y;for(;e!==null;)K(e.alternate,e),e=e.return;Y=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,Q(),Qu=e,Y=n=Mi(e.current,null),X=t,$u=0,ed=null,td=!1,nd=lt(e,t),rd=!1,ld=Z=cd=sd=od=ad=0,dd=ud=null,fd=!1,id=ut(e,t),Ci(),n}function Bd(e,t){U=null,M.H=mc,t===qa||t===Ya?(t=to(),$u=3):t===Ja?(t=to(),$u=4):$u=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,Y===null&&(ad=1,Ec(e,Bi(t,e.current)))}function Vd(){var e=ko.current;return e===null?!0:(X&4194048)===X?Ao===null:(X&62914560)===X||X&536870912?e===Ao:!1}function Hd(){var e=M.H;return M.H=mc,e===null?mc:e}function Ud(){var e=M.A;return M.A=Xu,e}function Wd(){ad=4,td||(X&4194048)!==X&&ko.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||Qu===null||Ld(Qu,X,Z,!1)}function Gd(e,t,n){var r=J;J|=2;var i=Hd(),a=Ud();(Qu!==e||X!==t)&&(gd=null,zd(e,t)),t=!1;var o=ad;a:do try{if($u!==0&&Y!==null){var s=Y,c=ed;switch($u){case 8:Q(),o=6;break a;case 3:case 2:case 9:case 6:ko.current===null&&(t=!0);var l=$u;if($u=0,ed=null,Zd(e,s,c,l),n&&nd){o=0;break a}break;default:l=$u,$u=0,ed=null,Zd(e,s,c,l)}}Kd(),o=ad;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,ha=ma=null,J=r,M.H=i,M.A=a,Y===null&&(Qu=null,X=0,Ci()),o}function Kd(){for(;Y!==null;)Yd(Y)}function qd(e,t){var n=J;J|=2;var r=Hd(),a=Ud();Qu!==e||X!==t?(gd=null,hd=We()+500,zd(e,t)):nd=lt(e,t);a:do try{if($u!==0&&Y!==null){t=Y;var o=ed;b:switch($u){case 1:$u=0,ed=null,Zd(e,t,o,1);break;case 2:case 9:if(Za(o)){$u=0,ed=null,Xd(t);break}t=function(){$u!==2&&$u!==9||Qu!==e||($u=7),Tf(e)},o.then(t,t);break a;case 3:$u=7;break a;case 4:$u=5;break a;case 7:Za(o)?($u=0,ed=null,Xd(t)):($u=0,ed=null,Zd(e,t,o,7));break;case 5:var s=null;switch(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Ym(s):c.stateNode.complete){$u=0,ed=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=u,Qd(u))}break b}}$u=0,ed=null,Zd(e,t,o,5);break;case 6:$u=0,ed=null,Zd(e,t,o,6);break;case 8:Q(),ad=6;break a;default:throw Error(i(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return ha=ma=null,M.H=r,M.A=a,J=n,Y===null?(Qu=null,X=0,Ci(),ad):0}function Jd(){for(;Y!==null&&!He();)Yd(Y)}function Yd(e){var t=dl(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?Qd(e):Y=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:is(t);var r=t;r===ta&&(H?(ca(r),r.tag===5&&r.stateNode!=null&&(na=r.stateNode)):(ca(r),H=!0));default:K(n,t),t=Y=Ni(t,id),t=dl(n,t,id)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Y=t}function Zd(e,t,n,r){ha=ma=null,is(t),ro=null,io=0;var i=t.return;try{if(jc(e,i,t,n,X)){ad=1,Ec(e,Bi(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;ad=1,Ec(e,Bi(n,e.current)),Y=null;return}t.flags&32768?(H||r===1?e=!0:nd||X&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=ko.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,td);return}e=t.return;var n=vl(t.alternate,t,id);if(n!==null){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);ad===0&&(ad=5)}function $d(e,t){do{var n=G(e.alternate,e);if(n!==null){n.flags&=32767,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);ad=6,Y=null}function ef(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(vd!==0);if(J&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Qu&&(Y=Qu=null,X=0),bd=t,yd=e,xd=n,Cd=a,wd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=Si,L(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=Pa(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Je,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ll=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=J,J|=4;try{du(e,t,n)}finally{J=a,N.p=i,M.T=r}}vd=1,Ll?Td=Mp(o,e.containerInfo,Dd,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function rf(){vd===3&&(vd=0,Mu(bd,yd),vd=4)}function af(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=J;J|=4;try{cu=lu=!1,Ou(t,e,n),n=cp;var o=Kr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Gr(s.ownerDocument.documentElement,s)){if(c!==null&&qr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Wr(s,h),v=Wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{J=a,N.p=i,M.T=r}}e.current=t,vd=2}}function of(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=J;J|=4;try{pu(e,t.alternate,t)}finally{J=i,N.p=r,M.T=n}}vd=3}}function sf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Ue();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),yt(r),n=n.stateNode,I&&typeof I.onCommitFiberRoot==`function`)try{I.onCommitFiberRoot(F,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{M.T=n,N.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);xd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ja(t)))}function lf(){return Td!==null&&(Td.skipTransition(),Td=null),af(),of(),sf(),uf()}function uf(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=yt(xd),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,J&6)throw Error(i(331));var c=J;if(J|=4,qu(o.current),zu(o,o.current,s,n),J=c,Ef(0,!1),I&&typeof I.onPostCommitFiberRoot==`function`)try{I.onPostCommitFiberRoot(F,o)}catch{}return!0}finally{N.p=a,M.T=r,cf(e,t)}}function df(e,t,n){t=Bi(n,t),t=Oc(e.stateNode,t,2),e=go(e,t,2),e!==null&&(mt(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Bi(n,e),n=kc(2),r=go(t,n,2),r!==null&&(Ac(n,r,t,e),mt(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Zu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(rd=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Qu===e&&(X&n)===n&&(ad===4||ad===3&&(X&62914560)===X&&300>We()-pd?J&2?cd|=n:zd(e,0):cd|=n,ld===X&&(ld=0)),Tf(e)}function hf(e,t){t===0&&(t=ft()),e=Ti(e,t),e!==null&&(mt(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return Be(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=X,a=ct(r,r===Qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=We(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}vd!==0&&vd!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Qu,n=X,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&($u===2||$u===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ve(r),yt(n)){case 2:case 8:n=qe;break;case 32:n=Je;break;case 268435456:n=Xe;break;default:n=Je}return r=Af.bind(null,e),n=Be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=X;return r=ct(e,e===Qu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),kf(e,We()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Pd(e,t,!0)}function Mf(){bp(function(){J&6?Be(Ke,Df):Of()})}function Nf(){if(wf===0){var e=La;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new zn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<pi.length;If++){var Lf=pi[If];mi(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}mi(ai,`onAnimationEnd`),mi(oi,`onAnimationIteration`),mi(si,`onAnimationStart`),mi(`dblclick`,`onDoubleClick`),mi(`focusin`,`onFocus`),mi(`focusout`,`onBlur`),mi(ci,`onTransitionRun`),mi(li,`onTransitionStart`),mi(ui,`onTransitionCancel`),mi(di,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){yi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){yi(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,zt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!kn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Nt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}En(function(){var r=a,i=xn(n),s=[];a:{var c=fi.get(e);if(c!==void 0){var l=zn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=rr;break;case`focusin`:u=`focus`,l=Jn;break;case`focusout`:u=`blur`,l=Jn;break;case`beforeblur`:case`afterblur`:l=Jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=qn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=or;break;case ai:case oi:case si:l=Yn;break;case di:l=sr;break;case`scroll`:case`scrollend`:l=Vn;break;case`wheel`:l=cr;break;case`copy`:case`cut`:case`paste`:l=Xn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ir;break;case`submit`:l=ar;break;case`toggle`:case`beforetoggle`:l=lr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Dn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ir,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Jf):null,c!==null&&Yf(s,u,c,d,!1),l!==null&&f!==null&&Yf(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=kr;else if(Cr(c)){if(Ar)_=Rr;else{_=Ir;var v=Fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=kr):_=Lr;if(_&&=_(e,r)){wr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(Cr(v)||v.contentEditable===`true`)&&(Yr=v,Xr=r,Zr=null);break;case`focusout`:Zr=Xr=Yr=null;break;case`mousedown`:Qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Qr=!1,$r(s,n,i);break;case`selectionchange`:if(Jr)break;case`keydown`:case`keyup`:$r(s,n,i)}var y;if(dr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else yr?_r(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(mr&&n.locale!==`ko`&&(yr||b!==`onCompositionStart`?b===`onCompositionEnd`&&yr&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,yr=!0)),v=qf(r,b),0<v.length&&(b=new Zn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=vr(n),y!==null&&(b.data=y)))),(y=pr?br(e,n):xr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Zn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Dn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Dn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=vn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ep(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ep(e,t,s,c,n,null)}un(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(R=!0),o=m;break;case`name`:m!==f&&(R=!0),a=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),s=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(R=!0),p=o;break;case`defaultValue`:o!==l&&(R=!0),c=o;break;case`multiple`:o!==l&&(R=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(R=!0),p=a;break;case`defaultValue`:a!==o&&(R=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(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 fp(e,t,n,r){return n=lp(n).createElement(e),n[Ct]=r,n[wt]=t,np(n,e,t),Lt(n),n}function pp(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 mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(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 um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var vm=new Map,ym=new Set;function bm(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 xm=N.d;N.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Rd();return e||t}function Cm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=It(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Lt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=De.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=It(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+rn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),np(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+rn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Lt(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[Ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:re,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){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=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ai(3,null,null,t),e.current=a,a.stateNode=e,t=Aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},po(a),e}function uh(e){return e?(e=Oi,e):Oi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=ho(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=go(e,r,t),n!==null&&(Nd(n,e,t),_o(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Ti(e,67108864);t!==null&&Nd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Ad();t=vt(t);var n=Ti(e,t);n!==null&&Nd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,yh(e,t,n,r)}finally{N.p=a,M.T=i}}function vh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,yh(e,t,n,r)}finally{N.p=a,M.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(J&6)&&(hd=We()+500,Ef(0,!1))}}break;case 31:case 13:s=Ti(a,2),s!==null&&Nd(s,a,2),Rd(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=xn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(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(Ge()){case Ke:return 2;case qe:return 8;case Je:case Ye:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,xt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,Ad(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Rd(),t[Tt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{F=Jh.inject(qh),I=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Tt]=t.current,Uf(e),new Wh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,y=/^[\\/]{2}/;function b(e,t){return t+e.replace(/\\/g,`/`)}var x=`popstate`;function S(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function C(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return O(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return ee(t,n,null,e)}function w(e,t){if(e===!1||e==null)throw Error(t)}function T(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function E(){return Math.random().toString(36).substring(2,10)}function D(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function O(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?A(t):t,state:n,key:t&&t.key||r||E(),mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function A(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ee(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u()+1;let d=D(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u();let i=D(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return te(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(x,d),c=e,()=>{i.removeEventListener(x,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function te(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),w(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:k(t);return i=i.replace(/ $/,`%20`),!n&&y.test(i)&&(i=r+i),new URL(i,r)}function ne(e,t,n=`/`){return j(e,t,n,!1)}function j(e,t,n,r,i){let a=ye((typeof t==`string`?A(t):t).pathname||`/`,n);if(a==null)return null;let o=i??re(e),s=null,c=N(a);for(let e=0;s==null&&e<o.length;++e)s=ge(o[e],c,r);return s}function re(e){let t=ie(e);return oe(t),t}function ie(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;w(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=De([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(w(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ie(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:me(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=M(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ae(e.path))a(e,t,!0,n)}),t}function ae(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ae(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function oe(e){e.sort((e,t)=>e.score===t.score?he(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var se=/^:[\w-]+$/,ce=3,le=2,ue=1,de=10,fe=-2,pe=e=>e===`*`;function me(e,t){let n=e.split(`/`),r=n.length;return n.some(pe)&&(r+=fe),t&&(r+=le),n.filter(e=>!pe(e)).reduce((e,t)=>e+(se.test(t)?ce:t===``?ue:de),r)}function he(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ge(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ve(u,l,s.matcher,s.compiledParams):_e(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=_e({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:De([a,d.pathname]),pathnameBase:ke(De([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=De([a,d.pathnameBase]))}return o}function _e(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=M(e.path,e.caseSensitive,e.end);return ve(e,t,n,r)}function ve(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Oe(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Oe(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function M(e,t=!1,n=!0){T(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function N(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return T(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ye(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function be(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?A(e):e,a;return n?(n=Ee(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?xe(n.substring(1),`/`):xe(n,t)):a=t,{pathname:a,search:Ae(r),hash:je(i)}}function xe(e,t){let n=Oe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Se(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ce(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function we(e){let t=Ce(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Te(e,t,n,r=!1){let i;typeof e==`string`?i=A(e):(i={...e},w(!i.pathname||!i.pathname.includes(`?`),Se(`?`,`pathname`,`search`,i)),w(!i.pathname||!i.pathname.includes(`#`),Se(`#`,`pathname`,`hash`,i)),w(!i.search||!i.search.includes(`#`),Se(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=be(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ee=e=>e.replace(/[\\/]{2,}/g,`/`),De=e=>Ee(e.join(`/`));function Oe(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var ke=e=>Oe(e).replace(/^\/*/,`/`),Ae=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,je=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Me=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ne(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function P(e){return De(e.map(e=>e.route.path).filter(Boolean))||`/`}var Pe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Fe(e,t){let n=e;if(typeof n!=`string`||!v.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Pe)try{let e=new URL(window.location.href),r=y.test(n)?new URL(b(n,e.protocol)):new URL(n),a=ye(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{T(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ie=new URL(`http://localhost`);function Le(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ie)}catch{return Ie}}function Re(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function ze(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Be(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Re(i,n),s=!Re(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!ze(e,i)||!Re(i,a)))throw Error(`External navigation is not allowed`)}var Ve=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ve);var He=[`GET`,...Ve];new Set(He);var Ue=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function We(e){try{return Ue.includes(new URL(e).protocol)}catch{return!1}}var Ge=_.createContext(null);Ge.displayName=`DataRouter`;var Ke=_.createContext(null);Ke.displayName=`DataRouterState`;var qe=_.createContext(!1);function Je(){return _.useContext(qe)}var Ye=_.createContext({isTransitioning:!1});Ye.displayName=`ViewTransition`;var Xe=_.createContext(new Map);Xe.displayName=`Fetchers`;var Ze=_.createContext(null);Ze.displayName=`Await`;var Qe=_.createContext(null);Qe.displayName=`Navigation`;var F=_.createContext(null);F.displayName=`Location`;var I=_.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var $e=_.createContext(null);$e.displayName=`RouteError`;var et=`REACT_ROUTER_ERROR`,tt=`REDIRECT`,nt=`ROUTE_ERROR_RESPONSE`;function rt(e){if(e.startsWith(`${et}:${tt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function it(e){if(e.startsWith(`${et}:${nt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Me(t.status,t.statusText,t.data)}catch{}}function at(e,{relative:t}={}){w(ot(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(Qe),{hash:i,pathname:a,search:o}=L(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:De([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ot(){return _.useContext(F)!=null}function st(){return w(ot(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(F).location}var ct=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function lt(e){_.useContext(Qe).static||_.useLayoutEffect(e)}function ut(){let{isDataRoute:e}=_.useContext(I);return e?jt():dt()}function dt(){w(ot(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(Ge),{basename:t,navigator:n}=_.useContext(Qe),{matches:r}=_.useContext(I),{pathname:i}=st(),a=JSON.stringify(we(r)),o=_.useRef(!1);return lt(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(T(o.current,ct),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Te(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:De([t,c.pathname])),Be(typeof r==`string`?r:k(r),n.createHref(c),Le(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var ft=_.createContext(null);function pt(e){let t=_.useContext(I).outlet;return _.useMemo(()=>t&&_.createElement(ft.Provider,{value:e},t),[t,e])}function mt(){let{matches:e}=_.useContext(I);return e[e.length-1]?.params??{}}function L(e,{relative:t}={}){let{matches:n}=_.useContext(I),{pathname:r}=st(),i=JSON.stringify(we(n));return _.useMemo(()=>Te(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ht(e,t){return gt(e,t)}function gt(e,t,n){w(ot(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(Qe),{matches:i}=_.useContext(I),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Nt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) 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.

Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=st(),d;if(t){let e=typeof t==`string`?A(t):t;w(c===`/`||e.pathname?.startsWith(c),`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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ne(e,{pathname:p});T(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),T(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 h=Ct(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:De([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:De([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function _t(){let e=At(),t=Ne(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var vt=_.createElement(_t,null),yt=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=it(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(I.Provider,{value:this.props.routeContext},_.createElement($e.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(xt,{error:e},t):t}};yt.contextType=qe;var bt=new WeakMap;function xt({children:e,error:t}){let{basename:n,navigator:r}=_.useContext(Qe);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=rt(t.digest);if(e){let i=bt.get(t);if(i)throw i;let a=Fe(e.location,n),o=a.absoluteURL||a.to;if(Be(e.location,o,Le(r),`allow-explicit`),We(o))throw Error(`Invalid redirect location`);if(Pe&&!bt.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw bt.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function St({routeContext:e,match:t,children:n}){let r=_.useContext(Ge);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(I.Provider,{value:e},n)}function Ct(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);w(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:P(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||vt,o&&(s<0&&c===0?(Nt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(St,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(yt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function wt(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tt(e){let t=_.useContext(Ge);return w(t,wt(e)),t}function Et(e){let t=_.useContext(Ke);return w(t,wt(e)),t}function Dt(e){let t=_.useContext(I);return w(t,wt(e)),t}function Ot(e){let t=Dt(e),n=t.matches[t.matches.length-1];return w(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kt(){return Ot(`useRouteId`)}function At(){let e=_.useContext($e),t=Et(`useRouteError`),n=Ot(`useRouteError`);return e===void 0?t.errors?.[n]:e}function jt(){let{router:e}=Tt(`useNavigate`),t=Ot(`useNavigate`),n=_.useRef(!1);return lt(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{T(n.current,ct),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Mt={};function Nt(e,t,n){!t&&!Mt[e]&&(Mt[e]=!0,T(!1,n))}_.memo(Pt);function Pt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return gt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Ft({to:e,replace:t,state:n,relative:r}){w(ot(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=_.useContext(Qe);T(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=_.useContext(I),{pathname:s}=st(),c=ut(),l=Te(e,we(o),s,r===`path`);Be(typeof e==`string`?e:k(e),a.createHref(l),Le(a),`reject`);let u=JSON.stringify(l);return _.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function It(e){return pt(e.context)}function Lt(e){w(!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 Rt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){w(!ot(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=A(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=ye(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return T(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(Qe.Provider,{value:c},_.createElement(F.Provider,{children:t,value:h}))}function zt({children:e,location:t}){return ht(Bt(e),t)}_.Component;function Bt(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,Bt(e.props.children,i));return}w(e.type===Lt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),w(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Bt(e.props.children,i)),n.push(a)}),n}var Vt=`get`,Ht=`application/x-www-form-urlencoded`;function Ut(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Wt(e){return Ut(e)&&e.tagName.toLowerCase()===`button`}function Gt(e){return Ut(e)&&e.tagName.toLowerCase()===`form`}function Kt(e){return Ut(e)&&e.tagName.toLowerCase()===`input`}function R(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qt(e,t){return e.button===0&&(!t||t===`_self`)&&!R(e)}function Jt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Yt(e,t){let n=Jt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Xt=null;function Zt(){if(Xt===null)try{new FormData(document.createElement(`form`),0),Xt=!1}catch{Xt=!0}return Xt}var Qt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $t(e){return e!=null&&!Qt.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ht}"`),null):e}function en(e,t){let n,r,i,a,o;if(Gt(e)){let o=e.getAttribute(`action`);r=o?ye(o,t):null,n=e.getAttribute(`method`)||Vt,i=$t(e.getAttribute(`enctype`))||Ht,a=new FormData(e)}else if(Wt(e)||Kt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ye(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Vt,i=$t(e.getAttribute(`formenctype`))||$t(o.getAttribute(`enctype`))||Ht,a=new FormData(o,e),!Zt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Ut(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Vt,r=null,i=Ht,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function tn(e,t){if(e===!1||e==null)throw Error(t)}function nn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&ye(i.pathname,t)===`/`?`${Oe(t)}/_root.${r}`:`${Oe(i.pathname)}.${r}`,i}async function rn(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function an(e){return e!=null&&typeof e.page==`string`}function on(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function sn(e,t,n){return fn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await rn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(on).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function cn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ln(e,t,{includeHydrateFallback:n}={}){return un(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function un(e){return[...new Set(e)]}function dn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function fn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!an(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(dn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function pn(){let e=_.useContext(Ge);return tn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function mn(){let e=_.useContext(Ke);return tn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var hn=_.createContext(void 0);hn.displayName=`FrameworkContext`;function gn(){let e=_.useContext(hn);return tn(e,`You must render this element inside a <HydratedRouter> element`),e}function _n(e,t){let n=_.useContext(hn),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:vn(s,p),onBlur:vn(c,m),onMouseEnter:vn(l,p),onMouseLeave:vn(u,m),onTouchStart:vn(d,p)}]:[a,f,{}]:[!1,f,{}]}function vn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yn({page:e,...t}){let n=Je(),{nonce:r}=gn(),{router:i}=pn(),a=_.useMemo(()=>ne(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(xn,{page:e,matches:a,...t}):_.createElement(Sn,{page:e,matches:a,...t})):null}function bn(e){let{manifest:t,routeModules:n}=gn(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return sn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function xn({page:e,matches:t,...n}){let r=st(),{future:i}=gn(),{basename:a}=pn(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=nn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Sn({page:e,matches:t,...n}){let r=st(),{future:i,manifest:a,routeModules:o}=gn(),{basename:s}=pn(),{loaderData:c,matches:l}=mn(),u=_.useMemo(()=>cn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>cn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=nn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>ln(d,a),[d,a]),m=bn(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Cn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{wn&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Tn({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=C({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(Rt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var En=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:y}=_.useContext(Qe),b=typeof l==`string`&&v.test(l),x=Fe(l,h);l=x.to;let S=at(l,{relative:r}),C=st(),w=null;if(o){let e=Te(o,[],C.mask?C.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:De([h,e.pathname])),w=g.createHref(e)}let[T,E,D]=_n(n,p),O=jn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:y});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||i),ee=_.createElement(`a`,{...p,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:Cn(m,E),target:c,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?_.createElement(_.Fragment,null,ee,_.createElement(yn,{page:S})):ee});En.displayName=`Link`;var Dn=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=L(a,{relative:c.relative}),d=st(),f=_.useContext(Ke),{navigator:p,basename:m}=_.useContext(Qe),h=f!=null&&Ln(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=ye(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(En,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Dn.displayName=`NavLink`;var On=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Vt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(Qe),g=Fn(),y=In(s,{relative:l}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&v.test(s);return _.createElement(`form`,{ref:m,method:b,action:y,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!x&&e===`render`?`true`:void 0})});On.displayName=`Form`;function kn(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function An(e){let t=_.useContext(Ge);return w(t,kn(e)),t}function jn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ut(),d=st(),f=L(e,{relative:o});return _.useCallback(p=>{if(qt(p,t)){p.preventDefault();let t=n===void 0?k(d)===k(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Mn(e){T(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 t=_.useRef(Jt(e)),n=_.useRef(!1),r=st(),i=_.useMemo(()=>Yt(r.search,n.current?null:t.current),[r.search]),a=ut();return[i,_.useCallback((e,t)=>{let r=Jt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Nn=0,Pn=()=>`__${String(++Nn)}__`;function Fn(){let{router:e}=An(`useSubmit`),{basename:t}=_.useContext(Qe),n=kt(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=en(e,t);if(a.navigate===!1){let e=a.fetcherKey||Pn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function In(e,{relative:t}={}){let{basename:n}=_.useContext(Qe),r=_.useContext(I);w(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...L(e||`.`,{relative:t})},o=st();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:De([n,a.pathname])),k(a)}function Ln(e,{relative:t}={}){let n=_.useContext(Ye);w(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=An(`useViewTransitionState`),i=L(e,{relative:t});if(!n.isTransitioning)return!1;let a=ye(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ye(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _e(i.pathname,o)!=null||_e(i.pathname,a)!=null}var Rn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),z=o(((e,t)=>{t.exports=Rn()}))(),zn=_.createContext(void 0),Bn=e=>{let t=_.useContext(zn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Vn=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,z.jsx)(zn.Provider,{value:e,children:t})),Hn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Un=new class{#e=Hn;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Wn(e){setTimeout(e,0)}var Gn=typeof window>`u`||`Deno`in globalThis;function Kn(){}function qn(e,t){return typeof e==`function`?e(t):e}function Jn(e){return typeof e==`number`&&e>=0&&e!==1/0}function Yn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xn(e,t){return typeof e==`function`?e(t):e}function Zn(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==$n(o,t.options))return!1}else if(!tr(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Qn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(er(t.options.mutationKey)!==er(a))return!1}else if(!tr(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function $n(e,t){return(t?.queryKeyHashFn||er)(e)}function er(e){return JSON.stringify(e,(e,t)=>or(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function tr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!tr(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!tr(e[r],t[r]))return!1;return!0}return!1}var nr=Object.prototype.hasOwnProperty;function rr(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ar(e)&&ar(t);if(!r&&!(or(e)&&or(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:nr.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=rr(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ir(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ar(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function or(e){if(!sr(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!sr(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function sr(e){return Object.prototype.toString.call(e)===`[object Object]`}function cr(e){return new Promise(t=>{Un.setTimeout(t,e)})}function lr(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:rr(e,t)}function ur(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function dr(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var fr=Symbol();function pr(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===fr?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mr(e,t){return typeof e==`function`?e(...t):!!e}function hr(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var gr=()=>Gn,_r=()=>gr(),vr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yr=new class extends vr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},br=Wn;function xr(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=br,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Sr=xr(),Cr=new class extends vr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function wr(e){return Math.min(1e3*2**e,3e4)}function Tr(e){return(e??`online`)!==`online`||Cr.isOnline()}var Er=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Dr(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Kn);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Er(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>yr.isFocused()&&(e.networkMode===`always`||Cr.isOnline())&&e.canRun(),p=()=>Tr(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(_r()?0:3),a=e.retryDelay??wr,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),cr(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Or=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jn(this.gcTime)&&(this.#e=Un.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_r()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Un.clearTimeout(this.#e),this.#e=void 0)}};function kr(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{hr(e,()=>t.signal,()=>n=!0)},u=pr(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?dr:ur;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?jr:Ar,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:Ar(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ar(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function jr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Mr=class extends Or{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Pr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Pr(this.options);e.data!==void 0&&(this.setState(Nr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=lr(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Kn).catch(Kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Xn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Xn(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Yn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=pr(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?kr(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Dr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Er&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Er){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...B(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Nr(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Sr.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function B(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Nr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Pr(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Fr=class extends vr{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Lr(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rr(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Xn(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ir(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&zr(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Xn(this.options.enabled,this.#t)!==Xn(t.enabled,this.#t)||Xn(this.options.staleTime,this.#t)!==Xn(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Xn(this.options.enabled,this.#t)!==Xn(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ir(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Kn)),t}#h(e){return!_r()&&Xn(this.options.enabled,this.#t)!==!1&&Jn(e)}#g(){this.#b();let e=Xn(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Yn(this.#r.dataUpdatedAt,e)+1;this.#u=Un.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Xn(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Un.setInterval(()=>{(this.options.refetchIntervalInBackground||yr.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Un.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Un.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Lr(e,t),o=i&&zr(e,n,t,r);(a||o)&&(l={...l,...B(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=lr(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=lr(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Br(e,t),refetch:this.refetch,isEnabled:Xn(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),ir(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Sr.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Ir(e,t){return Xn(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Xn(t.retryOnMount,e)!==!1)}function Lr(e,t){return Ir(e,t)||e.state.data!==void 0&&Rr(e,t,t.refetchOnMount)}function Rr(e,t,n){if(Xn(t.enabled,e)!==!1&&Xn(t.staleTime,e)!==`static`){let r=Xn(n,e);return r===`always`||r!==!1&&Br(e,t)}return!1}function zr(e,t,n,r){return(e!==t||Xn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Br(e,n)}function Br(e,t){return Xn(t.enabled,e)!==!1&&e.isStaleByTime(Xn(t.staleTime,e))}var Vr=class extends Or{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Hr(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Dr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Sr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Hr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ur=class extends vr{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Vr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Wr(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Wr(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Wr(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Wr(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Sr.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Qn(t,e))}findAll(e={}){return this.getAll().filter(t=>Qn(e,t))}notify(e){Sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Sr.batch(()=>Promise.all(e.map(e=>e.continue().catch(Kn))))}};function Wr(e){return e.options.scope?.id}var Gr=class extends vr{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ir(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&er(t.mutationKey)!==er(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Hr();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Sr.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Kr=class extends vr{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??$n(r,t),a=this.get(i);return a||(a=new Mr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Sr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Zn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Zn(e,t)):t}notify(e){Sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Sr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Sr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Kr,this.#t=e.mutationCache||new Ur,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=yr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Cr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=qn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Sr.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Sr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Sr.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Sr.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Kn).catch(Kn)}invalidateQueries(e,t={}){return Sr.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Sr.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Kn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Kn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Xn(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Xn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kn).catch(Kn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kn).catch(Kn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Cr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(er(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{tr(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(er(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{tr(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=$n(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===fr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Jr=_.createContext(!1),Yr=()=>_.useContext(Jr);Jr.Provider;function Xr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Zr=_.createContext(Xr()),Qr=()=>_.useContext(Zr),$r=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?mr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},ei=e=>{_.useEffect(()=>{e.clearReset()},[e])},ti=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||mr(n,[e.error,r])),ni=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ri=(e,t)=>e?.suspense&&t.isPending,ii=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ai(e,t,n){let r=Yr(),i=Qr(),a=Bn(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ni(o),$r(o,i,s),ei(i);let[l]=_.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(_.useSyncExternalStore(_.useCallback(e=>{let t=d?l.subscribe(Sr.batchCalls(e)):Kn;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),_.useEffect(()=>{l.setOptions(o)},[o,l]),ri(o,u))throw ii(o,l,i);if(ti({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function oi(e,t){return ai(e,Fr,t)}function si(e,t){let n=Bn(t),[r]=_.useState(()=>new Gr(n,e));_.useEffect(()=>{r.setOptions(e)},[r,e]);let i=_.useSyncExternalStore(_.useCallback(e=>r.subscribe(Sr.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=_.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Kn)},[r]);if(i.error&&mr(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ci=g(),li=/\{[^{}]+\}/g,ui=()=>typeof process==`object`&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function di(){return Math.random().toString(36).slice(2,11)}function fi(e){let{baseUrl:t=``,Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:o,headers:s,requestInitExt:c=void 0,...l}={...e};c=ui()?c:void 0,t=xi(t);let u=[];async function d(e,d){let{baseUrl:f,fetch:p=r,Request:m=n,headers:h,params:g={},parseAs:_=`json`,querySerializer:v,bodySerializer:y=a??vi,pathSerializer:b,body:x,middleware:S=[],...C}=d||{},w=t;f&&(w=xi(f)??t);let T=typeof i==`function`?i:gi(i);v&&(T=typeof v==`function`?v:gi({...typeof i==`object`?i:{},...v}));let E=b||o||_i,D=x===void 0?void 0:y(x,bi(s,h,g.header)),O=bi(D===void 0||D instanceof FormData?{}:{"Content-Type":`application/json`},s,h,g.header),k=[...u,...S],A={redirect:`follow`,...l,...C,body:D,headers:O},ee,te,ne=new m(yi(e,{baseUrl:w,params:g,querySerializer:T,pathSerializer:E}),A),j;for(let e in C)e in ne||(ne[e]=C[e]);if(k.length){ee=di(),te=Object.freeze({baseUrl:w,fetch:p,parseAs:_,querySerializer:T,bodySerializer:y,pathSerializer:E});for(let t of k)if(t&&typeof t==`object`&&typeof t.onRequest==`function`){let n=await t.onRequest({request:ne,schemaPath:e,params:g,options:te,id:ee});if(n){if(n instanceof m)ne=n;else if(n instanceof Response){j=n;break}else throw Error(`onRequest: must return new Request() or Response() when modifying the request`)}}}if(!j){try{j=await p(ne,c)}catch(t){let n=t;if(k.length)for(let t=k.length-1;t>=0;t--){let r=k[t];if(r&&typeof r==`object`&&typeof r.onError==`function`){let t=await r.onError({request:ne,error:n,schemaPath:e,params:g,options:te,id:ee});if(t){if(t instanceof Response){n=void 0,j=t;break}if(t instanceof Error){n=t;continue}throw Error(`onError: must return new Response() or instance of Error`)}}}if(n)throw n}if(k.length)for(let t=k.length-1;t>=0;t--){let n=k[t];if(n&&typeof n==`object`&&typeof n.onResponse==`function`){let t=await n.onResponse({request:ne,response:j,schemaPath:e,params:g,options:te,id:ee});if(t){if(!(t instanceof Response))throw Error(`onResponse: must return new Response() when modifying the response`);j=t}}}}let re=j.headers.get(`Content-Length`);if(j.status===204||ne.method===`HEAD`||re===`0`&&!j.headers.get(`Transfer-Encoding`)?.includes(`chunked`))return j.ok?{data:void 0,response:j}:{error:void 0,response:j};if(j.ok)return{data:await(async()=>{if(_===`stream`)return j.body;if(_===`json`&&!re){let e=await j.text();return e?JSON.parse(e):void 0}return await j[_]()})(),response:j};let ie=await j.text();try{ie=JSON.parse(ie)}catch{}return{error:ie,response:j}}return{request(e,t,n){return d(t,{...n,method:e.toUpperCase()})},GET(e,t){return d(e,{...t,method:`GET`})},PUT(e,t){return d(e,{...t,method:`PUT`})},POST(e,t){return d(e,{...t,method:`POST`})},DELETE(e,t){return d(e,{...t,method:`DELETE`})},OPTIONS(e,t){return d(e,{...t,method:`OPTIONS`})},HEAD(e,t){return d(e,{...t,method:`HEAD`})},PATCH(e,t){return d(e,{...t,method:`PATCH`})},TRACE(e,t){return d(e,{...t,method:`TRACE`})},use(...e){for(let t of e)if(t){if(typeof t!=`object`||!(`onRequest`in t||`onResponse`in t||`onError`in t))throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(t)}},eject(...e){for(let t of e){let e=u.indexOf(t);e!==-1&&u.splice(e,1)}}}}function pi(e,t,n){if(t==null)return``;if(typeof t==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function mi(e,t,n){if(!t||typeof t!=`object`)return``;let r=[],i={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`;if(n.style!==`deepObject`&&n.explode===!1){for(let e in t)r.push(e,n.allowReserved===!0?t[e]:encodeURIComponent(t[e]));let i=r.join(`,`);switch(n.style){case`form`:return`${e}=${i}`;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return i}}for(let i in t){let a=n.style===`deepObject`?`${e}[${i}]`:i;r.push(pi(a,t[i],n))}let a=r.join(i);return n.style===`label`||n.style===`matrix`?`${i}${a}`:a}function hi(e,t,n){if(!Array.isArray(t))return``;if(n.explode===!1){let r={form:`,`,spaceDelimited:`%20`,pipeDelimited:`|`}[n.style]||`,`,i=(n.allowReserved===!0?t:t.map(e=>encodeURIComponent(e))).join(r);switch(n.style){case`simple`:return i;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return`${e}=${i}`}}let r={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`,i=[];for(let r of t)n.style===`simple`||n.style===`label`?i.push(n.allowReserved===!0?r:encodeURIComponent(r)):i.push(pi(e,r,n));return n.style===`label`||n.style===`matrix`?`${r}${i.join(r)}`:i.join(r)}function gi(e){return function(t){let n=[];if(t&&typeof t==`object`)for(let r in t){let i=t[r];if(i!=null){if(Array.isArray(i)){if(i.length===0)continue;n.push(hi(r,i,{style:`form`,explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}))}else typeof i==`object`?n.push(mi(r,i,{style:`deepObject`,explode:!0,...e?.object,allowReserved:e?.allowReserved||!1})):n.push(pi(r,i,e))}}return n.join(`&`)}}function _i(e,t){let n=e;for(let r of e.match(li)??[]){let e=r.substring(1,r.length-1),i=!1,a=`simple`;if(e.endsWith(`*`)&&(i=!0,e=e.substring(0,e.length-1)),e.startsWith(`.`)?(a=`label`,e=e.substring(1)):e.startsWith(`;`)&&(a=`matrix`,e=e.substring(1)),!t||t[e]===void 0||t[e]===null)continue;let o=t[e];n=Array.isArray(o)?n.replace(r,hi(e,o,{style:a,explode:i})):typeof o==`object`?n.replace(r,mi(e,o,{style:a,explode:i})):a===`matrix`?n.replace(r,`;${pi(e,o)}`):n.replace(r,a===`label`?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function vi(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get(`Content-Type`)??t.get(`content-type`):t[`Content-Type`]??t[`content-type`])===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}function yi(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith(`?`)&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function bi(...e){let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,r)}return t}function xi(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}var Si=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`ApiError`}};function Ci(){try{return localStorage.getItem(`moadim.apiToken`)?.trim()||void 0}catch{return}}function wi(e,t={}){let n=Ci();if(!n)return fetch(e,t);let r=new Headers(t.headers);return!r.has(`authorization`)&&!r.has(`x-moadim-token`)&&r.set(`authorization`,`Bearer ${n}`),fetch(e,{...t,headers:r})}var V=fi({baseUrl:`/api/v1`,fetch:wi});function Ti(e){return e===401?` Set the UI token with localStorage.setItem('moadim.apiToken', '<MOADIM_API_TOKEN>').`:``}function Ei({data:e,error:t,response:n}){if(t!==void 0||!n.ok)throw new Si((t?.error??`HTTP ${n.status}`)+Ti(n.status),n.status);if(e===void 0)throw new Si(`empty response body`,n.status);return e}function Di({error:e,response:t}){if(e!==void 0||!t.ok)throw new Si((e?.error??`HTTP ${t.status}`)+Ti(t.status),t.status)}function Oi(e=1e4){return oi({queryKey:[`health`],queryFn:async()=>Ei(await V.GET(`/health`)),refetchInterval:e,retry:!1})}function ki(){let e=Bn();return si({mutationFn:async()=>Ei(await V.POST(`/crontab-sync/retry`)),onSuccess:t=>e.setQueryData([`health`],t)})}function Ai(){return si({mutationFn:async()=>Ei(await V.POST(`/shutdown`))})}function ji(){return oi({queryKey:[`machine`],queryFn:async()=>Ei(await V.GET(`/machine`))})}function Mi(){return oi({queryKey:[`machines`],queryFn:async()=>Ei(await V.GET(`/machines`))})}function Ni(){let e=Bn();return si({mutationFn:async e=>Ei(await V.PUT(`/machine`,{body:{name:e}})),onSuccess:()=>{e.invalidateQueries({queryKey:[`machine`]}),e.invalidateQueries({queryKey:[`machines`]})}})}function Pi(){return oi({queryKey:[`agents`],queryFn:async()=>Ei(await V.GET(`/agents`))})}function Fi(){return oi({queryKey:[`config`,`user-prompt`],queryFn:async()=>{let{data:e,error:t,response:n}=await V.GET(`/config/user-prompt`,{parseAs:`text`});return Ei({data:e,error:t,response:n})}})}function Ii(){let e=Bn();return si({mutationFn:async e=>Di(await V.PUT(`/config/user-prompt`,{body:{content:e}})),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`,`user-prompt`]})}})}function Li(){return oi({queryKey:[`config`,`max-concurrent-runs`],queryFn:async()=>Ei(await V.GET(`/config/max-concurrent-runs`))})}function Ri(){let e=Bn();return si({mutationFn:async e=>Ei(await V.PUT(`/config/max-concurrent-runs`,{body:{value:e}})),onSuccess:t=>{e.setQueryData([`config`,`max-concurrent-runs`],t)}})}function zi(e={},t){return oi({queryKey:[`routines`,e],queryFn:async()=>Ei(await V.GET(`/routines`,{params:{query:e}})),...t})}function Bi(e,t=!0){return oi({queryKey:[`routines`,e],queryFn:async()=>Ei(await V.GET(`/routines/{id}`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}function Vi(e,t){e.invalidateQueries({queryKey:[`routines`]}),t&&e.invalidateQueries({queryKey:[`routines`,t]})}function Hi(){let e=Bn();return si({mutationFn:async e=>Ei(await V.POST(`/routines`,{body:e})),onSuccess:()=>Vi(e)})}function Ui(){let e=Bn();return si({mutationFn:async({id:e,body:t})=>Ei(await V.PATCH(`/routines/{id}`,{params:{path:{id:e}},body:t})),onSuccess:(t,{id:n})=>Vi(e,n)})}function Wi(){let e=Bn();return si({mutationFn:async({id:e,body:t})=>Ei(await V.POST(`/routines/{id}/move`,{params:{path:{id:e}},body:t})),onSuccess:(t,{id:n})=>Vi(e,n)})}function Gi(){let e=Bn();return si({mutationFn:async e=>Ei(await V.DELETE(`/routines/{id}`,{params:{path:{id:e}}})),onSuccess:(t,n)=>Vi(e,n)})}function Ki(){let e=Bn();return si({mutationFn:async e=>{try{return await qi(e,!1)}catch(t){if(!Ji(t)||!window.confirm(`System power saving is active. Run this routine anyway?`))throw t;return qi(e,!0)}},onSuccess:(t,n)=>Vi(e,n)})}async function qi(e,t){return Ei(await V.POST(`/routines/{id}/trigger`,{params:{path:{id:e}},body:{override_system_power_saving:t}}))}function Ji(e){return e instanceof Si&&e.status===423&&e.message===`locked: system power saving is active`}function Yi(){let e=Bn();return si({mutationFn:async()=>Ei(await V.POST(`/routines/cleanup`)),onSuccess:()=>Vi(e)})}function Xi(){return oi({queryKey:[`routines`,`lock`],queryFn:async()=>Ei(await V.GET(`/routines/lock`))})}function Zi(){let e=Bn();return si({mutationFn:async e=>Ei(await V.DELETE(`/routines/lock`,{params:{query:{scope:e}}})),onSuccess:()=>void e.invalidateQueries({queryKey:[`routines`,`lock`]})})}function Qi(e,t){return oi({queryKey:[`routines`,`runs`,e],queryFn:async()=>Ei(await V.GET(`/routines/runs`,{params:{query:{limit:e}}})),...t})}function $i(e,t=!0){return oi({queryKey:[`routines`,e,`runs`],queryFn:async()=>Ei(await V.GET(`/routines/{id}/runs`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}async function ea(e){let{data:t,error:n,response:r}=await e;return Ei({data:t,error:n,response:r})}function ta(e,t=!0){return oi({queryKey:[`routines`,e,`logs`],queryFn:()=>ea(V.GET(`/routines/{id}/logs`,{params:{path:{id:e}},parseAs:`text`})),enabled:t&&e.length>0})}function na(e,t,n=!0){return oi({queryKey:[`routines`,e,`runs`,t,`log`],queryFn:()=>ea(V.GET(`/routines/{id}/runs/{workbench}/log`,{params:{path:{id:e,workbench:t}},parseAs:`text`})),enabled:n&&e.length>0&&t.length>0})}function H(e,t,n=!0){return oi({queryKey:[`routines`,e,`runs`,t,`summary`],queryFn:()=>ea(V.GET(`/routines/{id}/runs/{workbench}/summary`,{params:{path:{id:e,workbench:t}},parseAs:`text`})),enabled:n&&e.length>0&&t.length>0})}function ra(e,t=!0){return oi({queryKey:[`routines`,e,`flags`],queryFn:async()=>Ei(await V.GET(`/routines/{id}/flags`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}function ia(){let e=Bn();return si({mutationFn:async({id:e,filename:t})=>Di(await V.DELETE(`/routines/{id}/flags/{filename}`,{params:{path:{id:e,filename:t}}})),onSuccess:(t,{id:n})=>void e.invalidateQueries({queryKey:[`routines`,n,`flags`]})})}function aa(e){return e?`/api/v1/routines.ics?routine=${encodeURIComponent(e)}`:`/api/v1/routines.ics`}var oa=`moadim.notify-failures`;function sa(){try{return localStorage.getItem(oa)===`1`}catch{return!1}}function ca(e){try{localStorage.setItem(oa,e?`1`:`0`)}catch{}}function la(){return typeof Notification<`u`}function ua(){return la()?Notification.permission:`unsupported`}async function da(){return la()?Notification.permission==="default"?Notification.requestPermission():Notification.permission:`unsupported`}function fa(e){return new Map(e.map(e=>[e.workbench,e.status]))}function pa(e,t){return e.filter(e=>e.status===`failed`&&t.get(e.workbench)!==`failed`)}function ma(e){return{title:`${e.routine_title} failed`,body:e.exit_code==null?`Run failed`:`Exit code ${e.exit_code}`}}function ha(e){if(ua()!==`granted`)return;let{title:t,body:n}=ma(e);new Notification(t,{body:n,tag:e.workbench})}var ga=`moadim.notification-log`;function _a(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.routineId==`string`&&typeof t.routineTitle==`string`&&typeof t.message==`string`&&typeof t.atSecs==`number`&&typeof t.read==`boolean`}function va(){try{let e=localStorage.getItem(ga);if(e===null)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(_a):[]}catch{return[]}}function ya(e){try{localStorage.setItem(ga,JSON.stringify(e))}catch{}}function ba(e,t){let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.workbench)).map(e=>({id:e.workbench,routineId:e.routine_id,routineTitle:e.routine_title,message:e.exit_code==null?`Run failed`:`Run failed (exit ${e.exit_code})`,atSecs:e.finished_at??e.started_at,read:!1}));return r.length===0?e:[...r,...e].slice(0,50)}function xa(e){return e.missed_scheduled_run_at==null?void 0:`missed:${e.id}:${e.missed_scheduled_run_at}`}function Sa(e,t){let n=new Set(e.map(e=>e.id)),r=t.flatMap(e=>{let t=xa(e);return t===void 0||n.has(t)?[]:[{id:t,routineId:e.id,routineTitle:e.title,message:`Scheduled run was missed — review or run manually`,atSecs:e.missed_scheduled_run_at??0,read:!1}]});return r.length===0?e:(r.sort((e,t)=>t.atSecs-e.atSecs||e.routineTitle.localeCompare(t.routineTitle)),[...r,...e].slice(0,50))}function Ca(e){return e.filter(e=>!e.read).length}function wa(e){return e.some(e=>!e.read)?e.map(e=>({...e,read:!0})):e}var Ta=`moadim.client.theme`,Ea=`moadim-theme-change`;function Da(){try{return localStorage.getItem(Ta)!==`dark`}catch{return!0}}function Oa(e){try{localStorage.setItem(Ta,e?`light`:`dark`)}catch{}window.dispatchEvent(new CustomEvent(Ea,{detail:{light:e}}))}function ka(e){document.documentElement.classList.toggle(`theme-light`,e)}var Aa=[{key:`o`,route:`/`,label:`Overview`},{key:`r`,route:`/routines`,label:`Routines`},{key:`u`,route:`/runs`,label:`Runs`},{key:`h`,route:`/heatmap`,label:`Heatmap`},{key:`l`,route:`/reliability`,label:`Reliability`},{key:`m`,route:`/machines`,label:`Machines`},{key:`a`,route:`/agents`,label:`Agents`},{key:`s`,route:`/settings`,label:`Settings`}];function ja(e){return Aa.find(t=>t.key===e.toLowerCase())?.route}function Ma(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.closest(`[contenteditable]:not([contenteditable="false"])`)!==null}var Na=o(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`cronstrue`,[],r):typeof e==`object`?e.cronstrue=r():n.cronstrue=r()})(globalThis,()=>(()=>{var e={6949(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.CronParser=void 0;var r=n(9515);t.CronParser=function(){function e(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=!1),this.expression=e,this.dayOfWeekStartIndexZero=t,this.monthStartIndexZero=n}return e.prototype.parse=function(){var e,t=this.expression??``;if(t===`@reboot`)return e=[`@reboot`,``,``,``,``,``,``],e;if(t.startsWith(`@`)){var n=this.parseSpecial(this.expression);e=this.extractParts(n)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},e.prototype.parseSpecial=function(e){var t={"@yearly":`0 0 1 JAN *`,"@annually":`0 0 1 JAN *`,"@monthly":`0 0 1 * *`,"@weekly":`0 0 * * SUN`,"@daily":`0 0 * * *`,"@midnight":`0 0 * * *`,"@hourly":`0 * * * *`,"@reboot":`@reboot`}[e];if(!t)throw Error(`Unknown special expression.`);return t},e.prototype.extractParts=function(e){if(!this.expression)throw Error(`cron expression is empty`);for(var t=e.trim().split(/[ ]+/),n=0;n<t.length;n++)if(t[n].includes(`,`)){var r=t[n].split(`,`).map(function(e){return e.trim()}).filter(function(e){return e!==``}).map(function(e){return isNaN(Number(e))?e:Number(e)}).filter(function(e){return e!==null&&e!==``});r.length===0&&r.push(`*`),r.sort(function(e,t){return e!==null&&t!==null?e-t:0}),t[n]=r.map(function(e){return e===null?``:e.toString()}).join(`,`)}if(t.length<5)throw Error(`Expression has only ${t.length} part${t.length==1?``:`s`}. At least 5 parts are required.`);if(t.length==5)t.unshift(``),t.push(``);else if(t.length==6)/\d{4}$/.test(t[5])||t[4]==`?`||t[2]==`?`?t.unshift(``):t.push(``);else if(t.length>7)throw Error(`Expression has ${t.length} parts; too many!`);return t},e.prototype.normalize=function(e){var t=this;if(e[3]=e[3].replace(`?`,`*`),e[5]=e[5].replace(`?`,`*`),e[2]=e[2].replace(`?`,`*`),e[0].indexOf(`0/`)==0&&(e[0]=e[0].replace(`0/`,`*/`)),e[1].indexOf(`0/`)==0&&(e[1]=e[1].replace(`0/`,`*/`)),e[2].indexOf(`0/`)==0&&(e[2]=e[2].replace(`0/`,`*/`)),e[3].indexOf(`1/`)==0&&(e[3]=e[3].replace(`1/`,`*/`)),!this.monthStartIndexZero&&e[4].indexOf(`1/`)==0&&(e[4]=e[4].replace(`1/`,`*/`)),e[6].indexOf(`1/`)==0&&(e[6]=e[6].replace(`1/`,`*/`)),e[5]=e[5].replace(/(^\d+)|([^#/\s\d]\d+)/g,function(e){var n=e.replace(/\D/,``),r=n;return t.dayOfWeekStartIndexZero?n==`7`&&(r=`0`):r=(parseInt(n)-1).toString(),e.replace(n,r)}),e[5]==`L`&&(e[5]=`6`),e[3]==`?`&&(e[3]=`*`),e[3].indexOf(`W`)>-1&&(e[3].indexOf(`,`)>-1||/[-+]/.test(e[3]))&&!/^\d{1,2}W[+-]\d{1,2}$/.test(e[3]))throw Error(`The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.`);var n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var r in n)e[5]=e[5].replace(new RegExp(r,`gi`),n[r].toString());e[4]=e[4].replace(/(^\d{1,2})|([^#/\s\d]\d{1,2})/g,function(e){var n=e.replace(/\D/,``),r=n;return t.monthStartIndexZero&&(r=(parseInt(n)+1).toString()),e.replace(n,r)});var i={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var a in i)e[4]=e[4].replace(new RegExp(a,`gi`),i[a].toString());e[0]==`0`&&(e[0]=``),!/\*|\-|\,|\//.test(e[2])&&(/\*|\//.test(e[1])||/\*|\//.test(e[0]))&&(e[2]+=`-${e[2]}`);for(var o=0;o<e.length;o++)if(e[o].indexOf(`,`)!=-1&&(e[o]=e[o].split(`,`).filter(function(e){return e!==``}).join(`,`)||`*`),e[o]==`*/1`&&(e[o]=`*`),e[o].indexOf(`/`)>-1&&!/^\*|\-|\,/.test(e[o])){var s=null;switch(o){case 4:s=`12`;break;case 5:s=`6`;break;case 6:s=`9999`;break;default:s=null}if(s!==null){var c=e[o].split(`/`);e[o]=`${c[0]}-${s}/${c[1]}`}}},e.prototype.validate=function(e){var t=`0-9,\\-*/`;this.validateOnlyExpectedCharactersFound(e[0],t),this.validateOnlyExpectedCharactersFound(e[1],t),this.validateOnlyExpectedCharactersFound(e[2],t),this.validateOnlyExpectedCharactersFound(e[3].replace(/^(\d{1,2}W)[+-]\d{1,2}$/,`$1`),`0-9,\\-*/LW`),this.validateOnlyExpectedCharactersFound(e[4],t),this.validateOnlyExpectedCharactersFound(e[5],`0-9,\\-*/L#`),this.validateOnlyExpectedCharactersFound(e[6],t),this.validateAnyRanges(e)},e.prototype.validateAnyRanges=function(e){e.forEach(function(e){return r.default.stepRange(e)}),r.default.secondRange(e[0]),r.default.minuteRange(e[1]),r.default.hourRange(e[2]),r.default.dayOfMonthRange(e[3]),r.default.monthRange(e[4],this.monthStartIndexZero),r.default.dayOfWeekRange(e[5],this.dayOfWeekStartIndexZero)},e.prototype.validateOnlyExpectedCharactersFound=function(e,t){var n=e.match(RegExp(`[^${t}]+`,`gi`));if(n&&n.length)throw Error(`Expression contains invalid values: '${n.toString()}'`)},e}()},8333(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionDescriptor=void 0;var r=n(1823),i=n(6949);t.ExpressionDescriptor=function(){function e(t,n){if(this.expression=t,this.options=n,this.expressionParts=[,,,,,],!this.options.locale&&e.defaultLocale&&(this.options.locale=e.defaultLocale),!e.locales[this.options.locale]){var r=Object.keys(e.locales)[0];console.warn(`Locale '${this.options.locale}' could not be found; falling back to '${r}'.`),this.options.locale=r}this.i18n=e.locales[this.options.locale],n.use24HourTimeFormat===void 0&&(n.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return e.toString=function(t,n){var r=n===void 0?{}:n,i=r.throwExceptionOnParseError,a=i===void 0||i,o=r.verbose,s=o!==void 0&&o,c=r.dayOfWeekStartIndexZero,l=c===void 0||c,u=r.monthStartIndexZero,d=u!==void 0&&u,f=r.use24HourTimeFormat,p=r.trimHoursLeadingZero,m=p!==void 0&&p,h=r.locale,g=h===void 0?null:h,_=r.logicalAndDayFields,v={throwExceptionOnParseError:a,verbose:s,dayOfWeekStartIndexZero:l,monthStartIndexZero:d,use24HourTimeFormat:f,trimHoursLeadingZero:m,locale:g,logicalAndDayFields:_!==void 0&&_};return v.tzOffset&&console.warn(`'tzOffset' option has been deprecated and is no longer supported.`),new e(t,v).getFullDescription()},e.initialize=function(t,n){n===void 0&&(n=`en`),e.specialCharacters=[`/`,`-`,`,`,`*`],e.defaultLocale=n,t.load(e.locales)},e.prototype.getFullDescription=function(){var e,t=``;try{var n=new i.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=n.parse(),this.expressionParts[0]===`@reboot`)return(e=this.i18n).atReboot?.call(e)||`Run once, at startup`;var r=this.getTimeOfDayDescription(),a=this.getDayOfMonthDescription(),o=this.getMonthDescription(),s=this.getDayOfWeekDescription(),c=this.getYearDescription();t+=r+a+s+o+c,t=this.transformVerbosity(t,!!this.options.verbose),t=t.charAt(0).toLocaleUpperCase()+t.substr(1)}catch(e){if(!this.options.throwExceptionOnParseError)t=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw`${e}`}return t},e.prototype.getTimeOfDayDescription=function(){var t=this.expressionParts[0],n=this.expressionParts[1],i=this.expressionParts[2],a=``;if(!r.StringUtilities.containsAny(n,e.specialCharacters)&&!r.StringUtilities.containsAny(i,e.specialCharacters)&&!r.StringUtilities.containsAny(t,e.specialCharacters))a+=this.i18n.atSpace()+this.formatTime(i,n,t);else if(!t&&n.indexOf(`-`)>-1&&!(n.indexOf(`,`)>-1)&&!(n.indexOf(`/`)>-1)&&!r.StringUtilities.containsAny(i,e.specialCharacters)){var o=n.split(`-`);a+=r.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(i,o[0],``),this.formatTime(i,o[1],``))}else if(!t&&i.indexOf(`,`)>-1&&i.indexOf(`-`)==-1&&i.indexOf(`/`)==-1&&!r.StringUtilities.containsAny(n,e.specialCharacters)){var s=i.split(`,`);a+=this.i18n.at();for(var c=0;c<s.length;c++)a&&(a+=` `),a+=this.formatTime(s[c],n,``),c<s.length-2&&(a+=`,`),c==s.length-2&&(a+=this.i18n.spaceAnd())}else{var l=this.getSecondsDescription(),u=this.getMinutesDescription(),d=this.getHoursDescription();if(a+=l,a&&u&&(a+=`, `),a+=u,u===d)return a;a&&d&&(a+=`, `),a+=d}return a},e.prototype.getSecondsDescription=function(){var e=this;return this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(e){return e},function(t){return r.StringUtilities.format(e.i18n.everyX0Seconds(t),t)},function(t){return e.i18n.secondsX0ThroughX1PastTheMinute()},function(t){return t==`0`?``:parseInt(t)<20?e.i18n.atX0SecondsPastTheMinute(t):e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute(t)},{min:0,max:59})},e.prototype.getMinutesDescription=function(){var e=this,t=this.expressionParts[0],n=this.expressionParts[2];return this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(e){return e},function(t){return r.StringUtilities.format(e.i18n.everyX0Minutes(t),t)},function(t){return e.i18n.minutesX0ThroughX1PastTheHour()},function(r){var i;try{return r==`0`&&n.indexOf(`/`)==-1&&t==``?e.i18n.everyHour():r==`0`?(i=e.i18n).onTheHour?.call(i)||e.i18n.atX0MinutesPastTheHour(r):parseInt(r)<20?e.i18n.atX0MinutesPastTheHour(r):e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour(r)}catch{return e.i18n.atX0MinutesPastTheHour(r)}},{min:0,max:59})},e.prototype.getHoursDescription=function(){var e=this,t=this.expressionParts[2],n=0,i=[];t.split(`/`)[0].split(`,`).forEach(function(e){var t=e.split(`-`);t.length===2&&i.push({value:t[1],index:n+1}),n+=t.length});var a=0;return this.getSegmentDescription(t,this.i18n.everyHour(),function(t){var n=i.find(function(e){return e.value===t&&e.index===a})&&e.expressionParts[1]!==`0`;return a++,n?e.formatTime(t,`59`,``):e.formatTime(t,`0`,``)},function(t){return r.StringUtilities.format(e.i18n.everyX0Hours(t),t)},function(t){return e.i18n.betweenX0AndX1()},function(t){return e.i18n.atX0()},{min:0,max:23})},e.prototype.getDayOfWeekDescription=function(){var e=this,t=this.i18n.daysOfTheWeek(),n=null;return n=this.expressionParts[5]==`*`?``:this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(n,r){var i=n;n.indexOf(`#`)>-1?i=n.substring(0,n.indexOf(`#`)):n.indexOf(`L`)>-1&&(i=i.replace(`L`,``));var a=parseInt(i),o=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(r)[a]:t[a];if(n.indexOf(`#`)>-1){var s=null,c=n.substring(n.indexOf(`#`)+1),l=n.substring(0,n.indexOf(`#`));switch(c){case`1`:s=e.i18n.first(l);break;case`2`:s=e.i18n.second(l);break;case`3`:s=e.i18n.third(l);break;case`4`:s=e.i18n.fourth(l);break;case`5`:s=e.i18n.fifth(l)}o=s+` `+o}return o},function(t){return parseInt(t)==1?``:r.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(t),t)},function(t){var n=t.substring(0,t.indexOf(`-`));return e.expressionParts[3]==`*`?e.i18n.commaX0ThroughX1(n):e.i18n.commaAndX0ThroughX1(n)},function(t){var n=null;if(t.indexOf(`#`)>-1){var r=t.substring(t.indexOf(`#`)+1),i=t.substring(0,t.indexOf(`#`));n=e.i18n.commaOnThe(r,i).trim()+e.i18n.spaceX0OfTheMonth()}else n=t.indexOf(`L`)>-1?e.i18n.commaOnTheLastX0OfTheMonth(t.replace(`L`,``)):e.expressionParts[3]==`*`||e.options.logicalAndDayFields?e.i18n.commaOnlyOnX0(t):e.i18n.commaAndOnX0();return n}),n},e.prototype.getMonthDescription=function(){var e=this,t=this.i18n.monthsOfTheYear();return this.getSegmentDescription(this.expressionParts[4],``,function(n,r){return r&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(r)[parseInt(n)-1]:t[parseInt(n)-1]},function(t){return parseInt(t)==1?``:r.StringUtilities.format(e.i18n.commaEveryX0Months(t),t)},function(t){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(t){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()})},e.prototype.getDayOfMonthDescription=function(){var e=this,t,n,i=null,a=this.expressionParts[3];switch(a){case`L`:i=this.i18n.commaOnTheLastDayOfTheMonth();break;case`WL`:case`LW`:i=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var o=a.match(/^(?:(\d{1,2})W|W(\d{1,2}))(?:([+-])(\d{1,2}))?$/);if(o){var s=parseInt(o[1]||o[2]),c=s==1?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),s.toString()),l=o[4];i=l?o[3]==`-`?r.StringUtilities.format((t=this.i18n).commaDaysBeforeTheX0OfTheMonth?.call(t,l)||`, %s days before the %s of the month`,l,c):r.StringUtilities.format((n=this.i18n).commaDaysAfterTheX0OfTheMonth?.call(n,l)||`, %s days after the %s of the month`,l,c):r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),c);break}var u=a.match(/L-(\d{1,2})/);if(u){var d=u[1];i=r.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(d),d);break}if(a==`*`&&this.expressionParts[5]!=`*`)return``;i=this.getSegmentDescription(a,this.i18n.commaEveryDay(),function(t){return t==`L`?e.i18n.lastDay():e.i18n.dayX0?r.StringUtilities.format(e.i18n.dayX0(),t):t},function(t){return t==`1`?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(t)},function(t){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(t)},function(t){return e.i18n.commaOnDayX0OfTheMonth(t)})}return i},e.prototype.getYearDescription=function(){var e=this;return this.getSegmentDescription(this.expressionParts[6],``,function(e){return/^\d+$/.test(e)?new Date(parseInt(e),1).getFullYear().toString():e},function(t){return r.StringUtilities.format(e.i18n.commaEveryX0Years(t),t)},function(t){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(t){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()})},e.prototype.getSegmentDescription=function(e,t,n,i,a,o,s){var c=null,l=e.indexOf(`/`)>-1,u=e.indexOf(`-`)>-1,d=e.indexOf(`,`)>-1;if(!e)c=``;else if(e===`*`)c=t;else if(!l&&!u&&!d)c=r.StringUtilities.format(o(e),n(e));else if(d){for(var f=e.split(`,`),p=``,m=this.i18n.spaceAnd(),h=0;h<f.length;h++)if(h>0&&f.length>2&&(p+=`,`,h<f.length-1&&(p+=` `)),h>0&&f.length>1&&(h==f.length-1||f.length==2)&&(p+=m==`,`&&f.length>2?` `:`${m} `),f[h].indexOf(`/`)>-1||f[h].indexOf(`-`)>-1){var g=f[h].indexOf(`-`)>-1&&f[h].indexOf(`/`)==-1,_=this.getSegmentDescription(f[h],t,n,i,g?this.i18n.commaX0ThroughX1:a,o);g?_=_.replace(`, `,``):h>0&&_.startsWith(`, `)&&(_=_.substring(2)),p+=_}else if(!l)p+=n(f[h]);else{var v=this.getSegmentDescription(f[h],t,n,i,a,o);h>0&&v&&v.startsWith(`, `)&&(v=v.substring(2)),p+=v}c=l?p:r.StringUtilities.format(o(e),p)}else if(l){var f=e.split(`/`);if(c=r.StringUtilities.format(i(f[1]),f[1]),f[0].indexOf(`-`)>-1){var y=this.generateRangeSegmentDescription(f[0],a,n);y.indexOf(`, `)!=0&&(c+=`, `),c+=y}else if(f[0].indexOf(`*`)==-1){var b=r.StringUtilities.format(o(f[0]),n(f[0]));b=b.replace(`, `,``),c+=r.StringUtilities.format(this.i18n.commaStartingX0(),b)}c+=this.getWrappingIncrementDescription(e,s,t,n,i,a,o)}else u&&(c=this.generateRangeSegmentDescription(e,a,n));return c},e.prototype.getWrappingIncrementDescription=function(e,t,n,r,i,a,o){if(!this.options.verbose||!t)return``;var s=e.split(`/`),c=s[0],l=s[1],u=parseInt(l),d=t.max-t.min+1,f=c===`*`,p=Number.isInteger(u)&&u>1,m=p&&d%u===0;if(!f||!p||m)return``;for(var h=[],g=t.min;g<=t.max;g+=u)h.push(g);if(h.length<2)return``;var _=this.getSegmentDescription(h.join(`,`),n,r,i,a,o);return _?`, ${_}`:``},e.prototype.generateRangeSegmentDescription=function(e,t,n){var i=``,a=e.split(`-`),o=n(a[0],1),s=n(a[1],2),c=t(e);return i+=r.StringUtilities.format(c,o,s),i},e.prototype.formatTime=function(e,t,n){var r=0,i=0,a=parseInt(e)+r,o=parseInt(t)+i;o>=60?(o-=60,a+=1):o<0&&(o+=60,--a),a>=24?a-=24:a<0&&(a=24+a);var s=``,c=!1;this.options.use24HourTimeFormat||(c=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),s=c?`${this.getPeriod(a)} `:` ${this.getPeriod(a)}`,a>12&&(a-=12),a===0&&(a=12));var l=``;n&&(l=`:${(`00`+n).substring(n.length)}`);var u=a.toString(),d=(`00`+u).substring(u.length),f=o.toString(),p=(`00`+f).substring(f.length),m=this.options.trimHoursLeadingZero?u:d;return`${c?s:``}${m}:${p}${l}${c?``:s}`},e.prototype.transformVerbosity=function(e,t){if(!t&&(e=e.replace(RegExp(`, ${this.i18n.everyMinute()}`,`g`),``),e=e.replace(RegExp(`, ${this.i18n.everyHour()}`,`g`),``),e=e.replace(new RegExp(this.i18n.commaEveryDay(),`g`),``),e=e.replace(/\, ?$/,``),this.i18n.conciseVerbosityReplacements))for(var n=0,r=Object.entries(this.i18n.conciseVerbosityReplacements());n<r.length;n++){var i=r[n],a=i[0],o=i[1];e=e.replace(new RegExp(a,`g`),o)}return e},e.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||`PM`:this.i18n.am&&this.i18n.am()||`AM`},e.locales={},e}()},3747(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.enLocaleLoader=void 0;var r=n(9486);t.enLocaleLoader=function(){function e(){}return e.prototype.load=function(e){e.en=new r.en},e}()},9486(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.en=void 0;var n=function(e){return Number(e)===1};t.en=function(){function e(){}return e.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},e.prototype.atX0MinutesPastTheHourGt20=function(){return null},e.prototype.commaMonthX0ThroughMonthX1=function(){return null},e.prototype.commaYearX0ThroughYearX1=function(){return null},e.prototype.use24HourTimeFormatByDefault=function(){return!1},e.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return`An error occurred when generating the expression description. Check the cron expression syntax.`},e.prototype.everyMinute=function(){return`every minute`},e.prototype.everyHour=function(){return`every hour`},e.prototype.atSpace=function(){return`At `},e.prototype.everyMinuteBetweenX0AndX1=function(){return`Every minute between %s and %s`},e.prototype.at=function(){return`At`},e.prototype.spaceAnd=function(){return` and`},e.prototype.everySecond=function(){return`every second`},e.prototype.everyX0Seconds=function(e){return n(e)?`every %s second`:`every %s seconds`},e.prototype.secondsX0ThroughX1PastTheMinute=function(){return`seconds %s through %s past the minute`},e.prototype.atX0SecondsPastTheMinute=function(e){return n(e)?`at %s second past the minute`:`at %s seconds past the minute`},e.prototype.everyX0Minutes=function(e){return n(e)?`every %s minute`:`every %s minutes`},e.prototype.minutesX0ThroughX1PastTheHour=function(){return`minutes %s through %s past the hour`},e.prototype.atX0MinutesPastTheHour=function(e){return n(e)?`at %s minute past the hour`:`at %s minutes past the hour`},e.prototype.everyX0Hours=function(e){return n(e)?`every %s hour`:`every %s hours`},e.prototype.betweenX0AndX1=function(){return`between %s and %s`},e.prototype.atX0=function(){return`at %s`},e.prototype.commaEveryDay=function(){return`, every day`},e.prototype.commaEveryX0DaysOfTheWeek=function(){return`, every %s days of the week`},e.prototype.commaX0ThroughX1=function(){return`, %s through %s`},e.prototype.commaAndX0ThroughX1=function(){return`, %s through %s`},e.prototype.first=function(){return`first`},e.prototype.second=function(){return`second`},e.prototype.third=function(){return`third`},e.prototype.fourth=function(){return`fourth`},e.prototype.fifth=function(){return`fifth`},e.prototype.commaOnThe=function(){return`, on the `},e.prototype.spaceX0OfTheMonth=function(){return` %s of the month`},e.prototype.lastDay=function(){return`the last day`},e.prototype.commaOnTheLastX0OfTheMonth=function(){return`, on the last %s of the month`},e.prototype.commaOnlyOnX0=function(){return`, only on %s`},e.prototype.commaAndOnX0=function(){return`, and on %s`},e.prototype.commaEveryX0Months=function(){return`, every %s months`},e.prototype.commaOnlyInX0=function(){return`, only in %s`},e.prototype.commaOnTheLastDayOfTheMonth=function(){return`, on the last day of the month`},e.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return`, on the last weekday of the month`},e.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(e){return n(e)?`, %s day before the last day of the month`:`, %s days before the last day of the month`},e.prototype.firstWeekday=function(){return`first weekday`},e.prototype.weekdayNearestDayX0=function(){return`weekday nearest day %s`},e.prototype.commaOnTheX0OfTheMonth=function(){return`, on the %s of the month`},e.prototype.commaDaysBeforeTheX0OfTheMonth=function(e){return n(e)?`, %s day before the %s of the month`:`, %s days before the %s of the month`},e.prototype.commaDaysAfterTheX0OfTheMonth=function(e){return n(e)?`, %s day after the %s of the month`:`, %s days after the %s of the month`},e.prototype.commaEveryX0Days=function(){return`, every %s days in a month`},e.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return`, between day %s and %s of the month`},e.prototype.commaOnDayX0OfTheMonth=function(){return`, on day %s of the month`},e.prototype.commaEveryHour=function(){return`, every hour`},e.prototype.commaEveryX0Years=function(e){return n(e)?`, every %s year`:`, every %s years`},e.prototype.commaStartingX0=function(){return`, starting %s`},e.prototype.daysOfTheWeek=function(){return[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},e.prototype.monthsOfTheYear=function(){return[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},e.prototype.atReboot=function(){return`Run once, at startup`},e.prototype.onTheHour=function(){return`on the hour`},e}()},9515(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){if(!e)throw Error(t)}function r(e){var t=[];if(!isNaN(parseInt(e,10))){t.push(parseInt(e,10));var n=e.match(/^\d+-(-?\d+)/);n&&t.push(parseInt(n[1],10))}return t}t.default=function(){function e(){}return e.stepRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++){var i=t[r].split(`/`)[1];n(i===void 0||!/^0+$/.test(i),`step value must be greater than 0`)}},e.secondRange=function(e){for(var t=e.split(`,`),i=0;i<t.length;i++)for(var a=0,o=r(t[i]);a<o.length;a++){var s=o[a];n(s>=0&&s<=59,`seconds part must be >= 0 and <= 59`)}},e.minuteRange=function(e){for(var t=e.split(`,`),i=0;i<t.length;i++)for(var a=0,o=r(t[i]);a<o.length;a++){var s=o[a];n(s>=0&&s<=59,`minutes part must be >= 0 and <= 59`)}},e.hourRange=function(e){for(var t=e.split(`,`),i=0;i<t.length;i++)for(var a=0,o=r(t[i]);a<o.length;a++){var s=o[a];n(s>=0&&s<=23,`hours part must be >= 0 and <= 23`)}},e.dayOfMonthRange=function(e){for(var t=e.split(`,`),i=0;i<t.length;i++)for(var a=0,o=r(t[i]);a<o.length;a++){var s=o[a];n(s>=1&&s<=31,`DOM part must be >= 1 and <= 31`)}},e.monthRange=function(e,t){for(var i=e.split(`,`),a=0;a<i.length;a++)for(var o=0,s=r(i[a]);o<s.length;o++){var c=s[o];n(c>=1&&c<=12,t?`month part must be >= 0 and <= 11`:`month part must be >= 1 and <= 12`)}},e.dayOfWeekRange=function(e,t){for(var i=e.split(`,`),a=0;a<i.length;a++){if(i[a].indexOf(`#`)>-1){var o=i[a].substring(i[a].indexOf(`#`)+1);n(/^[1-5]$/.test(o),`DOW nth weekday must be >= 1 and <= 5`)}for(var s=0,c=r(i[a]);s<c.length;s++){var l=c[s];n(l>=0&&l<=6,t?`DOW part must be >= 0 and <= 6`:`DOW part must be >= 1 and <= 7`)}}},e}()},1823(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtilities=void 0,t.StringUtilities=function(){function e(){}return e.format=function(e){var t=[...arguments].slice(1);return e.replace(/%s/g,function(e){return t.shift()})},e.containsAny=function(e,t){return t.some(function(t){return e.indexOf(t)>-1})},e}()}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0;var t=n(8333),i=n(3747);t.ExpressionDescriptor.initialize(new i.enLocaleLoader),e.default=t.ExpressionDescriptor,e.toString=t.ExpressionDescriptor.toString})(),r})())}))();function Pa(e){let t=e.trim();if(t===``||t.startsWith(`@`))return t;let n=t.split(/\s+/);return n.length===7?n.slice(1,6).join(` `):t}function Fa(e){if(e.trim()===``)return[!1,`— enter a cron expression —`];try{return[!0,(0,Na.toString)(Pa(e),{throwExceptionOnParseError:!0})]}catch{return[!1,`Invalid cron expression`]}}function Ia(e){if(e===0)return`—`;let t=Math.floor(Date.now()/1e3),n=Math.max(0,t-e);return n<60?`just now`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}var La=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Ra(e){if(e===0)return`—`;let t=new Date(e*1e3);if(Number.isNaN(t.getTime()))return`—`;let n=String(t.getDate()).padStart(2,`0`),r=`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`;return`${La[t.getMonth()]} ${n}, ${t.getFullYear()} ${r}`}function za({entries:e,onMarkAllRead:t,onClear:n}){let[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=Ca(e);return(0,_.useEffect)(()=>{if(!r)return;let e=e=>{a.current&&!a.current.contains(e.target)&&i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,z.jsxs)(`div`,{className:`notif-root`,ref:a,children:[(0,z.jsxs)(`button`,{type:`button`,className:`icon-btn notif-bell`,title:o>0?`${o} unread notification${o===1?``:`s`}`:`Notifications`,"aria-label":o>0?`${o} unread notification${o===1?``:`s`}`:`Notifications`,"aria-haspopup":`true`,"aria-expanded":r,onClick:()=>i(e=>!e),children:[`🔔`,o>0&&(0,z.jsx)(`span`,{className:`notif-badge`,children:o>99?`99+`:o})]}),r&&(0,z.jsxs)(`div`,{className:`notif-panel`,role:`menu`,children:[(0,z.jsxs)(`div`,{className:`notif-panel-hd`,children:[(0,z.jsx)(`span`,{className:`notif-panel-title`,children:`NOTIFICATIONS`}),(0,z.jsxs)(`div`,{className:`notif-panel-acts`,children:[o>0&&(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:t,children:`MARK READ`}),e.length>0&&(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`CLEAR`})]})]}),e.length===0?(0,z.jsx)(`div`,{className:`notif-empty`,children:`No notifications yet`}):(0,z.jsx)(`ul`,{className:`notif-list`,children:e.map(e=>(0,z.jsx)(`li`,{className:e.read?`notif-item`:`notif-item unread`,children:(0,z.jsxs)(En,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,onClick:()=>i(!1),children:[(0,z.jsx)(`span`,{className:`notif-item-title`,children:e.routineTitle}),(0,z.jsx)(`span`,{className:`notif-item-msg`,children:e.message}),(0,z.jsx)(`span`,{className:`notif-item-time`,children:Ia(e.atSecs)})]})},e.id))})]})]})}function Ba(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`}function Va(e){let{health:t}=e,n=t?.status.toUpperCase()??`UNKNOWN`,r=t?.version?`/ v${t.version}`:``,i=t?.git_sha&&t.git_sha!==`unknown`?`build: ${t.git_sha}`:void 0,a=t?.uptime_secs!==void 0&&t.uptime_secs!==null?`/ UP ${Ba(t.uptime_secs)}`:``,o=t?.dependencies?!t.dependencies.tmux:!1,s=t?.dependencies?!t.dependencies.python3:!1,c=t?.crontab_sync?!t.crontab_sync.ok:!1,l=t?.crontab_sync?.last_error?`OS crontab sync failed: ${t.crontab_sync.last_error}`:`OS crontab sync failed — scheduled routine changes may not be installed`;return(0,z.jsxs)(`header`,{className:`app-header`,children:[(0,z.jsxs)(`span`,{className:`brand`,children:[`MOADIM`,(0,z.jsx)(`span`,{className:`brand-sub`,children:`/ control`}),r&&(0,z.jsx)(`span`,{className:`brand-sub`,title:i,children:r})]}),(0,z.jsx)(`div`,{className:`header-spacer`}),(0,z.jsxs)(`div`,{className:`header-right`,children:[o&&(0,z.jsx)(`span`,{className:`dep-warn`,title:`tmux is not on the daemon's PATH — all routine runs will silently fail`,children:`⚠ NO TMUX`}),s&&(0,z.jsx)(`span`,{className:`dep-warn`,title:`python3 is not on the daemon's PATH — the claude agent setup step will fail silently`,children:`⚠ NO PYTHON3`}),c&&(0,z.jsx)(`span`,{className:`dep-warn`,title:l,children:`⚠ CRON STALE`}),(0,z.jsxs)(`div`,{className:`health`,children:[(0,z.jsx)(`div`,{className:`health-dot ${e.healthOk?`ok`:`error`}`}),(0,z.jsx)(`span`,{children:n}),(0,z.jsx)(`span`,{children:a})]}),e.machineName&&(0,z.jsx)(`button`,{className:`machine-badge`,title:`Click to rename this machine`,onClick:e.onRenameMachine,children:e.machineName}),(0,z.jsx)(za,{...e.notifications}),(0,z.jsx)(`button`,{className:`icon-btn`,title:`Command palette (⌘K)`,onClick:e.onPalette,children:`⌘K`}),(0,z.jsx)(`button`,{className:`icon-btn`,title:`Keyboard shortcuts (?)`,onClick:e.onShortcuts,children:`?`}),(0,z.jsx)(`button`,{className:`icon-btn`,title:`Refresh`,onClick:e.onRefresh,children:`↻`}),(0,z.jsx)(`button`,{className:`icon-btn danger`,title:`Stop the server`,disabled:!e.healthOk,onClick:e.onStop,children:`⏻ Stop`})]})]})}var Ha=[{to:`/`,label:`Overview`,end:!0},{to:`/routines`,label:`Routines`,end:!1},{to:`/runs`,label:`Runs`,end:!1},{to:`/heatmap`,label:`Heatmap`,end:!1},{to:`/reliability`,label:`Reliability`,end:!1},{to:`/machines`,label:`Machines`,end:!1},{to:`/agents`,label:`Agents`,end:!1},{to:`/settings`,label:`Settings`,end:!1}];function Ua(){return(0,z.jsx)(`nav`,{className:`app-nav`,children:Ha.map(e=>(0,z.jsx)(Dn,{to:e.to,end:e.end,className:({isActive:e})=>`nav-link${e?` active`:``}`,children:e.label},e.to))})}var Wa=(0,_.createContext)(null);function Ga({children:e}){let[t,n]=(0,_.useState)([]),r=(0,_.useRef)(0),i=(0,_.useCallback)((e,t)=>{let i=r.current++;n(n=>[...n,{id:i,msg:e,kind:t}]),setTimeout(()=>n(e=>e.filter(e=>e.id!==i)),5e3)},[]);return(0,z.jsx)(Wa.Provider,{value:{toasts:t,addToast:i},children:e})}function Ka(){let e=(0,_.useContext)(Wa);if(!e)throw Error(`useToasts must be used within a ToastProvider`);return e}var qa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Ja=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronField=void 0,e.CronField=class e{#e=!1;#t=!1;#n=!1;#r=[];options={rawValue:``};static get min(){throw Error(`min must be overridden`)}static get max(){throw Error(`max must be overridden`)}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,n={rawValue:``}){if(!Array.isArray(t))throw Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...n,rawValue:n.rawValue??``},this.#r=[...t].sort(e.sorter),this.#n=this.options.wildcard===void 0?this.#i():this.options.wildcard,this.#e=this.options.rawValue.includes(`L`)||t.includes(`L`),this.#t=this.options.rawValue.includes(`?`)||t.includes(`?`)}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?e-t:!n&&!r?e.localeCompare(t):n?-1:1}static findNearestValueInList(e,t,n){if(n){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null}for(let n=0;n<e.length;n++)if(e[n]>t)return e[n];return null}findNearestValue(e,t){return this.constructor.findNearestValueInList(this.values,e,t)}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let e,t=this.chars.length>0?` or chars ${this.chars.join(``)}`:``,n=e=>t=>RegExp(`^\\d{0,2}${t}$`).test(e);if(!this.#r.every(t=>(e=t,typeof t==`number`?t>=this.min&&t<=this.max:this.chars.some(n(t)))))throw Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${t}`);let r=this.#r.find((e,t)=>this.#r.indexOf(e)!==t);if(r!==void 0)throw Error(`${this.constructor.name} Validation error, duplicate values found: ${r}`)}#i(){return this.options.rawValue.length>0?[`*`,`?`].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,t)=>t+this.min).every(e=>this.#r.includes(e))}}})),Ya=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{},n=class extends t{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},r=class extends t{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},i=class extends t{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},a=class extends t{},o=class extends t{constructor(e){super(`Invalid unit ${e}`)}},s=class extends t{},c=class extends t{constructor(){super(`Zone is an abstract class`)}},l=`numeric`,u=`short`,d=`long`,f={year:l,month:l,day:l},p={year:l,month:u,day:l},m={year:l,month:u,day:l,weekday:u},h={year:l,month:d,day:l},g={year:l,month:d,day:l,weekday:d},_={hour:l,minute:l},v={hour:l,minute:l,second:l},y={hour:l,minute:l,second:l,timeZoneName:u},b={hour:l,minute:l,second:l,timeZoneName:d},x={hour:l,minute:l,hourCycle:`h23`},S={hour:l,minute:l,second:l,hourCycle:`h23`},C={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:u},w={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:d},T={year:l,month:l,day:l,hour:l,minute:l},E={year:l,month:l,day:l,hour:l,minute:l,second:l},D={year:l,month:u,day:l,hour:l,minute:l},O={year:l,month:u,day:l,hour:l,minute:l,second:l},k={year:l,month:u,day:l,weekday:u,hour:l,minute:l},A={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},ee={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},te={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},ne={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d},j=class{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}},re=null,ie=class e extends j{static get instance(){return re===null&&(re=new e),re}get type(){return`system`}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Bt(e,t,n)}formatOffset(e,t){return Wt(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type===`system`}get isValid(){return!0}},ae=new Map;function oe(e){let t=ae.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,era:`short`}),ae.set(e,t)),t}var se={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ce(e,t){let n=e.format(t).replace(/\u200E/g,``),[,r,i,a,o,s,c,l]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n);return[a,r,i,o,s,c,l]}function le(e,t){let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let{type:t,value:i}=n[e],a=se[t];t===`era`?r[a]=i:L(a)||(r[a]=parseInt(i,10))}return r}var ue=new Map,de=class e extends j{static create(t){let n=ue.get(t);return n===void 0&&ue.set(t,n=new e(t)),n}static resetCache(){ue.clear(),ae.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=e.isValidZone(t)}get type(){return`iana`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Bt(e,t,n,this.name)}formatOffset(e,t){return Wt(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let n=oe(this.name),[r,i,a,o,s,c,l]=n.formatToParts?le(n,t):ce(n,t);o===`BC`&&(r=-Math.abs(r)+1);let u=It({year:r,month:i,day:a,hour:s===24?0:s,minute:c,second:l,millisecond:0}),d=+t,f=d%1e3;return d-=f>=0?f:1e3+f,(u-d)/6e4}equals(e){return e.type===`iana`&&e.name===this.name}get isValid(){return this.valid}},fe={};function pe(e,t={}){let n=JSON.stringify([e,t]),r=fe[n];return r||(r=new Intl.ListFormat(e,t),fe[n]=r),r}var me=new Map;function he(e,t={}){let n=JSON.stringify([e,t]),r=me.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),me.set(n,r)),r}var ge=new Map;function _e(e,t={}){let n=JSON.stringify([e,t]),r=ge.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),ge.set(n,r)),r}var ve=new Map;function M(e,t={}){let{base:n,...r}=t,i=JSON.stringify([e,r]),a=ve.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),ve.set(i,a)),a}var N=null;function ye(){return N||(N=new Intl.DateTimeFormat().resolvedOptions().locale,N)}var be=new Map;function xe(e){let t=be.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),be.set(e,t)),t}var Se=new Map;function Ce(e){let t=Se.get(e);if(!t){let n=new Intl.Locale(e);t=`getWeekInfo`in n?n.getWeekInfo():n.weekInfo,`minimalDays`in t||(t={...Ne,...t}),Se.set(e,t)}return t}function we(e){let t=e.indexOf(`-x-`);t!==-1&&(e=e.substring(0,t));let n=e.indexOf(`-u-`);if(n===-1)return[e];{let t,r;try{t=he(e).resolvedOptions(),r=e}catch{let i=e.substring(0,n);t=he(i).resolvedOptions(),r=i}let{numberingSystem:i,calendar:a}=t;return[r,i,a]}}function Te(e,t,n){return(n||t)&&(e.includes(`-u-`)||(e+=`-u`),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Ee(e){let t=[];for(let n=1;n<=12;n++){let r=Oi.utc(2009,n,1);t.push(e(r))}return t}function De(e){let t=[];for(let n=1;n<=7;n++){let r=Oi.utc(2016,11,13+n);t.push(e(r))}return t}function Oe(e,t,n,r){let i=e.listingMode();return i===`error`?null:i===`en`?n(t):r(t)}function ke(e){return e.numberingSystem&&e.numberingSystem!==`latn`?!1:e.numberingSystem===`latn`||!e.locale||e.locale.startsWith(`en`)||xe(e.locale).numberingSystem===`latn`}var Ae=class{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){let t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=_e(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Ot(this.floor?Math.floor(e):Mt(e,3),this.padTo)}},je=class{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type===`fixed`){let t=-1*(e.offset/60),n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;e.offset!==0&&de.create(n).valid?(r=n,this.dt=e):(r=`UTC`,this.dt=e.offset===0?e:e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type===`system`?this.dt=e:e.zone.type===`iana`?(this.dt=e,r=e.zone.name):(r=`UTC`,this.dt=e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=he(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(``):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if(e.type===`timeZoneName`){let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},Me=class{constructor(e,t,n){this.opts={style:`long`,...n},!t&&yt()&&(this.rtf=M(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):ln(t,e,this.opts.numeric,this.opts.style!==`long`)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},Ne={firstDay:1,minimalDays:4,weekend:[6,7]},P=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,a=!1){let o=t||F.defaultLocale,s=o||(a?`en-US`:ye()),c=n||F.defaultNumberingSystem,l=r||F.defaultOutputCalendar,u=Tt(i)||F.defaultWeekSettings;return new e(s,c,l,u,o)}static resetCache(){N=null,me.clear(),ge.clear(),ve.clear(),be.clear(),Se.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return e.create(t,n,r,i)}constructor(e,t,n,r,i){let[a,o,s]=we(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=Te(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached??=ke(this),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem===`latn`)&&(this.outputCalendar===null||this.outputCalendar===`gregory`);return e&&t?`en`:`intl`}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Tt(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Oe(this,e,Jt,()=>{let n=this.intl===`ja`||this.intl.startsWith(`ja-`);t&=!n;let r=t?{month:e,day:`numeric`}:{month:e},i=t?`format`:`standalone`;if(!this.monthsCache[i][e]){let t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,`month`);this.monthsCache[i][e]=Ee(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return Oe(this,e,Qt,()=>{let n=t?{weekday:e,year:`numeric`,month:`long`,day:`numeric`}:{weekday:e},r=t?`format`:`standalone`;return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=De(e=>this.extract(e,n,`weekday`))),this.weekdaysCache[r][e]})}meridiems(){return Oe(this,void 0,()=>$t,()=>{if(!this.meridiemCache){let e={hour:`numeric`,hourCycle:`h12`};this.meridiemCache=[Oi.utc(2016,11,13,9),Oi.utc(2016,11,13,19)].map(t=>this.extract(t,e,`dayperiod`))}return this.meridiemCache})}eras(e){return Oe(this,e,rn,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Oi.utc(-40,1,1),Oi.utc(2017,1,1)].map(e=>this.extract(e,t,`era`))),this.eraCache[e]})}extract(e,t,n){let r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new Ae(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new je(e,this.intl,t)}relFormatter(e={}){return new Me(this.intl,this.isEnglish(),e)}listFormatter(e={}){return pe(this.intl,e)}isEnglish(){return this.locale===`en`||this.locale.toLowerCase()===`en-us`||xe(this.intl).locale.startsWith(`en-us`)}getWeekSettings(){return this.weekSettings?this.weekSettings:bt()?Ce(this.locale):Ne}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Pe=null,Fe=class e extends j{static get utcInstance(){return Pe===null&&(Pe=new e(0)),Pe}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new e(Vt(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return`fixed`}get name(){return this.fixed===0?`UTC`:`UTC${Wt(this.fixed,`narrow`)}`}get ianaName(){return this.fixed===0?`Etc/UTC`:`Etc/GMT${Wt(-this.fixed,`narrow`)}`}offsetName(){return this.name}formatOffset(e,t){return Wt(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type===`fixed`&&e.fixed===this.fixed}get isValid(){return!0}},Ie=class extends j{constructor(e){super(),this.zoneName=e}get type(){return`invalid`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return``}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Le(e,t){if(L(e)||e===null)return t;if(e instanceof j)return e;if(_t(e)){let n=e.toLowerCase();return n==="default"?t:n===`local`||n===`system`?ie.instance:n===`utc`||n===`gmt`?Fe.utcInstance:Fe.parseSpecifier(n)||de.create(e)}return ht(e)?Fe.instance(e):typeof e==`object`&&`offset`in e&&typeof e.offset==`function`?e:new Ie(e)}var Re={arab:`[٠-٩]`,arabext:`[۰-۹]`,bali:`[᭐-᭙]`,beng:`[০-৯]`,deva:`[०-९]`,fullwide:`[0-9]`,gujr:`[૦-૯]`,hanidec:`[〇|一|二|三|四|五|六|七|八|九]`,khmr:`[០-៩]`,knda:`[೦-೯]`,laoo:`[໐-໙]`,limb:`[᥆-᥏]`,mlym:`[൦-൯]`,mong:`[᠐-᠙]`,mymr:`[၀-၉]`,orya:`[୦-୯]`,tamldec:`[௦-௯]`,telu:`[౦-౯]`,thai:`[๐-๙]`,tibt:`[༠-༩]`,latn:`\\d`},ze={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Be=Re.hanidec.replace(/[\[|\]]/g,``).split(``);function Ve(e){let t=parseInt(e,10);if(isNaN(t)){t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(e[n].search(Re.hanidec)!==-1)t+=Be.indexOf(e[n]);else for(let e in ze){let[n,i]=ze[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}return t}var He=new Map;function Ue(){He.clear()}function We({numberingSystem:e},t=``){let n=e||`latn`,r=He.get(n);r===void 0&&(r=new Map,He.set(n,r));let i=r.get(t);return i===void 0&&(i=RegExp(`${Re[n]}${t}`),r.set(t,i)),i}var Ge=()=>Date.now(),Ke=`system`,qe=null,Je=null,Ye=null,Xe=60,Ze,Qe=null,F=class{static get now(){return Ge}static set now(e){Ge=e}static set defaultZone(e){Ke=e}static get defaultZone(){return Le(Ke,ie.instance)}static get defaultLocale(){return qe}static set defaultLocale(e){qe=e}static get defaultNumberingSystem(){return Je}static set defaultNumberingSystem(e){Je=e}static get defaultOutputCalendar(){return Ye}static set defaultOutputCalendar(e){Ye=e}static get defaultWeekSettings(){return Qe}static set defaultWeekSettings(e){Qe=Tt(e)}static get twoDigitCutoffYear(){return Xe}static set twoDigitCutoffYear(e){Xe=e%100}static get throwOnInvalid(){return Ze}static set throwOnInvalid(e){Ze=e}static resetCaches(){P.resetCache(),de.resetCache(),Oi.resetCache(),Ue()}},I=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},$e=[0,31,59,90,120,151,181,212,243,273,304,334],et=[0,31,60,91,121,152,182,213,244,274,305,335];function tt(e,t){return new I(`unit out of range`,`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function nt(e,t,n){let r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function rt(e,t,n){return n+(Nt(e)?et:$e)[t-1]}function it(e,t){let n=Nt(e)?et:$e,r=n.findIndex(e=>e<t),i=t-n[r];return{month:r+1,day:i}}function at(e,t){return(e-t+7)%7+1}function ot(e,t=4,n=1){let{year:r,month:i,day:a}=e,o=rt(r,i,a),s=at(nt(r,i,a),n),c=Math.floor((o-s+14-t)/7),l;return c<1?(l=r-1,c=Rt(l,t,n)):c>Rt(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...Gt(e)}}function st(e,t=4,n=1){let{weekYear:r,weekNumber:i,weekday:a}=e,o=at(nt(r,1,t),n),s=Pt(r),c=i*7+a-o-7+t,l;c<1?(l=r-1,c+=Pt(l)):c>s?(l=r+1,c-=Pt(r)):l=r;let{month:u,day:d}=it(l,c);return{year:l,month:u,day:d,...Gt(e)}}function ct(e){let{year:t,month:n,day:r}=e;return{year:t,ordinal:rt(t,n,r),...Gt(e)}}function lt(e){let{year:t,ordinal:n}=e,{month:r,day:i}=it(t,n);return{year:t,month:r,day:i,...Gt(e)}}function ut(e,t){if(!L(e.localWeekday)||!L(e.localWeekNumber)||!L(e.localWeekYear)){if(!L(e.weekday)||!L(e.weekNumber)||!L(e.weekYear))throw new a(`Cannot mix locale-based week fields with ISO-based week fields`);return L(e.localWeekday)||(e.weekday=e.localWeekday),L(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),L(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function dt(e,t=4,n=1){let r=gt(e.weekYear),i=Et(e.weekNumber,1,Rt(e.weekYear,t,n)),a=Et(e.weekday,1,7);return r?i?!a&&tt(`weekday`,e.weekday):tt(`week`,e.weekNumber):tt(`weekYear`,e.weekYear)}function ft(e){let t=gt(e.year),n=Et(e.ordinal,1,Pt(e.year));return t?!n&&tt(`ordinal`,e.ordinal):tt(`year`,e.year)}function pt(e){let t=gt(e.year),n=Et(e.month,1,12),r=Et(e.day,1,Ft(e.year,e.month));return t?n?!r&&tt(`day`,e.day):tt(`month`,e.month):tt(`year`,e.year)}function mt(e){let{hour:t,minute:n,second:r,millisecond:i}=e,a=Et(t,0,23)||t===24&&n===0&&r===0&&i===0,o=Et(n,0,59),s=Et(r,0,59),c=Et(i,0,999);return a?o?s?!c&&tt(`millisecond`,i):tt(`second`,r):tt(`minute`,n):tt(`hour`,t)}function L(e){return e===void 0}function ht(e){return typeof e==`number`}function gt(e){return typeof e==`number`&&e%1==0}function _t(e){return typeof e==`string`}function vt(e){return Object.prototype.toString.call(e)===`[object Date]`}function yt(){try{return typeof Intl<`u`&&!!Intl.RelativeTimeFormat}catch{return!1}}function bt(){try{return typeof Intl<`u`&&!!Intl.Locale&&(`weekInfo`in Intl.Locale.prototype||`getWeekInfo`in Intl.Locale.prototype)}catch{return!1}}function xt(e){return Array.isArray(e)?e:[e]}function St(e,t,n){if(e.length!==0)return e.reduce((e,r)=>{let i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function Ct(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function wt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Tt(e){if(e==null)return null;if(typeof e!=`object`)throw new s(`Week settings must be an object`);if(!Et(e.firstDay,1,7)||!Et(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!Et(e,1,7)))throw new s(`Invalid week settings`);return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Et(e,t,n){return gt(e)&&e>=t&&e<=n}function Dt(e,t){return e-t*Math.floor(e/t)}function Ot(e,t=2){let n=e<0,r;return r=n?`-`+(``+-e).padStart(t,`0`):(``+e).padStart(t,`0`),r}function kt(e){if(!(L(e)||e===null||e===``))return parseInt(e,10)}function At(e){if(!(L(e)||e===null||e===``))return parseFloat(e)}function jt(e){if(!(L(e)||e===null||e===``)){let t=parseFloat(`0.`+e)*1e3;return Math.floor(t)}}function Mt(e,t,n=`round`){let r=10**t;switch(n){case`expand`:return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case`trunc`:return Math.trunc(e*r)/r;case`round`:return Math.round(e*r)/r;case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:throw RangeError(`Value rounding ${n} is out of range`)}}function Nt(e){return e%4==0&&(e%100!=0||e%400==0)}function Pt(e){return Nt(e)?366:365}function Ft(e,t){let n=Dt(t-1,12)+1,r=e+(t-n)/12;return n===2?Nt(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function It(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Lt(e,t,n){return-at(nt(e,1,t),n)+t-1}function Rt(e,t=4,n=1){let r=Lt(e,t,n),i=Lt(e+1,t,n);return(Pt(e)-r+i)/7}function zt(e){return e>99?e:e>F.twoDigitCutoffYear?1900+e:2e3+e}function Bt(e,t,n,r=null){let i=new Date(e),a={hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`};r&&(a.timeZone=r);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(e=>e.type.toLowerCase()===`timezonename`);return s?s.value:null}function Vt(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);let r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Ht(e){let t=Number(e);if(typeof e==`boolean`||e===``||!Number.isFinite(t))throw new s(`Invalid unit value ${e}`);return t}function Ut(e,t){let n={};for(let r in e)if(wt(e,r)){let i=e[r];if(i==null)continue;n[t(r)]=Ht(i)}return n}function Wt(e,t){let n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?`+`:`-`;switch(t){case`short`:return`${i}${Ot(n,2)}:${Ot(r,2)}`;case`narrow`:return`${i}${n}${r>0?`:${r}`:``}`;case`techie`:return`${i}${Ot(n,2)}${Ot(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function Gt(e){return Ct(e,[`hour`,`minute`,`second`,`millisecond`])}var Kt=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],R=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],qt=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`];function Jt(e){switch(e){case`narrow`:return[...qt];case`short`:return[...R];case`long`:return[...Kt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`11`,`12`];case`2-digit`:return[`01`,`02`,`03`,`04`,`05`,`06`,`07`,`08`,`09`,`10`,`11`,`12`];default:return null}}var Yt=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],Xt=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Zt=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Qt(e){switch(e){case`narrow`:return[...Zt];case`short`:return[...Xt];case`long`:return[...Yt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`];default:return null}}var $t=[`AM`,`PM`],en=[`Before Christ`,`Anno Domini`],tn=[`BC`,`AD`],nn=[`B`,`A`];function rn(e){switch(e){case`narrow`:return[...nn];case`short`:return[...tn];case`long`:return[...en];default:return null}}function an(e){return $t[e.hour<12?0:1]}function on(e,t){return Qt(t)[e.weekday-1]}function sn(e,t){return Jt(t)[e.month-1]}function cn(e,t){return rn(t)[e.year<0?0:1]}function ln(e,t,n=`always`,r=!1){let i={years:[`year`,`yr.`],quarters:[`quarter`,`qtr.`],months:[`month`,`mo.`],weeks:[`week`,`wk.`],days:[`day`,`day`,`days`],hours:[`hour`,`hr.`],minutes:[`minute`,`min.`],seconds:[`second`,`sec.`]},a=[`hours`,`minutes`,`seconds`].indexOf(e)===-1;if(n===`auto`&&a){let n=e===`days`;switch(t){case 1:return n?`tomorrow`:`next ${i[e][0]}`;case-1:return n?`yesterday`:`last ${i[e][0]}`;case 0:return n?`today`:`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),c=s===1,l=i[e],u=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}function un(e,t){let n=``;for(let r of e)r.literal?n+=r.val:n+=t(r.val);return n}var dn={D:f,DD:p,DDD:h,DDDD:g,t:_,tt:v,ttt:y,tttt:b,T:x,TT:S,TTT:C,TTTT:w,f:T,ff:D,fff:A,ffff:te,F:E,FF:O,FFF:ee,FFFF:ne},fn=class e{static create(t,n={}){return new e(t,n)}static parseFormat(e){let t=null,n=``,r=!1,i=[];for(let a=0;a<e.length;a++){let o=e.charAt(a);o===`'`?((n.length>0||r)&&i.push({literal:r||/^\s+$/.test(n),val:n===``?`'`:n}),t=null,n=``,r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return dn[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return Ot(e,t);let r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(t,n){let r=this.loc.listingMode()===`en`,i=this.loc.outputCalendar&&this.loc.outputCalendar!==`gregory`,a=(e,n)=>this.loc.extract(t,e,n),o=e=>t.isOffsetFixed&&t.offset===0&&e.allowZ?`Z`:t.isValid?t.zone.formatOffset(t.ts,e.format):``,s=()=>r?an(t):a({hour:`numeric`,hourCycle:`h12`},`dayperiod`),c=(e,n)=>r?sn(t,e):a(n?{month:e}:{month:e,day:`numeric`},`month`),l=(e,n)=>r?on(t,e):a(n?{weekday:e}:{weekday:e,month:`long`,day:`numeric`},`weekday`),u=n=>{let r=e.macroTokenToFormatOpts(n);return r?this.formatWithSystemDefault(t,r):n},d=e=>r?cn(t,e):a({era:e},`era`);return un(e.parseFormat(n),e=>{switch(e){case`S`:return this.num(t.millisecond);case`u`:case`SSS`:return this.num(t.millisecond,3);case`s`:return this.num(t.second);case`ss`:return this.num(t.second,2);case`uu`:return this.num(Math.floor(t.millisecond/10),2);case`uuu`:return this.num(Math.floor(t.millisecond/100));case`m`:return this.num(t.minute);case`mm`:return this.num(t.minute,2);case`h`:return this.num(t.hour%12==0?12:t.hour%12);case`hh`:return this.num(t.hour%12==0?12:t.hour%12,2);case`H`:return this.num(t.hour);case`HH`:return this.num(t.hour,2);case`Z`:return o({format:`narrow`,allowZ:this.opts.allowZ});case`ZZ`:return o({format:`short`,allowZ:this.opts.allowZ});case`ZZZ`:return o({format:`techie`,allowZ:this.opts.allowZ});case`ZZZZ`:return t.zone.offsetName(t.ts,{format:`short`,locale:this.loc.locale});case`ZZZZZ`:return t.zone.offsetName(t.ts,{format:`long`,locale:this.loc.locale});case`z`:return t.zoneName;case`a`:return s();case`d`:return i?a({day:`numeric`},`day`):this.num(t.day);case`dd`:return i?a({day:`2-digit`},`day`):this.num(t.day,2);case`c`:return this.num(t.weekday);case`ccc`:return l(`short`,!0);case`cccc`:return l(`long`,!0);case`ccccc`:return l(`narrow`,!0);case`E`:return this.num(t.weekday);case`EEE`:return l(`short`,!1);case`EEEE`:return l(`long`,!1);case`EEEEE`:return l(`narrow`,!1);case`L`:return i?a({month:`numeric`,day:`numeric`},`month`):this.num(t.month);case`LL`:return i?a({month:`2-digit`,day:`numeric`},`month`):this.num(t.month,2);case`LLL`:return c(`short`,!0);case`LLLL`:return c(`long`,!0);case`LLLLL`:return c(`narrow`,!0);case`M`:return i?a({month:`numeric`},`month`):this.num(t.month);case`MM`:return i?a({month:`2-digit`},`month`):this.num(t.month,2);case`MMM`:return c(`short`,!1);case`MMMM`:return c(`long`,!1);case`MMMMM`:return c(`narrow`,!1);case`y`:return i?a({year:`numeric`},`year`):this.num(t.year);case`yy`:return i?a({year:`2-digit`},`year`):this.num(t.year.toString().slice(-2),2);case`yyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,4);case`yyyyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,6);case`G`:return d(`short`);case`GG`:return d(`long`);case`GGGGG`:return d(`narrow`);case`kk`:return this.num(t.weekYear.toString().slice(-2),2);case`kkkk`:return this.num(t.weekYear,4);case`W`:return this.num(t.weekNumber);case`WW`:return this.num(t.weekNumber,2);case`n`:return this.num(t.localWeekNumber);case`nn`:return this.num(t.localWeekNumber,2);case`ii`:return this.num(t.localWeekYear.toString().slice(-2),2);case`iiii`:return this.num(t.localWeekYear,4);case`o`:return this.num(t.ordinal);case`ooo`:return this.num(t.ordinal,3);case`q`:return this.num(t.quarter);case`qq`:return this.num(t.quarter,2);case`X`:return this.num(Math.floor(t.ts/1e3));case`x`:return this.num(t.ts);default:return u(e)}})}formatDurationFromString(t,n){let r=this.opts.signMode===`negativeLargestOnly`?-1:1,i=e=>{switch(e[0]){case`S`:return`milliseconds`;case`s`:return`seconds`;case`m`:return`minutes`;case`h`:return`hours`;case`d`:return`days`;case`w`:return`weeks`;case`M`:return`months`;case`y`:return`years`;default:return null}},a=(e,t)=>n=>{let a=i(n);if(a){let i=t.isNegativeDuration&&a!==t.largestUnit?r:1,o;return o=this.opts.signMode===`negativeLargestOnly`&&a!==t.largestUnit?`never`:this.opts.signMode===`all`?`always`:`auto`,this.num(e.get(a)*i,n.length,o)}return n},o=e.parseFormat(n),s=o.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),c=t.shiftTo(...s.map(i).filter(e=>e));return un(o,a(c,{isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]}))}},pn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function mn(...e){let t=e.reduce((e,t)=>e+t.source,``);return RegExp(`^${t}$`)}function hn(...e){return t=>e.reduce(([e,n,r],i)=>{let[a,o,s]=i(t,r);return[{...e,...a},o||n,s]},[{},null,1]).slice(0,2)}function gn(e,...t){if(e==null)return[null,null];for(let[n,r]of t){let t=n.exec(e);if(t)return r(t)}return[null,null]}function _n(...e){return(t,n)=>{let r={},i=0;for(;i<e.length;i++)r[e[i]]=kt(t[n+i]);return[r,null,n+i]}}var vn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,yn=`(?:${vn.source}?(?:\\[(${pn.source})\\])?)?`,bn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,xn=RegExp(`${bn.source}${yn}`),Sn=RegExp(`(?:[Tt]${xn.source})?`),Cn=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,wn=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Tn=/(\d{4})-?(\d{3})/,En=_n(`weekYear`,`weekNumber`,`weekDay`),Dn=_n(`year`,`ordinal`),On=/(\d{4})-(\d\d)-(\d\d)/,kn=RegExp(`${bn.source} ?(?:${vn.source}|(${pn.source}))?`),An=RegExp(`(?: ${kn.source})?`);function jn(e,t,n){let r=e[t];return L(r)?n:kt(r)}function Mn(e,t){return[{year:jn(e,t),month:jn(e,t+1,1),day:jn(e,t+2,1)},null,t+3]}function Nn(e,t){return[{hours:jn(e,t,0),minutes:jn(e,t+1,0),seconds:jn(e,t+2,0),milliseconds:jt(e[t+3])},null,t+4]}function Pn(e,t){let n=!e[t]&&!e[t+1],r=Vt(e[t+1],e[t+2]);return[{},n?null:Fe.instance(r),t+3]}function Fn(e,t){return[{},e[t]?de.create(e[t]):null,t+1]}var In=RegExp(`^T?${bn.source}$`),Ln=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Rn(e){let[t,n,r,i,a,o,s,c,l]=e,u=t[0]===`-`,d=c&&c[0]===`-`,f=(e,t=!1)=>e!==void 0&&(t||e&&u)?-e:e;return[{years:f(At(n)),months:f(At(r)),weeks:f(At(i)),days:f(At(a)),hours:f(At(o)),minutes:f(At(s)),seconds:f(At(c),c===`-0`),milliseconds:f(jt(l),d)}]}var z={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function zn(e,t,n,r,i,a,o){let s={year:t.length===2?zt(kt(t)):kt(t),month:R.indexOf(n)+1,day:kt(r),hour:kt(i),minute:kt(a)};return o&&(s.second=kt(o)),e&&(s.weekday=e.length>3?Yt.indexOf(e)+1:Xt.indexOf(e)+1),s}var Bn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Vn(e){let[,t,n,r,i,a,o,s,c,l,u,d]=e,f=zn(t,i,r,n,a,o,s),p;return p=c?z[c]:l?0:Vt(u,d),[f,new Fe(p)]}function Hn(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).trim()}var Un=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Wn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Gn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Kn(e){let[,t,n,r,i,a,o,s]=e;return[zn(t,i,r,n,a,o,s),Fe.utcInstance]}function qn(e){let[,t,n,r,i,a,o,s]=e;return[zn(t,s,n,r,i,a,o),Fe.utcInstance]}var Jn=mn(Cn,Sn),Yn=mn(wn,Sn),Xn=mn(Tn,Sn),Zn=mn(xn),Qn=hn(Mn,Nn,Pn,Fn),$n=hn(En,Nn,Pn,Fn),er=hn(Dn,Nn,Pn,Fn),tr=hn(Nn,Pn,Fn);function nr(e){return gn(e,[Jn,Qn],[Yn,$n],[Xn,er],[Zn,tr])}function rr(e){return gn(Hn(e),[Bn,Vn])}function ir(e){return gn(e,[Un,Kn],[Wn,Kn],[Gn,qn])}function ar(e){return gn(e,[Ln,Rn])}var or=hn(Nn);function sr(e){return gn(e,[In,or])}var cr=mn(On,An),lr=mn(kn),ur=hn(Nn,Pn,Fn);function dr(e){return gn(e,[cr,Qn],[lr,ur])}var fr=`Invalid Duration`,pr={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},mr={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...pr},hr=146097/400,gr=146097/4800,_r={years:{quarters:4,months:12,weeks:hr/7,days:hr,hours:hr*24,minutes:hr*24*60,seconds:hr*24*60*60,milliseconds:hr*24*60*60*1e3},quarters:{months:3,weeks:hr/28,days:hr/4,hours:hr*24/4,minutes:hr*24*60/4,seconds:hr*24*60*60/4,milliseconds:hr*24*60*60*1e3/4},months:{weeks:gr/7,days:gr,hours:gr*24,minutes:gr*24*60,seconds:gr*24*60*60,milliseconds:gr*24*60*60*1e3},...pr},vr=[`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],yr=vr.slice(0).reverse();function br(e,t,n=!1){return new wr({values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix})}function xr(e,t){let n=t.milliseconds??0;for(let r of yr.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Sr(e,t){let n=xr(e,t)<0?-1:1;vr.reduceRight((r,i)=>{if(L(t[i]))return r;if(r){let a=t[r]*n,o=e[i][r],s=Math.floor(a/o);t[i]+=s*n,t[r]-=s*o*n}return i},null),vr.reduce((n,r)=>{if(L(t[r]))return n;if(n){let i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function Cr(e){let t={};for(let[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}var wr=class e{constructor(e){let t=e.conversionAccuracy===`longterm`||!1,n=t?_r:mr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||P.create(),this.conversionAccuracy=t?`longterm`:`casual`,this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,n){return e.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(typeof t!=`object`||!t)throw new s(`Duration.fromObject: argument expected to be an object, got ${t===null?`null`:typeof t}`);return new e({values:Ut(t,e.normalizeUnit),loc:P.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(ht(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t==`object`)return e.fromObject(t);throw new s(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){let[r]=ar(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){let[r]=sr(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Duration is invalid`);let r=t instanceof I?t:new I(t,n);if(F.throwOnInvalid)throw new i(r);return new e({invalid:r})}static normalizeUnit(e){let t={year:`years`,years:`years`,quarter:`quarters`,quarters:`quarters`,month:`months`,months:`months`,week:`weeks`,weeks:`weeks`,day:`days`,days:`days`,hour:`hours`,hours:`hours`,minute:`minutes`,minutes:`minutes`,second:`seconds`,seconds:`seconds`,millisecond:`milliseconds`,milliseconds:`milliseconds`}[e&&e.toLowerCase()];if(!t)throw new o(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?fn.create(this.loc,n).formatDurationFromString(this,e):fr}toHuman(e={}){if(!this.isValid)return fr;let t=e.showZeros!==!1,n=vr.map(n=>{let r=this.values[n];return L(r)||r===0&&!t?null:this.loc.numberFormatter({style:`unit`,unitDisplay:`long`,...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:`conjunction`,style:e.listStyle||`narrow`,...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e=`P`;return this.years!==0&&(e+=this.years+`Y`),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+`M`),this.weeks!==0&&(e+=this.weeks+`W`),this.days!==0&&(e+=this.days+`D`),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+=`T`),this.hours!==0&&(e+=this.hours+`H`),this.minutes!==0&&(e+=this.minutes+`M`),(this.seconds!==0||this.milliseconds!==0)&&(e+=Mt(this.seconds+this.milliseconds/1e3,3)+`S`),e===`P`&&(e+=`T0S`),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:`extended`,...e,includeOffset:!1},Oi.fromMillis(t,{zone:`UTC`}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?xr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t),r={};for(let e of vr)(wt(n.values,e)||wt(this.values,e))&&(r[e]=n.get(e)+this.get(e));return br(this,{values:r},!0)}minus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let n of Object.keys(this.values))t[n]=Ht(e(this.values[n],n));return br(this,{values:t},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let n={...this.values,...Ut(t,e.normalizeUnit)};return br(this,{values:n})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){let i={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return br(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return Sr(this.matrix,e),br(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=Cr(this.normalize().shiftToAll().toObject());return br(this,{values:e},!0)}shiftTo(...t){if(!this.isValid||t.length===0)return this;t=t.map(t=>e.normalizeUnit(t));let n={},r={},i=this.toObject(),a;for(let e of vr)if(t.indexOf(e)>=0){a=e;let t=0;for(let n in r)t+=this.matrix[n][e]*r[n],r[n]=0;ht(i[e])&&(t+=i[e]);let o=Math.trunc(t);n[e]=o,r[e]=(t*1e3-o*1e3)/1e3}else ht(i[e])&&(r[e]=i[e]);for(let e in r)r[e]!==0&&(n[a]+=e===a?r[e]:r[e]/this.matrix[a][e]);return Sr(this.matrix,n),br(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo(`years`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return br(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=Cr(this.values);return br(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(e,t){return e===void 0||e===0?t===void 0||t===0:e===t}for(let n of vr)if(!t(this.values[n],e.values[n]))return!1;return!0}},Tr=`Invalid Interval`;function Er(e,t){return!e||!e.isValid?Dr.invalid(`missing or invalid start`):!t||!t.isValid?Dr.invalid(`missing or invalid end`):t<e?Dr.invalid(`end before start`,`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}var Dr=class e{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Interval is invalid`);let i=t instanceof I?t:new I(t,n);if(F.throwOnInvalid)throw new r(i);return new e({invalid:i})}static fromDateTimes(t,n){let r=ki(t),i=ki(n);return Er(r,i)??new e({start:r,end:i})}static after(t,n){let r=wr.fromDurationLike(n),i=ki(t);return e.fromDateTimes(i,i.plus(r))}static before(t,n){let r=wr.fromDurationLike(n),i=ki(t);return e.fromDateTimes(i.minus(r),i)}static fromISO(t,n){let[r,i]=(t||``).split(`/`,2);if(r&&i){let t,a;try{t=Oi.fromISO(r,n),a=t.isValid}catch{a=!1}let o,s;try{o=Oi.fromISO(i,n),s=o.isValid}catch{s=!1}if(a&&s)return e.fromDateTimes(t,o);if(a){let r=wr.fromISO(i,n);if(r.isValid)return e.after(t,r)}else if(s){let t=wr.fromISO(r,n);if(t.isValid)return e.before(o,t)}}return e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e=`milliseconds`){return this.isValid?this.toDuration(e).get(e):NaN}count(e=`milliseconds`,t){if(!this.isValid)return NaN;let n=this.start.startOf(e,t),r;return r=t!=null&&t.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:t,end:n}={}){return this.isValid?e.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];let n=t.map(ki).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[],{s:i}=this,a=0;for(;i<this.e;){let t=n[a]||this.e,o=+t>+this.e?this.e:t;r.push(e.fromDateTimes(i,o)),i=o,a+=1}return r}splitBy(t){let n=wr.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as(`milliseconds`)===0)return[];let{s:r}=this,i=1,a,o=[];for(;r<this.e;){let t=this.start.plus(n.mapUnits(e=>e*i));a=+t>+this.e?this.e:t,o.push(e.fromDateTimes(r,a)),r=a,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(t){if(!this.isValid)return this;let n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:e.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;let n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return e.fromDateTimes(n,r)}static merge(e){let[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(t){let n=null,r=0,i=[],a=t.map(e=>[{time:e.s,type:`s`},{time:e.e,type:`e`}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(let t of o)r+=t.type===`s`?1:-1,r===1?n=t.time:(n&&+n!=+t.time&&i.push(e.fromDateTimes(n,t.time)),n=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Tr}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?fn.create(this.s.loc.clone(t),e).formatInterval(this):Tr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Tr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Tr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Tr}toFormat(e,{separator:t=` – `}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Tr}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):wr.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},Or=class{static hasDST(e=F.defaultZone){let t=Oi.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return de.isValidZone(e)}static normalizeZone(e){return Le(e,F.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||P.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||P.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||P.create(e)).getWeekendDays().slice()}static months(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||P.create(t,n,i)).months(e)}static monthsFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||P.create(t,n,i)).months(e,!0)}static weekdays(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||P.create(t,n,null)).weekdays(e)}static weekdaysFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||P.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return P.create(e).meridiems()}static eras(e=`short`,{locale:t=null}={}){return P.create(t,null,`gregory`).eras(e)}static features(){return{relative:yt(),localeWeek:bt()}}};function kr(e,t){let n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf(`day`).valueOf(),r=n(t)-n(e);return Math.floor(wr.fromMillis(r).as(`days`))}function Ar(e,t,n){let r=[[`years`,(e,t)=>t.year-e.year],[`quarters`,(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],[`months`,(e,t)=>t.month-e.month+(t.year-e.year)*12],[`weeks`,(e,t)=>{let n=kr(e,t);return(n-n%7)/7}],[`days`,kr]],i={},a=e,o,s;for(let[c,l]of r)n.indexOf(c)>=0&&(o=c,i[c]=l(e,t),s=a.plus(i),s>t?(i[c]--,e=a.plus(i),e>t&&(s=e,i[c]--,e=a.plus(i))):e=s);return[e,i,s,o]}function jr(e,t,n,r){let[i,a,o,s]=Ar(e,t,n),c=t-i,l=n.filter(e=>[`hours`,`minutes`,`seconds`,`milliseconds`].indexOf(e)>=0);l.length===0&&(o<t&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+c/(o-i)));let u=wr.fromObject(a,r);return l.length>0?wr.fromMillis(c,r).shiftTo(...l).plus(u):u}var Mr=`missing Intl.DateTimeFormat.formatToParts support`;function B(e,t=e=>e){return{regex:e,deser:([e])=>t(Ve(e))}}var Nr=`[ \xA0]`,Pr=new RegExp(Nr,`g`);function Fr(e){return e.replace(/\./g,`\\.?`).replace(Pr,Nr)}function Ir(e){return e.replace(/\./g,``).replace(Pr,` `).toLowerCase()}function Lr(e,t){return e===null?null:{regex:RegExp(e.map(Fr).join(`|`)),deser:([n])=>e.findIndex(e=>Ir(n)===Ir(e))+t}}function Rr(e,t){return{regex:e,deser:([,e,t])=>Vt(e,t),groups:t}}function zr(e){return{regex:e,deser:([e])=>e}}function Br(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,`\\$&`)}function Vr(e,t){let n=We(t),r=We(t,`{2}`),i=We(t,`{3}`),a=We(t,`{4}`),o=We(t,`{6}`),s=We(t,`{1,2}`),c=We(t,`{1,3}`),l=We(t,`{1,6}`),u=We(t,`{1,9}`),d=We(t,`{2,4}`),f=We(t,`{4,6}`),p=e=>({regex:RegExp(Br(e.val)),deser:([e])=>e,literal:!0}),m=(m=>{if(e.literal)return p(m);switch(m.val){case`G`:return Lr(t.eras(`short`),0);case`GG`:return Lr(t.eras(`long`),0);case`y`:return B(l);case`yy`:return B(d,zt);case`yyyy`:return B(a);case`yyyyy`:return B(f);case`yyyyyy`:return B(o);case`M`:return B(s);case`MM`:return B(r);case`MMM`:return Lr(t.months(`short`,!0),1);case`MMMM`:return Lr(t.months(`long`,!0),1);case`L`:return B(s);case`LL`:return B(r);case`LLL`:return Lr(t.months(`short`,!1),1);case`LLLL`:return Lr(t.months(`long`,!1),1);case`d`:return B(s);case`dd`:return B(r);case`o`:return B(c);case`ooo`:return B(i);case`HH`:return B(r);case`H`:return B(s);case`hh`:return B(r);case`h`:return B(s);case`mm`:return B(r);case`m`:return B(s);case`q`:return B(s);case`qq`:return B(r);case`s`:return B(s);case`ss`:return B(r);case`S`:return B(c);case`SSS`:return B(i);case`u`:return zr(u);case`uu`:return zr(s);case`uuu`:return B(n);case`a`:return Lr(t.meridiems(),0);case`kkkk`:return B(a);case`kk`:return B(d,zt);case`W`:return B(s);case`WW`:return B(r);case`E`:case`c`:return B(n);case`EEE`:return Lr(t.weekdays(`short`,!1),1);case`EEEE`:return Lr(t.weekdays(`long`,!1),1);case`ccc`:return Lr(t.weekdays(`short`,!0),1);case`cccc`:return Lr(t.weekdays(`long`,!0),1);case`Z`:case`ZZ`:return Rr(RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case`ZZZ`:return Rr(RegExp(`([+-]${s.source})(${r.source})?`),2);case`z`:return zr(/[a-z_+-/]{1,256}?/i);case` `:return zr(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:Mr};return m.token=e,m}var Hr={year:{"2-digit":`yy`,numeric:`yyyyy`},month:{numeric:`M`,"2-digit":`MM`,short:`MMM`,long:`MMMM`},day:{numeric:`d`,"2-digit":`dd`},weekday:{short:`EEE`,long:`EEEE`},dayperiod:`a`,dayPeriod:`a`,hour12:{numeric:`h`,"2-digit":`hh`},hour24:{numeric:`H`,"2-digit":`HH`},minute:{numeric:`m`,"2-digit":`mm`},second:{numeric:`s`,"2-digit":`ss`},timeZoneName:{long:`ZZZZZ`,short:`ZZZ`}};function Ur(e,t,n){let{type:r,value:i}=e;if(r===`literal`){let e=/^\s+$/.test(i);return{literal:!e,val:e?` `:i}}let a=t[r],o=r;r===`hour`&&(o=t.hour12==null?t.hourCycle==null?n.hour12?`hour12`:`hour24`:t.hourCycle===`h11`||t.hourCycle===`h12`?`hour12`:`hour24`:t.hour12?`hour12`:`hour24`);let s=Hr[o];if(typeof s==`object`&&(s=s[a]),s)return{literal:!1,val:s}}function Wr(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,``)}$`,e]}function Gr(e,t,n){let r=e.match(t);if(r){let e={},t=1;for(let i in n)if(wt(n,i)){let a=n[i],o=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+o))),t+=o}return[r,e]}return[r,{}]}function Kr(e){let t=e=>{switch(e){case`S`:return`millisecond`;case`s`:return`second`;case`m`:return`minute`;case`h`:case`H`:return`hour`;case`d`:return`day`;case`o`:return`ordinal`;case`L`:case`M`:return`month`;case`y`:return`year`;case`E`:case`c`:return`weekday`;case`W`:return`weekNumber`;case`k`:return`weekYear`;case`q`:return`quarter`;default:return null}},n=null,r;return L(e.z)||(n=de.create(e.z)),L(e.Z)||(n||=new Fe(e.Z),r=e.Z),L(e.q)||(e.M=(e.q-1)*3+1),L(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),L(e.u)||(e.S=jt(e.u)),[Object.keys(e).reduce((n,r)=>{let i=t(r);return i&&(n[i]=e[r]),n},{}),n,r]}var qr=null;function Jr(){return qr||=Oi.fromMillis(1555555555555),qr}function Yr(e,t){if(e.literal)return e;let n=ei(fn.macroTokenToFormatOpts(e.val),t);return n==null||n.includes(void 0)?e:n}function Xr(e,t){return Array.prototype.concat(...e.map(e=>Yr(e,t)))}var Zr=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Xr(fn.parseFormat(t),e),this.units=this.tokens.map(t=>Vr(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=Wr(this.units);this.regex=RegExp(e,`i`),this.handlers=t}}explainFromTokens(e){if(this.isValid){let[t,n]=Gr(e,this.regex,this.handlers),[r,i,o]=n?Kr(n):[null,null,void 0];if(wt(n,`a`)&&wt(n,`H`))throw new a(`Can't include meridiem when specifying 24-hour format`);return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:o}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function Qr(e,t,n){return new Zr(e,n).explainFromTokens(t)}function $r(e,t,n){let{result:r,zone:i,specificOffset:a,invalidReason:o}=Qr(e,t,n);return[r,i,a,o]}function ei(e,t){if(!e)return null;let n=fn.create(t,e).dtFormatter(Jr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>Ur(t,e,i))}var ti=`Invalid DateTime`,ni=864e13;function ri(e){return new I(`unsupported zone`,`the zone "${e.name}" is not supported`)}function ii(e){return e.weekData===null&&(e.weekData=ot(e.c)),e.weekData}function ai(e){return e.localWeekData===null&&(e.localWeekData=ot(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function oi(e,t){let n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Oi({...n,...t,old:n})}function si(e,t,n){let r=e-t*60*1e3,i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;let a=n.offset(r);return i===a?[r,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function ci(e,t){e+=t*60*1e3;let n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function li(e,t,n){return si(It(e),t,n)}function ui(e,t){let n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:r,month:i,day:Math.min(e.c.day,Ft(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=wr.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as(`milliseconds`),[s,c]=si(It(a),n,e.zone);return o!==0&&(s+=o,c=e.zone.offset(s)),{ts:s,o:c}}function di(e,t,n,r,i,a){let{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){let r=t||s,i=Oi.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}return Oi.invalid(new I(`unparsable`,`the input "${i}" can't be parsed as ${r}`))}function fi(e,t,n=!0){return e.isValid?fn.create(P.create(`en-US`),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function pi(e,t,n){let r=e.c.year>9999||e.c.year<0,i=``;if(r&&e.c.year>=0&&(i+=`+`),i+=Ot(e.c.year,r?6:4),n===`year`)return i;if(t){if(i+=`-`,i+=Ot(e.c.month),n===`month`)return i;i+=`-`}else if(i+=Ot(e.c.month),n===`month`)return i;return i+=Ot(e.c.day),i}function mi(e,t,n,r,i,a,o){let s=!n||e.c.millisecond!==0||e.c.second!==0,c=``;switch(o){case`day`:case`month`:case`year`:break;default:if(c+=Ot(e.c.hour),o===`hour`)break;if(t){if(c+=`:`,c+=Ot(e.c.minute),o===`minute`)break;s&&(c+=`:`,c+=Ot(e.c.second))}else{if(c+=Ot(e.c.minute),o===`minute`)break;s&&(c+=Ot(e.c.second))}if(o===`second`)break;s&&(!r||e.c.millisecond!==0)&&(c+=`.`,c+=Ot(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&e.offset===0&&!a?c+=`Z`:e.o<0?(c+=`-`,c+=Ot(Math.trunc(-e.o/60)),c+=`:`,c+=Ot(Math.trunc(-e.o%60))):(c+=`+`,c+=Ot(Math.trunc(e.o/60)),c+=`:`,c+=Ot(Math.trunc(e.o%60)))),a&&(c+=`[`+e.zone.ianaName+`]`),c}var hi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},gi={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},_i={ordinal:1,hour:0,minute:0,second:0,millisecond:0},vi=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],yi=[`weekYear`,`weekNumber`,`weekday`,`hour`,`minute`,`second`,`millisecond`],bi=[`year`,`ordinal`,`hour`,`minute`,`second`,`millisecond`];function xi(e){let t={year:`year`,years:`year`,month:`month`,months:`month`,day:`day`,days:`day`,hour:`hour`,hours:`hour`,minute:`minute`,minutes:`minute`,quarter:`quarter`,quarters:`quarter`,second:`second`,seconds:`second`,millisecond:`millisecond`,milliseconds:`millisecond`,weekday:`weekday`,weekdays:`weekday`,weeknumber:`weekNumber`,weeksnumber:`weekNumber`,weeknumbers:`weekNumber`,weekyear:`weekYear`,weekyears:`weekYear`,ordinal:`ordinal`}[e.toLowerCase()];if(!t)throw new o(e);return t}function Si(e){switch(e.toLowerCase()){case`localweekday`:case`localweekdays`:return`localWeekday`;case`localweeknumber`:case`localweeknumbers`:return`localWeekNumber`;case`localweekyear`:case`localweekyears`:return`localWeekYear`;default:return xi(e)}}function Ci(e){if(Ei===void 0&&(Ei=F.now()),e.type!==`iana`)return e.offset(Ei);let t=e.name,n=Di.get(t);return n===void 0&&(n=e.offset(Ei),Di.set(t,n)),n}function wi(e,t){let n=Le(t.zone,F.defaultZone);if(!n.isValid)return Oi.invalid(ri(n));let r=P.fromObject(t),i,a;if(L(e.year))i=F.now();else{for(let t of vi)L(e[t])&&(e[t]=hi[t]);let t=pt(e)||mt(e);if(t)return Oi.invalid(t);let r=Ci(n);[i,a]=li(e,r,n)}return new Oi({ts:i,zone:n,loc:r,o:a})}function V(e,t,n){let r=L(n.round)?!0:n.round,i=L(n.rounding)?`trunc`:n.rounding,a=(e,a)=>(e=Mt(e,r||n.calendary?0:2,n.calendary?`round`:i),t.loc.clone(n).relFormatter(n).format(e,a)),o=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(o(n.unit),n.unit);for(let e of n.units){let t=o(e);if(Math.abs(t)>=1)return a(t,e)}return a(e>t?-0:0,n.units[n.units.length-1])}function Ti(e){let t={},n;return e.length>0&&typeof e[e.length-1]==`object`?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}var Ei,Di=new Map,Oi=class e{constructor(e){let t=e.zone||F.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new I(`invalid input`):null)||(t.isValid?null:ri(t));this.ts=L(e.ts)?F.now():e.ts;let r=null,i=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{let a=ht(e.o)&&!e.old?e.o:t.offset(this.ts);r=ci(this.ts,a),n=Number.isNaN(r.year)?new I(`invalid input`):null,r=n?null:r,i=n?null:a}}this._zone=t,this.loc=e.loc||P.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[e,t]=Ti(arguments),[n,r,i,a,o,s,c]=t;return wi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static utc(){let[e,t]=Ti(arguments),[n,r,i,a,o,s,c]=t;return e.zone=Fe.utcInstance,wi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static fromJSDate(t,n={}){let r=vt(t)?t.valueOf():NaN;if(Number.isNaN(r))return e.invalid(`invalid input`);let i=Le(n.zone,F.defaultZone);return i.isValid?new e({ts:r,zone:i,loc:P.fromObject(n)}):e.invalid(ri(i))}static fromMillis(t,n={}){if(!ht(t))throw new s(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);return t<-864e13||t>ni?e.invalid(`Timestamp out of range`):new e({ts:t,zone:Le(n.zone,F.defaultZone),loc:P.fromObject(n)})}static fromSeconds(t,n={}){if(ht(t))return new e({ts:t*1e3,zone:Le(n.zone,F.defaultZone),loc:P.fromObject(n)});throw new s(`fromSeconds requires a numerical input`)}static fromObject(t,n={}){t||={};let r=Le(n.zone,F.defaultZone);if(!r.isValid)return e.invalid(ri(r));let i=P.fromObject(n),o=Ut(t,Si),{minDaysInFirstWeek:s,startOfWeek:c}=ut(o,i),l=F.now(),u=L(n.specificOffset)?r.offset(l):n.specificOffset,d=!L(o.ordinal),f=!L(o.year),p=!L(o.month)||!L(o.day),m=f||p,h=o.weekYear||o.weekNumber;if((m||d)&&h)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(p&&d)throw new a(`Can't mix ordinal dates with month/day`);let g=h||o.weekday&&!m,_,v,y=ci(l,u);g?(_=yi,v=gi,y=ot(y,s,c)):d?(_=bi,v=_i,y=ct(y)):(_=vi,v=hi);let b=!1;for(let e of _){let t=o[e];L(t)?o[e]=b?v[e]:y[e]:b=!0}let x=(g?dt(o,s,c):d?ft(o):pt(o))||mt(o);if(x)return e.invalid(x);let[S,C]=li(g?st(o,s,c):d?lt(o):o,u,r),w=new e({ts:S,zone:r,o:C,loc:i});return o.weekday&&m&&t.weekday!==w.weekday?e.invalid(`mismatched weekday`,`you can't specify both a weekday of ${o.weekday} and a date of ${w.toISO()}`):w.isValid?w:e.invalid(w.invalid)}static fromISO(e,t={}){let[n,r]=nr(e);return di(n,r,t,`ISO 8601`,e)}static fromRFC2822(e,t={}){let[n,r]=rr(e);return di(n,r,t,`RFC 2822`,e)}static fromHTTP(e,t={}){let[n,r]=ir(e);return di(n,r,t,`HTTP`,t)}static fromFormat(t,n,r={}){if(L(t)||L(n))throw new s(`fromFormat requires an input string and a format`);let{locale:i=null,numberingSystem:a=null}=r,[o,c,l,u]=$r(P.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),t,n);return u?e.invalid(u):di(o,c,r,`format ${n}`,t,l)}static fromString(t,n,r={}){return e.fromFormat(t,n,r)}static fromSQL(e,t={}){let[n,r]=dr(e);return di(n,r,t,`SQL`,e)}static invalid(t,r=null){if(!t)throw new s(`need to specify a reason the DateTime is invalid`);let i=t instanceof I?t:new I(t,r);if(F.throwOnInvalid)throw new n(i);return new e({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let n=ei(e,P.fromObject(t));return n?n.map(e=>e?e.val:null).join(``):null}static expandFormat(e,t={}){return Xr(fn.parseFormat(e),P.fromObject(t)).map(e=>e.val).join(``)}static resetCache(){Ei=void 0,Di.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ii(this).weekYear:NaN}get weekNumber(){return this.isValid?ii(this).weekNumber:NaN}get weekday(){return this.isValid?ii(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ai(this).weekday:NaN}get localWeekNumber(){return this.isValid?ai(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ai(this).weekYear:NaN}get ordinal(){return this.isValid?ct(this.c).ordinal:NaN}get monthShort(){return this.isValid?Or.months(`short`,{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Or.months(`long`,{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Or.weekdays(`short`,{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Or.weekdays(`long`,{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:`short`,locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:`long`,locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,t=6e4,n=It(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];let s=n-a*t,c=n-o*t,l=ci(s,a),u=ci(c,o);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[oi(this,{ts:s}),oi(this,{ts:c})]:[this]}get isInLeapYear(){return Nt(this.year)}get daysInMonth(){return Ft(this.year,this.month)}get daysInYear(){return this.isValid?Pt(this.year):NaN}get weeksInWeekYear(){return this.isValid?Rt(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Rt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:n,calendar:r}=fn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Fe.instance(e),t)}toLocal(){return this.setZone(F.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Le(t,F.defaultZone),t.equals(this.zone))return this;if(t.isValid){let e=this.ts;if(n||r){let n=t.offset(this.ts),r=this.toObject();[e]=li(r,n,t)}return oi(this,{ts:e,zone:t})}return e.invalid(ri(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){let r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return oi(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=Ut(e,Si),{minDaysInFirstWeek:n,startOfWeek:r}=ut(t,this.loc),i=!L(t.weekYear)||!L(t.weekNumber)||!L(t.weekday),o=!L(t.ordinal),s=!L(t.year),c=!L(t.month)||!L(t.day),l=s||c,u=t.weekYear||t.weekNumber;if((l||o)&&u)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(c&&o)throw new a(`Can't mix ordinal dates with month/day`);let d;i?d=st({...ot(this.c,n,r),...t},n,r):L(t.ordinal)?(d={...this.toObject(),...t},L(t.day)&&(d.day=Math.min(Ft(d.year,d.month),d.day))):d=lt({...ct(this.c),...t});let[f,p]=li(d,this.o,this.zone);return oi(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;let t=wr.fromDurationLike(e);return oi(this,ui(this,t))}minus(e){if(!this.isValid)return this;let t=wr.fromDurationLike(e).negate();return oi(this,ui(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let n={},r=wr.normalizeUnit(e);switch(r){case`years`:n.month=1;case`quarters`:case`months`:n.day=1;case`weeks`:case`days`:n.hour=0;case`hours`:n.minute=0;case`minutes`:n.second=0;case`seconds`:n.millisecond=0}if(r===`weeks`){if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1}return r===`quarters`&&(n.month=(Math.ceil(this.month/3)-1)*3+1),this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?fn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ti}toLocaleString(e=f,t={}){return this.isValid?fn.create(this.loc.clone(t),e).formatDateTime(this):ti}toLocaleParts(e={}){return this.isValid?fn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e=`extended`,suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1,precision:a=`milliseconds`}={}){if(!this.isValid)return null;a=xi(a);let o=e===`extended`,s=pi(this,o,a);return vi.indexOf(a)>=3&&(s+=`T`),s+=mi(this,o,t,n,r,i,a),s}toISODate({format:e=`extended`,precision:t=`day`}={}){return this.isValid?pi(this,e===`extended`,xi(t)):null}toISOWeekDate(){return fi(this,`kkkk-'W'WW-c`)}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a=`extended`,precision:o=`milliseconds`}={}){return this.isValid?(o=xi(o),(r&&vi.indexOf(o)>=3?`T`:``)+mi(this,a===`extended`,t,e,n,i,o)):null}toRFC2822(){return fi(this,`EEE, dd LLL yyyy HH:mm:ss ZZZ`,!1)}toHTTP(){return fi(this.toUTC(),`EEE, dd LLL yyyy HH:mm:ss 'GMT'`)}toSQLDate(){return this.isValid?pi(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r=`HH:mm:ss.SSS`;return(t||e)&&(n&&(r+=` `),t?r+=`z`:e&&(r+=`ZZ`)),fi(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ti}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t=`milliseconds`,n={}){if(!this.isValid||!e.isValid)return wr.invalid(`created by diffing an invalid DateTime`);let r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=xt(t).map(wr.normalizeUnit),a=e.valueOf()>this.valueOf(),o=jr(a?this:e,a?e:this,i,r);return a?o.negate():o}diffNow(t=`milliseconds`,n={}){return this.diff(e.now(),t,n)}until(e){return this.isValid?Dr.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;let r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(t={}){if(!this.isValid)return null;let n=t.base||e.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0,i=[`years`,`months`,`days`,`hours`,`minutes`,`seconds`],a=t.unit;return Array.isArray(t.unit)&&(i=t.unit,a=void 0),V(n,this.plus(r),{...t,numeric:`always`,units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?V(t.base||e.fromObject({},{zone:this.zone}),this,{...t,numeric:`auto`,units:[`years`,`months`,`days`],calendary:!0}):null}static min(...t){if(!t.every(e.isDateTime))throw new s(`min requires all arguments be DateTimes`);return St(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new s(`max requires all arguments be DateTimes`);return St(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){let{locale:r=null,numberingSystem:i=null}=n;return Qr(P.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(t,n,r={}){return e.fromFormatExplain(t,n,r)}static buildFormatParser(e,t={}){let{locale:n=null,numberingSystem:r=null}=t;return new Zr(P.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(t,n,r={}){if(L(t)||L(n))throw new s(`fromFormatParser requires an input string and a format parser`);let{locale:i=null,numberingSystem:a=null}=r,o=P.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(n.locale))throw new s(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);let{result:c,zone:l,specificOffset:u,invalidReason:d}=n.explainFromTokens(t);return d?e.invalid(d):di(c,l,r,`format ${n.format}`,t,u)}static get DATE_SHORT(){return f}static get DATE_MED(){return p}static get DATE_MED_WITH_WEEKDAY(){return m}static get DATE_FULL(){return h}static get DATE_HUGE(){return g}static get TIME_SIMPLE(){return _}static get TIME_WITH_SECONDS(){return v}static get TIME_WITH_SHORT_OFFSET(){return y}static get TIME_WITH_LONG_OFFSET(){return b}static get TIME_24_SIMPLE(){return x}static get TIME_24_WITH_SECONDS(){return S}static get TIME_24_WITH_SHORT_OFFSET(){return C}static get TIME_24_WITH_LONG_OFFSET(){return w}static get DATETIME_SHORT(){return T}static get DATETIME_SHORT_WITH_SECONDS(){return E}static get DATETIME_MED(){return D}static get DATETIME_MED_WITH_SECONDS(){return O}static get DATETIME_MED_WITH_WEEKDAY(){return k}static get DATETIME_FULL(){return A}static get DATETIME_FULL_WITH_SECONDS(){return ee}static get DATETIME_HUGE(){return te}static get DATETIME_HUGE_WITH_SECONDS(){return ne}};function ki(e){if(Oi.isDateTime(e))return e;if(e&&e.valueOf&&ht(e.valueOf()))return Oi.fromJSDate(e);if(e&&typeof e==`object`)return Oi.fromObject(e);throw new s(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.DateTime=Oi,e.Duration=wr,e.FixedOffsetZone=Fe,e.IANAZone=de,e.Info=Or,e.Interval=Dr,e.InvalidZone=Ie,e.Settings=F,e.SystemZone=ie,e.VERSION=`3.7.2`,e.Zone=j})),Xa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;var t=Ya(),n;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.Day=`Day`,e.Month=`Month`,e.Year=`Year`})(n||(e.TimeUnit=n={}));var r;(function(e){e.Add=`Add`,e.Subtract=`Subtract`})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var i=class i{#e;#t=null;#n=null;#r=null;constructor(e,n){let r={zone:n};if(e?e instanceof i?(this.#e=e.#e,this.#t=e.#t,this.#n=e.#n,this.#r=e.#r):e instanceof Date?this.#e=t.DateTime.fromJSDate(e,r):typeof e==`number`?this.#e=t.DateTime.fromMillis(e,r):(this.#e=t.DateTime.fromISO(e,r),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(e,`EEE, d MMM yyyy HH:mm:ss`,r))):this.#e=t.DateTime.local(),!this.#e.isValid)throw Error(`CronDate: unhandled timestamp: ${e}`);n&&n!==this.#e.zoneName&&(this.#e=this.#e.setZone(n))}static#i(e){return e%4==0&&e%100!=0||e%400==0}get dstStart(){return this.#t}get dstStartLandingHour(){return this.#n}clearDstStart(){this.#t=null,this.#n=null}get dstEnd(){return this.#r}set dstEnd(e){this.#r=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf(`month`)}addDay(){this.#e=this.#e.plus({days:1}).startOf(`day`)}addHour(){this.#e=this.#e.plus({hours:1}).startOf(`hour`)}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf(`minute`)}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf(`month`).startOf(`second`)}subtractDay(){this.#e=this.#e.minus({days:1}).endOf(`day`).startOf(`second`)}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf(`hour`).startOf(`second`)}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf(`minute`).startOf(`second`)}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){switch(e){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(e){switch(e){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(e,t){if(e===r.Add)this.addUnit(t);else if(e===r.Subtract)this.subtractUnit(t);else throw Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf(`day`)}setEndOfDay(){this.#e=this.#e.endOf(`day`)}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#a().day}getUTCFullYear(){return this.#a().year}getUTCDay(){let e=this.#a().weekday;return e===7?0:e}getUTCMonth(){return this.#a().month-1}getUTCHours(){return this.#a().hour}getUTCMinutes(){return this.#a().minute}getUTCSeconds(){return this.#a().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:t,month:n}=this.#e;if(n===2){let r=i.#i(this.#e.year);return t===e.DAYS_IN_MONTH[n-1]-+!r}return t===e.DAYS_IN_MONTH[n-1]}isLastWeekdayOfMonth(){let{day:t,month:n}=this.#e,r;return r=n===2?e.DAYS_IN_MONTH[n-1]-+!i.#i(this.#e.year):e.DAYS_IN_MONTH[n-1],t>r-7}applyDateOperation(e,t,i){if(t===n.Month||t===n.Day){this.invokeDateOperation(e,t);return}let a=this.getHours(),o=this.getUTCOffset();this.invokeDateOperation(e,t);let s=this.getHours(),c=(s-a+24)%24;e===r.Add&&this.getUTCOffset()>o&&c>=2?i!==24&&(this.#t=(a+1)%24,this.#n=s):c===0&&this.getMinutes()===0&&this.getSeconds()===0&&i!==24&&(this.dstEnd=s)}#a(){return this.#e.toUTC()}};e.CronDate=i,e.default=i})),Za=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMonth=void 0;var t=Xa(),n=Ja(),r=1,i=12,a=Object.freeze([]);e.CronMonth=class extends n.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}static get daysInMonth(){return t.DAYS_IN_MONTH}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Qa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfMonth=void 0;var t=Ja(),n=Za(),r=1,i=31,a=Object.freeze([`L`]);e.CronDayOfMonth=class e extends t.CronField{static fromMonth(t,r,i){if(t.length!==1)return new e(r,i);let a=n.CronMonth.daysInMonth[t[0]-1],o=r.filter(e=>typeof e!=`number`||e<=a);return new e(o.length>0?o:r,i)}static get min(){return r}static get max(){return i}static get chars(){return a}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),$a=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfWeek=void 0;var t=Ja(),n=0,r=7,i=Object.freeze([`L`]);e.CronDayOfWeek=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){if(super(e,t),this.validate(),this.values.some(e=>e===`L`))throw Error(`${this.constructor.name} Validation error, unexpected standalone L`)}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}}})),eo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronHour=void 0;var t=Ja(),n=0,r=23,i=Object.freeze([]);e.CronHour=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),to=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMinute=void 0;var t=Ja(),n=0,r=59,i=Object.freeze([]);e.CronMinute=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),no=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronSecond=void 0;var t=Ja(),n=0,r=59,i=Object.freeze([]);e.CronSecond=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),ro=o(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(qa(),e),i(Qa(),e),i($a(),e),i(Ja(),e),i(eo(),e),i(to(),e),i(Za(),e),i(no(),e)})),io=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFieldCollection=void 0;var t=ro();e.CronFieldCollection=class e{#e;#t;#n;#r;#i;#a;static from(n,r){return new e({second:this.resolveField(t.CronSecond,n.second,r.second),minute:this.resolveField(t.CronMinute,n.minute,r.minute),hour:this.resolveField(t.CronHour,n.hour,r.hour),dayOfMonth:this.resolveField(t.CronDayOfMonth,n.dayOfMonth,r.dayOfMonth),month:this.resolveField(t.CronMonth,n.month,r.month),dayOfWeek:this.resolveField(t.CronDayOfWeek,n.dayOfWeek,r.dayOfWeek)})}static resolveField(e,n,r){return r?r instanceof t.CronField?r:new e(r):n}constructor({second:e,minute:n,hour:r,dayOfMonth:i,month:a,dayOfWeek:o}){if(!e)throw Error(`Validation error, Field second is missing`);if(!n)throw Error(`Validation error, Field minute is missing`);if(!r)throw Error(`Validation error, Field hour is missing`);if(!i)throw Error(`Validation error, Field dayOfMonth is missing`);if(!a)throw Error(`Validation error, Field month is missing`);if(!o)throw Error(`Validation error, Field dayOfWeek is missing`);if(a.values.length===1&&!i.hasLastChar&&o.isWildcard&&!(parseInt(i.values[0],10)<=t.CronMonth.daysInMonth[a.values[0]-1]))throw Error(`Invalid explicit day of month definition`);this.#e=e,this.#t=n,this.#n=r,this.#i=a,this.#a=o,this.#r=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#i}get dayOfWeek(){return this.#a}static compactField(e){if(e.length===0)return[];let t=[],n;return e.forEach((e,r,i)=>{if(n===void 0){n={start:e,count:1};return}let a=i[r-1]||n.start,o=i[r+1];if(e===`L`||e===`W`)t.push(n),t.push({start:e,count:1}),n=void 0;else{if(n.step===void 0&&o!==void 0){let t=e-a;if(t<=o-e){n={...n,count:2,end:e,step:t};return}n.step=1}e-(n.end??0)===n.step?(n.count++,n.end=e):(n.count===1?t.push({start:n.start,count:1}):n.count===2?(t.push({start:n.start,count:1}),t.push({start:n.end??a,count:1})):t.push(n),n={start:e,count:1})}}),n&&t.push(n),t}static#o(e,n,r){let i=n.step;return i?i===1&&n.start===e.min&&n.end&&n.end>=r?(e instanceof t.CronDayOfMonth||e instanceof t.CronDayOfWeek)&&!e.isWildcard?null:e.hasQuestionMarkChar?`?`:`*`:i!==1&&n.start===e.min&&n.end&&n.end>=r-i+1?`*/${i}`:null:null}static#s(e){let t=e.step;if(t===1)return`${e.start}-${e.end}`;let n=e.start===0?e.count-1:e.count;if(!t)throw Error(`Unexpected range step`);if(!e.end)throw Error(`Unexpected range end`);if(t*n>e.end){let n=(n,r)=>{if(typeof e.start!=`number`)throw Error(`Unexpected range start`);return r%t===0?e.start+r:null};if(typeof e.start!=`number`)throw Error(`Unexpected range start`);let r={length:e.end-e.start+1};return Array.from(r,n).filter(e=>e!==null).join(`,`)}return`${e.start}-${e.end}/${t}`}stringifyField(n){let r=n.max,i=n.values;if(n instanceof t.CronDayOfWeek){r=6;let e=this.#a.values;i=e[e.length-1]===7?e.slice(0,-1):e}n instanceof t.CronDayOfMonth&&(r=this.#i.values.length===1?t.CronMonth.daysInMonth[this.#i.values[0]-1]:n.max);let a=e.compactField(i);if(a.length===1){let t=e.#o(n,a[0],r);if(t)return t}return a.map(r=>{let i=r.count===1?r.start.toString():e.#s(r);return n instanceof t.CronDayOfWeek&&n.nthDay>0?`${i}#${n.nthDay}`:i}).join(`,`)}stringify(e=!1){let t=[];return e&&t.push(this.stringifyField(this.#e)),t.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#i),this.stringifyField(this.#a)),t.join(` `)}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#i.serialize(),dayOfWeek:this.#a.serialize()}}}})),ao=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var t=Xa();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=`Out of the time span range`,e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=`Invalid expression, loop limit exceeded`;var n=1e4,r=class r{#e;#t;#n;#r;#i;#a;#o=null;#s=!1;constructor(e,n){this.#e=n,this.#t=n.tz,this.#r=n.startDate?new t.CronDate(n.startDate,this.#t):null,this.#i=n.endDate?new t.CronDate(n.endDate,this.#t):null;let r=n.currentDate??n.startDate;if(r){let e=new t.CronDate(r,this.#t);this.#r&&e.getTime()<this.#r.getTime()?r=this.#r:this.#i&&e.getTime()>this.#i.getTime()&&(r=this.#i)}this.#n=new t.CronDate(r,this.#t),this.#a=e}get fields(){return this.#a}static fieldsToExpression(e,t){return new r(e,t||{})}static#c(e,t){return t.some(t=>t===e)}#l(e,t){return e[t?e.length-1:0]}#u(e){let n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#o===n)return this.#s;let r=new t.CronDate(e);r.setStartOfDay();let i=new t.CronDate(e);return i.setEndOfDay(),this.#o=n,this.#s=r.getUTCOffset()!==i.getUTCOffset(),this.#s}#d(e,n,r){let i=this.#a.second.values,a=e.getSeconds(),o=this.#a.second.findNearestValue(a,r);o===null?(e.applyDateOperation(n,t.TimeUnit.Minute,this.#a.hour.values.length),e.setSeconds(this.#l(i,r))):e.setSeconds(o)}#f(e,n,r){let i=this.#a.minute.values,a=this.#a.second.values,o=e.getMinutes(),s=this.#a.minute.findNearestValue(o,r);s===null?(e.applyDateOperation(n,t.TimeUnit.Hour,this.#a.hour.values.length),e.setMinutes(this.#l(i,r)),e.setSeconds(this.#l(a,r))):(e.setMinutes(s),e.setSeconds(this.#l(a,r)))}static#p(e,t){if(!t.isLastWeekdayOfMonth())return!1;let n=t.getDay();return e.some(e=>n===parseInt(e.toString().charAt(0),10)%7)}static#m(e,t){return e<=0||Math.ceil(t.getDate()/7)===e}next(){return this.#v()}prev(){return this.#v(!0)}hasNext(){let e=this.#n;try{return this.#v(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){let e=this.#n;try{return this.#v(!0),!0}catch{return!1}finally{this.#n=e}}take(e){let t=[];if(e>=0)for(let n=0;n<e;n++)try{t.push(this.next())}catch{return t}else for(let n=0;n>e;n--)try{t.push(this.prev())}catch{return t}return t}reset(e){this.#n=new t.CronDate(e||this.#e.currentDate,this.#t)}stringify(e=!1){return this.#a.stringify(e)}includesDate(e){let{second:n,minute:r,hour:i,month:a}=this.#a,o=new t.CronDate(e,this.#t);return!(!n.values.includes(o.getSeconds())||!r.values.includes(o.getMinutes())||!i.values.includes(o.getHours())||!a.values.includes(o.getMonth()+1)||!this.#h(o))}toString(){return this.#e.expression||this.stringify(!0)}#h(e){let t=this.#a.dayOfMonth.isWildcard,n=!t,i=this.#a.dayOfWeek.isWildcard,a=!i,o=r.#c(e.getDate(),this.#a.dayOfMonth.values)||this.#a.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),s=this.#a.dayOfWeek.nthDay,c=r.#c(e.getDay(),this.#a.dayOfWeek.values)&&r.#m(s,e)||this.#a.dayOfWeek.hasLastChar&&r.#p(this.#a.dayOfWeek.values,e);return!!(n&&a&&(o||c)||o&&!a||t&&!i&&c)}#g(e,n,i){let a=this.#a.hour.values,o=a,s=e.getHours(),c=r.#c(s,a),l=e.dstEnd===s;if(e.dstStart!==null&&e.dstStartLandingHour===s){for(let t=e.dstStart;t!==s;t=(t+1)%24)if(r.#c(t,a))return!0}if(l&&!i)return e.dstEnd=null,e.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,o.length),!1;if(c)return!0;e.clearDstStart();let u=this.#a.hour.findNearestValue(s,i);if(u===null)return e.applyDateOperation(n,t.TimeUnit.Day,o.length),!1;if(this.#u(e)){let r=i?s-u:u-s;for(let a=0;a<r&&(e.applyDateOperation(n,t.TimeUnit.Hour,o.length),!(!i&&e.getHours()>=u||i&&e.getHours()<=u));a++);}else e.setHours(u);return e.setMinutes(this.#l(this.#a.minute.values,i)),e.setSeconds(this.#l(this.#a.second.values,i)),!1}#_(t){if(!this.#r&&!this.#i)return;let n=t.getTime();if(this.#r&&n<this.#r.getTime()||this.#i&&n>this.#i.getTime())throw Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#v(i=!1){let a=i?t.DateMathOp.Subtract:t.DateMathOp.Add,o=new t.CronDate(this.#n),s=o.getTime();o.getMilliseconds()>0&&(o.setMilliseconds(0),i||o.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Second,this.#a.hour.values.length));let c=0;for(;++c<n;)if(this.#_(o),!this.#h(o))o.applyDateOperation(a,t.TimeUnit.Day,this.#a.hour.values.length);else if(!r.#c(o.getMonth()+1,this.#a.month.values))o.applyDateOperation(a,t.TimeUnit.Month,this.#a.hour.values.length);else if(this.#g(o,a,i)){if(!r.#c(o.getMinutes(),this.#a.minute.values))this.#f(o,a,i);else if(!r.#c(o.getSeconds(),this.#a.second.values))this.#d(o,a,i);else if(s===o.getTime())o.applyDateOperation(a,t.TimeUnit.Second,this.#a.hour.values.length);else break}if(c>=n)throw Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return this.#n=o,o}[Symbol.iterator](){return{next:()=>{try{return{value:this.#v(),done:!1}}catch{return{value:void 0,done:!0}}}}}};e.CronExpression=r,e.default=r})),oo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.seededRandom=r;function t(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return()=>t>>>0}function n(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function r(e){return n(e?t(e)():Math.floor(Math.random()*1e10))}})),so=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpressionParser=e.DayOfWeek=e.Months=e.CronUnit=e.PredefinedExpressions=void 0;var t=io(),n=ao(),r=oo(),i=ro(),a;(function(e){e[`@yearly`]=`0 0 0 1 1 *`,e[`@annually`]=`0 0 0 1 1 *`,e[`@monthly`]=`0 0 0 1 * *`,e[`@weekly`]=`0 0 0 * * 0`,e[`@daily`]=`0 0 0 * * *`,e[`@hourly`]=`0 0 * * * *`,e[`@minutely`]=`0 * * * * *`,e[`@secondly`]=`* * * * * *`,e[`@weekdays`]=`0 0 0 * * 1-5`,e[`@weekends`]=`0 0 0 * * 0,6`})(a||(e.PredefinedExpressions=a={}));var o;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.DayOfMonth=`DayOfMonth`,e.Month=`Month`,e.DayOfWeek=`DayOfWeek`})(o||(e.CronUnit=o={}));var s;(function(e){e[e.jan=1]=`jan`,e[e.feb=2]=`feb`,e[e.mar=3]=`mar`,e[e.apr=4]=`apr`,e[e.may=5]=`may`,e[e.jun=6]=`jun`,e[e.jul=7]=`jul`,e[e.aug=8]=`aug`,e[e.sep=9]=`sep`,e[e.oct=10]=`oct`,e[e.nov=11]=`nov`,e[e.dec=12]=`dec`})(s||(e.Months=s={}));var c;(function(e){e[e.sun=0]=`sun`,e[e.mon=1]=`mon`,e[e.tue=2]=`tue`,e[e.wed=3]=`wed`,e[e.thu=4]=`thu`,e[e.fri=5]=`fri`,e[e.sat=6]=`sat`})(c||(e.DayOfWeek=c={}));var l=256,u=1024;e.CronExpressionParser=class e{static parse(s,c={}){let{strict:l=!1,hashSeed:u}=c,d=(0,r.seededRandom)(u);s=a[s]||s;let f=e.#e(s,l);if(f.dayOfMonth!==`*`&&f.dayOfWeek!==`*`&&l)throw Error(`Cannot use both dayOfMonth and dayOfWeek together in strict mode!`);let p=e.#t(o.Second,f.second,i.CronSecond.constraints,d,l),m=e.#t(o.Minute,f.minute,i.CronMinute.constraints,d,l),h=e.#t(o.Hour,f.hour,i.CronHour.constraints,d,l),g=e.#t(o.Month,f.month,i.CronMonth.constraints,d,l),_=e.#t(o.DayOfMonth,f.dayOfMonth,i.CronDayOfMonth.constraints,d,l),{dayOfWeek:v,nthDayOfWeek:y}=e.#h(f.dayOfWeek),b=e.#t(o.DayOfWeek,v,i.CronDayOfWeek.constraints,d,l),x=new t.CronFieldCollection({second:new i.CronSecond(p,{rawValue:f.second}),minute:new i.CronMinute(m,{rawValue:f.minute}),hour:new i.CronHour(h,{rawValue:f.hour}),dayOfMonth:i.CronDayOfMonth.fromMonth(g,_,{rawValue:f.dayOfMonth}),month:new i.CronMonth(g,{rawValue:f.month}),dayOfWeek:new i.CronDayOfWeek(b,{rawValue:f.dayOfWeek,nthDayOfWeek:y})});return new n.CronExpression(x,{...c,expression:s})}static#e(e,t){if(t&&!e.length)throw Error(`Invalid cron expression`);if(e||=`0 * * * * *`,e.length>u)throw Error(`Invalid cron expression, too long, expected at most ${u} characters`);let n=e.trim().split(/\s+/);if(t&&n.length<6)throw Error(`Invalid cron expression, expected 6 fields`);if(n.length>6)throw Error(`Invalid cron expression, too many fields`);let r=[`0`,`*`,`*`,`*`,`*`,`*`];n.length<r.length&&n.unshift(...r.slice(0,r.length-n.length));let[i,a,o,s,c,l]=n;return{second:i,minute:a,hour:o,dayOfMonth:s,month:c,dayOfWeek:l}}static#t(e,t,n,r,i){if((e===o.Month||e===o.DayOfWeek)&&(t=t.replace(/[a-z]{3}/gi,e=>{e=e.toLowerCase();let t=s[e]||c[e];if(t===void 0)throw Error(`Validation error, cannot resolve alias "${e}"`);return t.toString()})),!n.validChars.test(t))throw Error(`Invalid characters, got value: ${t}`);return t=this.#n(t,n),t=this.#r(t,n,r,e,i),this.#l(e,t,n)}static#n(e,t){return e.replace(/[*?]/g,t.min+`-`+t.max)}static#r(t,n,r,i,a){let o=r(),s=0;return t.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(t,r,c,l)=>{if(r&&c&&l){let t=parseInt(r,10),u=parseInt(c,10),d=parseInt(l,10);if(d<=0)throw Error(`Invalid step: ${d}, must be positive`);let f=e.#o(t,u,n,i,a);return s+=Math.ceil((f.max-f.min+1)/d),e.#c(i,s),e.#s(o,f.min,f.max,d,i,a)}if(r&&c){let t=parseInt(r,10),s=parseInt(c,10),l=e.#o(t,s,n,i,a);return String(e.#i(o,l.min,l.max))}if(l){let t=parseInt(l,10);if(t<=0)throw Error(`Invalid step: ${t}, must be positive`);return s+=Math.ceil((n.max-n.min+1)/t),e.#c(i,s),e.#s(o,n.min,n.max,t,i,a)}return String(e.#i(o,n.min,n.max))})}static#i(e,t,n){return Math.floor(e*(n-t+1))+t}static#a(e){return e.charAt(0).toLowerCase()+e.slice(1)}static#o(t,n,r,i,a){if(t>n)throw Error(`Invalid range: ${t}-${n}, min > max`);if(a&&(t<r.min||n>r.max))throw Error(`Invalid range: ${t}-${n}, outside the ${r.min}-${r.max} range of the ${e.#a(i)} field`);let o=Math.max(t,r.min),s=Math.min(n,r.max);if(o>s)throw Error(`Invalid range: ${t}-${n}, no usable value in the ${e.#a(i)} field`);return{min:o,max:s}}static#s(t,n,r,i,a,o){if(o&&i>r-n+1)throw Error(`Invalid step: ${i}, wider than the ${n}-${r} range of the ${e.#a(a)} field`);let s=Math.floor(t*i),c=[];for(let e=Math.floor(n/i)*i+s;e<=r;e+=i)e>=n&&c.push(e);return c.length===0?String(e.#i(t,n,r)):c.join(`,`)}static#c(e,t){if(t>l)throw Error(`Constraint error, too many values in ${e} field, expected at most ${l}`)}static#l(t,n,r){let i=[];function a(n,r){if(Array.isArray(n))i.push(...n);else if(e.#g(r,n))i.push(n);else{let e=parseInt(n.toString(),10);if(!(e>=r.min&&e<=r.max))throw Error(`Constraint error, got value ${n} expected range ${r.min}-${r.max}`);i.push(t===o.DayOfWeek?e%7:n)}}let s=n.split(`,`);for(let n of s){if(e.#c(t,i.length),!(n.length>0))throw Error(`Invalid list value format`);a(e.#u(t,n,r),r)}return i}static#u(t,n,r){let i=n.split(`/`);if(i.length>2)throw Error(`Invalid repeat: ${n}`);return i.length===2?(i[0].includes(`-`)||(i[0]=`${i[0]}-${r.max}`),e.#m(t,i[0],parseInt(i[1],10),r)):e.#m(t,n,1,r)}static#d(e,t,n){if(!(!isNaN(e)&&!isNaN(t)&&e>=n.min&&t<=n.max))throw Error(`Constraint error, got range ${e}-${t} expected range ${n.min}-${n.max}`);if(e>t)throw Error(`Invalid range: ${e}-${t}, min(${e}) > max(${t})`)}static#f(e){if(!(!isNaN(e)&&e>0))throw Error(`Constraint error, cannot repeat at every ${e} time.`)}static#p(e,t,n,r){let i=[];e===o.DayOfWeek&&n%7==0&&(n-t)%r===0&&i.push(0);for(let e=t;e<=n;e+=r)i.indexOf(e)===-1&&i.push(e);return i}static#m(e,t,n,r){let i=t.split(`-`);if(i.length<=1)return isNaN(+t)?t:+t;let[a,o]=i.map(e=>parseInt(e,10));return this.#d(a,o,r),this.#f(n),this.#p(e,a,o,n)}static#h(e){let t=e.split(`#`);if(t.length<=1)return{dayOfWeek:t[0]};let n=+t[t.length-1],r=e.match(/([,\-/])/);if(r!==null)throw Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r?.[0]}\` special characters are incompatible`);if(!(t.length<=2&&!isNaN(n)&&n>=1&&n<=5))throw Error(`Constraint error, invalid dayOfWeek occurrence number (#)`);return{dayOfWeek:t[0],nthDayOfWeek:n}}static#g(e,t){return e.chars.some(e=>t.toString().includes(e))}}})),co=o(((e,t)=>{t.exports={}})),lo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=void 0;var t=so();e.CronFileParser=class e{static async parseFile(t){let{readFile:n}=co(),r=await n(t,`utf8`);return e.#e(r)}static parseFileSync(t){let{readFileSync:n}=co(),r=n(t,`utf8`);return e.#e(r)}static#e(t){let n=t.split(`
`),r={variables:{},expressions:[],errors:{}};for(let t of n){let n=t.trim();if(n.length===0||n.startsWith(`#`))continue;let i=n.match(/^(.*)=(.*)$/);if(i){let[,e,t]=i;r.variables[e]=t.replace(/["']/g,``)}else try{let t=e.#t(n);r.expressions.push(t.interval)}catch(e){r.errors[n]=e}}return r}static#t(e){let n=e.split(/\s+/);return{interval:t.CronExpressionParser.parse(n.slice(0,5).join(` `)),command:n.slice(5,n.length)}}}})),uo=o(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;var a=so(),o=Xa();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var s=io();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return s.CronFieldCollection}});var c=ao();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return c.CronExpression}});var l=so();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return l.CronExpressionParser}});var u=lo();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return u.CronFileParser}}),i(ro(),e),e.default=a.CronExpressionParser}))(),fo=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function po(e,t){let n=Pa(e);if(n!==``)try{return uo.CronExpressionParser.parse(n,{currentDate:t})}catch{return}}function mo(e,t){let n=po(e,t);if(n?.hasNext())return n.next().toDate()}function ho(e,t,n){let r=po(e,t);if(!r)return[];let i=[];for(;i.length<n&&r.hasNext();)i.push(r.next().toDate());return i}function go(e){return e.schedules&&e.schedules.length>0?e.schedules:[e.schedule]}function _o(e,t){return e.map(e=>mo(e,t)).filter(e=>e!==void 0).sort((e,t)=>e.getTime()-t.getTime())[0]}function vo(e,t,n){let r=e.flatMap(e=>ho(e,t,n)),i=new Set;return r.sort((e,t)=>e.getTime()-t.getTime()).filter(e=>{let t=e.getTime();return!i.has(t)&&(i.add(t),!0)}).slice(0,n)}function yo(e,t,n){let r=mo(e,t);return r!==void 0&&r.getTime()-t.getTime()<=n}function bo(e,t){let n=Math.floor((t.getTime()-e.getTime())/1e3);if(n<=0)return`now`;let r=Math.floor(n/60);if(r<1)return`in <1m`;if(r<60)return`in ${r}m`;let i=Math.floor(r/60);if(i<24){let e=r%60;return e===0?`in ${i}h`:`in ${i}h ${e}m`}return`in ${Math.floor(i/24)}d`}function xo(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function So(e,t){let n=`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`,r=Math.round((xo(t).getTime()-xo(e).getTime())/864e5);return r===0?n:r===1?`tomorrow ${n}`:`${fo[t.getMonth()]} ${t.getDate()}, ${n}`}var Co=[`SUN`,`MON`,`TUE`,`WED`,`THU`,`FRI`,`SAT`],wo=[`JANUARY`,`FEBRUARY`,`MARCH`,`APRIL`,`MAY`,`JUNE`,`JULY`,`AUGUST`,`SEPTEMBER`,`OCTOBER`,`NOVEMBER`,`DECEMBER`];function To(e,t){let n=e.getFullYear()*12+e.getMonth()+t,r=Math.floor(n/12),i=(n%12+12)%12;return new Date(r,i,1)}var Eo=2e3;function Do(e,t){let n=xo(t),r=po(e,new Date(n.getTime()-1e3));if(!r)return[];let i=new Date(n.getTime()+864e5),a=[];for(let e=0;e<Eo&&r.hasNext();e++){let e=r.next().toDate();if(!(e.getTime()<n.getTime())){if(e.getTime()>=i.getTime())break;a.push(e)}}return a}function Oo(e,t){let n=po(e,new Date(t.getTime()-1e3));if(!n)return;let r=Array(42).fill(0),i=xo(t).getTime();for(let e=0;e<4e3&&n.hasNext();e++){let e=n.next().toDate(),t=Math.floor((xo(e).getTime()-i)/864e5);if(!(t<0)){if(t>=42)break;r[t]=(r[t]??0)+1}}return r}function ko(e){switch(e){case`nav-overview`:return`home`;case`nav-routines`:case`routine`:return`routines`;case`nav-runs`:return`runs`;case`nav-heatmap`:return`heatmap`;case`nav-reliability`:return`reliability`;case`nav-machines`:return`machines`;case`nav-agents`:return`agents`;case`nav-settings`:return`settings`;default:return}}function Ao(e){switch(e){case`nav-overview`:case`nav-routines`:case`nav-runs`:case`nav-heatmap`:case`nav-reliability`:case`nav-machines`:case`nav-agents`:case`nav-settings`:return`GO`;case`routine`:return`ROUTINE`;default:return`ACTION`}}function jo(e,t){let n=t.trim();if(n===``)return 0;let r=[...e.toLowerCase()],i=[...n.toLowerCase()],a=0,o=0,s;for(let e of i){let t;for(;o<r.length;){let n=r[o];if(o+=1,n===e){t=o-1;break}}if(t===void 0)return;a+=1,t===0?a+=10:/[a-z0-9]/i.test(r[t-1]??``)||(a+=6),s!==void 0&&t===s+1&&(a+=8),s=t}return a-=Math.floor(r.length/16),a}function Mo(e,t){let n=jo(e.title,t),r=jo(e.keywords,t),i=r===void 0?void 0:r-4;return n!==void 0&&i!==void 0?Math.max(n,i):n??i}function No(e,t){let n=[];return e.forEach((e,r)=>{let i=Mo(e,t);i!==void 0&&n.push([r,i])}),n.sort(([e,t],[n,r])=>r-t||e-n),n.map(([e])=>e)}function Po(e,t){return e||(t.trim()===``?`—`:t)}function Fo(e){let t=Po(e.schedule_description,go(e).join(`, `)),n=[];return e.enabled?(e.skip_runs??0)>0?n.push(`SNOOZED`):e.agent_registered||n.push(`AGENT MISSING`):n.push(`DISABLED`),e.flag_count>0&&n.push(`FLAGS`),n.length===0?t:`${t} — ${n.join(`, `)}`}function Io(e){let t=[{kind:`nav-overview`,title:`Overview`,subtitle:`Fleet summary & upcoming runs`,keywords:`home dashboard kpi summary landing`},{kind:`nav-routines`,title:`Routines`,subtitle:`Manage agent-driven routines`,keywords:`agents automation`},{kind:`nav-runs`,title:`Runs`,subtitle:`Fleet-wide filterable run history`,keywords:`history activity feed builds jobs log runs`},{kind:`nav-heatmap`,title:`Heatmap`,subtitle:`7-day x 24-hour fire-density grid`,keywords:`schedule density grid busy collisions calendar`},{kind:`nav-reliability`,title:`Reliability`,subtitle:`Success rate, streaks & duration regressions`,keywords:`flaky failing streak p50 p95 duration regression health`},{kind:`nav-machines`,title:`Machines`,subtitle:`Per-host fleet inventory`,keywords:`fleet hosts inventory nodes servers`},{kind:`nav-agents`,title:`Agents`,subtitle:`Per-agent health, success rate & models`,keywords:`claude codex opencode cli registry models executors`},{kind:`nav-settings`,title:`Settings`,subtitle:`Preferences, appearance, refresh cadence, and prompt`,keywords:`config preferences user prompt theme light dark appearance refresh cadence`},{kind:`action-refresh`,title:`Refresh`,subtitle:`Re-poll server health`,keywords:`reload health status action`},{kind:`action-stop`,title:`Stop Server`,subtitle:`Shut the moadim server down`,keywords:`shutdown halt kill quit action`},{kind:`action-shortcuts`,title:`Keyboard Shortcuts`,subtitle:`View all shortcuts, including go-to navigation chords`,keywords:`help cheatsheet hotkeys nav chord action`}];for(let n of e)t.push({kind:`routine`,title:n.title,subtitle:Fo(n),keywords:`${n.id} ${n.agent} ${go(n).join(` `)} ${(n.tags??[]).join(` `)} routine`,routineId:n.id});return t}function Lo(e,t){return t===0?0:Math.min(e,t-1)}function Ro(e,t){return t===0?0:Math.min(e+1,t-1)}function zo(e){return Math.max(0,e-1)}function Bo(e){return Math.max(0,e-1)}var U={home:`/`,routines:`/routines`,runs:`/runs`,heatmap:`/heatmap`,reliability:`/reliability`,machines:`/machines`,agents:`/agents`,settings:`/settings`};function Vo({open:e,onClose:t,onRefresh:n,onStop:r,onShortcuts:i}){let a=ut(),o=Ki(),{addToast:s}=Ka(),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(0),f=(0,_.useRef)(null),{data:p}=oi({queryKey:[`command-palette`,`routines`],queryFn:async()=>Ei(await V.GET(`/routines`)),enabled:e}),[m,h]=(0,_.useState)(e);if(e!==m&&(h(e),e&&(l(``),d(0))),(0,_.useEffect)(()=>{e&&f.current?.focus()},[e]),!e)return null;let g=Io(p??[]),v=No(g,c),y=Lo(u,v.length),b=e=>{let o=g[v[e]??-1];if(o)switch(o.kind){case`action-refresh`:n();break;case`action-stop`:r();break;case`action-shortcuts`:i();break;case`routine`:a(`/routines?history=${encodeURIComponent(o.routineId??``)}`);break;default:{let e=ko(o.kind);e&&a(U[e]??`/`)}}t()},x=e=>{let n=g[v[e]??-1];if(!n||n.kind!==`routine`||!n.routineId)return;let r=n.routineId,i=n.title;o.mutate(r,{onSuccess:()=>s(`Triggered "${i}"`,`ok`),onError:e=>s(`Trigger failed: ${e.message}`,`err`)}),t()},S=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),d(Ro(y,v.length));break;case`ArrowUp`:e.preventDefault(),d(zo(y));break;case`Home`:e.preventDefault(),d(0);break;case`End`:e.preventDefault(),d(Bo(v.length));break;case`Enter`:e.preventDefault(),e.metaKey||e.ctrlKey?x(y):b(y);break;case`Escape`:e.preventDefault(),t()}},C=v.length>0?`cmdk-opt-${y}`:void 0;return(0,z.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,z.jsxs)(`div`,{className:`cmdk`,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,onClick:e=>e.stopPropagation(),children:[(0,z.jsxs)(`div`,{className:`cmdk-search`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,z.jsx)(`input`,{ref:f,className:`cmdk-input`,type:`text`,placeholder:`Search pages, routines…`,autoComplete:`off`,spellCheck:!1,role:`combobox`,"aria-expanded":`true`,"aria-controls":`cmdk-listbox`,"aria-autocomplete":`list`,"aria-activedescendant":C,value:c,onChange:e=>{l(e.target.value),d(0)},onKeyDown:S}),(0,z.jsx)(`span`,{className:`cmdk-hint`,"aria-hidden":`true`,children:`ESC`})]}),v.length===0?(0,z.jsxs)(`div`,{className:`cmdk-empty`,children:[(0,z.jsx)(`div`,{children:`NO MATCHES`}),(0,z.jsx)(`div`,{children:`no page or routine matches`})]}):(0,z.jsx)(`ul`,{id:`cmdk-listbox`,className:`cmdk-list`,role:`listbox`,"aria-label":`Results`,children:v.map((e,t)=>{let n=g[e];if(!n)return null;let r=t===y;return(0,z.jsxs)(`li`,{id:`cmdk-opt-${t}`,className:`cmdk-row${r?` active`:``}`,role:`option`,"aria-selected":r,onClick:()=>b(t),onMouseEnter:()=>d(t),children:[(0,z.jsx)(`span`,{className:`kind-badge`,children:Ao(n.kind)}),(0,z.jsxs)(`span`,{className:`cmdk-row-text`,children:[(0,z.jsx)(`span`,{className:`cmdk-row-title`,children:n.title}),(0,z.jsx)(`span`,{className:`cmdk-row-sub`,children:n.subtitle})]}),n.kind===`routine`&&(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm cmdk-row-action`,title:`Trigger now (⌘⏎)`,"aria-label":`Trigger ${n.title} now`,onClick:e=>{e.stopPropagation(),x(t)},children:`⚡`})]},e)})}),(0,z.jsxs)(`div`,{className:`cmdk-foot`,"aria-hidden":`true`,children:[(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`span`,{className:`cmdk-key`,children:`↑↓`}),` navigate`]}),(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`span`,{className:`cmdk-key`,children:`↵`}),` open`]}),(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`span`,{className:`cmdk-key`,children:`⌘↵`}),` trigger routine`]}),(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`span`,{className:`cmdk-key`,children:`esc`}),` close`]})]})]})})}function Ho({current:e,onCancel:t,onConfirm:n}){let[r,i]=(0,_.useState)(e),[a,o]=(0,_.useState)(!1),s=r.trim(),c=async()=>{if(s!==``){o(!0);try{await n(s)}finally{o(!1)}}};return(0,z.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,z.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`rename-machine-title`,onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(`div`,{id:`rename-machine-title`,className:`dialog-title`,children:`Rename machine`}),(0,z.jsxs)(`div`,{className:`dialog-msg`,children:[(0,z.jsx)(`label`,{className:`form-label`,htmlFor:`rename-machine-input`,children:`Machine name`}),(0,z.jsx)(`input`,{id:`rename-machine-input`,className:`form-input`,type:`text`,value:r,onChange:e=>i(e.target.value),disabled:a,autoComplete:`off`,spellCheck:!1})]}),(0,z.jsxs)(`div`,{className:`dialog-actions`,children:[(0,z.jsx)(`button`,{className:`btn btn-ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,z.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>void c(),disabled:a||s===``,children:a?`Saving…`:`Rename`})]})]})})}function Uo({onClose:e}){return(0,z.jsx)(`div`,{className:`overlay`,onClick:e,children:(0,z.jsxs)(`div`,{className:`dialog shortcuts-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`shortcuts-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(`div`,{id:`shortcuts-dialog-title`,className:`dialog-title`,children:`⌨ Keyboard shortcuts`}),(0,z.jsxs)(`ul`,{className:`shortcuts-list`,children:[(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`span`,{className:`cmdk-key`,children:`⌘K`}),(0,z.jsx)(`span`,{className:`cmdk-key`,children:`Ctrl K`}),(0,z.jsx)(`span`,{children:`Open command palette`})]}),(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`span`,{className:`cmdk-key`,children:`?`}),(0,z.jsx)(`span`,{children:`Toggle this help`})]}),(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`span`,{className:`cmdk-key`,children:`Esc`}),(0,z.jsx)(`span`,{children:`Close any open dialog`})]}),Aa.map(e=>(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`span`,{className:`cmdk-key`,children:`G`}),(0,z.jsx)(`span`,{className:`cmdk-key`,children:e.key.toUpperCase()}),(0,z.jsxs)(`span`,{children:[`Go to `,e.label]})]},e.key))]}),(0,z.jsx)(`div`,{className:`dialog-actions`,children:(0,z.jsx)(`button`,{className:`btn btn-ghost`,onClick:e,children:`Close`})})]})})}function Wo({onCancel:e,onConfirm:t}){return(0,z.jsx)(`div`,{className:`overlay`,onClick:e,children:(0,z.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`shutdown-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(`div`,{id:`shutdown-dialog-title`,className:`dialog-title`,children:`⏻ Stop server`}),(0,z.jsx)(`div`,{className:`dialog-msg`,children:`Stop the moadim server? Scheduled jobs and routines will not run until it is started again.`}),(0,z.jsxs)(`div`,{className:`dialog-actions`,children:[(0,z.jsx)(`button`,{className:`btn btn-ghost`,onClick:e,children:`Cancel`}),(0,z.jsx)(`button`,{className:`btn btn-danger`,onClick:t,children:`Stop server`})]})]})})}function Go(){let{toasts:e}=Ka();return(0,z.jsx)(`div`,{className:`toast-wrap`,role:`status`,"aria-live":`polite`,"aria-atomic":`false`,children:e.map(e=>(0,z.jsx)(`div`,{className:`toast ${e.kind}`,children:e.msg},e.id))})}var Ko=900,qo=50,Jo=15e3;function Yo(){let[e,t]=(0,_.useState)(Da),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),u=ut(),d=Bn(),{addToast:f}=Ka(),p=Oi(3e4),m=ji(),h=Ai(),g=Ni(),v=Qi(qo,{refetchInterval:Jo}),y=zi({local_only:!0},{refetchInterval:Jo}),[b,x]=(0,_.useState)(va),S=(0,_.useRef)(null),C=()=>l(e=>!e);return(0,_.useEffect)(()=>{let e=v.data;if(e===void 0)return;if(S.current===null){S.current=fa(e);return}let t=pa(e,S.current);S.current=fa(e),t.length!==0&&x(e=>{let n=ba(e,t);return ya(n),n})},[v.data]),(0,_.useEffect)(()=>{let e=y.data;e!==void 0&&queueMicrotask(()=>{x(t=>{let n=Sa(t,e);return n!==t&&ya(n),n})})},[y.data]),(0,_.useEffect)(()=>{ka(e)},[e]),(0,_.useEffect)(()=>{let e=()=>t(Da());return window.addEventListener(Ea,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(Ea,e),window.removeEventListener(`storage`,e)}},[]),(0,_.useEffect)(()=>{let e=!1,t,n=()=>{e=!1,clearTimeout(t)},i=i=>{if((i.metaKey||i.ctrlKey)&&i.key.toLowerCase()===`k`)i.preventDefault(),a(e=>!e);else if(i.key===`Escape`)r(!1),s(!1),l(!1),n();else if(!(i.metaKey||i.ctrlKey||i.altKey||Ma(i.target))){if(e){n();let e=ja(i.key);e&&(i.preventDefault(),u(e))}else i.key.toLowerCase()===`g`?(e=!0,t=setTimeout(n,Ko)):i.key===`?`&&(i.preventDefault(),C())}};return window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,i),clearTimeout(t)}},[u]),(0,z.jsxs)(`div`,{className:`app-shell`,children:[(0,z.jsx)(Va,{health:p.data,healthOk:p.data?.running??!1,machineName:m.data?.name,onRefresh:()=>void p.refetch(),onStop:()=>r(!0),onPalette:()=>a(e=>!e),onRenameMachine:()=>s(!0),onShortcuts:C,notifications:{entries:b,onMarkAllRead:()=>{x(e=>{let t=wa(e);return t!==e&&ya(t),t})},onClear:()=>{x([]),ya([])}}}),(0,z.jsx)(Ua,{}),(0,z.jsx)(`div`,{className:`page`,children:(0,z.jsx)(It,{})}),(0,z.jsx)(Vo,{open:i,onClose:()=>a(!1),onRefresh:()=>void p.refetch(),onStop:()=>r(!0),onShortcuts:C}),c&&(0,z.jsx)(Uo,{onClose:()=>l(!1)}),o&&(0,z.jsx)(Ho,{current:m.data?.name??``,onCancel:()=>s(!1),onConfirm:async e=>{try{await g.mutateAsync(e),s(!1),f(`Machine renamed to "${e}"`,`ok`)}catch(e){throw f(`Rename failed: ${e instanceof Error?e.message:String(e)}`,`err`),e}}}),n&&(0,z.jsx)(Wo,{onCancel:()=>r(!1),onConfirm:()=>{r(!1),h.mutate(void 0,{onSuccess:()=>{f(`Server stopping…`,`ok`),d.invalidateQueries({queryKey:[`health`]})},onError:e=>f(`Stop failed: ${e.message}`,`err`)})}}),(0,z.jsx)(Go,{})]})}function Xo({status:e,onUnlock:t}){return!e||!e.locked?null:(0,z.jsxs)(`div`,{className:`card`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`10px 14px`,marginBottom:16,borderColor:`var(--warn)`},children:[(0,z.jsxs)(`div`,{style:{fontSize:13,fontWeight:600},children:[`⚠ Routines globally locked — scheduling and manual triggers paused`,e.shared&&(0,z.jsx)(`span`,{style:{marginLeft:8,fontSize:11,color:`var(--text-faint)`},children:`SHARED .lock`}),e.local&&(0,z.jsx)(`span`,{style:{marginLeft:8,fontSize:11,color:`var(--text-faint)`},children:`LOCAL .local.lock`})]}),(0,z.jsx)(`button`,{className:`btn btn-ghost`,onClick:t,children:`Unlock all`})]})}function Zo(e=1e3){let[t,n]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Qo=[{token:`off`,label:`Off`,ms:void 0},{token:`5`,label:`5s`,ms:5e3},{token:`15`,label:`15s`,ms:15e3},{token:`30`,label:`30s`,ms:3e4},{token:`60`,label:`60s`,ms:6e4}],$o=`moadim.refresh-interval`,es=`moadim-refresh-interval-change`;function ts(e){return e===`off`||e===`5`||e===`15`||e===`30`||e===`60`}function ns(e){return Qo.find(t=>t.token===e)?.ms}function rs(){try{let e=localStorage.getItem($o);return ts(e)?e:`off`}catch{return`off`}}function is(e){try{localStorage.setItem($o,e),window.dispatchEvent(new CustomEvent(es))}catch{}}function as(e){return e<60?`updated just now`:e<3600?`updated ${Math.floor(e/60)}m ago`:`updated ${Math.floor(e/3600)}h ago`}function os(){let[e,t]=(0,_.useState)(rs);return(0,_.useEffect)(()=>{let e=()=>t(rs()),n=t=>{t.key===`moadim.refresh-interval`&&e()};return window.addEventListener(es,e),window.addEventListener(`storage`,n),()=>{window.removeEventListener(es,e),window.removeEventListener(`storage`,n)}},[]),e}function ss({token:e,updatedAtMs:t,onChange:n}){let r=Zo(),i=t>0?as(Math.max(0,Math.floor((r-t)/1e3))):void 0;return(0,z.jsxs)(`div`,{className:`refresh-control`,children:[(0,z.jsx)(`label`,{className:`refresh-lbl`,htmlFor:`refresh-interval`,children:`AUTO`}),(0,z.jsx)(`select`,{id:`refresh-interval`,className:`refresh-select`,value:e,"aria-label":`Auto-refresh interval`,onChange:e=>n(e.target.value),children:Qo.map(e=>(0,z.jsx)(`option`,{value:e.token,children:e.label},e.token))}),i!==void 0&&(0,z.jsx)(`span`,{className:`refresh-fresh`,title:`Time since the list last refreshed`,children:i})]})}function cs({updatedAtMs:e}){let t=Zo();if(e<=0)return null;let n=as(Math.max(0,Math.floor((t-e)/1e3)));return(0,z.jsx)(`span`,{className:`refresh-fresh`,title:`Time since the list last refreshed`,children:n})}var ls=36e5,us={"auto-disabled":0,dormant:1,"dead-schedule":2,"agent-unregistered":3,"has-open-flags":4},ds={"auto-disabled":`AUTO-DISABLED`,dormant:`DORMANT`,"dead-schedule":`DEAD SCHEDULE`,"agent-unregistered":`AGENT MISSING`,"has-open-flags":`OPEN FLAGS`},fs={"auto-disabled":`the failure circuit-breaker disabled this — investigate and re-enable`,dormant:`assigned to no machine — fires nowhere`,"dead-schedule":`schedule has no future fire — never runs again`,"agent-unregistered":`agent not registered — every run errors`,"has-open-flags":`agent raised flags during a run — needs review`};function ps(e,t){return e<t?-1:+(e>t)}function ms(e,t){if(!e.enabled)return e.autoDisabledReason===void 0?void 0:`auto-disabled`;if(e.machinesEmpty)return`dormant`;if(_o(go(e),t)===void 0)return`dead-schedule`;if(e.agentRegistered===!1)return`agent-unregistered`;if(e.flagCount>0)return`has-open-flags`}function hs(e,t){let n=[];for(let r of e){let e=ms(r,t);e!==void 0&&n.push({kind:r.kind,label:r.label,reason:e,flagCount:r.flagCount})}return n.sort((e,t)=>us[e.reason]-us[t.reason]||ps(e.label,t.label)),n}function gs(e,t){let n=e.length,r=e.filter(e=>e.enabled).length,i=e.filter(e=>e.enabled&&!e.snoozed&&go(e).some(e=>yo(e,t,36e5))).length,a=e.reduce((e,t)=>e+t.flagCount,0),o=e.filter(e=>e.enabled&&e.snoozed).length,s=e.filter(e=>e.enabled&&e.machinesEmpty).length;return{total:n,enabled:r,disabled:n-r,dueSoon:i,attention:hs(e,t).length,flags:a,snoozed:o,dormant:s}}function _s(e,t){let n=[];for(let r of e){if(!r.enabled||r.snoozed)continue;let e=_o(go(r),t);e!==void 0&&n.push({kind:r.kind,id:r.id,label:r.label,human:r.human,schedule:r.schedule,at:e,soon:e.getTime()-t.getTime()<=ls,flagCount:r.flagCount})}return n.sort((e,t)=>e.at.getTime()-t.at.getTime()||ps(e.label,t.label)),n.slice(0,8)}function vs(e,t){return e[0]===void 0?void 0:bo(t,e[0].at)}function ys(e){return(e??[]).every(e=>e.trim()===``)}function bs(e,t){let n=e.snoozed_until!=null&&e.snoozed_until>Math.floor(t.getTime()/1e3),r=e.skip_runs!=null&&e.skip_runs>0;return n||r}function xs(e,t){return{kind:`routine`,id:e.id,label:e.title,schedule:e.schedule,schedules:go(e),human:e.schedule_description??void 0,enabled:e.enabled,machinesEmpty:ys(e.machines),agentRegistered:e.agent_registered,flagCount:e.flag_count,snoozed:bs(e,t),autoDisabledReason:e.auto_disabled_reason??void 0}}function Ss(e,t){return e.map(e=>xs(e,t))}function Cs({items:e}){return(0,z.jsx)(`div`,{className:`table-wrap attn-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`TYPE`}),(0,z.jsx)(`th`,{children:`NAME`}),(0,z.jsx)(`th`,{children:`ISSUE`}),(0,z.jsx)(`th`,{children:`DETAIL`})]})}),(0,z.jsx)(`tbody`,{children:e.map((e,t)=>(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:`kind-badge routine`,children:`ROUTINE`})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{className:`ov-name-link`,to:`/routines`,children:e.label})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:`attn-badge`,children:ds[e.reason]})}),(0,z.jsx)(`td`,{className:`attn-detail`,children:e.reason===`has-open-flags`&&e.flagCount>0?`${e.flagCount} open flag${e.flagCount===1?``:`s`} — needs review`:fs[e.reason]})]},t))})]})})}function ws({enabled:e,onToggle:t}){return(0,z.jsx)(`button`,{type:`button`,className:e?`btn btn-sm btn-ghost notify-toggle active`:`btn btn-sm btn-ghost notify-toggle`,title:e?`Desktop notifications on failure: on (click to turn off)`:`Get a desktop notification when a run fails`,"aria-pressed":e,onClick:()=>t(!e),children:e?`🔔 Notify on failure`:`🔕 Notify on failure`})}function Ts({kpis:e,nextRun:t}){return(0,z.jsxs)(`div`,{className:`stats`,children:[(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`SCHEDULED`}),(0,z.jsx)(`div`,{className:`stat-val`,children:e.total})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`ENABLED`}),(0,z.jsx)(`div`,{className:`stat-val c-accent`,children:e.enabled})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`DUE SOON`}),(0,z.jsx)(`div`,{className:`stat-val c-red`,children:e.dueSoon})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`ATTENTION`}),(0,z.jsx)(`div`,{className:`stat-val ${e.attention>0?`c-red`:`c-accent`}`,children:e.attention})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`DISABLED`}),(0,z.jsx)(`div`,{className:`stat-val c-amber`,children:e.disabled})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`DORMANT`}),(0,z.jsx)(`div`,{className:`stat-val ${e.dormant>0?`c-amber`:``}`,children:e.dormant})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FLAGS`}),(0,z.jsx)(`div`,{className:`stat-val ${e.flags>0?`c-red`:`c-accent`}`,children:e.flags})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`SNOOZED`}),(0,z.jsx)(`div`,{className:`stat-val ${e.snoozed>0?`c-amber`:`c-accent`}`,children:e.snoozed})]}),(0,z.jsxs)(`div`,{className:`stat-card stat-card-wide`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`NEXT RUN`}),(0,z.jsx)(`div`,{className:`stat-val stat-val-sm`,children:t??`—`})]})]})}function Es(e){return`run-status ${e}`}function Ds(e){switch(e){case`running`:return`RUNNING`;case`success`:return`SUCCESS`;case`failed`:return`FAILED`;default:return`UNKNOWN`}}function Os(e,t){let n=Math.max(0,t-e);return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}function ks(e,t){if(e>=t)return`expired`;let n=t-e;return n<60?`expires in <1m`:n<3600?`expires in ${Math.floor(n/60)}m`:`expires in ${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}function As({runs:e,loading:t}){return t?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS YET`})]})}):(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`ROUTINE`}),(0,z.jsx)(`th`,{children:`STARTED`}),(0,z.jsx)(`th`,{children:`DURATION`}),(0,z.jsx)(`th`,{children:`STATUS`}),(0,z.jsx)(`th`,{children:`EXIT CODE`})]})}),(0,z.jsx)(`tbody`,{children:e.map(e=>(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.routine_id)}`,children:e.routine_title})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`div`,{className:`cell-time`,title:Ra(e.started_at),children:Ia(e.started_at)})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:`cell-meta`,children:e.finished_at==null?`—`:Os(e.started_at,e.finished_at)})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:Es(e.status),children:Ds(e.status)})}),(0,z.jsx)(`td`,{children:e.exit_code==null?`—`:e.exit_code})]},e.workbench))})]})})}function js({digest:e,sinceSecs:t,onMarkSeen:n}){let r=e.failed===0&&e.succeeded===0;return(0,z.jsxs)(`section`,{"aria-label":`Since your last visit`,children:[(0,z.jsxs)(`div`,{className:`section-hd`,children:[(0,z.jsx)(`span`,{className:e.failed>0?`section-label attn`:`section-label`,children:`SINCE YOUR LAST VISIT`}),(0,z.jsxs)(`div`,{className:`section-acts`,children:[(0,z.jsx)(`span`,{className:`cell-meta`,title:Ra(t),children:Ia(t)}),!r&&(0,z.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-ghost`,onClick:n,children:`Mark as seen`})]})]}),r?(0,z.jsx)(`p`,{className:`cell-meta`,children:`No runs finished since your last visit.`}):(0,z.jsxs)(`p`,{className:`cell-meta`,children:[(0,z.jsxs)(`span`,{className:e.failed>0?`c-red`:void 0,children:[e.failed,` failed`]}),` ·`,` `,e.succeeded,` succeeded`,e.truncated&&` · older runs not loaded, counts may be low`]}),e.routines.length>0&&(0,z.jsx)(`div`,{className:`table-wrap attn-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`ROUTINE`}),(0,z.jsx)(`th`,{children:`FAILURES`}),(0,z.jsx)(`th`,{children:`LATEST FAILURE`}),(0,z.jsx)(`th`,{children:`NOW`})]})}),(0,z.jsx)(`tbody`,{children:e.routines.map(e=>(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{className:`ov-name-link`,to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.routineTitle})}),(0,z.jsx)(`td`,{children:e.failures}),(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/runs/${encodeURIComponent(e.routineId)}/${encodeURIComponent(e.latestFailure.workbench)}`,title:Ra(e.latestFailure.finished_at??0),children:Ia(e.latestFailure.finished_at??0)})}),(0,z.jsx)(`td`,{children:e.recovered?(0,z.jsx)(`span`,{className:`run-status success`,children:`RECOVERED`}):(0,z.jsx)(`span`,{className:`run-status failed`,children:`FAILING`})})]},e.routineId))})]})})]})}var Ms=`moadim.client.overview.lastSeen`;function Ns(e,t,n){let r=0,i=0,a=new Map,o=new Map;for(let n of e){if(n.finished_at==null||(a.has(n.routine_id)||a.set(n.routine_id,n.status),n.finished_at<=t)||(n.status===`success`&&i++,n.status!==`failed`))continue;r++;let e=o.get(n.routine_id);e?e.failures++:o.set(n.routine_id,{routineId:n.routine_id,routineTitle:n.routine_title,failures:1,latestFailure:n,recovered:a.get(n.routine_id)===`success`})}let s=[...o.values()].sort((e,t)=>Number(e.recovered)-Number(t.recovered)||(t.latestFailure.finished_at??0)-(e.latestFailure.finished_at??0)),c=e[e.length-1],l=e.length>=n&&c!==void 0&&c.started_at>t;return{failed:r,succeeded:i,routines:s,truncated:l}}function Ps(e){try{let e=Number(localStorage.getItem(Ms));if(Number.isFinite(e)&&e>0)return e}catch{return e}return Fs(e),e}function Fs(e){try{localStorage.setItem(Ms,String(e))}catch{}}function Is({runs:e,now:t,loading:n,error:r,onTrigger:i}){return r===void 0?n?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`◷`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO UPCOMING RUNS`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`no enabled routine is scheduled to fire`})]})}):(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`TYPE`}),(0,z.jsx)(`th`,{children:`NAME`}),(0,z.jsx)(`th`,{children:`SCHEDULE`}),(0,z.jsx)(`th`,{children:`NEXT RUN`}),(0,z.jsx)(`th`,{})]})}),(0,z.jsx)(`tbody`,{children:e.map((e,n)=>(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:`kind-badge routine`,children:`ROUTINE`})}),(0,z.jsxs)(`td`,{children:[(0,z.jsx)(En,{className:`ov-name-link`,to:`/routines`,children:e.label}),e.flagCount>0&&(0,z.jsx)(`span`,{className:`ov-flag-badge`,title:`${e.flagCount} open flag${e.flagCount===1?``:`s`}`,children:`⚑ ${e.flagCount}`})]}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`div`,{className:`cell-schedule-human`,children:e.human??e.schedule})}),(0,z.jsxs)(`td`,{className:`cell-next`,children:[(0,z.jsx)(`div`,{className:`cell-next-when`,children:So(t,e.at)}),(0,z.jsx)(`div`,{className:e.soon?`cell-next-until soon`:`cell-next-until`,children:bo(t,e.at)})]}),(0,z.jsx)(`td`,{className:`cell-act`,children:(0,z.jsx)(`button`,{className:`btn btn-sm btn-ghost run-now-btn`,title:`Trigger now`,onClick:()=>i(e.id),children:`▶ RUN`})})]},n))})]})}):(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:r})]})})}var Ls=8,Rs=300,zs=1e4;function Bs(){let e=Bn(),{addToast:t}=Ka(),n=zi(),r=Qi(Ls),i=Qi(Rs),[a,o]=(0,_.useState)(()=>Ps(Math.floor(Date.now()/1e3))),s=Xi(),c=Zi(),l=Ki(),[u,d]=(0,_.useState)(()=>new Date),f=os(),[p,m]=(0,_.useState)(sa),h=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=setInterval(()=>d(new Date),zs);return()=>clearInterval(e)},[]),(0,_.useEffect)(()=>{let t=ns(f);if(t===void 0)return;let n=setInterval(()=>{e.invalidateQueries({queryKey:[`routines`]})},t);return()=>clearInterval(n)},[f,e]),(0,_.useEffect)(()=>{if(!p){h.current=null;return}let e=r.data;if(e!==void 0){if(h.current===null)h.current=fa(e);else{for(let t of pa(e,h.current))ha(t);h.current=fa(e)}}},[r.data,p]);let g=(0,_.useCallback)(e=>{e?da().then(e=>{e===`granted`?(ca(!0),m(!0)):t(e===`unsupported`?`Desktop notifications aren't supported in this browser`:`Notification permission was denied`,`err`)}):(ca(!1),m(!1))},[t]),v=(0,_.useCallback)(e=>{l.mutate(e,{onSuccess:()=>t(`Triggered`,`ok`),onError:e=>t(`Trigger failed: ${e instanceof Error?e.message:String(e)}`,`err`)})},[l,t]),y=(0,_.useCallback)(()=>{let e=Math.floor(Date.now()/1e3);Fs(e),o(e)},[]),b=(0,_.useCallback)(()=>{c.mutate(`all`)},[c]),x=Ss(n.data??[],u),S=gs(x,u),C=hs(x,u),w=_s(x,u),T=vs(w,u),E=Math.max(n.dataUpdatedAt,r.dataUpdatedAt,s.dataUpdatedAt),D=n.error instanceof Error?n.error.message:void 0;return(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`page-title`,children:`Overview`}),(0,z.jsx)(Xo,{status:s.data,onUnlock:b}),(0,z.jsx)(Ts,{kpis:S,nextRun:T}),i.data&&(0,z.jsx)(js,{digest:Ns(i.data,a,Rs),sinceSecs:a,onMarkSeen:y}),C.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`section-hd`,children:(0,z.jsx)(`span`,{className:`section-label attn`,children:`NEEDS ATTENTION`})}),(0,z.jsx)(Cs,{items:C})]}),(0,z.jsxs)(`div`,{className:`section-hd`,children:[(0,z.jsx)(`span`,{className:`section-label`,children:`UPCOMING RUNS`}),(0,z.jsx)(`div`,{className:`section-acts`,children:(0,z.jsx)(cs,{updatedAtMs:E})})]}),(0,z.jsx)(Is,{runs:w,now:u,loading:n.isLoading,error:D,onTrigger:v}),(0,z.jsxs)(`div`,{className:`section-hd`,children:[(0,z.jsx)(`span`,{className:`section-label`,children:`RECENT RUNS`}),(0,z.jsx)(`div`,{className:`section-acts`,children:(0,z.jsx)(ws,{enabled:p,onToggle:g})})]}),(0,z.jsx)(As,{runs:r.data??[],loading:r.isLoading})]})}function Vs({count:e,onEnable:t,onDisable:n,onDelete:r,onClear:i}){return e===0?null:(0,z.jsxs)(`div`,{className:`bulk-bar`,children:[(0,z.jsxs)(`span`,{className:`bulk-count`,children:[e,` SELECTED`]}),(0,z.jsxs)(`div`,{className:`bulk-acts`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:t,children:`ENABLE`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`DISABLE`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-danger btn-sm`,onClick:r,children:`DELETE`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR`})]})]})}function Hs({count:e,onCancel:t,onConfirm:n}){return(0,z.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,z.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(`div`,{className:`dialog-title`,children:`⚠ DELETE ROUTINES`}),(0,z.jsxs)(`div`,{className:`dialog-msg`,children:[`Delete `,e,` selected routine`,e===1?``:`s`,`? This cannot be undone.`]}),(0,z.jsxs)(`div`,{className:`dialog-actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:t,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-danger`,onClick:n,children:`Delete`})]})]})})}function Us({title:e,onCancel:t,onConfirm:n}){return(0,z.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,z.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(`div`,{className:`dialog-title`,children:`⚠ DELETE ROUTINE`}),(0,z.jsxs)(`div`,{className:`dialog-msg`,children:[`Delete the routine "`,e,`"? This cannot be undone.`]}),(0,z.jsxs)(`div`,{className:`dialog-actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:t,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-danger`,onClick:n,children:`Delete`})]})]})})}var Ws=[`B`,`KB`,`MB`,`GB`,`TB`];function Gs(e){if(e<1024)return`${e} B`;let t=e,n=0;for(;t>=1024&&n<Ws.length-1;)t/=1024,n++;return`${t.toFixed(1)} ${Ws[n]}`}var Ks=[`id`,`title`,`enabled`,`status`,`schedule`,`schedule_description`,`timezone`,`agent`,`model`,`machines`,`tags`,`flag_count`,`next_run_at`,`last_scheduled_trigger_at`,`last_manual_trigger_at`];function qs(e){if(e==null)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toISOString()}function Js(e){return e.enabled?e.is_running?`running`:`enabled`:`disabled`}function Ys(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Xs(e){return e.map(Ys).join(`,`)}function Zs(e){let t=[Xs([...Ks])];for(let n of e)t.push(Xs([n.id,n.title,String(n.enabled),Js(n),go(n).join(`
`),(n.schedule_descriptions??[n.schedule_description]).filter(Boolean).join(`
`),n.timezone??``,n.agent,n.model??``,(n.machines??[]).join(`;`),(n.tags??[]).join(`;`),String(n.flag_count),qs(n.next_run_at),qs(n.last_scheduled_trigger_at),qs(n.last_manual_trigger_at)]));return t.join(`\r
`)+`\r
`}function Qs(e,t){let n=new Blob([t],{type:`text/csv;charset=utf-8;`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}var $s=[40,140,300,600],ec=wo.map(e=>e.slice(0,3));function tc({items:e,loading:t,onClick:n}){let[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(0),s=(0,_.useRef)(null);if((0,_.useEffect)(()=>{s.current?.scrollIntoView({block:`center`})},[r,a]),t)return(0,z.jsx)(`div`,{className:`day-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})});let c=xo(new Date),l=new Date(c);l.setDate(l.getDate()+r);let u=r===0?new Date().getHours():-1,d=Array.from({length:24},()=>[]),f=0;for(let t of e)for(let e of go(t))for(let n of Do(e,l))d[n.getHours()]?.push({time:n,label:t.label,id:t.id,snoozed:t.snoozed,flagCount:t.flagCount}),f++;for(let e of d)e.sort((e,t)=>e.time.getTime()-t.time.getTime());let p=`${Co[l.getDay()]} · ${ec[l.getMonth()]} ${l.getDate()} ${l.getFullYear()}`,m=a>0,h=$s[a]??$s[0];return(0,z.jsxs)(`div`,{className:`day-wrap`,children:[(0,z.jsxs)(`div`,{className:`day-nav`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Previous day`,"aria-label":`Previous day`,onClick:()=>i(e=>e-1),children:`‹`}),(0,z.jsx)(`div`,{className:`day-date`,children:p}),(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Next day`,"aria-label":`Next day`,onClick:()=>i(e=>e+1),children:`›`}),(0,z.jsxs)(`div`,{className:`day-zoom`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Zoom out`,"aria-label":`Zoom out`,disabled:a===0,onClick:()=>o(e=>Math.max(0,e-1)),children:`−`}),(0,z.jsxs)(`span`,{className:`day-zoom-level`,children:[a+1,`×`]}),(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Zoom into the hour`,"aria-label":`Zoom in`,disabled:a===$s.length-1,onClick:()=>o(e=>Math.min($s.length-1,e+1)),children:`+`})]}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>i(0),children:`TODAY`})]}),f===0?(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`no fire times on this day`})]}):(0,z.jsx)(`div`,{className:m?`day-scroll detail`:`day-scroll`,style:{"--dh":`${h}px`},children:d.map((e,t)=>(0,z.jsxs)(`div`,{className:t===u?`day-hour now`:`day-hour`,ref:t===u?s:void 0,children:[m?(0,z.jsxs)(`div`,{className:`day-hour-label`,children:[(0,z.jsxs)(`span`,{children:[String(t).padStart(2,`0`),`:00`]}),(0,z.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:15`]}),(0,z.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:30`]}),(0,z.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:45`]}),(0,z.jsx)(`span`,{className:`qt-end`})]}):(0,z.jsxs)(`div`,{className:`day-hour-label`,children:[String(t).padStart(2,`0`),`:00`]}),(0,z.jsx)(`div`,{className:`day-hour-slot`,children:e.map((e,t)=>{let r=(e.time.getMinutes()+e.time.getSeconds()/60)/60,i=m?{top:`${(r*100).toFixed(3)}%`}:void 0,a=`day-chip`;n&&e.id&&(a+=` clickable`),e.snoozed&&(a+=` snoozed`);let o=n&&e.id,s=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:`day-chip-time`,children:[String(e.time.getHours()).padStart(2,`0`),`:`,String(e.time.getMinutes()).padStart(2,`0`)]}),(0,z.jsx)(`span`,{className:`day-chip-label`,children:e.label}),e.flagCount>0&&(0,z.jsxs)(`span`,{className:`day-chip-flag`,children:[`⚑`,e.flagCount]})]});return o?(0,z.jsx)(`button`,{type:`button`,className:a,style:i,title:e.label,"aria-label":`Edit ${e.label}`,onClick:()=>n(e.id),children:s},t):(0,z.jsx)(`div`,{className:a,style:i,title:e.label,children:s},t)})})]},t))})]})}var nc=36e5,rc=[`all`,`enabled`,`disabled`,`auto-disabled`,`dormant`,`due`,`snoozed`,`flagged`,`agent-unreg`];function ic(e){return rc.includes(e)?e:`all`}var ac=`\0all`;function oc(e){return e.kind===`all`?ac:e.value}function sc(e){return e===ac?{kind:`all`}:{kind:`named`,value:e}}var cc=`\0any`,lc=`\0unassigned`;function uc(e){switch(e.kind){case`selected`:return e.values;case`any`:return cc;case`unassigned`:return lc;case`machine`:return e.value}}function dc(e){if(Array.isArray(e)){let t=[...new Set(e.filter(e=>e!==cc))];return t.length===0?{kind:`any`}:t.length===1?dc(t[0]):{kind:`selected`,values:t}}return e===cc?{kind:`any`}:e===lc?{kind:`unassigned`}:{kind:`machine`,value:e}}function fc(){return{query:``,status:`all`,agent:{kind:`all`},machine:{kind:`any`},repository:{kind:`all`},tag:{kind:`all`}}}function pc(e){return e.query.trim()!==``||e.status!==`all`||e.agent.kind!==`all`||e.machine.kind!==`any`&&(e.machine.kind!==`selected`||e.machine.values.length>0)||e.repository.kind!==`all`||e.tag.kind!==`all`}function mc(e,t,n,r){let i=t.machines??[];switch(e.status){case`enabled`:if(!t.enabled)return!1;break;case`disabled`:if(t.enabled)return!1;break;case`auto-disabled`:if(t.enabled||t.auto_disabled_reason==null)return!1;break;case`dormant`:if(!(t.enabled&&i.every(e=>e.trim()===``)))return!1;break;case`due`:if(!(t.enabled&&yo(t.schedule,n,r)))return!1;break;case`snoozed`:if(!Sc(t,n))return!1;break;case`flagged`:if((t.flag_count??0)===0)return!1;break;case`agent-unreg`:if(t.agent_registered)return!1}if(e.agent.kind===`named`&&t.agent!==e.agent.value||e.machine.kind===`unassigned`&&!i.every(e=>e.trim()===``)||e.machine.kind===`machine`&&!i.includes(e.machine.value)||e.machine.kind===`selected`&&e.machine.values.length>0&&!e.machine.values.some(e=>e===lc?i.every(e=>e.trim()===``):i.includes(e)))return!1;let a=e.repository;if(a.kind===`named`&&!(t.repositories??[]).some(e=>e.repository===a.value)||e.tag.kind===`named`&&!(t.tags??[]).includes(e.tag.value))return!1;let o=e.query.trim().toLowerCase();if(o!==``){let e=(t.repositories??[]).map(e=>e.repository.toLowerCase()).join(` `),n=(t.schedule_description??``).toLowerCase(),r=(t.tags??[]).map(e=>e.toLowerCase()).join(` `);if(![t.title.toLowerCase(),t.agent.toLowerCase(),t.schedule.toLowerCase(),e,n,r].join(` `).includes(o))return!1}return!0}function hc(e,t,n,r){return e.filter(e=>mc(t,e,n,r))}function gc(e){let t=e.last_manual_trigger_at??void 0,n=e.last_scheduled_trigger_at??void 0;return t===void 0?n:n===void 0?t:Math.max(t,n)}var _c=[`dormant`,`dead-schedule`,`agent-missing`,`auto-disabled`,`disabled`,`power-saving`,`snoozed`,`healthy`];function vc(e){switch(e){case`dormant`:return 0;case`dead-schedule`:return 1;case`agent-missing`:return 2;case`auto-disabled`:return 3;case`disabled`:return 4;case`power-saving`:return 5;case`snoozed`:return 6;case`healthy`:return 7}}function yc(e){switch(e){case`dormant`:return`DORMANT`;case`dead-schedule`:return`DEAD SCHEDULE`;case`agent-missing`:return`AGENT MISSING`;case`auto-disabled`:return`AUTO-DISABLED`;case`disabled`:return`DISABLED`;case`power-saving`:return`POWER SAVING`;case`snoozed`:return`SNOOZED`;case`healthy`:return`HEALTHY`}}function bc(e){switch(e){case`dormant`:return`health-badge dormant`;case`dead-schedule`:return`health-badge dead`;case`agent-missing`:return`health-badge agent-missing`;case`auto-disabled`:return`health-badge auto-disabled`;case`disabled`:return`health-badge disabled`;case`power-saving`:return`health-badge power-saving`;case`snoozed`:return`health-badge snoozed`;case`healthy`:return`health-badge healthy`}}function xc(e,t){return t===`auto-disabled`?e.auto_disabled_reason??yc(t):yc(t)}function Sc(e,t){let n=e.snoozed_until;return n!=null&&n*1e3>t.getTime()||(e.skip_runs??0)>0}function Cc(e,t){let n=e.snoozed_until;if(n!=null){let e=n*1e3;if(e>t.getTime()){let n=Math.floor((e-t.getTime())/1e3);return n<3600?`${Math.floor(n/60)}m left`:n<86400?`${Math.floor(n/3600)}h left`:`${Math.floor(n/86400)}d left`}}let r=e.skip_runs;return r!=null&&r>0?`${r} run${r===1?``:`s`} skipped`:``}function wc(e,t){return e.enabled?e.power_saving?`power-saving`:(e.machines??[]).every(e=>e.trim()===``)?`dormant`:mo(e.schedule,t)===void 0?`dead-schedule`:!e.agent_registered||!e.agent_setup_available?`agent-missing`:Sc(e,t)?`snoozed`:`healthy`:e.auto_disabled_reason==null?`disabled`:`auto-disabled`}function Tc(e){let t=e.failure_threshold,n=e.consecutive_failures??0;return!e.enabled||t==null||t<=0||n<=0?`none`:n+1>=t?`critical`:`warning`}function Ec(e){return e.enabled?e.power_saving?`Routine is in power-saving mode`:`Run now`:`Routine is disabled`}function Dc(e){return[...new Set(e.map(e=>e.agent))].sort()}function Oc(e){return[...new Set(e.flatMap(e=>(e.machines??[]).filter(e=>e.trim()!==``)))].sort()}function kc(e){return[...new Set(e.flatMap(e=>(e.repositories??[]).map(e=>e.repository)))].sort()}function Ac(e){return[...new Set(e.flatMap(e=>e.tags??[]))].sort()}function jc({facet:e,machines:t,onChange:n}){let r=(0,_.useRef)(null),i=(0,_.useRef)(null),a=(0,_.useRef)(void 0);(0,_.useEffect)(()=>{let e=e=>{let t=r.current;t?.open&&e.target instanceof Node&&!t.contains(e.target)&&(t.open=!1)};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),clearTimeout(a.current)}},[]);let o=uc(e),s=e.kind===`any`?[]:Array.isArray(o)?o:[o],c=`\0unassigned`,l=[...new Set([...t,...s.filter(e=>e!==c)])].sort(),u=e=>n(dc(s.includes(e)?s.filter(t=>t!==e):[...s,e]));return(0,z.jsxs)(`details`,{ref:r,className:`machine-filter`,onKeyDown:e=>{e.key===`Escape`&&e.currentTarget.open&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1,i.current?.focus())},onBlur:()=>{clearTimeout(a.current),a.current=setTimeout(()=>{let e=r.current;e&&!e.contains(document.activeElement)&&(e.open=!1)},0)},children:[(0,z.jsx)(`summary`,{ref:i,className:`filter-select`,"aria-label":`Machine filter`,children:s.length===0?`Any`:s.length===1?s[0]===c?`None`:s[0]:`${s.length} selected`}),(0,z.jsxs)(`fieldset`,{className:`machine-filter-options`,children:[(0,z.jsx)(`legend`,{children:`Match any selected machine`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>n({kind:`any`}),children:`Any machine`}),[c,...l].map(e=>(0,z.jsxs)(`label`,{children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:s.includes(e),onChange:()=>u(e)}),e===c?`None (unassigned)`:e]},e))]})]})}var Mc=[[`all`,`All`],[`enabled`,`Enabled`],[`disabled`,`Disabled`],[`auto-disabled`,`Auto-disabled`],[`dormant`,`Dormant`],[`due`,`Due soon`],[`snoozed`,`Snoozed`],[`flagged`,`Flagged`],[`agent-unreg`,`Agent unregistered`]];function Nc({filter:e,agents:t,machines:n,repositories:r,tags:i,shown:a,total:o,searchRef:s,onQuery:c,onStatus:l,onAgent:u,onMachine:d,onRepository:f,onTag:p,onClear:m}){return(0,z.jsxs)(`div`,{className:`filter-bar`,children:[(0,z.jsxs)(`div`,{className:`filter-field`,children:[(0,z.jsx)(`input`,{ref:s,type:`text`,className:`filter-input`,placeholder:`Search routines…  ( / )`,"aria-label":`Search routines`,value:e.query,onChange:e=>c(e.target.value)}),(0,z.jsx)(`span`,{className:`filter-label`,children:`STATUS`}),(0,z.jsx)(`select`,{className:`filter-select`,"aria-label":`Status filter`,value:e.status,onChange:e=>l(ic(e.target.value)),children:Mc.map(([e,t])=>(0,z.jsx)(`option`,{value:e,children:t},e))}),(0,z.jsx)(`span`,{className:`filter-label`,children:`AGENT`}),(0,z.jsxs)(`select`,{className:`filter-select`,"aria-label":`Agent filter`,value:oc(e.agent),onChange:e=>u(sc(e.target.value)),children:[(0,z.jsx)(`option`,{value:oc({kind:`all`}),children:`Any`}),t.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]}),(0,z.jsx)(`span`,{className:`filter-label`,children:`MACHINE`}),(0,z.jsx)(jc,{facet:e.machine,machines:n,onChange:d}),(0,z.jsx)(`span`,{className:`filter-label`,children:`REPOSITORY`}),(0,z.jsxs)(`select`,{className:`filter-select`,"aria-label":`Repository filter`,value:oc(e.repository),onChange:e=>f(sc(e.target.value)),children:[(0,z.jsx)(`option`,{value:oc({kind:`all`}),children:`Any`}),r.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]}),i.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`TAG`}),(0,z.jsxs)(`select`,{className:`filter-select`,"aria-label":`Tag filter`,value:oc(e.tag),onChange:e=>p(sc(e.target.value)),children:[(0,z.jsx)(`option`,{value:oc({kind:`all`}),children:`Any`}),i.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,z.jsxs)(`div`,{className:`filter-field`,children:[(0,z.jsxs)(`span`,{className:`filter-count`,children:[`Showing `,a,` of `,o]}),pc(e)&&(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Clear all filters`,onClick:m,children:`CLEAR`})]})]})}var Pc=[`title`,`next_run`,`last_fire`,`agent`,`health`,`enabled`,`updated`];function Fc(e){return Pc.includes(e)?e:void 0}function Ic(e){return e===`asc`?`desc`:`asc`}function Lc(e){return e===`desc`?`desc`:`asc`}var Rc=[`none`,`agent`,`machine`,`status`,`health`,`folder`];function zc(e){return Rc.includes(e)?e:`none`}function Bc(e){switch(e){case`none`:return`None`;case`agent`:return`Agent`;case`machine`:return`Machine`;case`status`:return`Status`;case`health`:return`Health`;case`folder`:return`Folder`}}function Vc(e){return e.folder?.trim()||`(root)`}function Hc(e,t){switch(t){case`none`:return``;case`agent`:return e.agent;case`machine`:return e.machines?.[0]??`(unassigned)`;case`status`:return e.enabled?`Enabled`:`Disabled`;case`health`:return yc(wc(e,new Date));case`folder`:return Vc(e)}}function Uc(e,t){let n=new Map(_c.map(e=>[e,0]));for(let r of e){let e=wc(r,t);n.set(e,(n.get(e)??0)+1)}return n}function Wc(e,t){if(t===`none`)return[[``,e]];let n=new Map;for(let r of e){let e=Hc(r,t),i=n.get(e);i?i.push(r):n.set(e,[r])}return[...n.entries()].sort(([e],[t])=>e<t?-1:+(e>t))}function Gc(e,t,n,r){if(t===void 0)return e;let i=(e,i)=>{let a;switch(t){case`title`:a=e.title.toLowerCase().localeCompare(i.title.toLowerCase());break;case`agent`:a=e.agent.toLowerCase().localeCompare(i.agent.toLowerCase());break;case`enabled`:a=Number(e.enabled)-Number(i.enabled);break;case`updated`:a=e.updated_at-i.updated_at;break;case`health`:a=vc(wc(e,r))-vc(wc(i,r));break;case`last_fire`:{let t=gc(e),n=gc(i);a=(t??-1)-(n??-1);break}case`next_run`:{let t=e=>e.enabled?mo(e.schedule,r)?.getTime():void 0,n=t(e),o=t(i);a=n!==void 0&&o!==void 0?n-o:n===void 0?o===void 0?0:1:-1;break}}let o=n===`desc`?-a:a;return o===0?e.id.localeCompare(i.id):o};return[...e].sort(i)}var Kc=[`none`,`agent`,`machine`,`status`,`health`,`folder`];function qc({groupBy:e,onChange:t}){return(0,z.jsxs)(`div`,{className:`group-by-ctrl`,children:[(0,z.jsx)(`label`,{htmlFor:`routine-group-by-select`,children:`GROUP BY`}),(0,z.jsx)(`select`,{id:`routine-group-by-select`,className:`filter-select`,"aria-label":`Group routines by`,value:e,onChange:e=>t(zc(e.target.value)),children:Kc.map(e=>(0,z.jsx)(`option`,{value:e,children:Bc(e)},e))})]})}function Jc(e){return e.toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`,year:`numeric`})}function Yc(e){return`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`}function Xc(e,t,n){return e.filter(e=>e.enabled).map(e=>{let r=new Set,i=go(e).flatMap(e=>Do(e,t)).sort((e,t)=>e.getTime()-t.getTime()).filter(e=>{let t=e.getTime();return!r.has(t)&&(r.add(t),!0)});return{id:e.id,title:e.title,times:i,snoozed:Sc(e,n)}}).filter(e=>e.times.length>0).sort((e,t)=>(e.times[0]?.getTime()??0)-(t.times[0]?.getTime()??0)||e.title.localeCompare(t.title))}function Zc({routines:e,loading:t,onEdit:n,onTrigger:r}){let[i,a]=(0,_.useState)(0),[o,s]=(0,_.useState)(void 0),{addToast:c}=Ka();if((0,_.useEffect)(()=>{if(o===void 0)return;let e=e=>{e.key===`Escape`&&s(void 0)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]),t)return(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})});let l=()=>{let e=`${window.location.origin}${aa()}`;navigator.clipboard.writeText(e).then(()=>c(`Calendar feed URL copied`,`ok`)).catch(()=>c(`Copy failed`,`err`))},u=new Date;u.setHours(0,0,0,0);let d=To(u,i),f=new Date(d);f.setDate(f.getDate()-d.getDay());let p=new Date,m=Array.from({length:42},()=>[]),h=0;for(let t of e.filter(e=>e.enabled)){let e=go(t).map(e=>Oo(e,f)).filter(e=>e!==void 0);if(e.length===0)continue;h++;let n=Sc(t,p);e.reduce((e,t)=>e.map((e,n)=>e+(t[n]??0))).forEach((e,r)=>{e>0&&m[r]?.push({id:t.id,title:t.title,count:e,snoozed:n})})}let g=`${wo[d.getMonth()]} ${d.getFullYear()}`,v=o?Xc(e,o,p):[];return(0,z.jsxs)(`div`,{className:`cal-wrap`,children:[(0,z.jsxs)(`div`,{className:`cal-nav`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Previous month`,"aria-label":`Previous month`,onClick:()=>a(e=>e-1),children:`‹`}),(0,z.jsx)(`div`,{className:`cal-month`,children:g}),(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Next month`,"aria-label":`Next month`,onClick:()=>a(e=>e+1),children:`›`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>a(0),children:`TODAY`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Copy the routines.ics feed URL`,onClick:l,children:`SUBSCRIBE`})]}),h===0?(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`enabled routines with a valid schedule appear here`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`cal-weekdays`,children:Co.map(e=>(0,z.jsx)(`div`,{className:`cal-weekday`,children:e},e))}),(0,z.jsx)(`div`,{className:`cal-grid`,children:m.map((e,t)=>{let r=new Date(f);r.setDate(r.getDate()+t);let i=xo(r),a=`cal-day`;r.getMonth()!==d.getMonth()&&(a+=` other-month`),r.getTime()===u.getTime()&&(a+=` today`);let o=Jc(i);return(0,z.jsxs)(`div`,{className:a,role:`button`,tabIndex:0,"aria-label":`Open schedule details for ${o}`,onClick:()=>s(i),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(i))},children:[(0,z.jsx)(`div`,{className:`cal-daynum`,children:r.getDate()}),(0,z.jsxs)(`div`,{className:`cal-hits`,children:[e.slice(0,4).map((e,t)=>{let r=e.count>1?`${e.title} ×${e.count}`:e.title,i=`cal-chip clickable`;return e.snoozed&&(i+=` snoozed`),(0,z.jsx)(`button`,{type:`button`,className:i,"aria-label":`Edit ${e.title}`,title:r,onClick:t=>{t.stopPropagation(),n(e.id)},children:r},`${e.id}-${t}`)}),e.length>4&&(0,z.jsxs)(`div`,{className:`cal-more`,children:[`+`,e.length-4,` more`]})]})]},t)})})]}),o&&(0,z.jsx)(`div`,{className:`overlay`,onClick:()=>s(void 0),children:(0,z.jsxs)(`div`,{className:`dialog cal-day-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Calendar day details`,onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(`div`,{className:`dialog-title`,children:Jc(o)}),(0,z.jsx)(`div`,{className:`dialog-msg`,children:`Scheduled routine fires for this local day.`}),v.length===0?(0,z.jsx)(`div`,{className:`cal-day-empty`,children:`No routine fires on this day.`}):(0,z.jsx)(`div`,{className:`cal-day-fire-list`,children:v.map(e=>(0,z.jsxs)(`div`,{className:`cal-day-fire`,children:[(0,z.jsxs)(`div`,{className:`cal-day-fire-main`,children:[(0,z.jsx)(`div`,{className:`cal-day-fire-title`,children:e.title}),(0,z.jsx)(`div`,{className:`cal-day-fire-times`,children:e.times.map(e=>(0,z.jsx)(`span`,{className:`cal-time-chip`,children:Yc(e)},e.getTime()))})]}),(0,z.jsx)(`button`,{type:`button`,className:`act-btn run`,"aria-label":`Run ${e.title} now`,disabled:e.snoozed,title:e.snoozed?`Routine is snoozed`:`Trigger this routine now`,onClick:()=>r(e.id),children:`RUN NOW`})]},e.id))}),(0,z.jsx)(`div`,{className:`dialog-actions`,children:(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>s(void 0),children:`Close`})})]})})]})}function Qc({id:e,title:t,onBack:n}){let r=ra(e),i=ia(),a=Zo(),o=r.data??[];return(0,z.jsxs)(`main`,{className:`logs-page`,children:[(0,z.jsxs)(`div`,{className:`page-hd`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,z.jsxs)(`div`,{className:`page-title`,children:[`FLAGS / `,t]}),r.dataUpdatedAt>0&&(0,z.jsx)(`span`,{className:`page-freshness`,children:as(Math.max(0,(a-r.dataUpdatedAt)/1e3))}),(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void r.refetch(),children:`↻`})]}),r.isLoading?(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})}):r.isError?(0,z.jsx)(`div`,{className:`logs-error`,children:r.error.message}):o.length===0?(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⚑`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO OPEN FLAGS`})]}):(0,z.jsxs)(`div`,{className:`flags-list`,children:[(0,z.jsxs)(`div`,{className:`flags-count`,children:[o.length,` open flag`,o.length===1?``:`s`]}),o.map(t=>(0,z.jsxs)(`div`,{className:`flag-item`,children:[(0,z.jsxs)(`div`,{className:`flag-item-hd`,children:[(0,z.jsx)(`span`,{className:`flag-type`,children:t.type}),(0,z.jsx)(`span`,{className:`flag-scope`,children:t.scope===`general`?`general`:`local`}),(0,z.jsx)(`span`,{className:`flag-age`,title:t.filename,children:Ia(t.created_at)}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:i.isPending,onClick:()=>i.mutate({id:e,filename:t.filename}),children:`RESOLVE`})]}),(0,z.jsx)(`div`,{className:`flag-desc`,children:t.description})]},t.filename))]})]})}var $c=e=>e.type===`checkbox`,el=e=>e.type===`file`,tl=e=>e instanceof Date,nl=e=>e==null,rl=e=>typeof e==`object`,il=e=>!nl(e)&&!Array.isArray(e)&&rl(e)&&!tl(e),al=e=>il(e)&&e.target?$c(e.target)?e.target.checked:el(e.target)?e.target.files:e.target.value:e,ol=/[.[\]'"]/,sl=e=>e.split(ol).filter(Boolean),cl=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),ll=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function W(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);let t=typeof Blob<`u`&&e instanceof Blob,n=typeof FileList<`u`&&e instanceof FileList;if(ll&&(t||n))return e;let r=Array.isArray(e),i=Object.getPrototypeOf(e);if(!r&&i&&i.constructor!==Object)return e;let a=r?Array(e.length):Object.create(i);for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(a[t]=W(e[t]));return a}var ul={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},dl={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},fl={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},pl=[fl.required,fl.min,fl.max,fl.minLength,fl.maxLength,fl.pattern,fl.validate],ml=`form`,hl=`root`,gl=[`__proto__`,`constructor`,`prototype`],_l=/^\w*$/,vl=e=>_l.test(e),G=e=>e===void 0,K=(e,t,n)=>{if(!t||!il(e))return n;let r=vl(t)?[t]:sl(t);if(r.some(e=>gl.includes(e)))return n;let i=r.reduce((e,t)=>nl(e)?void 0:e[t],e);return G(i)||i===e?G(e[t])?n:e[t]:i},yl=e=>typeof e==`boolean`,bl=e=>typeof e==`function`,xl=(e,t,n)=>{let r=-1,i=vl(t)?[t]:sl(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=il(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(gl.includes(t))return;e[t]=a,e=e[t]}},Sl=_.createContext(null);Sl.displayName=`HookFormControlContext`;var Cl=()=>_.useContext(Sl),wl=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==dl.all&&(t._proxyFormState[i]=!r||dl.all),n&&(n[i]=!0),e[i]}});return i},Tl=ll?_.useLayoutEffect:_.useEffect,El=e=>{let t=e.constructor&&e.constructor.prototype;return il(t)&&t.hasOwnProperty(`isPrototypeOf`)},Dl=e=>nl(e)||!rl(e),Ol=(e,t)=>t.length===0&&!Array.isArray(e)&&Object.getPrototypeOf(e)!==null&&!El(e);function kl(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(Dl(e)||Dl(t))return Object.is(e,t);if(tl(e)&&tl(t))return Object.is(e.getTime(),t.getTime());if(Array.isArray(e)&&Array.isArray(t)&&e.length!==t.length)return!1;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;if(Ol(e,i)||Ol(t,a))return Object.is(e,t);if(!i.length&&Array.isArray(e)!==Array.isArray(t))return!1;let o=r.get(e);if(o&&o.has(t))return!0;if(o)o.add(t);else{let n=new WeakSet;n.add(t),r.set(e,n)}for(let a of i){let i=e[a];if(!Object.prototype.hasOwnProperty.call(t,a))return!1;if(!n||a!==`ref`){let e=t[a];if(tl(i)&&tl(e)||(il(i)||Array.isArray(i))&&(il(e)||Array.isArray(e))?!kl(i,e,n,r):!Object.is(i,e))return!1}}return!0}function Al(e){let t=_.useRef(!1),n=_.useRef(!1),r=_.useRef(void 0),i=_.useRef(0);return i.current++,!n.current&&e&&(n.current=!0,r.current=W(e())),{resyncIfNeeded:_.useCallback((e,a,o)=>{if(e&&(t.current||n.current&&i.current>1)){let e=a();kl(r.current,e)||o(e)}t.current=!0},[]),snapshot:_.useCallback((e,t)=>{e&&(r.current=W(t()))},[])}}var jl=e=>typeof e==`string`,Ml=(e,t,n,r,i)=>jl(e)?(r&&t.watch.add(e),K(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),K(n,e,K(i,e)))):(r&&(t.watchAll=!0),n);function Nl(e){let t=Cl(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=_.useRef(i),l=_.useRef(s),u=_.useRef(n),d=_.useRef(r);l.current=s;let f=()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e},[p,m]=_.useState(f),h=_.useRef(p),g=_.useCallback(e=>{let t=Ml(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),v=_.useCallback(e=>{if(!a){let t=Ml(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);kl(e,h.current)||(m(e),h.current=e)}else m(t)}},[n._formValues,n._names,a,r]),{resyncIfNeeded:y,snapshot:b}=Al(f),x=_.useRef(v);x.current=v;let S=_.useRef(g);S.current=g,Tl(()=>{u.current!==n||!kl(d.current,r)?(u.current=n,d.current=r,x.current()):y(!a,()=>S.current(),e=>{let t=W(e);m(t),h.current=t});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{x.current(e.values)}});return()=>{e(),b(!a,()=>S.current())}},[n,o,r,a,y,b]),_.useEffect(()=>n._removeUnmounted());let C=u.current!==n,w=d.current,T=_.useMemo(()=>!C&&!kl(w,r),[C,r,w]);return(C||T)&&(c.current=i),!a&&(C||T)?g():p}var Pl=()=>typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)}),Fl=(e,t,n={})=>n.shouldFocus||G(n.shouldFocus)?n.focusName||`${e}.${G(n.focusIndex)?t:n.focusIndex}.`:``,Il=e=>({isOnSubmit:!e||e===dl.onSubmit,isOnBlur:e===dl.onBlur,isOnChange:e===dl.onChange,isOnAll:e===dl.all,isOnTouch:e===dl.onTouched}),Ll=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},Rl=(e,t,n)=>{for(let r of n||Object.keys(e)){if(r===`_f`)continue;let i=n?K(e,r):e[r];if(i){let{_f:e}=i;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],e.name)||e.ref&&t(e.ref,e.name)||Rl(i,t))return!0}else if((il(i)||Array.isArray(i))&&Rl(i,t))return!0}}},zl=(e,t,n)=>{let r=K(e,n),i=Array.isArray(r)?r:[];return xl(i,hl,t[n]),xl(e,n,i),e},Bl=e=>il(e)&&!Object.keys(e).length,Vl=e=>{if(!ll)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Hl=e=>e.type===`radio`,Ul=e=>e instanceof RegExp,Wl=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Gl={value:!1,isValid:!1},Kl={value:!0,isValid:!0},ql=e=>{if(!Array.isArray(e))return Gl;if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}let t=e[0];return!t||!t.checked||t.disabled?Gl:!t.attributes||!(`value`in t.attributes)||G(t.value)||t.value===``?Kl:{value:t.value,isValid:!0}},Jl={isValid:!1,value:null},Yl=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Jl):Jl;function Xl(e,t,n=`validate`){if(jl(e)||Array.isArray(e)&&e.length&&e.every(jl)||yl(e)&&!e)return{type:n,message:jl(e)?e:``,ref:t}}var Zl=e=>il(e)&&!Ul(e)?e:{value:e,message:``},Ql=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_,_c:v}=e._f,y=K(n,h);if(!_||t.has(h))return{};let b=s?s[0]:o,x=e=>{if(i&&b.reportValidity){let t=yl(e)?``:e||``;s?s.forEach(e=>bl(e.setCustomValidity)&&e.setCustomValidity(t)):b.setCustomValidity(t),b.reportValidity()}},S={},C=!v&&Hl(o),w=!v&&$c(o),T=C||w,E=(g||el(o))&&G(o.value)&&G(y)||Vl(o)&&o.value===``&&!v||y===``||Array.isArray(y)&&!y.length,D=Wl.bind(null,h,r,S),O=(e,t,n,r=fl.maxLength,i=fl.minLength)=>{let a=e?t:n;S[h]={type:e?r:i,message:a,ref:o,...D(e?r:i,a)}};if(a?!Array.isArray(y)||!y.length:c&&(!T&&(E||nl(y))||yl(y)&&!y||w&&!ql(s).isValid||C&&!Yl(s).isValid)){let{value:e,message:t}=jl(c)?{value:!!c,message:c}:Zl(c);if(e&&(S[h]={type:fl.required,message:t,ref:b,...D(fl.required,t)},!r))return x(t),S}if(!E&&(!nl(d)||!nl(f))){let e,t,n=Zl(f),i=Zl(d);if(!nl(y)&&!tl(y)&&!isNaN(y)){let r=!v&&o.valueAsNumber||y&&+y;nl(n.value)||(e=r>n.value),nl(i.value)||(t=r<i.value)}else{let r=!v&&o.valueAsDate||new Date(y),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;jl(n.value)&&y&&(e=s?a(y)>a(n.value):c?y>n.value:r>new Date(n.value)),jl(i.value)&&y&&(t=s?a(y)<a(i.value):c?y<i.value:r<new Date(i.value))}if((e||t)&&(O(!!e,n.message,i.message,fl.max,fl.min),!r))return x(S[h].message),S}if((!nl(l)||!nl(u))&&!E&&(jl(y)||a&&Array.isArray(y))){let e=Zl(l),t=Zl(u),n=!nl(e.value)&&y.length>+e.value,i=!nl(t.value)&&y.length<+t.value;if((n||i)&&(O(n,e.message,t.message),!r))return x(S[h].message),S}if(p&&!E&&jl(y)){let{value:e,message:t}=Zl(p);if(Ul(e)&&!y.match(e)&&(S[h]={type:fl.pattern,message:t,ref:o,...D(fl.pattern,t)},!r))return x(t),S}if(m){if(bl(m)){let e=Xl(await m(y,n),b);if(e&&(S[h]={...e,...D(fl.validate,e.message)},!r))return x(e.message),S}else if(il(m)){let e={};for(let t in m){if(!Bl(e)&&!r)break;let i=Xl(await m[t](y,n),b,t);i&&(e={...i,...D(t,i.message)},r||x(i.message),r&&(S[h]=e))}if(!Bl(e)&&(S[h]={ref:b,...e},!r))return S}}let k=S[h];return x(!k||k.message),S},$l=e=>Array.isArray(e)?e:[e],eu=(e,t)=>[...e,...$l(t)],tu=e=>Array.isArray(e)?e.map(()=>void 0):void 0;function nu(e,t,n){return[...e.slice(0,t),...$l(n),...e.slice(t)]}var q=(e,t,n)=>Array.isArray(e)?(G(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],ru=(e,t)=>[...$l(t),...$l(e)],iu=e=>Array.isArray(e)?e.filter(Boolean):[];function au(e,t){let n=0,r=[...e];for(let e of t)r.splice(e-n,1),n++;return iu(r).length?r:[]}var ou=(e,t)=>G(t)?[]:au(e,[...new Set($l(t))].sort((e,t)=>e-t)),su=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function cu(e,t){let n=t.length-1,r=0;for(;r<n;){if(nl(e)){e=void 0;break}e=e[t[r]],r++}return e}function lu(e){for(let t in e)if(e.hasOwnProperty(t)&&!G(e[t]))return!1;return!0}function uu(e,t){if(jl(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:vl(t)?[t]:sl(t);if(n.some(e=>gl.includes(String(e))))return e;let r=n.length===1?e:cu(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(il(r)&&Bl(r)||Array.isArray(r)&&lu(r))&&uu(e,n.slice(0,-1)),e}var du=(e,t,n)=>(e[t]=n,e);function fu(e){let t=Cl(),{control:n=t,name:r,keyName:i=`id`,disabled:a,shouldUnregister:o,rules:s}=e,c=()=>n._getFieldArray(r),[l,u]=_.useState(c),d=_.useRef(n._getFieldArray(r).map(Pl)),f=_.useRef(!1),{resyncIfNeeded:p,snapshot:m}=Al(c),h=_.useRef(n),g=_.useRef(r);a||n._names.array.add(r),_.useMemo(()=>!a&&s&&l&&n.register(r,s),[n,r,l,s,a]),Tl(()=>{if(a)return;if(h.current===n&&g.current===r)p(!0,c,e=>{u(e),d.current=e.map(Pl)});else{h.current=n,g.current=r;let e=c();kl(l,e)||(u(e),d.current=e.map(Pl)),m(!0,c)}let e=n._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===r||!t){let n=K(e,r);Array.isArray(n)?(u(n),d.current=n.map(Pl)):t||(u([]),d.current=[])}}}).unsubscribe;return()=>{e(),m(!0,c)}},[n,r,a,p,m]);let v=_.useCallback(e=>{f.current=!0,n._setFieldArray(r,e)},[n,r]);return _.useEffect(()=>{if(a){n._state.actionArrayLengths.delete(r);return}n._state.action=!1,n._state.actionArrayLengths.delete(r),Ll(r,n._names)&&n._subjects.state.next({...n._formState});let e=Il(n._options.mode),t=Il(n._options.reValidateMode);if(f.current&&(!e.isOnSubmit||n._formState.isSubmitted)&&!t.isOnSubmit&&(!e.isOnBlur||n._formState.isSubmitted&&t.isOnChange)){let e=K(n._formValues,r);if(n._options.resolver)n._runSchema([r]).then(t=>{if(n._updateIsValidating([r]),e!==K(n._formValues,r))return;let i=K(t.errors,r),a=K(n._formState.errors,r),o=a&&(a.type||a.root&&a.root.type),s=a&&(a.message||a.root&&a.root.message);(a?!i&&o||i&&(o!==i.type||s!==i.message):i&&i.type)&&(i?il(i)&&!Object.keys(i).some(e=>!Number.isNaN(+e))?zl(n._formState.errors,{[r]:i},r):xl(n._formState.errors,r,i):uu(n._formState.errors,r),n._formState.errors={...n._formState.errors},n._subjects.state.next({errors:n._formState.errors}))});else{let t=K(n._fields,r);t&&t._f&&Ql(t,n._names.disabled,n._formValues,n._options.criteriaMode===dl.all,n._options.shouldUseNativeValidation,!0).then(t=>{if(e===K(n._formValues,r)){if(!Bl(t))zl(n._formState.errors,t,r),n._formState.errors={...n._formState.errors},n._subjects.state.next({errors:n._formState.errors});else{let e=K(n._formState.errors,r);e&&e[hl]&&(uu(n._formState.errors,`${r}.${hl}`),n._formState.errors={...n._formState.errors},n._subjects.state.next({errors:n._formState.errors}))}}})}}f.current&&n._subjects.state.next({name:r,values:W(n._formValues)}),n._names.focus&&Rl(n._fields,(e,t)=>{if(n._names.focus&&t.startsWith(n._names.focus)&&e.focus)return e.focus(),1}),n._names.focus=``,n._setValid(),f.current=!1},[l,r,n,a]),_.useEffect(()=>(a||G(K(n._formValues,r))&&n._setFieldArray(r),()=>{if(n._state.actionArrayLengths.delete(r),n._state.actionArrayLengths.size||(n._state.action=!1),a)return;let e=!(n._options.shouldUnregister||o),t=(e,t)=>{let r=K(n._fields,e);r&&r._f&&(r._f.mount=t)};f.current&&e&&n._subjects.state.next({name:r,values:W(n._formValues)}),!(!e&&n._state.action&&[...n._state.actionArrayLengths.keys()].some(e=>r.startsWith(e+`.`)))&&(e?t(r,!1):n.unregister(r))}),[r,n,i,o,a]),{swap:_.useCallback((e,t)=>{if(a)return;let i=n._getFieldArray(r);su(i,e,t),su(d.current,e,t),v(i),u(i),n._setFieldArray(r,i,su,{argA:e,argB:t},!1)},[v,r,n,a]),move:_.useCallback((e,t)=>{if(a)return;let i=n._getFieldArray(r);q(i,e,t),q(d.current,e,t),v(i),u(i),n._setFieldArray(r,i,q,{argA:e,argB:t},!1)},[v,r,n,a]),prepend:_.useCallback((e,t)=>{if(a)return;let i=$l(W(e)),o=ru(n._getFieldArray(r),i);n._names.focus=Fl(r,0,t),d.current=ru(d.current,i.map(Pl)),v(o),u(o),n._setFieldArray(r,o,ru,{argA:tu(e)})},[v,r,n,a]),append:_.useCallback((e,t)=>{if(a)return;let i=$l(W(e)),o=eu(n._getFieldArray(r),i);n._names.focus=Fl(r,o.length-1,t),d.current=eu(d.current,i.map(Pl)),v(o),u(o),n._setFieldArray(r,o,eu,{argA:tu(e)})},[v,r,n,a]),remove:_.useCallback(e=>{if(a)return;let t=ou(n._getFieldArray(r),e);d.current=ou(d.current,e),v(t),u(t),!Array.isArray(K(n._fields,r))&&xl(n._fields,r,void 0),n._setFieldArray(r,t,ou,{argA:e})},[v,r,n,a]),insert:_.useCallback((e,t,i)=>{if(a)return;let o=$l(W(t)),s=nu(n._getFieldArray(r),e,o);n._names.focus=Fl(r,e,i),d.current=nu(d.current,e,o.map(Pl)),v(s),u(s),n._setFieldArray(r,s,nu,{argA:e,argB:tu(t)})},[v,r,n,a]),update:_.useCallback((e,t)=>{if(a)return;let i=W(t),o=du(n._getFieldArray(r),e,i);d.current=[...o].map((t,n)=>!t||n===e?Pl():d.current[n]),v(o),u([...o]),n._setFieldArray(r,o,du,{argA:e,argB:tu(t)})},[v,r,n,a]),replace:_.useCallback(e=>{if(a)return;let t=$l(W(e));d.current=t.map(Pl),v([...t]),u([...t]),n._setFieldArray(r,[...t],e=>Array.isArray(e)?e.slice(0,t.length):e,{})},[v,r,n,a]),fields:_.useMemo(()=>l.map((e,t)=>({...e,...yl(a)?{disabled:a}:{},[i]:d.current[t]||Pl()})),[l,i,a])}}var pu=()=>{let e=new Set,t=0;return{get observers(){return Array.from(e)},next:n=>{let r=e;t++;for(let e of r)e.next&&e.next(n);r===e&&t--},subscribe:n=>(e.add(n),{unsubscribe:()=>{t&&=(e=new Set(e),0),e.delete(n)}}),unsubscribe:()=>{e=new Set,t=0}}};function mu(e,t){let n=Array.isArray(e)?[]:{};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let i=e[r],a=t[r];i&&(il(i)||Array.isArray(i))&&a?n[r]=mu(i,a):e[r]&&(n[r]=a)}return n}var hu=(e,t)=>e!==null&&rl(e)&&Object.prototype.hasOwnProperty.call(e,t),gu=(e,t)=>{if(!t)return!1;let n=e;for(let r of vl(t)?[t]:sl(t)){if(!hu(n,r))return hu(e,t);n=n[r]}return!0},_u=e=>e.type===`select-multiple`,vu=e=>{let t=[...e.options];return!e.multiple&&e.size<2&&!t.some(e=>e.defaultSelected)?e.selectedIndex!==t.findIndex(e=>!e.disabled):t.some(e=>e.selected!==e.defaultSelected)},yu=e=>$c(e)?e.checked!==e.defaultChecked:e.type===`select-one`||_u(e)?vu(e):!Hl(e)&&`defaultValue`in e&&e.value!==e.defaultValue,bu=e=>Hl(e)||$c(e),xu=e=>Vl(e)&&e.isConnected;function Su(e){return Array.isArray(e)||il(e)}function Cu(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];Su(o)&&Su(K(t,a))?Cu(o,t,a,r):r.push(a)}return r}var wu=e=>{for(let t in e)if(bl(e[t]))return!0;return!1};function Tu(e){return Array.isArray(e)||il(e)&&!wu(e)}function Eu(e){return!!(e&&`_f`in e)}function Du(e){return Array.isArray(e)?!e.some(e=>!G(e)):!Object.keys(e).length}function Ou(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function ku(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];Tu(i)&&(!Array.isArray(i)||!Eu(a))?(t[r]=Array.isArray(i)?[]:{},ku(i,t[r],a),Du(t[r])&&Ou(t,r)):G(i)||(t[r]=!0)}return t}function Au(e,t,n,r){n||=ku(t,Array.isArray(nl(t)?e:t)?[]:{},r);for(let i in e){let a=e[i],o=r&&r[i];Tu(a)&&(!Array.isArray(a)||!Eu(o))?(G(t)||Dl(n[i])?n[i]=ku(a,Array.isArray(a)?[]:{},o):Au(a,nl(t)?{}:t[i],n[i],o),Du(n[i])&&Ou(n,i)):kl(a,nl(t)?void 0:t[i])?Ou(n,i):n[i]=!0}return n}var ju=(e,t)=>{let n=t.split(`.`),r=[],i=n[0];for(let t=1;t<n.length;i+=`.`+n[t++])!isNaN(+n[t])&&e.has(i)&&r.push(`${i}.${n[t]}`);return r},Mu=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>G(e)?e:t?e===``?NaN:e&&+e:n&&jl(e)?new Date(e):r?r(e):e;function Nu(e){let t=e.ref;return el(t)?t.files:Hl(t)?Yl(e.refs).value:_u(t)?[...t.selectedOptions].map(({value:e})=>e):$c(t)?ql(e.refs).value:Mu(t.value,e)}var Pu=(e,t,n,r)=>{let i={};for(let n of e){let e=K(t,n);e&&xl(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Fu=e=>G(e)?e:Ul(e)?e.source:il(e)?Ul(e.value)?e.value.source:e.value:e,Iu=`AsyncFunction`,Lu=e=>{if(!e||!e.validate)return!1;if(bl(e.validate))return e.validate.constructor.name===Iu;if(il(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===Iu)return!0}return!1},Ru=e=>e.mount&&(e.required||!G(e.required)&&e.required!==!1||!G(e.min)||!G(e.max)||!G(e.maxLength)||!G(e.minLength)||e.pattern||e.validate);function zu(e,t,n){let r=K(e,n);if(r&&(r.type||r.message)||Array.isArray(r))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=K(t,r),o=K(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var Bu=(e,t,n)=>{let r=Object.keys(e).filter(e=>e!==`name`);return!r.length||n&&r.length>=Object.keys(t).length||r.find(e=>t[e]===(!n||dl.all))},Vu=(e,t,n)=>n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e),Hu=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return Vu(e,t,n);for(let r of e)if(r&&Vu(r,t,n))return!0;return!1},Uu=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,Wu=(e,t)=>{let n=K(e,t);!iu(n).length&&!(n&&n.root)&&uu(e,t)},Gu={mode:dl.onSubmit,reValidateMode:dl.onChange,shouldFocusError:!0},Ku=(e,t)=>{for(let t in e)delete e[t];Object.assign(e,t)},qu={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Ju(e={}){let t={...Gu,...e},n={...W(qu),isLoading:bl(t.defaultValues),errors:W(t.errors)||{},disabled:t.disabled||!1},r={},i=(il(t.defaultValues)||il(t.values))&&W(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:W(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s=!1,c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l={},u={},d=new Set,f=Il(t.mode),p=Il(t.reValidateMode),m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...m},g={},_=(...e)=>e.some(e=>h[e]||g[e]),v=e=>{for(let t of d)if(Hu(t.name,e,t.exact))return!0;return!1},y={array:pu(),state:pu()},b=0,x=0,S=0,C={},w=t.criteriaMode===dl.all,T=(e,t)=>n=>{clearTimeout(u[e]),u[e]=setTimeout(t,n)},E=e=>{clearTimeout(u[e]),delete u[e],delete l[e]},D=e=>{E(e);let t=`${e}.`;for(let e of Object.keys(l))e.startsWith(t)&&E(e)},O=async e=>{if(!o.keepIsValid&&!t.disabled&&(_(`isValid`)||e)){let e=++b,i;t.resolver?(i=Bl((await ue()).errors),e===b&&A()):i=await pe({fields:r,onlyCheckValid:!0,eventType:ul.VALID}),e===b&&i!==n.isValid&&y.state.next({isValid:i})}},k=(e,t)=>{let r=[...e];if(!r.some(e=>e&&(t?K(n.validatingFields,e)!==!0:gu(n.validatingFields,e))))return;let i=W(n.validatingFields);for(let e of r)e&&(t?xl(i,e,!0):uu(i,e));kl(n.validatingFields,i)||(n.validatingFields=i)},A=(e,r)=>{!t.disabled&&_(`isValidating`,`validatingFields`)&&(k(e||c.mount,r),y.state.next({validatingFields:n.validatingFields,isValidating:!Bl(n.validatingFields)}))},ee=()=>{n.dirtyFields=Au(i,a,void 0,r)},te=(e,i=[],c,l,u=!0,d=!0)=>{if(l&&c&&!t.disabled){o.action=!0,o.keepIsValid=!1;let t=K(r,e),a=t&&t._f,f=a?Object.assign([],t):t;if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(f)?f.length:0),d&&Array.isArray(f)){let t=c(f,l.argA,l.argB)||f;a?xl(r,e,{...t,_f:a}):u&&xl(r,e,t)}let p=K(n.errors,e);if(d&&Array.isArray(p)){let t=p.root,r=c(p,l.argA,l.argB)||p;t&&(r.root=t),u&&xl(n.errors,e,r),Wu(n.errors,e),n.errors={...n.errors}}let m=K(n.touchedFields,e),h=d&&Array.isArray(m);if(h){let t=c(m,l.argA,l.argB);u&&xl(n.touchedFields,e,t)}let g=K(n.dirtyFields,e);if(d&&Array.isArray(g)){let t=c(g,l.argA,l.argB)||g;u&&xl(n.dirtyFields,e,t)}_(`dirtyFields`)?ee():s=!0,y.state.next({name:e,isDirty:he(e,i),dirtyFields:n.dirtyFields,...h&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else xl(a,e,i)},ne=(e,t)=>{xl(n.errors,e,t),n.errors={...n.errors},y.state.next({errors:n.errors})},j=e=>{Object.keys(l).forEach(E);let t=!Bl(e);n.errors=W(e),y.state.next({errors:n.errors,...t?{isValid:!1}:{}}),!t&&o.mount&&O()},re=e=>vl(e)?[e]:sl(e),ie=e=>{let t=re(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=nl(n)?n:n[i],r=nl(r)?r:r[i],n===null&&r!==null)return!0}return!1},ae=e=>{if(!o.actionArrayLengths.size)return!1;let t=re(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(nl(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;if(o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a],G(n)&&i!==-1&&e>i&&+t[i]<s)return!0}return!1},oe=e=>{let t=a;for(let n of re(e)){if(Array.isArray(t)&&+n>=t.length)return!0;t&&=t[n]}return!1},se=(e,l,u,d)=>{let f=K(r,e);if(f){if(ie(e)||ae(e))return;let r=G(K(a,e)),p=K(a,e,G(u)?K(i,e):u),m=!!d&&!n.isReady&&yu(d);if(G(p)||d&&d.defaultChecked||m||l){let t=l?p:Nu(f._f);G(t)&&oe(e)||(_(`dirtyFields`)&&!kl(K(a,e),t)&&(s=!0),xl(a,e,t),m&&ce(e,t))}else ve(e,p);o.mount&&!o.action&&(t.resolver&&_(`isValidating`,`validatingFields`)?Promise.resolve().then(()=>O()):O(),r&&n.isDirty&&_(`isDirty`)&&(he()||(n.isDirty=!1,y.state.next({...n}))),t.shouldUnregister&&r&&!G(K(a,e))&&Ll(e,c)&&(o.watch=!0))}},ce=(e,o,c,l,u)=>{let d=!1,f=!1,p={name:e};if(!t.disabled||l===!0){if(!c||l){let t=kl(K(i,e),o);if(_(`isDirty`)&&(f=n.isDirty,n.isDirty=p.isDirty=!t||he(),d=f!==p.isDirty),f=!!K(n.dirtyFields,e),t)uu(n.dirtyFields,e);else{let t=K(i,e),a=K(r,e),s=!(a&&a._f)&&(il(t)||Array.isArray(t))?Au(t,o,void 0,a):!0;xl(n.dirtyFields,e,s)}let c=!1;if(s||t&&(_(`isDirty`)?n.isDirty:he())){s=!1;let e=Au(i,a,void 0,r);kl(n.dirtyFields,e)||(c=!0,Ku(n.dirtyFields,e))}p.dirtyFields=n.dirtyFields,d||=_(`dirtyFields`)&&(c||f!==!t)}if(c){let t=gu(n.touchedFields,e)?K(n.touchedFields,e):void 0;t||(xl(n.touchedFields,e,c),p.touchedFields=n.touchedFields,d||=_(`touchedFields`)&&t!==c)}d&&u&&y.state.next(p)}return d?p:{}},le=(e,r,i,a)=>{let o=K(n.errors,e),s=_(`isValid`)&&yl(r)&&n.isValid!==r;if(t.delayError&&i?(l[e]=T(e,()=>ne(e,i)),l[e](t.delayError)):(E(e),i?xl(n.errors,e,i):uu(n.errors,e),n.errors={...n.errors}),(i?!kl(o,i,!0):o)||!Bl(a)||s){let t={...a,...s&&yl(r)?{isValid:r}:{},errors:n.errors,name:e};y.state.next(t)}},ue=async e=>(A(e,!0),await t.resolver(a,t.context,Pu(e||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),de=async e=>{let t=x,i=S,a=e?e.filter(e=>K(r,e)):[],{errors:o}=await ue(e);if(t!==x)return o;if(A(e),e){for(let t of e){if(a.includes(t)&&(!K(r,t)||C[t]>i)){uu(o,t);continue}let e=K(o,t);D(t);let s=c.array.has(t)&&il(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e))),l=K(r,t),u=il(l)&&Object.keys(l).some(e=>e!==`_f`);s?zl(n.errors,{[t]:e},t):e&&(e.type||e.message)||Array.isArray(e)||il(e)&&u?xl(n.errors,t,e):uu(n.errors,t)}n.errors={...n.errors}}else Object.keys(l).forEach(E),n.errors=o;return o},fe=async({name:e,eventType:r})=>{if(t.validate){let i=x,o=await t.validate({formValues:a,formState:n,name:e,eventType:r});if(i!==x)return!0;if(il(o)){let e=!0;De(ml);for(let t in o){let n=o[t];n&&(e=!1,Oe(`${ml}.${t}`,{message:jl(n.message)?n.message:``,type:n.type||fl.validate}))}return e}return jl(o)||!o?(Oe(ml,{message:o||``,type:fl.validate}),!1):(De(ml),!0)}return!0},pe=async({fields:e,onlyCheckValid:i,name:o,eventType:s,context:l={valid:!0,runRootValidation:!1}})=>{let u=x;if(t.validate&&!l.runRootValidation&&(l.runRootValidation=!0,!await fe({name:o,eventType:s})&&(l.valid=!1,i)))return l.valid;for(let o in e){let d=e[o];if(d){let{_f:e,...f}=d;if(e){let o=c.array.has(e.name),s=d._f&&Lu(d._f),f=_(`isValidating`,`validatingFields`);s&&f&&A([e.name],!0);let p=S,m=await Ql(d,c.disabled,a,w,t.shouldUseNativeValidation&&!i,o);if(u!==x)return l.valid;if(s&&f&&A([e.name]),!K(r,e.name)||C[e.name]>p)continue;if(m[e.name]&&(l.valid=!1,i)||(i||(E(e.name),K(m,e.name)?o?zl(n.errors,m,e.name):xl(n.errors,e.name,m[e.name]):uu(n.errors,e.name)),t.shouldUseNativeValidation&&m[e.name]))break}!Bl(f)&&await pe({context:l,onlyCheckValid:i,fields:f,name:o,eventType:s})}}return l.valid},me=()=>{for(let e of c.unMount){let t=K(r,e);t&&(t._f.refs?t._f.refs.every(e=>!xu(e)):!xu(t._f.ref))&&Me(e)}c.unMount=new Set},he=(e,t)=>(e&&!G(t)&&xl(a,e,t),!kl(o.mount?a:i,i)),ge=(e,t,n)=>{let r=o.mount?a:G(t)||!G(e)?i:t;return Ml(e,c,G(e)?{...r}:r,n,t)},_e=e=>iu(K(o.mount?a:i,e,t.shouldUnregister?K(i,e,[]):[])),ve=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=K(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&xl(a,e,Mu(t,n)),l=Vl(n.ref)&&nl(t)?``:t,_u(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?$c(n.ref)?n.refs.forEach(e=>{e.defaultChecked&&e.disabled||(e.checked=Array.isArray(l)?!!l.find(t=>t===e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):el(n.ref)?n.ref.value=``:(n.ref.value=l,n.ref.type||o||s||y.state.next({name:e,values:i?a:v(e)?W(a):void 0})))}(n.shouldDirty||n.shouldTouch)&&ce(e,c&&c._f&&!c._f.disabled&&(c._f.valueAsNumber||c._f.valueAsDate||c._f.setValueAs)?Mu(t,c._f):l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&Ce(e,{delayError:n.delayError}),n.shouldValidate&&c&&c._f&&c._f.deps&&(!Array.isArray(c._f.deps)||c._f.deps.length>0)&&Ce(c._f.deps)},M=(e,t,n,i=!1,o=!1,s=!1)=>{for(let l in t){if(!Object.prototype.hasOwnProperty.call(t,l))continue;let u=t[l],d=e+`.`+l,f=K(r,d);c.array.has(d)&&y.array.next({name:d,values:i?a:W(a)}),(c.array.has(e)||il(u)||f&&!f._f)&&!tl(u)?M(d,u,n,i,o,s):ve(d,u,n,i,o,s)}},N=(e,t,i,s,l=!1)=>{let u=K(r,e),d=c.array.has(e),f=s?t:W(t),p=kl(K(a,e),f);if(p||xl(a,e,f),d)y.array.next({name:e,values:s?a:W(a)}),_(`isDirty`,`dirtyFields`)&&i.shouldDirty&&(ee(),n.isDirty=he(e,f),l||y.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:n.isDirty})),i.shouldValidate&&Ce(e,{delayError:i.delayError});else{let t=Array.isArray(f)&&!f.length||Bl(f),n=!p&&!l;!u||u._f||nl(f)||t?ve(e,f,i,s,l,n):M(e,f,i,s,l,n)}if(!p&&!l){let t=Ll(e,c),r=o.mount||t?e:void 0,i=d?[]:ju(c.array,e),l=s?a:v(r)||i.some(v)?W(a):void 0;y.state.next({...t&&n,name:r,values:l});for(let e of i)y.state.next({name:e,values:l})}},ye=(e,t,n={})=>N(e,t,n,!1),be=(e,t={})=>{let r=bl(e)?e(a):e;if(!kl(a,r)){a={...a,...r};for(let e of new Set([...c.mount,...c.array]))gu(r,e)&&N(e,K(r,e),t,!0,!0);y.state.next({...n,name:void 0,type:void 0,...d.size?{values:a}:{}}),t.shouldValidate&&O()}},xe=async e=>{o.mount=!0;let i=e.target,s=i.name,u=!0,d=K(r,s),m=S,h=e=>{u=!!K(r,s)&&!(C[s]>m)&&kl(e,K(a,s,e))};if(d){o.keepIsValid=!1;let m,g,S=!1,C=i.type?Nu(d._f):al(e),T=e.type===ul.BLUR||e.type===ul.FOCUS_OUT,E=!Ru(d._f)&&!t.validate&&!t.resolver&&!K(n.errors,s)&&!d._f.deps,D=E||Uu(T,K(n.touchedFields,s),n.isSubmitted,p,f),k=Ll(s,c,T);xl(a,s,W(C)),T?i&&i.readOnly||(d._f.onBlur&&d._f.onBlur(e),Object.prototype.hasOwnProperty.call(l,s)&&(S=!0,l[s](0))):d._f.onChange&&d._f.onChange(e);let ee=ce(s,C,T),te=!Bl(ee)||k;if(!T&&y.state.next({name:s,type:e.type,...v(s)?{values:W(a)}:{}}),D)return E&&n.isValid||!_(`isValid`)||(t.mode===`onBlur`?T&&O():T||O()),te&&y.state.next({name:s,...k?{}:ee});if(!t.resolver&&t.validate&&await fe({name:s,eventType:e.type}),!T&&k&&y.state.next({...n}),t.resolver){let e=x,{errors:t}=await ue([s]);if(e!==x)return;if(A([s]),h(C),!u){!Bl(ee)&&y.state.next(ee);return}let i=zu(n.errors,r,s),a=zu(t,r,i.name||s);m=a.error,s=a.name,g=Bl(t)}else{let n=x,i=++b;if(A([s],!0),m=(await Ql(d,c.disabled,a,w,t.shouldUseNativeValidation))[s],n!==x)return;if(A([s]),h(C),u){if(m)g=!1;else if(_(`isValid`)){if(g=await pe({fields:r,onlyCheckValid:!0,name:s,eventType:e.type}),n!==x)return;h(C),i!==b&&(g=void 0)}}}u&&(d._f.deps&&(!Array.isArray(d._f.deps)||d._f.deps.length>0)&&Ce(d._f.deps),le(s,g,m,ee),S&&Object.prototype.hasOwnProperty.call(l,s)&&l[s](0))}},Se=(e,t)=>{if(K(n.errors,t)&&e.focus)return e.focus(),1},Ce=async(e,i={})=>{o.keepIsValid=!1;let a,s,u=$l(e),d=x;if(t.resolver){let t=await de(G(e)?e:u);a=Bl(t),s=e?!u.some(e=>K(t,e)):a}else e?(s=(await Promise.all(u.map(async e=>{let t=K(r,e);return await pe({fields:t&&t._f?{[e]:t}:t,eventType:ul.TRIGGER})}))).every(Boolean),(s||n.isValid)&&O()):s=a=await pe({fields:r,name:e,eventType:ul.TRIGGER});if(d!==x)return s;if(i.delayError&&t.delayError&&jl(e)){let r=K(n.errors,e);r?(uu(n.errors,e),l[e]=T(e,()=>ne(e,r)),l[e](t.delayError)):E(e)}if(i.shouldTouch)for(let t of e?u:c.mount)!c.array.has(t)&&xl(n.touchedFields,t,!0);return n.errors={...n.errors},y.state.next({...!jl(e)||_(`isValid`)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},...i.shouldTouch&&_(`touchedFields`)?{touchedFields:n.touchedFields}:{},errors:n.errors}),i.shouldFocus&&!s&&Rl(r,Se,e?u:c.mount),s},we=((e,t)=>{let r=G(e)&&!t?{...o.mount?a:i}:o.mount?a:i;return t&&(r=mu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),G(e)?r:jl(e)?K(r,e):e.map(e=>K(r,e))}),Te=(e=>G(e)?{...n.errors}:jl(e)?K(n.errors,e):e.map(e=>K(n.errors,e))),Ee=(e,t)=>{let r=t||n,i=K(r.errors,e);return{invalid:!!i,isDirty:!!K(r.dirtyFields,e),error:i,isValidating:!!K(r.validatingFields,e),isTouched:!!K(r.touchedFields,e)}},De=e=>{let t=e?$l(e):void 0;t?t.forEach(e=>{D(e),uu(n.errors,e),n.errors={...n.errors},y.state.next({name:e,errors:n.errors})}):(Object.keys(l).forEach(E),n.errors={},y.state.next({errors:n.errors}))},Oe=(e,t,i)=>{D(e);let a=K(r,e,{_f:{}}),o=a._f&&a._f.ref,{ref:s,message:c,type:l,types:u,...d}=K(n.errors,e)||{};xl(n.errors,e,{...d,...t,ref:o}),n.errors={...n.errors},y.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&o&&o.focus&&o.focus()},ke=(e,t)=>{if(bl(e)){let n={};d.add(n);let{unsubscribe:r}=y.state.subscribe({next:n=>`values`in n&&e(n.values||ge(void 0,t),n)});return{unsubscribe:()=>{d.delete(n),r()}}}return ge(e,t,!0)},Ae=e=>{let t={name:e.name,exact:e.exact};e.formState&&e.formState.values&&d.add(t);let{unsubscribe:r}=y.state.subscribe({next:t=>{if(Hu(e.name,t.name,e.exact)&&Bu(t,e.formState||h,e.reRenderRoot)){let r=t.values||{...a};e.callback({...n,...t,validatingFields:n.validatingFields,isValidating:n.isValidating,values:r,defaultValues:i})}}});return()=>{d.delete(t),r()}},je=e=>{o.mount=!0;let t=Object.keys(e.formState||{}).filter(t=>e.formState&&e.formState[t]);for(let e of t)g[e]=(g[e]||0)+1;let n=Ae({...e,formState:{...m,...e.formState}});return()=>{for(let e of t.splice(0))g[e]--;n()}},Me=(e,o={})=>{let s=e?$l(e):c.mount;o.keepIsValidating||k(s);for(let e of s)c.mount.delete(e),c.array.delete(e),c.disabled.delete(e),uu(r,e),!o.keepValue&&uu(a,e),o.keepError||(D(e),uu(n.errors,e)),!o.keepDirty&&uu(n.dirtyFields,e),!o.keepTouched&&uu(n.touchedFields,e),!t.shouldUnregister&&!o.keepDefaultValue&&uu(i,e);o.keepError||(n.errors={...n.errors}),d.size&&y.state.next({values:W(a)}),y.state.next({...n,...o.keepDirty?{}:{isDirty:he()},...o.keepIsValidating?{}:{isValidating:!Bl(n.validatingFields)}}),!o.keepIsValid&&O()},Ne=({disabled:e,name:t})=>{if(yl(e)&&o.mount||e||c.disabled.has(t)){let n=c.disabled.has(t)!==!!e;e?c.disabled.add(t):c.disabled.delete(t),n&&o.mount&&!o.action&&O()}},P=(e,n={})=>{let a=K(r,e),s=yl(n.disabled)||yl(t.disabled),l=!c.registerName.has(e)&&a&&a._f&&!a._f.mount;if(a&&a._f||(C[e]=++S),xl(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),c.mount.add(e),a&&a._f){let t=K(r,e);for(let e of pl)e in n||delete t._f[e]}return a&&!l?Ne({disabled:yl(n.disabled)?n.disabled:t.disabled,name:e}):se(e,!0,n.value),{...s?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!Fu(n.required),min:Fu(n.min),max:Fu(n.max),minLength:Fu(n.minLength),maxLength:Fu(n.maxLength),pattern:Fu(n.pattern)}:{},name:e,onChange:xe,onBlur:xe,ref:s=>{if(s){c.registerName.add(e),P(e,n),c.registerName.delete(e),a=K(r,e);let t=G(s.value)&&s.querySelectorAll&&s.querySelectorAll(`input,select,textarea`)[0]||s,o=bu(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(xu),t,...Array.isArray(K(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),xl(r,e,{_f:u}),se(e,!1,void 0,t)}else a=K(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(cl(c.array,e)&&o.action)&&c.unMount.add(e)}}},Pe=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Rl(r,Se,c.mount),Fe=e=>{yl(e)&&(y.state.next({disabled:e}),Rl(r,(t,n)=>{let i=K(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0))},Ie=(e,i)=>async o=>{let s,u;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let d=W(a);y.state.next({isSubmitting:!0});let f=x,p=e=>{throw f===x&&y.state.next({isSubmitting:!1}),e};if(t.resolver){let e;try{e=await ue()}catch(e){p(e)}let{errors:t,values:r}=e;if(f!==x)return;A(),Object.keys(l).forEach(E),n.errors=t,d=W(r)}else{try{await pe({fields:r,eventType:ul.SUBMIT})}catch(e){p(e)}if(f!==x)return;uu(n.errors,hl),n.errors={...n.errors}}if(c.disabled.size)for(let e of c.disabled)uu(d,e);if(Bl(n.errors)){y.state.next({errors:{}});try{s=await e(d,o)}catch(e){u=e}}else{if(i)try{await i({...n.errors},o)}catch(e){p(e)}Pe(),setTimeout(Pe)}if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Bl(n.errors)&&!u,submitCount:n.submitCount+1,errors:n.errors}),u)throw u;return s},Le=(e,t={})=>{K(r,e)&&(k([e]),G(t.defaultValue)?ye(e,W(K(i,e))):(ye(e,t.defaultValue),xl(i,e,W(t.defaultValue))),t.keepTouched||uu(n.touchedFields,e),t.keepDirty||(uu(n.dirtyFields,e),n.isDirty=G(t.defaultValue)?he():he(e,W(K(i,e)))),t.keepError||(D(e),uu(n.errors,e),n.errors={...n.errors},O()),y.state.next({...n,isValidating:!Bl(n.validatingFields)}))},Re=(e,u={})=>{x++,b++;let d=e?W(e):i,f=W(d),p=Bl(e),m=f,g=r;if(Object.keys(l).forEach(E),u.keepDefaultValues||(i=d),!u.keepValues){if(u.keepDirtyValues){let e=new Set([...c.mount,...Cu(Au(i,a,void 0,g),n.dirtyFields)]);for(let t of e){let e=K(n.dirtyFields,t),r=K(a,t),i=K(m,t);e&&!G(r)?xl(m,t,r):!e&&!G(i)&&ye(t,i)}}else{if(ll&&G(e))for(let e of c.mount){let t=K(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Vl(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(u.keepFieldsRef)for(let e of c.mount)ye(e,K(m,e));else r={}}if(t.shouldUnregister){if(a=u.keepDefaultValues?W(i):{},u.keepFieldsRef)for(let e of c.mount)xl(a,e,K(m,e))}else a=W(m);y.array.next({values:{...m}}),y.state.next({name:void 0,type:void 0,values:{...m}})}c={mount:u.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:u.keepValues||u.keepDirtyValues||u.keepFieldsRef?new Set([...c.disabled].filter(e=>K(r,e))):new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!h.isValid||!!u.keepIsValid||!!u.keepDirtyValues||!t.shouldUnregister&&!Bl(m),o.watch=!!t.shouldUnregister,o.keepIsValid=!!u.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),s=!1,u.keepErrors||(n.errors={}),y.state.next({submitCount:u.keepSubmitCount?n.submitCount:0,isDirty:p?!1:u.keepDirty?n.isDirty:u.keepValues?he():!!(u.keepDefaultValues&&e&&!kl(e,i)),isSubmitted:u.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:p?{}:u.keepDirtyValues?u.keepDefaultValues&&a?Au(i,a,void 0,g):n.dirtyFields:u.keepDefaultValues&&e?Au(i,e,void 0,g):u.keepDirty?n.dirtyFields:u.keepValues?Au(i,a,void 0,g):{},touchedFields:u.keepTouched?n.touchedFields:{},...!u.keepIsValidating&&(n.isValidating||!Bl(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:u.keepErrors?n.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},ze=(e,n)=>Re(bl(e)?e(a):e,{...t.resetOptions,...n}),Be=(e,t={})=>{let n=K(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&bl(e.select)&&e.select()})}};y.state.subscribe({next:e=>{let{name:t,type:r,values:i,...a}=e;Object.keys(a).length&&(n={...n,...a})}});let Ve={control:{register:P,unregister:Me,getFieldState:Ee,handleSubmit:Ie,setError:Oe,_subscribe:Ae,_runSchema:ue,_updateIsValidating:A,_focusError:Pe,_getWatch:ge,_getDirty:he,_setValid:O,_setFieldArray:te,_setDisabledField:Ne,_setErrors:j,_getFieldArray:_e,_reset:Re,_resetDefaultValues:()=>bl(t.defaultValues)&&t.defaultValues().then(e=>{ze(e,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:me,_disableForm:Fe,_subjects:y,_proxyFormState:h,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return c},set _names(e){c=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},f=Il(t.mode),p=Il(t.reValidateMode),w=t.criteriaMode===dl.all}},subscribe:je,trigger:Ce,register:P,handleSubmit:Ie,watch:ke,setValue:ye,setValues:be,getValues:we,getErrors:Te,reset:ze,resetField:Le,resetDefaultValues:(e,t={})=>{if(i=W(e),!t.keepDirty){let e=Au(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!Bl(e)}t.keepIsValid||O(),y.state.next({...n,defaultValues:i})},clearErrors:De,unregister:Me,setError:Oe,setFocus:Be,getFieldState:Ee};return{...Ve,formControl:Ve}}var Yu={mode:Gu.mode,reValidateMode:Gu.reValidateMode,shouldFocusError:Gu.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0,progressive:void 0,resetOptions:void 0};function Xu(e={}){let t=_.useRef(void 0),n=_.useRef(void 0),r=_.useRef(e.formControl),i=_.useRef(!1),a=_.useRef(!!e.validate),o=_.useRef(!!e.errors),s=_.useRef(!1),[c,l]=_.useState(()=>({...W(qu),isLoading:bl(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:bl(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,i.current=!1,e.formControl)t.current={...e.formControl,formState:c},e.defaultValues&&!bl(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=Ju(e);t.current={...r,formState:c}}}let u=t.current.control,d=u._options,f={};for(let t in Yu)t in d&&!(t in e)&&(f[t]=Yu[t]);i.current&&!e.disabled&&(f.disabled=!1),u._options={...f,...e,validate:e.validate};let p=()=>({...u._formState,defaultValues:u._defaultValues}),{resyncIfNeeded:m,snapshot:h}=Al(p);return Tl(()=>{m(!0,p,l);let e=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(e=>({...e,isReady:!0})),u._formState.isReady=!0,u._subjects.state.next({isReady:!0}),()=>{e(),h(!0,p)}},[u,m,h]),_.useEffect(()=>{u._disableForm(i.current&&!e.disabled?!1:e.disabled),i.current=!!e.disabled},[u,e.disabled]),_.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),_.useEffect(()=>{e.errors?(u._setErrors(e.errors),u._focusError()):o.current&&u._setErrors({}),o.current=!!e.errors},[u,e.errors]),_.useEffect(()=>{a.current&&!e.validate&&t.current&&t.current.clearErrors(ml),a.current=!!e.validate},[e.validate]),_.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),_.useEffect(()=>{if(u._proxyFormState.isDirty){let e=u._getDirty();e!==c.isDirty&&u._subjects.state.next({isDirty:e})}},[u,c.isDirty]),_.useEffect(()=>{e.values&&!kl(e.values,n.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),u._options.resetOptions&&u._options.resetOptions.keepIsValid||u._setValid(),n.current=e.values,l(e=>({...e}))):u._resetDefaultValues()},[u,e.values]),_.useEffect(()=>{u._state.mount&&(s.current||e.values)||(u._setValid(),u._state.mount=!0),s.current=!0,u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),t.current.formState=_.useMemo(()=>wl(c,u),[u,c]),t.current}var Zu=_.createContext(null);Zu.displayName=`HookFormContext`;function J(e,t=`|`){return e.map(e=>ld(e)).join(t)}function Qu(e,t){return typeof t==`bigint`?t.toString():t}function Y(e){return e==null}function X(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function $u(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ed(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function td(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function nd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var rd=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function id(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ad(e){if(id(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return id(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function od(e){return ad(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function sd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function cd(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ld(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}var ud={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},dd={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function fd(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function pd(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function md(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function hd(e){return typeof e==`string`?e:e?.message}function gd(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function _d(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function vd(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:hd(e.inst?._zod.def?.error?.(e))??hd(a?.(e))??hd(t?.error?.(e))??hd(n.customError?.(e))??hd(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var yd=/[\uD800-\uDBFF]/;function bd(e){let t=e.length;if(!yd.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function xd(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Sd(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Cd(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function wd(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Od(e,n,r.value)}}function Td(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ed(e,t,n){return Td(e,t,n,!1)}function Dd(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Td(this,n,r(this))},set(e){Td(this,n,e)}})}return t}function Od(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Td(this,t,n.bind(this))},set(e){Td(this,t,e)}})}var kd,Ad=!1,jd={configurable:!0,get(){Ad=!0}};function Md(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&kd!==e._zod?kd=void 0:(kd=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,jd);let e=Ad;Ad=!1;try{let r=n(this);return Ad?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Ad||=e,r}catch(n){throw delete this[t],Ad||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}var Nd=`~constantCatch`;function Pd(e){let t=()=>e;return t[Nd]=!0,t}var Fd,Id={value:void 0,enumerable:!1},Ld=`captureStackTrace`in Error?Error:null;function Rd(e){let t=Ld;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ld=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Q(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Id.value=new a(r);try{Object.defineProperty(n,"_zod",Id)}finally{Id.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),wd(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Rd(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var zd=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Bd=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Fd=globalThis).__zod_globalConfig??(Fd.__zod_globalConfig={});var Vd=globalThis.__zod_globalConfig;function Hd(e){return e&&Object.assign(Vd,e),Vd}function Ud(){let e=this._zod;return e.message??=JSON.stringify(e.def,Qu,2),e.message}function Wd(e){this._zod.message=e}var Gd={get:Ud,set:Wd,enumerable:!0,configurable:!0},Kd={value:void 0,enumerable:!1},qd=new WeakSet([Object.prototype,Error.prototype]),Jd=Q(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Kd.value=t,Object.defineProperty(e,"issues",Kd),Kd.value=void 0,Object.defineProperty(e,"message",Gd);let n=Object.getPrototypeOf(e);qd.has(n)||(qd.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Yd(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Xd(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Yd(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Zd(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Qd(e,t){return{callee:t?.callee??e,Err:t?.Err}}var $d=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new zd;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>vd(e,o,Hd())));throw rd(n,a?.callee??t),n}return s.value};return t},ef=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>vd(e,o,Hd())));throw rd(n,a?.callee??t),n}return s.value};return t},tf=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new zd;return a.issues.length?nf(e,a.issues,i):{success:!0,data:a.value}};function nf(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>vd(e,n,Hd()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var rf=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?nf(e,a.issues,i):{success:!0,data:a.value}},af=Symbol.for(`zod.compile.invalid`),of=Symbol.for(`zod.compile.fallback`),sf=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==af)return!0;if(r.definite===!0&&n===void 0)return!1}return cf(e,t,n)});function cf(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[of]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new zd;return a.issues.length===0}var lf=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},uf=e=>{let t=$d(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Qd(n,a))};return n},df=e=>{let t=$d(e),n=(e,r,i,a)=>t(e,r,i,Qd(n,a));return n},ff=e=>{let t=ef(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Qd(n,a))};return n},pf=e=>{let t=ef(e),n=async(e,r,i,a)=>await t(e,r,i,Qd(n,a));return n},mf=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return tf(e)(t,n,i)},hf=e=>(t,n,r)=>tf(e)(t,n,r),gf=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return rf(e)(t,n,i)},_f=e=>async(t,n,r)=>rf(e)(t,n,r),vf=/^[cC][0-9a-z]{6,}$/,yf=/^[0-9a-z]+$/,bf=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,xf=/^[0-9a-vA-V]{20}$/,Sf=/^[A-Za-z0-9]{27}$/,Cf=/^[a-zA-Z0-9_-]{21}$/;function wf(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Tf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ef=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Df=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Of=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kf=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Af(){return new RegExp(kf,`u`)}var jf=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Nf=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Pf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ff=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,If=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Lf=/^https?$/,Rf=/^\+[1-9]\d{6,14}$/,zf=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Bf(e){return RegExp(`^${e}$`)}var $=Bf(zf);function Vf(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Hf(e){return RegExp(`^${Vf(e)}$`)}function Uf(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Vf({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Vf({precision:e.precision})}`:n;return RegExp(`^${zf}T(?:${r})$`)}var Wf=/^[\s\S]{0,}$/,Gf=/^[^A-Z]*$/,Kf=/^[^a-z]*$/,qf=Q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Jf=e=>{let t=e.value;return!Y(t)&&t.length!==void 0},Yf=Q(`$ZodCheckMaxLength`,(e,t)=>{var n;qf.init(e,t),(n=e._zod.def).when??(n.when=Jf),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?bd(r):i)<=t.maximum)return;let a=xd(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Xf=Q(`$ZodCheckMinLength`,(e,t)=>{var n;qf.init(e,t),(n=e._zod.def).when??(n.when=Jf),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?bd(r):i)>=t.minimum)return;let a=xd(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zf=Q(`$ZodCheckLengthEquals`,(e,t)=>{var n;qf.init(e,t),(n=e._zod.def).when??(n.when=Jf),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?bd(r):i;if(a===t.length)return;let o=xd(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Qf=Q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;qf.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),$f=Q(`$ZodCheckRegex`,(e,t)=>{Qf.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ep=Q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Gf,Qf.init(e,t)}),tp=Q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Kf,Qf.init(e,t)}),np=Q(`$ZodCheckIncludes`,(e,t)=>{qf.init(e,t);let n=sd(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),rp=Q(`$ZodCheckStartsWith`,(e,t)=>{qf.init(e,t);let n=RegExp(`^${sd(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ip=Q(`$ZodCheckEndsWith`,(e,t)=>{qf.init(e,t);let n=RegExp(`.*${sd(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ap=Q(`$ZodCheckOverwrite`,(e,t)=>{qf.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),op={major:4,minor:6,patch:7},sp=Q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=op;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=fd(t),a;for(let o of n){if(o._zod.def.when){if(pd(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new zd;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(_d(t.issues,n,e),i||=fd(t,n))});else{if(t.issues.length===n)continue;_d(t.issues,n,e),i||=fd(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(fd(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new zd;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new zd;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ed(this,`~standard`,up(this))},set"~standard"(e){Td(this,`~standard`,e)}}),cp=(e,t)=>e.issues.length?{issues:e.issues.map(e=>vd(e,t,Hd()))}:{value:e.value};async function lp(e,t){let n={async:!0};return cp(await e._zod.run({value:t,issues:[]},n),n)}function up(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return cp(r,n)}catch{}return lp(e,t)},vendor:`zod`,version:1}}var dp=Q(`$ZodString`,(e,t)=>{sp.init(e,t),e._zod.pattern=t.pattern??Wf,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),fp=Q(`$ZodStringFormat`,(e,t)=>{Qf.init(e,t),dp.init(e,t)}),pp=Q(`$ZodGUID`,(e,t)=>{t.pattern??=Ef,fp.init(e,t)}),mp=Q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Df(e)}else t.pattern??=Df();fp.init(e,t)}),hp=Q(`$ZodEmail`,(e,t)=>{t.pattern??=Of,fp.init(e,t)});function gp(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function _p(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?gp(e)||2:vp(e,t)}function vp(e,t){if(!t.normalize&&t.protocol?.source===Lf.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var yp=/[\t\n\r]/g;function bp(e){return e.replace(yp,``)}function xp(e,t){return t.lastIndex=0,t.test(e.hostname)}function Sp(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Cp=Q(`$ZodURL`,(e,t)=>{fp.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=_p(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=bp(r);return}t.hostname&&!xp(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Sp(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:bp(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),wp=Q(`$ZodEmoji`,(e,t)=>{t.pattern??=Af(),fp.init(e,t)}),Tp=Q(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Cf:wf(t.length),fp.init(e,t)}),Ep=Q(`$ZodCUID`,(e,t)=>{t.pattern??=vf,fp.init(e,t)}),Dp=Q(`$ZodCUID2`,(e,t)=>{t.pattern??=yf,fp.init(e,t)}),Op=Q(`$ZodULID`,(e,t)=>{t.pattern??=bf,fp.init(e,t)}),kp=Q(`$ZodXID`,(e,t)=>{t.pattern??=xf,fp.init(e,t)}),Ap=Q(`$ZodKSUID`,(e,t)=>{t.pattern??=Sf,fp.init(e,t)}),jp=Q(`$ZodISODateTime`,(e,t)=>{t.pattern??=Uf(t),fp.init(e,t)}),Mp=Q(`$ZodISODate`,(e,t)=>{t.pattern??=$,fp.init(e,t)}),Np=Q(`$ZodISOTime`,(e,t)=>{t.pattern??=Hf(t),fp.init(e,t)}),Pp=Q(`$ZodISODuration`,(e,t)=>{t.pattern??=Tf,fp.init(e,t)}),Fp=Q(`$ZodIPv4`,(e,t)=>{t.pattern??=jf,fp.init(e,t)}),Ip=/^[0-9a-fA-F:.]+$/;function Lp(e){return Ip.test(e)?gp(`http://[${e}]`):!1}var Rp=Q(`$ZodIPv6`,(e,t)=>{t.pattern??=Mf,fp.init(e,t),e._zod.check=n=>{Lp(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),zp=Q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Nf,fp.init(e,t)});function Bp(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Lp(n)}var Vp=Q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Pf,fp.init(e,t),e._zod.check=n=>{Bp(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Hp(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Up=/^[0-9a-zA-Z+/]*={0,2}$/,Wp=Q(`$ZodBase64`,(e,t)=>{t.pattern??=Up,fp.init(e,t),e._zod.check=n=>{Hp(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Gp=/^[A-Za-z0-9_-]*$/;function Kp(e){if(!Gp.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Hp(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var qp=Q(`$ZodBase64URL`,(e,t)=>{t.pattern??=Gp,fp.init(e,t),e._zod.check=n=>{Kp(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Jp=Q(`$ZodE164`,(e,t)=>{t.pattern??=Rf,fp.init(e,t)});function Yp(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Xp=Q(`$ZodJWT`,(e,t)=>{fp.init(e,t),e._zod.check=n=>{Yp(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}});function Zp(e,t){let n=gd(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of gd(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,_d(n.issues,t,e),n}}return i(n,a)}}var Qp=e=>Array.isArray(e)?e.length:-1;function $p(e,t,n){e.issues.length&&t.issues.push(...md(n,e.issues)),t.value[n]=e.value}var em=Q(`$ZodArray`,(e,t)=>{sp.init(e,t);let n=Vd.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>$p(t,r,e)));else if($p(c,r,e),s&&c.issues.length!==0&&fd(c))break}return o.length?Promise.all(o).then(()=>r):r},Zp(e,Qp)});function tm(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!fd(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>vd(e,r,Hd())))}),t)}var nm=Q(`$ZodUnion`,(e,t)=>{sp.init(e,t),Md(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Md(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Md(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Md(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>X(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>tm(t,r,e,i)):tm(o,r,e,i)}}),rm=Q(`$ZodIntersection`,(e,t)=>{sp.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>am(e,t,n)):am(e,i,a)}});function im(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ad(e)&&ad(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=im(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=im(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function am(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=im(t.value,n.value);if(!c.valid){if(fd(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var om=Q(`$ZodTransform`,(e,t)=>{sp.init(e,t),e._zod.optin=`optional`,Vd.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Bd(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new zd;return n.value=i,n}});function sm(e,t){return e.value=t.issues.length?void 0:t.value,e}var cm=Q(`$ZodOptional`,(e,t)=>{sp.init(e,t),Md(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Md(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Md(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${X(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>sm(e,t)):sm(e,r)}return t.innerType._zod.run(e,n)}}),lm=Q(`$ZodExactOptional`,(e,t)=>{cm.init(e,t),Md(e,`values`,e=>e.def.innerType._zod.values),Md(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),um=Q(`$ZodNullable`,(e,t)=>{sp.init(e,t),Md(e,`optin`,e=>e.def.innerType._zod.optin),Md(e,`optout`,e=>e.def.innerType._zod.optout),Md(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${X(t.source)}|null)$`):void 0}),Md(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),dm=Q(`$ZodDefault`,(e,t)=>{sp.init(e,t),e._zod.optin=`defaulted`,Md(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>fm(e,t)):fm(r,t)}});function fm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var pm=Q(`$ZodPrefault`,(e,t)=>{sp.init(e,t),e._zod.optin=`defaulted`,Md(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),mm=Q(`$ZodNonOptional`,(e,t)=>{sp.init(e,t),Md(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>hm(t,e)):hm(i,e)}});function hm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function gm(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>vd(e,r,Hd()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var _m=Q(`$ZodCatch`,(e,t)=>{sp.init(e,t),Md(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Md(e,`optout`,e=>e.def.innerType._zod.optout),Md(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>gm(e,r,t,n)):gm(e,r,t,n)}}),vm=Q(`$ZodPipe`,(e,t)=>{sp.init(e,t),Md(e,`values`,e=>e.def.in._zod.values),Md(e,`optin`,e=>e.def.in._zod.optin),Md(e,`optout`,e=>e.def.out._zod.optout),Md(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ym(e,t.in,n)):ym(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ym(e,t.out,n)):ym(r,t.out,n)}});function ym(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var bm=Q(`$ZodReadonly`,(e,t)=>{sp.init(e,t),Md(e,`propValues`,e=>e.def.innerType._zod.propValues),Md(e,`values`,e=>e.def.innerType._zod.values),Md(e,`optin`,e=>e.def.innerType?._zod?.optin),Md(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(xm):xm(r)}});function xm(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Sm=Q(`$ZodCustom`,(e,t)=>{qf.init(e,t),sp.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Cm(t,n,r,e));Cm(i,n,r,e)}});function Cm(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Cd(e))}}var wm=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Tm=`~memo`,Em=[];function Dm(e){return typeof e==`object`&&!!e}function Om(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var km=new WeakMap,Am=0,jm=1,Mm=2;function Nm(e,t,n){let r=km.get(e);if(r!==void 0)return r?Mm:Am;if(t.has(e))return Mm;t.add(e);let i=Am,a=e=>{if(i!==Mm&&e?._zod){let r=Nm(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Am;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?jm:o.value?._zod?Nm(o.value,t,n):Am;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=ed(c);s(e?o(e,!0):jm),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Nm(r,t,!1):jm);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Pm(e,i)}function Pm(e,t){return t!==jm&&km.set(e,t===Mm),t}function Fm(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Im,Lm=[],Rm={alloc(e,t,n){let r=Im;if(!r)return n;Im=void 0;let i={value:n,issues:null};return r.set(t.value,i),Lm.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Bm(n,e.value))throw new wm;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Nm(e,new Set,!1);if(i===Am)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Mm||r?n=!0:r=!0}let l=s.value;if(!Dm(l))return t(s,c);let u=c[Tm];u||(u={buckets:new WeakMap,backEdges:void 0},c[Tm]=u);let d;i===c?d=a:(d=Fm(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Om(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Im=d;let p=Lm.length,m=t(s,c);Im=void 0;let h=Lm.length>p?Lm.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Om(e.issues):Em),e)):(h&&(h.issues=m.issues.length?Om(m.issues):Em),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function zm(){return Rm}function Bm(e,t){let n=e[Tm]?.backEdges;return n!==void 0&&Dm(t)&&n.has(t)}var Vm=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Sd(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ld(e.values[0])}`:`Invalid option: expected one of ${J(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${J(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Hm(){return{localeError:Vm()}}var Um,Wm=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Gm(){return new Wm}(Um=globalThis).__zod_globalRegistry??(Um.__zod_globalRegistry=Gm());var Km=globalThis.__zod_globalRegistry;function qm(e){return e.checks&&=[...e.checks],e}function Jm(e,t){return new e(qm({type:`string`,...Z(t)}))}function Ym(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Z(t)})}function Xm(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Z(t)})}function Zm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Z(t)})}function Qm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Z(t)})}function $m(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Z(t)})}function eh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Z(t)})}function th(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Z(t)})}function nh(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Z(t)})}function rh(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Z(t)})}function ih(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Z(t)})}function ah(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Z(t)})}function oh(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Z(t)})}function sh(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Z(t)})}function ch(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Z(t)})}function lh(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Z(t)})}function uh(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Z(t)})}function dh(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Z(t)})}function fh(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Z(t)})}function ph(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Z(t)})}function mh(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Z(t)})}function hh(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Z(t)})}function gh(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Z(t)})}function _h(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Z(t)})}function vh(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Z(t)})}function yh(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Z(t)})}function bh(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Z(t)})}function xh(e,t){return new Yf({check:`max_length`,...Z(t),maximum:e})}function Sh(e,t){return new Xf({check:`min_length`,...Z(t),minimum:e})}function Ch(e,t){return new Zf({check:`length_equals`,...Z(t),length:e})}function wh(e,t){return new $f({check:`string_format`,format:`regex`,...Z(t),pattern:e})}function Th(e){return new ep({check:`string_format`,format:`lowercase`,...Z(e)})}function Eh(e){return new tp({check:`string_format`,format:`uppercase`,...Z(e)})}function Dh(e,t){return new np({check:`string_format`,format:`includes`,...Z(t),includes:e})}function Oh(e,t){return new rp({check:`string_format`,format:`starts_with`,...Z(t),prefix:e})}function kh(e,t){return new ip({check:`string_format`,format:`ends_with`,...Z(t),suffix:e})}function Ah(e){return new ap({check:`overwrite`,tx:e})}function jh(e){return Ah(t=>t.normalize(e))}function Mh(){return Ah(e=>e.trim())}function Nh(){return Ah(e=>e.toLowerCase())}function Ph(){return Ah(e=>e.toUpperCase())}function Fh(){return Ah(e=>nd(e))}function Ih(e,t,n){return new e({type:`array`,element:t,...Z(n)})}function Lh(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Z(n)})}function Rh(e,t){let n=zh(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Cd(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Cd(r))}},e(t.value,t)),t);return n}function zh(e,t){let n=new qf({check:`custom`,...Z(t)});return n._zod.check=e,n}function Bh(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&$u(e,t,n[t]);return e}function Vh(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Km,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Hh(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Uh(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Uh(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Bh(o.schema,c),t.io===`input`&&$h(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Wh(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Gh(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Wh(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Wh(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Kh(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Kh(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var qh=new Set([`type`,`properties`,`required`,`additionalProperties`]),Jh=[`oneOf`,`anyOf`];function Yh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Xh(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!qh.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Yh(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}$u(n,r,e.length===1?e[0]:Xh(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Yh(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Zh(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of qh)if(t in e)return;let n=t.filter(e=>Jh.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Xh(t);else{let e=n[0],i=Jh.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Xh([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Bh(e,r))}function Qh(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Bh(i,s),Bh(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Kh(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Zh(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Bh(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,$u(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:tg(t,`input`,e.processors),output:tg(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function $h(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return $h(r.element,n);if(r.type===`set`)return $h(r.valueType,n);if(r.type===`lazy`)return $h(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return $h(r.innerType,n);if(r.type===`intersection`)return $h(r.left,n)||$h(r.right,n);if(r.type===`record`||r.type===`map`)return $h(r.keyType,n)||$h(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:$h(r.in,n)||$h(r.out,n);if(r.type===`object`){for(let e in r.shape)if($h(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if($h(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if($h(e,n))return!0;return!!(r.rest&&$h(r.rest,n))}return!1}var eg=(e,t={})=>n=>{let r=Vh({...n,processors:t});return Uh(e,r),Gh(r,e),Qh(r,e)},tg=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Vh({...i??{},target:a,io:t,processors:n});return Uh(e,o),Gh(o,e),Qh(o,e)},ng=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},rg=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},ig=(e,t)=>{ng(e,`minimum`,t),rg(e,`maximum`,t)},ag=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},og=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},sg=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},cg=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},lg=(e,t)=>ng(e,`minimum`,t.minimum),ug=(e,t)=>rg(e,`maximum`,t.maximum),dg=e=>(t,n)=>{cg(t,n.format);let[r,i]=e[n.format];ng(t,`minimum`,r),rg(t,`maximum`,i)},fg={greater_than:(e,t)=>ng(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>rg(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ag(e,t.value),number_format:dg(ud),bigint_format:dg(dd),min_length:lg,max_length:ug,length_equals:(e,t)=>ig(e,t.length),min_size:lg,max_size:ug,size_equals:(e,t)=>ig(e,t.size),string_format:(e,t)=>{cg(e,t.format),t.pattern&&og(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>sg(e,t.mime)};function pg(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)fg[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ng(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ng(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&rg(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&rg(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ag(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&sg(t,i.mime);for(let e of i.patterns??[])og(t,e);return t}var mg={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},hg=new Map([[Up,Ff],[Gp,If]]),gg=e=>hg.get(e)??e,_g=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=pg(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=mg[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(gg);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},vg=(e,t,n,r)=>{Hh(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},yg=(e,t,n,r)=>{Hh(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},bg=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=pg(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Uh(a.element,t,{...r,path:[...r.path,`items`]})},xg=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Uh(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Sg=(e,t,n,r)=>{let i=e._zod.def,a=Uh(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Uh(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Cg=(e,t,n,r)=>{let i=e._zod.def,a=Uh(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},wg=(e,t,n,r)=>{let i=e._zod.def;Uh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Tg=Symbol();function Eg(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Hh(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Tg):JSON.parse(o)}var Dg=(e,t,n,r)=>{let i=e._zod.def;Uh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Eg(i.defaultValue,e,t,n,r);o!==Tg&&(n.default=o)},Og=(e,t,n,r)=>{let i=e._zod.def;Uh(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Eg(i.defaultValue,e,t,n,r);o!==Tg&&(n._prefault=o)},kg=(e,t,n,r)=>{let i=e._zod.def;Uh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Hh(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Ag=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Uh(o,t,r);let s=t.seen.get(e);s.ref=o},jg=(e,t,n,r)=>{let i=e._zod.def;Uh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Mg=(e,t,n,r)=>{let i=e._zod.def;Uh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ng=new WeakSet([Object.prototype,Error.prototype]);function Pg(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Fg=Q(`ZodError`,(e,t)=>{Jd.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Ng.has(n)||(Ng.add(n),Pg(n,`format`,e=>t=>Zd(e,t)),Pg(n,`flatten`,e=>t=>Xd(e,t)),Pg(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Qu,2)}),Pg(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Qu,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Ig=$d(Fg),Lg=ef(Fg),Rg=tf(Fg),zg=rf(Fg),Bg=uf(Fg),Vg=df(Fg),Hg=ff(Fg),Ug=pf(Fg),Wg=mf(Fg),Gg=hf(Fg),Kg=gf(Fg),qg=_f(Fg);function Jg(){Vd.localeError||Hd(Hm())}function Yg(){Vd.memoizer||Hd({memoizer:zm()})}var Xg=Q(`ZodType`,(e,t)=>(Jg(),sp.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(td(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return cd(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Z_(e,t))},superRefine(e,t){return this.check(Q_(e,t))},overwrite(e){return this.check(Ah(e))},optional(){return N_(this)},exactOptional(){return F_(this)},nullable(){return L_(this)},nullish(){return N_(L_(this))},nonoptional(e){return U_(this,e)},array(){return T_(this)},or(e){return D_([this,e])},and(e){return k_(this,e)},transform(e){return q_(this,j_(e))},default(e){return z_(this,e)},prefault(e){return V_(this,e)},catch(e){return G_(this,e)},pipe(e){return q_(this,e)},readonly(){return Y_(this)},describe(e){let t=this.clone();return Km.add(t,{description:e}),t},meta(...e){if(e.length===0)return Km.get(this);let t=this.clone();return Km.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ed(this,`~standard`,{...up(this),jsonSchema:{input:tg(this,`input`),output:tg(this,`output`)}})},set"~standard"(e){Td(this,`~standard`,e)},parse:function e(t,n){return Ig(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Lg(this,t,n,{callee:e})},safeParse(e,t){return Rg(this,e,t)},async safeParseAsync(e,t){return zg(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Td(this,`spa`,e)},validate(e,t){return sf(this,e,t)},validateAsync(e,t){return lf(this,e,t)},encode:function e(t,n){return Bg(this,t,n,{callee:e})},decode:function e(t,n){return Vg(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Hg(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Ug(this,t,n,{callee:e})},safeEncode(e,t){return Wg(this,e,t)},safeDecode(e,t){return Gg(this,e,t)},async safeEncodeAsync(e,t){return Kg(this,e,t)},async safeDecodeAsync(e,t){return qg(this,e,t)},toJSONSchema(e){return eg(this,{})(e)},get description(){return Km.get(this)?.description},get _def(){return this._zod.def}}),Zg=Q(`_ZodString`,(e,t)=>{dp.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_g(e,t,n,r)},Dd({format:e=>pg(e).format??null,minLength:e=>pg(e).minimum??null,maxLength:e=>pg(e).maximum??null},{regex(...e){return this.check(wh(...e))},includes(...e){return this.check(Dh(...e))},startsWith(...e){return this.check(Oh(...e))},endsWith(...e){return this.check(kh(...e))},min(...e){return this.check(Sh(...e))},max(...e){return this.check(xh(...e))},length(...e){return this.check(Ch(...e))},nonempty(...e){return this.check(Sh(1,...e))},lowercase(e){return this.check(Th(e))},uppercase(e){return this.check(Eh(e))},trim(){return this.check(Mh())},normalize(...e){return this.check(jh(...e))},toLowerCase(){return this.check(Nh())},toUpperCase(){return this.check(Ph())},slugify(){return this.check(Fh())}})),Qg=Q(`ZodString`,(e,t)=>{dp.init(e,t),Zg.init(e,t)},{email(e){return this.check(Ym(a_,e))},url(e){return this.check(th(c_,e))},jwt(e){return this.check(gh(C_,e))},emoji(e){return this.check(nh(l_,e))},guid(e){return this.check(Xm(o_,e))},uuid(e){return this.check(Zm(s_,e))},uuidv4(e){return this.check(Qm(s_,e))},uuidv6(e){return this.check($m(s_,e))},uuidv7(e){return this.check(eh(s_,e))},nanoid(e){return this.check(rh(u_,e))},cuid(e){return this.check(ih(d_,e))},cuid2(e){return this.check(ah(f_,e))},ulid(e){return this.check(oh(p_,e))},base64(e){return this.check(ph(b_,e))},base64url(e){return this.check(mh(x_,e))},xid(e){return this.check(sh(m_,e))},ksuid(e){return this.check(ch(h_,e))},ipv4(e){return this.check(lh(g_,e))},ipv6(e){return this.check(uh(__,e))},cidrv4(e){return this.check(dh(v_,e))},cidrv6(e){return this.check(fh(y_,e))},e164(e){return this.check(hh(S_,e))},datetime(e){return this.check(_h(t_,e))},date(e){return this.check(vh(n_,e))},time(e){return this.check(yh(r_,e))},duration(e){return this.check(bh(i_,e))}});function $g(e){return Jm(Qg,e)}var e_=Q(`ZodStringFormat`,(e,t)=>{fp.init(e,t),Zg.init(e,t)}),t_=Q(`ZodISODateTime`,(e,t)=>{jp.init(e,t),e_.init(e,t)}),n_=Q(`ZodISODate`,(e,t)=>{Mp.init(e,t),e_.init(e,t)}),r_=Q(`ZodISOTime`,(e,t)=>{Np.init(e,t),e_.init(e,t)}),i_=Q(`ZodISODuration`,(e,t)=>{Pp.init(e,t),e_.init(e,t)}),a_=Q(`ZodEmail`,(e,t)=>{hp.init(e,t),e_.init(e,t)}),o_=Q(`ZodGUID`,(e,t)=>{pp.init(e,t),e_.init(e,t)}),s_=Q(`ZodUUID`,(e,t)=>{mp.init(e,t),e_.init(e,t)}),c_=Q(`ZodURL`,(e,t)=>{Cp.init(e,t),e_.init(e,t)}),l_=Q(`ZodEmoji`,(e,t)=>{wp.init(e,t),e_.init(e,t)}),u_=Q(`ZodNanoID`,(e,t)=>{Tp.init(e,t),e_.init(e,t)}),d_=Q(`ZodCUID`,(e,t)=>{Ep.init(e,t),e_.init(e,t)}),f_=Q(`ZodCUID2`,(e,t)=>{Dp.init(e,t),e_.init(e,t)}),p_=Q(`ZodULID`,(e,t)=>{Op.init(e,t),e_.init(e,t)}),m_=Q(`ZodXID`,(e,t)=>{kp.init(e,t),e_.init(e,t)}),h_=Q(`ZodKSUID`,(e,t)=>{Ap.init(e,t),e_.init(e,t)}),g_=Q(`ZodIPv4`,(e,t)=>{Fp.init(e,t),e_.init(e,t)}),__=Q(`ZodIPv6`,(e,t)=>{Rp.init(e,t),e_.init(e,t)}),v_=Q(`ZodCIDRv4`,(e,t)=>{zp.init(e,t),e_.init(e,t)}),y_=Q(`ZodCIDRv6`,(e,t)=>{Vp.init(e,t),e_.init(e,t)}),b_=Q(`ZodBase64`,(e,t)=>{Wp.init(e,t),e_.init(e,t)}),x_=Q(`ZodBase64URL`,(e,t)=>{qp.init(e,t),e_.init(e,t)}),S_=Q(`ZodE164`,(e,t)=>{Jp.init(e,t),e_.init(e,t)}),C_=Q(`ZodJWT`,(e,t)=>{Xp.init(e,t),e_.init(e,t)}),w_=Q(`ZodArray`,(e,t)=>{Yg(),em.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bg(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Sh(e,t))},nonempty(e){return this.check(Sh(1,e))},max(e,t){return this.check(xh(e,t))},length(e,t){return this.check(Ch(e,t))},unwrap(){return this.element}});function T_(e,t){return Ih(w_,e,t)}var E_=Q(`ZodUnion`,(e,t)=>{nm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xg(e,t,n,r),e.options=t.options});function D_(e,t){return new E_({type:`union`,options:e,...Z(t)})}var O_=Q(`ZodIntersection`,(e,t)=>{rm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sg(e,t,n,r)});function k_(e,t){return new O_({type:`intersection`,left:e,right:t})}var A_=Q(`ZodTransform`,(e,t)=>{Yg(),om.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yg(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Bd(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Cd(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Cd(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function j_(e){return new A_({type:`transform`,transform:e})}var M_=Q(`ZodOptional`,(e,t)=>{cm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function N_(e){return new M_({type:`optional`,innerType:e})}var P_=Q(`ZodExactOptional`,(e,t)=>{lm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function F_(e){return new P_({type:`optional`,innerType:e})}var I_=Q(`ZodNullable`,(e,t)=>{um.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function L_(e){return new I_({type:`nullable`,innerType:e})}var R_=Q(`ZodDefault`,(e,t)=>{dm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function z_(e,t){return new R_({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():od(t)}})}var B_=Q(`ZodPrefault`,(e,t)=>{pm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Og(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function V_(e,t){return new B_({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():od(t)}})}var H_=Q(`ZodNonOptional`,(e,t)=>{mm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function U_(e,t){return new H_({type:`nonoptional`,innerType:e,...Z(t)})}var W_=Q(`ZodCatch`,(e,t)=>{_m.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function G_(e,t){return new W_({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Pd(t)})}var K_=Q(`ZodPipe`,(e,t)=>{vm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ag(e,t,n,r),e.in=t.in,e.out=t.out});function q_(e,t){return new K_({type:`pipe`,in:e,out:t})}var J_=Q(`ZodReadonly`,(e,t)=>{bm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Y_(e){return new J_({type:`readonly`,innerType:e})}var X_=Q(`ZodCustom`,(e,t)=>{Sm.init(e,t),Xg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vg(e,t,n,r)});function Z_(e,t={}){return Lh(X_,e,t)}function Q_(e,t){return Rh(e,t)}function $_({value:e,onChange:t}){let n=Mi(),[r,i]=(0,_.useState)(``),a=n.data??[],o=[...new Set([...a,...e])].sort(),s=n=>{e.includes(n)?t(e.filter(e=>e!==n)):t([...e,n].sort())};return(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsxs)(`label`,{className:`form-label`,children:[`MACHINES `,(0,z.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(pick targets; none = runs nowhere)`})]}),o.length===0?(0,z.jsx)(`div`,{className:`machine-empty`,children:`No machines known yet — add one below.`}):(0,z.jsx)(`div`,{className:`machine-chips`,children:o.map(t=>(0,z.jsx)(`button`,{type:`button`,className:e.includes(t)?`machine-chip on`:`machine-chip`,onClick:()=>s(t),children:t},t))}),(0,z.jsxs)(`div`,{className:`machine-add`,children:[(0,z.jsx)(`input`,{type:`text`,className:`form-input`,placeholder:`add a machine name`,autoComplete:`off`,spellCheck:!1,value:r,onChange:e=>i(e.target.value)}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>{let n=r.trim();n!==``&&!e.includes(n)&&t([...e,n].sort()),i(``)},children:`ADD`})]})]})}var ev=`Copy of `;function tv(e){return e.startsWith(ev)?e:`${ev}${e}`}function nv(e){return e.map(e=>{let t=[e.repository];return e.branch&&e.branch.trim()!==``&&t.push(e.branch),e.auto_pull===!1&&t.push(`auto_pull=false`),t.join(` `)}).join(`
`)}function rv(e){let t=[];for(let n of e.split(`
`)){let e=n.trim().split(/\s+/).filter(Boolean),r=e.shift();if(!r)continue;let i=e.findIndex(e=>e===`auto_pull=false`||e===`auto-pull=false`),a=i===-1;i!==-1&&e.splice(i,1),t.push({repository:r,branch:e[0]??null,auto_pull:a})}return t}function iv(e){return e.join(`, `)}function av(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function ov(e){let t=e.trim();return t===``||!/^\d+$/.test(t)?null:Number(t)}var sv=[[`3600`,`1h`],[`86400`,`1d`],[`604800`,`7d`],[`2592000`,`30d`]];function cv(e){return e==null?`default`:e===0?`0s`:e%86400==0?`${e/86400}d`:e%3600==0?`${e/3600}h`:e%60==0?`${e/60}m`:`${e}s`}function lv({schedule:e,...t}){return t}var uv=$g().trim().min(1),dv=[`claude`,`codex`],fv=[[`@daily`,`@daily`],[`@hourly`,`@hourly`],[`@weekly`,`@weekly`],[`@monthly`,`@monthly`],[`0 0 9 * * 1-5 *`,`weekdays 9am`],[`0 0 * * * * *`,`every hour`]];function pv(e){let t=e?.schedules&&e.schedules.length>0?e.schedules:e?.schedule?[e.schedule]:[``];return{title:e?.title??``,schedules:t.map(e=>({expression:e})),agent:e?.agent??`claude`,model:e?.model??``,prompt:e?.prompt??``,goal:e?.goal??``,reposRaw:nv(e?.repositories??[]),machines:e?.machines??[],tagsRaw:iv(e?.tags??[]),ttlRaw:e?.ttl_secs==null?``:String(e.ttl_secs),enabled:e?.enabled??!0,power_saving_exempt:e?.power_saving_exempt??!1}}function mv({initial:e,mode:t,saving:n,onCancel:r,onSave:i}){let a=Pi(),o=a.data&&a.data.length>0?a.data:dv,{register:s,control:c,setValue:l,handleSubmit:u,reset:d}=Xu({defaultValues:pv(e)}),{fields:f,append:p,remove:m}=fu({control:c,name:`schedules`});(0,_.useEffect)(()=>{d(pv(e))},[e]);let h=Nl({control:c,name:`title`}),g=Nl({control:c,name:`schedules`})??[],v=g.map(e=>e.expression.trim()).filter(Boolean),y=Nl({control:c,name:`agent`}),b=Nl({control:c,name:`prompt`}),x=Nl({control:c,name:`machines`}),S=uv.safeParse(h).success&&v.length>0&&uv.safeParse(y).success&&uv.safeParse(b).success,C=(e=``)=>{f.length===1&&(g[0]?.expression??``).trim()===``?l(`schedules.0.expression`,e):p({expression:e})},w=u(e=>{i({schedule:v[0]??``,schedules:v,title:e.title,agent:e.agent,model:e.model.trim()===``?null:e.model,prompt:e.prompt,goal:e.goal.trim()===``?null:e.goal,repositories:rv(e.reposRaw),machines:e.machines,enabled:e.enabled,power_saving_exempt:e.power_saving_exempt,ttl_secs:ov(e.ttlRaw),tags:av(e.tagsRaw)})}),T=t===`edit`,E=n?`…`:T?`SAVE CHANGES`:`CREATE ROUTINE`,D=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsx)(`label`,{className:`form-label`,children:`TITLE*`}),(0,z.jsx)(`input`,{className:`form-input`,placeholder:`ops/nightly triage`,autoComplete:`off`,spellCheck:!1,...s(`title`)}),(0,z.jsx)(`div`,{className:`form-hint`,children:`Display name only. Use MOVE to change the filesystem folder.`})]}),(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsx)(`label`,{className:`form-label`,children:`SCHEDULES*`}),(0,z.jsx)(`div`,{className:`cron-schedule-list`,children:f.map((e,t)=>{let n=g[t]?.expression??``,[r,i]=Fa(n),a=n.trim()===``?`cron-preview`:r?`cron-preview ok`:`cron-preview bad`;return(0,z.jsxs)(`div`,{className:`cron-schedule-row`,children:[(0,z.jsxs)(`div`,{className:`cron-schedule-input`,children:[(0,z.jsx)(`input`,{className:`form-input`,placeholder:`cron expression`,"aria-label":`Cron expression ${t+1}`,...s(`schedules.${t}.expression`)}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,"aria-label":`Remove cron expression ${t+1}`,onClick:()=>m(t),children:`REMOVE`})]}),(0,z.jsx)(`div`,{className:a,children:i})]},e.id)})}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm add-cron-btn`,onClick:()=>C(),children:`+ ADD CRON EXPRESSION`}),(0,z.jsx)(`div`,{className:`cron-presets`,children:fv.map(([e,t])=>(0,z.jsx)(`button`,{type:`button`,className:`preset-btn`,onClick:()=>C(e),children:t},e))})]}),(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsx)(`label`,{className:`form-label`,children:`AGENT*`}),(0,z.jsx)(`select`,{className:`form-select`,...s(`agent`),children:o.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))})]}),(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsxs)(`label`,{className:`form-label`,children:[`MODEL `,(0,z.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(optional; blank = agent default)`})]}),(0,z.jsx)(`input`,{className:`form-input`,placeholder:`claude-sonnet-4-6`,...s(`model`)})]}),(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsx)(`label`,{className:`form-label`,children:`PROMPT*`}),(0,z.jsx)(`textarea`,{className:`form-textarea`,rows:6,placeholder:`Review open PRs and summarize…`,...s(`prompt`)})]}),(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsxs)(`label`,{className:`form-label`,children:[`GOAL `,(0,z.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(optional; ≤5 lines — the why)`})]}),(0,z.jsx)(`textarea`,{className:`form-textarea`,rows:3,placeholder:`Keep the PR backlog under control…`,...s(`goal`)})]}),(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsxs)(`label`,{className:`form-label`,children:[`REPOSITORIES `,(0,z.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(one url [branch] [auto_pull=false] per line)`})]}),(0,z.jsx)(`textarea`,{className:`form-textarea`,rows:3,placeholder:`https://github.com/org/repo main
https://github.com/org/pinned auto_pull=false`,...s(`reposRaw`)})]}),(0,z.jsx)($_,{value:x,onChange:e=>l(`machines`,e)}),(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsxs)(`label`,{className:`form-label`,children:[`TAGS `,(0,z.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(comma-separated)`})]}),(0,z.jsx)(`input`,{className:`form-input`,placeholder:`triage, nightly`,...s(`tagsRaw`)})]}),(0,z.jsxs)(`div`,{className:`form-group`,children:[(0,z.jsxs)(`label`,{className:`form-label`,children:[`WORKBENCH TTL `,(0,z.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(seconds; blank = server default)`})]}),(0,z.jsx)(`input`,{className:`form-input`,type:`number`,min:0,placeholder:`604800`,...s(`ttlRaw`)}),(0,z.jsx)(`div`,{className:`ttl-presets`,children:sv.map(([e,t])=>(0,z.jsx)(`button`,{type:`button`,className:`preset-btn`,onClick:()=>l(`ttlRaw`,e),children:t},e))})]}),(0,z.jsxs)(`div`,{className:`toggle-row`,children:[(0,z.jsx)(`span`,{children:`ENABLED`}),(0,z.jsxs)(`label`,{className:`toggle`,children:[(0,z.jsx)(`input`,{type:`checkbox`,...s(`enabled`)}),(0,z.jsx)(`div`,{className:`toggle-track`})]})]}),(0,z.jsxs)(`div`,{className:`toggle-row`,children:[(0,z.jsx)(`span`,{title:`Allow this routine to launch while the host is on battery or Low Power Mode`,children:`POWER-SAVING EXEMPT`}),(0,z.jsxs)(`label`,{className:`toggle`,children:[(0,z.jsx)(`input`,{type:`checkbox`,...s(`power_saving_exempt`)}),(0,z.jsx)(`div`,{className:`toggle-track`})]})]})]}),O=(0,z.jsxs)(`div`,{className:`modal-ft`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:r,children:`CANCEL`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:n||!S,onClick:w,children:E})]});return T?(0,z.jsx)(`div`,{className:`overlay open`,children:(0,z.jsxs)(`div`,{className:`dialog modal`,children:[(0,z.jsxs)(`div`,{className:`modal-hd`,children:[(0,z.jsx)(`div`,{className:`modal-title`,children:`EDIT ROUTINE`}),(0,z.jsx)(`button`,{type:`button`,className:`modal-x`,title:`Close`,"aria-label":`Close`,onClick:r,children:`✕`})]}),(0,z.jsx)(`div`,{className:`modal-body`,children:D}),O]})}):(0,z.jsxs)(`main`,{className:`create-page`,children:[(0,z.jsxs)(`div`,{className:`page-hd`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:r,children:`← BACK`}),(0,z.jsx)(`div`,{className:`page-title`,children:t===`clone`?`NEW ROUTINE (FROM CLONE)`:`NEW ROUTINE`})]}),(0,z.jsxs)(`div`,{className:`page-card card`,children:[(0,z.jsx)(`div`,{className:`modal-body`,children:D}),O]})]})}function hv({content:e,loading:t,err:n}){let r;if(t)r=(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})});else if(n!==void 0)r=(0,z.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,n]});else if(e===void 0)return null;else r=e===``?(0,z.jsx)(`div`,{className:`logs-empty`,children:`— the agent didn't write a summary for this run —`}):(0,z.jsx)(`div`,{className:`run-summary-text`,children:e});return(0,z.jsxs)(`div`,{className:`run-summary`,children:[(0,z.jsx)(`div`,{className:`section-hd`,children:(0,z.jsx)(`span`,{className:`section-label`,children:`SUMMARY`})}),(0,z.jsx)(`div`,{className:`logs-wrap run-summary-wrap`,children:r})]})}function gv(e){if(e===``)return[];let t=e.split(`
`);return t.length>0&&t[t.length-1]===``&&t.pop(),t}function _v(e,t){let n=t.trim().toLowerCase(),r=[],i=gv(e);for(let e=0;e<i.length;e++){let t=i[e]??``;(n===``||t.toLowerCase().includes(n))&&r.push([e+1,t])}return r}function vv(e,t){let n=gv(e),r=n.length,i=t.trim().toLowerCase();return i===``?[r,r]:[n.filter(e=>e.toLowerCase().includes(i)).length,r]}function yv(e,t){let n=t.trim().toLowerCase();if(n===``)return[[!1,e]];let r=Array.from(e),i=r.map(e=>e.toLowerCase()[0]??e),a=Array.from(n).length,o=[],s=0,c=0;for(;s<r.length;){let e=i.slice(s,s+a).join(``);e===n&&e.length>0?(s>c&&o.push([!1,r.slice(c,s).join(``)]),o.push([!0,r.slice(s,s+a).join(``)]),s+=a,c=s):s++}return c<r.length&&o.push([!1,r.slice(c).join(``)]),o}function bv({text:e,query:t}){return(0,z.jsx)(z.Fragment,{children:yv(e,t).map(([e,t],n)=>e?(0,z.jsx)(`mark`,{className:`log-hl`,children:t},n):(0,z.jsx)(`span`,{children:t},n))})}function xv({content:e,loading:t,err:n}){let[r,i]=(0,_.useState)(``),a=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=a.current;e&&(e.scrollTop=e.scrollHeight)},[e?.length]);let o=null;if(t)o=(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})});else if(n!==void 0)o=(0,z.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,n]});else if(e!==void 0){if(e===``)o=(0,z.jsx)(`div`,{className:`logs-empty`,children:`— no logs yet —`});else{let t=_v(e,r),[n,a]=vv(e,r),s=r.trim()===``?`${a} lines`:`${n} / ${a} matches`;o=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`log-search`,children:[(0,z.jsx)(`input`,{type:`search`,className:`log-search-input`,placeholder:`Search logs…`,"aria-label":`Search log lines`,value:r,onChange:e=>i(e.target.value)}),r!==``&&(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Clear search`,"aria-label":`Clear search`,onClick:()=>i(``),children:`✕`}),(0,z.jsx)(`span`,{className:`log-match-count`,children:s})]}),(0,z.jsx)(`div`,{className:`log-lines`,children:t.map(([e,t])=>(0,z.jsxs)(`div`,{className:`log-line`,children:[(0,z.jsx)(`span`,{className:`log-ln`,children:e}),(0,z.jsx)(`span`,{className:`log-lc`,children:(0,z.jsx)(bv,{text:t,query:r})})]},e))})]})}}return(0,z.jsx)(`div`,{className:`logs-wrap`,ref:a,children:o})}function Sv(e){let t=e.map(e=>e.finished_at==null?null:Math.max(0,e.finished_at-e.started_at)),n=Math.max(1,...t.filter(e=>e!==null));return e.map((e,r)=>{let i=t[r]??null;return{workbench:e.workbench,startedAt:e.started_at,status:e.status,exitCode:e.exit_code,durationSecs:i,widthPct:i===null?4:Math.max(4,i/n*100)}})}function Cv({runs:e,selected:t,onSelect:n}){if(e.length===0)return null;let r=Sv(e);return(0,z.jsx)(`div`,{className:`duration-chart`,role:`list`,"aria-label":`Run duration chart`,children:r.map(e=>{let r=e.durationSecs===null?`in progress`:Os(0,e.durationSecs),i=t===e.workbench;return(0,z.jsxs)(`button`,{type:`button`,role:`listitem`,className:`duration-row${i?` row-selected`:``}`,title:`${Ds(e.status)} · ${r} · ${Ra(e.startedAt)}${e.exitCode==null?``:` · exit ${e.exitCode}`}`,onClick:()=>n(e.workbench),children:[(0,z.jsx)(`span`,{className:`duration-row-time`,children:Ia(e.startedAt)}),(0,z.jsx)(`span`,{className:`duration-row-track`,children:(0,z.jsx)(`span`,{className:`duration-bar ${e.status}`,style:{width:`${e.widthPct}%`}})}),(0,z.jsx)(`span`,{className:`duration-row-dur`,children:r})]},e.workbench)})})}function wv({id:e,title:t,onBack:n}){let r=$i(e),[i,a]=(0,_.useState)(void 0),o=na(e,i??``,i!==void 0),s=H(e,i??``,i!==void 0),c=r.data??[],l=Zo(),u=Math.floor(l/1e3);return(0,z.jsxs)(`main`,{className:`logs-page`,children:[(0,z.jsxs)(`div`,{className:`page-hd`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,z.jsxs)(`div`,{className:`page-title`,children:[`HISTORY / `,t]}),r.dataUpdatedAt>0&&(0,z.jsx)(`span`,{className:`page-freshness`,children:as(Math.max(0,(l-r.dataUpdatedAt)/1e3))}),(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void r.refetch(),children:`↻`})]}),r.isLoading?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):r.isError?(0,z.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,r.error.message]}):c.length===0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS YET`})]})}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Cv,{runs:c,selected:i,onSelect:e=>a(i===e?void 0:e)}),(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`STARTED`}),(0,z.jsx)(`th`,{children:`STATUS`}),(0,z.jsx)(`th`,{children:`DURATION`}),(0,z.jsx)(`th`,{children:`EXIT CODE`}),(0,z.jsx)(`th`,{children:`RETENTION`}),(0,z.jsx)(`th`,{})]})}),(0,z.jsx)(`tbody`,{children:c.map(t=>{let n=i===t.workbench;return(0,z.jsxs)(`tr`,{className:n?`row-selected`:``,children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(`div`,{className:`cell-time`,title:`${t.workbench} · ${Ra(t.started_at)}`,children:Ia(t.started_at)})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:Es(t.status),children:Ds(t.status)})}),(0,z.jsx)(`td`,{children:t.finished_at==null?`—`:Os(t.started_at,t.finished_at)}),(0,z.jsx)(`td`,{children:t.exit_code??`—`}),(0,z.jsx)(`td`,{children:t.retention_expires_at==null?`—`:(0,z.jsx)(`span`,{className:`cell-meta`,children:ks(u,t.retention_expires_at)})}),(0,z.jsxs)(`td`,{children:[(0,z.jsx)(`button`,{type:`button`,className:`act-btn logs`,onClick:()=>a(n?void 0:t.workbench),children:n?`HIDE LOG`:`VIEW LOG`}),(0,z.jsx)(En,{to:`/runs/${encodeURIComponent(e)}/${encodeURIComponent(t.workbench)}`,className:`act-btn`,children:`PERMALINK`})]})]},t.workbench)})})]})})]}),i!==void 0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(hv,{content:s.data,loading:s.isLoading,err:s.isError?s.error.message:void 0}),(0,z.jsx)(xv,{content:o.data,loading:o.isLoading,err:o.isError?o.error.message:void 0})]})]})}function Tv({id:e,title:t,onBack:n}){let r=os(),i=ta(e);return(0,_.useEffect)(()=>{let e=ns(r);if(e===void 0)return;let t=window.setInterval(()=>void i.refetch(),e);return()=>window.clearInterval(t)},[r,e]),(0,z.jsxs)(`main`,{className:`logs-page`,children:[(0,z.jsxs)(`div`,{className:`page-hd`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,z.jsxs)(`div`,{className:`page-title`,children:[`LOGS / `,t]}),(0,z.jsx)(cs,{updatedAtMs:i.dataUpdatedAt}),(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void i.refetch(),children:`↻`})]}),(0,z.jsx)(xv,{content:i.data,loading:i.isLoading,err:i.isError?i.error.message:void 0})]})}function Ev(e){return e?.trim()??``}function Dv(e){return e?.trim()??``}function Ov(e,t){return e===``?t:`${e}/${t}`}function kv({routine:e,saving:t,onCancel:n,onConfirm:r}){let[i,a]=(0,_.useState)(Ev(e.folder)),[o,s]=(0,_.useState)(Dv(e.slug)),c=i.trim(),l=o.trim(),u=(0,_.useMemo)(()=>Ov(c,l),[c,l]),d=(0,_.useMemo)(()=>Ov(Ev(e.folder),Dv(e.slug)),[e.folder,e.slug]),f=c===Ev(e.folder)&&l===Dv(e.slug),p=l===``||l.includes(`/`)||l.includes(`\\`);return(0,z.jsx)(`div`,{className:`overlay`,onClick:n,children:(0,z.jsxs)(`div`,{className:`dialog move-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`move-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,z.jsxs)(`div`,{className:`move-dialog-hd`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{id:`move-dialog-title`,className:`dialog-title move-dialog-title`,children:`FOLDER MANAGEMENT`}),(0,z.jsx)(`div`,{className:`move-dialog-sub`,children:`Move routine files without changing the display title.`})]}),(0,z.jsx)(`div`,{className:`move-dialog-badge`,children:`FILES`})]}),(0,z.jsxs)(`div`,{className:`move-current-card`,"aria-label":`Current path ${d}`,children:[(0,z.jsx)(`div`,{className:`move-current-label`,children:`CURRENT LOCATION`}),(0,z.jsxs)(`div`,{className:`move-current-row`,children:[(0,z.jsx)(`span`,{className:`routine-fs-icon`,"aria-hidden":`true`,children:`📄`}),(0,z.jsxs)(`div`,{className:`move-current-copy`,children:[(0,z.jsx)(`strong`,{children:e.title}),(0,z.jsx)(`span`,{children:d||`root`})]})]})]}),(0,z.jsxs)(`div`,{className:`move-path-grid`,children:[(0,z.jsxs)(`div`,{className:`form-group move-form-group`,children:[(0,z.jsx)(`label`,{className:`form-label`,htmlFor:`move-folder`,children:`FOLDER`}),(0,z.jsx)(`input`,{id:`move-folder`,className:`form-input move-input`,placeholder:`maintenance`,autoComplete:`off`,spellCheck:!1,value:i,onChange:e=>a(e.target.value)}),(0,z.jsx)(`div`,{className:`form-hint`,children:`Blank keeps the routine at root. Use / for nested folders.`})]}),(0,z.jsxs)(`div`,{className:`form-group move-form-group`,children:[(0,z.jsx)(`label`,{className:`form-label`,htmlFor:`move-slug`,children:`SLUG*`}),(0,z.jsx)(`input`,{id:`move-slug`,className:`form-input move-input`,placeholder:`daily-maintenance-digest`,autoComplete:`off`,spellCheck:!1,value:o,onChange:e=>s(e.target.value)}),(0,z.jsx)(`div`,{className:`form-hint`,children:`One path segment only. Title remains display-only.`})]})]}),(0,z.jsxs)(`div`,{className:`move-preview`,"aria-label":`Destination path routines/${u||`…`}/routine.toml`,children:[(0,z.jsx)(`div`,{className:`move-preview-label`,children:`DESTINATION PREVIEW`}),(0,z.jsxs)(`div`,{className:`move-preview-path`,children:[`routines/`,u||`…`,`/routine.toml`]})]}),(0,z.jsxs)(`div`,{className:`dialog-actions move-dialog-actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:n,children:`CANCEL`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:t||p||f,onClick:()=>r(c===``?void 0:c,l),children:t?`MOVING…`:`MOVE`})]})]})})}var Av=c(m(),1),jv=6,Mv=2,Nv=14,Pv={running:`var(--warn)`,success:`var(--ok)`,failed:`var(--err)`,unknown:`var(--text-faint)`};function Fv({runs:e}){if(e.length===0)return(0,z.jsx)(`span`,{className:`spark-empty muted`,children:`—`});let t=e.length*jv-Mv;return(0,z.jsx)(`svg`,{className:`spark`,role:`img`,"aria-label":`Last ${e.length} runs`,width:t,height:Nv,viewBox:`0 0 ${t} ${Nv}`,children:e.map((e,t)=>(0,z.jsx)(`rect`,{x:t*jv,y:0,width:4,height:Nv,rx:1,fill:Pv[e.status],className:`spark-tick ${e.status}`,children:(0,z.jsx)(`title`,{children:`${Ds(e.status)} · ${Ia(e.started_at)} (${Ra(e.started_at)})`})},`${e.workbench}-${t}`))})}function Iv({routine:e,now:t}){if(!e.enabled)return(0,z.jsx)(`span`,{className:`cell-next muted`,children:`paused`});if(Sc(e,t)){let n=Cc(e,t);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`cell-next muted`,children:`snoozed`}),n!==``&&(0,z.jsx)(`div`,{className:`cell-next-until muted`,children:n})]})}let n=_o(go(e),t);if(n===void 0)return(0,z.jsx)(`span`,{className:`cell-next muted`,children:`—`});let r=n.getTime()-t.getTime()<=nc;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`cell-next-when`,children:So(t,n)}),(0,z.jsx)(`div`,{className:r?`cell-next-until soon`:`cell-next-until`,children:bo(t,n)})]})}function Lv({routine:e,now:t,runs:n,selected:r,onSelect:i,onEdit:a,onClone:o,onDelete:s,onMove:c,onToggle:l,onTrigger:u,onLogs:d,onHistory:f,onFlags:p}){let[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)({}),x=(0,_.useRef)(null),S=(0,_.useRef)(null),C=go(e),w=(e.schedule_descriptions??[e.schedule_description]).filter(Boolean).join(` · `)||`—`,T=Ia(e.updated_at),E=e.repositories??[],D=(e.machines??[]).filter(e=>e.trim()!==``),O=e.tags??[],k=e.goal?.trim()?e.goal.split(`
`)[0]:void 0,A=gc(e),ee=e.last_manual_trigger_at!=null&&(e.last_scheduled_trigger_at==null||e.last_manual_trigger_at>=e.last_scheduled_trigger_at),te=wc(e,t),ne=Tc(e);(0,_.useEffect)(()=>{if(!g)return;let e=e=>{let t=e.target;x.current?.contains(t)||S.current?.contains(t)||v(!1)},t=e=>{e.key===`Escape`&&v(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[g]);let j=()=>v(!1),re=()=>{if(g){v(!1);return}let e=x.current?.getBoundingClientRect();if(e!==void 0){let t=e.bottom+6+260<=window.innerHeight;b({left:Math.max(8,Math.min(e.right-168,window.innerWidth-168-8)),top:t?e.bottom+6:Math.max(8,e.top-260-6)})}v(!0)},ie=g?(0,Av.createPortal)((0,z.jsxs)(`div`,{className:`actions-menu`,id:`routine-actions-${e.id}`,ref:S,role:`menu`,style:y,children:[(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{j(),d(e.id)},children:`Logs`}),(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{j(),f(e.id)},children:`History`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{j(),p(e.id)},children:[`Flags`,(e.flag_count??0)>0&&(0,z.jsx)(`span`,{className:`flag-badge`,children:e.flag_count})]}),(0,z.jsx)(`div`,{className:`actions-menu-sep`,role:`separator`}),(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{j(),a(e.id)},children:`Edit`}),(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{j(),c(e.id)},children:`Move folder`}),(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{j(),o(e.id)},children:`Clone`}),(0,z.jsx)(`div`,{className:`actions-menu-sep`,role:`separator`}),(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item danger`,onClick:()=>{j(),s(e.id,e.title)},children:`Delete`})]}),document.body):null;return(0,z.jsxs)(`tr`,{className:r?`row-selected`:``,children:[(0,z.jsx)(`td`,{className:`col-select`,"data-label":`Select`,children:(0,z.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>i(e.id),"aria-label":`Select ${e.title}`})}),(0,z.jsxs)(`td`,{className:`routine-title-cell`,"data-label":`Title`,children:[(0,z.jsx)(`div`,{className:`cell-schedule`,title:e.title,children:(0,z.jsx)(Rv,{title:e.title})}),(0,z.jsx)(`div`,{className:`cell-goal`,title:e.rel_path,children:e.folder?`/${e.folder}/${e.slug}`:`/${e.slug}`}),k!==void 0&&(0,z.jsx)(`div`,{className:`cell-goal`,title:e.goal??``,children:k})]}),(0,z.jsxs)(`td`,{className:`routine-schedule-cell`,"data-label":`Schedule`,children:[(0,z.jsx)(`div`,{className:`cell-schedule`,children:C.join(`
`)}),(0,z.jsx)(`div`,{className:`cell-schedule-human`,children:w}),(0,z.jsx)(`button`,{type:`button`,className:m?`sched-preview-btn open`:`sched-preview-btn`,"aria-expanded":m,onClick:e=>{e.stopPropagation(),h(e=>!e)},children:`▸ fires`}),m&&(0,z.jsx)(zv,{schedules:C,now:t})]}),(0,z.jsx)(`td`,{"data-label":`Next run`,children:(0,z.jsx)(Iv,{routine:e,now:t})}),(0,z.jsx)(`td`,{"data-label":`Last fire`,children:A===void 0?(0,z.jsx)(`span`,{className:`muted`,children:`—`}):(0,z.jsxs)(`div`,{className:`cell-triggered`,children:[ee?`↻`:`⏱`,` `,Ia(A)]})}),(0,z.jsx)(`td`,{"data-label":`Run history`,children:(0,z.jsx)(Fv,{runs:n})}),(0,z.jsxs)(`td`,{"data-label":`Agent`,children:[(0,z.jsxs)(`span`,{className:`cell-handler`,title:e.agent_registered?`agent registered`:`agent config missing`,children:[(0,z.jsx)(`span`,{className:e.agent_registered?`handler-dot ok`:`handler-dot warn`}),e.agent]}),e.model&&(0,z.jsx)(`div`,{className:`cell-goal`,children:e.model})]}),(0,z.jsx)(`td`,{"data-label":`Repos`,children:E.length===0?`—`:(0,z.jsx)(`span`,{title:E.map(e=>e.repository).join(`
`),children:E.length})}),(0,z.jsx)(`td`,{"data-label":`Machines`,className:D.length===0?`cell-meta cell-no-machines`:`cell-meta`,children:D.length===0?`—`:(0,z.jsx)(`span`,{title:D.join(`
`),children:D.length})}),(0,z.jsx)(`td`,{"data-label":`Tags`,children:O.length===0?`—`:(0,z.jsx)(`span`,{title:O.join(`, `),children:O.join(`, `)})}),(0,z.jsx)(`td`,{"data-label":`TTL`,children:(0,z.jsx)(`span`,{className:`cell-meta`,title:`workbench retention for finished runs`,children:cv(e.ttl_secs)})}),(0,z.jsxs)(`td`,{"data-label":`Health`,children:[(0,z.jsx)(`span`,{className:bc(te),title:xc(e,te),children:yc(te)}),e.power_saving_exempt&&(0,z.jsx)(`div`,{className:`failure-chip low`,title:`Runs even when system power saving is active`,children:`EXEMPT`}),ne!==`none`&&(0,z.jsxs)(`div`,{className:`failure-chip ${ne}`,title:`${e.consecutive_failures} consecutive failure(s) — auto-disables at ${e.failure_threshold}`,children:[e.consecutive_failures,`/`,e.failure_threshold]})]}),(0,z.jsx)(`td`,{"data-label":`Enabled`,children:(0,z.jsxs)(`label`,{className:`toggle`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>l(e.id,t.target.checked)}),(0,z.jsx)(`div`,{className:`toggle-track`})]})}),(0,z.jsx)(`td`,{"data-label":`Updated`,children:(0,z.jsx)(`div`,{className:`cell-time`,title:Ra(e.updated_at),children:T})}),(0,z.jsx)(`td`,{className:`routine-actions-cell`,"data-label":`Actions`,children:(0,z.jsxs)(`div`,{className:`row-actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`act-btn run`,title:Ec(e),"aria-label":`Run now`,disabled:!e.enabled||e.power_saving,onClick:()=>u(e.id),children:`RUN`}),(0,z.jsxs)(`div`,{className:`actions-menu-root`,ref:x,children:[(0,z.jsx)(`button`,{type:`button`,className:`act-btn actions-menu-trigger`,"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":`routine-actions-${e.id}`,onClick:re,children:`ACTIONS ▾`}),ie]})]})})]})}function Rv({title:e}){let t=e.split(`/`).filter(Boolean);return t.length<=1?(0,z.jsx)(z.Fragment,{children:e}):(0,z.jsx)(`span`,{className:`cell-title-path`,children:t.map((e,n)=>(0,z.jsxs)(`span`,{children:[n>0&&(0,z.jsx)(`span`,{className:`cell-title-sep`,children:`/`}),(0,z.jsx)(`span`,{className:n===t.length-1?`cell-title-leaf`:`cell-title-folder`,children:e})]},`${e}-${n}`))})}function zv({schedules:e,now:t}){let n=vo(e,t,10);return n.length===0?(0,z.jsx)(`div`,{className:`fires-panel`,children:(0,z.jsx)(`div`,{className:`fires-empty`,children:`— no future fires —`})}):(0,z.jsxs)(`div`,{className:`fires-panel`,children:[(0,z.jsx)(`div`,{className:`fires-hd`,children:`NEXT 10 FIRES`}),n.map((e,n)=>(0,z.jsxs)(`div`,{className:`fires-item`,children:[(0,z.jsx)(`span`,{className:`fires-when`,children:So(t,e)}),(0,z.jsx)(`span`,{className:`fires-until`,children:bo(t,e)})]},n))]})}function Bv(e){let t=e.slug?.trim()||e.title.trim()||e.id,n=e.folder?.trim();return n?`${n}/${t}`:t}function Vv(e){let t={name:``,path:``,folders:new Map,routines:[]};for(let n of e){let e=(n.folder??``).split(`/`).map(e=>e.trim()).filter(Boolean),r=t;for(let t of e){let e=r.path===``?t:`${r.path}/${t}`,n=r.folders.get(t);n===void 0&&(n={name:t,path:e,folders:new Map,routines:[]},r.folders.set(t,n)),r=n}r.routines.push(n)}return Hv(t),t}function Hv(e){e.routines.sort((e,t)=>Bv(e).localeCompare(Bv(t))||e.id.localeCompare(t.id));for(let t of e.folders.values())Hv(t)}function Uv(e){return[...e.folders.values()].sort((e,t)=>e.name.localeCompare(t.name))}function Wv(e){return{"--depth":e}}function Gv({routines:e,loading:t,filterActive:n,now:r,onClearFilters:i,...a}){let o=(0,_.useMemo)(()=>Vv(e),[e]),[s,c]=(0,_.useState)(new Set),l=e=>{c(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})};return t?(0,z.jsx)(`div`,{className:`routine-fs-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,z.jsx)(`div`,{className:`routine-fs-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:n?`⊘`:`⧗`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:n?`NO ROUTINES MATCH`:`NO ROUTINES SCHEDULED`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:n?(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR FILTERS`}):`press + NEW ROUTINE to create one`})]})}):(0,z.jsxs)(`div`,{className:`routine-fs-wrap`,children:[(0,z.jsxs)(`div`,{className:`routine-fs-summary`,children:[e.length,` routine(s) shown by filesystem location`]}),(0,z.jsxs)(`div`,{className:`routine-fs-tree`,role:`tree`,"aria-label":`Routine filesystem`,children:[o.routines.map(e=>(0,z.jsx)(Jv,{routine:e,now:r,depth:0,...a},e.id)),Uv(o).map(e=>(0,z.jsx)(Kv,{node:e,now:r,depth:0,collapsed:s,onToggle:l,actions:a},e.path))]})]})}function Kv({node:e,now:t,depth:n,collapsed:r,onToggle:i,actions:a}){let o=r.has(e.path),s=qv(e);return(0,z.jsxs)(`div`,{className:`routine-fs-branch`,children:[(0,z.jsx)(`div`,{className:`routine-fs-folder`,role:`treeitem`,"aria-expanded":!o,"aria-label":`${e.name} folder, ${s} routine${s===1?``:`s`}`,style:Wv(n),children:(0,z.jsxs)(`button`,{type:`button`,className:`routine-fs-folder-toggle`,"aria-label":`${o?`Expand`:`Collapse`} ${e.name} folder`,onClick:()=>i(e.path),children:[(0,z.jsx)(`span`,{className:`routine-fs-caret`,children:o?`▸`:`▾`}),(0,z.jsx)(`span`,{className:`routine-fs-icon`,children:`📁`}),(0,z.jsx)(`span`,{className:`routine-fs-folder-name`,children:e.name}),(0,z.jsx)(`span`,{className:`routine-fs-count`,children:s})]})}),!o&&(0,z.jsxs)(`div`,{role:`group`,children:[e.routines.map(e=>(0,z.jsx)(Jv,{routine:e,now:t,depth:n+1,...a},e.id)),Uv(e).map(e=>(0,z.jsx)(Kv,{node:e,now:t,depth:n+1,collapsed:r,onToggle:i,actions:a},e.path))]})]})}function qv(e){let t=e.routines.length;for(let n of e.folders.values())t+=qv(n);return t}function Jv({routine:e,now:t,depth:n,onEdit:r,onClone:i,onDelete:a,onMove:o,onToggle:s,onTrigger:c,onLogs:l,onHistory:u,onFlags:d}){let f=Bv(e),p=wc(e,t),m=go(e);return(0,z.jsxs)(`div`,{className:`routine-fs-file`,role:`treeitem`,"aria-label":`${f} routine`,style:Wv(n),children:[(0,z.jsxs)(`div`,{className:`routine-fs-file-main`,children:[(0,z.jsx)(`span`,{className:`routine-fs-icon`,children:`📄`}),(0,z.jsxs)(`div`,{className:`routine-fs-file-copy`,children:[(0,z.jsx)(`div`,{className:`routine-fs-file-title`,children:e.title}),(0,z.jsx)(`div`,{className:`routine-fs-file-path`,title:e.rel_path,children:f})]})]}),(0,z.jsxs)(`div`,{className:`routine-fs-meta`,children:[(0,z.jsx)(`span`,{children:m.join(` · `)}),(0,z.jsx)(Iv,{routine:e,now:t})]}),(0,z.jsxs)(`div`,{className:`routine-fs-status`,children:[(0,z.jsx)(`span`,{className:bc(p),title:xc(e,p),children:yc(p)}),(0,z.jsxs)(`label`,{className:`toggle`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>s(e.id,t.target.checked)}),(0,z.jsx)(`div`,{className:`toggle-track`})]})]}),(0,z.jsxs)(`div`,{className:`routine-fs-actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`act-btn run`,"aria-label":`Run now`,title:Ec(e),disabled:!e.enabled||e.power_saving,onClick:()=>c(e.id),children:`RUN`}),(0,z.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>l(e.id),children:`Logs`}),(0,z.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>u(e.id),children:`History`}),(0,z.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>d(e.id),children:`Flags`}),(0,z.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>r(e.id),children:`Edit`}),(0,z.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>o(e.id),children:`Move folder`}),(0,z.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>i(e.id),children:`Clone`}),(0,z.jsx)(`button`,{type:`button`,className:`act-btn danger`,onClick:()=>a(e.id,e.title),children:`Delete`})]})]})}var Yv=`moadim.routines.collapsedGroups`;function Xv(){try{let e=localStorage.getItem(Yv);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function Zv(e){try{localStorage.setItem(Yv,JSON.stringify([...e]))}catch{}}function Qv({label:e,col:t,current:n,dir:r,onSort:i}){let a=n===t;return(0,z.jsxs)(`th`,{className:a?`th-sort th-sort-active`:`th-sort`,onClick:()=>i(t),children:[e,a?r===`asc`?` ▲`:` ▼`:``]})}function $v(e){let{routines:t,loading:n,filterActive:r,onClearFilters:i}=e,[a,o]=(0,_.useState)(Xv),s=e=>{o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),Zv(n),n})},c=e=>{let t=new Set(e);Zv(t),o(t)};if(n)return(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})});if(t.length===0)return(0,z.jsx)(`div`,{className:`table-wrap`,children:r?(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⊘`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO ROUTINES MATCH`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR FILTERS`})})]}):(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO ROUTINES SCHEDULED`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`press + NEW ROUTINE to create one`})]})});let l=t.length>0&&t.every(t=>e.selected.has(t.id)),u=Wc(t,e.groupBy),d=t=>`${e.groupBy}:${t}`;return(0,z.jsxs)(`div`,{className:`table-wrap`,children:[e.groupBy!==`none`&&u.length>1&&(0,z.jsxs)(`div`,{className:`group-controls`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>c(u.map(([e])=>d(e))),children:`COLLAPSE ALL`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>c([]),children:`EXPAND ALL`})]}),(0,z.jsxs)(`table`,{className:`routine-table`,children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{className:`col-select`,children:(0,z.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e.onSelectAll,"aria-label":`Select all visible routines`,title:`Select all visible`})}),(0,z.jsx)(Qv,{label:`TITLE`,col:`title`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,z.jsx)(`th`,{children:`SCHEDULE`}),(0,z.jsx)(Qv,{label:`NEXT RUN`,col:`next_run`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,z.jsx)(Qv,{label:`LAST FIRE`,col:`last_fire`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,z.jsx)(`th`,{children:`RUN HISTORY`}),(0,z.jsx)(Qv,{label:`AGENT`,col:`agent`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,z.jsx)(`th`,{children:`REPOS`}),(0,z.jsx)(`th`,{children:`MACHINES`}),(0,z.jsx)(`th`,{children:`TAGS`}),(0,z.jsx)(`th`,{children:`TTL`}),(0,z.jsx)(Qv,{label:`HEALTH`,col:`health`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,z.jsx)(Qv,{label:`ENABLED`,col:`enabled`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,z.jsx)(Qv,{label:`UPDATED`,col:`updated`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,z.jsx)(`th`,{})]})}),(0,z.jsx)(`tbody`,{children:u.map(([t,n])=>{let r=d(t),i=e.groupBy!==`none`&&a.has(r),o=Uc(n,e.now);return(0,z.jsxs)(_.Fragment,{children:[e.groupBy!==`none`&&(0,z.jsx)(`tr`,{className:`group-hd`,children:(0,z.jsx)(`td`,{colSpan:15,"data-label":`Group`,children:(0,z.jsxs)(`div`,{className:`group-hd-row`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`group-hd-toggle`,onClick:()=>s(r),"aria-expanded":!i,children:[(0,z.jsx)(`span`,{className:`group-caret`,children:i?`▶`:`▼`}),(0,z.jsx)(`span`,{className:`group-label`,children:t}),(0,z.jsxs)(`span`,{className:`group-count`,children:[`(`,n.length,`)`]})]}),(0,z.jsx)(`span`,{className:`group-health-chips`,children:_c.filter(e=>(o.get(e)??0)>0).map(e=>(0,z.jsx)(`span`,{className:`${bc(e)} chip`,children:o.get(e)},e))})]})})},`hd-${t}`),!i&&n.map(t=>(0,z.jsx)(Lv,{routine:t,now:e.now,runs:e.runHistory.get(t.id)??[],selected:e.selected.has(t.id),onSelect:e.onSelect,onEdit:e.onEdit,onClone:e.onClone,onDelete:e.onDelete,onMove:e.onMove,onToggle:e.onToggle,onTrigger:e.onTrigger,onLogs:e.onLogs,onHistory:e.onHistory,onFlags:e.onFlags},t.id))]},`grp-${t}`)})})]})]})}var ey=`moadim.routines.saved_views`,ty=`moadim.routines.last_view`;function ny(e,t,n,r){return{query:e.query,status:e.status,agent:oc(e.agent),machine:uc(e.machine),repository:oc(e.repository),tag:oc(e.tag),sortCol:t,sortDir:n,groupBy:r}}function ry(e){return{filter:{query:e.query,status:ic(e.status),agent:sc(e.agent),machine:dc(e.machine),repository:sc(e.repository),tag:sc(e.tag)},sortCol:e.sortCol===void 0?void 0:Fc(e.sortCol),sortDir:Lc(e.sortDir),groupBy:zc(e.groupBy)}}function iy(e){try{let t=window.localStorage.getItem(e);return t===null?void 0:JSON.parse(t)}catch{return}}function ay(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}}function oy(){return iy(ey)??[]}function sy(e){ay(ey,e)}function cy(){return iy(ty)}function ly(e){ay(ty,e)}function uy({views:e,onApply:t,onSave:n,onDelete:r}){let{addToast:i}=Ka(),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),d=n=>{let r=e.find(e=>e.name===n);r&&t(r.snapshot),u(n)};return(0,z.jsx)(`div`,{className:`filter-bar saved-views-bar`,children:(0,z.jsxs)(`div`,{className:`filter-field`,children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`VIEWS`}),(0,z.jsxs)(`select`,{className:`filter-select`,"aria-label":`Saved views`,value:l,onChange:e=>d(e.target.value),children:[(0,z.jsx)(`option`,{value:``,children:`— select —`}),e.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.name))]}),a?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`input`,{type:`text`,className:`filter-input`,placeholder:`View name…`,"aria-label":`New view name`,value:s,onChange:e=>c(e.target.value)}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:s.trim()===``,onClick:()=>{let e=s.trim();e!==``&&(n(e),u(e),o(!1))},children:`SAVE`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>o(!1),children:`CANCEL`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Save current filters, sort, and grouping as a named view`,onClick:()=>{o(!0),c(``)},children:`☆ SAVE VIEW`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Copy a shareable link to this filtered/sorted/grouped view`,onClick:()=>{navigator.clipboard.writeText(window.location.href).then(()=>i(`Link copied — includes current filters, sort, and grouping`,`ok`)).catch(()=>i(`Copy failed`,`err`))},children:`🔗 COPY LINK`}),l!==``&&(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Delete this saved view`,onClick:()=>{l!==``&&(r(l),u(``))},children:`DELETE`})]})]})})}function dy(e){let t=new Map;for(let n of e){let e=t.get(n.routine_id);e||(e=[],t.set(n.routine_id,e)),e.length<10&&e.push(n)}for(let e of t.values())e.reverse();return t}var fy=ny(fc(),void 0,`asc`,`none`),py={query:`q`,status:`status`,agent:`agent`,machine:`machine`,repository:`repo`,tag:`tag`,sortCol:`sort`,sortDir:`dir`,groupBy:`group`},my=Object.values(py);function hy(e){let t=new URLSearchParams;for(let n of Object.keys(py)){let r=e[n];if(r!==void 0&&r!==fy[n]){if(Array.isArray(r))for(let e of r)t.append(py[n],e);else t.set(py[n],r)}}return t}function gy(e,t){let n=new URLSearchParams(e);for(let e of my)n.delete(e);for(let[e,r]of hy(t))n.append(e,r);return n}function _y(e){if(my.some(t=>e.has(t)))return{query:e.get(py.query)??fy.query,status:e.get(py.status)??fy.status,agent:e.get(py.agent)??fy.agent,machine:e.getAll(py.machine).length>1?e.getAll(py.machine):e.get(py.machine)??fy.machine,repository:e.get(py.repository)??fy.repository,tag:e.get(py.tag)??fy.tag,sortCol:e.get(py.sortCol)??void 0,sortDir:e.get(py.sortDir)??fy.sortDir,groupBy:e.get(py.groupBy)??fy.groupBy}}function vy({routines:e,now:t,active:n,onStatus:r}){let i=e.length,a=e.filter(e=>e.enabled).length,o=i-a,s=e.filter(e=>!e.enabled&&e.auto_disabled_reason!=null).length,c=e.filter(e=>e.enabled&&!Sc(e,t)&&yo(e.schedule,t,36e5)).length,l=e.filter(e=>e.enabled&&Sc(e,t)).length,u=e.filter(e=>e.enabled&&(e.machines??[]).length===0).length,d=e.reduce((e,t)=>e+(t.flag_count??0),0),f=e.filter(e=>!e.agent_registered).length;return(0,z.jsx)(`div`,{className:`stats`,children:[[`all`,`TOTAL`,i,``],[`enabled`,`ENABLED`,a,``],[`disabled`,`DISABLED`,o,``],[`auto-disabled`,`AUTO-DISABLED`,s,s>0?`has-auto-disabled`:``],[`dormant`,`DORMANT`,u,u>0?`has-dormant`:``],[`due`,`DUE SOON`,c,``],[`snoozed`,`SNOOZED`,l,``],[`flagged`,`FLAGS`,d,d>0?`has-flags`:``],[`agent-unreg`,`UNREGISTERED AGENT`,f,f>0?`has-unreg`:``]].map(([e,t,i,a])=>{let o=n===e;return(0,z.jsxs)(`button`,{type:`button`,className:`stat-card ${a}${o?` active`:``}`.trim(),"aria-pressed":o,onClick:()=>r(o?`all`:e),children:[(0,z.jsx)(`div`,{className:`stat-label`,children:t}),(0,z.jsx)(`div`,{className:`stat-val`,children:i})]},e)})})}var yy=[[`table`,`LIST`],[`files`,`FILES`],[`calendar`,`CALENDAR`],[`day`,`DAY`]];function by({view:e,onSetView:t}){return(0,z.jsx)(`div`,{className:`view-toggle`,children:yy.map(([n,r])=>(0,z.jsx)(`button`,{type:`button`,className:e===n?`view-btn active`:`view-btn`,onClick:()=>t(n),children:r},n))})}var xy=3e4;function Sy(){let{addToast:e}=Ka(),[t,n]=Mn(),r=(0,_.useMemo)(()=>_y(t)??cy(),[]),i=r?ry(r):void 0,[a,o]=(0,_.useState)(()=>{let e=t.get(`history`);return e?{kind:`history`,id:e}:{kind:`list`}}),[s,c]=(0,_.useState)({kind:`none`}),[l,u]=(0,_.useState)(`table`),[d,f]=(0,_.useState)(i?.filter??fc()),[p,m]=(0,_.useState)(i?.sortCol),[h,g]=(0,_.useState)(i?.sortDir??`asc`),[v,y]=(0,_.useState)(i?.groupBy??`none`),[b,x]=(0,_.useState)(new Set),[S,C]=(0,_.useState)(oy),w=os(),[T,E]=(0,_.useState)(()=>new Date),D=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(t.get(`history`)){let e=new URLSearchParams(t);e.delete(`history`),n(e,{replace:!0})}},[]),(0,_.useEffect)(()=>{let e=setInterval(()=>E(new Date),xy);return()=>clearInterval(e)},[]),(0,_.useEffect)(()=>{let e=ny(d,p,h,v);ly(e),n(t=>gy(t,e),{replace:!0})},[d,p,h,v]),(0,_.useEffect)(()=>{let e=e=>{if(e.key===`Escape`&&s.kind!==`none`){c({kind:`none`});return}let t=e.target,n=t&&[`INPUT`,`TEXTAREA`,`SELECT`].includes(t.tagName);e.key!==`/`||n||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),D.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s.kind]);let O=ns(w),k=zi({},{refetchInterval:O}),A=Qi(300),ee=Xi(),te=ji(),ne=Mi();(0,_.useEffect)(()=>{if(O===void 0)return;let e=setInterval(()=>void A.refetch(),O);return()=>clearInterval(e)},[O]);let j=(0,_.useMemo)(()=>k.data??[],[k.data]),re=(0,_.useMemo)(()=>dy(A.data??[]),[A.data]),ie=(0,_.useRef)(!1);(0,_.useEffect)(()=>{let e=te.data?.name;e&&!ie.current&&(ie.current=!0,f(t=>t.machine.kind===`any`?{...t,machine:{kind:`machine`,value:e}}:t))},[te.data]);let[ae,oe]=(0,_.useState)(j);if(j!==ae){oe(j);let e=new Set(j.map(e=>e.id));x(t=>{let n=new Set([...t].filter(t=>e.has(t)));return n.size===t.size?t:n})}let se=Hi(),ce=Ui(),le=Wi(),ue=Gi(),de=Ki(),fe=Yi(),pe=Zi(),me=()=>o({kind:`list`}),he=()=>c({kind:`none`}),ge=()=>{pe.mutate(`all`,{onSuccess:()=>e(`Routines unlocked`,`ok`),onError:t=>e(`Unlock failed: ${t.message}`,`err`)})},_e=t=>{se.mutate({...t},{onSuccess:()=>{me(),e(`Routine created`,`ok`)},onError:t=>e(`Create failed: ${t.message}`,`err`)})},ve=(t,n)=>{ce.mutate({id:t,body:lv(n)},{onSuccess:()=>{he(),e(`Routine updated`,`ok`)},onError:t=>e(`Update failed: ${t.message}`,`err`)})},M=(t,n,r)=>{le.mutate({id:t,body:{folder:n,slug:r}},{onSuccess:()=>{he(),e(`Routine moved`,`ok`)},onError:t=>e(`Move failed: ${t.message}`,`err`)})},N=t=>{ue.mutate(t,{onSuccess:()=>{he(),e(`Routine deleted`,`ok`)},onError:t=>e(`Delete failed: ${t.message}`,`err`)})},ye=(t,n)=>{ce.mutate({id:t,body:{enabled:n}},{onSuccess:()=>e(n?`Routine enabled`:`Routine disabled`,`ok`),onError:t=>e(`Toggle failed: ${t.message}`,`err`)})},be=t=>{de.mutate(t,{onSuccess:()=>e(`Routine triggered`,`ok`),onError:t=>e(`Trigger failed: ${t.message}`,`err`)})},xe=()=>{fe.mutate(void 0,{onSuccess:t=>{let n=t.removed;e(`Cleanup removed ${n} workbench${n===1?``:`es`} (freed ${Gs(t.freed_bytes)})`,`ok`)},onError:t=>e(`Cleanup failed: ${t.message}`,`err`)})},Se=async t=>{let n=[...b];if(n.length===0)return;let r=0,i=0;for(let e of n)try{await ce.mutateAsync({id:e,body:{enabled:t}}),r++}catch{i++}let a=t?`enabled`:`disabled`;i===0?e(`${r} routine(s) ${a}`,`ok`):e(`${r} ${a}, ${i} failed`,`err`)},Ce=async()=>{let t=[...b],n=0,r=0,i=[];for(let e of t)try{await ue.mutateAsync(e),n++,i.push(e)}catch{r++}x(e=>{let t=new Set(e);for(let e of i)t.delete(e);return t}),he(),r===0?e(`${n} routine(s) deleted`,`ok`):e(`${n} deleted, ${r} failed`,`err`)},we=e=>{let t=ry(e);f(t.filter),m(t.sortCol),g(t.sortDir),y(t.groupBy)},Te=e=>{let t=ny(d,p,h,v);C(n=>{let r=[...n.filter(t=>t.name!==e),{name:e,snapshot:t}];return sy(r),r})},Ee=e=>{C(t=>{let n=t.filter(t=>t.name!==e);return sy(n),n})},De=(0,_.useMemo)(()=>Dc(j),[j]),Oe=(0,_.useMemo)(()=>kc(j),[j]),ke=(0,_.useMemo)(()=>Ac(j),[j]),Ae=(0,_.useMemo)(()=>[...new Set([...Oc(j),...ne.data??[]])].sort(),[j,ne.data]),je=pc(d),Me=(0,_.useMemo)(()=>Gc(hc(j,d,T,nc),p,h,T),[j,d,T,p,h]),Ne=()=>{Qs(`routines-${new Date().toISOString().slice(0,10)}.csv`,Zs(Me)),e(`Exported ${Me.length} routine(s) to CSV`,`ok`)},P=Bi(s.kind===`edit`?s.id:``,s.kind===`edit`),Pe=s.kind===`edit`?P.data:void 0,Fe=e=>x(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),Ie=()=>{let e=Me.map(e=>e.id),t=e.length>0&&e.every(e=>b.has(e));x(t?new Set:new Set(e))},Le=e=>{p===e?g(e=>Ic(e)):(m(e),g(`asc`))},Re=e=>j.find(t=>t.id===e)?.title??``;if(a.kind===`new`)return(0,z.jsx)(mv,{mode:`create`,saving:se.isPending,onCancel:me,onSave:_e});if(a.kind===`clone`){let e={schedule:a.source.schedule,schedules:go(a.source),title:tv(a.source.title),agent:a.source.agent,model:a.source.model??null,prompt:a.source.prompt??``,goal:a.source.goal??null,repositories:a.source.repositories??[],machines:a.source.machines??[],enabled:a.source.enabled,power_saving_exempt:a.source.power_saving_exempt??!1,ttl_secs:a.source.ttl_secs??null,tags:a.source.tags??[]};return(0,z.jsx)(mv,{mode:`clone`,initial:e,saving:se.isPending,onCancel:me,onSave:_e})}if(a.kind===`logs`)return(0,z.jsx)(Tv,{id:a.id,title:Re(a.id),onBack:me});if(a.kind===`history`)return(0,z.jsx)(wv,{id:a.id,title:Re(a.id),onBack:me});if(a.kind===`flags`)return(0,z.jsx)(Qc,{id:a.id,title:Re(a.id),onBack:me});let ze=Me.filter(e=>e.enabled).map(e=>({id:e.id,label:e.title,schedule:e.schedule,schedules:go(e),snoozed:Sc(e,T),flagCount:e.flag_count??0}));return(0,z.jsxs)(`div`,{className:`page`,children:[(0,z.jsx)(`h1`,{className:`page-title`,children:`Routines`}),(0,z.jsx)(Xo,{status:ee.data,onUnlock:ge}),(0,z.jsx)(vy,{routines:j,now:T,active:d.status,onStatus:e=>f(t=>({...t,status:e}))}),(0,z.jsxs)(`div`,{className:`section-hd`,children:[(0,z.jsx)(`div`,{className:`section-label`,children:`SCHEDULED ROUTINES`}),(0,z.jsxs)(`div`,{className:`section-acts`,children:[(0,z.jsx)(cs,{updatedAtMs:k.dataUpdatedAt}),l===`table`&&(0,z.jsx)(qc,{groupBy:v,onChange:y}),(0,z.jsx)(by,{view:l,onSetView:u}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Reap finished, expired run workbenches now`,onClick:xe,children:`CLEANUP NOW`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Export the currently filtered/sorted routines to a CSV file`,disabled:Me.length===0,onClick:Ne,children:`EXPORT CSV`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>o({kind:`new`}),children:`+ NEW ROUTINE`})]})]}),(0,z.jsx)(Nc,{filter:d,agents:De,machines:Ae,repositories:Oe,tags:ke,shown:Me.length,total:j.length,searchRef:D,onQuery:e=>f(t=>({...t,query:e})),onStatus:e=>f(t=>({...t,status:e})),onAgent:e=>f(t=>({...t,agent:e})),onMachine:e=>f(t=>({...t,machine:e})),onRepository:e=>f(t=>({...t,repository:e})),onTag:e=>f(t=>({...t,tag:e})),onClear:()=>f(fc())}),(0,z.jsx)(uy,{views:S,onApply:we,onSave:Te,onDelete:Ee}),(0,z.jsx)(Vs,{count:b.size,onEnable:()=>void Se(!0),onDisable:()=>void Se(!1),onDelete:()=>c({kind:`confirmBulkDelete`}),onClear:()=>x(new Set)}),l===`table`&&(0,z.jsx)($v,{routines:Me,loading:k.isLoading,filterActive:je,now:T,selected:b,onSelect:Fe,onSelectAll:Ie,sortCol:p,sortDir:h,groupBy:v,runHistory:re,onSort:Le,onEdit:e=>c({kind:`edit`,id:e}),onClone:e=>{let t=j.find(t=>t.id===e);t&&o({kind:`clone`,source:t})},onDelete:(e,t)=>c({kind:`confirmDelete`,id:e,title:t}),onMove:e=>c({kind:`move`,id:e}),onToggle:ye,onTrigger:be,onLogs:e=>o({kind:`logs`,id:e}),onHistory:e=>o({kind:`history`,id:e}),onFlags:e=>o({kind:`flags`,id:e}),onClearFilters:()=>f(fc())}),l===`files`&&(0,z.jsx)(Gv,{routines:Me,loading:k.isLoading,filterActive:je,now:T,onEdit:e=>c({kind:`edit`,id:e}),onClone:e=>{let t=j.find(t=>t.id===e);t&&o({kind:`clone`,source:t})},onDelete:(e,t)=>c({kind:`confirmDelete`,id:e,title:t}),onMove:e=>c({kind:`move`,id:e}),onToggle:ye,onTrigger:be,onLogs:e=>o({kind:`logs`,id:e}),onHistory:e=>o({kind:`history`,id:e}),onFlags:e=>o({kind:`flags`,id:e}),onClearFilters:()=>f(fc())}),l===`calendar`&&(0,z.jsx)(Zc,{routines:Me,loading:k.isLoading,onEdit:e=>c({kind:`edit`,id:e}),onTrigger:be}),l===`day`&&(0,z.jsx)(tc,{items:ze,loading:k.isLoading,onClick:e=>c({kind:`edit`,id:e})}),s.kind===`edit`&&P.isLoading&&(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})}),s.kind===`edit`&&Pe&&(0,z.jsx)(mv,{mode:`edit`,initial:Pe&&{schedule:Pe.schedule,schedules:go(Pe),title:Pe.title,agent:Pe.agent,model:Pe.model??null,prompt:Pe.prompt??``,goal:Pe.goal??null,repositories:Pe.repositories??[],machines:Pe.machines??[],enabled:Pe.enabled,power_saving_exempt:Pe.power_saving_exempt??!1,ttl_secs:Pe.ttl_secs??null,tags:Pe.tags??[]},saving:ce.isPending,onCancel:he,onSave:e=>ve(s.id,e)}),s.kind===`move`&&(()=>{let e=j.find(e=>e.id===s.id);return e?(0,z.jsx)(kv,{routine:e,saving:le.isPending,onCancel:he,onConfirm:(e,t)=>M(s.id,e,t)}):null})(),s.kind===`confirmDelete`&&(0,z.jsx)(Us,{title:s.title,onCancel:he,onConfirm:()=>N(s.id)}),s.kind===`confirmBulkDelete`&&(0,z.jsx)(Hs,{count:b.size,onCancel:he,onConfirm:()=>void Ce()})]})}var Cy={"1h":3600,"24h":86400,"7d":604800};function wy(e,t,n){let r=t.query.trim().toLowerCase(),i=t.time===`all`?void 0:n-Cy[t.time];return e.filter(e=>!(t.status!==`all`&&e.status!==t.status||i!==void 0&&e.started_at<i||r!==``&&!e.routine_title.toLowerCase().includes(r)))}function Ty(e){let t={running:0,success:0,failed:0,unknown:0};for(let n of e)t[n.status]+=1;return t}var Ey=[`all`,`success`,`failed`,`running`,`unknown`],Dy=[`all`,`1h`,`24h`,`7d`];function Oy(e){let t=e.get(`status`)??``,n=e.get(`when`)??``,r=Number(e.get(`from`)),i=Number(e.get(`to`)),a=e.has(`from`)&&e.has(`to`)&&Number.isFinite(r)&&Number.isFinite(i)&&r<i;return{filter:{query:e.get(`q`)??``,status:Ey.includes(t)?t:`all`,time:Dy.includes(n)?n:`all`},range:a?{from:r,to:i}:null}}function ky(e,t){let n=new URLSearchParams;return e.query!==``&&n.set(`q`,e.query),e.status!==`all`&&n.set(`status`,e.status),e.time!==`all`&&n.set(`when`,e.time),t!==null&&(n.set(`from`,String(t.from)),n.set(`to`,String(t.to))),n}function Ay(e){let t=e==null?``:String(e);return/[",\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t}function jy(e){return e==null?``:new Date(e*1e3).toISOString()}var My=`routine,routine_id,workbench,status,exit_code,started_at,finished_at,duration_secs`;function Ny(e){return[My,...e.map(e=>[e.routine_title,e.routine_id,e.workbench,e.status,e.exit_code,jy(e.started_at),jy(e.finished_at),e.finished_at==null?null:e.finished_at-e.started_at].map(Ay).join(`,`))].join(`\r
`)+`\r
`}var Py=[`failed`,`success`,`running`,`unknown`];function Fy(e){let t=Py.filter(t=>e.counts[t]>0).map(t=>`${e.counts[t]} ${t}`);return`${Ra(e.from)} – ${Ra(e.to)}: ${e.total===0?`no runs`:t.join(`, `)}`}function Iy({histogram:e,selected:t,onSelect:n}){let{buckets:r,max:i}=e;if(r.length===0)return null;let a=r[0];return(0,z.jsxs)(`div`,{className:`runs-hist`,role:`group`,"aria-label":`Run activity over time`,children:[(0,z.jsx)(`div`,{className:`runs-hist-bars`,children:r.map(e=>{let r=t===e.from,a=Fy(e);return(0,z.jsx)(`button`,{type:`button`,className:r?`runs-hist-bar selected`:`runs-hist-bar`,"aria-pressed":r,"aria-label":a,title:a,disabled:e.total===0&&!r,onClick:()=>n(r?null:e),children:(0,z.jsx)(`span`,{className:`runs-hist-stack`,style:{height:`${i===0?0:e.total/i*100}%`},children:Py.filter(t=>e.counts[t]>0).map(t=>(0,z.jsx)(`span`,{className:`runs-hist-seg ${t}`,style:{flexGrow:e.counts[t]}},t))})},e.from)})}),(0,z.jsxs)(`div`,{className:`runs-hist-axis`,children:[(0,z.jsx)(`span`,{children:Ra(a.from)}),(0,z.jsxs)(`span`,{children:[`peak `,i,`/bar`]}),(0,z.jsx)(`span`,{children:`now`})]})]})}var Ly=[60,300,900,1800,3600,10800,21600,43200,86400,604800];function Ry(e){return Ly.find(t=>t*24>=e)??Ly[Ly.length-1]}function zy(e,t,n){let r=n??Math.min(...e.map(e=>e.started_at));if(!Number.isFinite(r)||r>t)return{buckets:[],step:0,max:0};let i=Ry(t-r),a=Math.floor(r/i)*i,o=Math.floor((t-a)/i)+1,s=Array.from({length:o},(e,t)=>({from:a+t*i,to:a+(t+1)*i,counts:{running:0,success:0,failed:0,unknown:0},total:0}));for(let t of e){let e=s[Math.floor((t.started_at-a)/i)];e!==void 0&&(e.counts[t.status]+=1,e.total+=1)}return{buckets:s,step:i,max:Math.max(0,...s.map(e=>e.total))}}function By(e,t){return e.filter(e=>e.started_at>=t.from&&e.started_at<t.to)}function Vy(e,t){return e.finished_at==null?e.status===`running`?Math.max(e.started_at,t):e.started_at:Math.max(e.started_at,e.finished_at)}function Hy(e,t,n){let r=[];for(let t of e)t.end<=t.start||r.push([t.start,1],[t.end,-1]);r.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let i=[],a=0,o=t;for(let[e,t]of r)e>o&&(i.push({from:o,to:e,count:a}),o=e),a+=t;return n>o&&i.push({from:o,to:n,count:a}),i}function Uy(e,t,n){let r=n??Math.min(...e.map(e=>e.started_at));if(!Number.isFinite(r)||r>=t)return{from:0,to:0,lanes:[],concurrency:[],peak:0};let i=new Map,a=[];for(let n of e){let e=Math.min(Vy(n,t),t);if(e<r||n.started_at>t)continue;let o={run:n,start:Math.max(n.started_at,r),end:e};a.push(o);let s=i.get(n.routine_id);s===void 0&&(s={routineId:n.routine_id,title:n.routine_title,bars:[]},i.set(n.routine_id,s)),s.bars.push(o)}let o=Hy(a,r,t);return{from:r,to:t,lanes:[...i.values()].sort((e,t)=>e.title.localeCompare(t.title)),concurrency:o,peak:Math.max(0,...o.map(e=>e.count))}}function Wy(e,t,n){return(e-t)/(n-t)*100}function Gy(e,t){let n=t.run.status===`running`?`running`:Os(t.run.started_at,t.end);return`${e}: started ${Ra(t.run.started_at)}, ${n}, ${t.run.status}`}function Ky({gantt:e,cap:t}){let{from:n,to:r,lanes:i,concurrency:a,peak:o}=e;if(i.length===0)return null;let s=t!==void 0&&t>0,c=s&&o>=t,l=t===void 0?``:t===0?` (no cap)`:` / cap ${t}`;return(0,z.jsxs)(`details`,{className:`runs-gantt`,open:!0,children:[(0,z.jsxs)(`summary`,{className:`runs-gantt-hd`,children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`TIMELINE`}),(0,z.jsxs)(`span`,{className:c?`runs-gantt-peak c-amber`:`runs-gantt-peak`,children:[`peak concurrency `,o,l,c&&` — runs may have queued`]})]}),(0,z.jsxs)(`div`,{className:`runs-gantt-row`,children:[(0,z.jsx)(`span`,{className:`runs-gantt-name`,children:`concurrent`}),(0,z.jsxs)(`div`,{className:`runs-gantt-track runs-gantt-strip`,role:`img`,"aria-label":`Concurrent runs over time, peak ${o}`,children:[a.filter(e=>e.count>0).map(e=>(0,z.jsx)(`span`,{className:`runs-gantt-level`,title:`${Ra(e.from)} – ${Ra(e.to)}: ${e.count} running`,style:{left:`${Wy(e.from,n,r)}%`,width:`${Wy(e.to,n,r)-Wy(e.from,n,r)}%`,height:`${e.count/o*100}%`}},e.from)),s&&t<=o&&(0,z.jsx)(`span`,{className:`runs-gantt-cap`,style:{bottom:`${t/o*100}%`}})]})]}),(0,z.jsx)(`div`,{className:`runs-gantt-lanes`,children:i.map(e=>(0,z.jsxs)(`div`,{className:`runs-gantt-row`,children:[(0,z.jsx)(`span`,{className:`runs-gantt-name`,title:e.title,children:e.title}),(0,z.jsx)(`div`,{className:`runs-gantt-track`,children:e.bars.map(t=>{let i=Gy(e.title,t);return(0,z.jsx)(En,{to:`/runs/${encodeURIComponent(t.run.routine_id)}/${encodeURIComponent(t.run.workbench)}`,className:`runs-gantt-bar ${t.run.status}`,"aria-label":i,title:i,style:{left:`${Wy(t.start,n,r)}%`,width:`${Wy(t.end,n,r)-Wy(t.start,n,r)}%`}},t.run.workbench)})})]},e.routineId))}),(0,z.jsxs)(`div`,{className:`runs-hist-axis runs-gantt-axis`,children:[(0,z.jsx)(`span`,{children:Ra(n)}),(0,z.jsx)(`span`,{children:`now`})]})]})}function qy({label:e,col:t,sort:n,defaultDir:r,onSort:i}){let a=n?.key===t?n.dir:null;return(0,z.jsx)(`th`,{className:a===null?`th-sort`:`th-sort th-sort-active`,"aria-sort":a===null?`none`:a===`asc`?`ascending`:`descending`,children:(0,z.jsxs)(`button`,{type:`button`,className:`th-sort-btn`,onClick:()=>i(t,r),children:[e,a===null?``:a===`asc`?` ▲`:` ▼`]})})}function Jy(e,t,n){return e===null||e.key!==t?{key:t,dir:n}:e.dir===n?{key:t,dir:n===`asc`?`desc`:`asc`}:null}function Yy(e,t,n){if(t===null)return[...e];let r=n[t.key],i=t.dir===`asc`?1:-1;return e.map((e,t)=>({row:e,i:t,v:r(e)})).sort((e,t)=>{if(e.v===null||t.v===null)return e.v===t.v?e.i-t.i:e.v===null?1:-1;let n=typeof e.v==`number`&&typeof t.v==`number`?e.v-t.v:String(e.v).localeCompare(String(t.v),void 0,{sensitivity:`base`,numeric:!0});return n===0?e.i-t.i:n*i}).map(e=>e.row)}function Xy(e,t){try{let n=localStorage.getItem(e);if(n===null)return null;let r=JSON.parse(n);if(typeof r!=`object`||!r)return null;let{key:i,dir:a}=r;return!t.includes(i)||a!==`asc`&&a!==`desc`?null:{key:i,dir:a}}catch{return null}}function Zy(e,t){try{t===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}catch{}}function Qy(e,t){let[n,r]=(0,_.useState)(()=>Xy(e,t));return{sort:n,toggle:(t,i)=>{let a=Jy(n,t,i);Zy(e,a),r(a)}}}function $y(e,t){let n=URL.createObjectURL(new Blob([e],{type:`text/csv;charset=utf-8`})),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}var eb=100,tb=100,nb=1e3,rb=[`routine`,`started`,`duration`,`status`,`exit`],ib={routine:e=>e.routine_title,started:e=>e.started_at,duration:e=>e.finished_at==null?null:e.finished_at-e.started_at,status:e=>e.status,exit:e=>e.exit_code??null},ab=[[`all`,`All`],[`success`,`Success`],[`failed`,`Failed`],[`running`,`Running`],[`unknown`,`Unknown`]],ob=[[`all`,`All time`],[`1h`,`Last hour`],[`24h`,`Last 24h`],[`7d`,`Last 7 days`]];function sb(){let e=ns(os()),t=Math.floor(Zo(3e4)/1e3),[n,r]=(0,_.useState)(eb),[i,a]=Mn(),{filter:o,range:s}=(0,_.useMemo)(()=>Oy(i),[i]),c=(e,t)=>a(ky(e,t),{replace:!0}),l=e=>c(e,s),u=e=>c(o,e),d=Qi(n,{refetchInterval:e}),f=(0,_.useMemo)(()=>d.data??[],[d.data]),p=(0,_.useMemo)(()=>wy(f,o,t),[f,o,t]),m=o.time===`all`?void 0:t-Cy[o.time],h=(0,_.useMemo)(()=>zy(p,t,m),[p,t,m]),g=(0,_.useMemo)(()=>s===null?p:By(p,s),[p,s]),v=(0,_.useMemo)(()=>Uy(g,t,s?.from??m),[g,t,s,m]),y=Li().data?.value,b=(0,_.useMemo)(()=>Ty(f),[f]),{sort:x,toggle:S}=Qy(`moadim.client.runs.sort`,rb),C=(0,_.useMemo)(()=>Yy(g,x,ib),[g,x]),w=f.length>=n&&n<nb;return(0,z.jsxs)(`div`,{className:`page`,children:[(0,z.jsxs)(`div`,{className:`section-hd`,children:[(0,z.jsx)(`h1`,{className:`page-title`,children:`Runs`}),(0,z.jsx)(`div`,{className:`section-acts`,children:(0,z.jsx)(cs,{updatedAtMs:d.dataUpdatedAt})})]}),(0,z.jsxs)(`div`,{className:`stats`,children:[(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FETCHED`}),(0,z.jsx)(`div`,{className:`stat-val`,children:f.length})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`RUNNING`}),(0,z.jsx)(`div`,{className:b.running>0?`stat-val c-accent`:`stat-val`,children:b.running})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`SUCCESS`}),(0,z.jsx)(`div`,{className:`stat-val`,children:b.success})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FAILED`}),(0,z.jsx)(`div`,{className:b.failed>0?`stat-val c-red`:`stat-val`,children:b.failed})]})]}),(0,z.jsxs)(`div`,{className:`filter-bar`,children:[(0,z.jsxs)(`div`,{className:`filter-field`,children:[(0,z.jsx)(`input`,{type:`text`,className:`filter-input`,placeholder:`Search runs by routine…`,"aria-label":`Search runs`,value:o.query,onChange:e=>l({...o,query:e.target.value})}),(0,z.jsx)(`span`,{className:`filter-label`,children:`STATUS`}),(0,z.jsx)(`select`,{className:`filter-select`,"aria-label":`Status filter`,value:o.status,onChange:e=>l({...o,status:e.target.value}),children:ab.map(([e,t])=>(0,z.jsx)(`option`,{value:e,children:t},e))}),(0,z.jsx)(`span`,{className:`filter-label`,children:`WHEN`}),(0,z.jsx)(`select`,{className:`filter-select`,"aria-label":`Time range filter`,value:o.time,onChange:e=>c({...o,time:e.target.value},null),children:ob.map(([e,t])=>(0,z.jsx)(`option`,{value:e,children:t},e))})]}),(0,z.jsxs)(`div`,{className:`filter-field`,children:[(0,z.jsxs)(`span`,{className:`filter-count`,children:[`Showing `,g.length,` of `,f.length,` fetched`]}),s!==null&&(0,z.jsxs)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>u(null),children:[`Clear time selection (`,Ra(s.from),` – `,Ra(s.to),`) ✕`]}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,disabled:C.length===0,title:`Download the runs shown below, in their current order`,onClick:()=>$y(Ny(C),`moadim-runs-${t}.csv`),children:`Export CSV`})]})]}),d.data!==void 0&&(0,z.jsx)(Iy,{histogram:h,selected:s?.from??null,onSelect:e=>u(e===null?null:{from:e.from,to:e.to})}),(0,z.jsx)(Ky,{gantt:v,cap:y}),d.error?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:d.error.message})]})}):d.isLoading?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):g.length===0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:f.length===0?`no runs yet`:`no runs match the current filters`})]})}):(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(qy,{label:`ROUTINE`,col:`routine`,sort:x,defaultDir:`asc`,onSort:S}),(0,z.jsx)(qy,{label:`STARTED`,col:`started`,sort:x,defaultDir:`desc`,onSort:S}),(0,z.jsx)(qy,{label:`DURATION`,col:`duration`,sort:x,defaultDir:`desc`,onSort:S}),(0,z.jsx)(qy,{label:`STATUS`,col:`status`,sort:x,defaultDir:`asc`,onSort:S}),(0,z.jsx)(qy,{label:`EXIT CODE`,col:`exit`,sort:x,defaultDir:`desc`,onSort:S}),(0,z.jsx)(`th`,{})]})}),(0,z.jsx)(`tbody`,{children:C.map(e=>(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.routine_id)}`,children:e.routine_title})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`div`,{className:`cell-time`,title:Ra(e.started_at),children:Ia(e.started_at)})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:`cell-meta`,children:e.finished_at==null?`—`:Os(e.started_at,e.finished_at)})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:Es(e.status),children:Ds(e.status)})}),(0,z.jsx)(`td`,{children:e.exit_code==null?`—`:e.exit_code}),(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/runs/${encodeURIComponent(e.routine_id)}/${encodeURIComponent(e.workbench)}`,className:`act-btn logs`,children:`VIEW RUN`})})]},e.workbench))})]})}),w&&(0,z.jsx)(`div`,{className:`section-acts`,children:(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>r(e=>Math.min(nb,e+tb)),children:`Load more`})})]})}var cb=4e3;function lb(e,t){let n=Array.from({length:e.length+1},()=>Array(t.length+1).fill(0));for(let r=e.length-1;r>=0;r--)for(let i=t.length-1;i>=0;i--)n[r][i]=e[r]===t[i]?n[r+1][i+1]+1:Math.max(n[r+1][i],n[r][i+1]);return n}function ub(e,t,n){let r=[],i=0,a=0;for(;i<e.length&&a<t.length;)e[i]===t[a]?(r.push({kind:`equal`,line:e[i]}),i++,a++):n[i+1][a]>=n[i][a+1]?(r.push({kind:`remove`,line:e[i]}),i++):(r.push({kind:`add`,line:t[a]}),a++);for(;i<e.length;)r.push({kind:`remove`,line:e[i++]});for(;a<t.length;)r.push({kind:`add`,line:t[a++]});return r}function db(e,t){return[...e.map(e=>({kind:`remove`,line:e})),...t.map(e=>({kind:`add`,line:e}))]}function fb(e,t){let n=gv(e),r=gv(t);return n.length>cb||r.length>cb?db(n,r):ub(n,r,lb(n,r))}function pb(e){let t=0,n=0;for(let r of e)r.kind===`add`?t++:r.kind===`remove`&&n++;return{added:t,removed:n}}function mb(e,t){return t.find(t=>t.status===`success`&&t.started_at<e.started_at)}function hb({routineId:e,current:t,candidates:n}){let r=mb(t,n)??n[0],[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(r?.workbench),c=n.find(e=>e.workbench===o),l=na(e,t.workbench,i),u=na(e,o??``,i&&o!==void 0),d=(0,_.useMemo)(()=>{if(l.data!==void 0&&u.data!==void 0)return fb(u.data,l.data)},[l.data,u.data]);return n.length===0?null:(0,z.jsxs)(`div`,{className:`run-compare`,children:[(0,z.jsxs)(`div`,{className:`section-acts`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>a(e=>!e),children:[i?`▾`:`▸`,` Compare against another run`]}),i&&(0,z.jsx)(`select`,{className:`input input-sm`,value:o??``,onChange:e=>s(e.target.value||void 0),"aria-label":`Compare against`,children:n.map(e=>(0,z.jsxs)(`option`,{value:e.workbench,children:[Ds(e.status),` · `,Ia(e.started_at)]},e.workbench))})]}),i&&c!==void 0&&(0,z.jsx)(`div`,{className:`run-compare-body`,children:l.isLoading||u.isLoading?(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})}):l.isError||u.isError?(0,z.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,(l.error??u.error)?.message]}):d===void 0?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`run-compare-summary`,children:(()=>{let{added:e,removed:t}=pb(d);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:`c-accent`,children:[`+`,e]}),` `,(0,z.jsxs)(`span`,{className:`c-red`,children:[`-`,t]}),` vs`,` `,Ds(c.status),` run at `,Ia(c.started_at)]})})()}),(0,z.jsx)(`div`,{className:`logs-wrap`,children:d.length===0?(0,z.jsx)(`div`,{className:`logs-empty`,children:`— identical logs —`}):(0,z.jsx)(`div`,{className:`log-lines`,children:d.map((e,t)=>(0,z.jsxs)(`div`,{className:`log-line run-diff-${e.kind}`,children:[(0,z.jsx)(`span`,{className:`run-diff-marker`,children:e.kind===`add`?`+`:e.kind===`remove`?`-`:` `}),(0,z.jsx)(`span`,{className:`log-lc`,children:e.line})]},t))})})]})})]})}function gb(){let{routineId:e=``,workbench:t=``}=mt(),n=ut(),r=Zo(),i=Math.floor(r/1e3),a=Bi(e),o=$i(e),s=na(e,t),c=H(e,t),l=o.data??[],u=l.findIndex(e=>e.workbench===t),d=u>=0?l[u]:void 0,f=u>=0?l[u+1]:void 0,p=u>=0?l[u-1]:void 0,m=a.data?.title??e;return(0,z.jsxs)(`main`,{className:`logs-page`,children:[(0,z.jsxs)(`div`,{className:`page-hd`,children:[(0,z.jsxs)(En,{to:`/routines?history=${encodeURIComponent(e)}`,className:`btn btn-ghost btn-sm`,children:[`← `,m]}),(0,z.jsxs)(`div`,{className:`page-title`,children:[`RUN / `,t]}),o.dataUpdatedAt>0&&(0,z.jsx)(`span`,{className:`page-freshness`,children:as(Math.max(0,(r-o.dataUpdatedAt)/1e3))}),(0,z.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void o.refetch(),children:`↻`})]}),o.isLoading?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):o.isError?(0,z.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,o.error.message]}):d===void 0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`RUN NOT FOUND`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`it may have been reaped, or the link is stale`})]})}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`stats`,children:[(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`STATUS`}),(0,z.jsx)(`span`,{className:Es(d.status),children:Ds(d.status)})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`STARTED`}),(0,z.jsx)(`div`,{className:`stat-val stat-val-sm`,title:Ra(d.started_at),children:Ia(d.started_at)})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`DURATION`}),(0,z.jsx)(`div`,{className:`stat-val stat-val-sm`,children:d.finished_at==null?`—`:Os(d.started_at,d.finished_at)})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`EXIT CODE`}),(0,z.jsx)(`div`,{className:`stat-val stat-val-sm`,children:d.exit_code??`—`})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`RETENTION`}),(0,z.jsx)(`div`,{className:`stat-val stat-val-sm`,children:d.retention_expires_at==null?`—`:ks(i,d.retention_expires_at)})]})]}),(0,z.jsxs)(`div`,{className:`section-acts`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:f===void 0,onClick:()=>f&&n(`/runs/${e}/${f.workbench}`),children:`← Older run`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:p===void 0,onClick:()=>p&&n(`/runs/${e}/${p.workbench}`),children:`Newer run →`})]}),(0,z.jsx)(hv,{content:c.data,loading:c.isLoading,err:c.isError?c.error.message:void 0}),(0,z.jsx)(xv,{content:s.data,loading:s.isLoading,err:s.isError?s.error.message:void 0}),(0,z.jsx)(hb,{routineId:e,current:d,candidates:l.filter(e=>e.workbench!==d.workbench)})]})]})}function _b(e){return Ra(e).slice(-5)}function vb({forecast:e,cap:t}){let{from:n,to:r,lanes:i,concurrency:a,peak:o,overCap:s}=e;if(i.length===0)return null;let c=t!==void 0&&t>0,l=t===void 0?``:t===0?` (no cap)`:` / cap ${t}`;return(0,z.jsxs)(`details`,{className:`runs-gantt cap-forecast`,open:!0,children:[(0,z.jsxs)(`summary`,{className:`runs-gantt-hd`,children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`CAPACITY FORECAST · NEXT 24H`}),(0,z.jsxs)(`span`,{className:s.length>0?`runs-gantt-peak c-amber`:`runs-gantt-peak`,children:[`projected peak `,o,l,s.length>0&&` — ${s.length} over-cap window${s.length===1?``:`s`}`]})]}),(0,z.jsxs)(`div`,{className:`runs-gantt-row`,children:[(0,z.jsx)(`span`,{className:`runs-gantt-name`,children:`projected`}),(0,z.jsxs)(`div`,{className:`runs-gantt-track runs-gantt-strip`,role:`img`,"aria-label":`Projected concurrent runs over the next 24 hours, peak ${o}`,children:[a.filter(e=>e.count>0).map(e=>(0,z.jsx)(`span`,{className:c&&e.count>t?`runs-gantt-level over`:`runs-gantt-level`,title:`${Ra(e.from)} – ${Ra(e.to)}: ${e.count} projected`,style:{left:`${Wy(e.from,n,r)}%`,width:`${Wy(e.to,n,r)-Wy(e.from,n,r)}%`,height:`${e.count/o*100}%`}},e.from)),c&&t<=o&&(0,z.jsx)(`span`,{className:`runs-gantt-cap`,style:{bottom:`${t/o*100}%`}})]})]}),(0,z.jsx)(`div`,{className:`runs-gantt-lanes`,children:i.map(e=>{let t=`${Os(0,e.estimateSecs)}${e.estimated?` (default, no history)`:` median`}`;return(0,z.jsxs)(`div`,{className:`runs-gantt-row`,children:[(0,z.jsx)(`span`,{className:`runs-gantt-name`,title:`${e.title} · ~${t}`,children:e.title}),(0,z.jsx)(`div`,{className:`runs-gantt-track`,children:e.bars.map(i=>{let a=`${e.title}: ${i.running?`running now`:`fires ${Ra(i.start)}`}, ~${t}`;return(0,z.jsx)(`span`,{className:i.running?`runs-gantt-bar running`:e.estimated?`runs-gantt-bar est`:`runs-gantt-bar`,role:`img`,"aria-label":a,title:a,style:{left:`${Wy(i.start,n,r)}%`,width:`${Wy(i.end,n,r)-Wy(i.start,n,r)}%`}},i.start)})})]},e.routineId)})}),(0,z.jsxs)(`div`,{className:`runs-hist-axis runs-gantt-axis`,children:[(0,z.jsx)(`span`,{children:`now`}),(0,z.jsx)(`span`,{children:`+24h`})]}),s.length>0&&(0,z.jsx)(`ul`,{className:`cap-forecast-windows`,"aria-label":`Over-cap windows`,children:s.map(e=>(0,z.jsxs)(`li`,{children:[(0,z.jsxs)(`span`,{className:`c-amber`,children:[_b(e.from),`–`,_b(e.to),` · `,e.peak,` projected`]}),` `,e.titles.join(`, `)]},e.from))})]})}function yb(e,t){let n=Array.from({length:24},()=>[]);for(let r of e)for(let e of Do(r.schedule,t))n[e.getHours()]?.push({time:e,label:r.label,snoozed:r.snoozed,flagCount:r.flagCount});for(let e of n)e.sort((e,t)=>e.time.getTime()-t.time.getTime());return n}function bb(e,t){let n=e.snoozed_until;return n!=null&&n>Math.floor(t.getTime()/1e3)||(e.skip_runs??0)>0}function xb(e,t){return e.filter(e=>e.enabled).map(e=>({label:e.title,schedule:e.schedule,snoozed:bb(e,t),flagCount:e.flag_count}))}function Sb(e){return`${Co[e.getDay()]} · ${wo[e.getMonth()]?.slice(0,3)} ${e.getDate()} ${e.getFullYear()}`}function Cb({day:e,items:t,loading:n,isToday:r,currentHour:i,onPrev:a,onNext:o,onToday:s,onClose:c}){let l=yb(t,e),u=l.reduce((e,t)=>e+t.length,0);return(0,z.jsxs)(`section`,{className:`hm-day card`,children:[(0,z.jsxs)(`div`,{className:`hm-day-nav`,children:[(0,z.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:a,"aria-label":`Previous day`,children:`‹`}),(0,z.jsx)(`div`,{className:`hm-day-title`,children:Sb(e)}),(0,z.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:o,"aria-label":`Next day`,children:`›`}),(0,z.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:s,children:`TODAY`}),(0,z.jsx)(`div`,{className:`hm-day-spacer`}),(0,z.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:c,"aria-label":`Close day view`,children:`✕`})]}),n?(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})}):u===0?(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`no fire times on this day`})]}):(0,z.jsx)(`div`,{className:`hm-day-hours`,children:l.map((e,t)=>(0,z.jsxs)(`div`,{className:r&&t===i?`hm-day-hour now`:`hm-day-hour`,children:[(0,z.jsxs)(`div`,{className:`hm-day-hour-label`,children:[String(t).padStart(2,`0`),`:00`]}),(0,z.jsx)(`div`,{className:`hm-day-hour-slot`,children:e.map((e,t)=>(0,z.jsxs)(`div`,{className:e.snoozed?`hm-day-chip snoozed`:`hm-day-chip`,title:e.label,children:[(0,z.jsxs)(`span`,{className:`hm-day-chip-time`,children:[String(e.time.getHours()).padStart(2,`0`),`:`,String(e.time.getMinutes()).padStart(2,`0`)]}),(0,z.jsx)(`span`,{className:`hm-day-chip-label`,children:e.label}),e.flagCount>0&&(0,z.jsx)(`span`,{className:`hm-day-chip-flag`,children:`⚑${e.flagCount}`})]},t))})]},t))})]})}var wb=86400,Tb=2e3;function Eb(e){let t=new Map;for(let n of e){if(n.finished_at==null||n.status===`running`)continue;let e=t.get(n.routine_id)??[];e.push(Math.max(0,n.finished_at-n.started_at)),t.set(n.routine_id,e)}let n=new Map;for(let[e,r]of t)r.sort((e,t)=>e-t),n.set(e,r[Math.floor((r.length-1)/2)]??0);return n}function Db(e,t,n){let r=new Set;for(let i of go(e)){let e=po(i,new Date(t*1e3));for(let t=0;e!==void 0&&t<Tb&&e.hasNext();t++){let t=Math.floor(e.next().toDate().getTime()/1e3);if(t>=n)break;r.add(t)}}let i=e.snoozed_until??0;return[...r].sort((e,t)=>e-t).filter(e=>e>=i).slice(Math.max(0,e.skip_runs??0))}function Ob(e,t,n,r,i=wb){let a=n+i,o=Eb(t),s=t.filter(e=>e.status===`running`),c=[];for(let t of e){if(!t.enabled||(t.machines??[]).every(e=>e.trim()===``))continue;let e=o.get(t.id),r=Math.max(60,e??600),i=s.filter(e=>e.routine_id===t.id).map(e=>({start:n,end:Math.min(a,Math.max(n+60,e.started_at+r)),running:!0}));for(let e of Db(t,n,a))i.push({start:e,end:Math.min(a,e+r),running:!1});i.length>0&&c.push({routineId:t.id,title:t.title,estimateSecs:r,estimated:e===void 0,bars:i})}c.sort((e,t)=>e.title.localeCompare(t.title));let l=Hy(c.flatMap(e=>e.bars),n,a);return{from:n,to:a,lanes:c,concurrency:l,peak:Math.max(0,...l.map(e=>e.count)),overCap:kb(l,c,r)}}function kb(e,t,n){if(n<=0)return[];let r=[];for(let t of e){if(t.count<=n)continue;let e=r[r.length-1];e!==void 0&&e.to===t.from?(e.to=t.to,e.peak=Math.max(e.peak,t.count)):r.push({from:t.from,to:t.to,peak:t.count,titles:[]})}for(let e of r)e.titles=t.filter(t=>t.bars.some(t=>t.start<e.to&&t.end>e.from)).map(e=>e.title);return r}var Ab=2e4;function jb(e){return e===`all`?`ALL`:`ROUTINES`}function Mb(e,t){return e===`all`||e===t}function Nb(e,t,n){let r=xo(t),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+7),a=Array.from({length:7},()=>Array(24).fill(0)),o=0;for(let s of e){if(!s.enabled||!Mb(n,s.kind))continue;let e=!1;for(let n of go(s)){let o=po(n,t);if(o)for(let t=0;t<Ab&&o.hasNext();t++){let t=o.next().toDate(),n=xo(t);if(n.getTime()>=i.getTime())break;let s=a[Math.round((n.getTime()-r.getTime())/864e5)];s&&(s[t.getHours()]=(s[t.getHours()]??0)+1,e=!0)}}e&&o++}let s=0,c=0,l;for(let e=0;e<7;e++){let t=a[e];if(t)for(let n=0;n<24;n++){let r=t[n]??0;s+=r,r>c&&(c=r,l=[e,n])}}return{grid:a,total:s,maxCell:c,peak:l,sources:o}}function Pb(e,t){if(e===0||t===0)return 0;let n=e/t;return Math.min(4,Math.max(1,Math.ceil(n*4)))}function Fb(e){return e.grid.map(e=>e.reduce((e,t)=>e+t,0))}function Ib(e){return Array.from({length:24},(t,n)=>e.grid.reduce((e,t)=>e+(t[n]??0),0))}function Lb(e){return e.grid.flat().filter(e=>e>0).length}function Rb(e){return e.getDay()}function zb(e,t){return Co[Rb(new Date(e.getFullYear(),e.getMonth(),e.getDate()+t))]??``}function Bb(e,t){if(!e.peak)return;let[n,r]=e.peak,i=e.grid[n]?.[r]??0,a=i===1?`run`:`runs`;return`${zb(t,n)} ${String(r).padStart(2,`0`)}:00 · ${i} ${a}`}function Vb(e,t){let n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return`${Co[Rb(n)]} ${n.getDate()}`}function Hb(e){return e.map(e=>({kind:`routine`,schedule:e.schedule,schedules:go(e),enabled:e.enabled}))}var Ub=6e4,Wb=[`all`,`routine`];function Gb(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Kb(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function qb(e){let t=e?/^(\d{4})-(\d{2})-(\d{2})$/.exec(e):null;if(!t)return;let[,n,r,i]=t;return new Date(Number(n),Number(r)-1,Number(i))}function Jb(e){if(e!==0)return`color-mix(in srgb, var(--accent) ${10+e*20}%, var(--surface))`}function Yb(){let e=os(),{data:t,isLoading:n,error:r,dataUpdatedAt:i}=zi({},{refetchInterval:ns(e)}),[a,o]=(0,_.useState)(()=>new Date),[s,c]=(0,_.useState)(`all`),[l,u]=Mn();(0,_.useEffect)(()=>{let e=setInterval(()=>o(new Date),Ub);return()=>clearInterval(e)},[]);let d=xo(a),f=a.getHours(),p=(0,_.useMemo)(()=>Hb(t??[]),[t]),m=(0,_.useMemo)(()=>Nb(p,a,s),[p,a,s]),h=qb(l.get(`day`)),g=e=>{u(t=>{let n=new URLSearchParams(t);return n.set(`day`,Kb(e)),n})},v=()=>{u(e=>{let t=new URLSearchParams(e);return t.delete(`day`),t})},{data:y}=Qi(300,{refetchInterval:ns(e)}),b=Li().data?.value,x=(0,_.useMemo)(()=>Ob(t??[],y??[],Math.floor(a.getTime()/1e3),b??0),[t,y,a,b]),S=(0,_.useMemo)(()=>xb(t??[],a),[t,a]),C=r?.message,w=Array.from({length:7},(e,t)=>t),T=Array.from({length:24},(e,t)=>t),E=Fb(m),D=Ib(m),O=168-Lb(m);return(0,z.jsxs)(`div`,{className:`page`,children:[(0,z.jsxs)(`div`,{className:`hm-hd`,children:[(0,z.jsx)(`h1`,{className:`page-title`,children:`Heatmap`}),(0,z.jsxs)(`div`,{className:`hm-hd-acts`,children:[(0,z.jsx)(`div`,{className:`hm-filter`,role:`group`,"aria-label":`Source filter`,children:Wb.map(e=>(0,z.jsx)(`button`,{className:e===s?`hm-filter-btn active`:`hm-filter-btn`,"aria-pressed":e===s,onClick:()=>c(e),children:jb(e)},e))}),(0,z.jsx)(cs,{updatedAtMs:i})]})]}),(0,z.jsxs)(`div`,{className:`stats`,children:[(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FIRES / 7 DAYS`}),(0,z.jsx)(`div`,{className:`stat-val`,children:m.total})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`BUSIEST WINDOW`}),(0,z.jsx)(`div`,{className:`stat-val stat-val-sm c-accent`,children:Bb(m,d)??`—`})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`PEAK / HOUR`}),(0,z.jsx)(`div`,{className:`stat-val`,children:m.maxCell})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`SOURCES`}),(0,z.jsx)(`div`,{className:`stat-val`,children:m.sources})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`OPEN SLOTS`}),(0,z.jsxs)(`div`,{className:`stat-val stat-val-sm`,children:[O,` / `,168]})]})]}),C?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:C})]})}):n?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):m.total===0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`▦`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`no enabled routine fires in the next 7 days`})]})}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`hm-grid-wrap`,children:(0,z.jsxs)(`div`,{className:`hm-grid`,role:`grid`,"aria-label":`Fire density by day and hour`,children:[(0,z.jsx)(`div`,{className:`hm-corner`,role:`columnheader`,children:`DAY \\ HR`}),T.map(e=>(0,z.jsx)(`div`,{className:e===f?`hm-hcol now`:`hm-hcol`,role:`columnheader`,children:String(e).padStart(2,`0`)},e)),(0,z.jsx)(`div`,{className:`hm-rowtot hm-corner`,role:`columnheader`,children:`Σ`}),w.map(e=>{let t=Gb(d,e);return(0,z.jsxs)(_.Fragment,{children:[(0,z.jsx)(`button`,{className:e===0?`hm-daylabel today`:`hm-daylabel`,onClick:()=>g(t),title:`View ${Vb(d,e)}`,children:Vb(d,e)}),T.map(n=>{let r=m.grid[e]?.[n]??0,i=Pb(r,m.maxCell),a=m.peak?.[0]===e&&m.peak[1]===n,o=e===0&&n===f,s=`hm-cell`;return a&&(s+=` peak`),o&&(s+=` now`),(0,z.jsx)(`button`,{className:s,style:{backgroundColor:Jb(i)},onClick:()=>g(t),title:`${Vb(d,e)} ${String(n).padStart(2,`0`)}:00 — ${r} run${r===1?``:`s`}`,children:r>0?(0,z.jsx)(`span`,{className:`hm-n`,children:r}):null},`${e}-${n}`)}),(0,z.jsx)(`div`,{className:`hm-rowtot`,children:E[e]})]},e)}),(0,z.jsx)(`div`,{className:`hm-daylabel hm-foot`,children:`Σ`}),T.map(e=>(0,z.jsx)(`div`,{className:`hm-rowtot hm-foot`,children:D[e]},`hourtot-${e}`)),(0,z.jsx)(`div`,{className:`hm-rowtot hm-foot grand`,children:m.total})]})}),(0,z.jsxs)(`div`,{className:`hm-legend`,children:[(0,z.jsx)(`span`,{className:`hm-legend-label`,children:`LESS`}),[0,1,2,3,4].map(e=>(0,z.jsx)(`span`,{className:`hm-cell hm-legend-swatch`,style:{backgroundColor:Jb(e)}},e)),(0,z.jsx)(`span`,{className:`hm-legend-label`,children:`MORE`}),(0,z.jsx)(`span`,{className:`hm-legend-note`,children:`fires per weekday · hour across the next 7 days`})]})]}),!C&&!n&&(0,z.jsx)(vb,{forecast:x,cap:b}),h&&(0,z.jsx)(Cb,{day:h,items:S,loading:n,isToday:xo(h).getTime()===d.getTime(),currentHour:f,onPrev:()=>g(Gb(h,-1)),onNext:()=>g(Gb(h,1)),onToday:()=>g(d),onClose:v})]})}var Xb=5,Zb=.4,Qb=8,$b=1.25;function ex(e){return e.sampleSize===0?null:e.successes/e.sampleSize}function tx(e){if(e.sampleSize<Xb)return!1;let t=e.sampleSize-1;return t>0&&e.flips/t>=Zb}function nx(e){return e.kind===`failure`?e.count:0}function rx(e){let t=e[0];if(t===void 0)return{kind:`none`};let n=0;for(let r of e){if(r!==t)break;n+=1}return t===`success`?{kind:`success`,count:n}:{kind:`failure`,count:n}}function ix(e){let t=0;for(let n=1;n<e.length;n++)e[n]!==e[n-1]&&(t+=1);return t}function ax(e,t){return e.length===0?null:e[Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1))]??null}function ox(e){return ax([...e].sort((e,t)=>e-t),.5)}function sx(e){if(e.length<Qb)return!1;let t=Math.floor(e.length/2),n=ox(e.slice(0,t)),r=ox(e.slice(t));return n===null||r===null||r<=0?!1:n>r*$b}function cx(e){let t=new Map;for(let n of e){if(n.status!==`success`&&n.status!==`failed`)continue;let e=t.get(n.routine_id);e||(e={title:n.routine_title,statuses:[],durationsSecs:[]},t.set(n.routine_id,e)),e.statuses.length<20&&e.statuses.push(n.status),e.durationsSecs.length<20&&n.finished_at!=null&&n.finished_at>=n.started_at&&e.durationsSecs.push(n.finished_at-n.started_at)}return t}function lx(e){let t=[];for(let[n,r]of cx(e)){let e=[...r.durationsSecs].sort((e,t)=>e-t);t.push({routineId:n,routineTitle:r.title,sampleSize:r.statuses.length,successes:r.statuses.filter(e=>e===`success`).length,streak:rx(r.statuses),flips:ix(r.statuses),durationsSecs:r.durationsSecs,p50Secs:ax(e,.5),p95Secs:ax(e,.95),regressing:sx(r.durationsSecs)})}return t.sort((e,t)=>{let n=nx(t.streak)-nx(e.streak);if(n!==0)return n;let r=ex(e)??1,i=ex(t)??1;return r===i?e.routineTitle.localeCompare(t.routineTitle):r-i}),t}function ux(e){let t=e.flatMap(e=>e.durationsSecs).sort((e,t)=>e-t);return{sampleSize:e.reduce((e,t)=>e+t.sampleSize,0),successes:e.reduce((e,t)=>e+t.successes,0),failingCount:e.filter(e=>nx(e.streak)>0).length,flakyCount:e.filter(tx).length,p50Secs:ax(t,.5),p95Secs:ax(t,.95),regressingCount:e.filter(e=>e.regressing).length}}function dx(e){switch(e.kind){case`success`:return`run-status success`;case`failure`:return`run-status failed`;default:return`run-status unknown`}}function fx(e){switch(e.kind){case`success`:return`${e.count} OK`;case`failure`:return`${e.count} FAILING`;default:return`—`}}function px(e){return e===null?`run-status unknown`:e>=.9?`run-status success`:e>=.7?`run-status running`:`run-status failed`}function mx(e){return e===null?`—`:`${Math.round(e*100)}%`}var hx=86400,gx=60,_x=2e3;function vx(e){if(e.length===0)return null;let t=[...e].sort((e,t)=>e-t);return t[Math.floor((t.length-1)/2)]??null}function yx(e,t,n){let r=new Set;for(let i of go(e)){let e=po(i,new Date((n+1)*1e3));for(let n=0;e!==void 0&&n<_x&&e.hasPrev();n++){let n=Math.floor(e.prev().toDate().getTime()/1e3);if(n<t)break;r.add(n)}}return[...r].sort((e,t)=>e-t)}function bx(e,t){let n=[...t].sort((e,t)=>e-t),r=new Set,i=[],a=[];for(let t of e){let e=n.findIndex((e,n)=>!r.has(n)&&e>=t-gx&&e<=t+900);e===-1?a.push(t):(r.add(e),i.push(Math.max(0,n[e]-t)))}return{lags:i,missedAt:a}}function xx(e,t,n,r,i){let a=t.length>=i&&t.length>0,o=a?Math.min(...t.map(e=>e.started_at)):-1/0,s=Math.max(r-hx,o),c=r-900,l=new Map;for(let e of t){let t=l.get(e.routine_id)??[];t.push(e.started_at),l.set(e.routine_id,t)}let u=[],d=[];for(let t of e){let e=(t.machines??[]).filter(e=>e.trim()!==``);if(!t.enabled||e.length===0||n!==void 0&&!e.includes(n))continue;let r=yx(t,Math.max(s,t.created_at,t.snoozed_until??0),c);if(r.length===0)continue;let{lags:i,missedAt:a}=bx(r,l.get(t.id)??[]);d.push(...i),u.push({routineId:t.id,title:t.title,expected:r.length,ran:i.length,missed:a.length,medianLagSecs:vx(i),lastMissedAt:a[a.length-1]??null})}u.sort((e,t)=>t.missed-e.missed||e.title.localeCompare(t.title));let f=e=>u.reduce((t,n)=>t+n[e],0);return{from:s,to:c,truncated:a,rows:u,expected:f(`expected`),ran:f(`ran`),missed:f(`missed`),medianLagSecs:vx(d)}}function Sx(e){return e===null?`—`:Os(0,e)}function Cx({adherence:e}){let{rows:t,expected:n,ran:r,missed:i,medianLagSecs:a,truncated:o,from:s}=e;if(t.length===0)return null;let c=r/n,l=Math.max(1,Math.round((e.to-s)/3600));return(0,z.jsxs)(`details`,{className:`table-wrap adherence`,open:!0,children:[(0,z.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,z.jsxs)(`span`,{className:`filter-label`,children:[`SCHEDULE ADHERENCE · LAST `,o?`~${l}H`:`24H`]}),(0,z.jsxs)(`span`,{className:i>0?`c-red`:`cell-meta`,children:[r,`/`,n,` fires ran — `,i,` missed · `,(0,z.jsx)(`span`,{className:px(c),children:mx(c)}),` · median start lag `,Sx(a)]})]}),(0,z.jsxs)(`p`,{className:`adherence-note`,children:[`A fire counts as run when this routine started within `,15,`m of it. Past snoozes and power-saving skips aren't recorded, so they show as missed`,o&&`; the window is shortened to the oldest run in the fetched sample`,`.`]}),(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`ROUTINE`}),(0,z.jsx)(`th`,{children:`EXPECTED`}),(0,z.jsx)(`th`,{children:`RAN`}),(0,z.jsx)(`th`,{children:`MISSED`}),(0,z.jsx)(`th`,{children:`ADHERENCE`}),(0,z.jsx)(`th`,{children:`MEDIAN LAG`}),(0,z.jsx)(`th`,{children:`LAST MISSED`})]})}),(0,z.jsx)(`tbody`,{children:t.map(e=>(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.title})}),(0,z.jsx)(`td`,{className:`cell-meta`,children:e.expected}),(0,z.jsx)(`td`,{className:`cell-meta`,children:e.ran}),(0,z.jsx)(`td`,{className:e.missed>0?`c-red`:`cell-meta`,children:e.missed}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:px(e.ran/e.expected),children:mx(e.ran/e.expected)})}),(0,z.jsx)(`td`,{className:`cell-meta`,children:Sx(e.medianLagSecs)}),(0,z.jsx)(`td`,{className:`cell-meta`,children:e.lastMissedAt===null?`—`:Ra(e.lastMissedAt)})]},e.routineId))})]})]})}function wx(e,t){let n=new Map;for(let t of e){if(t.status!==`success`&&t.status!==`failed`)continue;let e=n.get(t.routine_id)??[];e.push(t),n.set(t.routine_id,e)}let r=[];for(let e of n.values()){e.sort((e,t)=>e.started_at-t.started_at);let n=null;for(let[t,i]of e.entries())if(i.status===`failed`)n?n.failedRuns+=1:n={routineId:i.routine_id,routineTitle:i.routine_title,openedAt:i.started_at,resolvedAt:null,durationSecs:0,failedRuns:1,firstWorkbench:i.workbench,truncated:t===0};else if(n){let e=i.finished_at??i.started_at;r.push({...n,resolvedAt:e,durationSecs:Math.max(0,e-n.openedAt)}),n=null}n&&r.push({...n,durationSecs:Math.max(0,t-n.openedAt)})}r.sort((e,t)=>Number(e.resolvedAt!==null)-Number(t.resolvedAt!==null)||t.openedAt-e.openedAt);let i=r.filter(e=>e.resolvedAt!==null).map(e=>e.durationSecs);return{incidents:r,openCount:r.length-i.length,mttrSecs:i.length===0?null:Math.round(i.reduce((e,t)=>e+t,0)/i.length),longestSecs:i.length===0?null:Math.max(...i)}}function Tx(e){return e===null?`—`:Os(0,e)}function Ex({report:e}){let{incidents:t,openCount:n,mttrSecs:r,longestSecs:i}=e;return t.length===0?null:(0,z.jsxs)(`details`,{className:`table-wrap adherence`,open:!0,children:[(0,z.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`FAILURE INCIDENTS`}),(0,z.jsxs)(`span`,{className:`cell-meta`,children:[(0,z.jsxs)(`span`,{className:n>0?`c-red`:void 0,children:[n,` open`]}),` · `,t.length,` total · MTTR `,Tx(r),` · longest `,Tx(i)]})]}),(0,z.jsx)(`p`,{className:`adherence-note`,children:`Consecutive failed runs of a routine form one incident, resolved when its next run succeeds. ≥ marks an incident that began before the oldest run in the fetched sample.`}),(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`ROUTINE`}),(0,z.jsx)(`th`,{children:`STATUS`}),(0,z.jsx)(`th`,{children:`OPENED`}),(0,z.jsx)(`th`,{children:`RESOLVED`}),(0,z.jsx)(`th`,{children:`TIME TO RECOVER`}),(0,z.jsx)(`th`,{children:`FAILED RUNS`})]})}),(0,z.jsx)(`tbody`,{children:t.map(e=>{let t=e.truncated?`≥ `:``;return(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.routineTitle})}),(0,z.jsx)(`td`,{children:e.resolvedAt===null?(0,z.jsx)(`span`,{className:`run-status failed`,children:`ONGOING`}):(0,z.jsx)(`span`,{className:`run-status success`,children:`RESOLVED`})}),(0,z.jsx)(`td`,{className:`cell-meta`,children:(0,z.jsxs)(En,{to:`/runs/${encodeURIComponent(e.routineId)}/${encodeURIComponent(e.firstWorkbench)}`,title:`Open the first failed run`,children:[t,Ra(e.openedAt)]})}),(0,z.jsx)(`td`,{className:`cell-meta`,children:e.resolvedAt===null?`—`:Ra(e.resolvedAt)}),(0,z.jsxs)(`td`,{className:e.resolvedAt===null?`c-red`:`cell-meta`,children:[t,Tx(e.durationSecs)]}),(0,z.jsxs)(`td`,{className:`cell-meta`,children:[t,e.failedRuns]})]},`${e.routineId}-${e.openedAt}`)})})]})]})}var Dx={1:`general error`,2:`misuse / bad arguments`,124:`timed out`,126:`not executable`,127:`command not found`,130:`interrupted (SIGINT)`,137:`killed (SIGKILL / OOM)`,143:`terminated (SIGTERM)`};function Ox(e){return e===null?`no exit code recorded`:Dx[e]||(e>128&&e<160?`signal ${e-128}`:`routine-specific`)}function kx(e){let t=new Map,n=0;for(let r of e){if(r.status!==`failed`)continue;n+=1;let e=r.exit_code??null,i=r.finished_at??r.started_at,a=t.get(e);a||(a={code:e,count:0,routines:[],last:{routineId:r.routine_id,workbench:r.workbench,at:i}},t.set(e,a)),a.count+=1,i>a.last.at&&(a.last={routineId:r.routine_id,workbench:r.workbench,at:i});let o=a.routines.find(e=>e.id===r.routine_id);o?o.count+=1:a.routines.push({id:r.routine_id,title:r.routine_title,count:1})}let r=[...t.values()];for(let e of r)e.routines.sort((e,t)=>t.count-e.count);return r.sort((e,t)=>t.count-e.count||t.last.at-e.last.at),{causes:r,totalFailed:n}}var Ax=3;function jx({report:e}){let{causes:t,totalFailed:n}=e;return t.length===0?null:(0,z.jsxs)(`details`,{className:`table-wrap adherence`,open:!0,children:[(0,z.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`FAILURE CAUSES`}),(0,z.jsxs)(`span`,{className:`cell-meta`,children:[n,` failed runs · `,t.length,` distinct exit `,t.length===1?`code`:`codes`]})]}),(0,z.jsx)(`p`,{className:`adherence-note`,children:`Failed runs in the fetched sample grouped by exit code. The same code across many routines usually means a host-level cause.`}),(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`EXIT CODE`}),(0,z.jsx)(`th`,{children:`MEANING`}),(0,z.jsx)(`th`,{children:`FAILURES`}),(0,z.jsx)(`th`,{children:`ROUTINES`}),(0,z.jsx)(`th`,{children:`LAST SEEN`})]})}),(0,z.jsx)(`tbody`,{children:t.map(e=>{let t=e.routines.length-Ax;return(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:`run-status failed`,children:e.code??`?`})}),(0,z.jsx)(`td`,{className:`cell-meta`,children:Ox(e.code)}),(0,z.jsxs)(`td`,{className:`cell-meta`,children:[e.count,` (`,Math.round(e.count/n*100),`%)`]}),(0,z.jsxs)(`td`,{children:[e.routines.slice(0,Ax).map((e,t)=>(0,z.jsxs)(`span`,{children:[t>0?`, `:null,(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.id)}`,children:e.title}),e.count>1?(0,z.jsxs)(`span`,{className:`cell-meta`,children:[` ×`,e.count]}):null]},e.id)),t>0?(0,z.jsxs)(`span`,{className:`cell-meta`,children:[` +`,t,` more`]}):null]}),(0,z.jsx)(`td`,{className:`cell-meta`,children:(0,z.jsx)(En,{to:`/runs/${encodeURIComponent(e.last.routineId)}/${encodeURIComponent(e.last.workbench)}`,title:`Open the newest failed run with this exit code`,children:Ra(e.last.at)})})]},e.code??`none`)})})]})]})}var Mx=1.5;function Nx(e,t,n){let r=new Map(t.map(e=>[e.routineId,e])),i=[],a=0,o=0;for(let t of e){if(t.status!==`running`)continue;a+=1;let e=r.get(t.routine_id);if(!e||e.p95Secs===null||e.durationsSecs.length<3){o+=1;continue}let s=Math.max(0,n-t.started_at),c=Math.max(e.p95Secs,1);s<60||s<=c*1.5||i.push({routineId:t.routine_id,routineTitle:t.routine_title,workbench:t.workbench,elapsedSecs:s,p95Secs:e.p95Secs,ratio:s/c})}return i.sort((e,t)=>t.ratio-e.ratio),{overruns:i,runningCount:a,noBaselineCount:o}}function Px({report:e}){let{overruns:t,runningCount:n,noBaselineCount:r}=e;return n===0?null:(0,z.jsxs)(`details`,{className:`table-wrap adherence`,open:t.length>0,children:[(0,z.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`LONG-RUNNING NOW`}),(0,z.jsxs)(`span`,{className:`cell-meta`,children:[t.length,` of `,n,` running over baseline`,r>0?` · ${r} without baseline`:``]})]}),(0,z.jsxs)(`p`,{className:`adherence-note`,children:[`Live runs whose elapsed time exceeds `,Mx,`× their routine's p95 duration. A large overrun usually means a stuck agent.`]}),t.length>0?(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`ROUTINE`}),(0,z.jsx)(`th`,{children:`ELAPSED`}),(0,z.jsx)(`th`,{children:`P95`}),(0,z.jsx)(`th`,{children:`OVERRUN`})]})}),(0,z.jsx)(`tbody`,{children:t.map(e=>(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/runs/${encodeURIComponent(e.routineId)}/${encodeURIComponent(e.workbench)}`,title:`Open the live run`,children:e.routineTitle})}),(0,z.jsx)(`td`,{className:`cell-meta`,children:Os(0,e.elapsedSecs)}),(0,z.jsx)(`td`,{className:`cell-meta`,children:Os(0,e.p95Secs)}),(0,z.jsx)(`td`,{children:(0,z.jsxs)(`span`,{className:e.ratio>=3?`run-status failed`:`run-status running`,children:[e.ratio.toFixed(1),`×`]})})]},`${e.routineId}/${e.workbench}`))})]}):null]})}var Fx=604800,Ix=[`worse`,`quiet`,`new`,`better`,`steady`],Lx=()=>({runs:0,failures:0,durations:[]});function Rx(e){if(e.length<3)return null;let t=[...e].sort((e,t)=>e-t);return t[Math.ceil(t.length/2)-1]??null}function zx(e){return{runs:e.runs,failures:e.failures,rate:e.runs===0?null:(e.runs-e.failures)/e.runs,p50Secs:Rx(e.durations)}}function Bx(e,t,n,r){return e.runs===0?`quiet`:t.runs===0?`new`:n!==null&&n<=-10||r!==null&&r>=1.25?`worse`:n!==null&&n>=10||r!==null&&r<=1/1.25?`better`:`steady`}function Vx(e,t,n){let r=t-Fx,i=t-2*Fx,a=new Map,o={current:Lx(),prior:Lx()},s=1/0;for(let n of e){if(s=Math.min(s,n.started_at),n.status!==`success`&&n.status!==`failed`||n.started_at<i||n.started_at>t)continue;let e=n.started_at>=r?`current`:`prior`,c=a.get(n.routine_id);c||(c={title:n.routine_title,current:Lx(),prior:Lx()},a.set(n.routine_id,c));for(let t of[c[e],o[e]])t.runs+=1,n.status===`failed`&&(t.failures+=1),n.finished_at!=null&&n.finished_at>=n.started_at&&t.durations.push(n.finished_at-n.started_at)}let c=[...a].map(([e,t])=>{let n=zx(t.current),r=zx(t.prior),i=n.rate===null||r.rate===null?null:(n.rate-r.rate)*100,a=n.p50Secs===null||r.p50Secs===null||r.p50Secs<=0?null:n.p50Secs/r.p50Secs;return{routineId:e,routineTitle:t.title,current:n,prior:r,rateDeltaPp:i,p50Ratio:a,verdict:Bx(n,r,i,a)}});return c.sort((e,t)=>Ix.indexOf(e.verdict)-Ix.indexOf(t.verdict)||(e.rateDeltaPp??0)-(t.rateDeltaPp??0)||e.routineTitle.localeCompare(t.routineTitle)),{changes:c,fleetCurrent:zx(o.current),fleetPrior:zx(o.prior),priorPartial:e.length>=n&&s>i}}var Hx={worse:`run-status failed`,quiet:`run-status running`,new:`cell-meta`,better:`run-status success`,steady:`cell-meta`};function Ux(e){if(e===null)return``;let t=Math.round(e);return t===0?` (±0pp)`:` (${t>0?`+`:``}${t}pp)`}function Wx(e){if(e===null)return``;let t=Math.round((e-1)*100);return t===0?` (±0%)`:` (${t>0?`+`:``}${t}%)`}function Gx(e){return e.p50Secs===null?`—`:Os(0,e.p50Secs)}function Kx(e){return e.failures>0?`${e.runs} · ${e.failures} failed`:`${e.runs}`}function qx({report:e}){let{changes:t,fleetCurrent:n,fleetPrior:r,priorPartial:i}=e;if(t.length===0)return null;let a=t.filter(e=>e.verdict===`worse`||e.verdict===`quiet`).length,o=n.rate===null||r.rate===null?null:(n.rate-r.rate)*100;return(0,z.jsxs)(`details`,{className:`table-wrap adherence`,open:a>0,children:[(0,z.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`WEEK OVER WEEK`}),(0,z.jsxs)(`span`,{className:`cell-meta`,children:[`fleet `,mx(r.rate),` → `,mx(n.rate),Ux(o),` · `,a,` worse or quiet`,i?` · prior week partial`:``]})]}),(0,z.jsxs)(`p`,{className:`adherence-note`,children:[`Finished runs in the last 7 days against the 7 days before. WORSE means the success rate fell by`,` `,10,`pp or more, or p50 grew by 25% or more. QUIET means it ran last week but not this week.`,i?` The fetched sample does not reach back 14 days, so the prior week is incomplete.`:``]}),(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`ROUTINE`}),(0,z.jsx)(`th`,{children:`CHANGE`}),(0,z.jsx)(`th`,{children:`RUNS (PRIOR → NOW)`}),(0,z.jsx)(`th`,{children:`SUCCESS RATE`}),(0,z.jsx)(`th`,{children:`P50`})]})}),(0,z.jsx)(`tbody`,{children:t.map(e=>(0,z.jsx)(Jx,{change:e},e.routineId))})]})]})}function Jx({change:e}){return(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.routineTitle})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:Hx[e.verdict],children:e.verdict.toUpperCase()})}),(0,z.jsxs)(`td`,{className:`cell-meta`,children:[Kx(e.prior),` → `,Kx(e.current)]}),(0,z.jsxs)(`td`,{className:`cell-meta`,children:[mx(e.prior.rate),` → `,mx(e.current.rate),Ux(e.rateDeltaPp)]}),(0,z.jsxs)(`td`,{className:`cell-meta`,children:[Gx(e.prior),` → `,Gx(e.current),Wx(e.p50Ratio)]})]})}var Yx=604800,Xx=86400,Zx=[.9,.95,.99,.999],Qx=.95,$x=.25,eS=[`exhausted`,`fast-burn`,`at-risk`,`ok`],tS=`moadim.client.reliability.slo`;function nS(){try{let e=Number(localStorage.getItem(tS));return Zx.includes(e)?e:Qx}catch{return Qx}}function rS(e){try{localStorage.setItem(tS,String(e))}catch{}}function iS(e){return`${Math.round(e*1e3)/10}%`}function aS(e,t,n){return t>0&&e<=0?`exhausted`:n!==null&&n>=2?`fast-burn`:e<.25?`at-risk`:`ok`}function oS(e,t,n,r){let i=t-Yx,a=t-Xx,o=1-n,s=new Map,c=1/0;for(let n of e){if(c=Math.min(c,n.started_at),n.status!==`success`&&n.status!==`failed`||n.started_at<i||n.started_at>t)continue;let e=s.get(n.routine_id);e||(e={title:n.routine_title,runs:0,failures:0,runs24:0,failures24:0},s.set(n.routine_id,e));let r=+(n.status===`failed`);e.runs+=1,e.failures+=r,n.started_at>=a&&(e.runs24+=1,e.failures24+=r)}let l=[...s].map(([e,t])=>{let n=t.runs*o,r=1-t.failures/n,i=t.runs24===0?null:t.failures24/t.runs24/o;return{routineId:e,routineTitle:t.title,runs:t.runs,failures:t.failures,allowed:n,budgetLeft:r,burn7d:t.failures/t.runs/o,burn24h:i,status:aS(r,t.failures,i)}});return l.sort((e,t)=>eS.indexOf(e.status)-eS.indexOf(t.status)||e.budgetLeft-t.budgetLeft||e.routineTitle.localeCompare(t.routineTitle)),{budgets:l,exhaustedCount:l.filter(e=>e.status===`exhausted`).length,partial:e.length>=r&&c>i}}var sS={exhausted:`run-status failed`,"fast-burn":`run-status failed`,"at-risk":`run-status running`,ok:`run-status success`},cS={exhausted:`EXHAUSTED`,"fast-burn":`FAST BURN`,"at-risk":`AT RISK`,ok:`OK`};function lS(e){return e===null?`—`:`${e.toFixed(1)}×`}function uS(e){return e.toFixed(+(e<10))}function dS({report:e,target:t,onTargetChange:n}){let{budgets:r,exhaustedCount:i,partial:a}=e;if(r.length===0)return null;let o=r.filter(e=>e.status!==`ok`).length;return(0,z.jsxs)(`details`,{className:`table-wrap adherence`,open:o>0,children:[(0,z.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,z.jsx)(`span`,{className:`filter-label`,children:`ERROR BUDGET`}),(0,z.jsxs)(`span`,{className:`cell-meta`,children:[`SLO `,iS(t),` · 7d · `,i,` exhausted · `,o,` need attention`,a?` · window partial`:``]})]}),(0,z.jsxs)(`p`,{className:`adherence-note`,children:[(0,z.jsx)(`label`,{htmlFor:`slo-target-select`,children:`SLO TARGET `}),(0,z.jsx)(`select`,{id:`slo-target-select`,className:`filter-select`,value:t,onChange:e=>n(Number(e.target.value)),children:Zx.map(e=>(0,z.jsx)(`option`,{value:e,children:iS(e)},e))}),` `,`The budget is the failures the target allows over finished runs in the last 7 days. Burn rate is the failure rate over the allowed rate: 1× spends the budget exactly at the window end. FAST BURN means the last 24h burn is `,2,`× or more. AT RISK means less than `,Math.round($x*100),`% of the budget is left.`,a?` The fetched sample does not reach back 7 days, so the window is incomplete.`:``]}),(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`ROUTINE`}),(0,z.jsx)(`th`,{children:`STATUS`}),(0,z.jsx)(`th`,{children:`FAILURES / ALLOWED`}),(0,z.jsx)(`th`,{children:`BUDGET LEFT`}),(0,z.jsx)(`th`,{children:`BURN 24H`}),(0,z.jsx)(`th`,{children:`BURN 7D`})]})}),(0,z.jsx)(`tbody`,{children:r.map(e=>(0,z.jsx)(fS,{budget:e},e.routineId))})]})]})}function fS({budget:e}){let t=Math.max(0,e.budgetLeft);return(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.routineTitle})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:sS[e.status],children:cS[e.status]})}),(0,z.jsxs)(`td`,{className:`cell-meta`,children:[e.failures,` / `,uS(e.allowed),` of `,e.runs,` runs`]}),(0,z.jsxs)(`td`,{className:`cell-meta`,children:[(0,z.jsx)(`meter`,{min:0,max:1,low:$x,high:.5,optimum:1,value:t,"aria-label":`${e.routineTitle} budget left`}),` `,Math.round(t*100),`%`]}),(0,z.jsx)(`td`,{className:`cell-meta`,children:lS(e.burn24h)}),(0,z.jsx)(`td`,{className:`cell-meta`,children:lS(e.burn7d)})]})}var pS=300,mS=[`routine`,`streak`,`rate`,`p50`,`p95`,`trend`],hS={routine:e=>e.routineTitle,streak:e=>e.streak.kind===`failure`?-e.streak.count:e.streak.kind===`success`?e.streak.count:0,rate:e=>ex(e),p50:e=>e.p50Secs,p95:e=>e.p95Secs,trend:e=>+!!e.regressing};function gS(e){return e===null?`—`:Os(0,e)}function _S(){let e=os(),{data:t,isLoading:n,error:r,dataUpdatedAt:i}=Qi(pS,{refetchInterval:ns(e)}),{data:a}=zi({},{refetchInterval:ns(e)}),{data:o,isLoading:s}=ji(),c=Zo(15e3),l=lx(t??[]),{sort:u,toggle:d}=Qy(`moadim.client.reliability.sort`,mS),f=ux(l),p=f.sampleSize===0?null:f.successes/f.sampleSize,m=r?.message,h=xx(a??[],t??[],o?.name,Math.floor(c/1e3),pS),g=wx(t??[],Math.floor(c/1e3)),v=kx(t??[]),y=Nx(t??[],l,Math.floor(c/1e3)),b=Vx(t??[],Math.floor(c/1e3),pS),[x,S]=(0,_.useState)(nS),C=oS(t??[],Math.floor(c/1e3),x,pS);return(0,z.jsxs)(`div`,{className:`page`,children:[(0,z.jsxs)(`div`,{className:`section-hd`,children:[(0,z.jsx)(`h1`,{className:`page-title`,children:`Reliability`}),(0,z.jsx)(`div`,{className:`section-acts`,children:(0,z.jsx)(cs,{updatedAtMs:i})})]}),(0,z.jsxs)(`div`,{className:`stats`,children:[(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FLEET SUCCESS RATE`}),(0,z.jsx)(`div`,{className:`stat-val`,children:mx(p)})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FAILING`}),(0,z.jsx)(`div`,{className:f.failingCount>0?`stat-val c-red`:`stat-val`,children:f.failingCount})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FLAKY`}),(0,z.jsx)(`div`,{className:f.flakyCount>0?`stat-val c-amber`:`stat-val`,children:f.flakyCount})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FLEET P50`}),(0,z.jsx)(`div`,{className:`stat-val stat-val-sm`,children:gS(f.p50Secs)})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`FLEET P95`}),(0,z.jsx)(`div`,{className:`stat-val stat-val-sm`,children:gS(f.p95Secs)})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`OVERRUNNING`}),(0,z.jsx)(`div`,{className:y.overruns.length>0?`stat-val c-red`:`stat-val`,children:y.overruns.length})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`SLOWER TREND`}),(0,z.jsx)(`div`,{className:f.regressingCount>0?`stat-val c-amber`:`stat-val`,children:f.regressingCount})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`BUDGET EXHAUSTED`}),(0,z.jsx)(`div`,{className:C.exhaustedCount>0?`stat-val c-red`:`stat-val`,children:C.exhaustedCount})]})]}),!m&&!n&&(0,z.jsx)(Px,{report:y}),!m&&!n&&!s&&(0,z.jsx)(Cx,{adherence:h}),!m&&!n&&(0,z.jsx)(Ex,{report:g}),!m&&!n&&(0,z.jsx)(jx,{report:v}),!m&&!n&&(0,z.jsx)(dS,{report:C,target:x,onTargetChange:e=>{S(e),rS(e)}}),!m&&!n&&(0,z.jsx)(qx,{report:b}),m?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:m})]})}):n?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):l.length===0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`✓`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO FINISHED RUNS YET`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`reliability metrics need at least one success or failure`})]})}):(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(qy,{label:`ROUTINE`,col:`routine`,sort:u,defaultDir:`asc`,onSort:d}),(0,z.jsx)(qy,{label:`STREAK`,col:`streak`,sort:u,defaultDir:`asc`,onSort:d}),(0,z.jsx)(qy,{label:`SUCCESS RATE`,col:`rate`,sort:u,defaultDir:`asc`,onSort:d}),(0,z.jsx)(qy,{label:`P50`,col:`p50`,sort:u,defaultDir:`desc`,onSort:d}),(0,z.jsx)(qy,{label:`P95`,col:`p95`,sort:u,defaultDir:`desc`,onSort:d}),(0,z.jsx)(qy,{label:`TREND`,col:`trend`,sort:u,defaultDir:`desc`,onSort:d})]})}),(0,z.jsx)(`tbody`,{children:Yy(l,u,hS).map(e=>(0,z.jsx)(vS,{item:e},e.routineId))})]})})]})}function vS({item:e}){return(0,z.jsxs)(`tr`,{children:[(0,z.jsxs)(`td`,{children:[(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.routineTitle}),tx(e)?(0,z.jsxs)(`span`,{className:`run-status running`,title:`Alternating pass/fail over the recent sample`,children:[` `,`FLAKY`]}):null]}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:dx(e.streak),children:fx(e.streak)})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:px(ex(e)),children:mx(ex(e))})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:`cell-meta`,children:gS(e.p50Secs)})}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:`cell-meta`,children:gS(e.p95Secs)})}),(0,z.jsx)(`td`,{children:e.regressing?(0,z.jsx)(`span`,{className:`run-status failed`,title:`Recent runs are meaningfully slower than the baseline`,children:`SLOWER`}):(0,z.jsx)(`span`,{className:`cell-meta`,children:`—`})})]})}var yS={unregistered:0,"cli-missing":1,"setup-missing":2,ok:3,unused:4};function bS(e,t,n){return n.length===0?`unused`:!t.has(e)||n.some(e=>!e.agent_registered)?`unregistered`:n.some(e=>!e.agent_command_available)?`cli-missing`:n.some(e=>!e.agent_setup_available)?`setup-missing`:`ok`}function xS(e,t,n){let r=new Set(e);return[...new Set([...e,...t.map(e=>e.agent)])].map(e=>{let i=t.filter(t=>t.agent===e),a=new Set(i.map(e=>e.id)),o=n.filter(e=>a.has(e.routine_id)),s=o.filter(e=>e.status===`success`||e.status===`failed`),c=s.flatMap(e=>e.finished_at!=null&&e.finished_at>=e.started_at?[e.finished_at-e.started_at]:[]).sort((e,t)=>e-t),l=o.reduce((e,t)=>e===null||t.started_at>e.started_at?t:e,null);return{name:e,health:bS(e,r,i),routines:i.map(e=>({id:e.id,title:e.title})).sort((e,t)=>e.title.localeCompare(t.title)),total:i.length,enabled:i.filter(e=>e.enabled).length,runningNow:i.filter(e=>e.is_running).length,models:[...new Set(i.map(e=>e.model?.trim()??``).filter(e=>e!==``))].sort(),successCount:s.filter(e=>e.status===`success`).length,finishedCount:s.length,p50Secs:ax(c,.5),lastRun:l?{label:l.started_at_local,status:l.status}:null}}).sort((e,t)=>yS[e.health]-yS[t.health]||t.total-e.total||e.name.localeCompare(t.name))}function SS(e){return e.finishedCount===0?null:e.successCount/e.finishedCount}function CS(e){return e===`unregistered`||e===`cli-missing`||e===`setup-missing`}function wS(e){switch(e){case`unregistered`:return{label:`UNREGISTERED`,className:`run-status failed`,title:`Not in this daemon's agent registry`};case`cli-missing`:return{label:`CLI MISSING`,className:`run-status failed`,title:`The agent's command is not on the daemon PATH`};case`setup-missing`:return{label:`SETUP MISSING`,className:`run-status running`,title:`The agent's setup tool is not on the daemon PATH`};case`ok`:return{label:`OK`,className:`run-status success`,title:`Registered, and its command resolves on PATH`};case`unused`:return{label:`UNUSED`,className:`cell-meta`,title:`Registered, but no routine targets it`}}}var TS=300;function ES(){let e=ns(os()),t=Pi(),n=zi({},{refetchInterval:e}),r=Qi(TS,{refetchInterval:e}),i=(0,_.useMemo)(()=>xS(t.data??[],n.data??[],r.data??[]),[t.data,n.data,r.data]),a=t.isLoading||n.isLoading||r.isLoading,o=t.error?.message??n.error?.message??r.error?.message,s=Math.min(t.dataUpdatedAt||1/0,n.dataUpdatedAt||1/0,r.dataUpdatedAt||1/0),c=i.filter(e=>CS(e.health)),l=c.reduce((e,t)=>e+t.enabled,0);return(0,z.jsxs)(`div`,{className:`page`,children:[(0,z.jsxs)(`div`,{className:`section-hd`,children:[(0,z.jsx)(`h1`,{className:`page-title`,children:`Agents`}),(0,z.jsx)(`div`,{className:`section-acts`,children:(0,z.jsx)(cs,{updatedAtMs:Number.isFinite(s)?s:0})})]}),(0,z.jsxs)(`div`,{className:`stats`,children:[(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`AGENTS`}),(0,z.jsx)(`div`,{className:`stat-val`,children:i.length})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`UNHEALTHY`}),(0,z.jsx)(`div`,{className:c.length>0?`stat-val c-red`:`stat-val`,children:c.length})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`ENABLED ROUTINES BLOCKED`}),(0,z.jsx)(`div`,{className:l>0?`stat-val c-red`:`stat-val`,children:l})]})]}),o?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:o})]})}):a?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):i.length===0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`🤖`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO AGENTS YET`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`the agent registry is empty and no routine targets an agent`})]})}):(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`AGENT`}),(0,z.jsx)(`th`,{children:`HEALTH`}),(0,z.jsx)(`th`,{children:`ROUTINES`}),(0,z.jsx)(`th`,{children:`ENABLED`}),(0,z.jsx)(`th`,{children:`RUNNING NOW`}),(0,z.jsx)(`th`,{children:`MODELS`}),(0,z.jsx)(`th`,{children:`SUCCESS RATE`}),(0,z.jsx)(`th`,{children:`P50`}),(0,z.jsx)(`th`,{children:`LAST ACTIVITY`})]})}),(0,z.jsx)(`tbody`,{children:i.map(e=>(0,z.jsx)(DS,{a:e},e.name))})]})})]})}function DS({a:e}){let t=wS(e.health);return(0,z.jsxs)(`tr`,{children:[(0,z.jsxs)(`td`,{children:[e.total>0?(0,z.jsx)(En,{to:`/routines?agent=${encodeURIComponent(e.name)}`,children:e.name}):e.name,e.routines.length>0?(0,z.jsxs)(`details`,{children:[(0,z.jsxs)(`summary`,{className:`cell-meta`,children:[e.routines.length,` routine`,e.routines.length===1?``:`s`]}),(0,z.jsx)(`ul`,{children:e.routines.map(e=>(0,z.jsx)(`li`,{children:(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.id)}`,children:e.title})},e.id))})]}):null]}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:t.className,title:t.title,children:t.label})}),(0,z.jsx)(`td`,{children:e.total}),(0,z.jsx)(`td`,{children:e.enabled}),(0,z.jsx)(`td`,{className:e.runningNow>0?`c-accent`:void 0,children:e.runningNow}),(0,z.jsx)(`td`,{className:`cell-meta`,children:e.models.length>0?e.models.join(`, `):`default`}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:px(SS(e)),children:mx(SS(e))})}),(0,z.jsx)(`td`,{className:`cell-meta`,children:e.p50Secs===null?`—`:Os(0,e.p50Secs)}),(0,z.jsx)(`td`,{children:e.lastRun?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:Es(e.lastRun.status),children:Ds(e.lastRun.status)}),` `,(0,z.jsx)(`span`,{className:`cell-meta`,children:e.lastRun.label})]}):(0,z.jsx)(`span`,{className:`cell-meta`,children:`—`})})]})}function OS(e,t,n,r,i){return e.map(e=>{let a=t.filter(t=>(t.machines??[]).includes(e)),o=new Set(a.map(e=>e.id)),s=n.filter(e=>o.has(e.routine_id)),c=s.filter(e=>e.status===`success`||e.status===`failed`),l=s.reduce((e,t)=>e===null||t.started_at>e.started_at?t:e,null);return{name:e,isCurrent:e===r,routines:a.map(e=>({id:e.id,title:e.title})).sort((e,t)=>e.title.localeCompare(t.title)),total:a.length,enabled:a.filter(e=>e.enabled).length,runningNow:a.filter(e=>e.is_running).length,powerSaving:a.filter(e=>e.power_saving).length,needsAttention:a.filter(e=>{let t=wc(e,i);return t===`agent-missing`||t===`dead-schedule`}).length,successCount:c.filter(e=>e.status===`success`).length,finishedCount:c.length,lastRun:l?{label:l.started_at_local,status:l.status}:null}})}function kS(e){return e.finishedCount===0?null:e.successCount/e.finishedCount}function AS(e){return e.filter(e=>(e.machines??[]).every(e=>e.trim()===``)).length}var jS=300;function MS(){let e=ns(os()),t=Mi(),n=ji(),r=zi({},{refetchInterval:e}),i=Qi(jS,{refetchInterval:e}),a=(0,_.useMemo)(()=>r.data??[],[r.data]),o=(0,_.useMemo)(()=>i.data??[],[i.data]),s=(0,_.useMemo)(()=>[...new Set([...t.data??[],...Oc(a)])].sort(),[t.data,a]),c=(0,_.useMemo)(()=>OS(s,a,o,n.data?.name,new Date),[s,a,o,n.data?.name]),l=t.isLoading||r.isLoading||i.isLoading,u=t.error?.message??r.error?.message??i.error?.message,d=Math.min(t.dataUpdatedAt||1/0,r.dataUpdatedAt||1/0,i.dataUpdatedAt||1/0),f=AS(a),p=c.reduce((e,t)=>e+t.runningNow,0);return(0,z.jsxs)(`div`,{className:`page`,children:[(0,z.jsxs)(`div`,{className:`section-hd`,children:[(0,z.jsx)(`h1`,{className:`page-title`,children:`Machines`}),(0,z.jsx)(`div`,{className:`section-acts`,children:(0,z.jsx)(cs,{updatedAtMs:Number.isFinite(d)?d:0})})]}),(0,z.jsxs)(`div`,{className:`stats`,children:[(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`MACHINES`}),(0,z.jsx)(`div`,{className:`stat-val`,children:s.length})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`RUNNING NOW`}),(0,z.jsx)(`div`,{className:p>0?`stat-val c-accent`:`stat-val`,children:p})]}),(0,z.jsxs)(`div`,{className:`stat-card`,children:[(0,z.jsx)(`div`,{className:`stat-label`,children:`UNASSIGNED ROUTINES`}),(0,z.jsx)(`div`,{className:f>0?`stat-val c-amber`:`stat-val`,children:f})]})]}),u?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:u})]})}):l?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsx)(`div`,{className:`empty`,children:(0,z.jsx)(`div`,{className:`spinner`})})}):c.length===0?(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`div`,{className:`empty`,children:[(0,z.jsx)(`div`,{className:`empty-icon`,children:`🖥`}),(0,z.jsx)(`div`,{className:`empty-msg`,children:`NO MACHINES YET`}),(0,z.jsx)(`div`,{className:`empty-sub`,children:`no routine targets a machine, and this daemon has no resolved identity`})]})}):(0,z.jsx)(`div`,{className:`table-wrap`,children:(0,z.jsxs)(`table`,{children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:`MACHINE`}),(0,z.jsx)(`th`,{children:`ROUTINES`}),(0,z.jsx)(`th`,{children:`ENABLED`}),(0,z.jsx)(`th`,{children:`RUNNING NOW`}),(0,z.jsx)(`th`,{children:`POWER SAVING`}),(0,z.jsx)(`th`,{children:`ATTENTION`}),(0,z.jsx)(`th`,{children:`SUCCESS RATE`}),(0,z.jsx)(`th`,{children:`LAST ACTIVITY`})]})}),(0,z.jsx)(`tbody`,{children:c.map(e=>(0,z.jsx)(NS,{m:e},e.name))})]})})]})}function NS({m:e}){return(0,z.jsxs)(`tr`,{children:[(0,z.jsxs)(`td`,{children:[e.name,e.isCurrent?(0,z.jsx)(`span`,{className:`cell-meta`,children:` (this machine)`}):null,e.routines.length>0?(0,z.jsxs)(`details`,{children:[(0,z.jsxs)(`summary`,{className:`cell-meta`,children:[e.routines.length,` routine`,e.routines.length===1?``:`s`]}),(0,z.jsx)(`ul`,{children:e.routines.map(e=>(0,z.jsx)(`li`,{children:(0,z.jsx)(En,{to:`/routines?history=${encodeURIComponent(e.id)}`,children:e.title})},e.id))})]}):null]}),(0,z.jsx)(`td`,{children:e.total}),(0,z.jsx)(`td`,{children:e.enabled}),(0,z.jsx)(`td`,{className:e.runningNow>0?`c-accent`:void 0,children:e.runningNow}),(0,z.jsx)(`td`,{children:e.powerSaving}),(0,z.jsx)(`td`,{className:e.needsAttention>0?`c-red`:`cell-meta`,children:e.needsAttention||`—`}),(0,z.jsx)(`td`,{children:(0,z.jsx)(`span`,{className:px(kS(e)),children:mx(kS(e))})}),(0,z.jsx)(`td`,{children:e.lastRun?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:Es(e.lastRun.status),children:Ds(e.lastRun.status)}),` `,(0,z.jsx)(`span`,{className:`cell-meta`,children:e.lastRun.label})]}):(0,z.jsx)(`span`,{className:`cell-meta`,children:`—`})})]})}function PS({health:e,loading:t,retrying:n,onRefresh:r,onRetry:i}){let a=e?.crontab_sync;return t&&!a?(0,z.jsx)(`p`,{className:`settings-card-copy`,children:`Checking OS crontab sync…`}):a?a.ok?(0,z.jsxs)(`div`,{className:`settings-health settings-health-ok`,children:[(0,z.jsx)(`div`,{className:`settings-health-main`,children:`OS crontab sync is healthy`}),(0,z.jsx)(`p`,{className:`settings-card-copy`,children:`Scheduled routine changes are installed in the OS crontab.`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]}):(0,z.jsxs)(`div`,{className:`settings-health settings-health-warn`,children:[(0,z.jsx)(`div`,{className:`settings-health-main`,children:`⚠ OS crontab sync needs attention`}),(0,z.jsx)(`p`,{className:`settings-card-copy`,children:`Scheduled routine changes may not fire until macOS allows Moadim to write the crontab again.`}),a.last_error&&(0,z.jsx)(`div`,{className:`settings-health-error`,children:a.last_error}),a.last_error_at&&(0,z.jsxs)(`div`,{className:`settings-health-meta`,children:[`Last failed: `,FS(a.last_error_at)]}),(0,z.jsxs)(`ol`,{className:`settings-recovery-list`,"aria-label":`Crontab sync recovery steps`,children:[(0,z.jsx)(`li`,{children:`Open macOS System Settings → Privacy & Security → Full Disk Access.`}),(0,z.jsx)(`li`,{children:`Allow the Moadim daemon or the launcher that starts it.`}),(0,z.jsx)(`li`,{children:`Restart Moadim if you changed permissions, then click Retry sync now.`})]}),(0,z.jsxs)(`div`,{className:`settings-health-actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:n,onClick:i,children:n?`Retrying…`:`Retry sync now`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]})]}):(0,z.jsxs)(`div`,{className:`settings-health settings-health-unknown`,children:[(0,z.jsx)(`div`,{className:`settings-health-main`,children:`Health details unavailable`}),(0,z.jsx)(`p`,{className:`settings-card-copy`,children:`Refresh status once the daemon is reachable.`}),(0,z.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]})}function FS(e){return new Date(e*1e3).toLocaleString()}function IS(){let{addToast:e}=Ka(),t=Fi(),n=Ii(),r=Oi(3e4),i=ki(),a=Li(),o=Ri(),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(rs),[p,m]=(0,_.useState)(Da),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(void 0);t.data!==void 0&&t.data!==v&&(y(t.data),c(t.data),u(t.data));let b=s!==l,[x,S]=(0,_.useState)(void 0);a.data!==void 0&&a.data.override_value!==x&&(S(a.data.override_value),g(a.data.override_value===null?``:String(a.data.override_value)));let C=h!==(x===null?``:String(x??``)),w=h.trim()===``||/^\d+$/.test(h.trim()),T=()=>{let t=h.trim(),n=t===``?null:Number.parseInt(t,10);o.mutate(n,{onSuccess:()=>e(`Concurrency cap saved`,`ok`),onError:t=>e(`Save failed: ${t.message}`,`err`)})},E=()=>{n.mutate(s,{onSuccess:()=>{u(s),e(`Prompt saved`,`ok`)},onError:t=>e(`Save failed: ${t.message}`,`err`)})},D=t=>{is(t),f(t),e(`Refresh cadence saved`,`ok`)},O=t=>{Oa(t),m(t),e(`Theme saved`,`ok`)};return(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`page-title`,children:`Settings`}),(0,z.jsxs)(`div`,{className:`card settings-card`,children:[(0,z.jsx)(`div`,{className:`settings-card-title`,children:`Appearance`}),(0,z.jsx)(`p`,{className:`settings-card-copy`,children:`Choose the app theme. This replaces the header theme toggle so appearance lives with the rest of Settings.`}),(0,z.jsxs)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Theme`,children:[(0,z.jsx)(`button`,{type:`button`,className:`btn ${p?`btn-primary`:`btn-secondary`}`,"aria-pressed":p,onClick:()=>O(!0),children:`Light`}),(0,z.jsx)(`button`,{type:`button`,className:`btn ${p?`btn-secondary`:`btn-primary`}`,"aria-pressed":!p,onClick:()=>O(!1),children:`Dark`})]})]}),(0,z.jsxs)(`div`,{className:`card settings-card`,children:[(0,z.jsx)(`div`,{className:`settings-card-title`,children:`Data refresh`}),(0,z.jsx)(`p`,{className:`settings-card-copy`,children:`Choose how often the app pulls fresh daemon data. The same cadence is used by overview, routines, logs, heatmap, machines, and reliability views.`}),(0,z.jsx)(ss,{token:d,updatedAtMs:0,onChange:D})]}),(0,z.jsxs)(`div`,{className:`card settings-card`,children:[(0,z.jsx)(`div`,{className:`settings-card-title`,children:`Concurrency`}),(0,z.jsxs)(`p`,{className:`settings-card-copy`,children:[`The most routines this daemon will run at once fleet-wide. Extra due routines wait for a slot instead of starting immediately. Takes effect on the next trigger check — no restart required. Leave blank to fall back to the `,(0,z.jsx)(`code`,{children:`MOADIM_MAX_CONCURRENT_RUNS`}),` env var, or the built-in default if that isn't set either.`]}),a.isLoading?(0,z.jsx)(`div`,{children:`Loading…`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`settings-card-copy`,children:[`Effective cap right now:`,` `,(0,z.jsx)(`strong`,{children:a.data?.value===0?`unbounded`:a.data?.value})]}),(0,z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:8},children:[(0,z.jsx)(`input`,{type:`number`,min:0,step:1,className:`form-input`,style:{width:120},placeholder:`unset`,"aria-label":`Max concurrent runs override`,value:h,onChange:e=>g(e.target.value)}),(0,z.jsx)(`button`,{className:`btn btn-primary`,disabled:!C||!w||o.isPending,onClick:T,children:o.isPending?`Saving…`:`Save`}),h.trim()!==``&&(0,z.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,disabled:o.isPending,onClick:()=>g(``),children:`Clear`}),C&&w&&(0,z.jsx)(`span`,{style:{color:`var(--text-faint)`,fontSize:12},children:`unsaved changes`}),!w&&(0,z.jsx)(`span`,{style:{color:`var(--err)`,fontSize:12},children:`must be a whole number ≥ 0`})]})]})]}),(0,z.jsxs)(`div`,{className:`card settings-card settings-health-card`,children:[(0,z.jsx)(`div`,{className:`settings-card-title`,children:`System health`}),(0,z.jsx)(PS,{health:r.data,loading:r.isLoading,retrying:i.isPending,onRefresh:()=>void r.refetch(),onRetry:()=>{i.mutate(void 0,{onSuccess:t=>{t.crontab_sync.ok?e(`Crontab sync recovered`,`ok`):e(`Crontab sync still needs attention`,`err`)},onError:t=>e(`Retry failed: ${t.message}`,`err`)})}})]}),(0,z.jsxs)(`div`,{className:`card`,style:{padding:16},children:[(0,z.jsx)(`div`,{style:{fontWeight:700,marginBottom:4},children:`Persistent prompt`}),(0,z.jsx)(`p`,{style:{color:`var(--text-dim)`,fontSize:13,marginTop:0},children:`Appended to every routine's agent instructions file (CLAUDE.md/AGENTS.md), alongside the moadim-managed preamble, on every run.`}),t.isLoading?(0,z.jsx)(`div`,{children:`Loading…`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`textarea`,{className:`form-textarea`,rows:12,placeholder:"e.g. always run `cargo fmt` before finishing a task",value:s,onChange:e=>c(e.target.value)}),(0,z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:10},children:[(0,z.jsx)(`button`,{className:`btn btn-primary`,disabled:!b||n.isPending,onClick:E,children:n.isPending?`Saving…`:`Save`}),b&&(0,z.jsx)(`span`,{style:{color:`var(--text-faint)`,fontSize:12},children:`unsaved changes`})]})]})]})]})}function LS(){return(0,z.jsx)(zt,{children:(0,z.jsxs)(Lt,{element:(0,z.jsx)(Yo,{}),children:[(0,z.jsx)(Lt,{index:!0,element:(0,z.jsx)(Bs,{})}),(0,z.jsx)(Lt,{path:`routines`,element:(0,z.jsx)(Sy,{})}),(0,z.jsx)(Lt,{path:`runs`,element:(0,z.jsx)(sb,{})}),(0,z.jsx)(Lt,{path:`runs/:routineId/:workbench`,element:(0,z.jsx)(gb,{})}),(0,z.jsx)(Lt,{path:`heatmap`,element:(0,z.jsx)(Yb,{})}),(0,z.jsx)(Lt,{path:`reliability`,element:(0,z.jsx)(_S,{})}),(0,z.jsx)(Lt,{path:`machines`,element:(0,z.jsx)(MS,{})}),(0,z.jsx)(Lt,{path:`agents`,element:(0,z.jsx)(ES,{})}),(0,z.jsx)(Lt,{path:`settings`,element:(0,z.jsx)(IS,{})}),(0,z.jsx)(Lt,{path:`*`,element:(0,z.jsx)(Ft,{to:`/`,replace:!0})})]})})}function RS(){return(0,z.jsx)(Ga,{children:(0,z.jsx)(LS,{})})}var zS=new qr({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),BS=document.getElementById(`root`);if(!BS)throw Error(`#root element missing`);(0,ci.createRoot)(BS).render((0,z.jsx)(_.StrictMode,{children:(0,z.jsx)(Vn,{client:zS,children:(0,z.jsx)(Tn,{children:(0,z.jsx)(RS,{})})})}));</script>
    <style rel="stylesheet" crossorigin>.machine-filter{max-width:100%;position:relative}.machine-filter summary{cursor:pointer;overflow-wrap:anywhere}.machine-filter-options{z-index:20;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);width:min(280px,80vw);max-height:320px;box-shadow:var(--shadow);margin:4px 0 0;padding:12px;position:absolute;top:100%;left:0;overflow:auto}.machine-filter-options legend{background:var(--surface);padding:0 4px;font-size:12px}.machine-filter-options label{overflow-wrap:anywhere;align-items:center;gap:8px;min-height:44px;display:flex}.machine-filter-options input{flex-shrink:0}:root,html.theme-light{--bg:#f4f1e8;--surface:#fff;--surface-2:#f9f5df;--border:#0a0a0a;--border-strong:#0a0a0a;--text:#0a0a0a;--text-dim:#332f24;--text-faint:#5f5744;--accent:#ffd400;--accent-ink:#0a0a0a;--ok:#16833a;--ok-bg:#dff8e7;--err:#d02f21;--err-bg:#ffe0db;--warn:#9f6800;--warn-bg:#fff0b8;--sans:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;--mono:"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;--radius:0;--shadow:6px 6px 0 0 var(--border);--shadow-lg:10px 10px 0 0 var(--border);--shadow-hover:8px 8px 0 0 var(--border);--shadow-active:2px 2px 0 0 var(--border);--grid-line:color-mix(in srgb, var(--text) 6%, var(--bg));--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}html:not(.theme-light){--bg:#0a0a0a;--surface:#181818;--surface-2:#24210e;--border:#f4f1e8;--border-strong:#f4f1e8;--text:#f4f1e8;--text-dim:#d8d0bb;--text-faint:#a89f88;--accent:#ffd400;--accent-ink:#0a0a0a;--ok:#7ee68f;--ok-bg:#102515;--err:#ff7a68;--err-bg:#2d130f;--warn:#ffd400;--warn-bg:#2a2200;--grid-line:color-mix(in srgb, var(--text) 9%, var(--bg));--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body,#root{height:100%}body{background:var(--bg);color:var(--text);font-family:var(--sans);-webkit-font-smoothing:antialiased;margin:0;font-size:14px;line-height:1.5;overflow-x:hidden}a{color:inherit}button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}.app-shell{flex-direction:column;min-height:100%;display:flex}.app-header{border-bottom:1px solid var(--border);background:var(--surface);align-items:center;gap:16px;padding:12px 20px;display:flex}.brand{letter-spacing:.02em;font-size:15px;font-weight:700}.brand-sub{color:var(--text-faint);margin-left:6px;font-weight:500}.header-spacer{flex:1}.header-right{align-items:center;gap:10px;display:flex}.dep-warn{border-radius:var(--radius);background:var(--warn-bg);color:var(--warn);padding:3px 8px;font-size:12px;font-weight:600}.health{color:var(--text-dim);align-items:center;gap:6px;font-size:12px;display:flex}.health-dot{background:var(--text-faint);border-radius:50%;width:8px;height:8px}.health-dot.ok{background:var(--ok)}.health-dot.error{background:var(--err)}.machine-badge,.icon-btn{border:1px solid var(--border);background:var(--surface);border-radius:var(--radius);cursor:pointer;padding:6px 10px;font-size:12px;font-weight:600}.machine-badge:hover,.icon-btn:hover{border-color:var(--border-strong)}.icon-btn.danger{color:var(--err);border-color:var(--err)}.icon-btn.danger:disabled{opacity:.4;cursor:not-allowed}.notif-root,.notif-bell{position:relative}.notif-badge{background:var(--err);color:#fff;text-align:center;border-radius:999px;min-width:16px;height:16px;padding:0 4px;font-size:10px;font-weight:700;line-height:16px;position:absolute;top:-6px;right:-6px}.notif-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);width:320px;max-height:420px;box-shadow:var(--shadow);z-index:150;flex-direction:column;display:flex;position:absolute;top:calc(100% + 6px);right:0}.notif-panel-hd{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:10px 12px;display:flex}.notif-panel-title{letter-spacing:.04em;color:var(--text-dim);font-size:11px;font-weight:700}.notif-panel-acts{gap:4px;display:flex}.notif-empty{text-align:center;color:var(--text-faint);padding:24px 12px;font-size:13px}.notif-list{margin:0;padding:4px;list-style:none;overflow-y:auto}.notif-item a{border-radius:var(--radius);color:inherit;flex-direction:column;gap:2px;padding:8px 10px;text-decoration:none;display:flex}.notif-item a:hover{background:var(--surface-2)}.notif-item.unread a{background:var(--err-bg)}.notif-item-title{font-size:13px;font-weight:700}.notif-item-msg{color:var(--text-dim);font-size:12px}.notif-item-time{color:var(--text-faint);font-size:11px}.app-nav{border-bottom:1px solid var(--border);background:var(--surface);gap:4px;padding:0 20px;display:flex}.nav-link{color:var(--text-dim);border-bottom:2px solid #0000;padding:10px 12px;font-size:13px;font-weight:600;text-decoration:none}.nav-link:hover{color:var(--text)}.nav-link.active{color:var(--accent);border-bottom-color:var(--accent)}.page{flex:1;width:100%;max-width:1200px;margin:0 auto;padding:24px 20px 60px}.page-title{margin:0 0 16px;font-size:20px;font-weight:700}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}.btn{border-radius:var(--radius);border:1px solid var(--border-strong);background:var(--surface);cursor:pointer;padding:7px 14px;font-size:13px;font-weight:600}.btn:hover{border-color:var(--accent)}.btn-danger{background:var(--err);border-color:var(--err);color:#fff}.btn-ghost{background:0 0;border-color:#0000}.btn:disabled{opacity:.5;cursor:not-allowed}.overlay{z-index:100;background:#14130f66;justify-content:center;align-items:flex-start;padding-top:12vh;display:flex;position:fixed;inset:0}.dialog{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);min-width:340px;max-width:90vw;padding:20px}.dialog-title{margin-bottom:8px;font-weight:700}.dialog-msg{color:var(--text-dim);margin-bottom:16px;font-size:13px}.dialog-actions{justify-content:flex-end;gap:8px;display:flex}.move-dialog{border:4px solid var(--border-strong);box-shadow:8px 8px 0 var(--border-strong);gap:14px;width:min(680px,92vw);padding:0;display:grid}.move-dialog-hd{background:var(--accent);border-bottom:4px solid var(--border-strong);color:var(--accent-ink);justify-content:space-between;align-items:flex-start;gap:16px;padding:16px 18px;display:flex}.move-dialog-title{letter-spacing:.08em;margin-bottom:4px;font-size:18px;font-weight:950}.move-dialog-sub{letter-spacing:.04em;text-transform:uppercase;font-size:12px;font-weight:800}.move-dialog-badge,.move-current-label,.move-preview-label{letter-spacing:.1em;text-transform:uppercase;font-size:11px;font-weight:950}.move-dialog-badge{background:var(--surface);border:3px solid var(--border-strong);color:var(--text);padding:5px 9px}.move-current-card,.move-path-grid,.move-preview,.move-dialog-actions{margin-left:18px;margin-right:18px}.move-current-card,.move-preview{background:var(--surface-2);border:3px solid var(--border-strong);box-shadow:4px 4px 0 var(--border-strong);padding:12px}.move-current-label,.move-preview-label{color:var(--text-faint);margin-bottom:8px}.move-current-row{align-items:center;gap:10px;display:flex}.move-current-copy{gap:2px;min-width:0;display:grid}.move-current-copy strong{text-overflow:ellipsis;white-space:nowrap;font-weight:950;overflow:hidden}.move-current-copy span,.move-preview-path{color:var(--text-dim);font-family:var(--mono);overflow-wrap:anywhere;font-size:12px}.move-path-grid{grid-template-columns:minmax(0,1fr) minmax(180px,.7fr);gap:12px;display:grid}.move-form-group{margin:0}.move-input{font-family:var(--mono);border-width:3px;font-weight:700}.move-preview{margin-bottom:2px}.move-dialog-actions{border-top:3px solid var(--border-strong);padding:14px 0 18px}.shortcuts-dialog{width:360px}.shortcuts-list{flex-direction:column;gap:10px;margin:0 0 16px;padding:0;list-style:none;display:flex}.shortcuts-list li{align-items:center;gap:6px;font-size:13px;display:flex}.shortcuts-list li>span:last-child{color:var(--text-dim);margin-left:6px}.form-label{color:var(--text-dim);letter-spacing:.02em;margin-bottom:6px;font-size:12px;font-weight:700;display:block}.form-input,.form-textarea,.form-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);width:100%;padding:8px 10px;font-size:13px}.form-textarea{font-family:var(--mono);resize:vertical}.toast-wrap{z-index:200;flex-direction:column;gap:8px;display:flex;position:fixed;bottom:16px;right:16px}.toast{border-radius:var(--radius);box-shadow:var(--shadow);padding:10px 14px;font-size:13px;font-weight:600}.toast.ok{background:var(--ok-bg);color:var(--ok)}.toast.err{background:var(--err-bg);color:var(--err)}.cmdk{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);width:560px;max-width:92vw;box-shadow:var(--shadow);overflow:hidden}.cmdk-search{border-bottom:1px solid var(--border);align-items:center;gap:8px;padding:12px 14px;display:flex}.cmdk-input{background:0 0;border:none;outline:none;flex:1;font-size:14px}.cmdk-hint{color:var(--text-faint);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:11px}.cmdk-list{max-height:50vh;margin:0;padding:6px;list-style:none;overflow-y:auto}.cmdk-row{border-radius:var(--radius);cursor:pointer;align-items:center;gap:10px;padding:8px 10px;display:flex}.cmdk-row.active{background:var(--surface-2)}.kind-badge{background:var(--surface-2);color:var(--text-dim);border-radius:4px;flex-shrink:0;padding:2px 6px;font-size:10px;font-weight:700}.cmdk-row-text{flex-direction:column;flex:1;min-width:0;display:flex}.cmdk-row-action{opacity:0;flex-shrink:0}.cmdk-row:hover .cmdk-row-action,.cmdk-row.active .cmdk-row-action{opacity:1}.cmdk-row-title{font-size:13px;font-weight:600}.cmdk-row-sub{color:var(--text-faint);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.cmdk-empty{text-align:center;color:var(--text-faint);padding:24px}.cmdk-foot{border-top:1px solid var(--border);color:var(--text-faint);gap:14px;padding:8px 14px;font-size:11px;display:flex}.cmdk-key{border:1px solid var(--border);border-radius:4px;margin-right:3px;padding:0 4px}.stats{grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin-bottom:20px;display:grid}.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}.stat-card-wide{grid-column:span 2}.stat-label{letter-spacing:.04em;color:var(--text-faint);margin-bottom:6px;font-size:11px;font-weight:700}.stat-val{color:var(--text);font-size:24px;font-weight:700}.stat-val-sm{font-size:16px}.c-accent{color:var(--accent)}.c-red{color:var(--err)}.c-amber{color:var(--warn)}.section-hd{justify-content:space-between;align-items:center;margin:24px 0 8px;display:flex}.section-label{letter-spacing:.05em;color:var(--text-dim);font-size:12px;font-weight:700}.section-label.attn{color:var(--err)}.section-acts{align-items:center;gap:10px;display:flex}.table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow-x:auto}.table-wrap table{border-collapse:collapse;width:100%;font-size:13px}.table-wrap th{text-align:left;letter-spacing:.04em;color:var(--text-faint);border-bottom:1px solid var(--border);white-space:nowrap;padding:10px 14px;font-size:11px;font-weight:700}.table-wrap td{border-bottom:1px solid var(--border);vertical-align:middle;padding:10px 14px}.table-wrap tbody tr:last-child td{border-bottom:none}.table-wrap tbody tr:hover{background:var(--surface-2)}.empty{text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:36px 14px;display:flex}.empty-icon{color:var(--text-faint);font-size:22px}.empty-msg{letter-spacing:.04em;color:var(--text-dim);font-size:12px;font-weight:700}.empty-sub{color:var(--text-faint);font-size:12px}.spinner{border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;width:20px;height:20px;animation:.7s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.ov-name-link{font-weight:600;text-decoration:none}.ov-name-link:hover{color:var(--accent);text-decoration:underline}.ov-flag-badge{color:var(--warn);background:var(--warn-bg);border-radius:4px;margin-left:8px;padding:1px 6px;font-size:11px;font-weight:700}.kind-badge.routine{background:var(--surface-2);color:var(--text-dim)}.attn-badge{color:var(--err);background:var(--err-bg);letter-spacing:.02em;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:700}.attn-detail,.cell-schedule-human,.cell-time,.cell-meta{color:var(--text-dim)}.cell-next-when{font-weight:600}.cell-next-until{color:var(--text-faint);font-size:12px}.cell-next-until.soon{color:var(--err);font-weight:600}.cell-act{text-align:right}.btn-sm{padding:4px 10px;font-size:12px}.run-now-btn{border:1px solid var(--border-strong)}.refresh-control{align-items:center;gap:8px;display:flex}.refresh-lbl{letter-spacing:.04em;color:var(--text-faint);font-size:11px;font-weight:700}.refresh-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:5px 8px;font-size:12px}.refresh-fresh{color:var(--text-faint);font-size:11px}.settings-card{gap:8px;margin-bottom:16px;padding:16px;display:grid}.settings-card-title{font-weight:700}.settings-card-copy{color:var(--text-dim);max-width:70ch;margin:0;font-size:13px}.settings-segmented{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.settings-health{border:1px solid var(--border);border-radius:var(--radius);gap:8px;padding:12px;display:grid}.settings-health-ok{background:color-mix(in srgb, var(--ok) 10%, var(--surface));border-color:color-mix(in srgb, var(--ok) 45%, var(--border))}.settings-health-warn{background:color-mix(in srgb, var(--warn) 12%, var(--surface));border-color:color-mix(in srgb, var(--warn) 55%, var(--border))}.settings-health-unknown{background:var(--surface-2)}.settings-health-main{font-weight:700}.settings-health-error{font-family:var(--mono);overflow-wrap:anywhere;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px;font-size:12px}.settings-health-meta{color:var(--text-faint);font-size:12px}.settings-recovery-list{color:var(--text-dim);margin:0;padding-left:20px;font-size:13px}.settings-health-actions{flex-wrap:wrap;gap:8px;display:flex}.hm-hd{justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;display:flex}.hm-hd-acts{align-items:center;gap:14px;display:flex}.hm-filter{gap:4px;display:flex}.hm-filter-btn{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);cursor:pointer;color:var(--text-dim);padding:5px 12px;font-size:12px;font-weight:600}.hm-filter-btn:hover{border-color:var(--accent);color:var(--text)}.hm-filter-btn.active{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.hm-grid-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px;overflow-x:auto}.hm-grid{grid-template-columns:64px repeat(24,minmax(26px,1fr)) 44px;gap:3px;min-width:760px;display:grid}.hm-corner,.hm-hcol{letter-spacing:.03em;color:var(--text-faint);text-align:center;padding:4px 0;font-size:10px;font-weight:700}.hm-corner{text-align:left}.hm-hcol.now{color:var(--accent)}.hm-daylabel{color:var(--text-dim);text-align:left;cursor:pointer;border-radius:var(--radius);background:0 0;border:none;padding:0 6px;font-size:11px;font-weight:700}.hm-daylabel:hover{color:var(--accent);background:var(--surface-2)}.hm-daylabel.today{color:var(--accent)}.hm-daylabel.hm-foot{cursor:default;color:var(--text-faint);border-top:1px solid var(--border);padding-top:6px;font-weight:700}.hm-daylabel.hm-foot:hover{color:var(--text-faint);background:0 0}.hm-cell{border:1px solid var(--border);background:var(--surface-2);aspect-ratio:1;cursor:pointer;border-radius:3px;justify-content:center;align-items:center;min-height:22px;padding:0;display:flex}.hm-cell:hover{border-color:var(--accent)}.hm-cell.now{border-color:var(--accent);border-width:2px}.hm-cell.peak{box-shadow:0 0 0 2px var(--accent) inset}.hm-n{color:var(--text);font-size:10px;font-weight:700}.hm-rowtot{color:var(--text-faint);text-align:center;padding:2px 0;font-size:11px}.hm-rowtot.hm-foot{border-top:1px solid var(--border);color:var(--text-dim);padding-top:6px;font-weight:700}.hm-rowtot.grand{color:var(--accent)}.hm-legend{color:var(--text-faint);align-items:center;gap:6px;margin-top:12px;font-size:11px;display:flex}.hm-legend-label{letter-spacing:.03em;font-weight:700}.hm-legend-swatch{aspect-ratio:auto;cursor:default;border-radius:3px;width:14px;height:14px;min-height:0}.hm-legend-note{margin-left:8px}.hm-day{margin-top:20px;padding:16px}.hm-day-nav{align-items:center;gap:8px;margin-bottom:12px;display:flex}.hm-day-title{letter-spacing:.03em;font-size:13px;font-weight:700}.hm-day-spacer{flex:1}.hm-day-hours{flex-direction:column;gap:2px;max-height:520px;display:flex;overflow-y:auto}.hm-day-hour{border-bottom:1px solid var(--border);grid-template-columns:56px 1fr;gap:10px;padding:4px 6px;display:grid}.hm-day-hour.now{background:var(--surface-2);border-radius:var(--radius)}.hm-day-hour-label{color:var(--text-faint);padding-top:3px;font-size:11px}.hm-day-hour-slot{flex-wrap:wrap;gap:6px;display:flex}.hm-day-chip{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);align-items:center;gap:6px;padding:3px 8px;font-size:12px;display:flex}.hm-day-chip.snoozed{opacity:.55}.hm-day-chip-time{font-family:var(--mono);color:var(--text-dim);font-size:11px}.hm-day-chip-label{font-weight:600}.hm-day-chip-flag{color:var(--warn);font-size:11px}.filter-bar{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px 14px;margin-bottom:12px;padding:12px 14px;display:flex}.filter-field{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.filter-label{letter-spacing:.03em;color:var(--text-faint);font-size:11px;font-weight:700}.filter-input,.filter-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:6px 9px;font-size:12px}.filter-input{min-width:200px}.filter-count{color:var(--text-faint);font-size:12px}.saved-views-bar{margin-top:-4px}.group-by-ctrl{letter-spacing:.03em;color:var(--text-faint);align-items:center;gap:6px;font-size:11px;font-weight:700;display:flex}.view-toggle{border:1px solid var(--border-strong);border-radius:var(--radius);display:flex;overflow:hidden}.view-btn{background:var(--surface);color:var(--text-dim);cursor:pointer;border:none;padding:6px 10px;font-size:12px;font-weight:600}.view-btn+.view-btn{border-left:1px solid var(--border-strong)}.view-btn.active{background:var(--accent);color:var(--accent-ink)}.notify-toggle.active{border-color:var(--accent);color:var(--accent)}.btn-refresh{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);cursor:pointer;width:26px;height:26px;font-size:14px;line-height:1}.btn-refresh:hover{border-color:var(--accent)}.btn-refresh:disabled{opacity:.4;cursor:not-allowed}.stat-card{cursor:pointer;text-align:left;font:inherit;color:inherit}.stat-card.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.stat-card.has-dormant .stat-val,.stat-card.has-flags .stat-val,.stat-card.has-unreg .stat-val,.stat-card.has-auto-disabled .stat-val{color:var(--warn)}.col-select{width:28px}.routine-table{table-layout:fixed;min-width:1180px}.routine-table th,.routine-table td{padding-left:10px;padding-right:10px}.routine-table th{white-space:normal;line-height:1.1}.routine-table td{overflow-wrap:anywhere}.routine-table th:first-child,.routine-table td:first-child{width:3%}.routine-table th:nth-child(2),.routine-table td:nth-child(2){width:14%}.routine-table th:nth-child(3),.routine-table td:nth-child(3){width:13%}.routine-table th:nth-child(4),.routine-table td:nth-child(4),.routine-table th:nth-child(5),.routine-table td:nth-child(5){width:8%}.routine-table th:nth-child(6),.routine-table td:nth-child(6),.routine-table th:nth-child(7),.routine-table td:nth-child(7){width:6%}.routine-table th:nth-child(8),.routine-table td:nth-child(8),.routine-table th:nth-child(9),.routine-table td:nth-child(9),.routine-table th:nth-child(11),.routine-table td:nth-child(11),.routine-table th:nth-child(13),.routine-table td:nth-child(13){width:4%}.routine-table th:nth-child(10),.routine-table td:nth-child(10){width:7%}.routine-table th:nth-child(12),.routine-table td:nth-child(12){width:6%}.routine-table th:nth-child(14),.routine-table td:nth-child(14){width:5%}.routine-table th:nth-child(15),.routine-table td:nth-child(15){width:14%}.th-sort{cursor:pointer;-webkit-user-select:none;user-select:none}.th-sort:hover{color:var(--text-dim)}.th-sort-active{color:var(--accent)!important}.th-sort-btn{all:unset;cursor:pointer;white-space:nowrap}.th-sort-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.row-selected td{background:var(--surface-2)}.group-hd td{background:var(--surface-2);padding:6px 14px;font-size:11px}.group-hd-row{justify-content:space-between;align-items:center;gap:12px;display:flex}.group-hd-toggle{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;padding:0;display:flex}.group-caret{color:var(--text-faint);width:8px;font-size:9px}.group-label{letter-spacing:.03em;font-weight:700}.group-count{color:var(--text-faint)}.group-health-chips{flex-wrap:wrap;gap:4px;display:flex}.group-controls{gap:8px;padding:6px 0;display:flex}.routine-fs-wrap{padding:14px}.routine-fs-summary{color:var(--text-faint);letter-spacing:.08em;text-transform:uppercase;margin-bottom:10px;font-size:12px;font-weight:800}.routine-fs-tree{gap:8px;display:grid}.routine-fs-folder,.routine-fs-file{margin-left:calc(var(--depth,0) * 22px)}.routine-fs-folder-toggle,.routine-fs-file{background:var(--surface-2);border:2px solid var(--border);color:inherit;text-align:left;min-width:0;width:calc(100% - (var(--depth,0) * 22px));align-items:center;gap:10px;padding:9px 10px;display:flex}.routine-fs-folder-toggle{cursor:pointer;font:inherit;font-weight:900}.routine-fs-caret{color:var(--text-faint);width:12px}.routine-fs-icon{flex:none}.routine-fs-folder-name,.routine-fs-file-title{text-overflow:ellipsis;white-space:nowrap;font-weight:900;overflow:hidden}.routine-fs-count{background:var(--surface);border:2px solid var(--border);margin-left:auto;padding:1px 6px;font-size:11px}.routine-fs-file{grid-template-columns:minmax(220px,1.2fr) minmax(180px,1fr) auto minmax(300px,1.4fr);display:grid}.routine-fs-file-main,.routine-fs-meta,.routine-fs-status,.routine-fs-actions{align-items:center;gap:8px;min-width:0;display:flex}.routine-fs-file-copy,.routine-fs-meta{min-width:0}.routine-fs-file-path{color:var(--text-faint);font-family:var(--mono);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.routine-fs-meta{color:var(--text-dim);font-family:var(--mono);justify-content:space-between;font-size:12px}.routine-fs-status,.routine-fs-actions{justify-content:flex-end}.routine-fs-actions{flex-wrap:wrap}.routine-fs-actions .act-btn{padding:4px 7px;font-size:10px}.routine-fs-actions .act-btn.danger{color:var(--danger)}.cell-schedule{font-family:var(--mono);font-size:12px}.cell-goal{color:var(--text-faint);margin-top:2px;font-size:11px}.cell-next,.cell-no-machines{color:var(--text-faint)}.cell-handler{align-items:center;gap:6px;display:inline-flex}.handler-dot{background:var(--text-faint);border-radius:50%;width:7px;height:7px}.handler-dot.ok{background:var(--ok)}.handler-dot.warn{background:var(--warn)}.cell-triggered{color:var(--text-dim);font-size:12px}.sched-preview-btn{color:var(--text-faint);cursor:pointer;background:0 0;border:none;margin-top:4px;padding:0;font-size:11px;display:block}.sched-preview-btn:hover,.sched-preview-btn.open{color:var(--accent)}.fires-panel{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);max-width:220px;margin-top:6px;padding:8px 10px;font-size:11px}.fires-hd{letter-spacing:.03em;color:var(--text-faint);margin-bottom:4px;font-weight:700}.fires-item{justify-content:space-between;gap:10px;padding:2px 0;display:flex}.fires-until,.fires-empty{color:var(--text-faint)}.spark{display:block}.spark-empty{font-size:12px}.muted{color:var(--text-faint)}.duration-chart{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);flex-direction:column;max-height:260px;margin-bottom:12px;padding:8px 12px;display:flex;overflow-y:auto}.duration-row{cursor:pointer;width:100%;font:inherit;color:inherit;text-align:left;background:0 0;border:none;border-radius:4px;align-items:center;gap:10px;padding:3px 0;display:flex}.duration-row:hover,.duration-row.row-selected{background:var(--surface-2)}.duration-row-time{color:var(--text-faint);flex:0 0 64px;font-size:11px}.duration-row-track{background:var(--border);border-radius:3px;flex:1;height:10px;overflow:hidden}.duration-bar{border-radius:3px;height:100%;display:block}.duration-bar.success{background:var(--ok)}.duration-bar.failed{background:var(--err)}.duration-bar.running{background:var(--warn)}.duration-bar.unknown{background:var(--text-faint)}.duration-row-dur{text-align:right;color:var(--text-faint);flex:0 0 56px;font-size:11px}.health-badge{letter-spacing:.03em;white-space:nowrap;border-radius:4px;padding:2px 7px;font-size:10px;font-weight:700;display:inline-block}.health-badge.healthy{background:var(--ok-bg);color:var(--ok)}.health-badge.disabled,.health-badge.power-saving,.health-badge.snoozed{background:var(--surface-2);color:var(--text-dim)}.health-badge.dormant,.health-badge.dead,.health-badge.agent-missing,.health-badge.auto-disabled{background:var(--err-bg);color:var(--err)}.health-badge.chip{padding:1px 5px;font-size:9px}.failure-chip{letter-spacing:.02em;white-space:nowrap;background:var(--warn-bg);color:var(--warn);border-radius:4px;margin-top:3px;padding:1px 5px;font-size:9px;font-weight:700;display:inline-block}.failure-chip.critical{background:var(--err-bg);color:var(--err)}.toggle{width:32px;height:18px;display:inline-block;position:relative}.toggle input{opacity:0;width:0;height:0}.toggle-track{background:var(--border-strong);border-radius:999px;transition:background .15s;position:absolute;inset:0}.toggle-track:before{content:"";background:var(--surface);border-radius:50%;width:14px;height:14px;transition:transform .15s;position:absolute;top:2px;left:2px}.toggle input:checked+.toggle-track{background:var(--accent)}.toggle input:checked+.toggle-track:before{transform:translate(14px)}.toggle-row{color:var(--text-dim);justify-content:space-between;align-items:center;padding:8px 0;font-size:12px;font-weight:700;display:flex}.row-actions{white-space:normal;flex-wrap:nowrap;justify-content:center;align-items:center;gap:6px;display:flex}.act-btn{border:2px solid var(--border);background:var(--surface);letter-spacing:.02em;min-height:26px;color:var(--text-dim);cursor:pointer;text-align:center;white-space:nowrap;border-radius:4px;padding:4px 7px;font-size:10px;font-weight:700;line-height:1;position:relative}.act-btn:hover{background:var(--surface-2);color:var(--text)}.act-btn:disabled{opacity:.4;cursor:not-allowed}.act-btn.del:hover{color:var(--err)}.act-btn.run{background:var(--ok-bg);border-color:var(--ok);color:var(--ok)}.actions-menu-root{justify-content:center;display:inline-flex;position:relative}.actions-menu-trigger{min-width:86px}.actions-menu{z-index:20;background:var(--surface);border:3px solid var(--border);min-width:168px;box-shadow:6px 6px 0 var(--border);text-align:left;padding:6px;display:grid;position:fixed}.actions-menu-item{color:var(--text);cursor:pointer;font:inherit;letter-spacing:.04em;text-align:left;text-transform:uppercase;white-space:nowrap;background:0 0;border:0;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;font-size:11px;font-weight:700;display:flex}.actions-menu-item:hover,.actions-menu-item:focus-visible{background:var(--accent);color:var(--border);outline:none}.actions-menu-item.danger{color:var(--err)}.actions-menu-item.danger:hover,.actions-menu-item.danger:focus-visible{background:var(--err-bg);color:var(--err)}.actions-menu-sep{background:var(--border-soft);height:1px;margin:5px 4px}.routine-actions-cell{text-align:center}.flag-badge{background:var(--warn-bg);color:var(--warn);border-radius:999px;margin-left:3px;padding:0 5px;font-size:9px;font-weight:700}.bulk-bar{background:var(--warn-bg);border:1px solid var(--warn);border-radius:var(--radius);justify-content:space-between;align-items:center;margin-bottom:12px;padding:8px 14px;display:flex}.bulk-count{color:var(--warn);font-size:12px;font-weight:700}.bulk-acts{gap:8px;display:flex}.create-page{max-width:720px;margin:0 auto}.page-card{padding:20px}.page-freshness{color:var(--text-faint);font-size:11px}.modal{flex-direction:column;width:640px;max-width:92vw;max-height:88vh;padding:0;display:flex}.modal-hd{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:16px 20px;display:flex}.modal-title{font-weight:700}.modal-x{cursor:pointer;color:var(--text-faint);background:0 0;border:none;font-size:14px}.modal-x:hover{color:var(--text)}.modal-body{padding:20px;overflow-y:auto}.modal-ft{border-top:1px solid var(--border);justify-content:flex-end;gap:8px;padding:14px 20px;display:flex}.form-group{margin-bottom:16px}.cron-presets,.ttl-presets{flex-wrap:wrap;gap:6px;margin-top:6px;display:flex}.cron-schedule-list{gap:8px;display:grid}.cron-schedule-input{align-items:center;gap:8px;display:flex}.cron-schedule-input .form-input{min-width:0}.add-cron-btn{margin-top:8px}.preset-btn{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);cursor:pointer;padding:4px 9px;font-size:11px}.preset-btn:hover{border-color:var(--accent)}.cron-preview{color:var(--text-faint);margin-top:6px;font-size:12px}.cron-preview.ok{color:var(--ok)}.cron-preview.bad{color:var(--err)}@media (width<=560px){.cron-schedule-input{flex-direction:column;align-items:stretch}}.machine-chips{flex-wrap:wrap;gap:6px;margin-bottom:8px;display:flex}.machine-chip{border:1px solid var(--border-strong);background:var(--surface);cursor:pointer;border-radius:999px;padding:4px 11px;font-size:12px}.machine-chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.machine-empty{color:var(--text-faint);margin-bottom:8px;font-size:12px}.machine-add{gap:8px;display:flex}.machine-add .form-input{flex:1}.logs-page{max-width:1000px;margin:0 auto}.page-hd{align-items:center;gap:12px;margin-bottom:16px;display:flex}.page-hd .page-title{flex:1;margin:0}.logs-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);max-height:70vh;overflow-y:auto}.logs-empty,.logs-error{color:var(--text-faint);padding:20px}.logs-error{color:var(--err)}.run-summary{margin-bottom:16px}.run-summary-wrap{max-height:none}.run-summary-text{white-space:pre-wrap;padding:16px;line-height:1.5}.log-search{border-bottom:1px solid var(--border);background:var(--surface);align-items:center;gap:8px;padding:10px 14px;display:flex;position:sticky;top:0}.log-search-input{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);flex:1;padding:6px 9px;font-size:12px}.log-match-count{color:var(--text-faint);white-space:nowrap;font-size:11px}.log-lines{font-family:var(--mono);padding:4px 0;font-size:12px}.log-line{gap:12px;padding:1px 14px;display:flex}.log-line:hover{background:var(--surface-2)}.log-ln{color:var(--text-faint);text-align:right;-webkit-user-select:none;user-select:none;min-width:3.5em}.log-lc{white-space:pre-wrap;word-break:break-word}.run-compare{margin-top:16px}.run-compare-body{margin-top:10px}.run-compare-summary{color:var(--text-faint);margin-bottom:8px;font-size:12px}.run-diff-add{background:var(--ok-bg)}.run-diff-remove{background:var(--err-bg)}.run-diff-marker{color:var(--text-faint);-webkit-user-select:none;user-select:none;min-width:1em}.log-hl{background:var(--warn-bg);color:var(--warn);border-radius:2px}.flags-list{flex-direction:column;gap:10px;display:flex}.flags-count{color:var(--text-faint);font-size:12px}.flag-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}.flag-item-hd{align-items:center;gap:10px;margin-bottom:6px;display:flex}.flag-type{text-transform:uppercase;font-size:12px;font-weight:700}.flag-scope{color:var(--text-faint);border:1px solid var(--border);border-radius:4px;padding:1px 6px;font-size:11px}.flag-age{color:var(--text-faint);flex:1;font-size:11px}.flag-desc{color:var(--text-dim);font-size:13px}.cal-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.cal-nav{border-bottom:1px solid var(--border);align-items:center;gap:10px;padding:12px 14px;display:flex}.cal-month{flex:1;font-weight:700}.cal-weekdays{border-bottom:1px solid var(--border);grid-template-columns:repeat(7,1fr);display:grid}.cal-weekday{text-align:center;letter-spacing:.03em;color:var(--text-faint);padding:6px;font-size:10px;font-weight:700}.cal-grid{grid-template-columns:repeat(7,1fr);display:grid}.cal-day{border-right:1px solid var(--border);border-bottom:1px solid var(--border);cursor:pointer;outline:none;min-height:90px;padding:6px}.cal-day:focus-visible{box-shadow:inset 0 0 0 2px var(--accent)}.cal-day.other-month{background:var(--surface-2);color:var(--text-faint)}.cal-day.today .cal-daynum{color:var(--accent);font-weight:700}.cal-daynum{margin-bottom:4px;font-size:11px}.cal-hits{flex-direction:column;gap:2px;display:flex}.cal-chip{background:var(--surface-2);color:var(--text);font-size:10px;font:inherit;text-align:left;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:3px;padding:1px 5px;overflow:hidden}.cal-chip.clickable{cursor:pointer}.cal-chip.clickable:hover{background:var(--accent);color:var(--accent-ink)}.cal-chip.snoozed{opacity:.6}.cal-more{color:var(--text-faint);font-size:10px}.cal-day-dialog{width:min(560px,100vw - 32px);max-height:min(680px,100vh - 48px);overflow-y:auto}.cal-day-empty{border:1px dashed var(--border);color:var(--text-dim);text-align:center;margin-top:12px;padding:18px;font-size:13px}.cal-day-fire-list{flex-direction:column;gap:10px;margin:14px 0;display:flex}.cal-day-fire{background:var(--surface-2);border:1px solid var(--border);border-radius:6px;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px;display:flex}.cal-day-fire-main{min-width:0}.cal-day-fire-title{margin-bottom:6px;font-size:13px;font-weight:700}.cal-day-fire-times{flex-wrap:wrap;gap:4px;display:flex}.cal-time-chip{background:var(--surface);border:1px solid var(--border);color:var(--text-dim);border-radius:3px;padding:2px 5px;font-size:11px}@media (width<=640px){.cal-day-fire{flex-direction:column;align-items:stretch}}.day-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.day-nav{border-bottom:1px solid var(--border);align-items:center;gap:10px;padding:12px 14px;display:flex}.day-date{flex:1;font-weight:700}.day-zoom{align-items:center;gap:6px;display:flex}.day-zoom-level{color:var(--text-faint);text-align:center;min-width:2em;font-size:11px}.day-scroll{max-height:70vh;overflow-y:auto}.day-hour{border-bottom:1px solid var(--border);min-height:var(--dh,40px);display:flex}.day-hour.now{background:var(--surface-2)}.day-hour-label{width:60px;color:var(--text-faint);border-right:1px solid var(--border);flex-direction:column;flex-shrink:0;gap:2px;padding:6px;font-size:11px;display:flex}.day-hour-label .qt,.day-hour-label .qt-end{color:var(--text-faint);opacity:.5;font-size:10px}.day-hour-slot{flex-wrap:wrap;flex:1;align-content:flex-start;gap:4px;padding:4px 8px;display:flex;position:relative}.day-scroll.detail .day-hour-slot{display:block}.day-scroll.detail .day-chip{position:absolute;left:8px;right:8px}.day-chip{color:var(--text);font:inherit;background:var(--surface-2);text-align:left;border:0;border-radius:4px;align-items:center;gap:5px;padding:2px 7px;font-size:11px;display:inline-flex}.day-chip.clickable{cursor:pointer}.day-chip.clickable:hover{background:var(--accent);color:var(--accent-ink)}.day-chip.snoozed{opacity:.6}.day-chip-time{font-family:var(--mono);color:var(--text-dim);font-size:10px}.day-chip-label{font-weight:600}.day-chip-flag{color:var(--warn);font-size:10px}@media (width<=720px){.app-header{gap:10px;padding:10px 12px}.brand-sub{display:none}.header-right{gap:6px}.machine-badge,.icon-btn{min-height:40px;padding:8px 10px}.app-nav{-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:0 12px;overflow-x:auto}.app-nav::-webkit-scrollbar{display:none}.nav-link{white-space:nowrap;flex:none;padding:12px 10px}.page{max-width:100vw;padding:16px 12px 40px;overflow-x:hidden}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat-card{min-width:0}.stat-label{overflow-wrap:anywhere}.section-hd,.section-acts,.filter-bar,.filter-field,.saved-views-bar .filter-field,.refresh-control,.group-by-ctrl{flex-direction:column;align-items:stretch;width:100%}.section-hd{gap:10px}.section-acts{gap:8px}.section-acts .btn,.filter-bar .btn,.filter-input,.filter-select,.refresh-select,.view-toggle,.group-by-ctrl,.group-by-ctrl .filter-select{width:100%;max-width:100%}.filter-input{min-width:0}.view-toggle{grid-template-columns:repeat(2,minmax(0,1fr));display:grid}.move-dialog{width:calc(100vw - 24px)}.move-dialog-hd,.move-path-grid{grid-template-columns:1fr;display:grid}.move-dialog-badge{justify-self:start}.move-current-card,.move-path-grid,.move-preview,.move-dialog-actions{margin-left:12px;margin-right:12px}.modal-hd,.modal-body,.modal-ft{padding-left:14px;padding-right:14px}.notif-panel{width:min(320px,92vw)}.routine-table{width:100%;min-width:0;display:block}.routine-table thead{display:none}.routine-table tbody,.routine-table tr,.routine-table td{width:100%;display:block}.routine-table tr{border-bottom:4px solid var(--border);padding:12px;display:grid}.routine-table tr:last-child{border-bottom:0}.routine-table th,.routine-table td{width:auto!important}.routine-table td{border-bottom-width:0;grid-template-columns:minmax(76px,.34fr) minmax(0,1fr);align-items:start;gap:10px;min-width:0;padding:8px 0;display:grid}.routine-table td:before{content:attr(data-label);color:var(--text-faint);letter-spacing:.1em;text-transform:uppercase;font-size:11px;font-weight:950}.routine-table .col-select,.routine-table .routine-title-cell,.routine-table .routine-actions-cell{grid-template-columns:1fr}.routine-table .routine-title-cell{padding-top:0}.routine-table .col-select:before,.routine-table .routine-title-cell:before,.routine-table .routine-actions-cell:before{margin-bottom:4px}.routine-table .col-select{width:100%}.routine-table .group-hd td{display:block}.routine-table .group-hd td:before{display:none}.routine-table .row-actions{white-space:normal;flex-wrap:wrap}.routine-table td:nth-child(6),.routine-table td:nth-child(8),.routine-table td:nth-child(9),.routine-table td:nth-child(10),.routine-table td:nth-child(11),.routine-table td:nth-child(13){display:none}.routine-table .cell-goal{line-height:1.35}.routine-table .health-badge{max-width:100%}.routine-fs-wrap{padding:10px}.routine-fs-file{margin-left:calc(var(--depth,0) * 12px);width:calc(100% - (var(--depth,0) * 12px));grid-template-columns:1fr}.routine-fs-folder{margin-left:calc(var(--depth,0) * 12px)}.routine-fs-folder-toggle{width:calc(100% - (var(--depth,0) * 12px))}.routine-fs-meta,.routine-fs-status,.routine-fs-actions{justify-content:flex-start}}body{background-color:var(--bg);background-image:linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);background-position:-1px -1px;background-size:32px 32px}:focus-visible{outline:3px solid var(--border);outline-offset:3px}.app-header,.app-nav{border-color:var(--border);background:var(--surface);border-width:0 0 4px}.app-header{text-transform:uppercase}.brand{background:var(--accent);border:3px solid var(--border);box-shadow:var(--shadow-active);color:var(--accent-ink);letter-spacing:.08em;padding:4px 8px;font-size:16px;font-weight:900}.brand-sub{color:inherit;font-weight:900}.nav-link{color:var(--text);letter-spacing:.08em;text-transform:uppercase;border:0;border-left:3px solid #0000;border-right:3px solid #0000;font-weight:900}.nav-link:hover,.nav-link.active{background:var(--accent);border-left-color:var(--border);border-right-color:var(--border);color:var(--accent-ink)}.page{max-width:1280px;padding-top:34px}.page-title{background:var(--accent);border:4px solid var(--border);box-shadow:var(--shadow);color:var(--accent-ink);letter-spacing:-.04em;text-transform:uppercase;margin:0 0 30px;padding:8px 12px;font-size:clamp(30px,5vw,58px);font-weight:950;line-height:.95;display:inline-block}.card,.stat-card,.table-wrap,.routine-fs-wrap,.settings-section,.reliability-card,.heatmap-card,.cal-wrap,.day-wrap,.modal,.dialog,.cmdk,.notif-panel,.global-lock-banner{background:var(--surface);border:4px solid var(--border);box-shadow:var(--shadow-lg);border-radius:0}.stats{gap:14px;margin-bottom:28px}.stat-card,.settings-section,.reliability-card,.heatmap-card{padding:16px}.section-hd{margin:26px 0 12px}.stat-label,.section-label,.form-label,th,.kind-badge,.view-toggle-label{color:var(--text);letter-spacing:.12em;text-transform:uppercase;font-weight:950}.stat-val{color:var(--text);letter-spacing:-.05em;font-size:34px;font-weight:950}.section-label,.dep-warn,.kind-badge,.status-pill,.pill,.flag-scope,.cmdk-hint,.cmdk-key{background:var(--accent);border:2px solid var(--border);color:var(--accent-ink);border-radius:0}.btn,.machine-badge,.icon-btn,.form-input,.form-textarea,.form-select,.cmdk-input,.search-input{background:var(--surface);border:3px solid var(--border);box-shadow:3px 3px 0 0 var(--border);color:var(--text);border-radius:0;font-weight:800}.btn,.machine-badge,.icon-btn,.nav-link,.cal-chip.clickable,.day-chip.clickable,.cmdk-row{transition:box-shadow .12s,transform .12s,background-color .12s}.btn:hover:not(:disabled),.machine-badge:hover,.icon-btn:hover:not(:disabled),.cal-chip.clickable:hover,.day-chip.clickable:hover,.cmdk-row.active{background:var(--accent);border-color:var(--border);color:var(--accent-ink);box-shadow:var(--shadow);transform:translate(-2px,-2px)}.btn:active:not(:disabled),.machine-badge:active,.icon-btn:active:not(:disabled){box-shadow:var(--shadow-active);transform:translate(2px,2px)}.btn-primary{background:var(--accent);border-color:var(--border);color:var(--accent-ink)}.btn-danger,.icon-btn.danger{background:var(--err-bg);border-color:var(--border);color:var(--err)}.health-dot{border:2px solid var(--border);border-radius:0;width:12px;height:12px}.table-wrap{overflow:auto}table{border-collapse:collapse}th{background:var(--accent);color:var(--accent-ink)}th,td{border-bottom:3px solid var(--border)}tr:last-child td{border-bottom:0}.cmdk-row,.notif-row,.cal-day,.day-hour,.log-line{border-color:var(--border)}.toast{border:3px solid var(--border);box-shadow:var(--shadow);border-radius:0}@media (width<=720px){.app-header{-webkit-overflow-scrolling:touch;overflow-x:auto}.page{box-sizing:border-box;width:100%;max-width:none}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stat-card,.table-wrap,.filter-bar{box-sizing:border-box;width:100%}.section-label{width:auto;display:block}.routine-table tr{gap:6px}.routine-table td{grid-template-columns:minmax(0,1fr);gap:5px}.routine-table td:before{display:block}.routine-table .cell-schedule-human{overflow-wrap:normal;word-break:normal;max-width:100%}.routine-table .routine-actions-cell .row-actions{gap:10px 14px}.routine-table .routine-actions-cell .act-btn{padding:4px 0}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}.runs-hist{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:12px;padding:8px 12px}.runs-hist-bars{align-items:flex-end;gap:2px;height:72px;display:flex}.runs-hist-bar{cursor:pointer;background:0 0;border:0;flex:1 1 0;align-items:flex-end;min-width:0;height:100%;padding:0;display:flex}.runs-hist-bar:disabled{cursor:default}.runs-hist-bar:hover:not(:disabled),.runs-hist-bar.selected{background:var(--grid-line)}.runs-hist-bar:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.runs-hist-bar.selected .runs-hist-stack{outline:2px solid var(--text)}.runs-hist-stack{flex-direction:column-reverse;width:100%;min-height:0;display:flex}.runs-hist-seg{flex-basis:0;min-height:2px}.runs-hist-seg.success{background:var(--ok)}.runs-hist-seg.failed{background:var(--err)}.runs-hist-seg.running{background:var(--warn)}.runs-hist-seg.unknown{background:var(--text-faint)}.runs-hist-axis{font-family:var(--mono);color:var(--text-faint);justify-content:space-between;margin-top:4px;font-size:11px;display:flex}.runs-gantt{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:12px;padding:8px 12px}.runs-gantt-hd{cursor:pointer;align-items:baseline;gap:12px;margin-bottom:6px;display:flex}.runs-gantt-peak{font-family:var(--mono);color:var(--text-dim);font-size:12px}.runs-gantt-lanes{max-height:320px;overflow-y:auto}.runs-gantt-row{align-items:center;gap:8px;height:18px;margin-bottom:2px;display:flex}.runs-gantt-name{text-overflow:ellipsis;white-space:nowrap;color:var(--text-dim);flex:0 0 140px;font-size:11px;overflow:hidden}.runs-gantt-track{background:var(--grid-line);border-radius:2px;flex:1 1 0;height:100%;position:relative}.runs-gantt-strip{border-bottom:1px solid var(--border);background:0 0;height:32px}.runs-gantt-row:has(.runs-gantt-strip){height:32px;margin-bottom:6px}.runs-gantt-level{background:var(--accent);opacity:.6;position:absolute;bottom:0}.runs-gantt-cap{border-top:1px dashed var(--err);position:absolute;left:0;right:0}.runs-gantt-bar{background:var(--text-faint);border-radius:2px;min-width:3px;position:absolute;top:3px;bottom:3px}.runs-gantt-bar.success{background:var(--ok)}.runs-gantt-bar.failed{background:var(--err)}.runs-gantt-bar.running{background:var(--warn)}.runs-gantt-bar:hover,.runs-gantt-bar:focus-visible{outline:2px solid var(--accent);outline-offset:1px;z-index:1}.runs-gantt-axis{margin-left:148px}@media (width<=640px){.runs-gantt-name{flex-basis:72px}.runs-gantt-axis{margin-left:80px}}.cap-forecast{margin-top:12px}.runs-gantt-level.over{background:var(--err)}.runs-gantt-bar.est{background:var(--text-faint);opacity:.6}.cap-forecast-windows{color:var(--text-dim);margin:8px 0 0;padding-left:18px;font-size:12px}.cap-forecast-windows .c-amber{font-family:var(--mono)}.adherence{margin-bottom:16px}.adherence-hd{cursor:pointer;flex-wrap:wrap;align-items:baseline;gap:8px 16px;padding:10px 12px;font-size:12px;display:flex}.adherence-note{color:var(--text-dim);margin:0 12px 8px;font-size:12px}
/*$vite$:1*/</style>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>