moadim 3.3.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),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},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ie(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 k(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,k(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),k(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+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+re(a,u),c+=k(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+re(a,u++),c+=k(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return k(ie(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 ae(e,t,n){if(e==null)return e;var r=[],i=0;return k(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(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 se=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 ce(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,se)}catch(e){se(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function le(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 ce(le.bind(null,e))}var ue={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ue,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=le,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)!ee.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 E(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)ee.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ce,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.0`})),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,D());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){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&&ee());){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&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=E,D=function(){te.postMessage(null)}}else D=function(){_(E,0)};function ne(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,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,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.0`})),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 ee(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 E=Object.assign,D=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),te=Symbol.for(`react.portal`),ne=Symbol.for(`react.fragment`),re=Symbol.for(`react.strict_mode`),ie=Symbol.for(`react.profiler`),k=Symbol.for(`react.consumer`),ae=Symbol.for(`react.context`),oe=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),le=Symbol.for(`react.memo`),ue=Symbol.for(`react.lazy`),de=Symbol.for(`react.activity`),fe=Symbol.for(`react.legacy_hidden`),pe=Symbol.for(`react.memo_cache_sentinel`),me=Symbol.for(`react.view_transition`),he=Symbol.for(`react.recoverable`),ge=Symbol.iterator;function _e(e){return typeof e!=`object`||!e?null:(e=ge&&e[ge]||e[`@@iterator`],typeof e==`function`?e:null)}var ve=Symbol.for(`react.client.reference`);function ye(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ne:return`Fragment`;case ie:return`Profiler`;case re:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case de:return`Activity`;case me:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case te:return`Portal`;case ae:return e.displayName||`Context`;case k:return(e._context.displayName||`Context`)+`.Consumer`;case oe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case le:return t=e.displayName||null,t===null?ye(e.type)||`Memo`:t;case ue:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var be=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Se=[],Ce=-1;function we(e){return{current:e}}function Te(e){0>Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function Ee(e,t){Ce++,Se[Ce]=e.current,e.current=t}var De=we(null),Oe=we(null),ke=we(null),Ae=we(null);function je(e,t){switch(Ee(ke,t),Ee(Oe,e),Ee(De,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}}Te(De),Ee(De,e)}function Me(){Te(De),Te(Oe),Te(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,Ee(Ae,e)),t=De.current;var n=dp(t,e.type);t!==n&&(Ee(Oe,e),Ee(De,n))}function Pe(e){Oe.current===e&&(Te(De),Te(Oe)),Ae.current===e&&(Te(Ae),sh._currentValue=xe)}var Fe,Ie;function Le(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1<e.stack.indexOf(`
    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+Fe+e+Ie}var Re=!1;function ze(e,t){if(!e||Re)return``;Re=!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{Re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Le(n):``}function Be(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le(`Lazy`);case 13:return e.child!==t&&t!==null?Le(`Suspense Fallback`):Le(`Suspense`);case 19:return Le(`SuspenseList`);case 0:case 15:return ze(e.type,!1);case 11:return ze(e.type.render,!1);case 1:return ze(e.type,!0);case 31:return Le(`Activity`);case 30:return Le(`ViewTransition`);default:return``}}function Ve(e){try{var t=``,n=null;do t+=Be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var He=Object.prototype.hasOwnProperty,Ue=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Ke=t.unstable_requestPaint,qe=t.unstable_now,Je=t.unstable_getCurrentPriorityLevel,Ye=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,Qe=t.unstable_LowPriority,$e=t.unstable_IdlePriority,et=t.log,tt=t.unstable_setDisableYieldValue,nt=null,rt=null;function it(e){if(typeof et==`function`&&tt(e),rt&&typeof rt.setStrictMode==`function`)try{rt.setStrictMode(nt,e)}catch{}}var at=Math.clz32?Math.clz32:ct,ot=Math.log,st=Math.LN2;function ct(e){return e>>>=0,e===0?32:31-(ot(e)/st|0)|0}var lt=256,ut=262144,dt=4194304;function ft(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 pt(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=ft(n))):i=ft(o):i=ft(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ft(n))):i=ft(o)):i=ft(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 mt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ht(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-at(n),i=1<<r;t|=e[r],n&=~i}return t}function gt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var e=dt;return dt<<=1,!(dt&62914560)&&(dt=4194304),e}function vt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function M(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-at(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&&bt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function bt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-at(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function xt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function St(e,t){var n=t&-t;return n=n&42?1:Ct(n),(n&(e.suspendedLanes|t))===0?n:0}function Ct(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 wt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Tt(){var e=j.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function Et(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var Dt=Math.random().toString(36).slice(2),Ot=`__reactFiber$`+Dt,kt=`__reactProps$`+Dt,At=`__reactContainer$`+Dt,jt=`__reactEvents$`+Dt,Mt=`__reactListeners$`+Dt,Nt=`__reactHandles$`+Dt,Pt=`__reactResources$`+Dt,Ft=`__reactMarker$`+Dt,It=`__reactLoad$`+Dt;function Lt(e){delete e[Ot],delete e[kt],delete e[Mt],delete e[Nt]}function Rt(e){var t;if(t=e[Ot])return t;for(var n=e.parentNode;n;){if(t=n[At]||n[Ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[Ot])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function zt(e){if(e=e[Ot]||e[At]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Vt(e){var t=e[Pt];return t||=e[Pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ht(e){e[Ft]=!0}function Ut(e){e[It]=void 0}var Wt=new Set,Gt={};function Kt(e,t){qt(e,t),qt(e+`Capture`,t)}function qt(e,t){for(Gt[e]=t,e=0;e<t.length;e++)Wt.add(t[e])}var Jt=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]*$`),Yt={},Xt={};function Zt(e){return He.call(Xt,e)?!0:He.call(Yt,e)?!1:Jt.test(e)?Xt[e]=!0:(Yt[e]=!0,!1)}var N=!1;function Qt(){var e=N;return N=!1,e}function $t(e,t,n){if(Zt(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 en(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 tn(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 nn(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function rn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function an(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 on(e){if(!e._valueTracker){var t=rn(e)?`checked`:`value`;e._valueTracker=an(e,t,``+e[t])}}function sn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=rn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var cn=/[\n"\\]/g;function ln(e){return e.replace(cn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function un(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=``+nn(t)):e.value!==``+nn(t)&&(e.value=``+nn(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):fn(e,nn(n)):o===`number`&&e.value==t?fn(e,nn(e.value)):fn(e,nn(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=``+nn(s):e.removeAttribute(`name`)}function dn(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)){on(e);return}n=n==null?``:``+nn(n),t=t==null?n:``+nn(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),on(e)}function fn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function pn(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=``+nn(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 mn(e,t,n){if(t!=null&&(t=``+nn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+nn(n)}function hn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(be(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=nn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),on(e)}function gn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _n=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 vn(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||_n.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function yn(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]=``,N=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(vn(e,a,r),N=!0)}else for(var o in t)t.hasOwnProperty(o)&&vn(e,o,t[o])}function bn(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 xn=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`]]),Sn=/^[\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 Cn(e){return Sn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function wn(){}var Tn=null;function En(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dn=null,On=null;function kn(e){var t=zt(e);if(t&&(e=t.stateNode)){var n=e[kt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(un(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="`+ln(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[kt]||null;if(!a)throw Error(i(90));un(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&&sn(r)}break a;case`textarea`:mn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&pn(e,!!n.multiple,t,!1)}}}var An=!1;function jn(e,t,n){if(An)return e(t,n);An=!0;try{return e(t)}finally{if(An=!1,(Dn!==null||On!==null)&&(Rd(),Dn&&(t=Dn,e=On,On=Dn=null,kn(t),e)))for(t=0;t<e.length;t++)kn(e[t])}}function Mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[kt]||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 Nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Pn=!1;if(Nn)try{var Fn={};Object.defineProperty(Fn,"passive",{get:function(){Pn=!0}}),window.addEventListener(`test`,Fn,Fn),window.removeEventListener(`test`,Fn,Fn)}catch{Pn=!1}var In=null,Ln=null,Rn=null;function zn(){if(Rn)return Rn;var e,t=Ln,n=t.length,r,i=`value`in In?In.value:In.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 Rn=i.slice(e,1<r?1-r:void 0)}function Bn(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 Vn(){return!0}function Hn(){return!1}function Un(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)?Vn:Hn,this.isPropagationStopped=Hn,this}return E(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=Vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Vn)},persist:function(){},isPersistent:Vn}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gn=Un(Wn),Kn=E({},Wn,{view:0,detail:0}),qn=Un(Kn),P,Jn,Yn,Xn=E({},Kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sr,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!==Yn&&(Yn&&e.type===`mousemove`?(P=e.screenX-Yn.screenX,Jn=e.screenY-Yn.screenY):Jn=P=0,Yn=e),P)},movementY:function(e){return`movementY`in e?e.movementY:Jn}}),Zn=Un(Xn),Qn=Un(E({},Xn,{dataTransfer:0})),$n=Un(E({},Kn,{relatedTarget:0})),er=Un(E({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0})),tr=Un(E({},Wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),nr=Un(E({},Wn,{data:0})),rr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},ir={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`},ar={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function or(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ar[e])?!!t[e]:!1}function sr(){return or}var cr=Un(E({},Kn,{key:function(e){if(e.key){var t=rr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?ir[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sr,charCode:function(e){return e.type===`keypress`?Bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),lr=Un(E({},Xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ur=Un(E({},Wn,{submitter:0})),dr=Un(E({},Kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sr})),fr=Un(E({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),pr=Un(E({},Xn,{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})),mr=Un(E({},Wn,{newState:0,oldState:0,source:0})),hr=[9,13,27,32],gr=Nn&&`CompositionEvent`in window,_r=null;Nn&&`documentMode`in document&&(_r=document.documentMode);var vr=Nn&&`TextEvent`in window&&!_r,yr=Nn&&(!gr||_r&&8<_r&&11>=_r),br=` `,xr=!1;function Sr(e,t){switch(e){case`keyup`:return hr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var wr=!1;function Tr(e,t){switch(e){case`compositionend`:return Cr(t);case`keypress`:return t.which===32?(xr=!0,br):null;case`textInput`:return e=t.data,e===br&&xr?null:e;default:return null}}function Er(e,t){if(wr)return e===`compositionend`||!gr&&Sr(e,t)?(e=zn(),Rn=Ln=In=null,wr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return yr&&t.locale!==`ko`?null:t.data;default:return null}}var Dr={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 Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Dr[e.type]:t===`textarea`}function kr(e,t,n,r){Dn?On?On.push(r):On=[r]:Dn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Ar=null,jr=null;function Mr(e){Vf(e,0)}function Nr(e){if(sn(Bt(e)))return e}function Pr(e,t){if(e===`change`)return t}var Fr=!1;if(Nn){var Ir;if(Nn){var Lr=`oninput`in document;if(!Lr){var F=document.createElement(`div`);F.setAttribute(`oninput`,`return;`),Lr=typeof F.oninput==`function`}Ir=Lr}else Ir=!1;Fr=Ir&&(!document.documentMode||9<document.documentMode)}function Rr(){Ar&&(Ar.detachEvent(`onpropertychange`,zr),jr=Ar=null)}function zr(e){if(e.propertyName===`value`&&Nr(jr)){var t=[];kr(t,jr,e,En(e)),jn(Mr,t)}}function Br(e,t,n){e===`focusin`?(Rr(),Ar=t,jr=n,Ar.attachEvent(`onpropertychange`,zr)):e===`focusout`&&Rr()}function Vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Nr(jr)}function Hr(e,t){if(e===`click`)return Nr(t)}function Ur(e,t){if(e===`input`||e===`change`)return Nr(t)}function Wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Gr=typeof Object.is==`function`?Object.is:Wr;function Kr(e,t){if(Gr(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(!He.call(t,i)||!Gr(e[i],t[i]))return!1}return!0}function qr(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 Jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yr(e,t){var n=Jr(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=Jr(n)}}function Xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qr(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=qr(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 $r=Nn&&`documentMode`in document&&11>=document.documentMode,ei=null,ti=null,ni=null,ri=!1;function ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ri||ei==null||ei!==qr(r)||(r=ei,`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}),ni&&Kr(ni,r)||(ni=r,r=Jf(ti,`onSelect`),0<r.length&&(t=new Gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ei)))}function ai(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var oi={animationend:ai(`Animation`,`AnimationEnd`),animationiteration:ai(`Animation`,`AnimationIteration`),animationstart:ai(`Animation`,`AnimationStart`),transitionrun:ai(`Transition`,`TransitionRun`),transitionstart:ai(`Transition`,`TransitionStart`),transitioncancel:ai(`Transition`,`TransitionCancel`),transitionend:ai(`Transition`,`TransitionEnd`)},si={},ci={};Nn&&(ci=document.createElement(`div`).style,`AnimationEvent`in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),`TransitionEvent`in window||delete oi.transitionend.transition);function li(e){if(si[e])return si[e];if(!oi[e])return e;var t=oi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ci)return si[e]=t[n];return e}var ui=li(`animationend`),di=li(`animationiteration`),fi=li(`animationstart`),pi=li(`transitionrun`),mi=li(`transitionstart`),hi=li(`transitioncancel`),gi=li(`transitionend`),_i=new Map,vi=`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(` `);vi.push(`scrollEnd`);function yi(e,t){_i.set(e,t),Kt(t,[e])}var bi=0;function xi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=bi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Si(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;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 Ci(e,t){return e=Si(e),t=Si(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var wi=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)},Ti=[],Ei=0,Di=0;function Oi(){for(var e=Ei,t=Di=Ei=0;t<e;){var n=Ti[t];Ti[t++]=null;var r=Ti[t];Ti[t++]=null;var i=Ti[t];Ti[t++]=null;var a=Ti[t];if(Ti[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&&Mi(n,i,a)}}function ki(e,t,n,r){Ti[Ei++]=e,Ti[Ei++]=t,Ti[Ei++]=n,Ti[Ei++]=r,Di|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ai(e,t,n,r){return ki(e,t,n,r),Ni(e)}function ji(e,t){return ki(e,null,null,t),Ni(e)}function Mi(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-at(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ni(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var I={};function Pi(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 L(e,t,n,r){return new Pi(e,t,n,r)}function Fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var n=e.alternate;return n===null?(n=L(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 Li(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 Ri(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Fi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,De.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case de:return e=L(31,n,t,a),e.elementType=de,e.lanes=o,e;case ne:return zi(n.children,a,o,t);case re:s=8,a|=24;break;case ie:return e=L(12,n,t,a|2),e.elementType=ie,e.lanes=o,e;case se:return e=L(13,n,t,a),e.elementType=se,e.lanes=o,e;case ce:return e=L(19,n,t,a),e.elementType=ce,e.lanes=o,e;case fe:case me:return e=a|32,e=L(30,n,t,e),e.elementType=me,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ae:s=10;break a;case k:s=9;break a;case oe:s=11;break a;case le:s=14;break a;case ue:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=L(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function zi(e,t,n,r){return e=L(7,e,r,t),e.lanes=n,e}function Bi(e,t,n){return e=L(6,e,null,t),e.lanes=n,e}function Vi(e){var t=L(18,null,null,0);return t.stateNode=e,t}function Hi(e,t,n){return t=L(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ui=new WeakMap;function Wi(e,t){if(typeof e==`object`&&e){var n=Ui.get(e);return n===void 0?(t={value:e,source:t,stack:Ve(t)},Ui.set(e,t),t):n}return{value:e,source:t,stack:Ve(t)}}var Gi=[],Ki=0,qi=null,Ji=0,Yi=[],Xi=0,Zi=null,Qi=1,$i=``;function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=qi,qi=e,Ji=t}function ta(e,t,n){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Zi=e;var r=Qi;e=$i;var i=32-at(r)-1;r&=~(1<<i),n+=1;var a=32-at(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Qi=1<<32-at(t)+i|n<<i|r,$i=a+e}else Qi=1<<a|n<<i|r,$i=e}function na(e){e.return!==null&&(ea(e,1),ta(e,1,0))}function ra(e){for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null;for(;e===Zi;)Zi=Yi[--Xi],Yi[Xi]=null,$i=Yi[--Xi],Yi[Xi]=null,Qi=Yi[--Xi],Yi[Xi]=null}function ia(e,t){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Qi=t.id,$i=t.overflow,Zi=e}var aa=null,R=null,z=!1,oa=null,sa=!1,ca=Error(i(519));function la(e){throw ha(Wi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ot]=e,t[kt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),dn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),hn(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||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=wn),t=!0):t=!1,t||la(e,!0)}function da(e){for(aa=e.return;aa;)switch(aa.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:aa=aa.return}}function fa(e){if(e!==aa)return!1;if(!z)return da(e),z=!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&&R&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));R=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));R=dm(e)}else t===27?(t=R,Sp(e.type)?(e=um,um=null,R=e):R=t):R=aa?lm(e.stateNode.nextSibling):null;return!0}function pa(){R=aa=null,z=!1}function ma(){var e=oa;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),oa=null),e}function ha(e){oa===null?oa=[e]:oa.push(e)}var ga=we(null),_a=null,va=null;function ya(e,t,n){Ee(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,Te(ga)}function xa(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 Sa(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),xa(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),xa(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),xa(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 Ca(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;Gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ae.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&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!Gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(i(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=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()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:ae,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(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 Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Pf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(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 Ga=A.S;A.S=function(e,t){if(hd=qe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=bf;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=we(null);function qa(){var e=Ka.current;return e===null?$u.pooledCache:e}function Ja(e,t){t===null?Ee(Ka,Ka.current):Ee(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Ma._currentValue,pool:e}}var Xa=Error(i(460)),Za=Error(i(474)),Qa=Error(i(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(wn,wn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(wn,wn);else{if(e=$u,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,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(i(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(i(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(e,t){throw t.$$typeof===D?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function fo(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=Ii(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=Bi(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===ne?(e=d(e,t,n.props.children,r,n.key),lo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ue&&no(i)===t.type)?(t=a(t,n.props),lo(t,n),t.return=e,t):(t=Ri(n.type,n.key,n.props,null,e.mode,r),lo(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=Hi(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=zi(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=Bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case O:return n=Ri(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case te:return t=Hi(t,e.mode,n),t.return=e,t;case ue:return t=no(t),f(e,t,n)}if(be(t)||_e(t))return t=zi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===ae)return f(e,Da(e,t),n);uo(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 O:return n.key===i?l(e,t,n,r):null;case te:return n.key===i?u(e,t,n,r):null;case ue:return n=no(n),p(e,t,n,r)}if(be(n)||_e(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,co(n),r);if(n.$$typeof===ae)return p(e,t,Da(e,n),r);uo(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 O:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case te:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ue:return r=no(r),m(e,t,n,r,i)}if(be(r)||_e(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,co(r),i);if(r.$$typeof===ae)return m(e,t,n,Da(t,r),i);uo(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),z&&ea(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 z&&ea(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)}),z&&ea(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),z&&ea(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 z&&ea(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)}),z&&ea(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ne&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case O:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ne){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ue&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ne?(c=zi(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Ri(o.type,o.key,o.props,null,e.mode,c),lo(c,o),c.return=e,e=c)}return s(e);case te: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=Hi(o,e.mode,c),c.return=e,e=c}return s(e);case ue:return o=no(o),_(e,r,o,c)}if(be(o))return h(e,r,o,c);if(_e(o)){if(l=_e(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,co(o),c);if(o.$$typeof===ae)return _(e,r,Da(e,o),c);uo(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=Bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=L(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(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 vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ni(e),Mi(e,null,n),t}return ki(e,r,t,n),Ni(e)}function bo(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,xt(e,n)}}function xo(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;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!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?(Y&f)===f:(r&f)===f){f!==0&&f===Ba&&(So=!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=E({},d,f);break a;case 2:ho=!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 To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)To(n[e],t)}var Do=we(null),Oo=we(0);function ko(e,t){e=id,Ee(Oo,e),Ee(Do,t),id=e|t.baseLanes}function Ao(){Ee(Oo,id),Ee(Do,Do.current)}function jo(){id=Oo.current,Te(Do),Te(Oo)}var Mo=we(null),No=null;function Po(e){var t=e.alternate;Ee(zo,zo.current&1),Ee(Mo,e),No===null&&(t===null||Do.current!==null||t.memoizedState!==null)&&(No=e)}function Fo(e){Ee(zo,zo.current),Ee(Mo,e),No===null&&(No=e)}function Io(e){e.tag===22?(Ee(zo,zo.current),Ee(Mo,e),No===null&&(No=e)):Lo()}function Lo(){Ee(zo,zo.current),Ee(Mo,Mo.current)}function Ro(e){Te(Mo),No===e&&(No=null),Te(zo)}var zo=we(0);function Bo(e,t){Ee(Mo,Mo.current),Ee(zo,t)}function Vo(e){Te(zo),Te(Mo),No===e&&(No=null)}function Ho(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 Uo=0,B=null,Wo=null,Go=null,Ko=!1,qo=!1,Jo=!1,Yo=0,Xo=0,Zo=null,Qo=0;function $o(){throw Error(i(321))}function es(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gr(e[n],t[n]))return!1;return!0}function ts(e,t,n,r,i,a){return Uo=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?vc:yc,Jo=!1,a=n(r,i),Jo=!1,qo&&(a=rs(t,n,r,i)),ns(e),a}function ns(e){A.H=_c;var t=Wo!==null&&Wo.next!==null;if(Uo=0,Go=Wo=B=null,Ko=!1,Xo=0,Zo=null,t)throw Error(i(300));e===null||Ic||(e=e.dependencies,e!==null&&wa(e)&&(Ic=!0))}function rs(e,t,n,r){B=e;var a=0;do{if(qo&&(Zo=null),Xo=0,qo=!1,25<=a)throw Error(i(301));if(a+=1,Go=Wo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=bc,o=t(n,r)}while(qo);return o}function is(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?ds(t):t,e=e.useState()[0],(Wo===null?null:Wo.memoizedState)!==e&&(B.flags|=1024),t}function as(){var e=Yo!==0;return Yo=0,e}function os(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ss(e){if(Ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ko=!1}Uo=0,Go=Wo=B=null,qo=!1,Xo=Yo=0,Zo=null}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Go===null?B.memoizedState=Go=e:Go=Go.next=e,Go}function ls(){if(Wo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=Wo.next;var t=Go===null?B.memoizedState:Go.next;if(t!==null)Go=t,Wo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));Wo=e,e={memoizedState:Wo.memoizedState,baseState:Wo.baseState,baseQueue:Wo.baseQueue,queue:Wo.queue,next:null},Go===null?B.memoizedState=Go=e:Go=Go.next=e}return Go}function us(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ds(e){var t=Xo;return Xo+=1,Zo===null&&(Zo=[]),e=to(Zo,e,t),t=B,(Go===null?t.memoizedState:Go.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?vc:yc),e}function fs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ds(e);if(e.$$typeof===he)return;if(e.$$typeof===ae)return Ea(e)}throw Error(i(438,String(e)))}function ps(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.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=us(),B.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]=pe;return t.index++,n}function ms(e,t){return typeof t==`function`?t(e):t}function hs(e){return gs(ls(),Wo,e)}function gs(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?(Uo&f)===f:(Y&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===Ba&&(d=!0);else if((Uo&p)===p){u=u.next,p===Ba&&(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,B.lanes|=p,od|=p;f=u.action,Jo&&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,B.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Gr(o,e.memoizedState)&&(Ic=!0,d&&(n=Va,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 _s(e){var t=ls(),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);Gr(o,t.memoizedState)||(Ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function vs(e,t,n){var r=B,a=ls(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Gr((Wo||a).memoizedState,n);if(s&&(a.memoizedState=n,Ic=!0),a=a.queue,Us(xs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Go!==null&&!!(Go.memoizedState.tag&1),Rs(e?9:8,{destroy:void 0},bs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,$u===null)throw Error(i(349));o||Uo&127||ys(r,t,n)}return n}function ys(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=us(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bs(e,t,n,r){t.value=n,t.getSnapshot=r,Ss(t)&&Cs(e)}function xs(e,t,n){return n(function(){Ss(t)&&Cs(e)})}function Ss(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gr(e,n)}catch{return!0}}function Cs(e){var t=ji(e,2);t!==null&&Nd(t,e,2)}function ws(e){var t=cs();if(typeof e==`function`){var n=e;if(e=n(),Jo){it(!0);try{n()}finally{it(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:e},t}function Ts(e,t,n,r){return e.baseState=n,gs(e,Wo,typeof r==`function`?r:ms)}function Es(e,t,n,r,a){if(mc(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)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ds(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ds(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};o.types=a===null?null:a.types,A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),Os(e,t,s)}catch(n){As(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),Os(e,t,a)}catch(n){As(e,t,n)}}function Os(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ks(e,t,n)},function(n){return As(e,t,n)}):ks(e,t,n)}function ks(e,t,n){t.status=`fulfilled`,t.value=n,js(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ds(e,n)))}function As(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,js(t),t=t.next;while(t!==r)}e.action=null}function js(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ms(e,t){return t}function Ns(e,t){if(z){var n=$u.formState;if(n!==null){a:{var r=B;if(z){if(R){b:{for(var i=R,a=sa;i.nodeType!==8;){if(!a){i=null;break b}if(i=lm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){R=lm(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=cs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:t},n.queue=r,n=dc.bind(null,B,r),r.dispatch=n,r=ws(!1),a=pc.bind(null,B,!1,r.queue),r=cs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Es.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ps(e){return Fs(ls(),Wo,e)}function Fs(e,t,n){if(t=gs(e,t,Ms)[0],e=hs(ms)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ds(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=ls();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,Rs(9,{destroy:void 0},Is.bind(null,i,n),null)),[r,a,e]}function Is(e,t){e.action=t}function Ls(e){var t=ls(),n=Wo;if(n!==null)return Fs(t,n,e);ls(),t=t.memoizedState,n=ls();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=us(),B.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 zs(){return ls().memoizedState}function Bs(e,t,n,r){var i=cs();B.flags|=e,i.memoizedState=Rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Vs(e,t,n,r){var i=ls();r=r===void 0?null:r;var a=i.memoizedState.inst;Wo!==null&&r!==null&&es(r,Wo.memoizedState.deps)?i.memoizedState=Rs(t,a,n,r):(B.flags|=e,i.memoizedState=Rs(1|t,a,n,r))}function Hs(e,t){Bs(8390656,8,e,t)}function Us(e,t){Vs(2048,8,e,t)}function Ws(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=us(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gs(e){var t=ls().memoizedState;return Ws({ref:t,nextImpl:e}),function(){if(q&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ks(e,t){return Vs(4,2,e,t)}function qs(e,t){return Vs(4,4,e,t)}function Js(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 Ys(e,t,n){n=n==null?null:n.concat([e]),Vs(4,4,Js.bind(null,t,e),n)}function Xs(){}function Zs(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&es(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qs(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&es(t,r[1]))return r[0];if(r=e(),Jo){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r}function $s(e,t,n){return n===void 0||Uo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=Z(),B.lanes|=e,od|=e,n)}function ec(e,t,n,r){return Gr(n,t)?n:Do.current===null?!(Uo&106)||Uo&1073741824&&!(Y&261930)?(Ic=!0,e.memoizedState=n):(e=Z(),B.lanes|=e,od|=e,t):(e=$s(e,n,r),Gr(e,t)||(Ic=!0),e)}function tc(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};s.types=o===null?null:o.types,A.T=s,pc(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?fc(e,t,Wa(c,r),jd(e)):fc(e,t,r,jd(e))}catch(n){fc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function nc(){}function rc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ic(e).queue;tc(e,a,t,xe,n===null?nc:function(){return ac(e),n(r)})}function ic(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:xe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ac(e){var t=ic(e);t.next===null&&(t=e.alternate.memoizedState),fc(e,t.next.queue,{},jd())}function oc(){return Ea(sh)}function sc(){return ls().memoizedState}function cc(){return ls().memoizedState}function lc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=vo(n);var r=yo(t,e,n);r!==null&&(Nd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function uc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mc(e)?hc(t,n):(n=Ai(e,t,n,r),n!==null&&(Nd(n,e,r),gc(n,t,r)))}function dc(e,t,n){fc(e,t,n,jd())}function fc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mc(e))hc(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,Gr(s,o))return ki(e,t,i,0),$u===null&&Oi(),!1}catch{}if(n=Ai(e,t,i,r),n!==null)return Nd(n,e,r),gc(n,t,r),!0}return!1}function pc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mc(e)){if(t)throw Error(i(479))}else t=Ai(e,n,r,2),t!==null&&Nd(t,e,2)}function mc(e){var t=e.alternate;return e===B||t!==null&&t===B}function hc(e,t){qo=Ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xt(e,n)}}var _c={readContext:Ea,use:fs,useCallback:$o,useContext:$o,useEffect:$o,useImperativeHandle:$o,useLayoutEffect:$o,useInsertionEffect:$o,useMemo:$o,useReducer:$o,useRef:$o,useState:$o,useDebugValue:$o,useDeferredValue:$o,useTransition:$o,useSyncExternalStore:$o,useId:$o,useHostTransitionStatus:$o,useFormState:$o,useActionState:$o,useOptimistic:$o,useMemoCache:$o,useCacheRefresh:$o,useEffectEvent:$o},vc={readContext:Ea,use:fs,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Bs(4194308,4,Js.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Jo){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Jo){it(!0);try{n(t)}finally{it(!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=uc.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=ws(e);var t=e.queue,n=dc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xs,useDeferredValue:function(e,t){return $s(cs(),e,t)},useTransition:function(){var e=ws(!1);return e=tc.bind(null,B,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=cs();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),$u===null)throw Error(i(349));Y&127||ys(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Hs(xs.bind(null,r,o,e),[e]),r.flags|=2048,Rs(9,{destroy:void 0},bs.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=$u.identifierPrefix;if(z){var n=$i,r=Qi;n=(r&~(1<<32-at(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:oc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e){var t=cs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pc.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:ps,useCacheRefresh:function(){return cs().memoizedState=lc.bind(null,B)},useEffectEvent:function(e){var t=cs(),n={impl:e};return t.memoizedState=n,function(){if(q&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},yc={readContext:Ea,use:fs,useCallback:Zs,useContext:Ea,useEffect:Us,useImperativeHandle:Ys,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Qs,useReducer:hs,useRef:zs,useState:function(){return hs(ms)},useDebugValue:Xs,useDeferredValue:function(e,t){return ec(ls(),Wo.memoizedState,e,t)},useTransition:function(){var e=hs(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:sc,useHostTransitionStatus:oc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){return Ts(ls(),Wo,e,t)},useMemoCache:ps,useCacheRefresh:cc,useEffectEvent:Gs},bc={readContext:Ea,use:fs,useCallback:Zs,useContext:Ea,useEffect:Us,useImperativeHandle:Ys,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Qs,useReducer:_s,useRef:zs,useState:function(){return _s(ms)},useDebugValue:Xs,useDeferredValue:function(e,t){var n=ls();return Wo===null?$s(n,e,t):ec(n,Wo.memoizedState,e,t)},useTransition:function(){var e=_s(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:sc,useHostTransitionStatus:oc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){var n=ls();return Wo===null?(n.baseState=e,[e,n.queue.dispatch]):Ts(n,Wo,e,t)},useMemoCache:ps,useCacheRefresh:cc,useEffectEvent:Gs};function xc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Sc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Nd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Nd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(Nd(t,e,n),bo(t,e,n))}};function Cc(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?!Kr(n,r)||!Kr(i,a):!0}function wc(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&&Sc.enqueueReplaceState(t,t.state,null)}function Tc(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=E({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ec(e){wi(e)}function Dc(e){console.error(e)}function Oc(e){wi(e)}function kc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ac(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 jc(e,t,n){return n=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){kc(e,t)},n}function Mc(e){return e=vo(e),e.tag=3,e}function Nc(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(){Ac(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ac(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Pc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,a,!0),n=Mo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return No===null?Gd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===$a?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)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Gd(),!1}if(z)return t=Mo.current,t===null?(r!==ca&&(t=Error(i(423),{cause:r}),ha(Wi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Wi(r,n),a=jc(e.stateNode,r,a),xo(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ca&&(e=Error(i(422),{cause:r}),ha(Wi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Wi(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=Wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=jc(n.stateNode,r,e),xo(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`&&(vd===null||!vd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Mc(a),Nc(a,e,n,r),xo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Fc=Error(i(461)),Ic=!1;function Lc(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Rc(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 Ta(t),r=ts(e,t,n,o,a,i),s=as(),e!==null&&!Ic?(os(e,t,i),dl(e,t,i)):(z&&s&&na(t),t.flags|=1,Lc(e,t,r,i),t.child)}function zc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Bc(e,t,a,r,i)):(e=Ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Kr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function Bc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Kr(a,r)&&e.ref===t.ref){if(Ic=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Ic=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return Jc(e,t,n,r,i)}function Vc(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 Uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?Ao():ko(t,a),Io(t);else return r=t.lanes=536870912,Uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),Ao(),Lo()):(Ja(t,a.cachePool),ko(t,a),Lo(),t.memoizedState=null);return Lc(e,t,i,n),t.child}function Hc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Uc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),Ao(),Io(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function Wc(e,t){return t=rl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gc(e,t,n){return po(t,e.child,null,n),e=Wc(t,t.pendingProps),e.flags|=2,Ro(t),t.memoizedState=null,e}function Kc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=Wc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Hc(null,e);if(Fo(t),(e=R)?(e=am(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,R=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Wc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Fo(t),a){if(t.flags&256)t.flags&=-257,t=Gc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ic||Ca(e,t,n,!1),a=(n&e.childLanes)!==0,Ic||a){if(Do.current===null){if(r=$u,r!==null&&(s=St(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ji(e,s),Nd(r,e,s),Fc;Gd()}t=Gc(e,t,n)}else e=o.treeContext,R=lm(s.nextSibling),aa=t,z=!0,oa=null,sa=!1,e!==null&&ia(t,e),t=Wc(t,r),t.flags|=134221824;return t}return e=Ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qc(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 Jc(e,t,n,r,i){return Ta(t),n=ts(e,t,n,r,void 0,i),r=as(),e!==null&&!Ic?(os(e,t,i),dl(e,t,i)):(z&&r&&na(t),t.flags|=1,Lc(e,t,n,i),t.child)}function Yc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=rs(t,r,n,i),ns(e),r=as(),e!==null&&!Ic?(os(e,t,a),dl(e,t,a)):(z&&r&&na(t),t.flags|=1,Lc(e,t,n,a),t.child)}function Xc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=I,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Sc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):I,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(xc(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&&Sc.enqueueReplaceState(a,a.state,null),wo(t,r,a,i),Co(),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=Tc(n,s);a.props=c;var l=a.context,u=n.contextType;o=I,typeof u==`object`&&u&&(o=Ea(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)&&wc(t,a,r,o),ho=!1;var f=t.memoizedState;a.state=f,wo(t,r,a,i),Co(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(xc(t,n,d,r),l=t.memoizedState),(c=ho||Cc(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,_o(e,t),o=t.memoizedProps,u=Tc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=I,typeof l==`object`&&l&&(c=Ea(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)&&wc(t,a,r,c),ho=!1,f=t.memoizedState,a.state=f,wo(t,r,a,i),Co();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(xc(t,n,s,r),p=t.memoizedState),(u=ho||Cc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(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,qc(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=po(t,e.child,null,i),t.child=po(t,null,n,i)):Lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Zc(e,t,n,r){return pa(),t.flags|=256,Lc(e,t,n,r),t.child}var Qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:Ya()}}function el(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function tl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(zo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(z){if(i?Po(t):Lo(),(e=R)?(e=am(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,R=null)):e=null,e===null)throw la(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Lo(),i=t.mode,a=rl({mode:`hidden`,children:a},i),r=zi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=$c(n),r.childLanes=el(e,o,n),t.memoizedState=Qc,Hc(null,r)):(Po(t),nl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return al(e,t,a,o,r,c,s,n)}return i?(Lo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ii(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=zi(i,a,n,null),i.flags|=2):i=Ii(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Hc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=$c(n):(a=i.cachePool,a===null?a=Ya():(s=Ma._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=el(e,o,n),t.memoizedState=Qc,Hc(e.child,r)):(Po(t),n=e.child,e=n.sibling,n=Ii(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 nl(e,t){return t=rl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function rl(e,t){return e=L(22,e,null,t),e.lanes=0,e}function il(e,t,n){return po(t,e.child,null,n),e=nl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function al(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Po(t),t.flags&=-257,il(e,t,c)):t.memoizedState===null?(Lo(),o=a.fallback,s=t.mode,a=rl({mode:`visible`,children:a.children},s),o=zi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=$c(c),a.childLanes=el(e,r,c),t.memoizedState=Qc,Hc(null,a)):(Lo(),t.child=e.child,t.flags|=128,null);if(Po(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,ha({value:a,source:null,stack:null})),il(e,t,c)}if(Ic||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,Ic||r){if(Do.current!==null)return il(e,t,c);if(r=$u,r!==null&&(a=St(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,ji(e,a),Nd(r,e,a),Fc;return om(o)||Gd(),il(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,R=lm(o.nextSibling),aa=t,z=!0,oa=null,sa=!1,e!==null&&ia(t,e),t=nl(t,a.children),t.flags|=134221824,t)}function ol(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function sl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ho(n)===null&&(t=e),e=e.sibling}return t}function cl(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 ll(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 ul(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zo.current;if(t.flags&128)return Bo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Bo(t,o),i===`backwards`&&e!==null?(ll(e),Lc(e,t,r,n),ll(e)):Lc(e,t,r,n),r=z?Ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ol(e,n,t);else if(e.tag===19)ol(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=sl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ll(t)),cl(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&&Ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}cl(t,!0,n,null,a,r);break;case`together`:cl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=sl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),cl(t,!1,i,n,a,r)}return t.child}function V(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Lc(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(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=Ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function pl(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:Ne(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Po(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?tl(e,t,n):(Po(t),e=dl(e,t,n),e===null?null:e.sibling)}Po(t);break;case 19:if(t.flags&128)return ul(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ul(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bo(t,zo.current),r)break;return null;case 22:return t.lanes=0,Vc(e,t,n,t.pendingProps);case 24:ya(t,Ma,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ic=!0;else{if(!fl(e,n)&&!(t.flags&128))return Ic=!1,pl(e,t,n);Ic=!!(e.flags&131072)}}else Ic=!1,z&&t.flags&1048576&&ta(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Fi(e)?(r=Tc(e,r),t.tag=1,t=Xc(null,t,e,r,n)):(t.tag=0,t=Jc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===oe){t.tag=11,t=Rc(null,t,e,r,n);break a}if(a===le){t.tag=14,t=zc(null,t,e,r,n);break a}if(a===ae){t.tag=10,t.type=e,t=V(null,t,n);break a}}throw t=ye(e)||e,Error(i(306,t,``))}}return t;case 0:return Jc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Tc(r,t.pendingProps),Xc(e,t,r,a,n);case 3:a:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,_o(e,t),wo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,Ma,r),r!==o.cache&&Sa(t,[Ma],n,!0),Co(),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=Zc(e,t,r,n);break a}if(r!==a){a=Wi(Error(i(424)),t),ha(a),t=Zc(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(R=lm(e.firstChild),aa=t,z=!0,oa=null,sa=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===a){t=dl(e,t,n);break a}Lc(e,t,r,n)}t=t.child}return t;case 26:return qc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(t.stateNode=fp(t.type,t.pendingProps,ke.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&z&&(r=t.stateNode=hm(t.type,t.pendingProps,ke.current),aa=t,sa=!0,a=R,Sp(t.type)?(um=a,R=lm(r.firstChild)):R=a),Lc(e,t,t.pendingProps.children,n),qc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=R)&&(r=rm(r,t.type,t.pendingProps,sa),r===null?a=!1:(t.stateNode=r,aa=t,R=lm(r.firstChild),sa=!1,a=!0)),a||la(t)),Ne(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=ts(e,t,is,null,null,n),sh._currentValue=a),qc(e,t),Lc(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=R)&&(n=im(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,aa=t,R=null,e=!0)),e||la(t)),null;case 13:return tl(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Lc(e,t,r,n),t.child;case 11:return Rc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,qc(e,t),Lc(e,t,r,n),t.child;case 8:return Lc(e,t,t.pendingProps.children,n),t.child;case 12:return Lc(e,t,t.pendingProps.children,n),t.child;case 10:return V(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ta(t),a=Ea(a),r=r(a),t.flags|=1,Lc(e,t,r,n),t.child;case 14:return zc(e,t,t.type,t.pendingProps,n);case 15:return Bc(e,t,t.type,t.pendingProps,n);case 19:return ul(e,t,n);case 31:return Kc(e,t,n);case 22:return Vc(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(Ma),e===null?(a=qa(),a===null&&(a=$u,o=Na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},go(t),ya(t,Ma,a)):((e.lanes&n)!==0&&(_o(e,t),wo(t,null,null,n),Co()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ya(t,Ma,r),r!==a.cache&&Sa(t,[Ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ya(t,Ma,r))),Lc(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:z&&na(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:qc(e,t),Lc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function hl(e){e.flags|=4}function gl(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(Hd())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Hd())e.flags|=8192;else throw ro=$a,Za}}function H(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:_t(),e.lanes|=t,ud|=t)}function U(e,t){if(!z)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 W(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(ra(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(t),null;case 1:return W(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(Ma),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),W(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(W(t),gl(t,a,null,r,n)):(W(t),_l(t,o))):o?o===e.memoizedState?(W(t),t.flags&=-16777217):(hl(t),W(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),W(t),gl(t,a,e,r,n)),null;case 27:if(Pe(t),n=ke.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return W(t),t.subtreeFlags&=-33554433,null}e=De.current,fa(t)?ua(t,e):(e=hm(a,r,n),t.stateNode=e,hl(t))}return W(t),t.subtreeFlags&=-33554433,null;case 5:if(Pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return W(t),t.subtreeFlags&=-33554433,null}if(o=De.current,fa(t))ua(t,o);else{var s=lp(ke.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[Ot]=t,o[kt]=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&&hl(t)}}return W(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ke.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=aa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||la(t,!0)}else e=lp(e).createTextNode(r),e[Ot]=t,t.stateNode=e}return W(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(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[Ot]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return W(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(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[Ot]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(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),H(t,t.updateQueue),W(t),null);case 4:return Me(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,W(t),null;case 10:return ba(t.type),W(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return W(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)U(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,U(r,!1),e=o.updateQueue,t.updateQueue=e,H(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Li(n,e),n=n.sibling;return Bo(t,zo.current&1|2),z&&ea(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&qe()>gd&&(t.flags|=128,a=!0,U(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,H(t,e),U(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return W(t),null}else 2*qe()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,U(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=qe(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?Bo(t,o):(n=o,Ee(Mo,t),Ee(zo,n),No===null&&(No=t)),z&&ea(t,r.treeForkCount),e}return W(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(W(t),t.subtreeFlags&6&&(t.flags|=8192)):W(t),n=t.updateQueue,n!==null&&H(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&&Te(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),W(t),null;case 25:return null;case 30:return t.flags|=33554432,W(t),null}throw Error(i(156,t.tag))}function yl(e,t){switch(ra(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pe(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(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 Me(),null;case 10:return ba(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&Te(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function bl(e,t){switch(ra(t),t.tag){case 3:ba(Ma),Me();break;case 26:case 27:case 5:Pe(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:ba(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&Te(Ka);break;case 24:ba(Ma)}}function xl(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){pf(t,t.return,e)}}function Sl(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){pf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){pf(t,t.return,e)}}function Cl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){pf(e,e.return,t)}}}function wl(e,t,n){n.props=Tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){pf(e,t,n)}}function Tl(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=xi(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){pf(e,t,n)}}function El(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){pf(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){pf(e,t,n)}else n.current=null}}function Dl(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 Ol(e){for(var t=e.return;t!==null&&(jl(t)&&em(e.stateNode,t.stateNode),!Al(t));)t=t.return}function kl(e){for(var t=e.return;t!==null&&(jl(t)&&tm(e.stateNode,t.stateNode),!Al(t));)t=t.return}function Al(e){return e.tag===5||e.tag===3||e.tag===27}function jl(e){return e&&e.tag===7&&e.stateNode!==null}function Ml(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){pf(e,e.return,t)}}function Nl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[kt]=t}catch(t){pf(e,e.return,t)}}function Pl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Fl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Pl(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 Il(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=wn)),Dl(e,r),N=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Dl(e,r),N=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(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[Ot]=e,t[kt]=n}catch(t){pf(e,e.return,t)}}var zl=!1,Bl=null;function Vl(e){(e.tag===30||e.subtreeFlags&33554432)&&(zl=!0)}var Hl=null;function Ul(){var e=Hl;return Hl=null,e}var Wl=0;function Gl(e,t,n,r,i){return Wl=0,Kl(e.child,t,n,r,i)}function Kl(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);zl=!0,Tp(o,Wl===0?t:t+`_`+Wl,n),Wl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Kl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function ql(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ql(e.child,t)),e=e.sibling}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Jl(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=Ci(t.default,t.share),t!==`none`&&(Gl(e,n,t,null,!1)||ql(e.child,!1))}e=e.sibling}}function Yl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=xi(r,n),a=Ci(r.default,n.paired?r.share:r.enter);a===`none`?Jl(e):Gl(e,i,a,null,!1)?(Jl(e),n.paired||t||Md(e,r.onEnter)):ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e,t),e=e.sibling;else Jl(e)}function Xl(e){if(Bl!==null&&Bl.size!==0){var t=Bl;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=Ci(n.default,n.share);if(a!==`none`&&(Gl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):ql(e.child,!1)),t.delete(r),t.size===0)break}}}Xl(e)}e=e.sibling}}}function Zl(e){if(e.tag===30){var t=e.memoizedProps,n=xi(t,e.stateNode),r=Bl===null?void 0:Bl.get(n),i=Ci(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Gl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Bl.delete(n),Md(e,t.onShare)):ql(e.child,!1)),Bl!==null&&Xl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Bl!==null&&Xl(e)}function Ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=xi(t,e.stateNode);t=Ci(t.default,t.update),e.flags&=-5,t!==`none`&&Gl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Ql(e);e=e.sibling}}function $l(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,ql(e.child,!1))}$l(e)}e=e.sibling}}function eu(e){if(e.tag===30)e.stateNode.paired=null,ql(e.child,!1),$l(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else $l(e)}function tu(e){for(e=e.child;e!==null;)e.tag===30?ql(e.child,!1):e.subtreeFlags&33554432&&tu(e),e=e.sibling}function nu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Wl<a.length){var l=a[Wl],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,Wl===0?n:n+`_`+Wl,i),s&&e.flags&4||(Hl===null&&(Hl=[]),Hl.push(c,Wl===0?r:r+`_`+Wl,t.memoizedProps)),Wl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:nu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ru(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=xi(n,r),a=Ci(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;Wl=0,i=nu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&ru(e,t);e=e.sibling}}var iu=!1,G=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,K=null,cu=!1,lu=!1,uu=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,sp=gh,e=Zr(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,K=t,t=n?9270:1024;K!==null;){if(e=K,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Zl(r[a]);if(e.alternate===null&&e.flags&2)n&&Vl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Zl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Vl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,K=r):(n&&Ql(e),pu(n))}}Bl=null}function pu(e){for(;K!==null;){var t=K,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=Tc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){pf(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=xi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Ci(a.default,a.update),a!==`none`&&Gl(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,K=r;break}K=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&xl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){pf(n,n.return,e)}else{var i=Tc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){pf(n,n.return,e)}}}r&64&&Cl(n),r&512&&Tl(n,n.return);break;case 3:if(Pu(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{Eo(e,t)}catch(e){pf(n,n.return,e)}}break;case 27:t===null&&r&4&&Rl(n);case 26:case 5:Pu(e,n),t===null&&r&4&&Ml(n),r&512&&Tl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||iu,!r){var a=t!==null&&t.memoizedState!==null||G;t=iu,i=G,iu=r,(G=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),iu=t,G=i}break;case 30:Pu(e,n),r&512&&Tl(n,n.return);break;case 7:r&512&&Tl(n,n.return);default:Pu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(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){pf(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,N=!0}catch(t){pf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){pf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Lt(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 yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount==`function`)try{rt.onCommitFiberUnmount(nt,n)}catch{}switch(n.tag){case 26:G||El(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!G&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:G||El(n,t),kl(n);var r=yu,i=bu;Sp(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:G||El(n,t),kl(n);case 6:if(n.tag===6&&kl(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),N=!0}catch(e){pf(n,t,e)}else try{yu.removeChild(n.stateNode),N=!0}catch(e){pf(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:Sl(2,n,t),G||Sl(4,n,t),xu(e,t,n);break;case 1:G||(El(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&wl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:G=(r=G)||n.memoizedState!==null,xu(e,t,n),G=r;break;case 30:El(n,t),xu(e,t,n);break;case 7:G||El(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){pf(t,t.return,e)}}}function wu(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){pf(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Du(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)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(i(160));Su(s,c,o),yu=null,bu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(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}Du(t,e,n),Au(e),a&4&&(Sl(3,e,e.return),xl(3,e),Sl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),a&512&&(G||r===null||El(r,r.return)),a&64&&iu&&(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=Ou,Du(t,e,n),Au(e),a&512&&(G||r===null||El(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(iu)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[Ft]||r[Ot]||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[Ot]=e,Ht(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[Ot]=e,Ht(r),t=r}e.stateNode=t}}else iu||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Nl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||G||t.parentNode.removeChild(t)):a.count--,n===null?iu||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),a&512&&(G||r===null||El(r,r.return)),r!==null&&a&4&&Nl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Du(t,e,n),au=o,Au(e),a&512&&(G||r===null||El(r,r.return)),e.flags&32){t=e.stateNode;try{gn(t,``),N=!0}catch(t){pf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Nl(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Du(t,e,n),Au(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,N=!0}catch(t){pf(e,e.return,t)}}break;case 3:if(N=!1,Wm=null,o=Ou,Ou=bm(t.containerInfo),Du(t,e,n),Ou=o,Au(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){pf(e,e.return,t)}ou&&(ou=!1,ju(e)),N=!1;break;case 4:a=au,au=iu,r=Qt(),o=Ou,Ou=bm(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=o,N&&lu&&(uu=!0),N=r,au=a;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=qe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=iu,l=G,u=au;iu=c||o,au=u||o,G=l||s,Du(t,e,n),G=l,au=u,iu=c,Au(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||iu||G||(t=s||G,n=iu,r=G,iu=o||iu,G=t,Fu(e,2),iu=n,G=r),!o&&au||hu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:a&512&&(G||r===null||El(r,r.return)),a=Qt(),o=lu,s=(n&335544064)===n,c=e.memoizedProps,lu=s&&Ci(c.default,c.update)!==`none`,Du(t,e,n),Au(e),s&&r!==null&&N&&(e.flags|=4),lu=o,N=a;break;case 21:break;case 7:a&512&&(G||r===null||El(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Pl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(jl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Al(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ll(e,Fl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(gn(l,``),n.flags&=-33),Ll(e,Fl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Il(e,Fl(e),u,s);break;default:throw Error(i(161))}}catch(t){pf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else ru(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)Yl(e,!1);else switch(e.tag){case 3:if(du=cu=!1,Ul(),Mu(t,e),!cu&&!uu){if(e=Hl,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`})),du=!0}Hl=null;break;case 5:Mu(t,e);break;case 4:r=cu,cu=!1,Mu(t,e),cu&&(uu=!0),cu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):Yl(e,!1));break;case 30:r=cu,i=Ul(),cu=!1,Mu(t,e),cu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=xi(a,o),o=xi(n.memoizedProps,o);var s=Ci(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Wl=0,t=nu(e,n,t,o,s,a,!0),Wl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Hl=i):i!==null&&(i.push.apply(i,Hl),Hl=i),cu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Sl(4,n,n.return),Fu(n,r);break;case 1:El(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&wl(n,n.return,i),Fu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:El(n,n.return),n.tag!==5&&n.tag!==27||kl(n),Fu(n,r);break;case 6:kl(n);break;case 26:El(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||G||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:El(n,n.return),Fu(n,r);break;case 7:El(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(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:Iu(i,a,n),xl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){pf(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++)To(l[i],c)}catch(e){pf(r,r.return,e)}}s&&o&64&&Cl(a),Tl(a,a.return);break;case 27:n&2&&Rl(a);case 5:a.tag!==5&&a.tag!==27||Ol(a),Iu(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 6:Ol(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||iu||Km(bm(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),Tl(a,a.return);break;case 30:Iu(i,a,n),Tl(a,a.return);break;case 7:Tl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(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&&Pa(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&tu(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&eu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&xl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&du&&(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&&Pa(a)));break;case 12:if(a&2048){zu(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){pf(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(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&&eu(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&eu(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(ql(a.child,!0),ql(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(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:Vu(a,o,s,c,i),xl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(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:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Ou;Ou=bm(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Bl===null&&(Bl=new Map),Bl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(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 qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];K=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];K=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;K!==null;){var n=K;switch(n.tag){case 0:case 11:case 15:Sl(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:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,K=r;else a:for(n=e;K!==null;){r=K;var i=r.sibling,a=r.return;if(vu(r),r===n){K=null;break a}if(i!==null){i.return=a,K=i;break a}K=a}}}var Zu={getCacheForType:function(e){var t=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,q=0,$u=null,J=null,Y=0,ed=0,td=null,nd=!1,X=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return q&2&&Y!==0?Y&-Y:A.T===null?Tt():Pf()}function Z(){if(ld===0){if(!(Y&536870912)||z){var e=ut;ut<<=1,!(ut&3932160)&&(ut=262144),ld=e}else ld=536870912}return e=Mo.current,e!==null&&(e.flags|=32),ld}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(xi(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Nd(e,t,n){(e===$u&&(ed===2||ed===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,Y,ld,!1)),yt(e,n),(!(q&2)||e!==$u)&&(e===$u&&(!(q&2)&&(sd|=n),ad===4&&Ld(e,Y,ld,!1)),Ef(e))}function Pd(e,t,n){if(q&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||mt(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){X&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n)){a=Kd(e,t,!1),o=!1;continue}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=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=fd,fd=a,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Bd(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,ld,!nd);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=md+300-qe(),10<a)){if(Ld(r,t,ld,!nd),pt(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=gp(Fd.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,nd,o,`Throttled`,-0,0),a);break a}Fd(r,n,fd,_d,pd,t,ld,sd,ud,nd,o,null,-0,0)}break}while(1);Ef(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;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wn},Bl=null,Gu(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?md-qe():(a&4194048)===a?hd-qe():0,m=eh(d,m),m!==null)){Sd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l);return}tf(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(!Gr(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=ht(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-at(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&bt(e,n,t)}function Rd(){return q&6?!0:(Df(0,!1),!1)}function zd(){if(J!==null){if(ed===0)var e=J.return;else e=J,va=_a=null,ss(e),oo=null,so=0,e=J;for(;e!==null;)bl(e.alternate,e),e=e.return;J=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,zd(),$u=e,J=n=Ii(e.current,null),Y=t,ed=0,td=null,nd=!1,X=mt(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=ht(e,t),Oi(),n}function Vd(e,t){B=null,A.H=_c,t===Xa||t===Qa?(t=io(),ed=3):t===Za?(t=io(),ed=4):ed=t===Fc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,td=t,J===null&&(ad=1,kc(e,Wi(t,e.current)))}function Hd(){var e=Mo.current;return e===null?!0:(Y&4194048)===Y?No===null:(Y&62914560)===Y||Y&536870912?e===No:!1}function Ud(){var e=A.H;return A.H=_c,e===null?_c:e}function Wd(){var e=A.A;return A.A=Zu,e}function Gd(){ad=4,nd||(Y&4194048)!==Y&&Mo.current!==null||(X=!0),!(od&134217727)&&!(sd&134217727)||$u===null||Ld($u,Y,ld,!1)}function Kd(e,t,n){var r=q;q|=2;var i=Ud(),a=Wd();($u!==e||Y!==t)&&(_d=null,Bd(e,t)),t=!1;var o=ad;a:do try{if(ed!==0&&J!==null){var s=J,c=td;switch(ed){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:Mo.current===null&&(t=!0);var l=ed;if(ed=0,td=null,Qd(e,s,c,l),n&&X){o=0;break a}break;default:l=ed,ed=0,td=null,Qd(e,s,c,l)}}qd(),o=ad;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,q=r,A.H=i,A.A=a,J===null&&($u=null,Y=0,Oi()),o}function qd(){for(;J!==null;)Xd(J)}function Jd(e,t){var n=q;q|=2;var r=Ud(),a=Wd();$u!==e||Y!==t?(_d=null,gd=qe()+500,Bd(e,t)):X=mt(e,t);a:do try{if(ed!==0&&J!==null){t=J;var o=td;b:switch(ed){case 1:ed=0,td=null,Qd(e,t,o,1);break;case 2:case 9:if(eo(o)){ed=0,td=null,Zd(t);break}t=function(){ed!==2&&ed!==9||$u!==e||(ed=7),Ef(e)},o.then(t,t);break a;case 3:ed=7;break a;case 4:ed=5;break a;case 7:eo(o)?(ed=0,td=null,Zd(t)):(ed=0,td=null,Qd(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Ym(s):c.stateNode.complete){ed=0,td=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,$d(u))}break b}}ed=0,td=null,Qd(e,t,o,5);break;case 6:ed=0,td=null,Qd(e,t,o,6);break;case 8:zd(),ad=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return va=_a=null,A.H=r,A.A=a,q=n,J===null?($u=null,Y=0,Oi(),ad):0}function Yd(){for(;J!==null&&!Ge();)Xd(J)}function Xd(e){var t=ml(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?$d(e):J=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Yc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=Yc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:ss(t);var r=t;r===aa&&(z?(da(r),r.tag===5&&r.stateNode!=null&&(R=r.stateNode)):(da(r),z=!0));default:bl(n,t),t=J=Li(t,id),t=ml(n,t,id)}e.memoizedProps=e.pendingProps,t===null?$d(e):J=t}function Qd(e,t,n,r){va=_a=null,ss(t),oo=null,so=0;var i=t.return;try{if(Pc(e,i,t,n,Y)){ad=1,kc(e,Wi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;ad=1,kc(e,Wi(n,e.current)),J=null;return}t.flags&32768?(z||r===1?e=!0:X||Y&536870912?e=!1:(nd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Mo.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,nd);return}e=t.return;var n=vl(t.alternate,t,id);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);ad===0&&(ad=5)}function ef(e,t){do{var n=yl(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);ad=6,J=null}function tf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(yd!==0);if(q&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===$u&&(J=$u=null,Y=0),xd=t,bd=e,Sd=n,wd=a,Td=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=Di,M(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=La(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Ze,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),zl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,i=j.p,j.p=2,a=q,q|=4;try{fu(e,t,n)}finally{q=a,j.p=i,A.T=r}}yd=1,zl?Ed=Mp(o,e.containerInfo,Od,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function af(){yd===3&&(yd=0,Nu(xd,bd),yd=4)}function of(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=A.T,A.T=null;var i=j.p;j.p=2;var a=q;q|=4;try{lu=uu=!1,ku(t,e,n),n=cp;var o=Zr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Xr(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 _=Yr(s,h),v=Yr(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{q=a,j.p=i,A.T=r}}e.current=t,yd=2}}function sf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=q;q|=4;try{mu(e,t.alternate,t)}finally{q=i,j.p=r,A.T=n}}yd=3}}function cf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,Ke();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),wt(r),n=n.stateNode,rt&&typeof rt.onCommitFiberRoot==`function`)try{rt.onCommitFiberRoot(nt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=A.T,a=j.p,j.p=2,A.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{A.T=n,j.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=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);Sd&3&&uf(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function uf(){return Ed!==null&&(Ed.skipTransition(),Ed=null),of(),sf(),cf(),df()}function df(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=wt(Sd),r=A.T,a=j.p;try{j.p=32>n?32:n,A.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,q&6)throw Error(i(331));var c=q;if(q|=4,Ju(o.current),Bu(o,o.current,s,n),q=c,Df(0,!1),rt&&typeof rt.onPostCommitFiberRoot==`function`)try{rt.onPostCommitFiberRoot(nt,o)}catch{}return!0}finally{j.p=a,A.T=r,lf(e,t)}}function ff(e,t,n){t=Wi(n,t),t=jc(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(yt(e,2),Ef(e))}function pf(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Wi(n,e),n=Mc(2),r=yo(t,n,2),r!==null&&(Nc(n,r,t,e),yt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;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=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$u===e&&(Y&n)===n&&(ad===4||ad===3&&(Y&62914560)===Y&&300>qe()-md?q&2?cd|=n:Bd(e,0):cd|=n,ud===Y&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=_t()),e=ji(e,t),e!==null&&(yt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(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),gf(e,n)}function yf(e,t){return Ue(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-at(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Y,a=pt(r,r===$u?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||mt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=qe(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-at(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=gt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=$u,n=Y,n=pt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ed===2||ed===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&We(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||mt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&We(r),wt(n)){case 2:case 8:n=Xe;break;case 32:n=Ze;break;case 268435456:n=$e;break;default:n=Ze}return r=jf.bind(null,e),n=Ue(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&We(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=Y;return r=pt(e,e===$u?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),Af(e,qe()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(uf())return null;Pd(e,t,!0)}function Nf(){bp(function(){q&6?Ue(Ye,Of):kf()})}function Pf(){if(Tf===0){var e=Ba;e===0&&(e=lt,lt<<=1,!(lt&261888)&&(lt=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Cn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[kt]||null).action),o=r.submitter;o&&(t=(t=o[kt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);rc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),rc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<vi.length;Lf++){var Rf=vi[Lf];yi(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}yi(ui,`onAnimationEnd`),yi(di,`onAnimationIteration`),yi(fi,`onAnimationStart`),yi(`dblclick`,`onDoubleClick`),yi(`focusin`,`onFocus`),yi(`focusout`,`onBlur`),yi(pi,`onTransitionRun`),yi(mi,`onTransitionStart`),yi(hi,`onTransitionCancel`),yi(gi,`onTransitionEnd`),qt(`onMouseEnter`,[`mouseout`,`mouseover`]),qt(`onMouseLeave`,[`mouseout`,`mouseover`]),qt(`onPointerEnter`,[`pointerout`,`pointerover`]),qt(`onPointerLeave`,[`pointerout`,`pointerover`]),Kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(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){wi(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){wi(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[jt];n===void 0&&(n=t[jt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Wt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(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,!Pn||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 Kf(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=Rt(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}jn(function(){var r=a,i=En(n),s=[];a:{var c=_i.get(e);if(c!==void 0){var l=Gn,u=e;switch(e){case`keypress`:if(Bn(n)===0)break a;case`keydown`:case`keyup`:l=cr;break;case`focusin`:u=`focus`,l=$n;break;case`focusout`:u=`blur`,l=$n;break;case`beforeblur`:case`afterblur`:l=$n;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=Zn;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=dr;break;case ui:case di:case fi:l=er;break;case gi:l=fr;break;case`scroll`:case`scrollend`:l=qn;break;case`wheel`:l=pr;break;case`copy`:case`cut`:case`paste`:l=tr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=lr;break;case`submit`:l=ur;break;case`toggle`:case`beforetoggle`:l=mr}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=Mn(m,p),g!=null&&d.push(qf(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!==Tn&&(u=n.relatedTarget||n.fromElement)&&(Rt(u)||u[At]))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?Rt(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=Zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=lr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Bt(c),h=l==null?u:Bt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Rt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?ee(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Pr;else if(Or(c)){if(Fr)_=Ur;else{_=Vr;var v=Br}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&bn(r.elementType)&&(_=Pr):_=Hr;if(_&&=_(e,r)){kr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Bt(r):window,e){case`focusin`:(Or(v)||v.contentEditable===`true`)&&(ei=v,ti=r,ni=null);break;case`focusout`:ni=ti=ei=null;break;case`mousedown`:ri=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ri=!1,ii(s,n,i);break;case`selectionchange`:if($r)break;case`keydown`:case`keyup`:ii(s,n,i)}var y;if(gr)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 wr?Sr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(yr&&n.locale!==`ko`&&(wr||b!==`onCompositionStart`?b===`onCompositionEnd`&&wr&&(y=zn()):(In=i,Ln=`value`in In?In.value:In.textContent,wr=!0)),v=Jf(r,b),0<v.length&&(b=new nr(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Cr(n),y!==null&&(b.data=y)))),(y=vr?Tr(e,n):Er(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new nr(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=Mn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Mn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=Mn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Mn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||gn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&gn(e,``+r);else return;break;case`className`:en(e,`class`,r);break;case`tabIndex`:en(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:en(e,n,r);break;case`style`:yn(e,r,o);return;case`data`:if(t!==`object`){en(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Cn(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`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Cn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=wn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`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=Cn(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`:Q(`beforetoggle`,e),Q(`toggle`,e),$t(e,`popover`,r);break;case`xlinkActuate`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:tn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:tn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:tn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:$t(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=xn.get(n)||n,$t(e,n,r);else return}N=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:yn(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`)gn(e,r);else if(typeof r==`number`||typeof r==`bigint`)gn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=wn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Gt.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[kt]||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}N=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):$t(e,n,r)}return}N=!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`:Q(`error`,e),Q(`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:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`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:$(e,t,r,d,n,null)}}dn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`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:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&pn(e,!!r,n,!0):pn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`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:$(e,t,s,c,n,null)}hn(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:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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:$(e,t,u,r,n,null)}return;default:if(bn(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&&$(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)||$(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&&(N=!0),o=m;break;case`name`:m!==f&&(N=!0),a=m;break;case`checked`:m!==f&&(N=!0),u=m;break;case`defaultChecked`:m!==f&&(N=!0),d=m;break;case`value`:m!==f&&(N=!0),s=m;break;case`defaultValue`:m!==f&&(N=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}un(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)||$(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&&(N=!0),p=o;break;case`defaultValue`:o!==l&&(N=!0),c=o;break;case`multiple`:o!==l&&(N=!0),s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?pn(e,!!n,n?[]:``,!1):pn(e,!!n,t,!0)):pn(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:$(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&&(N=!0),p=a;break;case`defaultValue`:a!==o&&(N=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}mn(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:$(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&&(N=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(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)&&$(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:$(e,t,u,p,r,m)}return;default:if(bn(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)&&$(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||$(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[Ot]=r,n[kt]=t,np(n,e,t),Ht(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[Ft]||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}:E({},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=Rt(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=ee(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=ee(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),Lt(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[Ft])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&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===wn&&(e.onclick=null),Lt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Lt(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=j.d;j.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=zt(e);t!==null&&t.tag===5&&t.type===`form`?ac(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=ln(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),Ht(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="`+ln(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+ln(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+ln(n.imageSizes)+`"]`)):i+=`[href="`+ln(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=E({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[It]=!0,o.onload=o.onerror=function(){Ut(o)}),Ht(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="`+ln(r)+`"][href="`+ln(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=E({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),Ht(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Vt(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=E({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Ht(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=Vt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=E({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ht(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=Vt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=E({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ht(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=ke.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=Vt(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=Vt(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=Vt(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="`+ln(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return E({},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[It]){r.loading=1;return}}else t=e.createElement(`link`),t[It]=!0,t.onload=t.onerror=Ut.bind(null,t),np(t,`link`,n),Ht(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="`+ln(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~="`+ln(n.href)+`"]`);if(r)return t.instance=r,Ht(r),r;var a=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ht(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,Ht(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Ht(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,Ht(a),a):(r=n,(a=vm.get(o))&&(r=E({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ht(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[Ft]||a[Ot]||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,Ht(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Ht(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:ae,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_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=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(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=L(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function uh(e){return e?(e=I,e):I}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(Nd(n,e,t),bo(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=ji(e,67108864);t!==null&&Nd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=Ct(t);var n=ji(e,t);n!==null&&Nd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,yh(e,t,n,r)}finally{j.p=a,A.T=i}}function vh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,yh(e,t,n,r)}finally{j.p=a,A.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(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=zt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ft(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-at(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(q&6)&&(gd=qe()+500,Df(0,!1))}}break;case 31:case 13:s=ji(a,2),s!==null&&Nd(s,a,2),Rd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=En(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Rt(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(Je()){case Ye:return 2;case Xe:return 8;case Ze:case Qe:return 32;case $e: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=zt(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=Rt(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,Et(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Et(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);Tn=r,n.target.dispatchEvent(r),Tn=null}else return t=zt(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=zt(n);a!==null&&(e.splice(t,3),t-=3,rc(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[kt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[kt]||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,jd(),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[At]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tt();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.0`)throw Error(i(527,Kh,`19.3.0`));j.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.0`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{nt=Jh.inject(qh),rt=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ec,s=Dc,c=Oc;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[At]=t.current,Wf(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()})),_=`modulepreload`,v=function(e,t){return new URL(e,t).href},y={},b=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=v(t,n),t=s(t),t in y)return;y[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:_,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},x=c(u(),1),S=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,C=/^[\\/]{2}/;function w(e,t){return t+e.replace(/\\/g,`/`)}var T=`popstate`;function ee(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function E(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return re(``,{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:ie(t)}return ae(t,n,null,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function te(){return Math.random().toString(36).substring(2,10)}function ne(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 re(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?k(t):t,state:n,key:t&&t.key||r||te(),mask:i}}function ie({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 k(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 ae(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=ee(e)?e:re(h.location,e,t);n&&n(r,e),l=u()+1;let d=ne(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=ee(e)?e:re(h.location,e,t);n&&n(r,e),l=u();let i=ne(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 oe(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(T,d),c=e,()=>{i.removeEventListener(T,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 oe(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),D(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:ie(t);return i=i.replace(/ $/,`%20`),!n&&C.test(i)&&(i=r+i),new URL(i,r)}function se(e,t,n=`/`){return ce(e,t,n,!1)}function ce(e,t,n,r,i){let a=Te((typeof t==`string`?k(t):t).pathname||`/`,n);if(a==null)return null;let o=i??le(e),s=null,c=we(a);for(let e=0;s==null&&e<o.length;++e)s=j(o[e],c,r);return s}function le(e){let t=ue(e);return fe(t),t}function ue(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;D(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=Ne([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ue(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:be(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Ce(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 de(e.path))a(e,t,!0,n)}),t}function de(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=de(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 fe(e){e.sort((e,t)=>e.score===t.score?A(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var pe=/^:[\w-]+$/,me=3,he=2,ge=1,_e=10,ve=-2,ye=e=>e===`*`;function be(e,t){let n=e.split(`/`),r=n.length;return n.some(ye)&&(r+=ve),t&&(r+=he),n.filter(e=>!ye(e)).reduce((e,t)=>e+(pe.test(t)?me:t===``?ge:_e),r)}function A(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 j(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?Se(u,l,s.matcher,s.compiledParams):xe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=xe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Ne([a,d.pathname]),pathnameBase:Fe(Ne([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Ne([a,d.pathnameBase]))}return o}function xe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ce(e.path,e.caseSensitive,e.end);return Se(e,t,n,r)}function Se(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Pe(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Pe(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 Ce(e,t=!1,n=!0){O(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 we(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!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 Te(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 Ee(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?k(e):e,a;return n?(n=Me(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?De(n.substring(1),`/`):De(n,t)):a=t,{pathname:a,search:Ie(r),hash:Le(i)}}function De(e,t){let n=Pe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Oe(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 ke(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ae(e){let t=ke(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function je(e,t,n,r=!1){let i;typeof e==`string`?i=k(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),Oe(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),Oe(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),Oe(`#`,`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=Ee(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Me=e=>e.replace(/[\\/]{2,}/g,`/`),Ne=e=>Me(e.join(`/`));function Pe(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 Fe=e=>Pe(e).replace(/^\/*/,`/`),Ie=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Le=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Re=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 ze(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Be(e){return Ne(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ve=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function He(e,t){let n=e;if(typeof n!=`string`||!S.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ve)try{let e=new URL(window.location.href),r=C.test(n)?new URL(w(n,e.protocol)):new URL(n),a=Te(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!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 Ue=new URL(`http://localhost`);function We(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ue)}catch{return Ue}}function Ge(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ke(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 qe(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&&!Ge(i,n),s=!Ge(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ke(e,i)||!Ge(i,a)))throw Error(`External navigation is not allowed`)}var Je=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Je);var Ye=[`GET`,...Je];new Set(Ye);var Xe=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ze(e){try{return Xe.includes(new URL(e).protocol)}catch{return!1}}var Qe=x.createContext(null);Qe.displayName=`DataRouter`;var $e=x.createContext(null);$e.displayName=`DataRouterState`;var et=x.createContext(!1);function tt(){return x.useContext(et)}var nt=x.createContext({isTransitioning:!1});nt.displayName=`ViewTransition`;var rt=x.createContext(new Map);rt.displayName=`Fetchers`;var it=x.createContext(null);it.displayName=`Await`;var at=x.createContext(null);at.displayName=`Navigation`;var ot=x.createContext(null);ot.displayName=`Location`;var st=x.createContext({outlet:null,matches:[],isDataRoute:!1});st.displayName=`Route`;var ct=x.createContext(null);ct.displayName=`RouteError`;var lt=`REACT_ROUTER_ERROR`,ut=`REDIRECT`,dt=`ROUTE_ERROR_RESPONSE`;function ft(e){if(e.startsWith(`${lt}:${ut}:{`))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 pt(e){if(e.startsWith(`${lt}:${dt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Re(t.status,t.statusText,t.data)}catch{}}function mt(e,{relative:t}={}){D(ht(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=x.useContext(at),{hash:i,pathname:a,search:o}=Ct(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ne([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ht(){return x.useContext(ot)!=null}function gt(){return D(ht(),`useLocation() may be used only in the context of a <Router> component.`),x.useContext(ot).location}var _t=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function vt(e){x.useContext(at).static||x.useLayoutEffect(e)}function yt(){let{isDataRoute:e}=x.useContext(st);return e?Bt():M()}function M(){D(ht(),`useNavigate() may be used only in the context of a <Router> component.`);let e=x.useContext(Qe),{basename:t,navigator:n}=x.useContext(at),{matches:r}=x.useContext(st),{pathname:i}=gt(),a=JSON.stringify(Ae(r)),o=x.useRef(!1);return vt(()=>{o.current=!0}),x.useCallback((r,s={})=>{if(O(o.current,_t),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=je(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ne([t,c.pathname])),qe(typeof r==`string`?r:ie(r),n.createHref(c),We(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var bt=x.createContext(null);function xt(e){let t=x.useContext(st).outlet;return x.useMemo(()=>t&&x.createElement(bt.Provider,{value:e},t),[t,e])}function St(){let{matches:e}=x.useContext(st);return e[e.length-1]?.params??{}}function Ct(e,{relative:t}={}){let{matches:n}=x.useContext(st),{pathname:r}=gt(),i=JSON.stringify(Ae(n));return x.useMemo(()=>je(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function wt(e,t){return Tt(e,t)}function Tt(e,t,n){D(ht(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=x.useContext(at),{matches:i}=x.useContext(st),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||``;Ht(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=gt(),d;if(t){let e=typeof t==`string`?k(t):t;D(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})):se(e,{pathname:p});O(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(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=Mt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ne([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ne([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?x.createElement(ot.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Et(){let e=zt(),t=ze(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=x.createElement(x.Fragment,null,x.createElement(`p`,null,`💿 Hey developer 👋`),x.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,x.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,x.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),x.createElement(x.Fragment,null,x.createElement(`h2`,null,`Unexpected Application Error!`),x.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?x.createElement(`pre`,{style:i},n):null,o)}var Dt=x.createElement(Et,null),Ot=class extends x.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=pt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:x.createElement(st.Provider,{value:this.props.routeContext},x.createElement(ct.Provider,{value:e,children:this.props.component}));return this.context?x.createElement(At,{error:e},t):t}};Ot.contextType=et;var kt=new WeakMap;function At({children:e,error:t}){let{basename:n,navigator:r}=x.useContext(at);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ft(t.digest);if(e){let i=kt.get(t);if(i)throw i;let a=He(e.location,n),o=a.absoluteURL||a.to;if(qe(e.location,o,We(r),`allow-explicit`),Ze(o))throw Error(`Invalid redirect location`);if(Ve&&!kt.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 kt.set(t,n),n}}return x.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function jt({routeContext:e,match:t,children:n}){let r=x.useContext(Qe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(st.Provider,{value:e},n)}function Mt(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);D(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:Be(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||Dt,o&&(s<0&&c===0?(Ht(`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?x.createElement(n.route.Component,null):n.route.element?n.route.element:e,x.createElement(jt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?x.createElement(Ot,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Nt(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pt(e){let t=x.useContext(Qe);return D(t,Nt(e)),t}function Ft(e){let t=x.useContext($e);return D(t,Nt(e)),t}function It(e){let t=x.useContext(st);return D(t,Nt(e)),t}function Lt(e){let t=It(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Rt(){return Lt(`useRouteId`)}function zt(){let e=x.useContext(ct),t=Ft(`useRouteError`),n=Lt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Bt(){let{router:e}=Pt(`useNavigate`),t=Lt(`useNavigate`),n=x.useRef(!1);return vt(()=>{n.current=!0}),x.useCallback(async(r,i={})=>{O(n.current,_t),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Vt={};function Ht(e,t,n){!t&&!Vt[e]&&(Vt[e]=!0,O(!1,n))}x.memo(Ut);function Ut({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Tt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Wt({to:e,replace:t,state:n,relative:r}){D(ht(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=x.useContext(at);O(!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}=x.useContext(st),{pathname:s}=gt(),c=yt(),l=je(e,Ae(o),s,r===`path`);qe(typeof e==`string`?e:ie(e),a.createHref(l),We(a),`reject`);let u=JSON.stringify(l);return x.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Gt(e){return xt(e.context)}function Kt(e){D(!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 qt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){D(!ht(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=x.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=k(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=x.useMemo(()=>{let e=Te(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 O(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:x.createElement(at.Provider,{value:c},x.createElement(ot.Provider,{children:t,value:h}))}function Jt({children:e,location:t}){return wt(Yt(e),t)}x.Component;function Yt(e,t=[]){let n=[];return x.Children.forEach(e,(e,r)=>{if(!x.isValidElement(e))return;let i=[...t,r];if(e.type===x.Fragment){n.push.apply(n,Yt(e.props.children,i));return}D(e.type===Kt,`[${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>`),D(!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=Yt(e.props.children,i)),n.push(a)}),n}var Xt=`get`,Zt=`application/x-www-form-urlencoded`;function N(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Qt(e){return N(e)&&e.tagName.toLowerCase()===`button`}function $t(e){return N(e)&&e.tagName.toLowerCase()===`form`}function en(e){return N(e)&&e.tagName.toLowerCase()===`input`}function tn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nn(e,t){return e.button===0&&(!t||t===`_self`)&&!tn(e)}function rn(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 an(e,t){let n=rn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var on=null;function sn(){if(on===null)try{new FormData(document.createElement(`form`),0),on=!1}catch{on=!0}return on}var cn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ln(e){return e!=null&&!cn.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Zt}"`),null):e}function un(e,t){let n,r,i,a,o;if($t(e)){let o=e.getAttribute(`action`);r=o?Te(o,t):null,n=e.getAttribute(`method`)||Xt,i=ln(e.getAttribute(`enctype`))||Zt,a=new FormData(e)}else if(Qt(e)||en(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?Te(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Xt,i=ln(e.getAttribute(`formenctype`))||ln(o.getAttribute(`enctype`))||Zt,a=new FormData(o,e),!sn()){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(N(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Xt,r=null,i=Zt,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 dn(e,t){if(e===!1||e==null)throw Error(t)}function fn(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&&Te(i.pathname,t)===`/`?`${Pe(t)}/_root.${r}`:`${Pe(i.pathname)}.${r}`,i}async function pn(e,t){if(e.id in t)return t[e.id];try{let n=await b(()=>import(e.module),void 0,import.meta.url);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 mn(e){return e!=null&&typeof e.page==`string`}function hn(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 gn(e,t,n){return xn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await pn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(hn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function _n(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 vn(e,t,{includeHydrateFallback:n}={}){return yn(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 yn(e){return[...new Set(e)]}function bn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function xn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!mn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(bn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Sn(){let e=x.useContext(Qe);return dn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Cn(){let e=x.useContext($e);return dn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var wn=x.createContext(void 0);wn.displayName=`FrameworkContext`;function Tn(){let e=x.useContext(wn);return dn(e,`You must render this element inside a <HydratedRouter> element`),e}function En(e,t){let n=x.useContext(wn),[r,i]=x.useState(!1),[a,o]=x.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=x.useRef(null);x.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]),x.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:Dn(s,p),onBlur:Dn(c,m),onMouseEnter:Dn(l,p),onMouseLeave:Dn(u,m),onTouchStart:Dn(d,p)}]:[a,f,{}]:[!1,f,{}]}function Dn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function On({page:e,...t}){let n=tt(),{nonce:r}=Tn(),{router:i}=Sn(),a=x.useMemo(()=>se(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?x.createElement(An,{page:e,matches:a,...t}):x.createElement(jn,{page:e,matches:a,...t})):null}function kn(e){let{manifest:t,routeModules:n}=Tn(),[r,i]=x.useState([]);return x.useEffect(()=>{let r=!1;return gn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function An({page:e,matches:t,...n}){let r=gt(),{future:i}=Tn(),{basename:a}=Sn(),o=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=fn(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 x.createElement(x.Fragment,null,o.map(e=>x.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function jn({page:e,matches:t,...n}){let r=gt(),{future:i,manifest:a,routeModules:o}=Tn(),{basename:s}=Sn(),{loaderData:c,matches:l}=Cn(),u=x.useMemo(()=>_n(e,t,l,a,r,`data`),[e,t,l,a,r]),d=x.useMemo(()=>_n(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=x.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=fn(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=x.useMemo(()=>vn(d,a),[d,a]),m=kn(d);return x.createElement(x.Fragment,null,f.map(e=>x.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>x.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>x.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Mn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}x.Component;var Nn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Nn&&(window.__reactRouterVersion=`7.18.3`)}catch{}function Pn({basename:e,children:t,useTransitions:n,window:r}){let i=x.useRef();i.current??=E({window:r,v5Compat:!0});let a=i.current,[o,s]=x.useState({action:a.action,location:a.location}),c=x.useCallback(e=>{n===!1?s(e):x.startTransition(()=>s(e))},[n]);return x.useLayoutEffect(()=>a.listen(c),[a,c]),x.createElement(qt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Fn=x.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:_}=x.useContext(at),v=typeof l==`string`&&S.test(l),y=He(l,h);l=y.to;let b=mt(l,{relative:r}),C=gt(),w=null;if(o){let e=je(o,[],C.mask?C.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Ne([h,e.pathname])),w=g.createHref(e)}let[T,ee,E]=En(n,p),D=Bn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let te=!(y.isExternal||i),ne=x.createElement(`a`,{...p,...E,href:(te?w:void 0)||y.absoluteURL||b,onClick:te?O:e,ref:Mn(m,ee),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return T&&!v?x.createElement(x.Fragment,null,ne,x.createElement(On,{page:b})):ne});Fn.displayName=`Link`;var In=x.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=Ct(a,{relative:c.relative}),d=gt(),f=x.useContext($e),{navigator:p,basename:m}=x.useContext(at),h=f!=null&&Kn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Te(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,S=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:S,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(C):i;return x.createElement(Fn,{...c,"aria-current":w,className:T,ref:l,style:ee,to:a,viewTransition:o},typeof s==`function`?s(C):s)});In.displayName=`NavLink`;var Ln=x.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Xt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=x.useContext(at),g=Wn(),_=Gn(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&S.test(s);return x.createElement(`form`,{ref:m,method:v,action:_,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?x.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Ln.displayName=`Form`;function Rn(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function zn(e){let t=x.useContext(Qe);return D(t,Rn(e)),t}function Bn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=yt(),d=gt(),f=Ct(e,{relative:o});return x.useCallback(p=>{if(nn(p,t)){p.preventDefault();let t=n===void 0?ie(d)===ie(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?x.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Vn(e){O(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=x.useRef(rn(e)),n=x.useRef(!1),r=gt(),i=x.useMemo(()=>an(r.search,n.current?null:t.current),[r.search]),a=yt();return[i,x.useCallback((e,t)=>{let r=rn(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Hn=0,Un=()=>`__${String(++Hn)}__`;function Wn(){let{router:e}=zn(`useSubmit`),{basename:t}=x.useContext(at),n=Rt(),r=e.fetch,i=e.navigate;return x.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=un(e,t);if(a.navigate===!1){let e=a.fetcherKey||Un();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 Gn(e,{relative:t}={}){let{basename:n}=x.useContext(at),r=x.useContext(st);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ct(e||`.`,{relative:t})},o=gt();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:Ne([n,a.pathname])),ie(a)}function Kn(e,{relative:t}={}){let n=x.useContext(nt);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zn(`useViewTransitionState`),i=Ct(e,{relative:t});if(!n.isTransitioning)return!1;let a=Te(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Te(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xe(i.pathname,o)!=null||xe(i.pathname,a)!=null}var qn=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})),P=o(((e,t)=>{t.exports=qn()}))(),Jn=x.createContext(void 0),Yn=e=>{let t=x.useContext(Jn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Xn=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,P.jsx)(Jn.Provider,{value:e,children:t})),Zn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Qn=new class{#e=Zn;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 $n(e){setTimeout(e,0)}var er=typeof window>`u`||`Deno`in globalThis;function tr(){}function nr(e,t){return typeof e==`function`?e(t):e}function rr(e){return typeof e==`number`&&e>=0&&e!==1/0}function ir(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ar(e,t){return typeof e==`function`?e(t):e}function or(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==cr(o,t.options))return!1}else if(!ur(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 sr(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(lr(t.options.mutationKey)!==lr(a))return!1}else if(!ur(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function cr(e,t){return(t?.queryKeyHashFn||lr)(e)}function lr(e){return JSON.stringify(e,(e,t)=>hr(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ur(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)){for(let n=0;n<t.length;n++)if(!ur(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ur(e[r],t[r]))return!1;return!0}return!1}var dr=Object.prototype.hasOwnProperty;function fr(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=mr(e)&&mr(t);if(!r&&!(hr(e)&&hr(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:dr.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=fr(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function pr(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 mr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hr(e){if(!gr(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!gr(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function gr(e){return Object.prototype.toString.call(e)===`[object Object]`}function _r(e){return new Promise(t=>{Qn.setTimeout(t,e)})}function vr(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:fr(e,t)}function yr(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function br(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xr=Symbol();function Sr(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===xr?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cr(e,t){return typeof e==`function`?e(...t):!!e}function wr(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Tr=()=>er,Er=()=>Tr(),Dr=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(){}},Or=new class extends Dr{#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`}},kr=$n;function Ar(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=kr,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 jr=Ar(),Mr=new class extends Dr{#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 Nr(e){return Math.min(1e3*2**e,3e4)}function Pr(e){return(e??`online`)!==`online`||Mr.isOnline()}var Fr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ir(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(tr);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Fr(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Or.isFocused()&&(e.networkMode===`always`||Mr.isOnline())&&e.canRun(),p=()=>Pr(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(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??(Er()?0:3),a=e.retryDelay??Nr,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),_r(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Lr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rr(this.gcTime)&&(this.#e=Qn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Er()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Qn.clearTimeout(this.#e),this.#e=void 0)}};function F(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=>{wr(e,()=>t.signal,()=>n=!0)},u=Sr(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?br:yr;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?zr:Rr,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]??r.initialPageParam:Rr(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 Rr(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 zr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Br=class extends Lr{#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=Ur(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=Ur(this.options);e.data!==void 0&&(this.setState(Hr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=vr(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(tr).catch(tr):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=>ar(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>ar(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:!ir(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=Sr(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`?F(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=Ir({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Fr&&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 Fr){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,...Vr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Hr(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),jr.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Vr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Pr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Hr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ur(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 Wr=class extends Dr{#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),Kr(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qr(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 ar(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&&!pr(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Jr(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||ar(this.options.enabled,this.#t)!==ar(t.enabled,this.#t)||ar(this.options.staleTime,this.#t)!==ar(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||ar(this.options.enabled,this.#t)!==ar(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 pr(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().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(tr)),t}#h(e){return!Er()&&ar(this.options.enabled,this.#t)!==!1&&rr(e)}#g(){this.#b();let e=ar(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=ir(this.#r.dataUpdatedAt,e)+1;this.#u=Qn.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Qn.setInterval(()=>{(this.options.refetchIntervalInBackground||Or.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Qn.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Qn.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&&Kr(e,t),o=i&&Jr(e,n,t,r);(a||o)&&(l={...l,...Vr(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=vr(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=vr(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:Yr(e,t),refetch:this.refetch,isEnabled:ar(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),pr(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)})})();jr.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 Gr(e,t){return ar(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||ar(t.retryOnMount,e)!==!1)}function Kr(e,t){return Gr(e,t)||e.state.data!==void 0&&qr(e,t,t.refetchOnMount)}function qr(e,t,n){if(ar(t.enabled,e)!==!1&&ar(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Yr(e,t)}return!1}function Jr(e,t,n,r){return(e!==t||ar(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Yr(e,n)}function Yr(e,t){return ar(t.enabled,e)!==!1&&e.isStaleByTime(ar(t.staleTime,e))}var Xr=class extends Lr{#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||Zr(),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=Ir({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),jr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Zr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Qr=class extends Dr{#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 Xr({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=$r(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=$r(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=$r(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=$r(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){jr.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>sr(t,e))}findAll(e={}){return this.getAll().filter(t=>sr(e,t))}notify(e){jr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return jr.batch(()=>Promise.all(e.map(e=>e.continue().catch(tr))))}};function $r(e){return e.options.scope?.id}var ei=class extends Dr{#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),pr(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&lr(t.mutationKey)!==lr(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??Zr();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){jr.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},ti=class extends Dr{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??cr(r,t),a=this.get(i);return a||(a=new Br({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){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){jr.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=>or(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>or(e,t)):t}notify(e){jr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){jr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){jr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ni=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ti,this.#t=e.mutationCache||new Qr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Or.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Mr.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(ar(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=nr(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return jr.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;jr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return jr.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=jr.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(tr).catch(tr)}invalidateQueries(e,t={}){return jr.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=jr.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(tr)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(tr)}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(ar(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(ar(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(tr).catch(tr)}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(tr).catch(tr)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Mr.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(lr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ur(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(lr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ur(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||=cr(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===xr&&(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()}},ri=x.createContext(!1),ii=()=>x.useContext(ri);ri.Provider;function ai(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var oi=x.createContext(ai()),si=()=>x.useContext(oi),ci=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Cr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},li=e=>{x.useEffect(()=>{e.clearReset()},[e])},ui=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Cr(n,[e.error,r])),di=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))}},fi=(e,t)=>e?.suspense&&t.isPending,pi=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mi(e,t,n){let r=ii(),i=si(),a=Yn(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,di(o),ci(o,i,s),li(i);let[l]=x.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(x.useSyncExternalStore(x.useCallback(e=>{let t=d?l.subscribe(jr.batchCalls(e)):tr;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),x.useEffect(()=>{l.setOptions(o)},[o,l]),fi(o,u))throw pi(o,l,i);if(ui({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function hi(e,t){return mi(e,Wr,t)}function gi(e,t){let n=Yn(t),[r]=x.useState(()=>new ei(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);let i=x.useSyncExternalStore(x.useCallback(e=>r.subscribe(jr.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(tr)},[r]);if(i.error&&Cr(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var _i=g(),vi=/\{[^{}]+\}/g,yi=()=>typeof process==`object`&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function bi(){return Math.random().toString(36).slice(2,11)}function xi(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=yi()?c:void 0,t=Ai(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??Di,pathSerializer:b,body:x,middleware:S=[],...C}=d||{},w=t;f&&(w=Ai(f)??t);let T=typeof i==`function`?i:Ti(i);v&&(T=typeof v==`function`?v:Ti({...typeof i==`object`?i:{},...v}));let ee=b||o||Ei,E=x===void 0?void 0:y(x,ki(s,h,g.header)),D=ki(E===void 0||E instanceof FormData?{}:{"Content-Type":`application/json`},s,h,g.header),O=[...u,...S],te={redirect:`follow`,...l,...C,body:E,headers:D},ne,re,ie=new m(Oi(e,{baseUrl:w,params:g,querySerializer:T,pathSerializer:ee}),te),k;for(let e in C)e in ie||(ie[e]=C[e]);if(O.length){ne=bi(),re=Object.freeze({baseUrl:w,fetch:p,parseAs:_,querySerializer:T,bodySerializer:y,pathSerializer:ee});for(let t of O)if(t&&typeof t==`object`&&typeof t.onRequest==`function`){let n=await t.onRequest({request:ie,schemaPath:e,params:g,options:re,id:ne});if(n){if(n instanceof m)ie=n;else if(n instanceof Response){k=n;break}else throw Error(`onRequest: must return new Request() or Response() when modifying the request`)}}}if(!k){try{k=await p(ie,c)}catch(t){let n=t;if(O.length)for(let t=O.length-1;t>=0;t--){let r=O[t];if(r&&typeof r==`object`&&typeof r.onError==`function`){let t=await r.onError({request:ie,error:n,schemaPath:e,params:g,options:re,id:ne});if(t){if(t instanceof Response){n=void 0,k=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(O.length)for(let t=O.length-1;t>=0;t--){let n=O[t];if(n&&typeof n==`object`&&typeof n.onResponse==`function`){let t=await n.onResponse({request:ie,response:k,schemaPath:e,params:g,options:re,id:ne});if(t){if(!(t instanceof Response))throw Error(`onResponse: must return new Response() when modifying the response`);k=t}}}}let ae=k.headers.get(`Content-Length`);if(k.status===204||ie.method===`HEAD`||ae===`0`&&!k.headers.get(`Transfer-Encoding`)?.includes(`chunked`))return k.ok?{data:void 0,response:k}:{error:void 0,response:k};if(k.ok)return{data:await(async()=>{if(_===`stream`)return k.body;if(_===`json`&&!ae){let e=await k.text();return e?JSON.parse(e):void 0}return await k[_]()})(),response:k};let oe=await k.text();try{oe=JSON.parse(oe)}catch{}return{error:oe,response:k}}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 Si(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 Ci(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(Si(a,t[i],n))}let a=r.join(i);return n.style===`label`||n.style===`matrix`?`${i}${a}`:a}function wi(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(Si(e,r,n));return n.style===`label`||n.style===`matrix`?`${r}${i.join(r)}`:i.join(r)}function Ti(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(wi(r,i,{style:`form`,explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof i==`object`){n.push(Ci(r,i,{style:`deepObject`,explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(Si(r,i,e))}}return n.join(`&`)}}function Ei(e,t){let n=e;for(let r of e.match(vi)??[]){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];if(Array.isArray(o)){n=n.replace(r,wi(e,o,{style:a,explode:i}));continue}if(typeof o==`object`){n=n.replace(r,Ci(e,o,{style:a,explode:i}));continue}if(a===`matrix`){n=n.replace(r,`;${Si(e,o)}`);continue}n=n.replace(r,a===`label`?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function Di(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 Oi(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 ki(...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 Ai(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}var ji=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`ApiError`}};function Mi(){try{return localStorage.getItem(`moadim.apiToken`)?.trim()||void 0}catch{return}}function Ni(e,t={}){let n=Mi();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 I=xi({baseUrl:`/api/v1`,fetch:Ni});function Pi(e){return e===401?` Set the UI token with localStorage.setItem('moadim.apiToken', '<MOADIM_API_TOKEN>').`:``}function L({data:e,error:t,response:n}){if(t!==void 0||!n.ok)throw new ji((t?.error??`HTTP ${n.status}`)+Pi(n.status),n.status);if(e===void 0)throw new ji(`empty response body`,n.status);return e}function Fi({error:e,response:t}){if(e!==void 0||!t.ok)throw new ji((e?.error??`HTTP ${t.status}`)+Pi(t.status),t.status)}function Ii(e=1e4){return hi({queryKey:[`health`],queryFn:async()=>L(await I.GET(`/health`)),refetchInterval:e,retry:!1})}function Li(){let e=Yn();return gi({mutationFn:async()=>L(await I.POST(`/crontab-sync/retry`)),onSuccess:t=>e.setQueryData([`health`],t)})}function Ri(){return gi({mutationFn:async()=>L(await I.POST(`/shutdown`))})}function zi(){return hi({queryKey:[`machine`],queryFn:async()=>L(await I.GET(`/machine`))})}function Bi(){return hi({queryKey:[`machines`],queryFn:async()=>L(await I.GET(`/machines`))})}function Vi(){let e=Yn();return gi({mutationFn:async e=>L(await I.PUT(`/machine`,{body:{name:e}})),onSuccess:()=>{e.invalidateQueries({queryKey:[`machine`]}),e.invalidateQueries({queryKey:[`machines`]})}})}function Hi(){return hi({queryKey:[`agents`],queryFn:async()=>L(await I.GET(`/agents`))})}function Ui(){return hi({queryKey:[`config`,`user-prompt`],queryFn:async()=>{let{data:e,error:t,response:n}=await I.GET(`/config/user-prompt`,{parseAs:`text`});return L({data:e,error:t,response:n})}})}function Wi(){let e=Yn();return gi({mutationFn:async e=>Fi(await I.PUT(`/config/user-prompt`,{body:{content:e}})),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`,`user-prompt`]})}})}function Gi(){return hi({queryKey:[`config`,`max-concurrent-runs`],queryFn:async()=>L(await I.GET(`/config/max-concurrent-runs`))})}function Ki(){let e=Yn();return gi({mutationFn:async e=>L(await I.PUT(`/config/max-concurrent-runs`,{body:{value:e}})),onSuccess:t=>{e.setQueryData([`config`,`max-concurrent-runs`],t)}})}function qi(e={},t){return hi({queryKey:[`routines`,e],queryFn:async()=>L(await I.GET(`/routines`,{params:{query:e}})),...t})}function Ji(e,t=!0){return hi({queryKey:[`routines`,e],queryFn:async()=>L(await I.GET(`/routines/{id}`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}function Yi(e,t){e.invalidateQueries({queryKey:[`routines`]}),t&&e.invalidateQueries({queryKey:[`routines`,t]})}function Xi(){let e=Yn();return gi({mutationFn:async e=>L(await I.POST(`/routines`,{body:e})),onSuccess:()=>Yi(e)})}function Zi(){let e=Yn();return gi({mutationFn:async({id:e,body:t})=>L(await I.PATCH(`/routines/{id}`,{params:{path:{id:e}},body:t})),onSuccess:(t,{id:n})=>Yi(e,n)})}function Qi(){let e=Yn();return gi({mutationFn:async({id:e,body:t})=>L(await I.POST(`/routines/{id}/move`,{params:{path:{id:e}},body:t})),onSuccess:(t,{id:n})=>Yi(e,n)})}function $i(){let e=Yn();return gi({mutationFn:async e=>L(await I.DELETE(`/routines/{id}`,{params:{path:{id:e}}})),onSuccess:(t,n)=>Yi(e,n)})}function ea(){let e=Yn();return gi({mutationFn:async e=>{try{return await ta(e,!1)}catch(t){if(!na(t)||!window.confirm(`System power saving is active. Run this routine anyway?`))throw t;return ta(e,!0)}},onSuccess:(t,n)=>Yi(e,n)})}async function ta(e,t){return L(await I.POST(`/routines/{id}/trigger`,{params:{path:{id:e}},body:{override_system_power_saving:t}}))}function na(e){return e instanceof ji&&e.status===423&&e.message===`locked: system power saving is active`}function ra(){let e=Yn();return gi({mutationFn:async()=>L(await I.POST(`/routines/cleanup`)),onSuccess:()=>Yi(e)})}function ia(){return hi({queryKey:[`routines`,`lock`],queryFn:async()=>L(await I.GET(`/routines/lock`))})}function aa(){let e=Yn();return gi({mutationFn:async e=>L(await I.DELETE(`/routines/lock`,{params:{query:{scope:e}}})),onSuccess:()=>void e.invalidateQueries({queryKey:[`routines`,`lock`]})})}function R(e,t){return hi({queryKey:[`routines`,`runs`,e],queryFn:async()=>L(await I.GET(`/routines/runs`,{params:{query:{limit:e}}})),...t})}function z(e,t=!0){return hi({queryKey:[`routines`,e,`runs`],queryFn:async()=>L(await I.GET(`/routines/{id}/runs`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}async function oa(e){let{data:t,error:n,response:r}=await e;return L({data:t,error:n,response:r})}function sa(e,t=!0){return hi({queryKey:[`routines`,e,`logs`],queryFn:()=>oa(I.GET(`/routines/{id}/logs`,{params:{path:{id:e}},parseAs:`text`})),enabled:t&&e.length>0})}function ca(e,t,n=!0){return hi({queryKey:[`routines`,e,`runs`,t,`log`],queryFn:()=>oa(I.GET(`/routines/{id}/runs/{workbench}/log`,{params:{path:{id:e,workbench:t}},parseAs:`text`})),enabled:n&&e.length>0&&t.length>0})}function la(e,t,n=!0){return hi({queryKey:[`routines`,e,`runs`,t,`summary`],queryFn:()=>oa(I.GET(`/routines/{id}/runs/{workbench}/summary`,{params:{path:{id:e,workbench:t}},parseAs:`text`})),enabled:n&&e.length>0&&t.length>0})}function ua(e,t=!0){return hi({queryKey:[`routines`,e,`flags`],queryFn:async()=>L(await I.GET(`/routines/{id}/flags`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}function da(){let e=Yn();return gi({mutationFn:async({id:e,filename:t})=>Fi(await I.DELETE(`/routines/{id}/flags/{filename}`,{params:{path:{id:e,filename:t}}})),onSuccess:(t,{id:n})=>void e.invalidateQueries({queryKey:[`routines`,n,`flags`]})})}function fa(e){return e?`/api/v1/routines.ics?routine=${encodeURIComponent(e)}`:`/api/v1/routines.ics`}var pa=`moadim.notify-failures`;function ma(){try{return localStorage.getItem(pa)===`1`}catch{return!1}}function ha(e){try{localStorage.setItem(pa,e?`1`:`0`)}catch{}}function ga(){return typeof Notification<`u`}function _a(){return ga()?Notification.permission:`unsupported`}async function va(){return ga()?Notification.permission==="default"?Notification.requestPermission():Notification.permission:`unsupported`}function ya(e){return new Map(e.map(e=>[e.workbench,e.status]))}function ba(e,t){return e.filter(e=>e.status===`failed`&&t.get(e.workbench)!==`failed`)}function xa(e){return{title:`${e.routine_title} failed`,body:e.exit_code==null?`Run failed`:`Exit code ${e.exit_code}`}}function Sa(e){if(_a()!==`granted`)return;let{title:t,body:n}=xa(e);new Notification(t,{body:n,tag:e.workbench})}var Ca=`moadim.notification-log`;function wa(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 Ta(){try{let e=localStorage.getItem(Ca);if(e===null)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(wa):[]}catch{return[]}}function Ea(e){try{localStorage.setItem(Ca,JSON.stringify(e))}catch{}}function Da(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 Oa(e){return e.missed_scheduled_run_at==null?void 0:`missed:${e.id}:${e.missed_scheduled_run_at}`}function ka(e,t){let n=new Set(e.map(e=>e.id)),r=t.flatMap(e=>{let t=Oa(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 Aa(e){return e.filter(e=>!e.read).length}function ja(e){return e.some(e=>!e.read)?e.map(e=>({...e,read:!0})):e}var Ma=`moadim.client.theme`,Na=`moadim-theme-change`;function Pa(){try{return localStorage.getItem(Ma)!==`dark`}catch{return!0}}function Fa(e){try{localStorage.setItem(Ma,e?`light`:`dark`)}catch{}window.dispatchEvent(new CustomEvent(Na,{detail:{light:e}}))}function Ia(e){document.documentElement.classList.toggle(`theme-light`,e)}var La=[{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:`s`,route:`/settings`,label:`Settings`}];function Ra(e){return La.find(t=>t.key===e.toLowerCase())?.route}function za(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 Ba=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 1 *`,"@annually":`0 0 1 1 *`,"@monthly":`0 0 1 * *`,"@weekly":`0 0 * * 0`,"@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/`,`*/`)),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)/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||e[3].indexOf(`-`)>-1))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{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],`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){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=null,n=this.expressionParts[3];switch(n){case`L`:t=this.i18n.commaOnTheLastDayOfTheMonth();break;case`WL`:case`LW`:t=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var i=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(i){var a=parseInt(i[0].replace(`W`,``)),o=a==1?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),a.toString());t=r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),o);break}var s=n.match(/L-(\d{1,2})/);if(s){var c=s[1];t=r.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(c),c);break}if(n==`*`&&this.expressionParts[5]!=`*`)return``;t=this.getSegmentDescription(n,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 t},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(`, `,``)),p+=_}else if(!l)p+=n(f[h]);else{var v=this.getSegmentDescription(f[h],t,n,i,a,o);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,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(){return`every %s seconds`},e.prototype.secondsX0ThroughX1PastTheMinute=function(){return`seconds %s through %s past the minute`},e.prototype.atX0SecondsPastTheMinute=function(){return`at %s seconds past the minute`},e.prototype.everyX0Minutes=function(){return`every %s minutes`},e.prototype.minutesX0ThroughX1PastTheHour=function(){return`minutes %s through %s past the hour`},e.prototype.atX0MinutesPastTheHour=function(){return`at %s minutes past the hour`},e.prototype.everyX0Hours=function(){return`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(){return`, %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.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(){return`, 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)}t.default=function(){function e(){}return e.secondRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=59,`seconds part must be >= 0 and <= 59`)}},e.minuteRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=59,`minutes part must be >= 0 and <= 59`)}},e.hourRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=23,`hours part must be >= 0 and <= 23`)}},e.dayOfMonthRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=1&&i<=31,`DOM part must be >= 1 and <= 31`)}},e.monthRange=function(e,t){for(var r=e.split(`,`),i=0;i<r.length;i++)if(!isNaN(parseInt(r[i],10))){var a=parseInt(r[i],10);n(a>=1&&a<=12,t?`month part must be >= 0 and <= 11`:`month part must be >= 1 and <= 12`)}},e.dayOfWeekRange=function(e,t){for(var r=e.split(`,`),i=0;i<r.length;i++)if(!isNaN(parseInt(r[i],10))){var a=parseInt(r[i],10);n(a>=0&&a<=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 Va(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 Ha(e){if(e.trim()===``)return[!1,`— enter a cron expression —`];try{return[!0,(0,Ba.toString)(Va(e),{throwExceptionOnParseError:!0})]}catch{return[!1,`Invalid cron expression`]}}function Ua(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 Wa=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Ga(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`${Wa[t.getMonth()]} ${n}, ${t.getFullYear()} ${r}`}function Ka({entries:e,onMarkAllRead:t,onClear:n}){let[r,i]=(0,x.useState)(!1),a=(0,x.useRef)(null),o=Aa(e);return(0,x.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,P.jsxs)(`div`,{className:`notif-root`,ref:a,children:[(0,P.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,P.jsx)(`span`,{className:`notif-badge`,children:o>99?`99+`:o})]}),r&&(0,P.jsxs)(`div`,{className:`notif-panel`,role:`menu`,children:[(0,P.jsxs)(`div`,{className:`notif-panel-hd`,children:[(0,P.jsx)(`span`,{className:`notif-panel-title`,children:`NOTIFICATIONS`}),(0,P.jsxs)(`div`,{className:`notif-panel-acts`,children:[o>0&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:t,children:`MARK READ`}),e.length>0&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`CLEAR`})]})]}),e.length===0?(0,P.jsx)(`div`,{className:`notif-empty`,children:`No notifications yet`}):(0,P.jsx)(`ul`,{className:`notif-list`,children:e.map(e=>(0,P.jsx)(`li`,{className:e.read?`notif-item`:`notif-item unread`,children:(0,P.jsxs)(Fn,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,onClick:()=>i(!1),children:[(0,P.jsx)(`span`,{className:`notif-item-title`,children:e.routineTitle}),(0,P.jsx)(`span`,{className:`notif-item-msg`,children:e.message}),(0,P.jsx)(`span`,{className:`notif-item-time`,children:Ua(e.atSecs)})]})},e.id))})]})]})}function qa(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 Ja(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 ${qa(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,P.jsxs)(`header`,{className:`app-header`,children:[(0,P.jsxs)(`span`,{className:`brand`,children:[`MOADIM`,(0,P.jsx)(`span`,{className:`brand-sub`,children:`/ control`}),r&&(0,P.jsx)(`span`,{className:`brand-sub`,title:i,children:r})]}),(0,P.jsx)(`div`,{className:`header-spacer`}),(0,P.jsxs)(`div`,{className:`header-right`,children:[o&&(0,P.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,P.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,P.jsx)(`span`,{className:`dep-warn`,title:l,children:`⚠ CRON STALE`}),(0,P.jsxs)(`div`,{className:`health`,children:[(0,P.jsx)(`div`,{className:`health-dot ${e.healthOk?`ok`:`error`}`}),(0,P.jsx)(`span`,{children:n}),(0,P.jsx)(`span`,{children:a})]}),e.machineName&&(0,P.jsx)(`button`,{className:`machine-badge`,title:`Click to rename this machine`,onClick:e.onRenameMachine,children:e.machineName}),(0,P.jsx)(Ka,{...e.notifications}),(0,P.jsx)(`button`,{className:`icon-btn`,title:`Command palette (⌘K)`,onClick:e.onPalette,children:`⌘K`}),(0,P.jsx)(`button`,{className:`icon-btn`,title:`Keyboard shortcuts (?)`,onClick:e.onShortcuts,children:`?`}),(0,P.jsx)(`button`,{className:`icon-btn`,title:`Refresh`,onClick:e.onRefresh,children:`↻`}),(0,P.jsx)(`button`,{className:`icon-btn danger`,title:`Stop the server`,disabled:!e.healthOk,onClick:e.onStop,children:`⏻ Stop`})]})]})}var Ya=[{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:`/settings`,label:`Settings`,end:!1}];function Xa(){return(0,P.jsx)(`nav`,{className:`app-nav`,children:Ya.map(e=>(0,P.jsx)(In,{to:e.to,end:e.end,className:({isActive:e})=>`nav-link${e?` active`:``}`,children:e.label},e.to))})}var Za=(0,x.createContext)(null);function Qa({children:e}){let[t,n]=(0,x.useState)([]),r=(0,x.useRef)(0),i=(0,x.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,P.jsx)(Za.Provider,{value:{toasts:t,addToast:i},children:e})}function $a(){let e=(0,x.useContext)(Za);if(!e)throw Error(`useToasts must be used within a ToastProvider`);return e}var eo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),to=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)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))}}})),no=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},ee={year:l,month:l,day:l,hour:l,minute:l,second:l},E={year:l,month:u,day:l,hour:l,minute:l},D={year:l,month:u,day:l,hour:l,minute:l,second:l},O={year:l,month:u,day:l,weekday:u,hour:l,minute:l},te={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},ne={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},re={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},ie={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d},k=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}},ae=null,oe=class e extends k{static get instance(){return ae===null&&(ae=new e),ae}get type(){return`system`}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Gt(e,t,n)}formatOffset(e,t){return Yt(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type===`system`}get isValid(){return!0}},se=new Map;function ce(e){let t=se.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`}),se.set(e,t)),t}var le={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ue(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 de(e,t){let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let{type:t,value:i}=n[e],a=le[t];t===`era`?r[a]=i:M(a)||(r[a]=parseInt(i,10))}return r}var fe=new Map,pe=class e extends k{static create(t){let n=fe.get(t);return n===void 0&&fe.set(t,n=new e(t)),n}static resetCache(){fe.clear(),se.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 Gt(e,t,n,this.name)}formatOffset(e,t){return Yt(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let n=ce(this.name),[r,i,a,o,s,c,l]=n.formatToParts?de(n,t):ue(n,t);o===`BC`&&(r=-Math.abs(r)+1);let u=Vt({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}},me={};function he(e,t={}){let n=JSON.stringify([e,t]),r=me[n];return r||(r=new Intl.ListFormat(e,t),me[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.DateTimeFormat(e,t),ge.set(n,r)),r}var ve=new Map;function ye(e,t={}){let n=JSON.stringify([e,t]),r=ve.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),ve.set(n,r)),r}var be=new Map;function A(e,t={}){let{base:n,...r}=t,i=JSON.stringify([e,r]),a=be.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),be.set(i,a)),a}var j=null;function xe(){return j||(j=new Intl.DateTimeFormat().resolvedOptions().locale,j)}var Se=new Map;function Ce(e){let t=Se.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Se.set(e,t)),t}var we=new Map;function Te(e){let t=we.get(e);if(!t){let n=new Intl.Locale(e);t=`getWeekInfo`in n?n.getWeekInfo():n.weekInfo,`minimalDays`in t||(t={...Fe,...t}),we.set(e,t)}return t}function Ee(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=_e(e).resolvedOptions(),r=e}catch{let i=e.substring(0,n);t=_e(i).resolvedOptions(),r=i}let{numberingSystem:i,calendar:a}=t;return[r,i,a]}}function De(e,t,n){return n||t?(e.includes(`-u-`)||(e+=`-u`),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}function Oe(e){let t=[];for(let n=1;n<=12;n++){let r=I.utc(2009,n,1);t.push(e(r))}return t}function ke(e){let t=[];for(let n=1;n<=7;n++){let r=I.utc(2016,11,13+n);t.push(e(r))}return t}function Ae(e,t,n,r){let i=e.listingMode();return i===`error`?null:i===`en`?n(t):r(t)}function je(e){return e.numberingSystem&&e.numberingSystem!==`latn`?!1:e.numberingSystem===`latn`||!e.locale||e.locale.startsWith(`en`)||Ce(e.locale).numberingSystem===`latn`}var Me=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=ye(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Nt(this.floor?Math.floor(e):Lt(e,3),this.padTo)}},Ne=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&&pe.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=_e(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()}},Pe=class{constructor(e,t,n){this.opts={style:`long`,...n},!t&&wt()&&(this.rtf=A(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):mn(t,e,this.opts.numeric,this.opts.style!==`long`)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},Fe={firstDay:1,minimalDays:4,weekend:[6,7]},Ie=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||nt.defaultLocale,s=o||(a?`en-US`:xe()),c=n||nt.defaultNumberingSystem,l=r||nt.defaultOutputCalendar,u=At(i)||nt.defaultWeekSettings;return new e(s,c,l,u,o)}static resetCache(){j=null,ge.clear(),ve.clear(),be.clear(),Se.clear(),we.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]=Ee(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=De(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??=je(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,At(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 Ae(this,e,$t,()=>{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]=Oe(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return Ae(this,e,rn,()=>{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]=ke(e=>this.extract(e,n,`weekday`))),this.weekdaysCache[r][e]})}meridiems(){return Ae(this,void 0,()=>an,()=>{if(!this.meridiemCache){let e={hour:`numeric`,hourCycle:`h12`};this.meridiemCache=[I.utc(2016,11,13,9),I.utc(2016,11,13,19)].map(t=>this.extract(t,e,`dayperiod`))}return this.meridiemCache})}eras(e){return Ae(this,e,ln,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[I.utc(-40,1,1),I.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 Me(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ne(e,this.intl,t)}relFormatter(e={}){return new Pe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return he(this.intl,e)}isEnglish(){return this.locale===`en`||this.locale.toLowerCase()===`en-us`||Ce(this.intl).locale.startsWith(`en-us`)}getWeekSettings(){return this.weekSettings?this.weekSettings:Tt()?Te(this.locale):Fe}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})`}},Le=null,Re=class e extends k{static get utcInstance(){return Le===null&&(Le=new e(0)),Le}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(Kt(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return`fixed`}get name(){return this.fixed===0?`UTC`:`UTC${Yt(this.fixed,`narrow`)}`}get ianaName(){return this.fixed===0?`Etc/UTC`:`Etc/GMT${Yt(-this.fixed,`narrow`)}`}offsetName(){return this.name}formatOffset(e,t){return Yt(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}},ze=class extends k{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 Be(e,t){if(M(e)||e===null)return t;if(e instanceof k)return e;if(St(e)){let n=e.toLowerCase();return n==="default"?t:n===`local`||n===`system`?oe.instance:n===`utc`||n===`gmt`?Re.utcInstance:Re.parseSpecifier(n)||pe.create(e)}return bt(e)?Re.instance(e):typeof e==`object`&&`offset`in e&&typeof e.offset==`function`?e:new ze(e)}var Ve={arab:`[٠-٩]`,arabext:`[۰-۹]`,bali:`[᭐-᭙]`,beng:`[০-৯]`,deva:`[०-९]`,fullwide:`[0-9]`,gujr:`[૦-૯]`,hanidec:`[〇|一|二|三|四|五|六|七|八|九]`,khmr:`[០-៩]`,knda:`[೦-೯]`,laoo:`[໐-໙]`,limb:`[᥆-᥏]`,mlym:`[൦-൯]`,mong:`[᠐-᠙]`,mymr:`[၀-၉]`,orya:`[୦-୯]`,tamldec:`[௦-௯]`,telu:`[౦-౯]`,thai:`[๐-๙]`,tibt:`[༠-༩]`,latn:`\\d`},He={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]},Ue=Ve.hanidec.replace(/[\[|\]]/g,``).split(``);function We(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(Ve.hanidec)!==-1)t+=Ue.indexOf(e[n]);else for(let e in He){let[n,i]=He[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}return t}var Ge=new Map;function Ke(){Ge.clear()}function qe({numberingSystem:e},t=``){let n=e||`latn`,r=Ge.get(n);r===void 0&&(r=new Map,Ge.set(n,r));let i=r.get(t);return i===void 0&&(i=RegExp(`${Ve[n]}${t}`),r.set(t,i)),i}var Je=()=>Date.now(),Ye=`system`,Xe=null,Ze=null,Qe=null,$e=60,et,tt=null,nt=class{static get now(){return Je}static set now(e){Je=e}static set defaultZone(e){Ye=e}static get defaultZone(){return Be(Ye,oe.instance)}static get defaultLocale(){return Xe}static set defaultLocale(e){Xe=e}static get defaultNumberingSystem(){return Ze}static set defaultNumberingSystem(e){Ze=e}static get defaultOutputCalendar(){return Qe}static set defaultOutputCalendar(e){Qe=e}static get defaultWeekSettings(){return tt}static set defaultWeekSettings(e){tt=At(e)}static get twoDigitCutoffYear(){return $e}static set twoDigitCutoffYear(e){$e=e%100}static get throwOnInvalid(){return et}static set throwOnInvalid(e){et=e}static resetCaches(){Ie.resetCache(),pe.resetCache(),I.resetCache(),Ke()}},rt=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},it=[0,31,59,90,120,151,181,212,243,273,304,334],at=[0,31,60,91,121,152,182,213,244,274,305,335];function ot(e,t){return new rt(`unit out of range`,`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function st(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 ct(e,t,n){return n+(Rt(e)?at:it)[t-1]}function lt(e,t){let n=Rt(e)?at:it,r=n.findIndex(e=>e<t),i=t-n[r];return{month:r+1,day:i}}function ut(e,t){return(e-t+7)%7+1}function dt(e,t=4,n=1){let{year:r,month:i,day:a}=e,o=ct(r,i,a),s=ut(st(r,i,a),n),c=Math.floor((o-s+14-t)/7),l;return c<1?(l=r-1,c=Ut(l,t,n)):c>Ut(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...Xt(e)}}function ft(e,t=4,n=1){let{weekYear:r,weekNumber:i,weekday:a}=e,o=ut(st(r,1,t),n),s=zt(r),c=i*7+a-o-7+t,l;c<1?(l=r-1,c+=zt(l)):c>s?(l=r+1,c-=zt(r)):l=r;let{month:u,day:d}=lt(l,c);return{year:l,month:u,day:d,...Xt(e)}}function pt(e){let{year:t,month:n,day:r}=e;return{year:t,ordinal:ct(t,n,r),...Xt(e)}}function mt(e){let{year:t,ordinal:n}=e,{month:r,day:i}=lt(t,n);return{year:t,month:r,day:i,...Xt(e)}}function ht(e,t){if(!M(e.localWeekday)||!M(e.localWeekNumber)||!M(e.localWeekYear)){if(!M(e.weekday)||!M(e.weekNumber)||!M(e.weekYear))throw new a(`Cannot mix locale-based week fields with ISO-based week fields`);return M(e.localWeekday)||(e.weekday=e.localWeekday),M(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),M(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 gt(e,t=4,n=1){let r=xt(e.weekYear),i=jt(e.weekNumber,1,Ut(e.weekYear,t,n)),a=jt(e.weekday,1,7);return r?i?!a&&ot(`weekday`,e.weekday):ot(`week`,e.weekNumber):ot(`weekYear`,e.weekYear)}function _t(e){let t=xt(e.year),n=jt(e.ordinal,1,zt(e.year));return t?!n&&ot(`ordinal`,e.ordinal):ot(`year`,e.year)}function vt(e){let t=xt(e.year),n=jt(e.month,1,12),r=jt(e.day,1,Bt(e.year,e.month));return t?n?!r&&ot(`day`,e.day):ot(`month`,e.month):ot(`year`,e.year)}function yt(e){let{hour:t,minute:n,second:r,millisecond:i}=e,a=jt(t,0,23)||t===24&&n===0&&r===0&&i===0,o=jt(n,0,59),s=jt(r,0,59),c=jt(i,0,999);return a?o?s?!c&&ot(`millisecond`,i):ot(`second`,r):ot(`minute`,n):ot(`hour`,t)}function M(e){return e===void 0}function bt(e){return typeof e==`number`}function xt(e){return typeof e==`number`&&e%1==0}function St(e){return typeof e==`string`}function Ct(e){return Object.prototype.toString.call(e)===`[object Date]`}function wt(){try{return typeof Intl<`u`&&!!Intl.RelativeTimeFormat}catch{return!1}}function Tt(){try{return typeof Intl<`u`&&!!Intl.Locale&&(`weekInfo`in Intl.Locale.prototype||`getWeekInfo`in Intl.Locale.prototype)}catch{return!1}}function Et(e){return Array.isArray(e)?e:[e]}function Dt(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 Ot(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function kt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function At(e){if(e==null)return null;if(typeof e!=`object`)throw new s(`Week settings must be an object`);if(!jt(e.firstDay,1,7)||!jt(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!jt(e,1,7)))throw new s(`Invalid week settings`);return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function jt(e,t,n){return xt(e)&&e>=t&&e<=n}function Mt(e,t){return e-t*Math.floor(e/t)}function Nt(e,t=2){let n=e<0,r;return r=n?`-`+(``+-e).padStart(t,`0`):(``+e).padStart(t,`0`),r}function Pt(e){if(!(M(e)||e===null||e===``))return parseInt(e,10)}function Ft(e){if(!(M(e)||e===null||e===``))return parseFloat(e)}function It(e){if(!(M(e)||e===null||e===``)){let t=parseFloat(`0.`+e)*1e3;return Math.floor(t)}}function Lt(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 Rt(e){return e%4==0&&(e%100!=0||e%400==0)}function zt(e){return Rt(e)?366:365}function Bt(e,t){let n=Mt(t-1,12)+1,r=e+(t-n)/12;return n===2?Rt(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Vt(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 Ht(e,t,n){return-ut(st(e,1,t),n)+t-1}function Ut(e,t=4,n=1){let r=Ht(e,t,n),i=Ht(e+1,t,n);return(zt(e)-r+i)/7}function Wt(e){return e>99?e:e>nt.twoDigitCutoffYear?1900+e:2e3+e}function Gt(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 Kt(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 qt(e){let t=Number(e);if(typeof e==`boolean`||e===``||!Number.isFinite(t))throw new s(`Invalid unit value ${e}`);return t}function Jt(e,t){let n={};for(let r in e)if(kt(e,r)){let i=e[r];if(i==null)continue;n[t(r)]=qt(i)}return n}function Yt(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}${Nt(n,2)}:${Nt(r,2)}`;case`narrow`:return`${i}${n}${r>0?`:${r}`:``}`;case`techie`:return`${i}${Nt(n,2)}${Nt(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function Xt(e){return Ot(e,[`hour`,`minute`,`second`,`millisecond`])}var Zt=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],N=[`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 $t(e){switch(e){case`narrow`:return[...Qt];case`short`:return[...N];case`long`:return[...Zt];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 en=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],tn=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],nn=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function rn(e){switch(e){case`narrow`:return[...nn];case`short`:return[...tn];case`long`:return[...en];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`];default:return null}}var an=[`AM`,`PM`],on=[`Before Christ`,`Anno Domini`],sn=[`BC`,`AD`],cn=[`B`,`A`];function ln(e){switch(e){case`narrow`:return[...cn];case`short`:return[...sn];case`long`:return[...on];default:return null}}function un(e){return an[e.hour<12?0:1]}function dn(e,t){return rn(t)[e.weekday-1]}function fn(e,t){return $t(t)[e.month-1]}function pn(e,t){return ln(t)[e.year<0?0:1]}function mn(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 hn(e,t){let n=``;for(let r of e)r.literal?n+=r.val:n+=t(r.val);return n}var gn={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:E,fff:te,ffff:re,F:ee,FF:D,FFF:ne,FFFF:ie},_n=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 gn[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 Nt(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?un(t):a({hour:`numeric`,hourCycle:`h12`},`dayperiod`),c=(e,n)=>r?fn(t,e):a(n?{month:e}:{month:e,day:`numeric`},`month`),l=(e,n)=>r?dn(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?pn(t,e):a({era:e},`era`);return hn(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 hn(o,a(c,{isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]}))}},vn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function yn(...e){let t=e.reduce((e,t)=>e+t.source,``);return RegExp(`^${t}$`)}function bn(...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 xn(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 Sn(...e){return(t,n)=>{let r={},i=0;for(;i<e.length;i++)r[e[i]]=Pt(t[n+i]);return[r,null,n+i]}}var Cn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,wn=`(?:${Cn.source}?(?:\\[(${vn.source})\\])?)?`,Tn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,En=RegExp(`${Tn.source}${wn}`),Dn=RegExp(`(?:[Tt]${En.source})?`),On=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,kn=/(\d{4})-?W(\d\d)(?:-?(\d))?/,An=/(\d{4})-?(\d{3})/,jn=Sn(`weekYear`,`weekNumber`,`weekDay`),Mn=Sn(`year`,`ordinal`),Nn=/(\d{4})-(\d\d)-(\d\d)/,Pn=RegExp(`${Tn.source} ?(?:${Cn.source}|(${vn.source}))?`),Fn=RegExp(`(?: ${Pn.source})?`);function In(e,t,n){let r=e[t];return M(r)?n:Pt(r)}function Ln(e,t){return[{year:In(e,t),month:In(e,t+1,1),day:In(e,t+2,1)},null,t+3]}function Rn(e,t){return[{hours:In(e,t,0),minutes:In(e,t+1,0),seconds:In(e,t+2,0),milliseconds:It(e[t+3])},null,t+4]}function zn(e,t){let n=!e[t]&&!e[t+1],r=Kt(e[t+1],e[t+2]);return[{},n?null:Re.instance(r),t+3]}function Bn(e,t){return[{},e[t]?pe.create(e[t]):null,t+1]}var Vn=RegExp(`^T?${Tn.source}$`),Hn=/^-?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 Un(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(Ft(n)),months:f(Ft(r)),weeks:f(Ft(i)),days:f(Ft(a)),hours:f(Ft(o)),minutes:f(Ft(s)),seconds:f(Ft(c),c===`-0`),milliseconds:f(It(l),d)}]}var Wn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Gn(e,t,n,r,i,a,o){let s={year:t.length===2?Wt(Pt(t)):Pt(t),month:N.indexOf(n)+1,day:Pt(r),hour:Pt(i),minute:Pt(a)};return o&&(s.second=Pt(o)),e&&(s.weekday=e.length>3?en.indexOf(e)+1:tn.indexOf(e)+1),s}var Kn=/^(?:(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 qn(e){let[,t,n,r,i,a,o,s,c,l,u,d]=e,f=Gn(t,i,r,n,a,o,s),p;return p=c?Wn[c]:l?0:Kt(u,d),[f,new Re(p)]}function P(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).trim()}var Jn=/^(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$/,Yn=/^(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$/,Xn=/^(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 Zn(e){let[,t,n,r,i,a,o,s]=e;return[Gn(t,i,r,n,a,o,s),Re.utcInstance]}function Qn(e){let[,t,n,r,i,a,o,s]=e;return[Gn(t,s,n,r,i,a,o),Re.utcInstance]}var $n=yn(On,Dn),er=yn(kn,Dn),tr=yn(An,Dn),nr=yn(En),rr=bn(Ln,Rn,zn,Bn),ir=bn(jn,Rn,zn,Bn),ar=bn(Mn,Rn,zn,Bn),or=bn(Rn,zn,Bn);function sr(e){return xn(e,[$n,rr],[er,ir],[tr,ar],[nr,or])}function cr(e){return xn(P(e),[Kn,qn])}function lr(e){return xn(e,[Jn,Zn],[Yn,Zn],[Xn,Qn])}function ur(e){return xn(e,[Hn,Un])}var dr=bn(Rn);function fr(e){return xn(e,[Vn,dr])}var pr=yn(Nn,Fn),mr=yn(Pn),hr=bn(Rn,zn,Bn);function gr(e){return xn(e,[pr,rr],[mr,hr])}var _r=`Invalid Duration`,vr={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}},yr={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},...vr},br=146097/400,xr=146097/4800,Sr={years:{quarters:4,months:12,weeks:br/7,days:br,hours:br*24,minutes:br*24*60,seconds:br*24*60*60,milliseconds:br*24*60*60*1e3},quarters:{months:3,weeks:br/28,days:br/4,hours:br*24/4,minutes:br*24*60/4,seconds:br*24*60*60/4,milliseconds:br*24*60*60*1e3/4},months:{weeks:xr/7,days:xr,hours:xr*24,minutes:xr*24*60,seconds:xr*24*60*60,milliseconds:xr*24*60*60*1e3},...vr},Cr=[`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],wr=Cr.slice(0).reverse();function Tr(e,t,n=!1){return new kr({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 Er(e,t){let n=t.milliseconds??0;for(let r of wr.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Dr(e,t){let n=Er(e,t)<0?-1:1;Cr.reduceRight((r,i)=>{if(M(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),Cr.reduce((n,r)=>{if(M(t[r]))return n;if(n){let i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function Or(e){let t={};for(let[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}var kr=class e{constructor(e){let t=e.conversionAccuracy===`longterm`||!1,n=t?Sr:yr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||Ie.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:Jt(t,e.normalizeUnit),loc:Ie.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(bt(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]=ur(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]=fr(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 rt?t:new rt(t,n);if(nt.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?_n.create(this.loc,n).formatDurationFromString(this,e):_r}toHuman(e={}){if(!this.isValid)return _r;let t=e.showZeros!==!1,n=Cr.map(n=>{let r=this.values[n];return M(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+=Lt(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},I.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?Er(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 Cr)(kt(n.values,e)||kt(this.values,e))&&(r[e]=n.get(e)+this.get(e));return Tr(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]=qt(e(this.values[n],n));return Tr(this,{values:t},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let n={...this.values,...Jt(t,e.normalizeUnit)};return Tr(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 Tr(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return Dr(this.matrix,e),Tr(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=Or(this.normalize().shiftToAll().toObject());return Tr(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 Cr)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;bt(i[e])&&(t+=i[e]);let o=Math.trunc(t);n[e]=o,r[e]=(t*1e3-o*1e3)/1e3}else bt(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 Dr(this.matrix,n),Tr(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 Tr(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=Or(this.values);return Tr(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 Cr)if(!t(this.values[n],e.values[n]))return!1;return!0}},Ar=`Invalid Interval`;function jr(e,t){return!e||!e.isValid?Mr.invalid(`missing or invalid start`):!t||!t.isValid?Mr.invalid(`missing or invalid end`):t<e?Mr.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 Mr=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 rt?t:new rt(t,n);if(nt.throwOnInvalid)throw new r(i);return new e({invalid:i})}static fromDateTimes(t,n){let r=Pi(t),i=Pi(n);return jr(r,i)??new e({start:r,end:i})}static after(t,n){let r=kr.fromDurationLike(n),i=Pi(t);return e.fromDateTimes(i,i.plus(r))}static before(t,n){let r=kr.fromDurationLike(n),i=Pi(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=I.fromISO(r,n),a=t.isValid}catch{a=!1}let o,s;try{o=I.fromISO(i,n),s=o.isValid}catch{s=!1}if(a&&s)return e.fromDateTimes(t,o);if(a){let r=kr.fromISO(i,n);if(r.isValid)return e.after(t,r)}else if(s){let t=kr.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(Pi).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=kr.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()})`:Ar}[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?_n.create(this.s.loc.clone(t),e).formatInterval(this):Ar}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ar}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ar}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ar}toFormat(e,{separator:t=` – `}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ar}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):kr.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},Nr=class{static hasDST(e=nt.defaultZone){let t=I.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pe.isValidZone(e)}static normalizeZone(e){return Be(e,nt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Ie.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Ie.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Ie.create(e)).getWeekendDays().slice()}static months(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||Ie.create(t,n,i)).months(e)}static monthsFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||Ie.create(t,n,i)).months(e,!0)}static weekdays(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||Ie.create(t,n,null)).weekdays(e)}static weekdaysFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||Ie.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ie.create(e).meridiems()}static eras(e=`short`,{locale:t=null}={}){return Ie.create(t,null,`gregory`).eras(e)}static features(){return{relative:wt(),localeWeek:Tt()}}};function Pr(e,t){let n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf(`day`).valueOf(),r=n(t)-n(e);return Math.floor(kr.fromMillis(r).as(`days`))}function Fr(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=Pr(e,t);return(n-n%7)/7}],[`days`,Pr]],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 Ir(e,t,n,r){let[i,a,o,s]=Fr(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=kr.fromObject(a,r);return l.length>0?kr.fromMillis(c,r).shiftTo(...l).plus(u):u}var Lr=`missing Intl.DateTimeFormat.formatToParts support`;function F(e,t=e=>e){return{regex:e,deser:([e])=>t(We(e))}}var Rr=`[ \xA0]`,zr=new RegExp(Rr,`g`);function Br(e){return e.replace(/\./g,`\\.?`).replace(zr,Rr)}function Vr(e){return e.replace(/\./g,``).replace(zr,` `).toLowerCase()}function Hr(e,t){return e===null?null:{regex:RegExp(e.map(Br).join(`|`)),deser:([n])=>e.findIndex(e=>Vr(n)===Vr(e))+t}}function Ur(e,t){return{regex:e,deser:([,e,t])=>Kt(e,t),groups:t}}function Wr(e){return{regex:e,deser:([e])=>e}}function Gr(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,`\\$&`)}function Kr(e,t){let n=qe(t),r=qe(t,`{2}`),i=qe(t,`{3}`),a=qe(t,`{4}`),o=qe(t,`{6}`),s=qe(t,`{1,2}`),c=qe(t,`{1,3}`),l=qe(t,`{1,6}`),u=qe(t,`{1,9}`),d=qe(t,`{2,4}`),f=qe(t,`{4,6}`),p=e=>({regex:RegExp(Gr(e.val)),deser:([e])=>e,literal:!0}),m=(m=>{if(e.literal)return p(m);switch(m.val){case`G`:return Hr(t.eras(`short`),0);case`GG`:return Hr(t.eras(`long`),0);case`y`:return F(l);case`yy`:return F(d,Wt);case`yyyy`:return F(a);case`yyyyy`:return F(f);case`yyyyyy`:return F(o);case`M`:return F(s);case`MM`:return F(r);case`MMM`:return Hr(t.months(`short`,!0),1);case`MMMM`:return Hr(t.months(`long`,!0),1);case`L`:return F(s);case`LL`:return F(r);case`LLL`:return Hr(t.months(`short`,!1),1);case`LLLL`:return Hr(t.months(`long`,!1),1);case`d`:return F(s);case`dd`:return F(r);case`o`:return F(c);case`ooo`:return F(i);case`HH`:return F(r);case`H`:return F(s);case`hh`:return F(r);case`h`:return F(s);case`mm`:return F(r);case`m`:return F(s);case`q`:return F(s);case`qq`:return F(r);case`s`:return F(s);case`ss`:return F(r);case`S`:return F(c);case`SSS`:return F(i);case`u`:return Wr(u);case`uu`:return Wr(s);case`uuu`:return F(n);case`a`:return Hr(t.meridiems(),0);case`kkkk`:return F(a);case`kk`:return F(d,Wt);case`W`:return F(s);case`WW`:return F(r);case`E`:case`c`:return F(n);case`EEE`:return Hr(t.weekdays(`short`,!1),1);case`EEEE`:return Hr(t.weekdays(`long`,!1),1);case`ccc`:return Hr(t.weekdays(`short`,!0),1);case`cccc`:return Hr(t.weekdays(`long`,!0),1);case`Z`:case`ZZ`:return Ur(RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case`ZZZ`:return Ur(RegExp(`([+-]${s.source})(${r.source})?`),2);case`z`:return Wr(/[a-z_+-/]{1,256}?/i);case` `:return Wr(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:Lr};return m.token=e,m}var qr={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 Jr(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=qr[o];if(typeof s==`object`&&(s=s[a]),s)return{literal:!1,val:s}}function Yr(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,``)}$`,e]}function Xr(e,t,n){let r=e.match(t);if(r){let e={},t=1;for(let i in n)if(kt(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 Zr(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 M(e.z)||(n=pe.create(e.z)),M(e.Z)||(n||=new Re(e.Z),r=e.Z),M(e.q)||(e.M=(e.q-1)*3+1),M(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),M(e.u)||(e.S=It(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 $r(){return Qr||=I.fromMillis(1555555555555),Qr}function ei(e,t){if(e.literal)return e;let n=ai(_n.macroTokenToFormatOpts(e.val),t);return n==null||n.includes(void 0)?e:n}function ti(e,t){return Array.prototype.concat(...e.map(e=>ei(e,t)))}var ni=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=ti(_n.parseFormat(t),e),this.units=this.tokens.map(t=>Kr(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=Yr(this.units);this.regex=RegExp(e,`i`),this.handlers=t}}explainFromTokens(e){if(this.isValid){let[t,n]=Xr(e,this.regex,this.handlers),[r,i,o]=n?Zr(n):[null,null,void 0];if(kt(n,`a`)&&kt(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 ri(e,t,n){return new ni(e,n).explainFromTokens(t)}function ii(e,t,n){let{result:r,zone:i,specificOffset:a,invalidReason:o}=ri(e,t,n);return[r,i,a,o]}function ai(e,t){if(!e)return null;let n=_n.create(t,e).dtFormatter($r()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>Jr(t,e,i))}var oi=`Invalid DateTime`,si=864e13;function ci(e){return new rt(`unsupported zone`,`the zone "${e.name}" is not supported`)}function li(e){return e.weekData===null&&(e.weekData=dt(e.c)),e.weekData}function ui(e){return e.localWeekData===null&&(e.localWeekData=dt(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function di(e,t){let n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new I({...n,...t,old:n})}function fi(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 pi(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 mi(e,t,n){return fi(Vt(e),t,n)}function hi(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,Bt(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=kr.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]=fi(Vt(a),n,e.zone);return o!==0&&(s+=o,c=e.zone.offset(s)),{ts:s,o:c}}function gi(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=I.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}return I.invalid(new rt(`unparsable`,`the input "${i}" can't be parsed as ${r}`))}function _i(e,t,n=!0){return e.isValid?_n.create(Ie.create(`en-US`),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function vi(e,t,n){let r=e.c.year>9999||e.c.year<0,i=``;if(r&&e.c.year>=0&&(i+=`+`),i+=Nt(e.c.year,r?6:4),n===`year`)return i;if(t){if(i+=`-`,i+=Nt(e.c.month),n===`month`)return i;i+=`-`}else if(i+=Nt(e.c.month),n===`month`)return i;return i+=Nt(e.c.day),i}function yi(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+=Nt(e.c.hour),o===`hour`)break;if(t){if(c+=`:`,c+=Nt(e.c.minute),o===`minute`)break;s&&(c+=`:`,c+=Nt(e.c.second))}else{if(c+=Nt(e.c.minute),o===`minute`)break;s&&(c+=Nt(e.c.second))}if(o===`second`)break;s&&(!r||e.c.millisecond!==0)&&(c+=`.`,c+=Nt(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&e.offset===0&&!a?c+=`Z`:e.o<0?(c+=`-`,c+=Nt(Math.trunc(-e.o/60)),c+=`:`,c+=Nt(Math.trunc(-e.o%60))):(c+=`+`,c+=Nt(Math.trunc(e.o/60)),c+=`:`,c+=Nt(Math.trunc(e.o%60)))),a&&(c+=`[`+e.zone.ianaName+`]`),c}var bi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},xi={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Si={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ci=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],wi=[`weekYear`,`weekNumber`,`weekday`,`hour`,`minute`,`second`,`millisecond`],Ti=[`year`,`ordinal`,`hour`,`minute`,`second`,`millisecond`];function Ei(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 Di(e){switch(e.toLowerCase()){case`localweekday`:case`localweekdays`:return`localWeekday`;case`localweeknumber`:case`localweeknumbers`:return`localWeekNumber`;case`localweekyear`:case`localweekyears`:return`localWeekYear`;default:return Ei(e)}}function Oi(e){if(Mi===void 0&&(Mi=nt.now()),e.type!==`iana`)return e.offset(Mi);let t=e.name,n=Ni.get(t);return n===void 0&&(n=e.offset(Mi),Ni.set(t,n)),n}function ki(e,t){let n=Be(t.zone,nt.defaultZone);if(!n.isValid)return I.invalid(ci(n));let r=Ie.fromObject(t),i,a;if(M(e.year))i=nt.now();else{for(let t of Ci)M(e[t])&&(e[t]=bi[t]);let t=vt(e)||yt(e);if(t)return I.invalid(t);let r=Oi(n);[i,a]=mi(e,r,n)}return new I({ts:i,zone:n,loc:r,o:a})}function Ai(e,t,n){let r=M(n.round)?!0:n.round,i=M(n.rounding)?`trunc`:n.rounding,a=(e,a)=>(e=Lt(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 ji(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 Mi,Ni=new Map,I=class e{constructor(e){let t=e.zone||nt.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new rt(`invalid input`):null)||(t.isValid?null:ci(t));this.ts=M(e.ts)?nt.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=bt(e.o)&&!e.old?e.o:t.offset(this.ts);r=pi(this.ts,a),n=Number.isNaN(r.year)?new rt(`invalid input`):null,r=n?null:r,i=n?null:a}}this._zone=t,this.loc=e.loc||Ie.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]=ji(arguments),[n,r,i,a,o,s,c]=t;return ki({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static utc(){let[e,t]=ji(arguments),[n,r,i,a,o,s,c]=t;return e.zone=Re.utcInstance,ki({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static fromJSDate(t,n={}){let r=Ct(t)?t.valueOf():NaN;if(Number.isNaN(r))return e.invalid(`invalid input`);let i=Be(n.zone,nt.defaultZone);return i.isValid?new e({ts:r,zone:i,loc:Ie.fromObject(n)}):e.invalid(ci(i))}static fromMillis(t,n={}){if(!bt(t))throw new s(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);return t<-864e13||t>si?e.invalid(`Timestamp out of range`):new e({ts:t,zone:Be(n.zone,nt.defaultZone),loc:Ie.fromObject(n)})}static fromSeconds(t,n={}){if(bt(t))return new e({ts:t*1e3,zone:Be(n.zone,nt.defaultZone),loc:Ie.fromObject(n)});throw new s(`fromSeconds requires a numerical input`)}static fromObject(t,n={}){t||={};let r=Be(n.zone,nt.defaultZone);if(!r.isValid)return e.invalid(ci(r));let i=Ie.fromObject(n),o=Jt(t,Di),{minDaysInFirstWeek:s,startOfWeek:c}=ht(o,i),l=nt.now(),u=M(n.specificOffset)?r.offset(l):n.specificOffset,d=!M(o.ordinal),f=!M(o.year),p=!M(o.month)||!M(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=pi(l,u);g?(_=wi,v=xi,y=dt(y,s,c)):d?(_=Ti,v=Si,y=pt(y)):(_=Ci,v=bi);let b=!1;for(let e of _){let t=o[e];M(t)?o[e]=b?v[e]:y[e]:b=!0}let x=(g?gt(o,s,c):d?_t(o):vt(o))||yt(o);if(x)return e.invalid(x);let[S,C]=mi(g?ft(o,s,c):d?mt(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]=sr(e);return gi(n,r,t,`ISO 8601`,e)}static fromRFC2822(e,t={}){let[n,r]=cr(e);return gi(n,r,t,`RFC 2822`,e)}static fromHTTP(e,t={}){let[n,r]=lr(e);return gi(n,r,t,`HTTP`,t)}static fromFormat(t,n,r={}){if(M(t)||M(n))throw new s(`fromFormat requires an input string and a format`);let{locale:i=null,numberingSystem:a=null}=r,[o,c,l,u]=ii(Ie.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),t,n);return u?e.invalid(u):gi(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]=gr(e);return gi(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 rt?t:new rt(t,r);if(nt.throwOnInvalid)throw new n(i);return new e({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let n=ai(e,Ie.fromObject(t));return n?n.map(e=>e?e.val:null).join(``):null}static expandFormat(e,t={}){return ti(_n.parseFormat(e),Ie.fromObject(t)).map(e=>e.val).join(``)}static resetCache(){Mi=void 0,Ni.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?li(this).weekYear:NaN}get weekNumber(){return this.isValid?li(this).weekNumber:NaN}get weekday(){return this.isValid?li(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ui(this).weekday:NaN}get localWeekNumber(){return this.isValid?ui(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ui(this).weekYear:NaN}get ordinal(){return this.isValid?pt(this.c).ordinal:NaN}get monthShort(){return this.isValid?Nr.months(`short`,{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Nr.months(`long`,{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Nr.weekdays(`short`,{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Nr.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=Vt(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=pi(s,a),u=pi(c,o);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[di(this,{ts:s}),di(this,{ts:c})]:[this]}get isInLeapYear(){return Rt(this.year)}get daysInMonth(){return Bt(this.year,this.month)}get daysInYear(){return this.isValid?zt(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ut(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ut(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:n,calendar:r}=_n.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Re.instance(e),t)}toLocal(){return this.setZone(nt.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Be(t,nt.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]=mi(r,n,t)}return di(this,{ts:e,zone:t})}return e.invalid(ci(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){let r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return di(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=Jt(e,Di),{minDaysInFirstWeek:n,startOfWeek:r}=ht(t,this.loc),i=!M(t.weekYear)||!M(t.weekNumber)||!M(t.weekday),o=!M(t.ordinal),s=!M(t.year),c=!M(t.month)||!M(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=ft({...dt(this.c,n,r),...t},n,r):M(t.ordinal)?(d={...this.toObject(),...t},M(t.day)&&(d.day=Math.min(Bt(d.year,d.month),d.day))):d=mt({...pt(this.c),...t});let[f,p]=mi(d,this.o,this.zone);return di(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;let t=kr.fromDurationLike(e);return di(this,hi(this,t))}minus(e){if(!this.isValid)return this;let t=kr.fromDurationLike(e).negate();return di(this,hi(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let n={},r=kr.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?_n.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):oi}toLocaleString(e=f,t={}){return this.isValid?_n.create(this.loc.clone(t),e).formatDateTime(this):oi}toLocaleParts(e={}){return this.isValid?_n.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=Ei(a);let o=e===`extended`,s=vi(this,o,a);return Ci.indexOf(a)>=3&&(s+=`T`),s+=yi(this,o,t,n,r,i,a),s}toISODate({format:e=`extended`,precision:t=`day`}={}){return this.isValid?vi(this,e===`extended`,Ei(t)):null}toISOWeekDate(){return _i(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=Ei(o),(r&&Ci.indexOf(o)>=3?`T`:``)+yi(this,a===`extended`,t,e,n,i,o)):null}toRFC2822(){return _i(this,`EEE, dd LLL yyyy HH:mm:ss ZZZ`,!1)}toHTTP(){return _i(this.toUTC(),`EEE, dd LLL yyyy HH:mm:ss 'GMT'`)}toSQLDate(){return this.isValid?vi(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`)),_i(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():oi}[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 kr.invalid(`created by diffing an invalid DateTime`);let r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=Et(t).map(kr.normalizeUnit),a=e.valueOf()>this.valueOf(),o=Ir(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?Mr.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),Ai(n,this.plus(r),{...t,numeric:`always`,units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?Ai(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 Dt(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new s(`max requires all arguments be DateTimes`);return Dt(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){let{locale:r=null,numberingSystem:i=null}=n;return ri(Ie.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 ni(Ie.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(t,n,r={}){if(M(t)||M(n))throw new s(`fromFormatParser requires an input string and a format parser`);let{locale:i=null,numberingSystem:a=null}=r,o=Ie.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):gi(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 ee}static get DATETIME_MED(){return E}static get DATETIME_MED_WITH_SECONDS(){return D}static get DATETIME_MED_WITH_WEEKDAY(){return O}static get DATETIME_FULL(){return te}static get DATETIME_FULL_WITH_SECONDS(){return ne}static get DATETIME_HUGE(){return re}static get DATETIME_HUGE_WITH_SECONDS(){return ie}};function Pi(e){if(I.isDateTime(e))return e;if(e&&e.valueOf&&bt(e.valueOf()))return I.fromJSDate(e);if(e&&typeof e==`object`)return I.fromObject(e);throw new s(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.DateTime=I,e.Duration=kr,e.FixedOffsetZone=Re,e.IANAZone=pe,e.Info=Nr,e.Interval=Mr,e.InvalidZone=ze,e.Settings=nt,e.SystemZone=oe,e.VERSION=`3.7.2`,e.Zone=k})),ro=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;var t=no(),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);return}if(e===r.Subtract){this.subtractUnit(t);return}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})),io=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMonth=void 0;var t=ro(),n=to(),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}}})),ao=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfMonth=void 0;var t=to(),n=io(),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}}})),oo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfWeek=void 0;var t=to(),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}}})),so=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronHour=void 0;var t=to(),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}}})),co=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMinute=void 0;var t=to(),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}}})),lo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronSecond=void 0;var t=to(),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}}})),uo=o((e=>{var t=e&&e.__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]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(eo(),e),n(ao(),e),n(oo(),e),n(to(),e),n(so(),e),n(co(),e),n(io(),e),n(lo(),e)})),fo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFieldCollection=void 0;var t=uo();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;return}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()}}}})),po=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=ro();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);if(o!==null){e.setSeconds(o);return}e.applyDateOperation(n,t.TimeUnit.Minute,this.#a.hour.values.length),e.setSeconds(this.#l(i,r))}#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);if(s!==null){e.setMinutes(s),e.setSeconds(this.#l(a,r));return}e.applyDateOperation(n,t.TimeUnit.Hour,this.#a.hour.values.length),e.setMinutes(this.#l(i,r)),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);continue}if(!r.#c(o.getMonth()+1,this.#a.month.values)){o.applyDateOperation(a,t.TimeUnit.Month,this.#a.hour.values.length);continue}if(this.#g(o,a,i)){if(!r.#c(o.getMinutes(),this.#a.minute.values)){this.#f(o,a,i);continue}if(!r.#c(o.getSeconds(),this.#a.second.values)){this.#d(o,a,i);continue}if(s===o.getTime()){o.applyDateOperation(a,t.TimeUnit.Second,this.#a.hour.values.length);continue}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})),mo=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))}})),ho=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpressionParser=e.DayOfWeek=e.Months=e.CronUnit=e.PredefinedExpressions=void 0;var t=fo(),n=po(),r=mo(),i=uo(),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={})),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.#m(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`);e||=`0 * * * * *`;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.#c(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();return t.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(t,r,s,c)=>{if(r&&s&&c){let t=parseInt(r,10),l=parseInt(s,10),u=parseInt(c,10);if(u<=0)throw Error(`Invalid step: ${u}, must be positive`);let d=e.#o(t,l,n,i,a);return e.#s(o,d.min,d.max,u,i,a)}if(r&&s){let t=parseInt(r,10),c=parseInt(s,10),l=e.#o(t,c,n,i,a);return String(e.#i(o,l.min,l.max))}if(c){let t=parseInt(c,10);if(t<=0)throw Error(`Invalid step: ${t}, must be positive`);return 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(t,n,r){let i=[];function a(n,r){if(Array.isArray(n))i.push(...n);else if(e.#h(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)}}return n.split(`,`).forEach(n=>{if(!(n.length>0))throw Error(`Invalid list value format`);a(e.#l(t,n,r),r)}),i}static#l(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.#p(t,i[0],parseInt(i[1],10),r)):e.#p(t,n,1,r)}static#u(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#d(e){if(!(!isNaN(e)&&e>0))throw Error(`Constraint error, cannot repeat at every ${e} time.`)}static#f(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#p(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.#u(a,o,r),this.#d(n),this.#f(e,a,o,n)}static#m(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#h(e,t){return e.chars.some(e=>t.toString().includes(e))}}})),go=o(((e,t)=>{t.exports={}})),_o=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=void 0;var t=ho();e.CronFileParser=class e{static async parseFile(t){let{readFile:n}=go(),r=await n(t,`utf8`);return e.#e(r)}static parseFileSync(t){let{readFileSync:n}=go(),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,``);continue}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(` `);return{interval:t.CronExpressionParser.parse(n.slice(0,5).join(` `)),command:n.slice(5,n.length)}}}})),vo=o((e=>{var t=e&&e.__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]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;var r=ho(),i=ro();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return i.CronDate}});var a=fo();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var o=po();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return o.CronExpression}});var s=ho();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var c=_o();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(uo(),e),e.default=r.CronExpressionParser}))(),yo=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function bo(e,t){let n=Va(e);if(n!==``)try{return vo.CronExpressionParser.parse(n,{currentDate:t})}catch{return}}function xo(e,t){let n=bo(e,t);if(n?.hasNext())return n.next().toDate()}function So(e,t,n){let r=bo(e,t);if(!r)return[];let i=[];for(;i.length<n&&r.hasNext();)i.push(r.next().toDate());return i}function Co(e){return e.schedules&&e.schedules.length>0?e.schedules:[e.schedule]}function wo(e,t){return e.map(e=>xo(e,t)).filter(e=>e!==void 0).sort((e,t)=>e.getTime()-t.getTime())[0]}function To(e,t,n){let r=e.flatMap(e=>So(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 Eo(e,t,n){let r=xo(e,t);return r!==void 0&&r.getTime()-t.getTime()<=n}function Do(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 Oo(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function ko(e,t){let n=`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`,r=Math.round((Oo(t).getTime()-Oo(e).getTime())/864e5);return r===0?n:r===1?`tomorrow ${n}`:`${yo[t.getMonth()]} ${t.getDate()}, ${n}`}var Ao=[`SUN`,`MON`,`TUE`,`WED`,`THU`,`FRI`,`SAT`],jo=[`JANUARY`,`FEBRUARY`,`MARCH`,`APRIL`,`MAY`,`JUNE`,`JULY`,`AUGUST`,`SEPTEMBER`,`OCTOBER`,`NOVEMBER`,`DECEMBER`];function Mo(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 No=2e3;function Po(e,t){let n=Oo(t),r=bo(e,new Date(n.getTime()-1e3));if(!r)return[];let i=new Date(n.getTime()+864e5),a=[];for(let e=0;e<No&&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 Fo(e,t){let n=bo(e,new Date(t.getTime()-1e3));if(!n)return;let r=Array(42).fill(0),i=Oo(t).getTime();for(let e=0;e<4e3&&n.hasNext();e++){let e=n.next().toDate(),t=Math.floor((Oo(e).getTime()-i)/864e5);if(!(t<0)){if(t>=42)break;r[t]=(r[t]??0)+1}}return r}function Io(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-settings`:return`settings`;default:return}}function Lo(e){switch(e){case`nav-overview`:case`nav-routines`:case`nav-runs`:case`nav-heatmap`:case`nav-reliability`:case`nav-machines`:case`nav-settings`:return`GO`;case`routine`:return`ROUTINE`;default:return`ACTION`}}function Ro(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 zo(e,t){let n=Ro(e.title,t),r=Ro(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 Bo(e,t){let n=[];return e.forEach((e,r)=>{let i=zo(e,t);i!==void 0&&n.push([r,i])}),n.sort(([e,t],[n,r])=>r-t||e-n),n.map(([e])=>e)}function Vo(e,t){return e||(t.trim()===``?`—`:t)}function Ho(e){let t=Vo(e.schedule_description,Co(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 Uo(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-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:Ho(n),keywords:`${n.id} ${n.agent} ${Co(n).join(` `)} ${(n.tags??[]).join(` `)} routine`,routineId:n.id});return t}function B(e,t){return t===0?0:Math.min(e,t-1)}function Wo(e,t){return t===0?0:Math.min(e+1,t-1)}function Go(e){return Math.max(0,e-1)}function Ko(e){return Math.max(0,e-1)}var qo={home:`/`,routines:`/routines`,runs:`/runs`,heatmap:`/heatmap`,reliability:`/reliability`,machines:`/machines`,settings:`/settings`};function Jo({open:e,onClose:t,onRefresh:n,onStop:r,onShortcuts:i}){let a=yt(),o=ea(),{addToast:s}=$a(),[c,l]=(0,x.useState)(``),[u,d]=(0,x.useState)(0),f=(0,x.useRef)(null),{data:p}=hi({queryKey:[`command-palette`,`routines`],queryFn:async()=>L(await I.GET(`/routines`)),enabled:e}),[m,h]=(0,x.useState)(e);if(e!==m&&(h(e),e&&(l(``),d(0))),(0,x.useEffect)(()=>{e&&f.current?.focus()},[e]),!e)return null;let g=Uo(p??[]),_=Bo(g,c),v=B(u,_.length),y=e=>{let o=g[_[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=Io(o.kind);e&&a(qo[e]??`/`)}}t()},b=e=>{let n=g[_[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(Wo(v,_.length));break;case`ArrowUp`:e.preventDefault(),d(Go(v));break;case`Home`:e.preventDefault(),d(0);break;case`End`:e.preventDefault(),d(Ko(_.length));break;case`Enter`:e.preventDefault(),e.metaKey||e.ctrlKey?b(v):y(v);break;case`Escape`:e.preventDefault(),t()}},C=_.length>0?`cmdk-opt-${v}`:void 0;return(0,P.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,P.jsxs)(`div`,{className:`cmdk`,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:`cmdk-search`,children:[(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,P.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,P.jsx)(`span`,{className:`cmdk-hint`,"aria-hidden":`true`,children:`ESC`})]}),_.length===0?(0,P.jsxs)(`div`,{className:`cmdk-empty`,children:[(0,P.jsx)(`div`,{children:`NO MATCHES`}),(0,P.jsx)(`div`,{children:`no page or routine matches`})]}):(0,P.jsx)(`ul`,{id:`cmdk-listbox`,className:`cmdk-list`,role:`listbox`,"aria-label":`Results`,children:_.map((e,t)=>{let n=g[e];if(!n)return null;let r=t===v;return(0,P.jsxs)(`li`,{id:`cmdk-opt-${t}`,className:`cmdk-row${r?` active`:``}`,role:`option`,"aria-selected":r,onClick:()=>y(t),onMouseEnter:()=>d(t),children:[(0,P.jsx)(`span`,{className:`kind-badge`,children:Lo(n.kind)}),(0,P.jsxs)(`span`,{className:`cmdk-row-text`,children:[(0,P.jsx)(`span`,{className:`cmdk-row-title`,children:n.title}),(0,P.jsx)(`span`,{className:`cmdk-row-sub`,children:n.subtitle})]}),n.kind===`routine`&&(0,P.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(),b(t)},children:`⚡`})]},e)})}),(0,P.jsxs)(`div`,{className:`cmdk-foot`,"aria-hidden":`true`,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`span`,{className:`cmdk-key`,children:`↑↓`}),` navigate`]}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`span`,{className:`cmdk-key`,children:`↵`}),` open`]}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`span`,{className:`cmdk-key`,children:`⌘↵`}),` trigger routine`]}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`span`,{className:`cmdk-key`,children:`esc`}),` close`]})]})]})})}function Yo({current:e,onCancel:t,onConfirm:n}){let[r,i]=(0,x.useState)(e),[a,o]=(0,x.useState)(!1),s=r.trim(),c=async()=>{if(s!==``){o(!0);try{await n(s)}finally{o(!1)}}};return(0,P.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,P.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`rename-machine-title`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{id:`rename-machine-title`,className:`dialog-title`,children:`Rename machine`}),(0,P.jsxs)(`div`,{className:`dialog-msg`,children:[(0,P.jsx)(`label`,{className:`form-label`,htmlFor:`rename-machine-input`,children:`Machine name`}),(0,P.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,P.jsxs)(`div`,{className:`dialog-actions`,children:[(0,P.jsx)(`button`,{className:`btn btn-ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,P.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>void c(),disabled:a||s===``,children:a?`Saving…`:`Rename`})]})]})})}function Xo({onClose:e}){return(0,P.jsx)(`div`,{className:`overlay`,onClick:e,children:(0,P.jsxs)(`div`,{className:`dialog shortcuts-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`shortcuts-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{id:`shortcuts-dialog-title`,className:`dialog-title`,children:`⌨ Keyboard shortcuts`}),(0,P.jsxs)(`ul`,{className:`shortcuts-list`,children:[(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`cmdk-key`,children:`⌘K`}),(0,P.jsx)(`span`,{className:`cmdk-key`,children:`Ctrl K`}),(0,P.jsx)(`span`,{children:`Open command palette`})]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`cmdk-key`,children:`?`}),(0,P.jsx)(`span`,{children:`Toggle this help`})]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`cmdk-key`,children:`Esc`}),(0,P.jsx)(`span`,{children:`Close any open dialog`})]}),La.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`cmdk-key`,children:`G`}),(0,P.jsx)(`span`,{className:`cmdk-key`,children:e.key.toUpperCase()}),(0,P.jsxs)(`span`,{children:[`Go to `,e.label]})]},e.key))]}),(0,P.jsx)(`div`,{className:`dialog-actions`,children:(0,P.jsx)(`button`,{className:`btn btn-ghost`,onClick:e,children:`Close`})})]})})}function Zo({onCancel:e,onConfirm:t}){return(0,P.jsx)(`div`,{className:`overlay`,onClick:e,children:(0,P.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`shutdown-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{id:`shutdown-dialog-title`,className:`dialog-title`,children:`⏻ Stop server`}),(0,P.jsx)(`div`,{className:`dialog-msg`,children:`Stop the moadim server? Scheduled jobs and routines will not run until it is started again.`}),(0,P.jsxs)(`div`,{className:`dialog-actions`,children:[(0,P.jsx)(`button`,{className:`btn btn-ghost`,onClick:e,children:`Cancel`}),(0,P.jsx)(`button`,{className:`btn btn-danger`,onClick:t,children:`Stop server`})]})]})})}function Qo(){let{toasts:e}=$a();return(0,P.jsx)(`div`,{className:`toast-wrap`,role:`status`,"aria-live":`polite`,"aria-atomic":`false`,children:e.map(e=>(0,P.jsx)(`div`,{className:`toast ${e.kind}`,children:e.msg},e.id))})}var $o=900,es=50,ts=15e3;function ns(){let[e,t]=(0,x.useState)(Pa),[n,r]=(0,x.useState)(!1),[i,a]=(0,x.useState)(!1),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(!1),u=yt(),d=Yn(),{addToast:f}=$a(),p=Ii(3e4),m=zi(),h=Ri(),g=Vi(),_=R(es,{refetchInterval:ts}),v=qi({local_only:!0},{refetchInterval:ts}),[y,b]=(0,x.useState)(Ta),S=(0,x.useRef)(null),C=()=>l(e=>!e);return(0,x.useEffect)(()=>{let e=_.data;if(e===void 0)return;if(S.current===null){S.current=ya(e);return}let t=ba(e,S.current);S.current=ya(e),t.length!==0&&b(e=>{let n=Da(e,t);return Ea(n),n})},[_.data]),(0,x.useEffect)(()=>{let e=v.data;e!==void 0&&queueMicrotask(()=>{b(t=>{let n=ka(t,e);return n!==t&&Ea(n),n})})},[v.data]),(0,x.useEffect)(()=>{Ia(e)},[e]),(0,x.useEffect)(()=>{let e=()=>t(Pa());return window.addEventListener(Na,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(Na,e),window.removeEventListener(`storage`,e)}},[]),(0,x.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);return}if(i.key===`Escape`){r(!1),s(!1),l(!1),n();return}if(!(i.metaKey||i.ctrlKey||i.altKey||za(i.target))){if(e){n();let e=Ra(i.key);e&&(i.preventDefault(),u(e));return}i.key.toLowerCase()===`g`?(e=!0,t=setTimeout(n,$o)):i.key===`?`&&(i.preventDefault(),C())}};return window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,i),clearTimeout(t)}},[u]),(0,P.jsxs)(`div`,{className:`app-shell`,children:[(0,P.jsx)(Ja,{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:y,onMarkAllRead:()=>{b(e=>{let t=ja(e);return t!==e&&Ea(t),t})},onClear:()=>{b([]),Ea([])}}}),(0,P.jsx)(Xa,{}),(0,P.jsx)(`div`,{className:`page`,children:(0,P.jsx)(Gt,{})}),(0,P.jsx)(Jo,{open:i,onClose:()=>a(!1),onRefresh:()=>void p.refetch(),onStop:()=>r(!0),onShortcuts:C}),c&&(0,P.jsx)(Xo,{onClose:()=>l(!1)}),o&&(0,P.jsx)(Yo,{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,P.jsx)(Zo,{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,P.jsx)(Qo,{})]})}function rs({status:e,onUnlock:t}){return!e||!e.locked?null:(0,P.jsxs)(`div`,{className:`card`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`10px 14px`,marginBottom:16,borderColor:`var(--warn)`},children:[(0,P.jsxs)(`div`,{style:{fontSize:13,fontWeight:600},children:[`⚠ Routines globally locked — scheduling and manual triggers paused`,e.shared&&(0,P.jsx)(`span`,{style:{marginLeft:8,fontSize:11,color:`var(--text-faint)`},children:`SHARED .lock`}),e.local&&(0,P.jsx)(`span`,{style:{marginLeft:8,fontSize:11,color:`var(--text-faint)`},children:`LOCAL .local.lock`})]}),(0,P.jsx)(`button`,{className:`btn btn-ghost`,onClick:t,children:`Unlock all`})]})}function is(e=1e3){let[t,n]=(0,x.useState)(()=>Date.now());return(0,x.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var as=[{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}],os=`moadim.refresh-interval`,ss=`moadim-refresh-interval-change`;function cs(e){return e===`off`||e===`5`||e===`15`||e===`30`||e===`60`}function ls(e){return as.find(t=>t.token===e)?.ms}function us(){try{let e=localStorage.getItem(os);return cs(e)?e:`off`}catch{return`off`}}function ds(e){try{localStorage.setItem(os,e),window.dispatchEvent(new CustomEvent(ss))}catch{}}function fs(e){return e<60?`updated just now`:e<3600?`updated ${Math.floor(e/60)}m ago`:`updated ${Math.floor(e/3600)}h ago`}function ps(){let[e,t]=(0,x.useState)(us);return(0,x.useEffect)(()=>{let e=()=>t(us()),n=t=>{t.key===`moadim.refresh-interval`&&e()};return window.addEventListener(ss,e),window.addEventListener(`storage`,n),()=>{window.removeEventListener(ss,e),window.removeEventListener(`storage`,n)}},[]),e}function ms({token:e,updatedAtMs:t,onChange:n}){let r=is(),i=t>0?fs(Math.max(0,Math.floor((r-t)/1e3))):void 0;return(0,P.jsxs)(`div`,{className:`refresh-control`,children:[(0,P.jsx)(`label`,{className:`refresh-lbl`,htmlFor:`refresh-interval`,children:`AUTO`}),(0,P.jsx)(`select`,{id:`refresh-interval`,className:`refresh-select`,value:e,"aria-label":`Auto-refresh interval`,onChange:e=>n(e.target.value),children:as.map(e=>(0,P.jsx)(`option`,{value:e.token,children:e.label},e.token))}),i!==void 0&&(0,P.jsx)(`span`,{className:`refresh-fresh`,title:`Time since the list last refreshed`,children:i})]})}function hs({updatedAtMs:e}){let t=is();if(e<=0)return null;let n=fs(Math.max(0,Math.floor((t-e)/1e3)));return(0,P.jsx)(`span`,{className:`refresh-fresh`,title:`Time since the list last refreshed`,children:n})}var gs=36e5,_s={"auto-disabled":0,dormant:1,"dead-schedule":2,"agent-unregistered":3,"has-open-flags":4},vs={"auto-disabled":`AUTO-DISABLED`,dormant:`DORMANT`,"dead-schedule":`DEAD SCHEDULE`,"agent-unregistered":`AGENT MISSING`,"has-open-flags":`OPEN FLAGS`},ys={"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 bs(e,t){return e<t?-1:+(e>t)}function xs(e,t){if(!e.enabled)return e.autoDisabledReason===void 0?void 0:`auto-disabled`;if(e.machinesEmpty)return`dormant`;if(wo(Co(e),t)===void 0)return`dead-schedule`;if(e.agentRegistered===!1)return`agent-unregistered`;if(e.flagCount>0)return`has-open-flags`}function Ss(e,t){let n=[];for(let r of e){let e=xs(r,t);e!==void 0&&n.push({kind:r.kind,label:r.label,reason:e,flagCount:r.flagCount})}return n.sort((e,t)=>_s[e.reason]-_s[t.reason]||bs(e.label,t.label)),n}function Cs(e,t){let n=e.length,r=e.filter(e=>e.enabled).length,i=e.filter(e=>e.enabled&&!e.snoozed&&Co(e).some(e=>Eo(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:Ss(e,t).length,flags:a,snoozed:o,dormant:s}}function ws(e,t){let n=[];for(let r of e){if(!r.enabled||r.snoozed)continue;let e=wo(Co(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()<=gs,flagCount:r.flagCount})}return n.sort((e,t)=>e.at.getTime()-t.at.getTime()||bs(e.label,t.label)),n.slice(0,8)}function Ts(e,t){return e[0]===void 0?void 0:Do(t,e[0].at)}function Es(e){return(e??[]).every(e=>e.trim()===``)}function Ds(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 Os(e,t){return{kind:`routine`,id:e.id,label:e.title,schedule:e.schedule,schedules:Co(e),human:e.schedule_description??void 0,enabled:e.enabled,machinesEmpty:Es(e.machines),agentRegistered:e.agent_registered,flagCount:e.flag_count,snoozed:Ds(e,t),autoDisabledReason:e.auto_disabled_reason??void 0}}function ks(e,t){return e.map(e=>Os(e,t))}function As({items:e}){return(0,P.jsx)(`div`,{className:`table-wrap attn-wrap`,children:(0,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`TYPE`}),(0,P.jsx)(`th`,{children:`NAME`}),(0,P.jsx)(`th`,{children:`ISSUE`}),(0,P.jsx)(`th`,{children:`DETAIL`})]})}),(0,P.jsx)(`tbody`,{children:e.map((e,t)=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:`kind-badge routine`,children:`ROUTINE`})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(Fn,{className:`ov-name-link`,to:`/routines`,children:e.label})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:`attn-badge`,children:vs[e.reason]})}),(0,P.jsx)(`td`,{className:`attn-detail`,children:e.reason===`has-open-flags`&&e.flagCount>0?`${e.flagCount} open flag${e.flagCount===1?``:`s`} — needs review`:ys[e.reason]})]},t))})]})})}function js({enabled:e,onToggle:t}){return(0,P.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 Ms({kpis:e,nextRun:t}){return(0,P.jsxs)(`div`,{className:`stats`,children:[(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`SCHEDULED`}),(0,P.jsx)(`div`,{className:`stat-val`,children:e.total})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`ENABLED`}),(0,P.jsx)(`div`,{className:`stat-val c-accent`,children:e.enabled})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`DUE SOON`}),(0,P.jsx)(`div`,{className:`stat-val c-red`,children:e.dueSoon})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`ATTENTION`}),(0,P.jsx)(`div`,{className:`stat-val ${e.attention>0?`c-red`:`c-accent`}`,children:e.attention})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`DISABLED`}),(0,P.jsx)(`div`,{className:`stat-val c-amber`,children:e.disabled})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`DORMANT`}),(0,P.jsx)(`div`,{className:`stat-val ${e.dormant>0?`c-amber`:``}`,children:e.dormant})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FLAGS`}),(0,P.jsx)(`div`,{className:`stat-val ${e.flags>0?`c-red`:`c-accent`}`,children:e.flags})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`SNOOZED`}),(0,P.jsx)(`div`,{className:`stat-val ${e.snoozed>0?`c-amber`:`c-accent`}`,children:e.snoozed})]}),(0,P.jsxs)(`div`,{className:`stat-card stat-card-wide`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`NEXT RUN`}),(0,P.jsx)(`div`,{className:`stat-val stat-val-sm`,children:t??`—`})]})]})}function Ns(e){return`run-status ${e}`}function Ps(e){switch(e){case`running`:return`RUNNING`;case`success`:return`SUCCESS`;case`failed`:return`FAILED`;default:return`UNKNOWN`}}function Fs(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 Is(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 Ls({runs:e,loading:t}){return t?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS YET`})]})}):(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`ROUTINE`}),(0,P.jsx)(`th`,{children:`STARTED`}),(0,P.jsx)(`th`,{children:`DURATION`}),(0,P.jsx)(`th`,{children:`STATUS`}),(0,P.jsx)(`th`,{children:`EXIT CODE`})]})}),(0,P.jsx)(`tbody`,{children:e.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(Fn,{to:`/routines?history=${encodeURIComponent(e.routine_id)}`,children:e.routine_title})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`div`,{className:`cell-time`,title:Ga(e.started_at),children:Ua(e.started_at)})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:`cell-meta`,children:e.finished_at==null?`—`:Fs(e.started_at,e.finished_at)})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:Ns(e.status),children:Ps(e.status)})}),(0,P.jsx)(`td`,{children:e.exit_code==null?`—`:e.exit_code})]},e.workbench))})]})})}function Rs({runs:e,now:t,loading:n,error:r,onTrigger:i}){return r===void 0?n?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`◷`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO UPCOMING RUNS`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:`no enabled routine is scheduled to fire`})]})}):(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`TYPE`}),(0,P.jsx)(`th`,{children:`NAME`}),(0,P.jsx)(`th`,{children:`SCHEDULE`}),(0,P.jsx)(`th`,{children:`NEXT RUN`}),(0,P.jsx)(`th`,{})]})}),(0,P.jsx)(`tbody`,{children:e.map((e,n)=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:`kind-badge routine`,children:`ROUTINE`})}),(0,P.jsxs)(`td`,{children:[(0,P.jsx)(Fn,{className:`ov-name-link`,to:`/routines`,children:e.label}),e.flagCount>0&&(0,P.jsx)(`span`,{className:`ov-flag-badge`,title:`${e.flagCount} open flag${e.flagCount===1?``:`s`}`,children:`⚑ ${e.flagCount}`})]}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`div`,{className:`cell-schedule-human`,children:e.human??e.schedule})}),(0,P.jsxs)(`td`,{className:`cell-next`,children:[(0,P.jsx)(`div`,{className:`cell-next-when`,children:ko(t,e.at)}),(0,P.jsx)(`div`,{className:e.soon?`cell-next-until soon`:`cell-next-until`,children:Do(t,e.at)})]}),(0,P.jsx)(`td`,{className:`cell-act`,children:(0,P.jsx)(`button`,{className:`btn btn-sm btn-ghost run-now-btn`,title:`Trigger now`,onClick:()=>i(e.id),children:`▶ RUN`})})]},n))})]})}):(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:r})]})})}var zs=8,Bs=1e4;function Vs(){let e=Yn(),{addToast:t}=$a(),n=qi(),r=R(zs),i=ia(),a=aa(),o=ea(),[s,c]=(0,x.useState)(()=>new Date),l=ps(),[u,d]=(0,x.useState)(ma),f=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=setInterval(()=>c(new Date),Bs);return()=>clearInterval(e)},[]),(0,x.useEffect)(()=>{let t=ls(l);if(t===void 0)return;let n=setInterval(()=>{e.invalidateQueries({queryKey:[`routines`]})},t);return()=>clearInterval(n)},[l,e]),(0,x.useEffect)(()=>{if(!u){f.current=null;return}let e=r.data;if(e!==void 0){if(f.current===null){f.current=ya(e);return}for(let t of ba(e,f.current))Sa(t);f.current=ya(e)}},[r.data,u]);let p=(0,x.useCallback)(e=>{if(!e){ha(!1),d(!1);return}va().then(e=>{e===`granted`?(ha(!0),d(!0)):t(e===`unsupported`?`Desktop notifications aren't supported in this browser`:`Notification permission was denied`,`err`)})},[t]),m=(0,x.useCallback)(e=>{o.mutate(e,{onSuccess:()=>t(`Triggered`,`ok`),onError:e=>t(`Trigger failed: ${e instanceof Error?e.message:String(e)}`,`err`)})},[o,t]),h=(0,x.useCallback)(()=>{a.mutate(`all`)},[a]),g=ks(n.data??[],s),_=Cs(g,s),v=Ss(g,s),y=ws(g,s),b=Ts(y,s),S=Math.max(n.dataUpdatedAt,r.dataUpdatedAt,i.dataUpdatedAt),C=n.error instanceof Error?n.error.message:void 0;return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Overview`}),(0,P.jsx)(rs,{status:i.data,onUnlock:h}),(0,P.jsx)(Ms,{kpis:_,nextRun:b}),v.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`section-hd`,children:(0,P.jsx)(`span`,{className:`section-label attn`,children:`NEEDS ATTENTION`})}),(0,P.jsx)(As,{items:v})]}),(0,P.jsxs)(`div`,{className:`section-hd`,children:[(0,P.jsx)(`span`,{className:`section-label`,children:`UPCOMING RUNS`}),(0,P.jsx)(`div`,{className:`section-acts`,children:(0,P.jsx)(hs,{updatedAtMs:S})})]}),(0,P.jsx)(Rs,{runs:y,now:s,loading:n.isLoading,error:C,onTrigger:m}),(0,P.jsxs)(`div`,{className:`section-hd`,children:[(0,P.jsx)(`span`,{className:`section-label`,children:`RECENT RUNS`}),(0,P.jsx)(`div`,{className:`section-acts`,children:(0,P.jsx)(js,{enabled:u,onToggle:p})})]}),(0,P.jsx)(Ls,{runs:r.data??[],loading:r.isLoading})]})}function Hs({count:e,onEnable:t,onDisable:n,onDelete:r,onClear:i}){return e===0?null:(0,P.jsxs)(`div`,{className:`bulk-bar`,children:[(0,P.jsxs)(`span`,{className:`bulk-count`,children:[e,` SELECTED`]}),(0,P.jsxs)(`div`,{className:`bulk-acts`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:t,children:`ENABLE`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`DISABLE`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-danger btn-sm`,onClick:r,children:`DELETE`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR`})]})]})}function Us({count:e,onCancel:t,onConfirm:n}){return(0,P.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,P.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{className:`dialog-title`,children:`⚠ DELETE ROUTINES`}),(0,P.jsxs)(`div`,{className:`dialog-msg`,children:[`Delete `,e,` selected routine`,e===1?``:`s`,`? This cannot be undone.`]}),(0,P.jsxs)(`div`,{className:`dialog-actions`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:t,children:`Cancel`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-danger`,onClick:n,children:`Delete`})]})]})})}function Ws({title:e,onCancel:t,onConfirm:n}){return(0,P.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,P.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{className:`dialog-title`,children:`⚠ DELETE ROUTINE`}),(0,P.jsxs)(`div`,{className:`dialog-msg`,children:[`Delete the routine "`,e,`"? This cannot be undone.`]}),(0,P.jsxs)(`div`,{className:`dialog-actions`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:t,children:`Cancel`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-danger`,onClick:n,children:`Delete`})]})]})})}var Gs=[`B`,`KB`,`MB`,`GB`,`TB`];function Ks(e){if(e<1024)return`${e} B`;let t=e,n=0;for(;t>=1024&&n<Gs.length-1;)t/=1024,n++;return`${t.toFixed(1)} ${Gs[n]}`}var qs=[`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 Js(e){if(e==null)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toISOString()}function Ys(e){return e.enabled?e.is_running?`running`:`enabled`:`disabled`}function Xs(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Zs(e){return e.map(Xs).join(`,`)}function Qs(e){let t=[Zs([...qs])];for(let n of e)t.push(Zs([n.id,n.title,String(n.enabled),Ys(n),Co(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),Js(n.next_run_at),Js(n.last_scheduled_trigger_at),Js(n.last_manual_trigger_at)]));return t.join(`\r
`)+`\r
`}function $s(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 ec=[40,140,300,600],tc=jo.map(e=>e.slice(0,3));function nc({items:e,loading:t,onClick:n}){let[r,i]=(0,x.useState)(0),[a,o]=(0,x.useState)(0),s=(0,x.useRef)(null);if((0,x.useEffect)(()=>{s.current?.scrollIntoView({block:`center`})},[r,a]),t)return(0,P.jsx)(`div`,{className:`day-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})});let c=Oo(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 Co(t))for(let n of Po(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=`${Ao[l.getDay()]} · ${tc[l.getMonth()]} ${l.getDate()} ${l.getFullYear()}`,m=a>0,h=ec[a]??ec[0];return(0,P.jsxs)(`div`,{className:`day-wrap`,children:[(0,P.jsxs)(`div`,{className:`day-nav`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Previous day`,"aria-label":`Previous day`,onClick:()=>i(e=>e-1),children:`‹`}),(0,P.jsx)(`div`,{className:`day-date`,children:p}),(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Next day`,"aria-label":`Next day`,onClick:()=>i(e=>e+1),children:`›`}),(0,P.jsxs)(`div`,{className:`day-zoom`,children:[(0,P.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,P.jsxs)(`span`,{className:`day-zoom-level`,children:[a+1,`×`]}),(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Zoom into the hour`,"aria-label":`Zoom in`,disabled:a===ec.length-1,onClick:()=>o(e=>Math.min(ec.length-1,e+1)),children:`+`})]}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>i(0),children:`TODAY`})]}),f===0?(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:`no fire times on this day`})]}):(0,P.jsx)(`div`,{className:m?`day-scroll detail`:`day-scroll`,style:{"--dh":`${h}px`},children:d.map((e,t)=>(0,P.jsxs)(`div`,{className:t===u?`day-hour now`:`day-hour`,ref:t===u?s:void 0,children:[m?(0,P.jsxs)(`div`,{className:`day-hour-label`,children:[(0,P.jsxs)(`span`,{children:[String(t).padStart(2,`0`),`:00`]}),(0,P.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:15`]}),(0,P.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:30`]}),(0,P.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:45`]}),(0,P.jsx)(`span`,{className:`qt-end`})]}):(0,P.jsxs)(`div`,{className:`day-hour-label`,children:[String(t).padStart(2,`0`),`:00`]}),(0,P.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,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:`day-chip-time`,children:[String(e.time.getHours()).padStart(2,`0`),`:`,String(e.time.getMinutes()).padStart(2,`0`)]}),(0,P.jsx)(`span`,{className:`day-chip-label`,children:e.label}),e.flagCount>0&&(0,P.jsxs)(`span`,{className:`day-chip-flag`,children:[`⚑`,e.flagCount]})]});return o?(0,P.jsx)(`button`,{type:`button`,className:a,style:i,title:e.label,"aria-label":`Edit ${e.label}`,onClick:()=>n(e.id),children:s},t):(0,P.jsx)(`div`,{className:a,style:i,title:e.label,children:s},t)})})]},t))})]})}var rc=36e5,ic=[`all`,`enabled`,`disabled`,`auto-disabled`,`dormant`,`due`,`snoozed`,`flagged`,`agent-unreg`];function ac(e){return ic.includes(e)?e:`all`}var oc=`\0all`;function sc(e){return e.kind===`all`?oc:e.value}function cc(e){return e===oc?{kind:`all`}:{kind:`named`,value:e}}var lc=`\0any`,uc=`\0unassigned`;function dc(e){switch(e.kind){case`selected`:return e.values;case`any`:return lc;case`unassigned`:return uc;case`machine`:return e.value}}function fc(e){if(Array.isArray(e)){let t=[...new Set(e.filter(e=>e!==lc))];return t.length===0?{kind:`any`}:t.length===1?fc(t[0]):{kind:`selected`,values:t}}return e===lc?{kind:`any`}:e===uc?{kind:`unassigned`}:{kind:`machine`,value:e}}function pc(){return{query:``,status:`all`,agent:{kind:`all`},machine:{kind:`any`},repository:{kind:`all`},tag:{kind:`all`}}}function mc(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 hc(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&&Eo(t.schedule,n,r)))return!1;break;case`snoozed`:if(!Cc(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===uc?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 gc(e,t,n,r){return e.filter(e=>hc(t,e,n,r))}function _c(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 vc=[`dormant`,`dead-schedule`,`agent-missing`,`auto-disabled`,`disabled`,`power-saving`,`snoozed`,`healthy`];function yc(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 bc(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 xc(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 Sc(e,t){return t===`auto-disabled`?e.auto_disabled_reason??bc(t):bc(t)}function Cc(e,t){let n=e.snoozed_until;return n!=null&&n*1e3>t.getTime()||(e.skip_runs??0)>0}function wc(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 Tc(e,t){return e.enabled?e.power_saving?`power-saving`:(e.machines??[]).every(e=>e.trim()===``)?`dormant`:xo(e.schedule,t)===void 0?`dead-schedule`:!e.agent_registered||!e.agent_setup_available?`agent-missing`:Cc(e,t)?`snoozed`:`healthy`:e.auto_disabled_reason==null?`disabled`:`auto-disabled`}function Ec(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 Dc(e){return e.enabled?e.power_saving?`Routine is in power-saving mode`:`Run now`:`Routine is disabled`}function Oc(e){return[...new Set(e.map(e=>e.agent))].sort()}function kc(e){return[...new Set(e.flatMap(e=>(e.machines??[]).filter(e=>e.trim()!==``)))].sort()}function Ac(e){return[...new Set(e.flatMap(e=>(e.repositories??[]).map(e=>e.repository)))].sort()}function jc(e){return[...new Set(e.flatMap(e=>e.tags??[]))].sort()}function Mc({facet:e,machines:t,onChange:n}){let r=(0,x.useRef)(null),i=(0,x.useRef)(null),a=(0,x.useRef)(void 0);(0,x.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=dc(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(fc(s.includes(e)?s.filter(t=>t!==e):[...s,e]));return(0,P.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,P.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,P.jsxs)(`fieldset`,{className:`machine-filter-options`,children:[(0,P.jsx)(`legend`,{children:`Match any selected machine`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>n({kind:`any`}),children:`Any machine`}),[c,...l].map(e=>(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:s.includes(e),onChange:()=>u(e)}),e===c?`None (unassigned)`:e]},e))]})]})}var Nc=[[`all`,`All`],[`enabled`,`Enabled`],[`disabled`,`Disabled`],[`auto-disabled`,`Auto-disabled`],[`dormant`,`Dormant`],[`due`,`Due soon`],[`snoozed`,`Snoozed`],[`flagged`,`Flagged`],[`agent-unreg`,`Agent unregistered`]];function Pc({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,P.jsxs)(`div`,{className:`filter-bar`,children:[(0,P.jsxs)(`div`,{className:`filter-field`,children:[(0,P.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,P.jsx)(`span`,{className:`filter-label`,children:`STATUS`}),(0,P.jsx)(`select`,{className:`filter-select`,"aria-label":`Status filter`,value:e.status,onChange:e=>l(ac(e.target.value)),children:Nc.map(([e,t])=>(0,P.jsx)(`option`,{value:e,children:t},e))}),(0,P.jsx)(`span`,{className:`filter-label`,children:`AGENT`}),(0,P.jsxs)(`select`,{className:`filter-select`,"aria-label":`Agent filter`,value:sc(e.agent),onChange:e=>u(cc(e.target.value)),children:[(0,P.jsx)(`option`,{value:sc({kind:`all`}),children:`Any`}),t.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}),(0,P.jsx)(`span`,{className:`filter-label`,children:`MACHINE`}),(0,P.jsx)(Mc,{facet:e.machine,machines:n,onChange:d}),(0,P.jsx)(`span`,{className:`filter-label`,children:`REPOSITORY`}),(0,P.jsxs)(`select`,{className:`filter-select`,"aria-label":`Repository filter`,value:sc(e.repository),onChange:e=>f(cc(e.target.value)),children:[(0,P.jsx)(`option`,{value:sc({kind:`all`}),children:`Any`}),r.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}),i.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`filter-label`,children:`TAG`}),(0,P.jsxs)(`select`,{className:`filter-select`,"aria-label":`Tag filter`,value:sc(e.tag),onChange:e=>p(cc(e.target.value)),children:[(0,P.jsx)(`option`,{value:sc({kind:`all`}),children:`Any`}),i.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,P.jsxs)(`div`,{className:`filter-field`,children:[(0,P.jsxs)(`span`,{className:`filter-count`,children:[`Showing `,a,` of `,o]}),mc(e)&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Clear all filters`,onClick:m,children:`CLEAR`})]})]})}var Fc=[`title`,`next_run`,`last_fire`,`agent`,`health`,`enabled`,`updated`];function Ic(e){return Fc.includes(e)?e:void 0}function Lc(e){return e===`asc`?`desc`:`asc`}function Rc(e){return e===`desc`?`desc`:`asc`}var zc=[`none`,`agent`,`machine`,`status`,`health`,`folder`];function Bc(e){return zc.includes(e)?e:`none`}function Vc(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 Hc(e){return e.folder?.trim()||`(root)`}function Uc(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 bc(Tc(e,new Date));case`folder`:return Hc(e)}}function Wc(e,t){let n=new Map(vc.map(e=>[e,0]));for(let r of e){let e=Tc(r,t);n.set(e,(n.get(e)??0)+1)}return n}function Gc(e,t){if(t===`none`)return[[``,e]];let n=new Map;for(let r of e){let e=Uc(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 Kc(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=yc(Tc(e,r))-yc(Tc(i,r));break;case`last_fire`:{let t=_c(e),n=_c(i);a=(t??-1)-(n??-1);break}case`next_run`:{let t=e=>e.enabled?xo(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 qc=[`none`,`agent`,`machine`,`status`,`health`,`folder`];function Jc({groupBy:e,onChange:t}){return(0,P.jsxs)(`div`,{className:`group-by-ctrl`,children:[(0,P.jsx)(`label`,{htmlFor:`routine-group-by-select`,children:`GROUP BY`}),(0,P.jsx)(`select`,{id:`routine-group-by-select`,className:`filter-select`,"aria-label":`Group routines by`,value:e,onChange:e=>t(Bc(e.target.value)),children:qc.map(e=>(0,P.jsx)(`option`,{value:e,children:Vc(e)},e))})]})}function Yc(e){return e.toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`,year:`numeric`})}function Xc(e){return`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`}function Zc(e,t,n){return e.filter(e=>e.enabled).map(e=>{let r=new Set,i=Co(e).flatMap(e=>Po(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:Cc(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 Qc({routines:e,loading:t,onEdit:n,onTrigger:r}){let[i,a]=(0,x.useState)(0),[o,s]=(0,x.useState)(void 0),{addToast:c}=$a();if((0,x.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,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})});let l=()=>{let e=`${window.location.origin}${fa()}`;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=Mo(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=Co(t).map(e=>Fo(e,f)).filter(e=>e!==void 0);if(e.length===0)continue;h++;let n=Cc(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=`${jo[d.getMonth()]} ${d.getFullYear()}`,_=o?Zc(e,o,p):[];return(0,P.jsxs)(`div`,{className:`cal-wrap`,children:[(0,P.jsxs)(`div`,{className:`cal-nav`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Previous month`,"aria-label":`Previous month`,onClick:()=>a(e=>e-1),children:`‹`}),(0,P.jsx)(`div`,{className:`cal-month`,children:g}),(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Next month`,"aria-label":`Next month`,onClick:()=>a(e=>e+1),children:`›`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>a(0),children:`TODAY`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Copy the routines.ics feed URL`,onClick:l,children:`SUBSCRIBE`})]}),h===0?(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:`enabled routines with a valid schedule appear here`})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`cal-weekdays`,children:Ao.map(e=>(0,P.jsx)(`div`,{className:`cal-weekday`,children:e},e))}),(0,P.jsx)(`div`,{className:`cal-grid`,children:m.map((e,t)=>{let r=new Date(f);r.setDate(r.getDate()+t);let i=Oo(r),a=`cal-day`;r.getMonth()!==d.getMonth()&&(a+=` other-month`),r.getTime()===u.getTime()&&(a+=` today`);let o=Yc(i);return(0,P.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,P.jsx)(`div`,{className:`cal-daynum`,children:r.getDate()}),(0,P.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,P.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,P.jsxs)(`div`,{className:`cal-more`,children:[`+`,e.length-4,` more`]})]})]},t)})})]}),o&&(0,P.jsx)(`div`,{className:`overlay`,onClick:()=>s(void 0),children:(0,P.jsxs)(`div`,{className:`dialog cal-day-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Calendar day details`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{className:`dialog-title`,children:Yc(o)}),(0,P.jsx)(`div`,{className:`dialog-msg`,children:`Scheduled routine fires for this local day.`}),_.length===0?(0,P.jsx)(`div`,{className:`cal-day-empty`,children:`No routine fires on this day.`}):(0,P.jsx)(`div`,{className:`cal-day-fire-list`,children:_.map(e=>(0,P.jsxs)(`div`,{className:`cal-day-fire`,children:[(0,P.jsxs)(`div`,{className:`cal-day-fire-main`,children:[(0,P.jsx)(`div`,{className:`cal-day-fire-title`,children:e.title}),(0,P.jsx)(`div`,{className:`cal-day-fire-times`,children:e.times.map(e=>(0,P.jsx)(`span`,{className:`cal-time-chip`,children:Xc(e)},e.getTime()))})]}),(0,P.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,P.jsx)(`div`,{className:`dialog-actions`,children:(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>s(void 0),children:`Close`})})]})})]})}function $c({id:e,title:t,onBack:n}){let r=ua(e),i=da(),a=is(),o=r.data??[];return(0,P.jsxs)(`main`,{className:`logs-page`,children:[(0,P.jsxs)(`div`,{className:`page-hd`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,P.jsxs)(`div`,{className:`page-title`,children:[`FLAGS / `,t]}),r.dataUpdatedAt>0&&(0,P.jsx)(`span`,{className:`page-freshness`,children:fs(Math.max(0,(a-r.dataUpdatedAt)/1e3))}),(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void r.refetch(),children:`↻`})]}),r.isLoading?(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})}):r.isError?(0,P.jsx)(`div`,{className:`logs-error`,children:r.error.message}):o.length===0?(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⚑`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO OPEN FLAGS`})]}):(0,P.jsxs)(`div`,{className:`flags-list`,children:[(0,P.jsxs)(`div`,{className:`flags-count`,children:[o.length,` open flag`,o.length===1?``:`s`]}),o.map(t=>(0,P.jsxs)(`div`,{className:`flag-item`,children:[(0,P.jsxs)(`div`,{className:`flag-item-hd`,children:[(0,P.jsx)(`span`,{className:`flag-type`,children:t.type}),(0,P.jsx)(`span`,{className:`flag-scope`,children:t.scope===`general`?`general`:`local`}),(0,P.jsx)(`span`,{className:`flag-age`,title:t.filename,children:Ua(t.created_at)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:i.isPending,onClick:()=>i.mutate({id:e,filename:t.filename}),children:`RESOLVE`})]}),(0,P.jsx)(`div`,{className:`flag-desc`,children:t.description})]},t.filename))]})]})}var el=e=>e.type===`checkbox`,tl=e=>e.type===`file`,nl=e=>e instanceof Date,rl=e=>e==null,il=e=>typeof e==`object`,al=e=>!rl(e)&&!Array.isArray(e)&&il(e)&&!nl(e),ol=e=>al(e)&&e.target?el(e.target)?e.target.checked:tl(e.target)?e.target.files:e.target.value:e,sl=/[.[\]'"]/,cl=e=>e.split(sl).filter(Boolean),ll=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),ul=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function V(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(ul&&(t||n))return e;let r=Array.isArray(e);if(!r&&e.constructor!==Object)return e;let i=r?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=V(e[t]));return i}var dl={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},fl={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},pl={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},ml=`root`,hl=[`__proto__`,`constructor`,`prototype`],gl=/^\w*$/,_l=e=>gl.test(e),H=e=>e===void 0,U=(e,t,n)=>{if(!t||!al(e))return n;let r=_l(t)?[t]:cl(t);if(r.some(e=>hl.includes(e)))return n;let i=r.reduce((e,t)=>rl(e)?void 0:e[t],e);return H(i)||i===e?H(e[t])?n:e[t]:i},W=e=>typeof e==`boolean`,vl=e=>typeof e==`function`,yl=(e,t,n)=>{let r=-1,i=_l(t)?[t]:cl(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=al(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(hl.includes(t))return;e[t]=a,e=e[t]}},bl=x.createContext(null);bl.displayName=`HookFormControlContext`;var xl=()=>x.useContext(bl),Sl=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==fl.all&&(t._proxyFormState[i]=!r||fl.all),n&&(n[i]=!0),e[i]}});return i},Cl=ul?x.useLayoutEffect:x.useEffect,wl=e=>{let t=e.constructor&&e.constructor.prototype;return al(t)&&t.hasOwnProperty(`isPrototypeOf`)},Tl=e=>rl(e)||!il(e),El=(e,t)=>t.length===0&&!Array.isArray(e)&&!wl(e);function Dl(e,t,n=new WeakMap){if(e===t)return!0;if(Tl(e)||Tl(t))return Object.is(e,t);if(nl(e)&&nl(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(El(e,r)||El(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;let a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{let r=new WeakSet;r.add(t),n.set(e,r)}for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(nl(r)&&nl(e)||(al(r)||Array.isArray(r))&&(al(e)||Array.isArray(e))?!Dl(r,e,n):!Object.is(r,e))return!1}}return!0}function Ol(e){let t=x.useRef(!1),n=x.useRef(!1),r=x.useRef(void 0),i=x.useRef(0);return i.current++,!n.current&&e&&(n.current=!0,r.current=V(e())),{resyncIfNeeded:x.useCallback((e,a,o)=>{if(e&&(t.current||n.current&&i.current>1)){let e=a();Dl(r.current,e)||o(e)}t.current=!0},[]),snapshot:x.useCallback((e,t)=>{e&&(r.current=V(t()))},[])}}var kl=e=>typeof e==`string`,Al=(e,t,n,r,i)=>kl(e)?(r&&t.watch.add(e),U(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),U(n,e,U(i,e)))):(r&&(t.watchAll=!0),n);function jl(e){let t=xl(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=x.useRef(i),l=x.useRef(s),u=x.useRef(n),d=x.useRef(r);l.current=s;let f=()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e},[p,m]=x.useState(f),h=x.useRef(p),g=x.useCallback(e=>{let t=Al(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),_=x.useCallback(e=>{if(!a){let t=Al(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);Dl(e,h.current)||(m(e),h.current=e)}else m(t)}},[n._formValues,n._names,a,r]),{resyncIfNeeded:v,snapshot:y}=Ol(f),b=x.useRef(_);b.current=_;let S=x.useRef(g);S.current=g,Cl(()=>{u.current!==n||!Dl(d.current,r)?(u.current=n,d.current=r,b.current()):v(!a,()=>S.current(),e=>{m(e),h.current=e});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{b.current(e.values)}});return()=>{e(),y(!a,()=>S.current())}},[n,o,r,a,v,y]),x.useEffect(()=>n._removeUnmounted());let C=u.current!==n,w=d.current;return x.useMemo(()=>{if(a)return!1;let e=!C&&!Dl(w,r);return C||e},[a,C,r,w])?g():p}var Ml=()=>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)}),Nl=(e,t,n={})=>n.shouldFocus||H(n.shouldFocus)?n.focusName||`${e}.${H(n.focusIndex)?t:n.focusIndex}.`:``,Pl=e=>({isOnSubmit:!e||e===fl.onSubmit,isOnBlur:e===fl.onBlur,isOnChange:e===fl.onChange,isOnAll:e===fl.all,isOnTouch:e===fl.onTouched}),Fl=(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},Il=(e,t,n)=>{for(let r of n||Object.keys(e)){if(r===`_f`)continue;let i=n?U(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)||Il(i,t))return!0}else if((al(i)||Array.isArray(i))&&Il(i,t))return!0}}},Ll=(e,t,n)=>{let r=U(e,n),i=Array.isArray(r)?r:[];return yl(i,ml,t[n]),yl(e,n,i),e},Rl=e=>al(e)&&!Object.keys(e).length,zl=e=>{if(!ul)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Bl=e=>e.type===`radio`,Vl=e=>e instanceof RegExp,Hl=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Ul={value:!1,isValid:!1},Wl={value:!0,isValid:!0},Gl=e=>{if(!Array.isArray(e))return Ul;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?Ul:!t.attributes||!(`value`in t.attributes)||H(t.value)||t.value===``?Wl:{value:t.value,isValid:!0}},Kl={isValid:!1,value:null},ql=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Kl):Kl;function Jl(e,t,n=`validate`){if(kl(e)||Array.isArray(e)&&e.every(kl)||W(e)&&!e)return{type:n,message:kl(e)?e:``,ref:t}}var Yl=e=>al(e)&&!Vl(e)?e:{value:e,message:``},Xl=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:_}=e._f,v=U(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{if(i&&y.reportValidity){let t=W(e)?``:e||``;s?s.forEach(e=>e.setCustomValidity(t)):y.setCustomValidity(t),y.reportValidity()}},x={},S=Bl(o),C=el(o),w=S||C,T=(g||tl(o))&&H(o.value)&&H(v)||zl(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length,ee=Hl.bind(null,h,r,x),E=(e,t,n,r=pl.maxLength,i=pl.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...ee(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||rl(v))||W(v)&&!v||C&&!Gl(s).isValid||S&&!ql(s).isValid)){let{value:e,message:t}=kl(c)?{value:!!c,message:c}:Yl(c);if(e&&(x[h]={type:pl.required,message:t,ref:y,...ee(pl.required,t)},!r))return b(t),x}if(!T&&(!rl(d)||!rl(f))){let e,t,n=Yl(f),i=Yl(d);if(!rl(v)&&!nl(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;rl(n.value)||(e=r>n.value),rl(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;kl(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),kl(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(E(!!e,n.message,i.message,pl.max,pl.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(kl(v)||a&&Array.isArray(v))){let e=Yl(l),t=Yl(u),n=!rl(e.value)&&v.length>+e.value,i=!rl(t.value)&&v.length<+t.value;if((n||i)&&(E(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&kl(v)){let{value:e,message:t}=Yl(p);if(Vl(e)&&!v.match(e)&&(x[h]={type:pl.pattern,message:t,ref:o,...ee(pl.pattern,t)},!r))return b(t),x}if(m){if(vl(m)){let e=Jl(await m(v,n),y);if(e&&(x[h]={...e,...ee(pl.validate,e.message)},!r))return b(e.message),x}else if(al(m)){let e={};for(let t in m){if(!Rl(e)&&!r)break;let i=Jl(await m[t](v,n),y,t);i&&(e={...i,...ee(t,i.message)},r||b(i.message),r&&(x[h]=e))}if(!Rl(e)&&(x[h]={ref:y,...e},!r))return x}}let D=x[h];return b(!D||D.message),x},Zl=e=>Array.isArray(e)?e:[e],Ql=(e,t)=>[...e,...Zl(t)],$l=e=>Array.isArray(e)?e.map(()=>void 0):void 0;function eu(e,t,n){return[...e.slice(0,t),...Zl(n),...e.slice(t)]}var tu=(e,t,n)=>Array.isArray(e)?(H(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],nu=(e,t)=>[...Zl(t),...Zl(e)],ru=e=>Array.isArray(e)?e.filter(Boolean):[];function iu(e,t){let n=0,r=[...e];for(let e of t)r.splice(e-n,1),n++;return ru(r).length?r:[]}var G=(e,t)=>H(t)?[]:iu(e,Zl(t).sort((e,t)=>e-t)),au=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function ou(e,t){let n=t.length-1,r=0;for(;r<n;){if(rl(e)){e=void 0;break}e=e[t[r]],r++}return e}function su(e){for(let t in e)if(e.hasOwnProperty(t)&&!H(e[t]))return!1;return!0}function K(e,t){if(kl(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:_l(t)?[t]:cl(t);if(n.some(e=>hl.includes(String(e))))return e;let r=n.length===1?e:ou(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(al(r)&&Rl(r)||Array.isArray(r)&&su(r))&&K(e,n.slice(0,-1)),e}var cu=(e,t,n)=>(e[t]=n,e);function lu(e){let t=xl(),{control:n=t,name:r,keyName:i=`id`,disabled:a,shouldUnregister:o,rules:s}=e,c=()=>n._getFieldArray(r),[l,u]=x.useState(c),d=x.useRef(n._getFieldArray(r).map(Ml)),f=x.useRef(!1),{resyncIfNeeded:p,snapshot:m}=Ol(c),h=x.useRef(n),g=x.useRef(r);a||n._names.array.add(r),x.useMemo(()=>!a&&s&&l.length>=0&&n.register(r,s),[n,r,l.length,s,a]),Cl(()=>{if(a)return;if(h.current===n&&g.current===r)p(!0,c,e=>{u(e),d.current=e.map(Ml)});else{h.current=n,g.current=r;let e=c();Dl(l,e)||(u(e),d.current=e.map(Ml)),m(!0,c)}let e=n._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===r||!t){let n=U(e,r);Array.isArray(n)?(u(n),d.current=n.map(Ml)):t||(u([]),d.current=[])}}}).unsubscribe;return()=>{e(),m(!0,c)}},[n,r,a,p,m]);let _=x.useCallback(e=>{f.current=!0,n._setFieldArray(r,e)},[n,r]);return x.useEffect(()=>{if(a){n._state.actionArrayLengths.delete(r);return}n._state.action=!1,n._state.actionArrayLengths.delete(r),Fl(r,n._names)&&n._subjects.state.next({...n._formState});let e=Pl(n._options.mode);if(f.current&&(!e.isOnSubmit||n._formState.isSubmitted)&&!Pl(n._options.reValidateMode).isOnSubmit&&!e.isOnBlur){if(n._options.resolver)n._runSchema([r]).then(e=>{n._updateIsValidating([r]);let t=U(e.errors,r),i=U(n._formState.errors,r),a=i&&(i.type||i.root?.type),o=i&&(i.message||i.root?.message);(i?!t&&a||t&&(a!==t.type||o!==t.message):t&&t.type)&&(t?al(t)&&!Object.keys(t).some(e=>!Number.isNaN(+e))?Ll(n._formState.errors,{[r]:t},r):yl(n._formState.errors,r,t):K(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{let e=U(n._fields,r);e&&e._f&&Xl(e,n._names.disabled,n._formValues,n._options.criteriaMode===fl.all,n._options.shouldUseNativeValidation,!0).then(e=>!Rl(e)&&n._subjects.state.next({errors:Ll(n._formState.errors,e,r)}))}}f.current&&n._subjects.state.next({name:r,values:V(n._formValues)}),n._names.focus&&Il(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]),x.useEffect(()=>(a||!U(n._formValues,r)&&n._setFieldArray(r),()=>{if(n._state.actionArrayLengths.delete(r),a)return;let e=!(n._options.shouldUnregister||o);f.current&&e&&n._subjects.state.next({name:r,values:V(n._formValues)}),e?((e,t)=>{let r=U(n._fields,e);r&&r._f&&(r._f.mount=t)})(r,!1):n.unregister(r)}),[r,n,i,o,a]),{swap:x.useCallback((e,t)=>{if(a)return;let i=n._getFieldArray(r);au(i,e,t),au(d.current,e,t),_(i),u(i),n._setFieldArray(r,i,au,{argA:e,argB:t},!1)},[_,r,n,a]),move:x.useCallback((e,t)=>{if(a)return;let i=n._getFieldArray(r);tu(i,e,t),tu(d.current,e,t),_(i),u(i),n._setFieldArray(r,i,tu,{argA:e,argB:t},!1)},[_,r,n,a]),prepend:x.useCallback((e,t)=>{if(a)return;let i=Zl(V(e)),o=nu(n._getFieldArray(r),i);n._names.focus=Nl(r,0,t),d.current=nu(d.current,i.map(Ml)),_(o),u(o),n._setFieldArray(r,o,nu,{argA:$l(e)})},[_,r,n,a]),append:x.useCallback((e,t)=>{if(a)return;let i=Zl(V(e)),o=Ql(n._getFieldArray(r),i);n._names.focus=Nl(r,o.length-1,t),d.current=Ql(d.current,i.map(Ml)),_(o),u(o),n._setFieldArray(r,o,Ql,{argA:$l(e)})},[_,r,n,a]),remove:x.useCallback(e=>{if(a)return;let t=G(n._getFieldArray(r),e);d.current=G(d.current,e),_(t),u(t),!Array.isArray(U(n._fields,r))&&yl(n._fields,r,void 0),n._setFieldArray(r,t,G,{argA:e})},[_,r,n,a]),insert:x.useCallback((e,t,i)=>{if(a)return;let o=Zl(V(t)),s=eu(n._getFieldArray(r),e,o);n._names.focus=Nl(r,e,i),d.current=eu(d.current,e,o.map(Ml)),_(s),u(s),n._setFieldArray(r,s,eu,{argA:e,argB:$l(t)})},[_,r,n,a]),update:x.useCallback((e,t)=>{if(a)return;let i=V(t),o=cu(n._getFieldArray(r),e,i);d.current=[...o].map((t,n)=>!t||n===e?Ml():d.current[n]),_(o),u([...o]),n._setFieldArray(r,o,cu,{argA:e,argB:$l(t)})},[_,r,n,a]),replace:x.useCallback(e=>{if(a)return;let t=Zl(V(e));d.current=t.map(Ml),_([...t]),u([...t]),n._setFieldArray(r,[...t],e=>Array.isArray(e)?e.slice(0,t.length):e,{})},[_,r,n,a]),fields:x.useMemo(()=>l.map((e,t)=>({...e,...W(a)?{disabled:a}:{},[i]:d.current[t]||Ml()})),[l,i,a])}}var uu=x.createContext(null);uu.displayName=`HookFormContext`;var du=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function fu(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&al(i)&&a){let e=fu(i,a);al(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var pu=(e,t)=>e!==null&&il(e)&&Object.prototype.hasOwnProperty.call(e,t),mu=(e,t)=>{if(!t)return!1;let n=e;for(let r of _l(t)?[t]:cl(t)){if(!pu(n,r))return pu(e,t);n=n[r]}return!0},hu=e=>e.type===`select-multiple`,gu=e=>Bl(e)||el(e),_u=e=>zl(e)&&e.isConnected;function vu(e){return Array.isArray(e)||al(e)}function yu(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];vu(o)&&vu(U(t,a))?yu(o,t,a,r):r.push(a)}return r}var bu=e=>{for(let t in e)if(vl(e[t]))return!0;return!1};function xu(e){return Array.isArray(e)||al(e)&&!bu(e)}function Su(e){return!!(e&&`_f`in e)}function Cu(e){return Array.isArray(e)?!e.some(e=>!H(e)):!Object.keys(e).length}function wu(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Tu(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];xu(i)&&(!Array.isArray(i)||!Su(a))?(t[r]=Array.isArray(i)?[]:{},Tu(i,t[r],a),Cu(t[r])&&wu(t,r)):H(i)||(t[r]=!0)}return t}function Eu(e,t,n,r){n||=Tu(t,{},r);for(let i in e){let a=e[i],o=r&&r[i];xu(a)&&(!Array.isArray(a)||!Su(o))?(H(t)||Tl(n[i])?n[i]=Tu(a,Array.isArray(a)?[]:{},o):Eu(a,rl(t)?{}:t[i],n[i],o),Cu(n[i])&&wu(n,i)):Dl(a,t[i])?wu(n,i):n[i]=!0}return n}var Du=(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},Ou=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>H(e)?e:t?e===``?NaN:e&&+e:n&&kl(e)?new Date(e):r?r(e):e;function ku(e){let t=e.ref;return tl(t)?t.files:Bl(t)?ql(e.refs).value:hu(t)?[...t.selectedOptions].map(({value:e})=>e):el(t)?Gl(e.refs).value:Ou(t.value,e)}var Au=(e,t,n,r)=>{let i={};for(let n of e){let e=U(t,n);e&&yl(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},ju=e=>H(e)?e:Vl(e)?e.source:al(e)?Vl(e.value)?e.value.source:e.value:e,Mu=`AsyncFunction`,Nu=e=>{if(!e||!e.validate)return!1;if(vl(e.validate))return e.validate.constructor.name===Mu;if(al(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===Mu)return!0}return!1},Pu=e=>e.mount&&(e.required||!H(e.required)&&e.required!==!1||!H(e.min)||!H(e.max)||!H(e.maxLength)||!H(e.minLength)||e.pattern||e.validate);function Fu(e,t,n){let r=U(e,n);if(r?.type||r?.message||Array.isArray(r))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=U(t,r),o=U(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 Iu=(e,t,n,r)=>{n(e);let i=Object.keys(e).filter(e=>e!==`name`);return!i.length||r&&i.length>=Object.keys(t).length||i.find(e=>t[e]===(!r||fl.all))},Lu=(e,t,n)=>!e||!t||e===t||Zl(e).some(e=>e&&(n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e))),Ru=(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,zu=(e,t)=>{let n=U(e,t);!ru(n).length&&!(n!=null&&n.root)&&K(e,t)},Bu={mode:fl.onSubmit,reValidateMode:fl.onChange,shouldFocusError:!0},Vu=`form`,Hu=(e,t)=>{for(let n in e)n in t||delete e[n];Object.assign(e,t)},Uu={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Wu(e={}){let t={...Bu,...e},n={...V(Uu),isLoading:vl(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(al(t.defaultValues)||al(t.values))&&V(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:V(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c={},l={},u=0,d=Pl(t.mode),f=Pl(t.reValidateMode),p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...p},h={...m},g=(...e)=>e.some(e=>m[e]||h[e]),_={array:du(),state:du()},v=0,y=0,b=t.criteriaMode===fl.all,x=(e,t)=>n=>{clearTimeout(l[e]),l[e]=setTimeout(t,n)},S=e=>{clearTimeout(l[e]),delete l[e],delete c[e]},C=e=>{S(e);let t=`${e}.`;for(let e of Object.keys(c))e.startsWith(t)&&S(e)},w=async e=>{if(!o.keepIsValid&&!t.disabled&&(g(`isValid`)||e)){let e=++v,i;t.resolver?(i=Rl((await ae()).errors),e===v&&T()):i=await ce({fields:r,onlyCheckValid:!0,eventType:dl.VALID}),e===v&&i!==n.isValid&&_.state.next({isValid:i})}},T=(e,r)=>{!t.disabled&&g(`isValidating`,`validatingFields`)&&((e||s.mount).forEach(e=>{e&&(r?yl(n.validatingFields,e,r):K(n.validatingFields,e))}),_.state.next({validatingFields:n.validatingFields,isValidating:!Rl(n.validatingFields)}))},ee=()=>{n.dirtyFields=Eu(i,a,void 0,r)},E=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){o.action=!0;let t=U(r,e);if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(t)?t.length:0),u&&Array.isArray(t)){let n=s(t,c.argA,c.argB);l&&yl(r,e,n)}let a=U(n.errors,e);if(u&&Array.isArray(a)){let t=a.root,r=s(a,c.argA,c.argB)||a;t&&(r.root=t),l&&yl(n.errors,e,r),zu(n.errors,e)}let d=U(n.touchedFields,e);if(g(`touchedFields`)&&u&&Array.isArray(d)){let t=s(d,c.argA,c.argB);l&&yl(n.touchedFields,e,t)}g(`dirtyFields`)&&ee(),_.state.next({name:e,isDirty:ue(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else yl(a,e,i)},D=(e,t)=>{yl(n.errors,e,t),n.errors={...n.errors},_.state.next({errors:n.errors})},O=e=>{Object.keys(c).forEach(S),n.errors=e,_.state.next({errors:n.errors,isValid:!1})},te=e=>{let t=_l(e)?[e]:cl(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=rl(n)?n:n[i],r=rl(r)?r:r[i],n===null&&r!==null)return!0}return!1},ne=e=>{if(!o.actionArrayLengths.size)return!1;let t=_l(e)?[e]:cl(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(rl(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],H(n)&&i!==-1&&e>i&&+t[i]<s)return!0}return!1},re=(t,c,l,u)=>{let d=U(r,t);if(d){if(te(t)||ne(t))return;let r=H(U(a,t)),f=U(a,t,H(l)?U(i,t):l);H(f)||u&&u.defaultChecked||c?yl(a,t,c?f:ku(d._f)):pe(t,f),o.mount&&!o.action&&(w(),r&&n.isDirty&&g(`isDirty`)&&(ue()||(n.isDirty=!1,_.state.next({...n}))),e.shouldUnregister&&r&&!H(U(a,t))&&Fl(t,s)&&(o.watch=!0))}},ie=(e,o,s,c,l)=>{let u=!1,d=!1,f={name:e};if(!t.disabled||c===!0){if(!s||c){let t=Dl(U(i,e),o);g(`isDirty`)&&(d=n.isDirty,n.isDirty=f.isDirty=!t||ue(),u=d!==f.isDirty),d=!!U(n.dirtyFields,e),t===n.isDirty?t?K(n.dirtyFields,e):yl(n.dirtyFields,e,!0):Hu(n.dirtyFields,Eu(i,a,void 0,r)),f.dirtyFields=n.dirtyFields,u||=g(`dirtyFields`)&&d!==!t}if(s){let t=U(n.touchedFields,e);t||(yl(n.touchedFields,e,s),f.touchedFields=n.touchedFields,u||=g(`touchedFields`)&&t!==s)}u&&l&&_.state.next(f)}return u?f:{}},k=(e,r,i,a)=>{let o=U(n.errors,e),s=g(`isValid`)&&W(r)&&n.isValid!==r;if(t.delayError&&i?(c[e]=x(e,()=>D(e,i)),c[e](t.delayError)):(S(e),i?yl(n.errors,e,i):K(n.errors,e),n.errors={...n.errors}),(i?!Dl(o,i):o)||!Rl(a)||s){let t={...a,...s&&W(r)?{isValid:r}:{},errors:n.errors,name:e};_.state.next(t)}},ae=async e=>(T(e,!0),await t.resolver(a,t.context,Au(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),oe=async e=>{let t=y,{errors:i}=await ae(e);if(t!==y)return i;if(T(e),e){for(let t of e){let e=U(i,t);S(t);let a=s.array.has(t)&&al(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e))),o=U(r,t),c=al(o)&&Object.keys(o).some(e=>e!==`_f`);a?Ll(n.errors,{[t]:e},t):e?.type||e?.message||Array.isArray(e)||al(e)&&c?yl(n.errors,t,e):K(n.errors,t)}n.errors={...n.errors}}else Object.keys(c).forEach(S),n.errors=i;return i},se=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(al(i))for(let e in i){let t=i[e];t&&Ce(`${Vu}.${e}`,{message:kl(t.message)?t.message:``,type:t.type||pl.validate})}else kl(i)||!i?Ce(Vu,{message:i||``,type:pl.validate}):Se(Vu);return i}return!0},ce=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await se({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...d}=u;if(r){let o=s.array.has(r.name),c=u._f&&Nu(u._f),d=g(`isValidating`,`validatingFields`);c&&d&&T([r.name],!0);let f=await Xl(u,s.disabled,a,b,t.shouldUseNativeValidation&&!i,o);if(c&&d&&T([r.name]),f[r.name]&&(l.valid=!1,i)||(i||(S(r.name),U(f,r.name)?o?Ll(n.errors,f,r.name):yl(n.errors,r.name,f[r.name]):K(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!Rl(d)&&await ce({context:l,onlyCheckValid:i,fields:d,name:o,eventType:c})}}return l.valid},le=()=>{for(let e of s.unMount){let t=U(r,e);t&&(t._f.refs?t._f.refs.every(e=>!_u(e)):!_u(t._f.ref))&&De(e)}s.unMount=new Set},ue=(e,t)=>(e&&t&&yl(a,e,t),!Dl(o.mount?a:i,i)),de=(e,t,n)=>Al(e,s,{...o.mount?a:H(t)||kl(e)?i:t},n,t),fe=e=>ru(U(o.mount?a:i,e,t.shouldUnregister?U(i,e,[]):[])),pe=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=U(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&yl(a,e,Ou(t,n)),l=zl(n.ref)&&rl(t)?``:t,hu(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?el(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):tl(n.ref)?n.ref.value=``:(n.ref.value=l,!n.ref.type&&!o&&!s&&_.state.next({name:e,values:i?a:V(a)})))}(n.shouldDirty||n.shouldTouch)&&ie(e,c&&c._f&&!c._f.disabled&&(c._f.valueAsNumber||c._f.valueAsDate||c._f.setValueAs)?Ou(t,c._f):l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&be(e,{delayError:n.delayError})},me=(e,t,n,i=!1,o=!1,c=!1)=>{s.array.has(e)&&_.array.next({name:e,values:i?a:V(a)});for(let a in t){if(!t.hasOwnProperty(a))continue;let l=t[a],u=e+`.`+a,d=U(r,u);(s.array.has(e)||al(l)||d&&!d._f)&&!nl(l)?me(u,l,n,i,o,c):pe(u,l,n,i,o,c)}},he=(e,t,i,c,l=!1)=>{let u=U(r,e),d=s.array.has(e),f=c?t:V(t),p=Dl(U(a,e),f);if(p||yl(a,e,f),d)_.array.next({name:e,values:c?a:V(a)}),g(`isDirty`,`dirtyFields`)&&i.shouldDirty&&(ee(),l||_.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:ue(e,f)}));else{let t=Array.isArray(f)&&!f.length||Rl(f),n=!p&&!l;!u||u._f||rl(f)||t?pe(e,f,i,c,l,n):me(e,f,i,c,l,n)}if(!p&&!l){let t=Fl(e,s),r=c?a:V(a);if(_.state.next({...t&&n,name:o.mount||t?e:void 0,values:r}),!d)for(let t of Du(s.array,e))_.state.next({name:t,values:r})}},ge=(e,t,n={})=>he(e,t,n,!1),_e=(e,t={})=>{let r=vl(e)?e(a):e;if(!Dl(a,r)){a={...a,...r};for(let e of s.mount)mu(r,e)&&he(e,U(r,e),t,!0,!0);_.state.next({...n,name:void 0,type:void 0,...u?{values:a}:{}}),t.shouldValidate&&w()}},ve=async i=>{o.mount=!0;let l=i.target,p=l.name,m=!0,h=U(r,p),v=e=>{m=Number.isNaN(e)||nl(e)&&isNaN(e.getTime())||Dl(e,U(a,p,e))};if(h){let o,y,x=l.type?ku(h._f):ol(i),S=i.type===dl.BLUR||i.type===dl.FOCUS_OUT,C=!Pu(h._f)&&!e.validate&&!t.resolver&&!U(n.errors,p)&&!h._f.deps,ee=C||Ru(S,U(n.touchedFields,p),n.isSubmitted,f,d),E=Fl(p,s,S);if(yl(a,p,V(x)),S){if(!l||!l.readOnly){h._f.onBlur&&h._f.onBlur(i);let e=c[p];e&&e(0)}}else h._f.onChange&&h._f.onChange(i);let D=ie(p,x,S),O=!Rl(D)||E;if(!S&&_.state.next({name:p,type:i.type,...u?{values:V(a)}:{}}),ee)return(!C||!n.isValid)&&g(`isValid`)&&(t.mode===`onBlur`?S&&w():S||w()),O&&_.state.next({name:p,...E?{}:D});if(!t.resolver&&e.validate&&await se({name:p,eventType:i.type}),!S&&E&&_.state.next({...n}),t.resolver){let{errors:e}=await ae([p]);if(T([p]),v(x),!m){!Rl(D)&&_.state.next(D);return}let t=Fu(n.errors,r,p),i=Fu(e,r,t.name||p);o=i.error,p=i.name,y=Rl(e)}else T([p],!0),o=(await Xl(h,s.disabled,a,b,t.shouldUseNativeValidation))[p],T([p]),v(x),m&&(o?y=!1:g(`isValid`)&&(y=await ce({fields:r,onlyCheckValid:!0,name:p,eventType:i.type})));m&&(h._f.deps&&(!Array.isArray(h._f.deps)||h._f.deps.length>0)&&be(h._f.deps),k(p,y,o,D))}},ye=(e,t)=>{if(U(n.errors,t)&&e.focus)return e.focus(),1},be=async(e,i={})=>{let a,o,l=Zl(e);if(t.resolver){let t=y,n=await oe(H(e)?e:l);if(a=Rl(n),o=e?!l.some(e=>U(n,e)):a,t!==y)return o}else e?(o=(await Promise.all(l.map(async e=>{let t=U(r,e);return await ce({fields:t&&t._f?{[e]:t}:t,eventType:dl.TRIGGER})}))).every(Boolean),(o||n.isValid)&&w()):o=a=await ce({fields:r,name:e,eventType:dl.TRIGGER});if(i.delayError&&t.delayError&&kl(e)){let r=U(n.errors,e);r?(K(n.errors,e),c[e]=x(e,()=>D(e,r)),c[e](t.delayError)):S(e)}if(i.shouldTouch)for(let t of e?l:s.mount)!s.array.has(t)&&yl(n.touchedFields,t,!0);return _.state.next({...!kl(e)||g(`isValid`)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},...i.shouldTouch&&g(`touchedFields`)?{touchedFields:n.touchedFields}:{},errors:n.errors}),i.shouldFocus&&!o&&Il(r,ye,e?l:s.mount),o},A=(e,t)=>{let r={...o.mount?a:i};return t&&(r=fu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),H(e)?r:kl(e)?U(r,e):e.map(e=>U(r,e))},j=e=>H(e)?{...n.errors}:kl(e)?U(n.errors,e):e.map(e=>U(n.errors,e)),xe=(e,t)=>{let r=t||n,i=U(r.errors,e);return{invalid:!!i,isDirty:!!U(r.dirtyFields,e),error:i,isValidating:!!U(r.validatingFields,e),isTouched:!!U(r.touchedFields,e)}},Se=e=>{let t=e?Zl(e):void 0;t?t.forEach(e=>{C(e),K(n.errors,e),_.state.next({name:e,errors:n.errors})}):(Object.keys(c).forEach(S),n.errors={},_.state.next({errors:n.errors}))},Ce=(e,t,i)=>{S(e);let a=(U(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,types:l,...u}=U(n.errors,e)||{};yl(n.errors,e,{...u,...t,ref:a}),_.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},we=(e,t)=>{if(vl(e)){u++;let{unsubscribe:n}=_.state.subscribe({next:n=>`values`in n&&e(n.values||de(void 0,t),n)}),r=!1;return{unsubscribe:()=>{r||(r=!0,u--,n())}}}return de(e,t,!0)},Te=e=>{let t=!!e.formState?.values;t&&u++;let{unsubscribe:r}=_.state.subscribe({next:t=>{if(Lu(e.name,t.name,e.exact)&&Iu(t,e.formState||m,Le,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}});if(!t)return r;let o=!1;return()=>{o||(o=!0,u--,r())}},Ee=e=>(o.mount=!0,h={...h,...e.formState},Te({...e,formState:{...p,...e.formState}})),De=(e,o={})=>{for(let c of e?Zl(e):s.mount)s.mount.delete(c),s.array.delete(c),s.disabled.delete(c),o.keepValue||(K(r,c),K(a,c)),o.keepError||(C(c),K(n.errors,c)),!o.keepDirty&&K(n.dirtyFields,c),!o.keepTouched&&K(n.touchedFields,c),!o.keepIsValidating&&K(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&K(i,c);u&&_.state.next({values:V(a)}),_.state.next({...n,...o.keepDirty?{}:{isDirty:ue()},...o.keepIsValidating?{}:{isValidating:!Rl(n.validatingFields)}}),!o.keepIsValid&&w()},Oe=({disabled:e,name:t})=>{if(W(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&w()}},ke=(e,n={})=>{let a=U(r,e),c=W(n.disabled)||W(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return yl(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?Oe({disabled:W(n.disabled)?n.disabled:t.disabled,name:e}):re(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:ju(n.min),max:ju(n.max),minLength:ju(n.minLength),maxLength:ju(n.maxLength),pattern:ju(n.pattern)}:{},name:e,onChange:ve,onBlur:ve,ref:c=>{if(c){s.registerName.add(e),ke(e,n),s.registerName.delete(e),a=U(r,e);let t=H(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=gu(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(_u),t,...Array.isArray(U(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),yl(r,e,{_f:u}),re(e,!1,void 0,t)}else a=U(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(ll(s.array,e)&&o.action)&&s.unMount.add(e)}}},Ae=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Il(r,ye,s.mount),je=e=>{W(e)&&(_.state.next({disabled:e}),Il(r,(t,n)=>{let i=U(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))},Me=(e,i)=>async o=>{let l,u;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let d=V(a);if(_.state.next({isSubmitting:!0}),t.resolver){let e=y,{errors:t,values:r}=await ae();if(e!==y)return;T(),Object.keys(c).forEach(S),n.errors=t,d=V(r)}else await ce({fields:r,eventType:dl.SUBMIT}),K(n.errors,ml);if(s.disabled.size)for(let e of s.disabled)K(d,e);if(Rl(n.errors)){_.state.next({errors:{}});try{l=await e(d,o)}catch(e){u=e}}else i&&await i({...n.errors},o),Ae(),setTimeout(Ae);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Rl(n.errors)&&!u,submitCount:n.submitCount+1,errors:n.errors}),u)throw u;return l},Ne=(e,t={})=>{U(r,e)&&(K(n.validatingFields,e),H(t.defaultValue)?ge(e,V(U(i,e))):(ge(e,t.defaultValue),yl(i,e,V(t.defaultValue))),t.keepTouched||K(n.touchedFields,e),t.keepDirty||(K(n.dirtyFields,e),n.isDirty=t.defaultValue?ue(e,V(U(i,e))):ue()),t.keepError||(S(e),K(n.errors,e),w()),_.state.next({...n,isValidating:!Rl(n.validatingFields)}))},Pe=(e,l={})=>{y++;let u=e?V(e):i,d=V(u),f=Rl(e),p=d,h=r;if(Object.keys(c).forEach(S),l.keepDefaultValues||(i=u),!l.keepValues){if(l.keepDirtyValues){let e=new Set([...s.mount,...yu(Eu(i,a,void 0,h),n.dirtyFields)]);for(let t of e){let e=U(n.dirtyFields,t),r=U(a,t),i=U(p,t);e&&!H(r)?yl(p,t,r):!e&&!H(i)&&ge(t,i)}}else{if(ul&&H(e))for(let e of s.mount){let t=U(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(zl(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(l.keepFieldsRef)for(let e of s.mount)ge(e,U(p,e));else r={}}if(t.shouldUnregister){if(a=l.keepDefaultValues?V(i):{},l.keepFieldsRef)for(let e of s.mount)yl(a,e,U(p,e))}else a=V(p);_.array.next({values:{...p}}),_.state.next({name:void 0,type:void 0,values:{...p}})}s={mount:l.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!m.isValid||!!l.keepIsValid||!!l.keepDirtyValues||!t.shouldUnregister&&!Rl(p),o.watch=!!t.shouldUnregister,o.keepIsValid=!!l.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),l.keepErrors||(n.errors={}),_.state.next({submitCount:l.keepSubmitCount?n.submitCount:0,isDirty:f?!1:l.keepDirty?n.isDirty:l.keepValues?ue():!(!l.keepDefaultValues||Dl(e,i)),isSubmitted:l.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:f?{}:l.keepDirtyValues?l.keepDefaultValues&&a?Eu(i,a,void 0,h):n.dirtyFields:l.keepDefaultValues&&e?Eu(i,e,void 0,h):l.keepDirty?n.dirtyFields:l.keepValues?Eu(i,a,void 0,h):{},touchedFields:l.keepTouched?n.touchedFields:{},...!l.keepIsValidating&&(n.isValidating||!Rl(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:l.keepErrors?n.errors:{},isSubmitSuccessful:l.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Fe=(e,n)=>Pe(vl(e)?e(a):e,{...t.resetOptions,...n}),Ie=(e,t={})=>{let n=U(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&vl(e.select)&&e.select()})}},Le=e=>{let{name:t,type:r,values:i,...a}=e;n={...n,...a}};_.state.subscribe({next:Le});let Re={control:{register:ke,unregister:De,getFieldState:xe,handleSubmit:Me,setError:Ce,_subscribe:Te,_runSchema:ae,_updateIsValidating:T,_focusError:Ae,_getWatch:de,_getDirty:ue,_setValid:w,_setFieldArray:E,_setDisabledField:Oe,_setErrors:O,_getFieldArray:fe,_reset:Pe,_resetDefaultValues:()=>vl(t.defaultValues)&&t.defaultValues().then(e=>{Fe(e,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:le,_disableForm:je,_subjects:_,_proxyFormState:m,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},d=Pl(t.mode),f=Pl(t.reValidateMode),b=t.criteriaMode===fl.all}},subscribe:Ee,trigger:be,register:ke,handleSubmit:Me,watch:we,setValue:ge,setValues:_e,getValues:A,getErrors:j,reset:Fe,resetField:Ne,resetDefaultValues:(e,t={})=>{if(i=V(e),!t.keepDirty){let e=Eu(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!Rl(e)}t.keepIsValid||w(),_.state.next({...n,defaultValues:i})},clearErrors:Se,unregister:De,setError:Ce,setFocus:Ie,getFieldState:xe};return{...Re,formControl:Re}}function Gu(e={}){let t=x.useRef(void 0),n=x.useRef(void 0),r=x.useRef(e.formControl),[i,a]=x.useState(()=>({...V(Uu),isLoading:vl(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:vl(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!vl(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=Wu(e);t.current={...r,formState:i}}}let o=t.current.control;o._options=e;let s=()=>({...o._formState,defaultValues:o._defaultValues}),{resyncIfNeeded:c,snapshot:l}=Ol(s);return Cl(()=>{c(!0,s,a);let e=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),o._formState.isReady=!0,()=>{e(),l(!0,s)}},[o,c,l]),x.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),x.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),x.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),x.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),x.useEffect(()=>{if(o._proxyFormState.isDirty){let e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}},[o,i.isDirty]),x.useEffect(()=>{e.values&&!Dl(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),o._options.resetOptions?.keepIsValid||o._setValid(),n.current=e.values,a(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),x.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=x.useMemo(()=>Sl(i,o),[o,i]),t.current}function Ku(e,t=`|`){return e.map(e=>rd(e)).join(t)}function qu(e,t){return typeof t==`bigint`?t.toString():t}function Ju(e){return e==null}function Yu(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Xu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Zu(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Qu(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function q(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var $u=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Y(e){if(J(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return J(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ed(e){return Y(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function td(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function nd(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function X(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 rd(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}var id={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ad={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function od(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 sd(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 cd(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ld(e){return typeof e==`string`?e:e?.message}function ud(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function dd(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:ld(e.inst?._zod.def?.error?.(e))??ld(a?.(e))??ld(t?.error?.(e))??ld(n.customError?.(e))??ld(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 fd=/[\uD800-\uDBFF]/;function pd(e){let t=e.length;if(!fd.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 md(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function hd(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 gd(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function _d(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):xd(e,n,r.value)}for(let n of Object.getOwnPropertySymbols(t))xd(e,n,t[n])}function vd(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function yd(e,t,n){return vd(e,t,n,!1)}function bd(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return vd(this,n,r(this))},set(e){vd(this,n,e)}})}return t}function xd(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:vd(this,t,n.bind(this))},set(e){vd(this,t,e)}})}var Sd,Cd=!1,wd={configurable:!0,get(){Cd=!0}};function Td(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Sd!==e._zod){Sd=void 0;return}Sd=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,wd);let e=Cd;Cd=!1;try{let r=n(this);return Cd?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Cd||=e,r}catch(n){throw delete this[t],Cd||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}var Ed=`~constantCatch`;function Dd(e){let t=()=>e;return t[Ed]=!0,t}var Od,kd={value:void 0,enumerable:!1},Ad=`captureStackTrace`in Error?Error:null;function jd(e){let t=Ad;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ad=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Z(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){kd.value=new a(r);try{Object.defineProperty(n,"_zod",kd)}finally{kd.value=void 0}}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),_d(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?jd(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 Md=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Nd=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Od=globalThis).__zod_globalConfig??(Od.__zod_globalConfig={});var Pd=globalThis.__zod_globalConfig;function Fd(e){return e&&Object.assign(Pd,e),Pd}function Id(){let e=this._zod;return e.message??=JSON.stringify(e.def,qu,2),e.message}function Ld(e){this._zod.message=e}var Rd={get:Id,set:Ld,enumerable:!0,configurable:!0},zd={value:void 0,enumerable:!1},Bd=new WeakSet([Object.prototype,Error.prototype]),Vd=(e,t)=>{e.name=`$ZodError`,zd.value=t,Object.defineProperty(e,"issues",zd),zd.value=void 0,Object.defineProperty(e,"message",Rd);let n=Object.getPrototypeOf(e);Bd.has(n)||(Bd.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})}}))},Hd=Z(`$ZodError`,Vd);Z(`$ZodError`,Vd,void 0,{Parent:Error});function Ud(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 Wd(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ud(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Gd(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 Kd(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qd=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 Md;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>dd(e,o,Fd())));throw $u(n,a?.callee??t),n}return s.value};return t},Jd=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=>dd(e,o,Fd())));throw $u(n,a?.callee??t),n}return s.value};return t},Yd=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 Md;return a.issues.length?Xd(e,a.issues,i):{success:!0,data:a.value}};function Xd(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>dd(e,n,Fd()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Zd=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?Xd(e,a.issues,i):{success:!0,data:a.value}},Qd=Symbol.for(`zod.compile.invalid`),$d=Symbol.for(`zod.compile.fallback`),ef=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Qd)return!0;if(r.definite===!0&&n===void 0)return!1}return tf(e,t,n)});function tf(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[$d]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Md;return a.issues.length===0}var nf=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},rf=e=>{let t=qd(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Kd(n,a))};return n},af=e=>{let t=qd(e),n=(e,r,i,a)=>t(e,r,i,Kd(n,a));return n},of=e=>{let t=Jd(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Kd(n,a))};return n},sf=e=>{let t=Jd(e),n=async(e,r,i,a)=>await t(e,r,i,Kd(n,a));return n},cf=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Yd(e)(t,n,i)},lf=e=>(t,n,r)=>Yd(e)(t,n,r),uf=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Zd(e)(t,n,i)},df=e=>async(t,n,r)=>Zd(e)(t,n,r),ff=/^[cC][0-9a-z]{6,}$/,pf=/^[0-9a-z]+$/,mf=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,hf=/^[0-9a-vA-V]{20}$/,gf=/^[A-Za-z0-9]{27}$/,_f=/^[a-zA-Z0-9_-]{21}$/;function vf(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var yf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bf=/^([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})$/,xf=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)$/,Sf=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Cf=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function wf(){return new RegExp(Cf,`u`)}var Tf=/^(?:(?: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])$/,Ef=/^(([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}|:))$/,Df=/^((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])$/,Of=/^(([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])$/,kf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Af=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,jf=/^https?$/,Mf=/^\+[1-9]\d{6,14}$/,Nf=`(?:(?:\\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 Pf(e){return RegExp(`^${e}$`)}var Ff=Pf(Nf);function If(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 Lf(e){return RegExp(`^${If(e)}$`)}function Rf(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${If({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${If({precision:e.precision})}`:n;return RegExp(`^${Nf}T(?:${r})$`)}var zf=/^[\s\S]{0,}$/,Bf=/^[^A-Z]*$/,Vf=/^[^a-z]*$/,Q=Z(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Hf=e=>{let t=e.value;return!Ju(t)&&t.length!==void 0},Uf=Z(`$ZodCheckMaxLength`,(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=Hf),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?pd(r):i)<=t.maximum)return;let a=md(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wf=Z(`$ZodCheckMinLength`,(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=Hf),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?pd(r):i)>=t.minimum)return;let a=md(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gf=Z(`$ZodCheckLengthEquals`,(e,t)=>{var n;Q.init(e,t),(n=e._zod.def).when??(n.when=Hf),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?pd(r):i;if(a===t.length)return;let o=md(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})}}),Kf=Z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Q.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=()=>{})}),qf=Z(`$ZodCheckRegex`,(e,t)=>{Kf.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})}}),Jf=Z(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Bf,Kf.init(e,t)}),Yf=Z(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Vf,Kf.init(e,t)}),Xf=Z(`$ZodCheckIncludes`,(e,t)=>{Q.init(e,t);let n=td(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})}}),Zf=Z(`$ZodCheckStartsWith`,(e,t)=>{Q.init(e,t);let n=RegExp(`^${td(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})}}),Qf=Z(`$ZodCheckEndsWith`,(e,t)=>{Q.init(e,t);let n=RegExp(`.*${td(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})}}),$f=Z(`$ZodCheckOverwrite`,(e,t)=>{Q.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ep={major:4,minor:6,patch:2},$=Z(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ep;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=od(t),a;for(let o of n){if(o._zod.def.when){if(sd(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 Md;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(ud(t.issues,n,e),i||=od(t,n))});else{if(t.issues.length===n)continue;ud(t.issues,n,e),i||=od(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(od(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Md;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 Md;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return yd(this,`~standard`,rp(this))},set"~standard"(e){vd(this,`~standard`,e)}}),tp=(e,t)=>e.issues.length?{issues:e.issues.map(e=>dd(e,t,Fd()))}:{value:e.value};async function np(e,t){let n={async:!0};return tp(await e._zod.run({value:t,issues:[]},n),n)}function rp(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return tp(r,n)}catch{}return np(e,t)},vendor:`zod`,version:1}}var ip=Z(`$ZodString`,(e,t)=>{$.init(e,t),e._zod.pattern=t.pattern??zf,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}}),ap=Z(`$ZodStringFormat`,(e,t)=>{Kf.init(e,t),ip.init(e,t)}),op=Z(`$ZodGUID`,(e,t)=>{t.pattern??=bf,ap.init(e,t)}),sp=Z(`$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??=xf(e)}else t.pattern??=xf();ap.init(e,t)}),cp=Z(`$ZodEmail`,(e,t)=>{t.pattern??=Sf,ap.init(e,t)});function lp(e,t){if(!t.normalize&&t.protocol?.source===jf.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var up=/[\t\n\r]/g;function dp(e){return e.replace(up,``)}function fp(e,t){return t.lastIndex=0,t.test(e.hostname)}function pp(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var mp=Z(`$ZodURL`,(e,t)=>{ap.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=lp(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}t.hostname&&!fp(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&&!pp(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:dp(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),hp=Z(`$ZodEmoji`,(e,t)=>{t.pattern??=wf(),ap.init(e,t)}),gp=Z(`$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?_f:vf(t.length),ap.init(e,t)}),_p=Z(`$ZodCUID`,(e,t)=>{t.pattern??=ff,ap.init(e,t)}),vp=Z(`$ZodCUID2`,(e,t)=>{t.pattern??=pf,ap.init(e,t)}),yp=Z(`$ZodULID`,(e,t)=>{t.pattern??=mf,ap.init(e,t)}),bp=Z(`$ZodXID`,(e,t)=>{t.pattern??=hf,ap.init(e,t)}),xp=Z(`$ZodKSUID`,(e,t)=>{t.pattern??=gf,ap.init(e,t)}),Sp=Z(`$ZodISODateTime`,(e,t)=>{t.pattern??=Rf(t),ap.init(e,t)}),Cp=Z(`$ZodISODate`,(e,t)=>{t.pattern??=Ff,ap.init(e,t)}),wp=Z(`$ZodISOTime`,(e,t)=>{t.pattern??=Lf(t),ap.init(e,t)}),Tp=Z(`$ZodISODuration`,(e,t)=>{t.pattern??=yf,ap.init(e,t)}),Ep=Z(`$ZodIPv4`,(e,t)=>{t.pattern??=Tf,ap.init(e,t)}),Dp=/^[0-9a-fA-F:.]+$/;function Op(e){if(!Dp.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var kp=Z(`$ZodIPv6`,(e,t)=>{t.pattern??=Ef,ap.init(e,t),e._zod.check=n=>{Op(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Ap=Z(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Df,ap.init(e,t)});function jp(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:Op(n)}var Mp=Z(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Of,ap.init(e,t),e._zod.check=n=>{jp(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Np(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Pp=/^[0-9a-zA-Z+/]*={0,2}$/,Fp=Z(`$ZodBase64`,(e,t)=>{t.pattern??=Pp,ap.init(e,t),e._zod.check=n=>{Np(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Ip=/^[A-Za-z0-9_-]*$/;function Lp(e){if(!Ip.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Np(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Rp=Z(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ip,ap.init(e,t),e._zod.check=n=>{Lp(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),zp=Z(`$ZodE164`,(e,t)=>{t.pattern??=Mf,ap.init(e,t)});function Bp(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 Vp=Z(`$ZodJWT`,(e,t)=>{ap.init(e,t),e._zod.check=n=>{Bp(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}});function Hp(e,t,n){e.issues.length&&t.issues.push(...cd(n,e.issues)),t.value[n]=e.value}var Up=Z(`$ZodArray`,(e,t)=>{$.init(e,t);let n=Pd.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=>Hp(t,r,e)));else if(Hp(c,r,e),s&&c.issues.length!==0&&od(c))break}return o.length?Promise.all(o).then(()=>r):r}});function Wp(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=>!od(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=>dd(e,r,Fd())))}),t)}var Gp=Z(`$ZodUnion`,(e,t)=>{$.init(e,t),Td(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),Td(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Td(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)))}),Td(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=>Yu(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=>Wp(t,r,e,i)):Wp(o,r,e,i)}}),Kp=Z(`$ZodIntersection`,(e,t)=>{$.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])=>Jp(e,t,n)):Jp(e,i,a)}});function qp(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Y(e)&&Y(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=qp(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=qp(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 Jp(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=qp(t.value,n.value);if(!c.valid){if(od(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Yp=Z(`$ZodTransform`,(e,t)=>{$.init(e,t),e._zod.optin=`optional`,Pd.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Nd(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 Md;return n.value=i,n}});function Xp(e,t){return e.value=t.issues.length?void 0:t.value,e}var Zp=Z(`$ZodOptional`,(e,t)=>{$.init(e,t),Td(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Td(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Td(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Yu(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=>Xp(e,t)):Xp(e,r)}return t.innerType._zod.run(e,n)}}),Qp=Z(`$ZodExactOptional`,(e,t)=>{Zp.init(e,t),Td(e,`values`,e=>e.def.innerType._zod.values),Td(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),$p=Z(`$ZodNullable`,(e,t)=>{$.init(e,t),Td(e,`optin`,e=>e.def.innerType._zod.optin),Td(e,`optout`,e=>e.def.innerType._zod.optout),Td(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Yu(t.source)}|null)$`):void 0}),Td(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)}),em=Z(`$ZodDefault`,(e,t)=>{$.init(e,t),e._zod.optin=`defaulted`,Td(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=>tm(e,t)):tm(r,t)}});function tm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var nm=Z(`$ZodPrefault`,(e,t)=>{$.init(e,t),e._zod.optin=`defaulted`,Td(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))}),rm=Z(`$ZodNonOptional`,(e,t)=>{$.init(e,t),Td(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=>im(t,e)):im(i,e)}});function im(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 am(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>dd(e,r,Fd()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var om=Z(`$ZodCatch`,(e,t)=>{$.init(e,t),Td(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Td(e,`optout`,e=>e.def.innerType._zod.optout),Td(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=>am(e,r,t,n)):am(e,r,t,n)}}),sm=Z(`$ZodPipe`,(e,t)=>{$.init(e,t),Td(e,`values`,e=>e.def.in._zod.values),Td(e,`optin`,e=>e.def.in._zod.optin),Td(e,`optout`,e=>e.def.out._zod.optout),Td(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=>cm(e,t.in,n)):cm(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>cm(e,t.out,n)):cm(r,t.out,n)}});function cm(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 lm=Z(`$ZodReadonly`,(e,t)=>{$.init(e,t),Td(e,`propValues`,e=>e.def.innerType._zod.propValues),Td(e,`values`,e=>e.def.innerType._zod.values),Td(e,`optin`,e=>e.def.innerType?._zod?.optin),Td(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(um):um(r)}});function um(e){return e.memo||(e.value=Object.freeze(e.value)),e}var dm=Z(`$ZodCustom`,(e,t)=>{Q.init(e,t),$.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=>fm(t,n,r,e));fm(i,n,r,e)}});function fm(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(gd(e))}}var pm=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},mm=`~memo`,hm=[];function gm(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function _m(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var vm=new WeakMap,ym=0,bm=1,xm=2;function Sm(e,t,n){let r=vm.get(e);if(r!==void 0)return r?xm:ym;if(t.has(e))return xm;t.add(e);let i=ym,a=e=>{if(i!==xm&&e?._zod){let r=Sm(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=ym;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?bm:o.value?._zod?Sm(o.value,t,n):ym;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Zu(c);s(e?o(e,!0):bm),a(c.catchall);break}case`properties`:s(o(c.shape,!1));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?Sm(r,t,!1):bm);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),Cm(e,i)}function Cm(e,t){return t!==bm&&vm.set(e,t===xm),t}function wm(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Tm,Em=[],Dm={alloc(e,t,n){let r=Tm;if(!r)return n;Tm=void 0;let i={value:n,issues:null};return r.set(t.value,i),Em.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`&&km(n,e.value))throw new pm;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=Sm(e,new Set,!1);if(i===ym)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===xm||r?n=!0:r=!0}let l=s.value;if(!gm(l))return t(s,c);let u=c[mm];u||(u={buckets:new WeakMap,backEdges:void 0},c[mm]=u);let d;i===c?d=a:(d=wm(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(..._m(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Tm=d;let p=Em.length,m=t(s,c);Tm=void 0;let h=Em.length>p?Em.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?_m(e.issues):hm),e)):(h&&(h.issues=m.issues.length?_m(m.issues):hm),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Om(){return Dm}function km(e,t){let n=e[mm]?.backEdges;return n!==void 0&&gm(t)&&n.has(t)}var Am=()=>{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`,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(hd(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${rd(e.values[0])}`:`Invalid option: expected one of ${Ku(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`:``}: ${Ku(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 jm(){return{localeError:Am()}}var Mm,Nm=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 Pm(){return new Nm}(Mm=globalThis).__zod_globalRegistry??(Mm.__zod_globalRegistry=Pm());var Fm=globalThis.__zod_globalRegistry;function Im(e,t){return new e({type:`string`,...X(t)})}function Lm(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...X(t)})}function Rm(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...X(t)})}function zm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...X(t)})}function Bm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...X(t)})}function Vm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...X(t)})}function Hm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...X(t)})}function Um(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...X(t)})}function Wm(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...X(t)})}function Gm(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...X(t)})}function Km(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...X(t)})}function qm(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...X(t)})}function Jm(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...X(t)})}function Ym(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...X(t)})}function Xm(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...X(t)})}function Zm(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...X(t)})}function Qm(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...X(t)})}function $m(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...X(t)})}function eh(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...X(t)})}function th(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...X(t)})}function nh(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...X(t)})}function rh(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...X(t)})}function ih(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...X(t)})}function ah(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...X(t)})}function oh(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...X(t)})}function sh(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...X(t)})}function ch(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...X(t)})}function lh(e,t){return new Uf({check:`max_length`,...X(t),maximum:e})}function uh(e,t){return new Wf({check:`min_length`,...X(t),minimum:e})}function dh(e,t){return new Gf({check:`length_equals`,...X(t),length:e})}function fh(e,t){return new qf({check:`string_format`,format:`regex`,...X(t),pattern:e})}function ph(e){return new Jf({check:`string_format`,format:`lowercase`,...X(e)})}function mh(e){return new Yf({check:`string_format`,format:`uppercase`,...X(e)})}function hh(e,t){return new Xf({check:`string_format`,format:`includes`,...X(t),includes:e})}function gh(e,t){return new Zf({check:`string_format`,format:`starts_with`,...X(t),prefix:e})}function _h(e,t){return new Qf({check:`string_format`,format:`ends_with`,...X(t),suffix:e})}function vh(e){return new $f({check:`overwrite`,tx:e})}function yh(e){return vh(t=>t.normalize(e))}function bh(){return vh(e=>e.trim())}function xh(){return vh(e=>e.toLowerCase())}function Sh(){return vh(e=>e.toUpperCase())}function Ch(){return vh(e=>q(e))}function wh(e,t,n){return new e({type:`array`,element:t,...X(n)})}function Th(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...X(n)})}function Eh(e,t){let n=Dh(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(gd(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(gd(r))}},e(t.value,t)),t);return n}function Dh(e,t){let n=new Q({check:`custom`,...X(t)});return n._zod.check=e,n}function Oh(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Xu(e,t,n[t]);return e}function kh(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??Fm,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 Ah(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 jh(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,jh(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Oh(o.schema,c),t.io===`input`&&Vh(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 Mh(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Nh(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}/${Mh(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+Mh(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);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ph(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;Ph(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 Fh=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ih=[`oneOf`,`anyOf`];function Lh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Rh(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Fh.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]??Lh(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Xu(n,r,e.length===1?e[0]:Rh(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=Lh(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 Fh)if(t in e)return;let n=t.filter(e=>Ih.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Rh(t);else{let e=n[0],i=Ih.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=>Rh([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Oh(e,r))}function Bh(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)):Oh(i,s),Oh(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())Ph(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)}Oh(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,Xu(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:Uh(t,`input`,e.processors),output:Uh(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Vh(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 Vh(r.element,n);if(r.type===`set`)return Vh(r.valueType,n);if(r.type===`lazy`)return Vh(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 Vh(r.innerType,n);if(r.type===`intersection`)return Vh(r.left,n)||Vh(r.right,n);if(r.type===`record`||r.type===`map`)return Vh(r.keyType,n)||Vh(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Vh(r.in,n)||Vh(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Vh(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Vh(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Vh(e,n))return!0;return!!(r.rest&&Vh(r.rest,n))}return!1}var Hh=(e,t={})=>n=>{let r=kh({...n,processors:t});return jh(e,r),Nh(r,e),Bh(r,e)},Uh=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=kh({...i??{},target:a,io:t,processors:n});return jh(e,o),Nh(o,e),Bh(o,e)},Wh=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Gh=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Kh=(e,t)=>{Wh(e,`minimum`,t),Gh(e,`maximum`,t)},qh=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Jh=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Yh=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Xh=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Zh=(e,t)=>Wh(e,`minimum`,t.minimum),Qh=(e,t)=>Gh(e,`maximum`,t.maximum),$h=e=>(t,n)=>{Xh(t,n.format);let[r,i]=e[n.format];Wh(t,`minimum`,r),Gh(t,`maximum`,i)},eg={greater_than:(e,t)=>Wh(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Gh(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>qh(e,t.value),number_format:$h(id),bigint_format:$h(ad),min_length:Zh,max_length:Qh,length_equals:(e,t)=>Kh(e,t.length),min_size:Zh,max_size:Qh,size_equals:(e,t)=>Kh(e,t.size),string_format:(e,t)=>{Xh(e,t.format),t.pattern&&Jh(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)=>Yh(e,t.mime)};function tg(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)eg[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Wh(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Wh(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Gh(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Gh(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&qh(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Yh(t,i.mime);for(let e of i.patterns??[])Jh(t,e);return t}var ng={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},rg=new Map([[Pp,kf],[Ip,Af]]),ig=e=>rg.get(e)??e,ag=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=tg(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ng[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(ig);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}))])}},og=(e,t,n,r)=>{Ah(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},sg=(e,t,n,r)=>{Ah(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},cg=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=tg(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=jh(a.element,t,{...r,path:[...r.path,`items`]})},lg=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>jh(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ug=(e,t,n,r)=>{let i=e._zod.def,a=jh(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=jh(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)},dg=(e,t,n,r)=>{let i=e._zod.def,a=jh(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`}]},fg=(e,t,n,r)=>{let i=e._zod.def;jh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},pg=Symbol();function mg(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Ah(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),pg):JSON.parse(o)}var hg=(e,t,n,r)=>{let i=e._zod.def;jh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=mg(i.defaultValue,e,t,n,r);o!==pg&&(n.default=o)},gg=(e,t,n,r)=>{let i=e._zod.def;jh(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=mg(i.defaultValue,e,t,n,r);o!==pg&&(n._prefault=o)},_g=(e,t,n,r)=>{let i=e._zod.def;jh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Ah(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},vg=(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;jh(o,t,r);let s=t.seen.get(e);s.ref=o},yg=(e,t,n,r)=>{let i=e._zod.def;jh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},bg=(e,t,n,r)=>{let i=e._zod.def;jh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xg=new WeakSet([Object.prototype,Error.prototype]);function Sg(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 Cg=Z(`ZodError`,(e,t)=>{Hd.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);xg.has(n)||(xg.add(n),Sg(n,`format`,e=>t=>Gd(e,t)),Sg(n,`flatten`,e=>t=>Wd(e,t)),Sg(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,qu,2)}),Sg(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}),wg=qd(Cg),Tg=Jd(Cg),Eg=Yd(Cg),Dg=Zd(Cg),Og=rf(Cg),kg=af(Cg),Ag=of(Cg),jg=sf(Cg),Mg=cf(Cg),Ng=lf(Cg),Pg=uf(Cg),Fg=df(Cg);function Ig(){Pd.localeError||Fd(jm())}function Lg(){Pd.memoizer||Fd({memoizer:Om()})}var Rg=Z(`ZodType`,(e,t)=>(Ig(),$.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Qu(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 nd(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(B_(e,t))},overwrite(e){return this.check(vh(e))},optional(){return x_(this)},exactOptional(){return C_(this)},nullable(){return T_(this)},nullish(){return x_(T_(this))},nonoptional(e){return j_(this,e)},array(){return p_(this)},or(e){return h_([this,e])},and(e){return __(this,e)},transform(e){return F_(this,y_(e))},default(e){return D_(this,e)},prefault(e){return k_(this,e)},catch(e){return N_(this,e)},pipe(e){return F_(this,e)},readonly(){return L_(this)},describe(e){let t=this.clone();return Fm.add(t,{description:e}),t},meta(...e){if(e.length===0)return Fm.get(this);let t=this.clone();return Fm.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 yd(this,`~standard`,{...rp(this),jsonSchema:{input:Uh(this,`input`),output:Uh(this,`output`)}})},set"~standard"(e){vd(this,`~standard`,e)},parse:function e(t,n){return wg(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Tg(this,t,n,{callee:e})},safeParse(e,t){return Eg(this,e,t)},async safeParseAsync(e,t){return Dg(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){vd(this,`spa`,e)},validate(e,t){return ef(this,e,t)},validateAsync(e,t){return nf(this,e,t)},encode:function e(t,n){return Og(this,t,n,{callee:e})},decode:function e(t,n){return kg(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Ag(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await jg(this,t,n,{callee:e})},safeEncode(e,t){return Mg(this,e,t)},safeDecode(e,t){return Ng(this,e,t)},async safeEncodeAsync(e,t){return Pg(this,e,t)},async safeDecodeAsync(e,t){return Fg(this,e,t)},toJSONSchema(e){return Hh(this,{})(e)},get description(){return Fm.get(this)?.description},get _def(){return this._zod.def}}),zg=Z(`_ZodString`,(e,t)=>{ip.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ag(e,t,n,r)},bd({format:e=>tg(e).format??null,minLength:e=>tg(e).minimum??null,maxLength:e=>tg(e).maximum??null},{regex(...e){return this.check(fh(...e))},includes(...e){return this.check(hh(...e))},startsWith(...e){return this.check(gh(...e))},endsWith(...e){return this.check(_h(...e))},min(...e){return this.check(uh(...e))},max(...e){return this.check(lh(...e))},length(...e){return this.check(dh(...e))},nonempty(...e){return this.check(uh(1,...e))},lowercase(e){return this.check(ph(e))},uppercase(e){return this.check(mh(e))},trim(){return this.check(bh())},normalize(...e){return this.check(yh(...e))},toLowerCase(){return this.check(xh())},toUpperCase(){return this.check(Sh())},slugify(){return this.check(Ch())}})),Bg=Z(`ZodString`,(e,t)=>{ip.init(e,t),zg.init(e,t)},{email(e){return this.check(Lm(qg,e))},url(e){return this.check(Um(Xg,e))},jwt(e){return this.check(ih(d_,e))},emoji(e){return this.check(Wm(Zg,e))},guid(e){return this.check(Rm(Jg,e))},uuid(e){return this.check(zm(Yg,e))},uuidv4(e){return this.check(Bm(Yg,e))},uuidv6(e){return this.check(Vm(Yg,e))},uuidv7(e){return this.check(Hm(Yg,e))},nanoid(e){return this.check(Gm(Qg,e))},cuid(e){return this.check(Km($g,e))},cuid2(e){return this.check(qm(e_,e))},ulid(e){return this.check(Jm(t_,e))},base64(e){return this.check(th(c_,e))},base64url(e){return this.check(nh(l_,e))},xid(e){return this.check(Ym(n_,e))},ksuid(e){return this.check(Xm(r_,e))},ipv4(e){return this.check(Zm(i_,e))},ipv6(e){return this.check(Qm(a_,e))},cidrv4(e){return this.check($m(o_,e))},cidrv6(e){return this.check(eh(s_,e))},e164(e){return this.check(rh(u_,e))},datetime(e){return this.check(ah(Ug,e))},date(e){return this.check(oh(Wg,e))},time(e){return this.check(sh(Gg,e))},duration(e){return this.check(ch(Kg,e))}});function Vg(e){return Im(Bg,e)}var Hg=Z(`ZodStringFormat`,(e,t)=>{ap.init(e,t),zg.init(e,t)}),Ug=Z(`ZodISODateTime`,(e,t)=>{Sp.init(e,t),Hg.init(e,t)}),Wg=Z(`ZodISODate`,(e,t)=>{Cp.init(e,t),Hg.init(e,t)}),Gg=Z(`ZodISOTime`,(e,t)=>{wp.init(e,t),Hg.init(e,t)}),Kg=Z(`ZodISODuration`,(e,t)=>{Tp.init(e,t),Hg.init(e,t)}),qg=Z(`ZodEmail`,(e,t)=>{cp.init(e,t),Hg.init(e,t)}),Jg=Z(`ZodGUID`,(e,t)=>{op.init(e,t),Hg.init(e,t)}),Yg=Z(`ZodUUID`,(e,t)=>{sp.init(e,t),Hg.init(e,t)}),Xg=Z(`ZodURL`,(e,t)=>{mp.init(e,t),Hg.init(e,t)}),Zg=Z(`ZodEmoji`,(e,t)=>{hp.init(e,t),Hg.init(e,t)}),Qg=Z(`ZodNanoID`,(e,t)=>{gp.init(e,t),Hg.init(e,t)}),$g=Z(`ZodCUID`,(e,t)=>{_p.init(e,t),Hg.init(e,t)}),e_=Z(`ZodCUID2`,(e,t)=>{vp.init(e,t),Hg.init(e,t)}),t_=Z(`ZodULID`,(e,t)=>{yp.init(e,t),Hg.init(e,t)}),n_=Z(`ZodXID`,(e,t)=>{bp.init(e,t),Hg.init(e,t)}),r_=Z(`ZodKSUID`,(e,t)=>{xp.init(e,t),Hg.init(e,t)}),i_=Z(`ZodIPv4`,(e,t)=>{Ep.init(e,t),Hg.init(e,t)}),a_=Z(`ZodIPv6`,(e,t)=>{kp.init(e,t),Hg.init(e,t)}),o_=Z(`ZodCIDRv4`,(e,t)=>{Ap.init(e,t),Hg.init(e,t)}),s_=Z(`ZodCIDRv6`,(e,t)=>{Mp.init(e,t),Hg.init(e,t)}),c_=Z(`ZodBase64`,(e,t)=>{Fp.init(e,t),Hg.init(e,t)}),l_=Z(`ZodBase64URL`,(e,t)=>{Rp.init(e,t),Hg.init(e,t)}),u_=Z(`ZodE164`,(e,t)=>{zp.init(e,t),Hg.init(e,t)}),d_=Z(`ZodJWT`,(e,t)=>{Vp.init(e,t),Hg.init(e,t)}),f_=Z(`ZodArray`,(e,t)=>{Lg(),Up.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cg(e,t,n,r),e.element=t.element},{min(e,t){return this.check(uh(e,t))},nonempty(e){return this.check(uh(1,e))},max(e,t){return this.check(lh(e,t))},length(e,t){return this.check(dh(e,t))},unwrap(){return this.element}});function p_(e,t){return wh(f_,e,t)}var m_=Z(`ZodUnion`,(e,t)=>{Gp.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lg(e,t,n,r),e.options=t.options});function h_(e,t){return new m_({type:`union`,options:e,...X(t)})}var g_=Z(`ZodIntersection`,(e,t)=>{Kp.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ug(e,t,n,r)});function __(e,t){return new g_({type:`intersection`,left:e,right:t})}var v_=Z(`ZodTransform`,(e,t)=>{Lg(),Yp.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sg(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Nd(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(gd(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(gd(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function y_(e){return new v_({type:`transform`,transform:e})}var b_=Z(`ZodOptional`,(e,t)=>{Zp.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function x_(e){return new b_({type:`optional`,innerType:e})}var S_=Z(`ZodExactOptional`,(e,t)=>{Qp.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function C_(e){return new S_({type:`optional`,innerType:e})}var w_=Z(`ZodNullable`,(e,t)=>{$p.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function T_(e){return new w_({type:`nullable`,innerType:e})}var E_=Z(`ZodDefault`,(e,t)=>{em.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function D_(e,t){return new E_({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ed(t)}})}var O_=Z(`ZodPrefault`,(e,t)=>{nm.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function k_(e,t){return new O_({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ed(t)}})}var A_=Z(`ZodNonOptional`,(e,t)=>{rm.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function j_(e,t){return new A_({type:`nonoptional`,innerType:e,...X(t)})}var M_=Z(`ZodCatch`,(e,t)=>{om.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_g(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function N_(e,t){return new M_({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Dd(t)})}var P_=Z(`ZodPipe`,(e,t)=>{sm.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vg(e,t,n,r),e.in=t.in,e.out=t.out});function F_(e,t){return new P_({type:`pipe`,in:e,out:t})}var I_=Z(`ZodReadonly`,(e,t)=>{lm.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function L_(e){return new I_({type:`readonly`,innerType:e})}var R_=Z(`ZodCustom`,(e,t)=>{dm.init(e,t),Rg.init(e,t),e._zod.processJSONSchema=(t,n,r)=>og(e,t,n,r)});function z_(e,t={}){return Th(R_,e,t)}function B_(e,t){return Eh(e,t)}function V_({value:e,onChange:t}){let n=Bi(),[r,i]=(0,x.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,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsxs)(`label`,{className:`form-label`,children:[`MACHINES `,(0,P.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(pick targets; none = runs nowhere)`})]}),o.length===0?(0,P.jsx)(`div`,{className:`machine-empty`,children:`No machines known yet — add one below.`}):(0,P.jsx)(`div`,{className:`machine-chips`,children:o.map(t=>(0,P.jsx)(`button`,{type:`button`,className:e.includes(t)?`machine-chip on`:`machine-chip`,onClick:()=>s(t),children:t},t))}),(0,P.jsxs)(`div`,{className:`machine-add`,children:[(0,P.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,P.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 H_=`Copy of `;function U_(e){return e.startsWith(H_)?e:`${H_}${e}`}function W_(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 G_(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 K_(e){return e.join(`, `)}function q_(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function J_(e){let t=e.trim();return t===``||!/^\d+$/.test(t)?null:Number(t)}var Y_=[[`3600`,`1h`],[`86400`,`1d`],[`604800`,`7d`],[`2592000`,`30d`]];function X_(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 Z_({schedule:e,...t}){return t}var Q_=Vg().trim().min(1),$_=[`claude`,`codex`],ev=[[`@daily`,`@daily`],[`@hourly`,`@hourly`],[`@weekly`,`@weekly`],[`@monthly`,`@monthly`],[`0 0 9 * * 1-5 *`,`weekdays 9am`],[`0 0 * * * * *`,`every hour`]];function tv(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:W_(e?.repositories??[]),machines:e?.machines??[],tagsRaw:K_(e?.tags??[]),ttlRaw:e?.ttl_secs==null?``:String(e.ttl_secs),enabled:e?.enabled??!0,power_saving_exempt:e?.power_saving_exempt??!1}}function nv({initial:e,mode:t,saving:n,onCancel:r,onSave:i}){let a=Hi(),o=a.data&&a.data.length>0?a.data:$_,{register:s,control:c,setValue:l,handleSubmit:u,reset:d}=Gu({defaultValues:tv(e)}),{fields:f,append:p,remove:m}=lu({control:c,name:`schedules`});(0,x.useEffect)(()=>{d(tv(e))},[e]);let h=jl({control:c,name:`title`}),g=jl({control:c,name:`schedules`})??[],_=g.map(e=>e.expression.trim()).filter(Boolean),v=jl({control:c,name:`agent`}),y=jl({control:c,name:`prompt`}),b=jl({control:c,name:`machines`}),S=Q_.safeParse(h).success&&_.length>0&&Q_.safeParse(v).success&&Q_.safeParse(y).success,C=(e=``)=>{if(f.length===1&&(g[0]?.expression??``).trim()===``){l(`schedules.0.expression`,e);return}p({expression:e})},w=u(e=>{i({schedule:_[0]??``,schedules:_,title:e.title,agent:e.agent,model:e.model.trim()===``?null:e.model,prompt:e.prompt,goal:e.goal.trim()===``?null:e.goal,repositories:G_(e.reposRaw),machines:e.machines,enabled:e.enabled,power_saving_exempt:e.power_saving_exempt,ttl_secs:J_(e.ttlRaw),tags:q_(e.tagsRaw)})}),T=t===`edit`,ee=n?`…`:T?`SAVE CHANGES`:`CREATE ROUTINE`,E=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsx)(`label`,{className:`form-label`,children:`TITLE*`}),(0,P.jsx)(`input`,{className:`form-input`,placeholder:`ops/nightly triage`,autoComplete:`off`,spellCheck:!1,...s(`title`)}),(0,P.jsx)(`div`,{className:`form-hint`,children:`Display name only. Use MOVE to change the filesystem folder.`})]}),(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsx)(`label`,{className:`form-label`,children:`SCHEDULES*`}),(0,P.jsx)(`div`,{className:`cron-schedule-list`,children:f.map((e,t)=>{let n=g[t]?.expression??``,[r,i]=Ha(n),a=n.trim()===``?`cron-preview`:r?`cron-preview ok`:`cron-preview bad`;return(0,P.jsxs)(`div`,{className:`cron-schedule-row`,children:[(0,P.jsxs)(`div`,{className:`cron-schedule-input`,children:[(0,P.jsx)(`input`,{className:`form-input`,placeholder:`cron expression`,"aria-label":`Cron expression ${t+1}`,...s(`schedules.${t}.expression`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,"aria-label":`Remove cron expression ${t+1}`,onClick:()=>m(t),children:`REMOVE`})]}),(0,P.jsx)(`div`,{className:a,children:i})]},e.id)})}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm add-cron-btn`,onClick:()=>C(),children:`+ ADD CRON EXPRESSION`}),(0,P.jsx)(`div`,{className:`cron-presets`,children:ev.map(([e,t])=>(0,P.jsx)(`button`,{type:`button`,className:`preset-btn`,onClick:()=>C(e),children:t},e))})]}),(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsx)(`label`,{className:`form-label`,children:`AGENT*`}),(0,P.jsx)(`select`,{className:`form-select`,...s(`agent`),children:o.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsxs)(`label`,{className:`form-label`,children:[`MODEL `,(0,P.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(optional; blank = agent default)`})]}),(0,P.jsx)(`input`,{className:`form-input`,placeholder:`claude-sonnet-4-6`,...s(`model`)})]}),(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsx)(`label`,{className:`form-label`,children:`PROMPT*`}),(0,P.jsx)(`textarea`,{className:`form-textarea`,rows:6,placeholder:`Review open PRs and summarize…`,...s(`prompt`)})]}),(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsxs)(`label`,{className:`form-label`,children:[`GOAL `,(0,P.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(optional; ≤5 lines — the why)`})]}),(0,P.jsx)(`textarea`,{className:`form-textarea`,rows:3,placeholder:`Keep the PR backlog under control…`,...s(`goal`)})]}),(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsxs)(`label`,{className:`form-label`,children:[`REPOSITORIES `,(0,P.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(one url [branch] [auto_pull=false] per line)`})]}),(0,P.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,P.jsx)(V_,{value:b,onChange:e=>l(`machines`,e)}),(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsxs)(`label`,{className:`form-label`,children:[`TAGS `,(0,P.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(comma-separated)`})]}),(0,P.jsx)(`input`,{className:`form-input`,placeholder:`triage, nightly`,...s(`tagsRaw`)})]}),(0,P.jsxs)(`div`,{className:`form-group`,children:[(0,P.jsxs)(`label`,{className:`form-label`,children:[`WORKBENCH TTL `,(0,P.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(seconds; blank = server default)`})]}),(0,P.jsx)(`input`,{className:`form-input`,type:`number`,min:0,placeholder:`604800`,...s(`ttlRaw`)}),(0,P.jsx)(`div`,{className:`ttl-presets`,children:Y_.map(([e,t])=>(0,P.jsx)(`button`,{type:`button`,className:`preset-btn`,onClick:()=>l(`ttlRaw`,e),children:t},e))})]}),(0,P.jsxs)(`div`,{className:`toggle-row`,children:[(0,P.jsx)(`span`,{children:`ENABLED`}),(0,P.jsxs)(`label`,{className:`toggle`,children:[(0,P.jsx)(`input`,{type:`checkbox`,...s(`enabled`)}),(0,P.jsx)(`div`,{className:`toggle-track`})]})]}),(0,P.jsxs)(`div`,{className:`toggle-row`,children:[(0,P.jsx)(`span`,{title:`Allow this routine to launch while the host is on battery or Low Power Mode`,children:`POWER-SAVING EXEMPT`}),(0,P.jsxs)(`label`,{className:`toggle`,children:[(0,P.jsx)(`input`,{type:`checkbox`,...s(`power_saving_exempt`)}),(0,P.jsx)(`div`,{className:`toggle-track`})]})]})]}),D=(0,P.jsxs)(`div`,{className:`modal-ft`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:r,children:`CANCEL`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:n||!S,onClick:w,children:ee})]});return T?(0,P.jsx)(`div`,{className:`overlay open`,children:(0,P.jsxs)(`div`,{className:`dialog modal`,children:[(0,P.jsxs)(`div`,{className:`modal-hd`,children:[(0,P.jsx)(`div`,{className:`modal-title`,children:`EDIT ROUTINE`}),(0,P.jsx)(`button`,{type:`button`,className:`modal-x`,title:`Close`,"aria-label":`Close`,onClick:r,children:`✕`})]}),(0,P.jsx)(`div`,{className:`modal-body`,children:E}),D]})}):(0,P.jsxs)(`main`,{className:`create-page`,children:[(0,P.jsxs)(`div`,{className:`page-hd`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:r,children:`← BACK`}),(0,P.jsx)(`div`,{className:`page-title`,children:t===`clone`?`NEW ROUTINE (FROM CLONE)`:`NEW ROUTINE`})]}),(0,P.jsxs)(`div`,{className:`page-card card`,children:[(0,P.jsx)(`div`,{className:`modal-body`,children:E}),D]})]})}function rv({content:e,loading:t,err:n}){let r;if(t)r=(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})});else if(n!==void 0)r=(0,P.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,n]});else if(e===void 0)return null;else r=e===``?(0,P.jsx)(`div`,{className:`logs-empty`,children:`— the agent didn't write a summary for this run —`}):(0,P.jsx)(`div`,{className:`run-summary-text`,children:e});return(0,P.jsxs)(`div`,{className:`run-summary`,children:[(0,P.jsx)(`div`,{className:`section-hd`,children:(0,P.jsx)(`span`,{className:`section-label`,children:`SUMMARY`})}),(0,P.jsx)(`div`,{className:`logs-wrap run-summary-wrap`,children:r})]})}function iv(e){if(e===``)return[];let t=e.split(`
`);return t.length>0&&t[t.length-1]===``&&t.pop(),t}function av(e,t){let n=t.trim().toLowerCase(),r=[],i=iv(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 ov(e,t){let n=iv(e),r=n.length,i=t.trim().toLowerCase();return i===``?[r,r]:[n.filter(e=>e.toLowerCase().includes(i)).length,r]}function sv(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 cv({text:e,query:t}){return(0,P.jsx)(P.Fragment,{children:sv(e,t).map(([e,t],n)=>e?(0,P.jsx)(`mark`,{className:`log-hl`,children:t},n):(0,P.jsx)(`span`,{children:t},n))})}function lv({content:e,loading:t,err:n}){let[r,i]=(0,x.useState)(``),a=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=a.current;e&&(e.scrollTop=e.scrollHeight)},[e?.length]);let o=null;if(t)o=(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})});else if(n!==void 0)o=(0,P.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,n]});else if(e!==void 0){if(e===``)o=(0,P.jsx)(`div`,{className:`logs-empty`,children:`— no logs yet —`});else{let t=av(e,r),[n,a]=ov(e,r),s=r.trim()===``?`${a} lines`:`${n} / ${a} matches`;o=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`log-search`,children:[(0,P.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,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Clear search`,"aria-label":`Clear search`,onClick:()=>i(``),children:`✕`}),(0,P.jsx)(`span`,{className:`log-match-count`,children:s})]}),(0,P.jsx)(`div`,{className:`log-lines`,children:t.map(([e,t])=>(0,P.jsxs)(`div`,{className:`log-line`,children:[(0,P.jsx)(`span`,{className:`log-ln`,children:e}),(0,P.jsx)(`span`,{className:`log-lc`,children:(0,P.jsx)(cv,{text:t,query:r})})]},e))})]})}}return(0,P.jsx)(`div`,{className:`logs-wrap`,ref:a,children:o})}function uv(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 dv({runs:e,selected:t,onSelect:n}){if(e.length===0)return null;let r=uv(e);return(0,P.jsx)(`div`,{className:`duration-chart`,role:`list`,"aria-label":`Run duration chart`,children:r.map(e=>{let r=e.durationSecs===null?`in progress`:Fs(0,e.durationSecs),i=t===e.workbench;return(0,P.jsxs)(`button`,{type:`button`,role:`listitem`,className:`duration-row${i?` row-selected`:``}`,title:`${Ps(e.status)} · ${r} · ${Ga(e.startedAt)}${e.exitCode==null?``:` · exit ${e.exitCode}`}`,onClick:()=>n(e.workbench),children:[(0,P.jsx)(`span`,{className:`duration-row-time`,children:Ua(e.startedAt)}),(0,P.jsx)(`span`,{className:`duration-row-track`,children:(0,P.jsx)(`span`,{className:`duration-bar ${e.status}`,style:{width:`${e.widthPct}%`}})}),(0,P.jsx)(`span`,{className:`duration-row-dur`,children:r})]},e.workbench)})})}function fv({id:e,title:t,onBack:n}){let r=z(e),[i,a]=(0,x.useState)(void 0),o=ca(e,i??``,i!==void 0),s=la(e,i??``,i!==void 0),c=r.data??[],l=is(),u=Math.floor(l/1e3);return(0,P.jsxs)(`main`,{className:`logs-page`,children:[(0,P.jsxs)(`div`,{className:`page-hd`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,P.jsxs)(`div`,{className:`page-title`,children:[`HISTORY / `,t]}),r.dataUpdatedAt>0&&(0,P.jsx)(`span`,{className:`page-freshness`,children:fs(Math.max(0,(l-r.dataUpdatedAt)/1e3))}),(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void r.refetch(),children:`↻`})]}),r.isLoading?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):r.isError?(0,P.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,r.error.message]}):c.length===0?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS YET`})]})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(dv,{runs:c,selected:i,onSelect:e=>a(i===e?void 0:e)}),(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`STARTED`}),(0,P.jsx)(`th`,{children:`STATUS`}),(0,P.jsx)(`th`,{children:`DURATION`}),(0,P.jsx)(`th`,{children:`EXIT CODE`}),(0,P.jsx)(`th`,{children:`RETENTION`}),(0,P.jsx)(`th`,{})]})}),(0,P.jsx)(`tbody`,{children:c.map(t=>{let n=i===t.workbench;return(0,P.jsxs)(`tr`,{className:n?`row-selected`:``,children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(`div`,{className:`cell-time`,title:`${t.workbench} · ${Ga(t.started_at)}`,children:Ua(t.started_at)})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:Ns(t.status),children:Ps(t.status)})}),(0,P.jsx)(`td`,{children:t.finished_at==null?`—`:Fs(t.started_at,t.finished_at)}),(0,P.jsx)(`td`,{children:t.exit_code??`—`}),(0,P.jsx)(`td`,{children:t.retention_expires_at==null?`—`:(0,P.jsx)(`span`,{className:`cell-meta`,children:Is(u,t.retention_expires_at)})}),(0,P.jsxs)(`td`,{children:[(0,P.jsx)(`button`,{type:`button`,className:`act-btn logs`,onClick:()=>a(n?void 0:t.workbench),children:n?`HIDE LOG`:`VIEW LOG`}),(0,P.jsx)(Fn,{to:`/runs/${encodeURIComponent(e)}/${encodeURIComponent(t.workbench)}`,className:`act-btn`,children:`PERMALINK`})]})]},t.workbench)})})]})})]}),i!==void 0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(rv,{content:s.data,loading:s.isLoading,err:s.isError?s.error.message:void 0}),(0,P.jsx)(lv,{content:o.data,loading:o.isLoading,err:o.isError?o.error.message:void 0})]})]})}function pv({id:e,title:t,onBack:n}){let r=ps(),i=sa(e);return(0,x.useEffect)(()=>{let e=ls(r);if(e===void 0)return;let t=window.setInterval(()=>void i.refetch(),e);return()=>window.clearInterval(t)},[r,e]),(0,P.jsxs)(`main`,{className:`logs-page`,children:[(0,P.jsxs)(`div`,{className:`page-hd`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,P.jsxs)(`div`,{className:`page-title`,children:[`LOGS / `,t]}),(0,P.jsx)(hs,{updatedAtMs:i.dataUpdatedAt}),(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void i.refetch(),children:`↻`})]}),(0,P.jsx)(lv,{content:i.data,loading:i.isLoading,err:i.isError?i.error.message:void 0})]})}function mv(e){return e?.trim()??``}function hv(e){return e?.trim()??``}function gv(e,t){return e===``?t:`${e}/${t}`}function _v({routine:e,saving:t,onCancel:n,onConfirm:r}){let[i,a]=(0,x.useState)(mv(e.folder)),[o,s]=(0,x.useState)(hv(e.slug)),c=i.trim(),l=o.trim(),u=(0,x.useMemo)(()=>gv(c,l),[c,l]),d=(0,x.useMemo)(()=>gv(mv(e.folder),hv(e.slug)),[e.folder,e.slug]),f=c===mv(e.folder)&&l===hv(e.slug),p=l===``||l.includes(`/`)||l.includes(`\\`);return(0,P.jsx)(`div`,{className:`overlay`,onClick:n,children:(0,P.jsxs)(`div`,{className:`dialog move-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`move-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:`move-dialog-hd`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{id:`move-dialog-title`,className:`dialog-title move-dialog-title`,children:`FOLDER MANAGEMENT`}),(0,P.jsx)(`div`,{className:`move-dialog-sub`,children:`Move routine files without changing the display title.`})]}),(0,P.jsx)(`div`,{className:`move-dialog-badge`,children:`FILES`})]}),(0,P.jsxs)(`div`,{className:`move-current-card`,"aria-label":`Current path ${d}`,children:[(0,P.jsx)(`div`,{className:`move-current-label`,children:`CURRENT LOCATION`}),(0,P.jsxs)(`div`,{className:`move-current-row`,children:[(0,P.jsx)(`span`,{className:`routine-fs-icon`,"aria-hidden":`true`,children:`📄`}),(0,P.jsxs)(`div`,{className:`move-current-copy`,children:[(0,P.jsx)(`strong`,{children:e.title}),(0,P.jsx)(`span`,{children:d||`root`})]})]})]}),(0,P.jsxs)(`div`,{className:`move-path-grid`,children:[(0,P.jsxs)(`div`,{className:`form-group move-form-group`,children:[(0,P.jsx)(`label`,{className:`form-label`,htmlFor:`move-folder`,children:`FOLDER`}),(0,P.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,P.jsx)(`div`,{className:`form-hint`,children:`Blank keeps the routine at root. Use / for nested folders.`})]}),(0,P.jsxs)(`div`,{className:`form-group move-form-group`,children:[(0,P.jsx)(`label`,{className:`form-label`,htmlFor:`move-slug`,children:`SLUG*`}),(0,P.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,P.jsx)(`div`,{className:`form-hint`,children:`One path segment only. Title remains display-only.`})]})]}),(0,P.jsxs)(`div`,{className:`move-preview`,"aria-label":`Destination path routines/${u||`…`}/routine.toml`,children:[(0,P.jsx)(`div`,{className:`move-preview-label`,children:`DESTINATION PREVIEW`}),(0,P.jsxs)(`div`,{className:`move-preview-path`,children:[`routines/`,u||`…`,`/routine.toml`]})]}),(0,P.jsxs)(`div`,{className:`dialog-actions move-dialog-actions`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:n,children:`CANCEL`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:t||p||f,onClick:()=>r(c===``?void 0:c,l),children:t?`MOVING…`:`MOVE`})]})]})})}var vv=c(m(),1),yv=6,bv=2,xv=14,Sv={running:`var(--warn)`,success:`var(--ok)`,failed:`var(--err)`,unknown:`var(--text-faint)`};function Cv({runs:e}){if(e.length===0)return(0,P.jsx)(`span`,{className:`spark-empty muted`,children:`—`});let t=e.length*yv-bv;return(0,P.jsx)(`svg`,{className:`spark`,role:`img`,"aria-label":`Last ${e.length} runs`,width:t,height:xv,viewBox:`0 0 ${t} ${xv}`,children:e.map((e,t)=>(0,P.jsx)(`rect`,{x:t*yv,y:0,width:4,height:xv,rx:1,fill:Sv[e.status],className:`spark-tick ${e.status}`,children:(0,P.jsx)(`title`,{children:`${Ps(e.status)} · ${Ua(e.started_at)} (${Ga(e.started_at)})`})},`${e.workbench}-${t}`))})}function wv({routine:e,now:t}){if(!e.enabled)return(0,P.jsx)(`span`,{className:`cell-next muted`,children:`paused`});if(Cc(e,t)){let n=wc(e,t);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`cell-next muted`,children:`snoozed`}),n!==``&&(0,P.jsx)(`div`,{className:`cell-next-until muted`,children:n})]})}let n=wo(Co(e),t);if(n===void 0)return(0,P.jsx)(`span`,{className:`cell-next muted`,children:`—`});let r=n.getTime()-t.getTime()<=rc;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`cell-next-when`,children:ko(t,n)}),(0,P.jsx)(`div`,{className:r?`cell-next-until soon`:`cell-next-until`,children:Do(t,n)})]})}function Tv({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,x.useState)(!1),[g,_]=(0,x.useState)(!1),[v,y]=(0,x.useState)({}),b=(0,x.useRef)(null),S=(0,x.useRef)(null),C=Co(e),w=(e.schedule_descriptions??[e.schedule_description]).filter(Boolean).join(` · `)||`—`,T=Ua(e.updated_at),ee=e.repositories??[],E=(e.machines??[]).filter(e=>e.trim()!==``),D=e.tags??[],O=e.goal?.trim()?e.goal.split(`
`)[0]:void 0,te=_c(e),ne=e.last_manual_trigger_at!=null&&(e.last_scheduled_trigger_at==null||e.last_manual_trigger_at>=e.last_scheduled_trigger_at),re=Tc(e,t),ie=Ec(e);(0,x.useEffect)(()=>{if(!g)return;let e=e=>{let t=e.target;b.current?.contains(t)||S.current?.contains(t)||_(!1)},t=e=>{e.key===`Escape`&&_(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[g]);let k=()=>_(!1),ae=()=>{if(g){_(!1);return}let e=b.current?.getBoundingClientRect();if(e!==void 0){let t=e.bottom+6+260<=window.innerHeight;y({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)})}_(!0)},oe=g?(0,vv.createPortal)((0,P.jsxs)(`div`,{className:`actions-menu`,id:`routine-actions-${e.id}`,ref:S,role:`menu`,style:v,children:[(0,P.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{k(),d(e.id)},children:`Logs`}),(0,P.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{k(),f(e.id)},children:`History`}),(0,P.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{k(),p(e.id)},children:[`Flags`,(e.flag_count??0)>0&&(0,P.jsx)(`span`,{className:`flag-badge`,children:e.flag_count})]}),(0,P.jsx)(`div`,{className:`actions-menu-sep`,role:`separator`}),(0,P.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{k(),a(e.id)},children:`Edit`}),(0,P.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{k(),c(e.id)},children:`Move folder`}),(0,P.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{k(),o(e.id)},children:`Clone`}),(0,P.jsx)(`div`,{className:`actions-menu-sep`,role:`separator`}),(0,P.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item danger`,onClick:()=>{k(),s(e.id,e.title)},children:`Delete`})]}),document.body):null;return(0,P.jsxs)(`tr`,{className:r?`row-selected`:``,children:[(0,P.jsx)(`td`,{className:`col-select`,"data-label":`Select`,children:(0,P.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>i(e.id),"aria-label":`Select ${e.title}`})}),(0,P.jsxs)(`td`,{className:`routine-title-cell`,"data-label":`Title`,children:[(0,P.jsx)(`div`,{className:`cell-schedule`,title:e.title,children:(0,P.jsx)(Ev,{title:e.title})}),(0,P.jsx)(`div`,{className:`cell-goal`,title:e.rel_path,children:e.folder?`/${e.folder}/${e.slug}`:`/${e.slug}`}),O!==void 0&&(0,P.jsx)(`div`,{className:`cell-goal`,title:e.goal??``,children:O})]}),(0,P.jsxs)(`td`,{className:`routine-schedule-cell`,"data-label":`Schedule`,children:[(0,P.jsx)(`div`,{className:`cell-schedule`,children:C.join(`
`)}),(0,P.jsx)(`div`,{className:`cell-schedule-human`,children:w}),(0,P.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,P.jsx)(Dv,{schedules:C,now:t})]}),(0,P.jsx)(`td`,{"data-label":`Next run`,children:(0,P.jsx)(wv,{routine:e,now:t})}),(0,P.jsx)(`td`,{"data-label":`Last fire`,children:te===void 0?(0,P.jsx)(`span`,{className:`muted`,children:`—`}):(0,P.jsxs)(`div`,{className:`cell-triggered`,children:[ne?`↻`:`⏱`,` `,Ua(te)]})}),(0,P.jsx)(`td`,{"data-label":`Run history`,children:(0,P.jsx)(Cv,{runs:n})}),(0,P.jsxs)(`td`,{"data-label":`Agent`,children:[(0,P.jsxs)(`span`,{className:`cell-handler`,title:e.agent_registered?`agent registered`:`agent config missing`,children:[(0,P.jsx)(`span`,{className:e.agent_registered?`handler-dot ok`:`handler-dot warn`}),e.agent]}),e.model&&(0,P.jsx)(`div`,{className:`cell-goal`,children:e.model})]}),(0,P.jsx)(`td`,{"data-label":`Repos`,children:ee.length===0?`—`:(0,P.jsx)(`span`,{title:ee.map(e=>e.repository).join(`
`),children:ee.length})}),(0,P.jsx)(`td`,{"data-label":`Machines`,className:E.length===0?`cell-meta cell-no-machines`:`cell-meta`,children:E.length===0?`—`:(0,P.jsx)(`span`,{title:E.join(`
`),children:E.length})}),(0,P.jsx)(`td`,{"data-label":`Tags`,children:D.length===0?`—`:(0,P.jsx)(`span`,{title:D.join(`, `),children:D.join(`, `)})}),(0,P.jsx)(`td`,{"data-label":`TTL`,children:(0,P.jsx)(`span`,{className:`cell-meta`,title:`workbench retention for finished runs`,children:X_(e.ttl_secs)})}),(0,P.jsxs)(`td`,{"data-label":`Health`,children:[(0,P.jsx)(`span`,{className:xc(re),title:Sc(e,re),children:bc(re)}),e.power_saving_exempt&&(0,P.jsx)(`div`,{className:`failure-chip low`,title:`Runs even when system power saving is active`,children:`EXEMPT`}),ie!==`none`&&(0,P.jsxs)(`div`,{className:`failure-chip ${ie}`,title:`${e.consecutive_failures} consecutive failure(s) — auto-disables at ${e.failure_threshold}`,children:[e.consecutive_failures,`/`,e.failure_threshold]})]}),(0,P.jsx)(`td`,{"data-label":`Enabled`,children:(0,P.jsxs)(`label`,{className:`toggle`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>l(e.id,t.target.checked)}),(0,P.jsx)(`div`,{className:`toggle-track`})]})}),(0,P.jsx)(`td`,{"data-label":`Updated`,children:(0,P.jsx)(`div`,{className:`cell-time`,title:Ga(e.updated_at),children:T})}),(0,P.jsx)(`td`,{className:`routine-actions-cell`,"data-label":`Actions`,children:(0,P.jsxs)(`div`,{className:`row-actions`,children:[(0,P.jsx)(`button`,{type:`button`,className:`act-btn run`,title:Dc(e),"aria-label":`Run now`,disabled:!e.enabled||e.power_saving,onClick:()=>u(e.id),children:`RUN`}),(0,P.jsxs)(`div`,{className:`actions-menu-root`,ref:b,children:[(0,P.jsx)(`button`,{type:`button`,className:`act-btn actions-menu-trigger`,"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":`routine-actions-${e.id}`,onClick:ae,children:`ACTIONS ▾`}),oe]})]})})]})}function Ev({title:e}){let t=e.split(`/`).filter(Boolean);return t.length<=1?(0,P.jsx)(P.Fragment,{children:e}):(0,P.jsx)(`span`,{className:`cell-title-path`,children:t.map((e,n)=>(0,P.jsxs)(`span`,{children:[n>0&&(0,P.jsx)(`span`,{className:`cell-title-sep`,children:`/`}),(0,P.jsx)(`span`,{className:n===t.length-1?`cell-title-leaf`:`cell-title-folder`,children:e})]},`${e}-${n}`))})}function Dv({schedules:e,now:t}){let n=To(e,t,10);return n.length===0?(0,P.jsx)(`div`,{className:`fires-panel`,children:(0,P.jsx)(`div`,{className:`fires-empty`,children:`— no future fires —`})}):(0,P.jsxs)(`div`,{className:`fires-panel`,children:[(0,P.jsx)(`div`,{className:`fires-hd`,children:`NEXT 10 FIRES`}),n.map((e,n)=>(0,P.jsxs)(`div`,{className:`fires-item`,children:[(0,P.jsx)(`span`,{className:`fires-when`,children:ko(t,e)}),(0,P.jsx)(`span`,{className:`fires-until`,children:Do(t,e)})]},n))]})}function Ov(e){let t=e.slug?.trim()||e.title.trim()||e.id,n=e.folder?.trim();return n?`${n}/${t}`:t}function kv(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 Av(t),t}function Av(e){e.routines.sort((e,t)=>Ov(e).localeCompare(Ov(t))||e.id.localeCompare(t.id));for(let t of e.folders.values())Av(t)}function jv(e){return[...e.folders.values()].sort((e,t)=>e.name.localeCompare(t.name))}function Mv(e){return{"--depth":e}}function Nv({routines:e,loading:t,filterActive:n,now:r,onClearFilters:i,...a}){let o=(0,x.useMemo)(()=>kv(e),[e]),[s,c]=(0,x.useState)(new Set),l=e=>{c(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})};return t?(0,P.jsx)(`div`,{className:`routine-fs-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,P.jsx)(`div`,{className:`routine-fs-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:n?`⊘`:`⧗`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:n?`NO ROUTINES MATCH`:`NO ROUTINES SCHEDULED`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:n?(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR FILTERS`}):`press + NEW ROUTINE to create one`})]})}):(0,P.jsxs)(`div`,{className:`routine-fs-wrap`,children:[(0,P.jsxs)(`div`,{className:`routine-fs-summary`,children:[e.length,` routine(s) shown by filesystem location`]}),(0,P.jsxs)(`div`,{className:`routine-fs-tree`,role:`tree`,"aria-label":`Routine filesystem`,children:[o.routines.map(e=>(0,P.jsx)(Iv,{routine:e,now:r,depth:0,...a},e.id)),jv(o).map(e=>(0,P.jsx)(Pv,{node:e,now:r,depth:0,collapsed:s,onToggle:l,actions:a},e.path))]})]})}function Pv({node:e,now:t,depth:n,collapsed:r,onToggle:i,actions:a}){let o=r.has(e.path),s=Fv(e);return(0,P.jsxs)(`div`,{className:`routine-fs-branch`,children:[(0,P.jsx)(`div`,{className:`routine-fs-folder`,role:`treeitem`,"aria-expanded":!o,"aria-label":`${e.name} folder, ${s} routine${s===1?``:`s`}`,style:Mv(n),children:(0,P.jsxs)(`button`,{type:`button`,className:`routine-fs-folder-toggle`,"aria-label":`${o?`Expand`:`Collapse`} ${e.name} folder`,onClick:()=>i(e.path),children:[(0,P.jsx)(`span`,{className:`routine-fs-caret`,children:o?`▸`:`▾`}),(0,P.jsx)(`span`,{className:`routine-fs-icon`,children:`📁`}),(0,P.jsx)(`span`,{className:`routine-fs-folder-name`,children:e.name}),(0,P.jsx)(`span`,{className:`routine-fs-count`,children:s})]})}),!o&&(0,P.jsxs)(`div`,{role:`group`,children:[e.routines.map(e=>(0,P.jsx)(Iv,{routine:e,now:t,depth:n+1,...a},e.id)),jv(e).map(e=>(0,P.jsx)(Pv,{node:e,now:t,depth:n+1,collapsed:r,onToggle:i,actions:a},e.path))]})]})}function Fv(e){let t=e.routines.length;for(let n of e.folders.values())t+=Fv(n);return t}function Iv({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=Ov(e),p=Tc(e,t),m=Co(e);return(0,P.jsxs)(`div`,{className:`routine-fs-file`,role:`treeitem`,"aria-label":`${f} routine`,style:Mv(n),children:[(0,P.jsxs)(`div`,{className:`routine-fs-file-main`,children:[(0,P.jsx)(`span`,{className:`routine-fs-icon`,children:`📄`}),(0,P.jsxs)(`div`,{className:`routine-fs-file-copy`,children:[(0,P.jsx)(`div`,{className:`routine-fs-file-title`,children:e.title}),(0,P.jsx)(`div`,{className:`routine-fs-file-path`,title:e.rel_path,children:f})]})]}),(0,P.jsxs)(`div`,{className:`routine-fs-meta`,children:[(0,P.jsx)(`span`,{children:m.join(` · `)}),(0,P.jsx)(wv,{routine:e,now:t})]}),(0,P.jsxs)(`div`,{className:`routine-fs-status`,children:[(0,P.jsx)(`span`,{className:xc(p),title:Sc(e,p),children:bc(p)}),(0,P.jsxs)(`label`,{className:`toggle`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>s(e.id,t.target.checked)}),(0,P.jsx)(`div`,{className:`toggle-track`})]})]}),(0,P.jsxs)(`div`,{className:`routine-fs-actions`,children:[(0,P.jsx)(`button`,{type:`button`,className:`act-btn run`,"aria-label":`Run now`,title:Dc(e),disabled:!e.enabled||e.power_saving,onClick:()=>c(e.id),children:`RUN`}),(0,P.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>l(e.id),children:`Logs`}),(0,P.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>u(e.id),children:`History`}),(0,P.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>d(e.id),children:`Flags`}),(0,P.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>r(e.id),children:`Edit`}),(0,P.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>o(e.id),children:`Move folder`}),(0,P.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>i(e.id),children:`Clone`}),(0,P.jsx)(`button`,{type:`button`,className:`act-btn danger`,onClick:()=>a(e.id,e.title),children:`Delete`})]})]})}var Lv=`moadim.routines.collapsedGroups`;function Rv(){try{let e=localStorage.getItem(Lv);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(Lv,JSON.stringify([...e]))}catch{}}function Bv({label:e,col:t,current:n,dir:r,onSort:i}){let a=n===t;return(0,P.jsxs)(`th`,{className:a?`th-sort th-sort-active`:`th-sort`,onClick:()=>i(t),children:[e,a?r===`asc`?` ▲`:` ▼`:``]})}function Vv(e){let{routines:t,loading:n,filterActive:r,onClearFilters:i}=e,[a,o]=(0,x.useState)(Rv),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,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})});if(t.length===0)return(0,P.jsx)(`div`,{className:`table-wrap`,children:r?(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⊘`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO ROUTINES MATCH`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR FILTERS`})})]}):(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO ROUTINES SCHEDULED`}),(0,P.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=Gc(t,e.groupBy),d=t=>`${e.groupBy}:${t}`;return(0,P.jsxs)(`div`,{className:`table-wrap`,children:[e.groupBy!==`none`&&u.length>1&&(0,P.jsxs)(`div`,{className:`group-controls`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>c(u.map(([e])=>d(e))),children:`COLLAPSE ALL`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>c([]),children:`EXPAND ALL`})]}),(0,P.jsxs)(`table`,{className:`routine-table`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{className:`col-select`,children:(0,P.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e.onSelectAll,"aria-label":`Select all visible routines`,title:`Select all visible`})}),(0,P.jsx)(Bv,{label:`TITLE`,col:`title`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,P.jsx)(`th`,{children:`SCHEDULE`}),(0,P.jsx)(Bv,{label:`NEXT RUN`,col:`next_run`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,P.jsx)(Bv,{label:`LAST FIRE`,col:`last_fire`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,P.jsx)(`th`,{children:`RUN HISTORY`}),(0,P.jsx)(Bv,{label:`AGENT`,col:`agent`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,P.jsx)(`th`,{children:`REPOS`}),(0,P.jsx)(`th`,{children:`MACHINES`}),(0,P.jsx)(`th`,{children:`TAGS`}),(0,P.jsx)(`th`,{children:`TTL`}),(0,P.jsx)(Bv,{label:`HEALTH`,col:`health`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,P.jsx)(Bv,{label:`ENABLED`,col:`enabled`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,P.jsx)(Bv,{label:`UPDATED`,col:`updated`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,P.jsx)(`th`,{})]})}),(0,P.jsx)(`tbody`,{children:u.map(([t,n])=>{let r=d(t),i=e.groupBy!==`none`&&a.has(r),o=Wc(n,e.now);return(0,P.jsxs)(x.Fragment,{children:[e.groupBy!==`none`&&(0,P.jsx)(`tr`,{className:`group-hd`,children:(0,P.jsx)(`td`,{colSpan:15,"data-label":`Group`,children:(0,P.jsxs)(`div`,{className:`group-hd-row`,children:[(0,P.jsxs)(`button`,{type:`button`,className:`group-hd-toggle`,onClick:()=>s(r),"aria-expanded":!i,children:[(0,P.jsx)(`span`,{className:`group-caret`,children:i?`▶`:`▼`}),(0,P.jsx)(`span`,{className:`group-label`,children:t}),(0,P.jsxs)(`span`,{className:`group-count`,children:[`(`,n.length,`)`]})]}),(0,P.jsx)(`span`,{className:`group-health-chips`,children:vc.filter(e=>(o.get(e)??0)>0).map(e=>(0,P.jsx)(`span`,{className:`${xc(e)} chip`,children:o.get(e)},e))})]})})},`hd-${t}`),!i&&n.map(t=>(0,P.jsx)(Tv,{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 Hv=`moadim.routines.saved_views`,Uv=`moadim.routines.last_view`;function Wv(e,t,n,r){return{query:e.query,status:e.status,agent:sc(e.agent),machine:dc(e.machine),repository:sc(e.repository),tag:sc(e.tag),sortCol:t,sortDir:n,groupBy:r}}function Gv(e){return{filter:{query:e.query,status:ac(e.status),agent:cc(e.agent),machine:fc(e.machine),repository:cc(e.repository),tag:cc(e.tag)},sortCol:e.sortCol===void 0?void 0:Ic(e.sortCol),sortDir:Rc(e.sortDir),groupBy:Bc(e.groupBy)}}function Kv(e){try{let t=window.localStorage.getItem(e);return t===null?void 0:JSON.parse(t)}catch{return}}function qv(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Jv(){return Kv(Hv)??[]}function Yv(e){qv(Hv,e)}function Xv(){return Kv(Uv)}function Zv(e){qv(Uv,e)}function Qv({views:e,onApply:t,onSave:n,onDelete:r}){let{addToast:i}=$a(),[a,o]=(0,x.useState)(!1),[s,c]=(0,x.useState)(``),[l,u]=(0,x.useState)(``),d=n=>{let r=e.find(e=>e.name===n);r&&t(r.snapshot),u(n)};return(0,P.jsx)(`div`,{className:`filter-bar saved-views-bar`,children:(0,P.jsxs)(`div`,{className:`filter-field`,children:[(0,P.jsx)(`span`,{className:`filter-label`,children:`VIEWS`}),(0,P.jsxs)(`select`,{className:`filter-select`,"aria-label":`Saved views`,value:l,onChange:e=>d(e.target.value),children:[(0,P.jsx)(`option`,{value:``,children:`— select —`}),e.map(e=>(0,P.jsx)(`option`,{value:e.name,children:e.name},e.name))]}),a?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`input`,{type:`text`,className:`filter-input`,placeholder:`View name…`,"aria-label":`New view name`,value:s,onChange:e=>c(e.target.value)}),(0,P.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,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>o(!1),children:`CANCEL`})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.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,P.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,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Delete this saved view`,onClick:()=>{l!==``&&(r(l),u(``))},children:`DELETE`})]})]})})}function $v(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 ey=Wv(pc(),void 0,`asc`,`none`),ty={query:`q`,status:`status`,agent:`agent`,machine:`machine`,repository:`repo`,tag:`tag`,sortCol:`sort`,sortDir:`dir`,groupBy:`group`},ny=Object.values(ty);function ry(e){let t=new URLSearchParams;for(let n of Object.keys(ty)){let r=e[n];if(r!==void 0&&r!==ey[n]){if(Array.isArray(r))for(let e of r)t.append(ty[n],e);else t.set(ty[n],r)}}return t}function iy(e,t){let n=new URLSearchParams(e);for(let e of ny)n.delete(e);for(let[e,r]of ry(t))n.append(e,r);return n}function ay(e){if(ny.some(t=>e.has(t)))return{query:e.get(ty.query)??ey.query,status:e.get(ty.status)??ey.status,agent:e.get(ty.agent)??ey.agent,machine:e.getAll(ty.machine).length>1?e.getAll(ty.machine):e.get(ty.machine)??ey.machine,repository:e.get(ty.repository)??ey.repository,tag:e.get(ty.tag)??ey.tag,sortCol:e.get(ty.sortCol)??void 0,sortDir:e.get(ty.sortDir)??ey.sortDir,groupBy:e.get(ty.groupBy)??ey.groupBy}}function oy({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&&!Cc(e,t)&&Eo(e.schedule,t,36e5)).length,l=e.filter(e=>e.enabled&&Cc(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,P.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,P.jsxs)(`button`,{type:`button`,className:`stat-card ${a}${o?` active`:``}`.trim(),"aria-pressed":o,onClick:()=>r(o?`all`:e),children:[(0,P.jsx)(`div`,{className:`stat-label`,children:t}),(0,P.jsx)(`div`,{className:`stat-val`,children:i})]},e)})})}var sy=[[`table`,`LIST`],[`files`,`FILES`],[`calendar`,`CALENDAR`],[`day`,`DAY`]];function cy({view:e,onSetView:t}){return(0,P.jsx)(`div`,{className:`view-toggle`,children:sy.map(([n,r])=>(0,P.jsx)(`button`,{type:`button`,className:e===n?`view-btn active`:`view-btn`,onClick:()=>t(n),children:r},n))})}var ly=3e4;function uy(){let{addToast:e}=$a(),[t,n]=Vn(),r=(0,x.useMemo)(()=>ay(t)??Xv(),[]),i=r?Gv(r):void 0,[a,o]=(0,x.useState)(()=>{let e=t.get(`history`);return e?{kind:`history`,id:e}:{kind:`list`}}),[s,c]=(0,x.useState)({kind:`none`}),[l,u]=(0,x.useState)(`table`),[d,f]=(0,x.useState)(i?.filter??pc()),[p,m]=(0,x.useState)(i?.sortCol),[h,g]=(0,x.useState)(i?.sortDir??`asc`),[_,v]=(0,x.useState)(i?.groupBy??`none`),[y,b]=(0,x.useState)(new Set),[S,C]=(0,x.useState)(Jv),w=ps(),[T,ee]=(0,x.useState)(()=>new Date),E=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(t.get(`history`)){let e=new URLSearchParams(t);e.delete(`history`),n(e,{replace:!0})}},[]),(0,x.useEffect)(()=>{let e=setInterval(()=>ee(new Date),ly);return()=>clearInterval(e)},[]),(0,x.useEffect)(()=>{let e=Wv(d,p,h,_);Zv(e),n(t=>iy(t,e),{replace:!0})},[d,p,h,_]),(0,x.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(),E.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s.kind]);let D=ls(w),O=qi({},{refetchInterval:D}),te=R(300),ne=ia(),re=zi(),ie=Bi();(0,x.useEffect)(()=>{if(D===void 0)return;let e=setInterval(()=>void te.refetch(),D);return()=>clearInterval(e)},[D]);let k=(0,x.useMemo)(()=>O.data??[],[O.data]),ae=(0,x.useMemo)(()=>$v(te.data??[]),[te.data]),oe=(0,x.useRef)(!1);(0,x.useEffect)(()=>{let e=re.data?.name;e&&!oe.current&&(oe.current=!0,f(t=>t.machine.kind===`any`?{...t,machine:{kind:`machine`,value:e}}:t))},[re.data]);let[se,ce]=(0,x.useState)(k);if(k!==se){ce(k);let e=new Set(k.map(e=>e.id));b(t=>{let n=new Set([...t].filter(t=>e.has(t)));return n.size===t.size?t:n})}let le=Xi(),ue=Zi(),de=Qi(),fe=$i(),pe=ea(),me=ra(),he=aa(),ge=()=>o({kind:`list`}),_e=()=>c({kind:`none`}),ve=()=>{he.mutate(`all`,{onSuccess:()=>e(`Routines unlocked`,`ok`),onError:t=>e(`Unlock failed: ${t.message}`,`err`)})},ye=t=>{le.mutate({...t},{onSuccess:()=>{ge(),e(`Routine created`,`ok`)},onError:t=>e(`Create failed: ${t.message}`,`err`)})},be=(t,n)=>{ue.mutate({id:t,body:Z_(n)},{onSuccess:()=>{_e(),e(`Routine updated`,`ok`)},onError:t=>e(`Update failed: ${t.message}`,`err`)})},A=(t,n,r)=>{de.mutate({id:t,body:{folder:n,slug:r}},{onSuccess:()=>{_e(),e(`Routine moved`,`ok`)},onError:t=>e(`Move failed: ${t.message}`,`err`)})},j=t=>{fe.mutate(t,{onSuccess:()=>{_e(),e(`Routine deleted`,`ok`)},onError:t=>e(`Delete failed: ${t.message}`,`err`)})},xe=(t,n)=>{ue.mutate({id:t,body:{enabled:n}},{onSuccess:()=>e(n?`Routine enabled`:`Routine disabled`,`ok`),onError:t=>e(`Toggle failed: ${t.message}`,`err`)})},Se=t=>{pe.mutate(t,{onSuccess:()=>e(`Routine triggered`,`ok`),onError:t=>e(`Trigger failed: ${t.message}`,`err`)})},Ce=()=>{me.mutate(void 0,{onSuccess:t=>{let n=t.removed;e(`Cleanup removed ${n} workbench${n===1?``:`es`} (freed ${Ks(t.freed_bytes)})`,`ok`)},onError:t=>e(`Cleanup failed: ${t.message}`,`err`)})},we=async t=>{let n=[...y];if(n.length===0)return;let r=0,i=0;for(let e of n)try{await ue.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`)},Te=async()=>{let t=[...y],n=0,r=0,i=[];for(let e of t)try{await fe.mutateAsync(e),n++,i.push(e)}catch{r++}b(e=>{let t=new Set(e);for(let e of i)t.delete(e);return t}),_e(),r===0?e(`${n} routine(s) deleted`,`ok`):e(`${n} deleted, ${r} failed`,`err`)},Ee=e=>{let t=Gv(e);f(t.filter),m(t.sortCol),g(t.sortDir),v(t.groupBy)},De=e=>{let t=Wv(d,p,h,_);C(n=>{let r=[...n.filter(t=>t.name!==e),{name:e,snapshot:t}];return Yv(r),r})},Oe=e=>{C(t=>{let n=t.filter(t=>t.name!==e);return Yv(n),n})},ke=(0,x.useMemo)(()=>Oc(k),[k]),Ae=(0,x.useMemo)(()=>Ac(k),[k]),je=(0,x.useMemo)(()=>jc(k),[k]),Me=(0,x.useMemo)(()=>[...new Set([...kc(k),...ie.data??[]])].sort(),[k,ie.data]),Ne=mc(d),Pe=(0,x.useMemo)(()=>Kc(gc(k,d,T,rc),p,h,T),[k,d,T,p,h]),Fe=()=>{$s(`routines-${new Date().toISOString().slice(0,10)}.csv`,Qs(Pe)),e(`Exported ${Pe.length} routine(s) to CSV`,`ok`)},Ie=Ji(s.kind===`edit`?s.id:``,s.kind===`edit`),Le=s.kind===`edit`?Ie.data:void 0,Re=e=>b(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),ze=()=>{let e=Pe.map(e=>e.id),t=e.length>0&&e.every(e=>y.has(e));b(t?new Set:new Set(e))},Be=e=>{p===e?g(e=>Lc(e)):(m(e),g(`asc`))},Ve=e=>k.find(t=>t.id===e)?.title??``;if(a.kind===`new`)return(0,P.jsx)(nv,{mode:`create`,saving:le.isPending,onCancel:ge,onSave:ye});if(a.kind===`clone`){let e={schedule:a.source.schedule,schedules:Co(a.source),title:U_(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,P.jsx)(nv,{mode:`clone`,initial:e,saving:le.isPending,onCancel:ge,onSave:ye})}if(a.kind===`logs`)return(0,P.jsx)(pv,{id:a.id,title:Ve(a.id),onBack:ge});if(a.kind===`history`)return(0,P.jsx)(fv,{id:a.id,title:Ve(a.id),onBack:ge});if(a.kind===`flags`)return(0,P.jsx)($c,{id:a.id,title:Ve(a.id),onBack:ge});let He=Pe.filter(e=>e.enabled).map(e=>({id:e.id,label:e.title,schedule:e.schedule,schedules:Co(e),snoozed:Cc(e,T),flagCount:e.flag_count??0}));return(0,P.jsxs)(`div`,{className:`page`,children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Routines`}),(0,P.jsx)(rs,{status:ne.data,onUnlock:ve}),(0,P.jsx)(oy,{routines:k,now:T,active:d.status,onStatus:e=>f(t=>({...t,status:e}))}),(0,P.jsxs)(`div`,{className:`section-hd`,children:[(0,P.jsx)(`div`,{className:`section-label`,children:`SCHEDULED ROUTINES`}),(0,P.jsxs)(`div`,{className:`section-acts`,children:[(0,P.jsx)(hs,{updatedAtMs:O.dataUpdatedAt}),l===`table`&&(0,P.jsx)(Jc,{groupBy:_,onChange:v}),(0,P.jsx)(cy,{view:l,onSetView:u}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Reap finished, expired run workbenches now`,onClick:Ce,children:`CLEANUP NOW`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Export the currently filtered/sorted routines to a CSV file`,disabled:Pe.length===0,onClick:Fe,children:`EXPORT CSV`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>o({kind:`new`}),children:`+ NEW ROUTINE`})]})]}),(0,P.jsx)(Pc,{filter:d,agents:ke,machines:Me,repositories:Ae,tags:je,shown:Pe.length,total:k.length,searchRef:E,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(pc())}),(0,P.jsx)(Qv,{views:S,onApply:Ee,onSave:De,onDelete:Oe}),(0,P.jsx)(Hs,{count:y.size,onEnable:()=>void we(!0),onDisable:()=>void we(!1),onDelete:()=>c({kind:`confirmBulkDelete`}),onClear:()=>b(new Set)}),l===`table`&&(0,P.jsx)(Vv,{routines:Pe,loading:O.isLoading,filterActive:Ne,now:T,selected:y,onSelect:Re,onSelectAll:ze,sortCol:p,sortDir:h,groupBy:_,runHistory:ae,onSort:Be,onEdit:e=>c({kind:`edit`,id:e}),onClone:e=>{let t=k.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:xe,onTrigger:Se,onLogs:e=>o({kind:`logs`,id:e}),onHistory:e=>o({kind:`history`,id:e}),onFlags:e=>o({kind:`flags`,id:e}),onClearFilters:()=>f(pc())}),l===`files`&&(0,P.jsx)(Nv,{routines:Pe,loading:O.isLoading,filterActive:Ne,now:T,onEdit:e=>c({kind:`edit`,id:e}),onClone:e=>{let t=k.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:xe,onTrigger:Se,onLogs:e=>o({kind:`logs`,id:e}),onHistory:e=>o({kind:`history`,id:e}),onFlags:e=>o({kind:`flags`,id:e}),onClearFilters:()=>f(pc())}),l===`calendar`&&(0,P.jsx)(Qc,{routines:Pe,loading:O.isLoading,onEdit:e=>c({kind:`edit`,id:e}),onTrigger:Se}),l===`day`&&(0,P.jsx)(nc,{items:He,loading:O.isLoading,onClick:e=>c({kind:`edit`,id:e})}),s.kind===`edit`&&Ie.isLoading&&(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})}),s.kind===`edit`&&Le&&(0,P.jsx)(nv,{mode:`edit`,initial:Le&&{schedule:Le.schedule,schedules:Co(Le),title:Le.title,agent:Le.agent,model:Le.model??null,prompt:Le.prompt??``,goal:Le.goal??null,repositories:Le.repositories??[],machines:Le.machines??[],enabled:Le.enabled,power_saving_exempt:Le.power_saving_exempt??!1,ttl_secs:Le.ttl_secs??null,tags:Le.tags??[]},saving:ue.isPending,onCancel:_e,onSave:e=>be(s.id,e)}),s.kind===`move`&&(()=>{let e=k.find(e=>e.id===s.id);return e?(0,P.jsx)(_v,{routine:e,saving:de.isPending,onCancel:_e,onConfirm:(e,t)=>A(s.id,e,t)}):null})(),s.kind===`confirmDelete`&&(0,P.jsx)(Ws,{title:s.title,onCancel:_e,onConfirm:()=>j(s.id)}),s.kind===`confirmBulkDelete`&&(0,P.jsx)(Us,{count:y.size,onCancel:_e,onConfirm:()=>void Te()})]})}var dy={query:``,status:`all`,time:`all`},fy={"1h":3600,"24h":86400,"7d":604800};function py(e,t,n){let r=t.query.trim().toLowerCase(),i=t.time===`all`?void 0:n-fy[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 my(e){let t={running:0,success:0,failed:0,unknown:0};for(let n of e)t[n.status]+=1;return t}var hy=[`failed`,`success`,`running`,`unknown`];function gy(e){let t=hy.filter(t=>e.counts[t]>0).map(t=>`${e.counts[t]} ${t}`);return`${Ga(e.from)} – ${Ga(e.to)}: ${e.total===0?`no runs`:t.join(`, `)}`}function _y({histogram:e,selected:t,onSelect:n}){let{buckets:r,max:i}=e;if(r.length===0)return null;let a=r[0];return(0,P.jsxs)(`div`,{className:`runs-hist`,role:`group`,"aria-label":`Run activity over time`,children:[(0,P.jsx)(`div`,{className:`runs-hist-bars`,children:r.map(e=>{let r=t===e.from,a=gy(e);return(0,P.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,P.jsx)(`span`,{className:`runs-hist-stack`,style:{height:`${i===0?0:e.total/i*100}%`},children:hy.filter(t=>e.counts[t]>0).map(t=>(0,P.jsx)(`span`,{className:`runs-hist-seg ${t}`,style:{flexGrow:e.counts[t]}},t))})},e.from)})}),(0,P.jsxs)(`div`,{className:`runs-hist-axis`,children:[(0,P.jsx)(`span`,{children:Ga(a.from)}),(0,P.jsxs)(`span`,{children:[`peak `,i,`/bar`]}),(0,P.jsx)(`span`,{children:`now`})]})]})}var vy=[60,300,900,1800,3600,10800,21600,43200,86400,604800];function yy(e){return vy.find(t=>t*24>=e)??vy[vy.length-1]}function by(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=yy(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 xy(e,t){return e.filter(e=>e.started_at>=t.from&&e.started_at<t.to)}function Sy(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 Cy(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 wy(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(Sy(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=Cy(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 Ty(e,t,n){return(e-t)/(n-t)*100}function Ey(e,t){let n=t.run.status===`running`?`running`:Fs(t.run.started_at,t.end);return`${e}: started ${Ga(t.run.started_at)}, ${n}, ${t.run.status}`}function Dy({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,P.jsxs)(`details`,{className:`runs-gantt`,open:!0,children:[(0,P.jsxs)(`summary`,{className:`runs-gantt-hd`,children:[(0,P.jsx)(`span`,{className:`filter-label`,children:`TIMELINE`}),(0,P.jsxs)(`span`,{className:c?`runs-gantt-peak c-amber`:`runs-gantt-peak`,children:[`peak concurrency `,o,l,c&&` — runs may have queued`]})]}),(0,P.jsxs)(`div`,{className:`runs-gantt-row`,children:[(0,P.jsx)(`span`,{className:`runs-gantt-name`,children:`concurrent`}),(0,P.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,P.jsx)(`span`,{className:`runs-gantt-level`,title:`${Ga(e.from)} – ${Ga(e.to)}: ${e.count} running`,style:{left:`${Ty(e.from,n,r)}%`,width:`${Ty(e.to,n,r)-Ty(e.from,n,r)}%`,height:`${e.count/o*100}%`}},e.from)),s&&t<=o&&(0,P.jsx)(`span`,{className:`runs-gantt-cap`,style:{bottom:`${t/o*100}%`}})]})]}),(0,P.jsx)(`div`,{className:`runs-gantt-lanes`,children:i.map(e=>(0,P.jsxs)(`div`,{className:`runs-gantt-row`,children:[(0,P.jsx)(`span`,{className:`runs-gantt-name`,title:e.title,children:e.title}),(0,P.jsx)(`div`,{className:`runs-gantt-track`,children:e.bars.map(t=>{let i=Ey(e.title,t);return(0,P.jsx)(Fn,{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:`${Ty(t.start,n,r)}%`,width:`${Ty(t.end,n,r)-Ty(t.start,n,r)}%`}},t.run.workbench)})})]},e.routineId))}),(0,P.jsxs)(`div`,{className:`runs-hist-axis runs-gantt-axis`,children:[(0,P.jsx)(`span`,{children:Ga(n)}),(0,P.jsx)(`span`,{children:`now`})]})]})}function Oy({label:e,col:t,sort:n,defaultDir:r,onSort:i}){let a=n?.key===t?n.dir:null;return(0,P.jsx)(`th`,{className:a===null?`th-sort`:`th-sort th-sort-active`,"aria-sort":a===null?`none`:a===`asc`?`ascending`:`descending`,children:(0,P.jsxs)(`button`,{type:`button`,className:`th-sort-btn`,onClick:()=>i(t,r),children:[e,a===null?``:a===`asc`?` ▲`:` ▼`]})})}function ky(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 Ay(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 jy(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 My(e,t){try{t===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}catch{}}function Ny(e,t){let[n,r]=(0,x.useState)(()=>jy(e,t));return{sort:n,toggle:(t,i)=>{let a=ky(n,t,i);My(e,a),r(a)}}}var Py=100,Fy=100,Iy=1e3,Ly=[`routine`,`started`,`duration`,`status`,`exit`],Ry={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},zy=[[`all`,`All`],[`success`,`Success`],[`failed`,`Failed`],[`running`,`Running`],[`unknown`,`Unknown`]],By=[[`all`,`All time`],[`1h`,`Last hour`],[`24h`,`Last 24h`],[`7d`,`Last 7 days`]];function Vy(){let e=ls(ps()),t=Math.floor(is(3e4)/1e3),[n,r]=(0,x.useState)(Py),[i,a]=(0,x.useState)(dy),o=R(n,{refetchInterval:e}),s=(0,x.useMemo)(()=>o.data??[],[o.data]),[c,l]=(0,x.useState)(null),u=(0,x.useMemo)(()=>py(s,i,t),[s,i,t]),d=i.time===`all`?void 0:t-fy[i.time],f=(0,x.useMemo)(()=>by(u,t,d),[u,t,d]),p=(0,x.useMemo)(()=>c===null?u:xy(u,c),[u,c]),m=(0,x.useMemo)(()=>wy(p,t,c?.from??d),[p,t,c,d]),h=Gi().data?.value,g=(0,x.useMemo)(()=>my(s),[s]),{sort:_,toggle:v}=Ny(`moadim.client.runs.sort`,Ly),y=(0,x.useMemo)(()=>Ay(p,_,Ry),[p,_]),b=s.length>=n&&n<Iy;return(0,P.jsxs)(`div`,{className:`page`,children:[(0,P.jsxs)(`div`,{className:`section-hd`,children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Runs`}),(0,P.jsx)(`div`,{className:`section-acts`,children:(0,P.jsx)(hs,{updatedAtMs:o.dataUpdatedAt})})]}),(0,P.jsxs)(`div`,{className:`stats`,children:[(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FETCHED`}),(0,P.jsx)(`div`,{className:`stat-val`,children:s.length})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`RUNNING`}),(0,P.jsx)(`div`,{className:g.running>0?`stat-val c-accent`:`stat-val`,children:g.running})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`SUCCESS`}),(0,P.jsx)(`div`,{className:`stat-val`,children:g.success})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FAILED`}),(0,P.jsx)(`div`,{className:g.failed>0?`stat-val c-red`:`stat-val`,children:g.failed})]})]}),(0,P.jsxs)(`div`,{className:`filter-bar`,children:[(0,P.jsxs)(`div`,{className:`filter-field`,children:[(0,P.jsx)(`input`,{type:`text`,className:`filter-input`,placeholder:`Search runs by routine…`,"aria-label":`Search runs`,value:i.query,onChange:e=>a({...i,query:e.target.value})}),(0,P.jsx)(`span`,{className:`filter-label`,children:`STATUS`}),(0,P.jsx)(`select`,{className:`filter-select`,"aria-label":`Status filter`,value:i.status,onChange:e=>a({...i,status:e.target.value}),children:zy.map(([e,t])=>(0,P.jsx)(`option`,{value:e,children:t},e))}),(0,P.jsx)(`span`,{className:`filter-label`,children:`WHEN`}),(0,P.jsx)(`select`,{className:`filter-select`,"aria-label":`Time range filter`,value:i.time,onChange:e=>{a({...i,time:e.target.value}),l(null)},children:By.map(([e,t])=>(0,P.jsx)(`option`,{value:e,children:t},e))})]}),(0,P.jsxs)(`div`,{className:`filter-field`,children:[(0,P.jsxs)(`span`,{className:`filter-count`,children:[`Showing `,p.length,` of `,s.length,` fetched`]}),c!==null&&(0,P.jsxs)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>l(null),children:[`Clear time selection (`,Ga(c.from),` – `,Ga(c.to),`) ✕`]})]})]}),o.data!==void 0&&(0,P.jsx)(_y,{histogram:f,selected:c?.from??null,onSelect:e=>l(e===null?null:{from:e.from,to:e.to})}),(0,P.jsx)(Dy,{gantt:m,cap:h}),o.error?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:o.error.message})]})}):o.isLoading?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):p.length===0?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:s.length===0?`no runs yet`:`no runs match the current filters`})]})}):(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(Oy,{label:`ROUTINE`,col:`routine`,sort:_,defaultDir:`asc`,onSort:v}),(0,P.jsx)(Oy,{label:`STARTED`,col:`started`,sort:_,defaultDir:`desc`,onSort:v}),(0,P.jsx)(Oy,{label:`DURATION`,col:`duration`,sort:_,defaultDir:`desc`,onSort:v}),(0,P.jsx)(Oy,{label:`STATUS`,col:`status`,sort:_,defaultDir:`asc`,onSort:v}),(0,P.jsx)(Oy,{label:`EXIT CODE`,col:`exit`,sort:_,defaultDir:`desc`,onSort:v}),(0,P.jsx)(`th`,{})]})}),(0,P.jsx)(`tbody`,{children:y.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(Fn,{to:`/routines?history=${encodeURIComponent(e.routine_id)}`,children:e.routine_title})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`div`,{className:`cell-time`,title:Ga(e.started_at),children:Ua(e.started_at)})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:`cell-meta`,children:e.finished_at==null?`—`:Fs(e.started_at,e.finished_at)})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:Ns(e.status),children:Ps(e.status)})}),(0,P.jsx)(`td`,{children:e.exit_code==null?`—`:e.exit_code}),(0,P.jsx)(`td`,{children:(0,P.jsx)(Fn,{to:`/runs/${encodeURIComponent(e.routine_id)}/${encodeURIComponent(e.workbench)}`,className:`act-btn logs`,children:`VIEW RUN`})})]},e.workbench))})]})}),b&&(0,P.jsx)(`div`,{className:`section-acts`,children:(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>r(e=>Math.min(Iy,e+Fy)),children:`Load more`})})]})}var Hy=4e3;function Uy(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 Wy(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 Gy(e,t){return[...e.map(e=>({kind:`remove`,line:e})),...t.map(e=>({kind:`add`,line:e}))]}function Ky(e,t){let n=iv(e),r=iv(t);return n.length>Hy||r.length>Hy?Gy(n,r):Wy(n,r,Uy(n,r))}function qy(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 Jy(e,t){return t.find(t=>t.status===`success`&&t.started_at<e.started_at)}function Yy({routineId:e,current:t,candidates:n}){let r=Jy(t,n)??n[0],[i,a]=(0,x.useState)(!1),[o,s]=(0,x.useState)(r?.workbench),c=n.find(e=>e.workbench===o),l=ca(e,t.workbench,i),u=ca(e,o??``,i&&o!==void 0),d=(0,x.useMemo)(()=>{if(l.data!==void 0&&u.data!==void 0)return Ky(u.data,l.data)},[l.data,u.data]);return n.length===0?null:(0,P.jsxs)(`div`,{className:`run-compare`,children:[(0,P.jsxs)(`div`,{className:`section-acts`,children:[(0,P.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>a(e=>!e),children:[i?`▾`:`▸`,` Compare against another run`]}),i&&(0,P.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,P.jsxs)(`option`,{value:e.workbench,children:[Ps(e.status),` · `,Ua(e.started_at)]},e.workbench))})]}),i&&c!==void 0&&(0,P.jsx)(`div`,{className:`run-compare-body`,children:l.isLoading||u.isLoading?(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})}):l.isError||u.isError?(0,P.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,(l.error??u.error)?.message]}):d===void 0?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`run-compare-summary`,children:(()=>{let{added:e,removed:t}=qy(d);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:`c-accent`,children:[`+`,e]}),` `,(0,P.jsxs)(`span`,{className:`c-red`,children:[`-`,t]}),` vs`,` `,Ps(c.status),` run at `,Ua(c.started_at)]})})()}),(0,P.jsx)(`div`,{className:`logs-wrap`,children:d.length===0?(0,P.jsx)(`div`,{className:`logs-empty`,children:`— identical logs —`}):(0,P.jsx)(`div`,{className:`log-lines`,children:d.map((e,t)=>(0,P.jsxs)(`div`,{className:`log-line run-diff-${e.kind}`,children:[(0,P.jsx)(`span`,{className:`run-diff-marker`,children:e.kind===`add`?`+`:e.kind===`remove`?`-`:` `}),(0,P.jsx)(`span`,{className:`log-lc`,children:e.line})]},t))})})]})})]})}function Xy(){let{routineId:e=``,workbench:t=``}=St(),n=yt(),r=is(),i=Math.floor(r/1e3),a=Ji(e),o=z(e),s=ca(e,t),c=la(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,P.jsxs)(`main`,{className:`logs-page`,children:[(0,P.jsxs)(`div`,{className:`page-hd`,children:[(0,P.jsxs)(Fn,{to:`/routines?history=${encodeURIComponent(e)}`,className:`btn btn-ghost btn-sm`,children:[`← `,m]}),(0,P.jsxs)(`div`,{className:`page-title`,children:[`RUN / `,t]}),o.dataUpdatedAt>0&&(0,P.jsx)(`span`,{className:`page-freshness`,children:fs(Math.max(0,(r-o.dataUpdatedAt)/1e3))}),(0,P.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void o.refetch(),children:`↻`})]}),o.isLoading?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):o.isError?(0,P.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,o.error.message]}):d===void 0?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`RUN NOT FOUND`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:`it may have been reaped, or the link is stale`})]})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`stats`,children:[(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`STATUS`}),(0,P.jsx)(`span`,{className:Ns(d.status),children:Ps(d.status)})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`STARTED`}),(0,P.jsx)(`div`,{className:`stat-val stat-val-sm`,title:Ga(d.started_at),children:Ua(d.started_at)})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`DURATION`}),(0,P.jsx)(`div`,{className:`stat-val stat-val-sm`,children:d.finished_at==null?`—`:Fs(d.started_at,d.finished_at)})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`EXIT CODE`}),(0,P.jsx)(`div`,{className:`stat-val stat-val-sm`,children:d.exit_code??`—`})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`RETENTION`}),(0,P.jsx)(`div`,{className:`stat-val stat-val-sm`,children:d.retention_expires_at==null?`—`:Is(i,d.retention_expires_at)})]})]}),(0,P.jsxs)(`div`,{className:`section-acts`,children:[(0,P.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,P.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,P.jsx)(rv,{content:c.data,loading:c.isLoading,err:c.isError?c.error.message:void 0}),(0,P.jsx)(lv,{content:s.data,loading:s.isLoading,err:s.isError?s.error.message:void 0}),(0,P.jsx)(Yy,{routineId:e,current:d,candidates:l.filter(e=>e.workbench!==d.workbench)})]})]})}function Zy(e){return Ga(e).slice(-5)}function Qy({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,P.jsxs)(`details`,{className:`runs-gantt cap-forecast`,open:!0,children:[(0,P.jsxs)(`summary`,{className:`runs-gantt-hd`,children:[(0,P.jsx)(`span`,{className:`filter-label`,children:`CAPACITY FORECAST · NEXT 24H`}),(0,P.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,P.jsxs)(`div`,{className:`runs-gantt-row`,children:[(0,P.jsx)(`span`,{className:`runs-gantt-name`,children:`projected`}),(0,P.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,P.jsx)(`span`,{className:c&&e.count>t?`runs-gantt-level over`:`runs-gantt-level`,title:`${Ga(e.from)} – ${Ga(e.to)}: ${e.count} projected`,style:{left:`${Ty(e.from,n,r)}%`,width:`${Ty(e.to,n,r)-Ty(e.from,n,r)}%`,height:`${e.count/o*100}%`}},e.from)),c&&t<=o&&(0,P.jsx)(`span`,{className:`runs-gantt-cap`,style:{bottom:`${t/o*100}%`}})]})]}),(0,P.jsx)(`div`,{className:`runs-gantt-lanes`,children:i.map(e=>{let t=`${Fs(0,e.estimateSecs)}${e.estimated?` (default, no history)`:` median`}`;return(0,P.jsxs)(`div`,{className:`runs-gantt-row`,children:[(0,P.jsx)(`span`,{className:`runs-gantt-name`,title:`${e.title} · ~${t}`,children:e.title}),(0,P.jsx)(`div`,{className:`runs-gantt-track`,children:e.bars.map(i=>{let a=`${e.title}: ${i.running?`running now`:`fires ${Ga(i.start)}`}, ~${t}`;return(0,P.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:`${Ty(i.start,n,r)}%`,width:`${Ty(i.end,n,r)-Ty(i.start,n,r)}%`}},i.start)})})]},e.routineId)})}),(0,P.jsxs)(`div`,{className:`runs-hist-axis runs-gantt-axis`,children:[(0,P.jsx)(`span`,{children:`now`}),(0,P.jsx)(`span`,{children:`+24h`})]}),s.length>0&&(0,P.jsx)(`ul`,{className:`cap-forecast-windows`,"aria-label":`Over-cap windows`,children:s.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsxs)(`span`,{className:`c-amber`,children:[Zy(e.from),`–`,Zy(e.to),` · `,e.peak,` projected`]}),` `,e.titles.join(`, `)]},e.from))})]})}function $y(e,t){let n=Array.from({length:24},()=>[]);for(let r of e)for(let e of Po(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 eb(e,t){let n=e.snoozed_until;return n!=null&&n>Math.floor(t.getTime()/1e3)||(e.skip_runs??0)>0}function tb(e,t){return e.filter(e=>e.enabled).map(e=>({label:e.title,schedule:e.schedule,snoozed:eb(e,t),flagCount:e.flag_count}))}function nb(e){return`${Ao[e.getDay()]} · ${jo[e.getMonth()]?.slice(0,3)} ${e.getDate()} ${e.getFullYear()}`}function rb({day:e,items:t,loading:n,isToday:r,currentHour:i,onPrev:a,onNext:o,onToday:s,onClose:c}){let l=$y(t,e),u=l.reduce((e,t)=>e+t.length,0);return(0,P.jsxs)(`section`,{className:`hm-day card`,children:[(0,P.jsxs)(`div`,{className:`hm-day-nav`,children:[(0,P.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:a,"aria-label":`Previous day`,children:`‹`}),(0,P.jsx)(`div`,{className:`hm-day-title`,children:nb(e)}),(0,P.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:o,"aria-label":`Next day`,children:`›`}),(0,P.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:s,children:`TODAY`}),(0,P.jsx)(`div`,{className:`hm-day-spacer`}),(0,P.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:c,"aria-label":`Close day view`,children:`✕`})]}),n?(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})}):u===0?(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:`no fire times on this day`})]}):(0,P.jsx)(`div`,{className:`hm-day-hours`,children:l.map((e,t)=>(0,P.jsxs)(`div`,{className:r&&t===i?`hm-day-hour now`:`hm-day-hour`,children:[(0,P.jsxs)(`div`,{className:`hm-day-hour-label`,children:[String(t).padStart(2,`0`),`:00`]}),(0,P.jsx)(`div`,{className:`hm-day-hour-slot`,children:e.map((e,t)=>(0,P.jsxs)(`div`,{className:e.snoozed?`hm-day-chip snoozed`:`hm-day-chip`,title:e.label,children:[(0,P.jsxs)(`span`,{className:`hm-day-chip-time`,children:[String(e.time.getHours()).padStart(2,`0`),`:`,String(e.time.getMinutes()).padStart(2,`0`)]}),(0,P.jsx)(`span`,{className:`hm-day-chip-label`,children:e.label}),e.flagCount>0&&(0,P.jsx)(`span`,{className:`hm-day-chip-flag`,children:`⚑${e.flagCount}`})]},t))})]},t))})]})}var ib=86400,ab=2e3;function ob(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 sb(e,t,n){let r=new Set;for(let i of Co(e)){let e=bo(i,new Date(t*1e3));for(let t=0;e!==void 0&&t<ab&&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 cb(e,t,n,r,i=ib){let a=n+i,o=ob(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 sb(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=Cy(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:lb(l,c,r)}}function lb(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 ub=2e4;function db(e){return e===`all`?`ALL`:`ROUTINES`}function fb(e,t){return e===`all`||e===t}function pb(e,t,n){let r=Oo(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||!fb(n,s.kind))continue;let e=!1;for(let n of Co(s)){let o=bo(n,t);if(o)for(let t=0;t<ub&&o.hasNext();t++){let t=o.next().toDate(),n=Oo(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 mb(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 hb(e){return e.grid.map(e=>e.reduce((e,t)=>e+t,0))}function gb(e){return Array.from({length:24},(t,n)=>e.grid.reduce((e,t)=>e+(t[n]??0),0))}function _b(e){return e.grid.flat().filter(e=>e>0).length}function vb(e){return e.getDay()}function yb(e,t){return Ao[vb(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`${yb(t,n)} ${String(r).padStart(2,`0`)}:00 · ${i} ${a}`}function xb(e,t){let n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return`${Ao[vb(n)]} ${n.getDate()}`}function Sb(e){return e.map(e=>({kind:`routine`,schedule:e.schedule,schedules:Co(e),enabled:e.enabled}))}var Cb=6e4,wb=[`all`,`routine`];function Tb(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Eb(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Db(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 Ob(e){if(e!==0)return`color-mix(in srgb, var(--accent) ${10+e*20}%, var(--surface))`}function kb(){let e=ps(),{data:t,isLoading:n,error:r,dataUpdatedAt:i}=qi({},{refetchInterval:ls(e)}),[a,o]=(0,x.useState)(()=>new Date),[s,c]=(0,x.useState)(`all`),[l,u]=Vn();(0,x.useEffect)(()=>{let e=setInterval(()=>o(new Date),Cb);return()=>clearInterval(e)},[]);let d=Oo(a),f=a.getHours(),p=(0,x.useMemo)(()=>Sb(t??[]),[t]),m=(0,x.useMemo)(()=>pb(p,a,s),[p,a,s]),h=Db(l.get(`day`)),g=e=>{u(t=>{let n=new URLSearchParams(t);return n.set(`day`,Eb(e)),n})},_=()=>{u(e=>{let t=new URLSearchParams(e);return t.delete(`day`),t})},{data:v}=R(300,{refetchInterval:ls(e)}),y=Gi().data?.value,b=(0,x.useMemo)(()=>cb(t??[],v??[],Math.floor(a.getTime()/1e3),y??0),[t,v,a,y]),S=(0,x.useMemo)(()=>tb(t??[],a),[t,a]),C=r?.message,w=Array.from({length:7},(e,t)=>t),T=Array.from({length:24},(e,t)=>t),ee=hb(m),E=gb(m),D=168-_b(m);return(0,P.jsxs)(`div`,{className:`page`,children:[(0,P.jsxs)(`div`,{className:`hm-hd`,children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Heatmap`}),(0,P.jsxs)(`div`,{className:`hm-hd-acts`,children:[(0,P.jsx)(`div`,{className:`hm-filter`,role:`group`,"aria-label":`Source filter`,children:wb.map(e=>(0,P.jsx)(`button`,{className:e===s?`hm-filter-btn active`:`hm-filter-btn`,"aria-pressed":e===s,onClick:()=>c(e),children:db(e)},e))}),(0,P.jsx)(hs,{updatedAtMs:i})]})]}),(0,P.jsxs)(`div`,{className:`stats`,children:[(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FIRES / 7 DAYS`}),(0,P.jsx)(`div`,{className:`stat-val`,children:m.total})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`BUSIEST WINDOW`}),(0,P.jsx)(`div`,{className:`stat-val stat-val-sm c-accent`,children:bb(m,d)??`—`})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`PEAK / HOUR`}),(0,P.jsx)(`div`,{className:`stat-val`,children:m.maxCell})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`SOURCES`}),(0,P.jsx)(`div`,{className:`stat-val`,children:m.sources})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`OPEN SLOTS`}),(0,P.jsxs)(`div`,{className:`stat-val stat-val-sm`,children:[D,` / `,168]})]})]}),C?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:C})]})}):n?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):m.total===0?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`▦`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:`no enabled routine fires in the next 7 days`})]})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`hm-grid-wrap`,children:(0,P.jsxs)(`div`,{className:`hm-grid`,role:`grid`,"aria-label":`Fire density by day and hour`,children:[(0,P.jsx)(`div`,{className:`hm-corner`,role:`columnheader`,children:`DAY \\ HR`}),T.map(e=>(0,P.jsx)(`div`,{className:e===f?`hm-hcol now`:`hm-hcol`,role:`columnheader`,children:String(e).padStart(2,`0`)},e)),(0,P.jsx)(`div`,{className:`hm-rowtot hm-corner`,role:`columnheader`,children:`Σ`}),w.map(e=>{let t=Tb(d,e);return(0,P.jsxs)(x.Fragment,{children:[(0,P.jsx)(`button`,{className:e===0?`hm-daylabel today`:`hm-daylabel`,onClick:()=>g(t),title:`View ${xb(d,e)}`,children:xb(d,e)}),T.map(n=>{let r=m.grid[e]?.[n]??0,i=mb(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,P.jsx)(`button`,{className:s,style:{backgroundColor:Ob(i)},onClick:()=>g(t),title:`${xb(d,e)} ${String(n).padStart(2,`0`)}:00 — ${r} run${r===1?``:`s`}`,children:r>0?(0,P.jsx)(`span`,{className:`hm-n`,children:r}):null},`${e}-${n}`)}),(0,P.jsx)(`div`,{className:`hm-rowtot`,children:ee[e]})]},e)}),(0,P.jsx)(`div`,{className:`hm-daylabel hm-foot`,children:`Σ`}),T.map(e=>(0,P.jsx)(`div`,{className:`hm-rowtot hm-foot`,children:E[e]},`hourtot-${e}`)),(0,P.jsx)(`div`,{className:`hm-rowtot hm-foot grand`,children:m.total})]})}),(0,P.jsxs)(`div`,{className:`hm-legend`,children:[(0,P.jsx)(`span`,{className:`hm-legend-label`,children:`LESS`}),[0,1,2,3,4].map(e=>(0,P.jsx)(`span`,{className:`hm-cell hm-legend-swatch`,style:{backgroundColor:Ob(e)}},e)),(0,P.jsx)(`span`,{className:`hm-legend-label`,children:`MORE`}),(0,P.jsx)(`span`,{className:`hm-legend-note`,children:`fires per weekday · hour across the next 7 days`})]})]}),!C&&!n&&(0,P.jsx)(Qy,{forecast:b,cap:y}),h&&(0,P.jsx)(rb,{day:h,items:S,loading:n,isToday:Oo(h).getTime()===d.getTime(),currentHour:f,onPrev:()=>g(Tb(h,-1)),onNext:()=>g(Tb(h,1)),onToday:()=>g(d),onClose:_})]})}var Ab=5,jb=.4,Mb=8,Nb=1.25;function Pb(e){return e.sampleSize===0?null:e.successes/e.sampleSize}function Fb(e){if(e.sampleSize<Ab)return!1;let t=e.sampleSize-1;return t>0&&e.flips/t>=jb}function Ib(e){return e.kind===`failure`?e.count:0}function Lb(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 Rb(e){let t=0;for(let n=1;n<e.length;n++)e[n]!==e[n-1]&&(t+=1);return t}function zb(e,t){return e.length===0?null:e[Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1))]??null}function Bb(e){return zb([...e].sort((e,t)=>e-t),.5)}function Vb(e){if(e.length<Mb)return!1;let t=Math.floor(e.length/2),n=Bb(e.slice(0,t)),r=Bb(e.slice(t));return n===null||r===null||r<=0?!1:n>r*Nb}function Hb(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 Ub(e){let t=[];for(let[n,r]of Hb(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:Lb(r.statuses),flips:Rb(r.statuses),durationsSecs:r.durationsSecs,p50Secs:zb(e,.5),p95Secs:zb(e,.95),regressing:Vb(r.durationsSecs)})}return t.sort((e,t)=>{let n=Ib(t.streak)-Ib(e.streak);if(n!==0)return n;let r=Pb(e)??1,i=Pb(t)??1;return r===i?e.routineTitle.localeCompare(t.routineTitle):r-i}),t}function Wb(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=>Ib(e.streak)>0).length,flakyCount:e.filter(Fb).length,p50Secs:zb(t,.5),p95Secs:zb(t,.95),regressingCount:e.filter(e=>e.regressing).length}}function Gb(e){switch(e.kind){case`success`:return`run-status success`;case`failure`:return`run-status failed`;default:return`run-status unknown`}}function Kb(e){switch(e.kind){case`success`:return`${e.count} OK`;case`failure`:return`${e.count} FAILING`;default:return`—`}}function qb(e){return e===null?`run-status unknown`:e>=.9?`run-status success`:e>=.7?`run-status running`:`run-status failed`}function Jb(e){return e===null?`—`:`${Math.round(e*100)}%`}var Yb=86400,Xb=60,Zb=2e3;function Qb(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 $b(e,t,n){let r=new Set;for(let i of Co(e)){let e=bo(i,new Date((n+1)*1e3));for(let n=0;e!==void 0&&n<Zb&&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 ex(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-Xb&&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 tx(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-Yb,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=$b(t,Math.max(s,t.created_at,t.snoozed_until??0),c);if(r.length===0)continue;let{lags:i,missedAt:a}=ex(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:Qb(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:Qb(d)}}function nx(e){return e===null?`—`:Fs(0,e)}function rx({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,P.jsxs)(`details`,{className:`table-wrap adherence`,open:!0,children:[(0,P.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,P.jsxs)(`span`,{className:`filter-label`,children:[`SCHEDULE ADHERENCE · LAST `,o?`~${l}H`:`24H`]}),(0,P.jsxs)(`span`,{className:i>0?`c-red`:`cell-meta`,children:[r,`/`,n,` fires ran — `,i,` missed · `,(0,P.jsx)(`span`,{className:qb(c),children:Jb(c)}),` · median start lag `,nx(a)]})]}),(0,P.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,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`ROUTINE`}),(0,P.jsx)(`th`,{children:`EXPECTED`}),(0,P.jsx)(`th`,{children:`RAN`}),(0,P.jsx)(`th`,{children:`MISSED`}),(0,P.jsx)(`th`,{children:`ADHERENCE`}),(0,P.jsx)(`th`,{children:`MEDIAN LAG`}),(0,P.jsx)(`th`,{children:`LAST MISSED`})]})}),(0,P.jsx)(`tbody`,{children:t.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(Fn,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.title})}),(0,P.jsx)(`td`,{className:`cell-meta`,children:e.expected}),(0,P.jsx)(`td`,{className:`cell-meta`,children:e.ran}),(0,P.jsx)(`td`,{className:e.missed>0?`c-red`:`cell-meta`,children:e.missed}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:qb(e.ran/e.expected),children:Jb(e.ran/e.expected)})}),(0,P.jsx)(`td`,{className:`cell-meta`,children:nx(e.medianLagSecs)}),(0,P.jsx)(`td`,{className:`cell-meta`,children:e.lastMissedAt===null?`—`:Ga(e.lastMissedAt)})]},e.routineId))})]})]})}function ix(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 ax(e){return e===null?`—`:Fs(0,e)}function ox({report:e}){let{incidents:t,openCount:n,mttrSecs:r,longestSecs:i}=e;return t.length===0?null:(0,P.jsxs)(`details`,{className:`table-wrap adherence`,open:!0,children:[(0,P.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,P.jsx)(`span`,{className:`filter-label`,children:`FAILURE INCIDENTS`}),(0,P.jsxs)(`span`,{className:`cell-meta`,children:[(0,P.jsxs)(`span`,{className:n>0?`c-red`:void 0,children:[n,` open`]}),` · `,t.length,` total · MTTR `,ax(r),` · longest `,ax(i)]})]}),(0,P.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,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`ROUTINE`}),(0,P.jsx)(`th`,{children:`STATUS`}),(0,P.jsx)(`th`,{children:`OPENED`}),(0,P.jsx)(`th`,{children:`RESOLVED`}),(0,P.jsx)(`th`,{children:`TIME TO RECOVER`}),(0,P.jsx)(`th`,{children:`FAILED RUNS`})]})}),(0,P.jsx)(`tbody`,{children:t.map(e=>{let t=e.truncated?`≥ `:``;return(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(Fn,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.routineTitle})}),(0,P.jsx)(`td`,{children:e.resolvedAt===null?(0,P.jsx)(`span`,{className:`run-status failed`,children:`ONGOING`}):(0,P.jsx)(`span`,{className:`run-status success`,children:`RESOLVED`})}),(0,P.jsx)(`td`,{className:`cell-meta`,children:(0,P.jsxs)(Fn,{to:`/runs/${encodeURIComponent(e.routineId)}/${encodeURIComponent(e.firstWorkbench)}`,title:`Open the first failed run`,children:[t,Ga(e.openedAt)]})}),(0,P.jsx)(`td`,{className:`cell-meta`,children:e.resolvedAt===null?`—`:Ga(e.resolvedAt)}),(0,P.jsxs)(`td`,{className:e.resolvedAt===null?`c-red`:`cell-meta`,children:[t,ax(e.durationSecs)]}),(0,P.jsxs)(`td`,{className:`cell-meta`,children:[t,e.failedRuns]})]},`${e.routineId}-${e.openedAt}`)})})]})]})}var sx={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 cx(e){return e===null?`no exit code recorded`:sx[e]||(e>128&&e<160?`signal ${e-128}`:`routine-specific`)}function lx(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 ux=3;function dx({report:e}){let{causes:t,totalFailed:n}=e;return t.length===0?null:(0,P.jsxs)(`details`,{className:`table-wrap adherence`,open:!0,children:[(0,P.jsxs)(`summary`,{className:`adherence-hd`,children:[(0,P.jsx)(`span`,{className:`filter-label`,children:`FAILURE CAUSES`}),(0,P.jsxs)(`span`,{className:`cell-meta`,children:[n,` failed runs · `,t.length,` distinct exit `,t.length===1?`code`:`codes`]})]}),(0,P.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,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`EXIT CODE`}),(0,P.jsx)(`th`,{children:`MEANING`}),(0,P.jsx)(`th`,{children:`FAILURES`}),(0,P.jsx)(`th`,{children:`ROUTINES`}),(0,P.jsx)(`th`,{children:`LAST SEEN`})]})}),(0,P.jsx)(`tbody`,{children:t.map(e=>{let t=e.routines.length-ux;return(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:`run-status failed`,children:e.code??`?`})}),(0,P.jsx)(`td`,{className:`cell-meta`,children:cx(e.code)}),(0,P.jsxs)(`td`,{className:`cell-meta`,children:[e.count,` (`,Math.round(e.count/n*100),`%)`]}),(0,P.jsxs)(`td`,{children:[e.routines.slice(0,ux).map((e,t)=>(0,P.jsxs)(`span`,{children:[t>0?`, `:null,(0,P.jsx)(Fn,{to:`/routines?history=${encodeURIComponent(e.id)}`,children:e.title}),e.count>1?(0,P.jsxs)(`span`,{className:`cell-meta`,children:[` ×`,e.count]}):null]},e.id)),t>0?(0,P.jsxs)(`span`,{className:`cell-meta`,children:[` +`,t,` more`]}):null]}),(0,P.jsx)(`td`,{className:`cell-meta`,children:(0,P.jsx)(Fn,{to:`/runs/${encodeURIComponent(e.last.routineId)}/${encodeURIComponent(e.last.workbench)}`,title:`Open the newest failed run with this exit code`,children:Ga(e.last.at)})})]},e.code??`none`)})})]})]})}var fx=300,px=[`routine`,`streak`,`rate`,`p50`,`p95`,`trend`],mx={routine:e=>e.routineTitle,streak:e=>e.streak.kind===`failure`?-e.streak.count:e.streak.kind===`success`?e.streak.count:0,rate:e=>Pb(e),p50:e=>e.p50Secs,p95:e=>e.p95Secs,trend:e=>+!!e.regressing};function hx(e){return e===null?`—`:Fs(0,e)}function gx(){let e=ps(),{data:t,isLoading:n,error:r,dataUpdatedAt:i}=R(fx,{refetchInterval:ls(e)}),{data:a}=qi({},{refetchInterval:ls(e)}),{data:o,isLoading:s}=zi(),c=is(6e4),l=Ub(t??[]),{sort:u,toggle:d}=Ny(`moadim.client.reliability.sort`,px),f=Wb(l),p=f.sampleSize===0?null:f.successes/f.sampleSize,m=r?.message,h=tx(a??[],t??[],o?.name,Math.floor(c/1e3),fx),g=ix(t??[],Math.floor(c/1e3)),_=lx(t??[]);return(0,P.jsxs)(`div`,{className:`page`,children:[(0,P.jsxs)(`div`,{className:`section-hd`,children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Reliability`}),(0,P.jsx)(`div`,{className:`section-acts`,children:(0,P.jsx)(hs,{updatedAtMs:i})})]}),(0,P.jsxs)(`div`,{className:`stats`,children:[(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FLEET SUCCESS RATE`}),(0,P.jsx)(`div`,{className:`stat-val`,children:Jb(p)})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FAILING`}),(0,P.jsx)(`div`,{className:f.failingCount>0?`stat-val c-red`:`stat-val`,children:f.failingCount})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FLAKY`}),(0,P.jsx)(`div`,{className:f.flakyCount>0?`stat-val c-amber`:`stat-val`,children:f.flakyCount})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FLEET P50`}),(0,P.jsx)(`div`,{className:`stat-val stat-val-sm`,children:hx(f.p50Secs)})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`FLEET P95`}),(0,P.jsx)(`div`,{className:`stat-val stat-val-sm`,children:hx(f.p95Secs)})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`SLOWER TREND`}),(0,P.jsx)(`div`,{className:f.regressingCount>0?`stat-val c-amber`:`stat-val`,children:f.regressingCount})]})]}),!m&&!n&&!s&&(0,P.jsx)(rx,{adherence:h}),!m&&!n&&(0,P.jsx)(ox,{report:g}),!m&&!n&&(0,P.jsx)(dx,{report:_}),m?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:m})]})}):n?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):l.length===0?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`✓`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO FINISHED RUNS YET`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:`reliability metrics need at least one success or failure`})]})}):(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(Oy,{label:`ROUTINE`,col:`routine`,sort:u,defaultDir:`asc`,onSort:d}),(0,P.jsx)(Oy,{label:`STREAK`,col:`streak`,sort:u,defaultDir:`asc`,onSort:d}),(0,P.jsx)(Oy,{label:`SUCCESS RATE`,col:`rate`,sort:u,defaultDir:`asc`,onSort:d}),(0,P.jsx)(Oy,{label:`P50`,col:`p50`,sort:u,defaultDir:`desc`,onSort:d}),(0,P.jsx)(Oy,{label:`P95`,col:`p95`,sort:u,defaultDir:`desc`,onSort:d}),(0,P.jsx)(Oy,{label:`TREND`,col:`trend`,sort:u,defaultDir:`desc`,onSort:d})]})}),(0,P.jsx)(`tbody`,{children:Ay(l,u,mx).map(e=>(0,P.jsx)(_x,{item:e},e.routineId))})]})})]})}function _x({item:e}){return(0,P.jsxs)(`tr`,{children:[(0,P.jsxs)(`td`,{children:[(0,P.jsx)(Fn,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.routineTitle}),Fb(e)?(0,P.jsxs)(`span`,{className:`run-status running`,title:`Alternating pass/fail over the recent sample`,children:[` `,`FLAKY`]}):null]}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:Gb(e.streak),children:Kb(e.streak)})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:qb(Pb(e)),children:Jb(Pb(e))})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:`cell-meta`,children:hx(e.p50Secs)})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:`cell-meta`,children:hx(e.p95Secs)})}),(0,P.jsx)(`td`,{children:e.regressing?(0,P.jsx)(`span`,{className:`run-status failed`,title:`Recent runs are meaningfully slower than the baseline`,children:`SLOWER`}):(0,P.jsx)(`span`,{className:`cell-meta`,children:`—`})})]})}function vx(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=Tc(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 yx(e){return e.finishedCount===0?null:e.successCount/e.finishedCount}function bx(e){return e.filter(e=>(e.machines??[]).every(e=>e.trim()===``)).length}var xx=300;function Sx(){let e=ls(ps()),t=Bi(),n=zi(),r=qi({},{refetchInterval:e}),i=R(xx,{refetchInterval:e}),a=(0,x.useMemo)(()=>r.data??[],[r.data]),o=(0,x.useMemo)(()=>i.data??[],[i.data]),s=(0,x.useMemo)(()=>[...new Set([...t.data??[],...kc(a)])].sort(),[t.data,a]),c=(0,x.useMemo)(()=>vx(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=bx(a),p=c.reduce((e,t)=>e+t.runningNow,0);return(0,P.jsxs)(`div`,{className:`page`,children:[(0,P.jsxs)(`div`,{className:`section-hd`,children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Machines`}),(0,P.jsx)(`div`,{className:`section-acts`,children:(0,P.jsx)(hs,{updatedAtMs:Number.isFinite(d)?d:0})})]}),(0,P.jsxs)(`div`,{className:`stats`,children:[(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`MACHINES`}),(0,P.jsx)(`div`,{className:`stat-val`,children:s.length})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`RUNNING NOW`}),(0,P.jsx)(`div`,{className:p>0?`stat-val c-accent`:`stat-val`,children:p})]}),(0,P.jsxs)(`div`,{className:`stat-card`,children:[(0,P.jsx)(`div`,{className:`stat-label`,children:`UNASSIGNED ROUTINES`}),(0,P.jsx)(`div`,{className:f>0?`stat-val c-amber`:`stat-val`,children:f})]})]}),u?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:u})]})}):l?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(`div`,{className:`empty`,children:(0,P.jsx)(`div`,{className:`spinner`})})}):c.length===0?(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`div`,{className:`empty`,children:[(0,P.jsx)(`div`,{className:`empty-icon`,children:`🖥`}),(0,P.jsx)(`div`,{className:`empty-msg`,children:`NO MACHINES YET`}),(0,P.jsx)(`div`,{className:`empty-sub`,children:`no routine targets a machine, and this daemon has no resolved identity`})]})}):(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsxs)(`table`,{children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`MACHINE`}),(0,P.jsx)(`th`,{children:`ROUTINES`}),(0,P.jsx)(`th`,{children:`ENABLED`}),(0,P.jsx)(`th`,{children:`RUNNING NOW`}),(0,P.jsx)(`th`,{children:`POWER SAVING`}),(0,P.jsx)(`th`,{children:`ATTENTION`}),(0,P.jsx)(`th`,{children:`SUCCESS RATE`}),(0,P.jsx)(`th`,{children:`LAST ACTIVITY`})]})}),(0,P.jsx)(`tbody`,{children:c.map(e=>(0,P.jsx)(Cx,{m:e},e.name))})]})})]})}function Cx({m:e}){return(0,P.jsxs)(`tr`,{children:[(0,P.jsxs)(`td`,{children:[e.name,e.isCurrent?(0,P.jsx)(`span`,{className:`cell-meta`,children:` (this machine)`}):null,e.routines.length>0?(0,P.jsxs)(`details`,{children:[(0,P.jsxs)(`summary`,{className:`cell-meta`,children:[e.routines.length,` routine`,e.routines.length===1?``:`s`]}),(0,P.jsx)(`ul`,{children:e.routines.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(Fn,{to:`/routines?history=${encodeURIComponent(e.id)}`,children:e.title})},e.id))})]}):null]}),(0,P.jsx)(`td`,{children:e.total}),(0,P.jsx)(`td`,{children:e.enabled}),(0,P.jsx)(`td`,{className:e.runningNow>0?`c-accent`:void 0,children:e.runningNow}),(0,P.jsx)(`td`,{children:e.powerSaving}),(0,P.jsx)(`td`,{className:e.needsAttention>0?`c-red`:`cell-meta`,children:e.needsAttention||`—`}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`span`,{className:qb(yx(e)),children:Jb(yx(e))})}),(0,P.jsx)(`td`,{children:e.lastRun?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:Ns(e.lastRun.status),children:Ps(e.lastRun.status)}),` `,(0,P.jsx)(`span`,{className:`cell-meta`,children:e.lastRun.label})]}):(0,P.jsx)(`span`,{className:`cell-meta`,children:`—`})})]})}function wx({health:e,loading:t,retrying:n,onRefresh:r,onRetry:i}){let a=e?.crontab_sync;return t&&!a?(0,P.jsx)(`p`,{className:`settings-card-copy`,children:`Checking OS crontab sync…`}):a?a.ok?(0,P.jsxs)(`div`,{className:`settings-health settings-health-ok`,children:[(0,P.jsx)(`div`,{className:`settings-health-main`,children:`OS crontab sync is healthy`}),(0,P.jsx)(`p`,{className:`settings-card-copy`,children:`Scheduled routine changes are installed in the OS crontab.`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]}):(0,P.jsxs)(`div`,{className:`settings-health settings-health-warn`,children:[(0,P.jsx)(`div`,{className:`settings-health-main`,children:`⚠ OS crontab sync needs attention`}),(0,P.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,P.jsx)(`div`,{className:`settings-health-error`,children:a.last_error}),a.last_error_at&&(0,P.jsxs)(`div`,{className:`settings-health-meta`,children:[`Last failed: `,Tx(a.last_error_at)]}),(0,P.jsxs)(`ol`,{className:`settings-recovery-list`,"aria-label":`Crontab sync recovery steps`,children:[(0,P.jsx)(`li`,{children:`Open macOS System Settings → Privacy & Security → Full Disk Access.`}),(0,P.jsx)(`li`,{children:`Allow the Moadim daemon or the launcher that starts it.`}),(0,P.jsx)(`li`,{children:`Restart Moadim if you changed permissions, then click Retry sync now.`})]}),(0,P.jsxs)(`div`,{className:`settings-health-actions`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:n,onClick:i,children:n?`Retrying…`:`Retry sync now`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]})]}):(0,P.jsxs)(`div`,{className:`settings-health settings-health-unknown`,children:[(0,P.jsx)(`div`,{className:`settings-health-main`,children:`Health details unavailable`}),(0,P.jsx)(`p`,{className:`settings-card-copy`,children:`Refresh status once the daemon is reachable.`}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]})}function Tx(e){return new Date(e*1e3).toLocaleString()}function Ex(){let{addToast:e}=$a(),t=Ui(),n=Wi(),r=Ii(3e4),i=Li(),a=Gi(),o=Ki(),[s,c]=(0,x.useState)(``),[l,u]=(0,x.useState)(``),[d,f]=(0,x.useState)(us),[p,m]=(0,x.useState)(Pa),[h,g]=(0,x.useState)(``),[_,v]=(0,x.useState)(void 0);t.data!==void 0&&t.data!==_&&(v(t.data),c(t.data),u(t.data));let y=s!==l,[b,S]=(0,x.useState)(void 0);a.data!==void 0&&a.data.override_value!==b&&(S(a.data.override_value),g(a.data.override_value===null?``:String(a.data.override_value)));let C=h!==(b===null?``:String(b??``)),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`)})},ee=()=>{n.mutate(s,{onSuccess:()=>{u(s),e(`Prompt saved`,`ok`)},onError:t=>e(`Save failed: ${t.message}`,`err`)})},E=t=>{ds(t),f(t),e(`Refresh cadence saved`,`ok`)},D=t=>{Fa(t),m(t),e(`Theme saved`,`ok`)};return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Settings`}),(0,P.jsxs)(`div`,{className:`card settings-card`,children:[(0,P.jsx)(`div`,{className:`settings-card-title`,children:`Appearance`}),(0,P.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,P.jsxs)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Theme`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn ${p?`btn-primary`:`btn-secondary`}`,"aria-pressed":p,onClick:()=>D(!0),children:`Light`}),(0,P.jsx)(`button`,{type:`button`,className:`btn ${p?`btn-secondary`:`btn-primary`}`,"aria-pressed":!p,onClick:()=>D(!1),children:`Dark`})]})]}),(0,P.jsxs)(`div`,{className:`card settings-card`,children:[(0,P.jsx)(`div`,{className:`settings-card-title`,children:`Data refresh`}),(0,P.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,P.jsx)(ms,{token:d,updatedAtMs:0,onChange:E})]}),(0,P.jsxs)(`div`,{className:`card settings-card`,children:[(0,P.jsx)(`div`,{className:`settings-card-title`,children:`Concurrency`}),(0,P.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,P.jsx)(`code`,{children:`MOADIM_MAX_CONCURRENT_RUNS`}),` env var, or the built-in default if that isn't set either.`]}),a.isLoading?(0,P.jsx)(`div`,{children:`Loading…`}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`settings-card-copy`,children:[`Effective cap right now:`,` `,(0,P.jsx)(`strong`,{children:a.data?.value===0?`unbounded`:a.data?.value})]}),(0,P.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:8},children:[(0,P.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,P.jsx)(`button`,{className:`btn btn-primary`,disabled:!C||!w||o.isPending,onClick:T,children:o.isPending?`Saving…`:`Save`}),h.trim()!==``&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,disabled:o.isPending,onClick:()=>g(``),children:`Clear`}),C&&w&&(0,P.jsx)(`span`,{style:{color:`var(--text-faint)`,fontSize:12},children:`unsaved changes`}),!w&&(0,P.jsx)(`span`,{style:{color:`var(--err)`,fontSize:12},children:`must be a whole number ≥ 0`})]})]})]}),(0,P.jsxs)(`div`,{className:`card settings-card settings-health-card`,children:[(0,P.jsx)(`div`,{className:`settings-card-title`,children:`System health`}),(0,P.jsx)(wx,{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,P.jsxs)(`div`,{className:`card`,style:{padding:16},children:[(0,P.jsx)(`div`,{style:{fontWeight:700,marginBottom:4},children:`Persistent prompt`}),(0,P.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,P.jsx)(`div`,{children:`Loading…`}):(0,P.jsxs)(P.Fragment,{children:[(0,P.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,P.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:10},children:[(0,P.jsx)(`button`,{className:`btn btn-primary`,disabled:!y||n.isPending,onClick:ee,children:n.isPending?`Saving…`:`Save`}),y&&(0,P.jsx)(`span`,{style:{color:`var(--text-faint)`,fontSize:12},children:`unsaved changes`})]})]})]})]})}function Dx(){return(0,P.jsx)(Jt,{children:(0,P.jsxs)(Kt,{element:(0,P.jsx)(ns,{}),children:[(0,P.jsx)(Kt,{index:!0,element:(0,P.jsx)(Vs,{})}),(0,P.jsx)(Kt,{path:`routines`,element:(0,P.jsx)(uy,{})}),(0,P.jsx)(Kt,{path:`runs`,element:(0,P.jsx)(Vy,{})}),(0,P.jsx)(Kt,{path:`runs/:routineId/:workbench`,element:(0,P.jsx)(Xy,{})}),(0,P.jsx)(Kt,{path:`heatmap`,element:(0,P.jsx)(kb,{})}),(0,P.jsx)(Kt,{path:`reliability`,element:(0,P.jsx)(gx,{})}),(0,P.jsx)(Kt,{path:`machines`,element:(0,P.jsx)(Sx,{})}),(0,P.jsx)(Kt,{path:`settings`,element:(0,P.jsx)(Ex,{})}),(0,P.jsx)(Kt,{path:`*`,element:(0,P.jsx)(Wt,{to:`/`,replace:!0})})]})})}function Ox(){return(0,P.jsx)(Qa,{children:(0,P.jsx)(Dx,{})})}var kx=new ni({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Ax=document.getElementById(`root`);if(!Ax)throw Error(`#root element missing`);(0,_i.createRoot)(Ax).render((0,P.jsx)(x.StrictMode,{children:(0,P.jsx)(Xn,{client:kx,children:(0,P.jsx)(Pn,{children:(0,P.jsx)(Ox,{})})})}));</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>