@plot-ai/darwin-arm64 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/CHANGELOG.md +5 -0
- package/bin/package.json +8 -0
- package/bin/plot-ai +0 -0
- package/bin/tui-worker.js +291399 -0
- package/package.json +31 -0
- package/pi-resources/skills/core/plot-commit/SKILL.md +68 -0
- package/pi-resources/skills/core/plot-debug/SKILL.md +116 -0
- package/pi-resources/skills/core/plot-land/SKILL.md +122 -0
- package/pi-resources/skills/core/plot-pull-main/SKILL.md +99 -0
- package/pi-resources/skills/core/plot-push-pr/SKILL.md +109 -0
- package/web-dist/assets/index-BID9mjlA.css +1 -0
- package/web-dist/assets/index-DyndTLrM.js +40 -0
- package/web-dist/index.html +27 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n&&t(r,Symbol.toStringTag,{value:`Module`}),r},l=(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},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((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,te());else{var t=n(l);t!==null&&ie(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&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(E)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=E,te=function(){re.postMessage(null)}}else te=function(){_(E,0)};function ie(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,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),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}}}})),p=s(((e,t)=>{t.exports=f()})),m=s((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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return ee(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 oe(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,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=oe(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(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 se(e,t,n){if(e==null)return e;var r=[],i=0;return oe(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var D=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)},le={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=le,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 ee(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)T.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 ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,D)}catch(e){D(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=h();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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),_=s(((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=g()})),v=s((e=>{var t=p(),n=h(),r=_();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 u(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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),ne=Symbol.for(`react.activity`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case ne:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ef(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ef(t),e=tf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function Se(e){e.memoizedState!==null&&he(ye,e);var t=ge.current,n=tf(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Ce(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),dp._currentValue=ue)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!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}e.call(n.prototype)}}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(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);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=`
|
|
6
|
+
`+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{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Fe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nt(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=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(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 rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(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 at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(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-Je(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&<(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(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 pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=le.p;return e===0?(e=window.event,e===void 0?32:Dp(e.type)):e}function ht(e,t){var n=le.p;try{return le.p=e,t()}finally{le.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt;function Tt(e){delete e[_t],delete e[vt],delete e[bt],delete e[xt],delete e[St]}function Et(e){var t=e[_t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wf(e);e!==null;){if(n=e[_t])return n;e=wf(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[wt]=!0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=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]*$`),It={},Lt={};function Rt(e){return je.call(Lt,e)?!0:je.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}function zt(e,t,n){if(Rt(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 Bt(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 Vt(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 Ht(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Wt(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 Gt(e){if(!e._valueTracker){var t=Ut(e)?`checked`:`value`;e._valueTracker=Wt(e,t,``+e[t])}}function Kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ut(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function qt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Jt=/[\n"\\]/g;function Yt(e){return e.replace(Jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Xt(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=``+Ht(t)):e.value!==``+Ht(t)&&(e.value=``+Ht(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Qt(e,o,Ht(n)):Qt(e,o,Ht(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=``+Ht(s):e.removeAttribute(`name`)}function Zt(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)){Gt(e);return}n=n==null?``:``+Ht(n),t=t==null?n:``+Ht(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),Gt(e)}function Qt(e,t,n){t===`number`&&qt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function $t(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=``+Ht(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 en(e,t,n){if(t!=null&&(t=``+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ht(n)}function tn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ce(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ht(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Gt(e)}function nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rn=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 an(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||rn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(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]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&an(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&an(e,o,t[o])}function sn(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 cn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),ln=/^[\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 un(e){return ln.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function dn(){}var fn=null;function pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mn=null,hn=null;function gn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Xt(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="`+Yt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[vt]||null;if(!a)throw Error(i(90));Xt(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&&Kt(r)}break a;case`textarea`:en(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&$t(e,!!n.multiple,t,!1)}}}var _n=!1;function vn(e,t,n){if(_n)return e(t,n);_n=!0;try{return e(t)}finally{if(_n=!1,(mn!==null||hn!==null)&&(Au(),mn&&(t=mn,e=hn,hn=mn=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function yn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||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 bn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),xn=!1;if(bn)try{var Sn={};Object.defineProperty(Sn,`passive`,{get:function(){xn=!0}}),window.addEventListener(`test`,Sn,Sn),window.removeEventListener(`test`,Sn,Sn)}catch{xn=!1}var Cn=null,wn=null,Tn=null;function En(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.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 Tn=i.slice(e,1<r?1-r:void 0)}function Dn(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 On(){return!0}function kn(){return!1}function An(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)?On:kn,this.isPropagationStopped=kn,this}return f(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=On)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=On)},persist:function(){},isPersistent:On}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mn=An(jn),Nn=f({},jn,{view:0,detail:0}),Pn=An(Nn),Fn,In,Ln,Rn=f({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yn,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!==Ln&&(Ln&&e.type===`mousemove`?(Fn=e.screenX-Ln.screenX,In=e.screenY-Ln.screenY):In=Fn=0,Ln=e),Fn)},movementY:function(e){return`movementY`in e?e.movementY:In}}),zn=An(Rn),Bn=An(f({},Rn,{dataTransfer:0})),Vn=An(f({},Nn,{relatedTarget:0})),Hn=An(f({},jn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=An(f({},jn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=An(f({},jn,{data:0})),Gn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Kn={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`},qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qn[e])?!!t[e]:!1}function Yn(){return Jn}var Xn=An(f({},Nn,{key:function(e){if(e.key){var t=Gn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yn,charCode:function(e){return e.type===`keypress`?Dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Zn=An(f({},Rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Qn=An(f({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yn})),$n=An(f({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),er=An(f({},Rn,{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})),tr=An(f({},jn,{newState:0,oldState:0})),O=[9,13,27,32],nr=bn&&`CompositionEvent`in window,rr=null;bn&&`documentMode`in document&&(rr=document.documentMode);var ir=bn&&`TextEvent`in window&&!rr,ar=bn&&(!nr||rr&&8<rr&&11>=rr),k=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return O.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 lr=!1;function ur(e,t){switch(e){case`compositionend`:return cr(t);case`keypress`:return t.which===32?(or=!0,k):null;case`textInput`:return e=t.data,e===k&&or?null:e;default:return null}}function dr(e,t){if(lr)return e===`compositionend`||!nr&&sr(e,t)?(e=En(),Tn=wn=Cn=null,lr=!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 ar&&t.locale!==`ko`?null:t.data;default:return null}}var fr={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 pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!fr[e.type]:t===`textarea`}function mr(e,t,n,r){mn?hn?hn.push(r):hn=[r]:mn=r,t=Rd(t,`onChange`),0<t.length&&(n=new Mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var hr=null,gr=null;function _r(e){Ad(e,0)}function vr(e){if(Kt(Ot(e)))return e}function yr(e,t){if(e===`change`)return t}var br=!1;if(bn){var xr;if(bn){var Sr=`oninput`in document;if(!Sr){var Cr=document.createElement(`div`);Cr.setAttribute(`oninput`,`return;`),Sr=typeof Cr.oninput==`function`}xr=Sr}else xr=!1;br=xr&&(!document.documentMode||9<document.documentMode)}function wr(){hr&&(hr.detachEvent(`onpropertychange`,Tr),gr=hr=null)}function Tr(e){if(e.propertyName===`value`&&vr(gr)){var t=[];mr(t,gr,e,pn(e)),vn(_r,t)}}function Er(e,t,n){e===`focusin`?(wr(),hr=t,gr=n,hr.attachEvent(`onpropertychange`,Tr)):e===`focusout`&&wr()}function Dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return vr(gr)}function Or(e,t){if(e===`click`)return vr(t)}function kr(e,t){if(e===`input`||e===`change`)return vr(t)}function Ar(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var jr=typeof Object.is==`function`?Object.is:Ar;function Mr(e,t){if(jr(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(!je.call(t,i)||!jr(e[i],t[i]))return!1}return!0}function Nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pr(e,t){var n=Nr(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=Nr(n)}}function Fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ir(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qt(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=qt(e.document)}return t}function Lr(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 Rr=bn&&`documentMode`in document&&11>=document.documentMode,zr=null,Br=null,Vr=null,Hr=!1;function Ur(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hr||zr==null||zr!==qt(r)||(r=zr,`selectionStart`in r&&Lr(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}),Vr&&Mr(Vr,r)||(Vr=r,r=Rd(Br,`onSelect`),0<r.length&&(t=new Mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=zr)))}function Wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Gr={animationend:Wr(`Animation`,`AnimationEnd`),animationiteration:Wr(`Animation`,`AnimationIteration`),animationstart:Wr(`Animation`,`AnimationStart`),transitionrun:Wr(`Transition`,`TransitionRun`),transitionstart:Wr(`Transition`,`TransitionStart`),transitioncancel:Wr(`Transition`,`TransitionCancel`),transitionend:Wr(`Transition`,`TransitionEnd`)},Kr={},qr={};bn&&(qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),`TransitionEvent`in window||delete Gr.transitionend.transition);function Jr(e){if(Kr[e])return Kr[e];if(!Gr[e])return e;var t=Gr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qr)return Kr[e]=t[n];return e}var Yr=Jr(`animationend`),Xr=Jr(`animationiteration`),Zr=Jr(`animationstart`),Qr=Jr(`transitionrun`),$r=Jr(`transitionstart`),ei=Jr(`transitioncancel`),ti=Jr(`transitionend`),ni=new Map,ri=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ri.push(`scrollEnd`);function ii(e,t){ni.set(e,t),Nt(t,[e])}var ai=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)},oi=[],si=0,ci=0;function li(){for(var e=si,t=ci=si=0;t<e;){var n=oi[t];oi[t++]=null;var r=oi[t];oi[t++]=null;var i=oi[t];oi[t++]=null;var a=oi[t];if(oi[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&&pi(n,i,a)}}function ui(e,t,n,r){oi[si++]=e,oi[si++]=t,oi[si++]=n,oi[si++]=r,ci|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function di(e,t,n,r){return ui(e,t,n,r),mi(e)}function fi(e,t){return ui(e,null,null,t),mi(e)}function pi(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-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function mi(e){if(50<xu)throw xu=0,Su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hi={};function gi(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 _i(e,t,n,r){return new gi(e,t,n,r)}function vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yi(e,t){var n=e.alternate;return n===null?(n=_i(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&65011712,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 bi(e,t){e.flags&=65011714;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 xi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)vi(e)&&(s=1);else if(typeof e==`string`)s=np(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ne:return e=_i(31,n,t,a),e.elementType=ne,e.lanes=o,e;case y:return Si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=_i(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=_i(13,n,t,a),e.elementType=T,e.lanes=o,e;case ee:return e=_i(19,n,t,a),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case E:s=14;break a;case te:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=_i(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Si(e,t,n,r){return e=_i(7,e,r,t),e.lanes=n,e}function Ci(e,t,n){return e=_i(6,e,null,t),e.lanes=n,e}function wi(e){var t=_i(18,null,null,0);return t.stateNode=e,t}function Ti(e,t,n){return t=_i(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ei=new WeakMap;function Di(e,t){if(typeof e==`object`&&e){var n=Ei.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Ei.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Oi=[],ki=0,Ai=null,ji=0,Mi=[],Ni=0,Pi=null,Fi=1,Ii=``;function Li(e,t){Oi[ki++]=ji,Oi[ki++]=Ai,Ai=e,ji=t}function Ri(e,t,n){Mi[Ni++]=Fi,Mi[Ni++]=Ii,Mi[Ni++]=Pi,Pi=e;var r=Fi;e=Ii;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Fi=1<<32-Je(t)+i|n<<i|r,Ii=a+e}else Fi=1<<a|n<<i|r,Ii=e}function zi(e){e.return!==null&&(Li(e,1),Ri(e,1,0))}function Bi(e){for(;e===Ai;)Ai=Oi[--ki],Oi[ki]=null,ji=Oi[--ki],Oi[ki]=null;for(;e===Pi;)Pi=Mi[--Ni],Mi[Ni]=null,Ii=Mi[--Ni],Mi[Ni]=null,Fi=Mi[--Ni],Mi[Ni]=null}function Vi(e,t){Mi[Ni++]=Fi,Mi[Ni++]=Ii,Mi[Ni++]=Pi,Fi=t.id,Ii=t.overflow,Pi=e}var Hi=null,Ui=null,Wi=!1,Gi=null,Ki=!1,qi=Error(i(519));function Ji(e){throw ea(Di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),qi}function Yi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:jd(`cancel`,t),jd(`close`,t);break;case`iframe`:case`object`:case`embed`:jd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Od.length;n++)jd(Od[n],t);break;case`source`:jd(`error`,t);break;case`img`:case`image`:case`link`:jd(`error`,t),jd(`load`,t);break;case`details`:jd(`toggle`,t);break;case`input`:jd(`invalid`,t),Zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:jd(`invalid`,t);break;case`textarea`:jd(`invalid`,t),tn(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||Wd(t.textContent,n)?(r.popover!=null&&(jd(`beforetoggle`,t),jd(`toggle`,t)),r.onScroll!=null&&jd(`scroll`,t),r.onScrollEnd!=null&&jd(`scrollend`,t),r.onClick!=null&&(t.onclick=dn),t=!0):t=!1,t||Ji(e,!0)}function Xi(e){for(Hi=e.return;Hi;)switch(Hi.tag){case 5:case 31:case 13:Ki=!1;return;case 27:case 3:Ki=!0;return;default:Hi=Hi.return}}function Zi(e){if(e!==Hi)return!1;if(!Wi)return Xi(e),Wi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||nf(e.type,e.memoizedProps)),n=!n),n&&Ui&&Ji(e),Xi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ui=Cf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ui=Cf(e)}else t===27?(t=Ui,df(e.type)?(e=Sf,Sf=null,Ui=e):Ui=t):Ui=Hi?xf(e.stateNode.nextSibling):null;return!0}function Qi(){Ui=Hi=null,Wi=!1}function $i(){var e=Gi;return e!==null&&(su===null?su=e:su.push.apply(su,e),Gi=null),e}function ea(e){Gi===null?Gi=[e]:Gi.push(e)}var ta=pe(null),na=null,ra=null;function ia(e,t,n){he(ta,t._currentValue),t._currentValue=n}function aa(e){e._currentValue=ta.current,me(ta)}function oa(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),oa(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),oa(s,n,e),s=null}else 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;jr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[dp]:e.push(dp))}a=a.return}e!==null&&sa(t,e,n,r),t.flags|=262144}function la(e){for(e=e.firstContext;e!==null;){if(!jr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ua(e){na=e,ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function da(e){return pa(na,e)}function fa(e,t){return na===null&&ua(e),pa(e,t)}function pa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ra===null){if(e===null)throw Error(i(308));ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ra=ra.next=t;return n}var ma=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()})}},ha=t.unstable_scheduleCallback,ga=t.unstable_NormalPriority,_a={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function va(){return{controller:new ma,data:new Map,refCount:0}}function ya(e){e.refCount--,e.refCount===0&&ha(ga,function(){e.controller.abort()})}var ba=null,xa=0,Sa=0,Ca=null;function wa(e,t){if(ba===null){var n=ba=[];xa=0,Sa=Sd(),Ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return xa++,t.then(Ta,Ta),t}function Ta(){if(--xa===0&&ba!==null){Ca!==null&&(Ca.status=`fulfilled`);var e=ba;ba=null,Sa=0,Ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function A(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 Ea=D.S;D.S=function(e,t){uu=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&wa(e,t),Ea!==null&&Ea(e,t)};var Da=pe(null);function Oa(){var e=Da.current;return e===null?Gl.pooledCache:e}function ka(e,t){t===null?he(Da,Da.current):he(Da,t.pool)}function Aa(){var e=Oa();return e===null?null:{parent:_a._currentValue,pool:e}}var ja=Error(i(460)),j=Error(i(474)),Ma=Error(i(542)),Na={then:function(){}};function Pa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Fa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dn,dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,za(e),e;default:if(typeof t.status==`string`)t.then(dn,dn);else{if(e=Gl,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,za(e),e}throw La=t,ja}}function Ia(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(La=e,ja):e}}var La=null;function Ra(){if(La===null)throw Error(i(459));var e=La;return La=null,e}function za(e){if(e===ja||e===Ma)throw Error(i(483))}var Ba=null,Va=0;function Ha(e){var t=Va;return Va+=1,Ba===null&&(Ba=[]),Fa(Ba,e,t)}function Ua(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Wa(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ga(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=yi(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ci(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===te&&Ia(i)===t.type)?(t=a(t,n.props),Ua(t,n),t.return=e,t):(t=xi(n.type,n.key,n.props,null,e.mode,r),Ua(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=Ti(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=Si(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=Ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=xi(t.type,t.key,t.props,null,e.mode,n),Ua(n,t),n.return=e,n;case v:return t=Ti(t,e.mode,n),t.return=e,t;case te:return t=Ia(t),f(e,t,n)}if(ce(t)||ae(t))return t=Si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ha(t),n);if(t.$$typeof===C)return f(e,fa(e,t),n);Wa(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 g:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case te:return n=Ia(n),p(e,t,n,r)}if(ce(n)||ae(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ha(n),r);if(n.$$typeof===C)return p(e,t,fa(e,n),r);Wa(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 g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case te:return r=Ia(r),m(e,t,n,r,i)}if(ce(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ha(r),i);if(r.$$typeof===C)return m(e,t,n,fa(t,r),i);Wa(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),Wi&&Li(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 Wi&&Li(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(g.key===null?h:g.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)}),Wi&&Li(i,h),l}function _(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),Wi&&Li(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 Wi&&Li(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(v.key===null?g:v.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)}),Wi&&Li(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===te&&Ia(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ua(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=Si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=xi(o.type,o.key,o.props,null,e.mode,c),Ua(c,o),c.return=e,e=c)}return s(e);case v: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=Ti(o,e.mode,c),c.return=e,e=c}return s(e);case te:return o=Ia(o),b(e,r,o,c)}if(ce(o))return h(e,r,o,c);if(ae(o)){if(l=ae(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),_(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ha(o),c);if(o.$$typeof===C)return b(e,r,fa(e,o),c);Wa(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=Ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Va=0;var i=b(e,t,n,r);return Ba=null,i}catch(t){if(t===ja||t===Ma)throw t;var a=_i(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ka=Ga(!0),qa=Ga(!1),M=!1;function Ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ya(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 Xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=mi(e),pi(e,null,n),t}return ui(e,r,t,n),mi(e)}function Qa(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,ut(e,n)}}function $a(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 eo=!1;function to(){if(eo){var e=Ca;if(e!==null)throw e}}function no(e,t,n,r){eo=!1;var i=e.updateQueue;M=!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 p=s.lane&-536870913,m=p!==s.lane;if(m?(ql&p)===p:(r&p)===p){p!==0&&p===Sa&&(eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:M=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),tu|=o,e.lanes=o,e.memoizedState=d}}function ro(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function io(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ro(n[e],t)}var ao=pe(null),oo=pe(0);function so(e,t){e=$l,he(oo,e),he(ao,t),$l=e|t.baseLanes}function co(){he(oo,$l),he(ao,ao.current)}function lo(){$l=oo.current,me(ao),me(oo)}var uo=pe(null),fo=null;function po(e){var t=e.alternate;he(vo,vo.current&1),he(uo,e),fo===null&&(t===null||ao.current!==null||t.memoizedState!==null)&&(fo=e)}function mo(e){he(vo,vo.current),he(uo,e),fo===null&&(fo=e)}function ho(e){e.tag===22?(he(vo,vo.current),he(uo,e),fo===null&&(fo=e)):go(e)}function go(){he(vo,vo.current),he(uo,uo.current)}function _o(e){me(uo),fo===e&&(fo=null),me(vo)}var vo=pe(0);function yo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||vf(n)||yf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bo=0,N=null,P=null,xo=null,F=!1,So=!1,Co=!1,wo=0,To=0,Eo=null,Do=0;function Oo(){throw Error(i(321))}function ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jr(e[n],t[n]))return!1;return!0}function I(e,t,n,r,i,a){return bo=a,N=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?Ws:Gs,Co=!1,a=n(r,i),Co=!1,So&&(a=jo(t,n,r,i)),Ao(e),a}function Ao(e){D.H=R;var t=P!==null&&P.next!==null;if(bo=0,xo=P=N=null,F=!1,To=0,Eo=null,t)throw Error(i(300));e===null||oc||(e=e.dependencies,e!==null&&la(e)&&(oc=!0))}function jo(e,t,n,r){N=e;var a=0;do{if(So&&(Eo=null),To=0,So=!1,25<=a)throw Error(i(301));if(a+=1,xo=P=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}D.H=Ks,o=t(n,r)}while(So);return o}function Mo(){var e=D.H,t=e.useState()[0];return t=typeof t.then==`function`?zo(t):t,e=e.useState()[0],(P===null?null:P.memoizedState)!==e&&(N.flags|=1024),t}function No(){var e=wo!==0;return wo=0,e}function Po(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Fo(e){if(F){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}F=!1}bo=0,xo=P=N=null,So=!1,To=wo=0,Eo=null}function Io(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xo===null?N.memoizedState=xo=e:xo=xo.next=e,xo}function Lo(){if(P===null){var e=N.alternate;e=e===null?null:e.memoizedState}else e=P.next;var t=xo===null?N.memoizedState:xo.next;if(t!==null)xo=t,P=e;else{if(e===null)throw N.alternate===null?Error(i(467)):Error(i(310));P=e,e={memoizedState:P.memoizedState,baseState:P.baseState,baseQueue:P.baseQueue,queue:P.queue,next:null},xo===null?N.memoizedState=xo=e:xo=xo.next=e}return xo}function Ro(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zo(e){var t=To;return To+=1,Eo===null&&(Eo=[]),e=Fa(Eo,e,t),t=N,(xo===null?t.memoizedState:xo.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?Ws:Gs),e}function Bo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return zo(e);if(e.$$typeof===C)return da(e)}throw Error(i(438,String(e)))}function Vo(e){var t=null,n=N.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=N.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=Ro(),N.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]=re;return t.index++,n}function Ho(e,t){return typeof t==`function`?t(e):t}function Uo(e){return Wo(Lo(),P,e)}function Wo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(bo&f)===f:(ql&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===Sa&&(d=!0);else if((bo&p)===p){u=u.next,p===Sa&&(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,N.lanes|=p,tu|=p;f=u.action,Co&&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,N.lanes|=f,tu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!jr(o,e.memoizedState)&&(oc=!0,d&&(n=Ca,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 Go(e){var t=Lo(),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);jr(o,t.memoizedState)||(oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ko(e,t,n){var r=N,a=Lo(),o=Wi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!jr((P||a).memoizedState,n);if(s&&(a.memoizedState=n,oc=!0),a=a.queue,gs(Yo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||xo!==null&&xo.memoizedState.tag&1){if(r.flags|=2048,ds(9,{destroy:void 0},Jo.bind(null,r,a,n,t),null),Gl===null)throw Error(i(349));o||bo&127||qo(r,t,n)}return n}function qo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=N.updateQueue,t===null?(t=Ro(),N.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Jo(e,t,n,r){t.value=n,t.getSnapshot=r,Xo(t)&&L(e)}function Yo(e,t,n){return n(function(){Xo(t)&&L(e)})}function Xo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jr(e,n)}catch{return!0}}function L(e){var t=fi(e,2);t!==null&&Tu(t,e,2)}function Zo(e){var t=Io();if(typeof e==`function`){var n=e;if(e=n(),Co){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:e},t}function Qo(e,t,n,r){return e.baseState=n,Wo(e,P,typeof r==`function`?r:Ho)}function $o(e,t,n,r,a){if(Vs(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)}};D.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=D.T,o={};D.T=o;try{var s=n(i,r),c=D.S;c!==null&&c(o,s),ts(e,t,s)}catch(n){rs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),D.T=a}}else try{a=n(i,r),ts(e,t,a)}catch(n){rs(e,t,n)}}function ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ns(e,t,n)},function(n){return rs(e,t,n)}):ns(e,t,n)}function ns(e,t,n){t.status=`fulfilled`,t.value=n,is(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,es(e,n)))}function rs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,is(t),t=t.next;while(t!==r)}e.action=null}function is(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function as(e,t){return t}function os(e,t){if(Wi){var n=Gl.formState;if(n!==null){a:{var r=N;if(Wi){if(Ui){b:{for(var i=Ui,a=Ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=xf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ui=xf(i.nextSibling),r=i.data===`F!`;break a}}Ji(r)}r=!1}r&&(t=n[0])}}return n=Io(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:t},n.queue=r,n=Rs.bind(null,N,r),r.dispatch=n,r=Zo(!1),a=Bs.bind(null,N,!1,r.queue),r=Io(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=$o.bind(null,N,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ss(e){return cs(Lo(),P,e)}function cs(e,t,n){if(t=Wo(e,t,as)[0],e=Uo(Ho)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=zo(t)}catch(e){throw e===ja?Ma:e}else r=t;t=Lo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(N.flags|=2048,ds(9,{destroy:void 0},ls.bind(null,i,n),null)),[r,a,e]}function ls(e,t){e.action=t}function us(e){var t=Lo(),n=P;if(n!==null)return cs(t,n,e);Lo(),t=t.memoizedState,n=Lo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ds(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=N.updateQueue,t===null&&(t=Ro(),N.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 fs(){return Lo().memoizedState}function ps(e,t,n,r){var i=Io();N.flags|=e,i.memoizedState=ds(1|t,{destroy:void 0},n,r===void 0?null:r)}function ms(e,t,n,r){var i=Lo();r=r===void 0?null:r;var a=i.memoizedState.inst;P!==null&&r!==null&&ko(r,P.memoizedState.deps)?i.memoizedState=ds(t,a,n,r):(N.flags|=e,i.memoizedState=ds(1|t,a,n,r))}function hs(e,t){ps(8390656,8,e,t)}function gs(e,t){ms(2048,8,e,t)}function _s(e){N.flags|=4;var t=N.updateQueue;if(t===null)t=Ro(),N.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function vs(e){var t=Lo().memoizedState;return _s({ref:t,nextImpl:e}),function(){if(Wl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ys(e,t){return ms(4,2,e,t)}function bs(e,t){return ms(4,4,e,t)}function xs(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 Ss(e,t,n){n=n==null?null:n.concat([e]),ms(4,4,xs.bind(null,t,e),n)}function Cs(){}function ws(e,t){var n=Lo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ts(e,t){var n=Lo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ko(t,r[1]))return r[0];if(r=e(),Co){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Es(e,t,n){return n===void 0||bo&1073741824&&!(ql&261930)?e.memoizedState=t:(e.memoizedState=n,e=wu(),N.lanes|=e,tu|=e,n)}function Ds(e,t,n,r){return jr(n,t)?n:ao.current===null?!(bo&42)||bo&1073741824&&!(ql&261930)?(oc=!0,e.memoizedState=n):(e=wu(),N.lanes|=e,tu|=e,t):(e=Es(e,n,r),jr(e,t)||(oc=!0),e)}function Os(e,t,n,r,i){var a=le.p;le.p=a!==0&&8>a?a:8;var o=D.T,s={};D.T=s,Bs(e,!1,t,n);try{var c=i(),l=D.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?zs(e,t,A(c,r),Cu(e)):zs(e,t,r,Cu(e))}catch(n){zs(e,t,{then:function(){},status:`rejected`,reason:n},Cu())}finally{le.p=a,o!==null&&s.types!==null&&(o.types=s.types),D.T=o}}function ks(){}function As(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=js(e).queue;Os(e,a,t,ue,n===null?ks:function(){return Ms(e),n(r)})}function js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ms(e){var t=js(e);t.next===null&&(t=e.alternate.memoizedState),zs(e,t.next.queue,{},Cu())}function Ns(){return da(dp)}function Ps(){return Lo().memoizedState}function Fs(){return Lo().memoizedState}function Is(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=Xa(n);var r=Za(t,e,n);r!==null&&(Tu(r,t,n),Qa(r,t,n)),t={cache:va()},e.payload=t;return}t=t.return}}function Ls(e,t,n){var r=Cu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Hs(t,n):(n=di(e,t,n,r),n!==null&&(Tu(n,e,r),Us(n,t,r)))}function Rs(e,t,n){zs(e,t,n,Cu())}function zs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Hs(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,jr(s,o))return ui(e,t,i,0),Gl===null&&li(),!1}catch{}if(n=di(e,t,i,r),n!==null)return Tu(n,e,r),Us(n,t,r),!0}return!1}function Bs(e,t,n,r){if(r={lane:2,revertLane:Sd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(i(479))}else t=di(e,n,r,2),t!==null&&Tu(t,e,2)}function Vs(e){var t=e.alternate;return e===N||t!==null&&t===N}function Hs(e,t){So=F=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Us(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var R={readContext:da,use:Bo,useCallback:Oo,useContext:Oo,useEffect:Oo,useImperativeHandle:Oo,useLayoutEffect:Oo,useInsertionEffect:Oo,useMemo:Oo,useReducer:Oo,useRef:Oo,useState:Oo,useDebugValue:Oo,useDeferredValue:Oo,useTransition:Oo,useSyncExternalStore:Oo,useId:Oo,useHostTransitionStatus:Oo,useFormState:Oo,useActionState:Oo,useOptimistic:Oo,useMemoCache:Oo,useCacheRefresh:Oo};R.useEffectEvent=Oo;var Ws={readContext:da,use:Bo,useCallback:function(e,t){return Io().memoizedState=[e,t===void 0?null:t],e},useContext:da,useEffect:hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ps(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var n=Io();t=t===void 0?null:t;var r=e();if(Co){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Io();if(n!==void 0){var i=n(t);if(Co){qe(!0);try{n(t)}finally{qe(!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=Ls.bind(null,N,e),[r.memoizedState,e]},useRef:function(e){var t=Io();return e={current:e},t.memoizedState=e},useState:function(e){e=Zo(e);var t=e.queue,n=Rs.bind(null,N,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cs,useDeferredValue:function(e,t){return Es(Io(),e,t)},useTransition:function(){var e=Zo(!1);return e=Os.bind(null,N,e.queue,!0,!1),Io().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=N,a=Io();if(Wi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Gl===null)throw Error(i(349));ql&127||qo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,hs(Yo.bind(null,r,o,e),[e]),r.flags|=2048,ds(9,{destroy:void 0},Jo.bind(null,r,o,n,t),null),n},useId:function(){var e=Io(),t=Gl.identifierPrefix;if(Wi){var n=Ii,r=Fi;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Do++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ns,useFormState:os,useActionState:os,useOptimistic:function(e){var t=Io();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bs.bind(null,N,!0,n),n.dispatch=t,[e,t]},useMemoCache:Vo,useCacheRefresh:function(){return Io().memoizedState=Is.bind(null,N)},useEffectEvent:function(e){var t=Io(),n={impl:e};return t.memoizedState=n,function(){if(Wl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Gs={readContext:da,use:Bo,useCallback:ws,useContext:da,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Uo,useRef:fs,useState:function(){return Uo(Ho)},useDebugValue:Cs,useDeferredValue:function(e,t){return Ds(Lo(),P.memoizedState,e,t)},useTransition:function(){var e=Uo(Ho)[0],t=Lo().memoizedState;return[typeof e==`boolean`?e:zo(e),t]},useSyncExternalStore:Ko,useId:Ps,useHostTransitionStatus:Ns,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){return Qo(Lo(),P,e,t)},useMemoCache:Vo,useCacheRefresh:Fs};Gs.useEffectEvent=vs;var Ks={readContext:da,use:Bo,useCallback:ws,useContext:da,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Go,useRef:fs,useState:function(){return Go(Ho)},useDebugValue:Cs,useDeferredValue:function(e,t){var n=Lo();return P===null?Es(n,e,t):Ds(n,P.memoizedState,e,t)},useTransition:function(){var e=Go(Ho)[0],t=Lo().memoizedState;return[typeof e==`boolean`?e:zo(e),t]},useSyncExternalStore:Ko,useId:Ps,useHostTransitionStatus:Ns,useFormState:us,useActionState:us,useOptimistic:function(e,t){var n=Lo();return P===null?(n.baseState=e,[e,n.queue.dispatch]):Qo(n,P,e,t)},useMemoCache:Vo,useCacheRefresh:Fs};Ks.useEffectEvent=vs;function qs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Js={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Xa(r);i.payload=t,n!=null&&(i.callback=n),t=Za(e,i,r),t!==null&&(Tu(t,e,r),Qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Xa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Za(e,i,r),t!==null&&(Tu(t,e,r),Qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cu(),r=Xa(n);r.tag=2,t!=null&&(r.callback=t),t=Za(e,r,n),t!==null&&(Tu(t,e,n),Qa(t,e,n))}};function Ys(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?!Mr(n,r)||!Mr(i,a):!0}function Xs(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&&Js.enqueueReplaceState(t,t.state,null)}function Zs(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=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Qs(e){ai(e)}function $s(e){console.error(e)}function ec(e){ai(e)}function tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function nc(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 rc(e,t,n){return n=Xa(n),n.tag=3,n.payload={element:null},n.callback=function(){tc(e,t)},n}function ic(e){return e=Xa(e),e.tag=3,e}function ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){nc(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function z(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=uo.current,n!==null){switch(n.tag){case 31:case 13:return fo===null?Lu():n.alternate===null&&eu===0&&(eu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Na?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),nd(e,r,a)),!1;case 22:return n.flags|=65536,r===Na?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)),nd(e,r,a)),!1}throw Error(i(435,n.tag))}return nd(e,r,a),Lu(),!1}if(Wi)return t=uo.current,t===null?(r!==qi&&(t=Error(i(423),{cause:r}),ea(Di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Di(r,n),a=rc(e.stateNode,r,a),$a(e,a),eu!==4&&(eu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==qi&&(e=Error(i(422),{cause:r}),ea(Di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Di(o,n),ou===null?ou=[o]:ou.push(o),eu!==4&&(eu=2),t===null)return!0;r=Di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=rc(n.stateNode,r,e),$a(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`&&(pu===null||!pu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ic(a),ac(a,e,n,r),$a(n,a),!1}n=n.return}while(n!==null);return!1}var B=Error(i(461)),oc=!1;function sc(e,t,n,r){t.child=e===null?qa(t,null,n,r):Ka(t,e.child,n,r)}function cc(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 ua(t),r=I(e,t,n,o,a,i),s=No(),e!==null&&!oc?(Po(e,t,i),Mc(e,t,i)):(Wi&&s&&zi(t),t.flags|=1,sc(e,t,r,i),t.child)}function lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!vi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,uc(e,t,a,r,i)):(e=xi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Nc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Mr:n,n(o,r)&&e.ref===t.ref)return Mc(e,t,i)}return t.flags|=1,e=yi(a,r),e.ref=t.ref,e.return=t,t.child=e}function uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mr(a,r)&&e.ref===t.ref)if(oc=!1,t.pendingProps=r=a,Nc(e,i))e.flags&131072&&(oc=!0);else return t.lanes=e.lanes,Mc(e,t,i)}return vc(e,t,n,r,i)}function dc(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 pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ka(t,a===null?null:a.cachePool),a===null?co():so(t,a),ho(t);else return r=t.lanes=536870912,pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ka(t,null),co(),go(t)):(ka(t,a.cachePool),so(t,a),go(t),t.memoizedState=null);return sc(e,t,i,n),t.child}function fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function pc(e,t,n,r,i){var a=Oa();return a=a===null?null:{parent:_a._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ka(t,null),co(),ho(t),e!==null&&ca(e,t,r,!0),t.childLanes=i,null}function mc(e,t){return t=Dc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hc(e,t,n){return Ka(t,e.child,null,n),e=mc(t,t.pendingProps),e.flags|=2,_o(t),t.memoizedState=null,e}function gc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Wi){if(r.mode===`hidden`)return e=mc(t,r),t.lanes=536870912,fc(null,e);if(mo(t),(e=Ui)?(e=_f(e,Ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,Ui=null)):e=null,e===null)throw Ji(t);return t.lanes=536870912,null}return mc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(mo(t),a)if(t.flags&256)t.flags&=-257,t=hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(oc||ca(e,t,n,!1),a=(n&e.childLanes)!==0,oc||a){if(r=Gl,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,fi(e,s),Tu(r,e,s),B;Lu(),t=hc(e,t,n)}else e=o.treeContext,Ui=xf(s.nextSibling),Hi=t,Wi=!0,Gi=null,Ki=!1,e!==null&&Vi(t,e),t=mc(t,r),t.flags|=4096;return t}return e=yi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _c(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 vc(e,t,n,r,i){return ua(t),n=I(e,t,n,r,void 0,i),r=No(),e!==null&&!oc?(Po(e,t,i),Mc(e,t,i)):(Wi&&r&&zi(t),t.flags|=1,sc(e,t,n,i),t.child)}function yc(e,t,n,r,i,a){return ua(t),t.updateQueue=null,n=jo(t,r,n,i),Ao(e),r=No(),e!==null&&!oc?(Po(e,t,a),Mc(e,t,a)):(Wi&&r&&zi(t),t.flags|=1,sc(e,t,n,a),t.child)}function bc(e,t,n,r,i){if(ua(t),t.stateNode===null){var a=hi,o=n.contextType;typeof o==`object`&&o&&(a=da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Js,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ja(t),o=n.contextType,a.context=typeof o==`object`&&o?da(o):hi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(qs(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&&Js.enqueueReplaceState(a,a.state,null),no(t,r,a,i),to(),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=Zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=hi,typeof u==`object`&&u&&(o=da(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)&&Xs(t,a,r,o),M=!1;var f=t.memoizedState;a.state=f,no(t,r,a,i),to(),l=t.memoizedState,s||f!==l||M?(typeof d==`function`&&(qs(t,n,d,r),l=t.memoizedState),(c=M||Ys(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,Ya(e,t),o=t.memoizedProps,u=Zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=hi,typeof l==`object`&&l&&(c=da(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)&&Xs(t,a,r,c),M=!1,f=t.memoizedState,a.state=f,no(t,r,a,i),to();var p=t.memoizedState;o!==d||f!==p||M||e!==null&&e.dependencies!==null&&la(e.dependencies)?(typeof s==`function`&&(qs(t,n,s,r),p=t.memoizedState),(u=M||Ys(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&la(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,_c(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ka(t,e.child,null,i),t.child=Ka(t,null,n,i)):sc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Mc(e,t,i),e}function xc(e,t,n,r){return Qi(),t.flags|=256,sc(e,t,n,r),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:Aa()}}function wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=iu),e}function Tc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(vo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Wi){if(a?po(t):go(t),(e=Ui)?(e=_f(e,Ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,Ui=null)):e=null,e===null)throw Ji(t);return yf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(go(t),a=t.mode,c=Dc({mode:`hidden`,children:c},a),r=Si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(null,r)):(po(t),Ec(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(po(t),t.flags&=-257,t=Oc(e,t,n)):t.memoizedState===null?(go(t),c=r.fallback,a=t.mode,r=Dc({mode:`visible`,children:r.children},a),c=Si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ka(t,e.child,null,n),r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,t=fc(null,r)):(go(t),t.child=e.child,t.flags|=128,t=null);else if(po(t),yf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,ea({value:r,source:null,stack:null}),t=Oc(e,t,n)}else if(oc||ca(e,t,n,!1),s=(n&e.childLanes)!==0,oc||s){if(s=Gl,s!==null&&(r=dt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,fi(e,r),Tu(s,e,r),B;vf(c)||Lu(),t=Oc(e,t,n)}else vf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ui=xf(c.nextSibling),Hi=t,Wi=!0,Gi=null,Ki=!1,e!==null&&Vi(t,e),t=Ec(t,r.children),t.flags|=4096);return t}return a?(go(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=yi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=Si(c,a,n,null),c.flags|=2):c=yi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,fc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Cc(n):(a=c.cachePool,a===null?a=Aa():(l=_a._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(e.child,r)):(po(t),n=e.child,e=n.sibling,n=yi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Ec(e,t){return t=Dc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Dc(e,t){return e=_i(22,e,null,t),e.lanes=0,e}function Oc(e,t,n){return Ka(t,e.child,null,n),e=Ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),oa(e.return,t,n)}function Ac(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 jc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=vo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,he(vo,o),sc(e,t,r,n),r=Wi?ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kc(e,n,t);else if(e.tag===19)kc(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`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&yo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&yo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,a,r);break;case`together`:Ac(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Mc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tu|=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=yi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&la(e))):!0}function Pc(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),ia(t,_a,e.memoizedState.cache),Qi();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:ia(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(po(t),e=Mc(e,t,n),e===null?null:e.sibling):Tc(e,t,n):(po(t),t.flags|=128,null);po(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return jc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),he(vo,vo.current),r)break;return null;case 22:return t.lanes=0,dc(e,t,n,t.pendingProps);case 24:ia(t,_a,e.memoizedState.cache)}return Mc(e,t,n)}function Fc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)oc=!0;else{if(!Nc(e,n)&&!(t.flags&128))return oc=!1,Pc(e,t,n);oc=!!(e.flags&131072)}else oc=!1,Wi&&t.flags&1048576&&Ri(t,ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e==`function`)vi(e)?(r=Zs(e,r),t.tag=1,t=bc(null,t,e,r,n)):(t.tag=0,t=vc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=cc(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=lc(null,t,e,r,n);break a}}throw t=se(e)||e,Error(i(306,t,``))}}return t;case 0:return vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Zs(r,t.pendingProps),bc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ya(e,t),no(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ia(t,_a,r),r!==o.cache&&sa(t,[_a],n,!0),to(),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=xc(e,t,r,n);break a}else if(r!==a){a=Di(Error(i(424)),t),ea(a),t=xc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ui=xf(e.firstChild),Hi=t,Wi=!0,Gi=null,Ki=!0,n=qa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Qi(),r===a){t=Mc(e,t,n);break a}sc(e,t,r,n)}t=t.child}return t;case 26:return _c(e,t),e===null?(n=Hf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Wi||(n=t.type,e=t.pendingProps,r=$d(ve.current).createElement(n),r[_t]=t,r[vt]=e,qd(r,n,e),At(r),t.stateNode=r):t.memoizedState=Hf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&Wi&&(r=t.stateNode=Tf(t.type,t.pendingProps,ve.current),Hi=t,Ki=!0,a=Ui,df(t.type)?(Sf=a,Ui=xf(r.firstChild)):Ui=a),sc(e,t,t.pendingProps.children,n),_c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Wi&&((a=r=Ui)&&(r=hf(r,t.type,t.pendingProps,Ki),r===null?a=!1:(t.stateNode=r,Hi=t,Ui=xf(r.firstChild),Ki=!1,a=!0)),a||Ji(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,nf(a,o)?r=null:s!==null&&nf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=I(e,t,Mo,null,null,n),dp._currentValue=a),_c(e,t),sc(e,t,r,n),t.child;case 6:return e===null&&Wi&&((e=n=Ui)&&(n=gf(n,t.pendingProps,Ki),n===null?e=!1:(t.stateNode=n,Hi=t,Ui=null,e=!0)),e||Ji(t)),null;case 13:return Tc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ka(t,null,r,n):sc(e,t,r,n),t.child;case 11:return cc(e,t,t.type,t.pendingProps,n);case 7:return sc(e,t,t.pendingProps,n),t.child;case 8:return sc(e,t,t.pendingProps.children,n),t.child;case 12:return sc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ia(t,t.type,r.value),sc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ua(t),a=da(a),r=r(a),t.flags|=1,sc(e,t,r,n),t.child;case 14:return lc(e,t,t.type,t.pendingProps,n);case 15:return uc(e,t,t.type,t.pendingProps,n);case 19:return jc(e,t,n);case 31:return gc(e,t,n);case 22:return dc(e,t,n,t.pendingProps);case 24:return ua(t),r=da(_a),e===null?(a=Oa(),a===null&&(a=Gl,o=va(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ja(t),ia(t,_a,a)):((e.lanes&n)!==0&&(Ya(e,t),no(t,null,null,n),to()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ia(t,_a,r),r!==a.cache&&sa(t,[_a],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ia(t,_a,r))),sc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ic(e){e.flags|=4}function Lc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Pu())e.flags|=8192;else throw La=Na,j}else e.flags&=-16777217}function Rc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rp(t))if(Pu())e.flags|=8192;else throw La=Na,j}function zc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,au|=t)}function Bc(e,t){if(!Wi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var 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}}function Vc(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&65011712,r|=i.flags&65011712,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 Hc(e,t,n){var r=t.pendingProps;switch(Bi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vc(t),null;case 1:return Vc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),aa(_a),xe(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Zi(t)?Ic(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$i())),Vc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ic(t),o===null?(Vc(t),Lc(t,a,null,r,n)):(Vc(t),Rc(t,o))):o?o===e.memoizedState?(Vc(t),t.flags&=-16777217):(Ic(t),Vc(t),Rc(t,o)):(e=e.memoizedProps,e!==r&&Ic(t),Vc(t),Lc(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}e=ge.current,Zi(t)?Yi(t,e):(e=Tf(a,r,n),t.stateNode=e,Ic(t))}return Vc(t),null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}if(o=ge.current,Zi(t))Yi(t,o);else{var s=$d(ve.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[_t]=t,o[vt]=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(qd(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&&Ic(t)}}return Vc(t),Lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,Zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Hi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Wd(e.nodeValue,n)),e||Ji(t,!0)}else e=$d(e).createTextNode(r),e[_t]=t,t.stateNode=e}return Vc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Zi(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[_t]=t}else Qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),e=!1}else n=$i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(_o(t),t):(_o(t),null);if(t.flags&128)throw Error(i(558))}return Vc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Zi(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[_t]=t}else Qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),a=!1}else a=$i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(_o(t),t):(_o(t),null)}return _o(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),zc(t,t.updateQueue),Vc(t),null);case 4:return xe(),e===null&&Pd(t.stateNode.containerInfo),Vc(t),null;case 10:return aa(t.type),Vc(t),null;case 19:if(me(vo),r=t.memoizedState,r===null)return Vc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Bc(r,!1);else{if(eu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=yo(e),o!==null){for(t.flags|=128,Bc(r,!1),e=o.updateQueue,t.updateQueue=e,zc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bi(n,e),n=n.sibling;return he(vo,vo.current&1|2),Wi&&Li(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>du&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304)}else{if(!a)if(e=yo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,zc(t,e),Bc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Wi)return Vc(t),null}else 2*Ie()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,a=!0,Bc(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)}return r.tail===null?(Vc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,n=vo.current,he(vo,a?n&1|2:n&1),Wi&&Li(t,r.treeForkCount),e);case 22:case 23:return _o(t),lo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Vc(t),t.subtreeFlags&6&&(t.flags|=8192)):Vc(t),n=t.updateQueue,n!==null&&zc(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&&me(Da),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),aa(_a),Vc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Uc(e,t){switch(Bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(_a),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(_o(t),t.alternate===null)throw Error(i(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_o(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(vo),null;case 4:return xe(),null;case 10:return aa(t.type),null;case 22:case 23:return _o(t),lo(),e!==null&&me(Da),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return aa(_a),null;case 25:return null;default:return null}}function Wc(e,t){switch(Bi(t),t.tag){case 3:aa(_a),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&_o(t);break;case 13:_o(t);break;case 19:me(vo);break;case 10:aa(t.type);break;case 22:case 23:_o(t),lo(),e!==null&&me(Da);break;case 24:aa(_a)}}function Gc(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){td(t,t.return,e)}}function Kc(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){td(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){td(t,t.return,e)}}function qc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{io(t,n)}catch(t){td(e,e.return,t)}}}function Jc(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){td(e,t,n)}}function Yc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){td(e,t,n)}}function Xc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){td(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){td(e,t,n)}else n.current=null}function Zc(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){td(e,e.return,t)}}function Qc(e,t,n){try{var r=e.stateNode;Jd(r,e.type,n,t),r[vt]=t}catch(t){td(e,e.return,t)}}function $c(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&df(e.type)||e.tag===4}function el(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||$c(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&&df(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 tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=dn));else if(r!==4&&(r===27&&df(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&df(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),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]);qd(t,r,n),t[_t]=e,t[vt]=n}catch(t){td(e,e.return,t)}}var il=!1,al=!1,ol=!1,sl=typeof WeakSet==`function`?WeakSet:Set,cl=null;function ll(e,t){if(e=e.containerInfo,Zd=bp,e=Ir(e),Lr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Qd={focusedElem:e,selectionRange:n},bp=!1,cl=t;cl!==null;)if(t=cl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,cl=e;else for(;cl!==null;){switch(t=cl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){td(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:mf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,cl=e;break}cl=t.return}}function ul(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Tl(e,n),r&4&&Gc(5,n);break;case 1:if(Tl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){td(n,n.return,e)}else{var i=Zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){td(n,n.return,e)}}r&64&&qc(n),r&512&&Yc(n,n.return);break;case 3:if(Tl(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{io(e,t)}catch(e){td(n,n.return,e)}}break;case 27:t===null&&r&4&&rl(n);case 26:case 5:Tl(e,n),t===null&&r&4&&Zc(n),r&512&&Yc(n,n.return);break;case 12:Tl(e,n);break;case 31:Tl(e,n),r&4&&gl(e,n);break;case 13:Tl(e,n),r&4&&_l(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ad.bind(null,n),bf(e,n))));break;case 22:if(r=n.memoizedState!==null||il,!r){t=t!==null&&t.memoizedState!==null||al,i=il;var a=al;il=r,(al=t)&&!a?Dl(e,n,(n.subtreeFlags&8772)!=0):Tl(e,n),il=i,al=a}break;case 30:break;default:Tl(e,n)}}function dl(e){var t=e.alternate;t!==null&&(e.alternate=null,dl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(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 fl=null,pl=!1;function ml(e,t,n){for(n=n.child;n!==null;)hl(e,t,n),n=n.sibling}function hl(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:al||Xc(n,t),ml(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:al||Xc(n,t);var r=fl,i=pl;df(n.type)&&(fl=n.stateNode,pl=!1),ml(e,t,n),Ef(n.stateNode),fl=r,pl=i;break;case 5:al||Xc(n,t);case 6:if(r=fl,i=pl,fl=null,ml(e,t,n),fl=r,pl=i,fl!==null)if(pl)try{(fl.nodeType===9?fl.body:fl.nodeName===`HTML`?fl.ownerDocument.body:fl).removeChild(n.stateNode)}catch(e){td(n,t,e)}else try{fl.removeChild(n.stateNode)}catch(e){td(n,t,e)}break;case 18:fl!==null&&(pl?(e=fl,ff(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Kp(e)):ff(fl,n.stateNode));break;case 4:r=fl,i=pl,fl=n.stateNode.containerInfo,pl=!0,ml(e,t,n),fl=r,pl=i;break;case 0:case 11:case 14:case 15:Kc(2,n,t),al||Kc(4,n,t),ml(e,t,n);break;case 1:al||(Xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Jc(n,t,r)),ml(e,t,n);break;case 21:ml(e,t,n);break;case 22:al=(r=al)||n.memoizedState!==null,ml(e,t,n),al=r;break;default:ml(e,t,n)}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kp(e)}catch(e){td(t,t.return,e)}}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kp(e)}catch(e){td(t,t.return,e)}}function vl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sl),t;default:throw Error(i(435,e.tag))}}function yl(e,t){var n=vl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=od.bind(null,e,t);t.then(r,r)}})}function bl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(df(c.type)){fl=c.stateNode,pl=!1;break a}break;case 5:fl=c.stateNode,pl=!1;break a;case 3:case 4:fl=c.stateNode.containerInfo,pl=!0;break a}c=c.return}if(fl===null)throw Error(i(160));hl(o,s,a),fl=null,pl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sl(t,e),t=t.sibling}var xl=null;function Sl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bl(t,e),Cl(e),r&4&&(Kc(3,e,e.return),Gc(3,e),Kc(5,e,e.return));break;case 1:bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),r&64&&il&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=xl;if(bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[wt]||o[_t]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),qd(o,r,n),o[_t]=e,At(o),r=o;break a;case`link`:var s=ep(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),qd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=ep(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),qd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[_t]=e,At(o),r=o}e.stateNode=r}else tp(a,e.type,e.stateNode);else e.stateNode=Yf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?tp(a,e.type,e.stateNode):Yf(a,r,e.memoizedProps))}break;case 27:bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),n!==null&&r&4&&Qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),e.flags&32){a=e.stateNode;try{nn(a,``)}catch(t){td(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(ol=!0);break;case 6:if(bl(t,e),Cl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){td(e,e.return,t)}}break;case 3:if($f=null,a=xl,xl=kf(t.containerInfo),bl(t,e),xl=a,Cl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Kp(t.containerInfo)}catch(t){td(e,e.return,t)}ol&&(ol=!1,wl(e));break;case 4:r=xl,xl=kf(e.stateNode.containerInfo),bl(t,e),Cl(e),xl=r;break;case 12:bl(t,e),Cl(e);break;case 31:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 13:bl(t,e),Cl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lu=Ie()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=il,d=al;if(il=u||a,al=d||l,bl(t,e),al=d,il=u,Cl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||il||al||El(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){td(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){td(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?pf(m,!0):pf(l.stateNode,!1)}catch(e){td(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,yl(e,n))));break;case 19:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 30:break;case 21:break;default:bl(t,e),Cl(e)}}function Cl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if($c(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;nl(e,el(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(nn(o,``),n.flags&=-33),nl(e,el(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;tl(e,el(e),s);break;default:throw Error(i(161))}}catch(t){td(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Tl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ul(e,t.alternate,t),t=t.sibling}function El(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kc(4,t,t.return),El(t);break;case 1:Xc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Jc(t,t.return,n),El(t);break;case 27:Ef(t.stateNode);case 26:case 5:Xc(t,t.return),El(t);break;case 22:t.memoizedState===null&&El(t);break;case 30:El(t);break;default:El(t)}e=e.sibling}}function Dl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Dl(i,a,n),Gc(4,a);break;case 1:if(Dl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){td(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)ro(c[i],s)}catch(e){td(r,r.return,e)}}n&&o&64&&qc(a),Yc(a,a.return);break;case 27:rl(a);case 26:case 5:Dl(i,a,n),n&&r===null&&o&4&&Zc(a),Yc(a,a.return);break;case 12:Dl(i,a,n);break;case 31:Dl(i,a,n),n&&o&4&&gl(i,a);break;case 13:Dl(i,a,n),n&&o&4&&_l(i,a);break;case 22:a.memoizedState===null&&Dl(i,a,n),Yc(a,a.return);break;case 30:break;default:Dl(i,a,n)}t=t.sibling}}function Ol(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&&ya(n))}function kl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ya(e))}function Al(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jl(e,t,n,r),t=t.sibling}function jl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Al(e,t,n,r),i&2048&&Gc(9,t);break;case 1:Al(e,t,n,r);break;case 3:Al(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ya(e)));break;case 12:if(i&2048){Al(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){td(t,t.return,e)}}else Al(e,t,n,r);break;case 31:Al(e,t,n,r);break;case 13:Al(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Al(e,t,n,r):(a._visibility|=2,Ml(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Al(e,t,n,r):Nl(e,t),i&2048&&Ol(o,t);break;case 24:Al(e,t,n,r),i&2048&&kl(t.alternate,t);break;default:Al(e,t,n,r)}}function Ml(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Ml(a,o,s,c,i),Gc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ml(a,o,s,c,i)):u._visibility&2?Ml(a,o,s,c,i):Nl(a,o),i&&l&2048&&Ol(o.alternate,o);break;case 24:Ml(a,o,s,c,i),i&&l&2048&&kl(o.alternate,o);break;default:Ml(a,o,s,c,i)}t=t.sibling}}function Nl(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:Nl(n,r),i&2048&&Ol(r.alternate,r);break;case 24:Nl(n,r),i&2048&&kl(r.alternate,r);break;default:Nl(n,r)}t=t.sibling}}var Pl=8192;function Fl(e,t,n){if(e.subtreeFlags&Pl)for(e=e.child;e!==null;)Il(e,t,n),e=e.sibling}function Il(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Pl&&e.memoizedState!==null&&ip(n,xl,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var r=xl;xl=kf(e.stateNode.containerInfo),Fl(e,t,n),xl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Pl,Pl=16777216,Fl(e,t,n),Pl=r):Fl(e,t,n));break;default:Fl(e,t,n)}}function Ll(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 Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cl=r,Vl(r,e)}Ll(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zl(e),e=e.sibling}function zl(e){switch(e.tag){case 0:case 11:case 15:Rl(e),e.flags&2048&&Kc(9,e,e.return);break;case 3:Rl(e);break;case 12:Rl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Bl(e)):Rl(e);break;default:Rl(e)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cl=r,Vl(r,e)}Ll(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kc(8,t,t.return),Bl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Bl(t));break;default:Bl(t)}e=e.sibling}}function Vl(e,t){for(;cl!==null;){var n=cl;switch(n.tag){case 0:case 11:case 15:Kc(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:ya(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cl=r;else a:for(n=e;cl!==null;){r=cl;var i=r.sibling,a=r.return;if(dl(r),r===n){cl=null;break a}if(i!==null){i.return=a,cl=i;break a}cl=a}}}var Hl={getCacheForType:function(e){var t=da(_a),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return da(_a).controller.signal}},Ul=typeof WeakMap==`function`?WeakMap:Map,Wl=0,Gl=null,Kl=null,ql=0,Jl=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=null,su=null,cu=!1,lu=0,uu=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,yu=null,bu=null,xu=0,Su=null;function Cu(){return Wl&2&&ql!==0?ql&-ql:D.T===null?mt():Sd()}function wu(){if(iu===0)if(!(ql&536870912)||Wi){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),iu=e}else iu=536870912;return e=uo.current,e!==null&&(e.flags|=32),iu}function Tu(e,t,n){(e===Gl&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)&&(Mu(e,0),ku(e,ql,iu,!1)),st(e,n),(!(Wl&2)||e!==Gl)&&(e===Gl&&(!(Wl&2)&&(nu|=n),eu===4&&ku(e,ql,iu,!1)),md(e))}function Eu(e,t,n){if(Wl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||rt(e,t),a=r?Bu(e,t):Ru(e,t,!0),o=r;do{if(a===0){Zl&&!r&&ku(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Ou(n)){a=Ru(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=ou;var l=c.current.memoizedState.isDehydrated;if(l&&(Mu(c,s).flags|=256),s=Ru(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,nu|=o,a=4;break a}o=su,su=a,o!==null&&(su===null?su=o:su.push.apply(su,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Mu(e,0),ku(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)break;case 6:ku(r,t,iu,!Xl);break a;case 2:su=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=lu+300-Ie(),10<a)){if(ku(r,t,iu,!Xl),nt(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=of(Du.bind(null,r,n,su,fu,cu,t,iu,nu,au,Xl,o,`Throttled`,-0,0),a);break a}Du(r,n,su,fu,cu,t,iu,nu,au,Xl,o,null,-0,0)}}break}while(1);md(e)}function Du(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dn},Il(t,a,d);var m=(a&62914560)===a?lu-Ie():(a&4194048)===a?uu-Ie():0;if(m=op(d,m),m!==null){_u=a,e.cancelPendingCommit=m(qu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ku(e,a,o,!l);return}}qu(e,t,a,n,r,i,o,s,c)}function Ou(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(!jr(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 ku(e,t,n,r){t&=~ru,t&=~nu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&<(e,n,t)}function Au(){return Wl&6?!0:(hd(0,!1),!1)}function ju(){if(Kl!==null){if(Jl===0)var e=Kl.return;else e=Kl,ra=na=null,Fo(e),Ba=null,Va=0,e=Kl;for(;e!==null;)Wc(e.alternate,e),e=e.return;Kl=null}}function Mu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,sf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,ju(),Gl=e,Kl=n=yi(e.current,null),ql=t,Jl=0,Yl=null,Xl=!1,Zl=rt(e,t),Ql=!1,au=iu=ru=nu=tu=eu=0,su=ou=null,cu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Je(r),a=1<<i;t|=e[i],r&=~a}return $l=t,li(),n}function Nu(e,t){N=null,D.H=R,t===ja||t===Ma?(t=Ra(),Jl=3):t===j?(t=Ra(),Jl=4):Jl=t===B?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,Kl===null&&(eu=1,tc(e,Di(t,e.current)))}function Pu(){var e=uo.current;return e===null?!0:(ql&4194048)===ql?fo===null:(ql&62914560)===ql||ql&536870912?e===fo:!1}function Fu(){var e=D.H;return D.H=R,e===null?R:e}function Iu(){var e=D.A;return D.A=Hl,e}function Lu(){eu=4,Xl||(ql&4194048)!==ql&&uo.current!==null||(Zl=!0),!(tu&134217727)&&!(nu&134217727)||Gl===null||ku(Gl,ql,iu,!1)}function Ru(e,t,n){var r=Wl;Wl|=2;var i=Fu(),a=Iu();(Gl!==e||ql!==t)&&(fu=null,Mu(e,t)),t=!1;var o=eu;a:do try{if(Jl!==0&&Kl!==null){var s=Kl,c=Yl;switch(Jl){case 8:ju(),o=6;break a;case 3:case 2:case 9:case 6:uo.current===null&&(t=!0);var l=Jl;if(Jl=0,Yl=null,Wu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=Jl,Jl=0,Yl=null,Wu(e,s,c,l)}}zu(),o=eu;break}catch(t){Nu(e,t)}while(1);return t&&e.shellSuspendCounter++,ra=na=null,Wl=r,D.H=i,D.A=a,Kl===null&&(Gl=null,ql=0,li()),o}function zu(){for(;Kl!==null;)Hu(Kl)}function Bu(e,t){var n=Wl;Wl|=2;var r=Fu(),a=Iu();Gl!==e||ql!==t?(fu=null,du=Ie()+500,Mu(e,t)):Zl=rt(e,t);a:do try{if(Jl!==0&&Kl!==null){t=Kl;var o=Yl;b:switch(Jl){case 1:Jl=0,Yl=null,Wu(e,t,o,1);break;case 2:case 9:if(Pa(o)){Jl=0,Yl=null,Uu(t);break}t=function(){Jl!==2&&Jl!==9||Gl!==e||(Jl=7),md(e)},o.then(t,t);break a;case 3:Jl=7;break a;case 4:Jl=5;break a;case 7:Pa(o)?(Jl=0,Yl=null,Uu(t)):(Jl=0,Yl=null,Wu(e,t,o,7));break;case 5:var s=null;switch(Kl.tag){case 26:s=Kl.memoizedState;case 5:case 27:var c=Kl;if(s?rp(s):c.stateNode.complete){Jl=0,Yl=null;var l=c.sibling;if(l!==null)Kl=l;else{var u=c.return;u===null?Kl=null:(Kl=u,Gu(u))}break b}}Jl=0,Yl=null,Wu(e,t,o,5);break;case 6:Jl=0,Yl=null,Wu(e,t,o,6);break;case 8:ju(),eu=6;break a;default:throw Error(i(462))}}Vu();break}catch(t){Nu(e,t)}while(1);return ra=na=null,D.H=r,D.A=a,Wl=n,Kl===null?(Gl=null,ql=0,li(),eu):0}function Vu(){for(;Kl!==null&&!Pe();)Hu(Kl)}function Hu(e){var t=Fc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Gu(e):Kl=t}function Uu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=yc(n,t,t.pendingProps,t.type,void 0,ql);break;case 11:t=yc(n,t,t.pendingProps,t.type.render,t.ref,ql);break;case 5:Fo(t);default:Wc(n,t),t=Kl=bi(t,$l),t=Fc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Gu(e):Kl=t}function Wu(e,t,n,r){ra=na=null,Fo(t),Ba=null,Va=0;var i=t.return;try{if(z(e,i,t,n,ql)){eu=1,tc(e,Di(n,e.current)),Kl=null;return}}catch(t){if(i!==null)throw Kl=i,t;eu=1,tc(e,Di(n,e.current)),Kl=null;return}t.flags&32768?(Wi||r===1?e=!0:Zl||ql&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=uo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ku(t,e)):Gu(t)}function Gu(e){var t=e;do{if(t.flags&32768){Ku(t,Xl);return}e=t.return;var n=Hc(t.alternate,t,$l);if(n!==null){Kl=n;return}if(t=t.sibling,t!==null){Kl=t;return}Kl=t=e}while(t!==null);eu===0&&(eu=5)}function Ku(e,t){do{var n=Uc(e.alternate,e);if(n!==null){n.flags&=32767,Kl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Kl=e;return}Kl=e=n}while(e!==null);eu=6,Kl=null}function qu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Qu();while(mu!==0);if(Wl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ci,ct(e,n,o,s,c,l),e===Gl&&(Kl=Gl=null,ql=0),gu=t,hu=e,_u=n,vu=o,yu=a,bu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,sd(Be,function(){return $u(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=D.T,D.T=null,a=le.p,le.p=2,s=Wl,Wl|=4;try{ll(e,t,n)}finally{Wl=s,le.p=a,D.T=r}}mu=1,Ju(),Yu(),Xu()}}function Ju(){if(mu===1){mu=0;var e=hu,t=gu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=D.T,D.T=null;var r=le.p;le.p=2;var i=Wl;Wl|=4;try{Sl(t,e);var a=Qd,o=Ir(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Fr(s.ownerDocument.documentElement,s)){if(c!==null&&Lr(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 _=Pr(s,h),v=Pr(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}}bp=!!Zd,Qd=Zd=null}finally{Wl=i,le.p=r,D.T=n}}e.current=t,mu=2}}function Yu(){if(mu===2){mu=0;var e=hu,t=gu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=D.T,D.T=null;var r=le.p;le.p=2;var i=Wl;Wl|=4;try{ul(e,t.alternate,t)}finally{Wl=i,le.p=r,D.T=n}}mu=3}}function Xu(){if(mu===4||mu===3){mu=0,Fe();var e=hu,t=gu,n=_u,r=bu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=null),pt(n),t=t.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=D.T,i=le.p,le.p=2,D.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{D.T=t,le.p=i}}_u&3&&Qu(),md(e),i=e.pendingLanes,n&261930&&i&42?e===Su?xu++:(xu=0,Su=e):xu=0,hd(0,!1)}}function Zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ya(t)))}function Qu(){return Ju(),Yu(),Xu(),$u()}function $u(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=pt(_u),r=D.T,a=le.p;try{le.p=32>n?32:n,D.T=null,n=yu,yu=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,Wl&6)throw Error(i(331));var c=Wl;if(Wl|=4,zl(o.current),jl(o,o.current,s,n),Wl=c,hd(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{le.p=a,D.T=r,Zu(e,t)}}function ed(e,t,n){t=Di(n,t),t=rc(e.stateNode,t,2),e=Za(e,t,2),e!==null&&(st(e,2),md(e))}function td(e,t,n){if(e.tag===3)ed(e,e,n);else for(;t!==null;){if(t.tag===3){ed(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=Di(n,e),n=ic(2),r=Za(t,n,2),r!==null&&(ac(n,r,t,e),st(r,2),md(r));break}}t=t.return}}function nd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ul;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)||(Ql=!0,i.add(n),e=rd.bind(null,e,t,n),t.then(e,e))}function rd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gl===e&&(ql&n)===n&&(eu===4||eu===3&&(ql&62914560)===ql&&300>Ie()-lu?!(Wl&2)&&Mu(e,0):ru|=n,au===ql&&(au=0)),md(e)}function id(e,t){t===0&&(t=at()),e=fi(e,t),e!==null&&(st(e,t),md(e))}function ad(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),id(e,n)}function od(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),id(e,n)}function sd(e,t){return Me(e,t)}var cd=null,ld=null,ud=!1,dd=!1,fd=!1,pd=0;function md(e){e!==ld&&e.next===null&&(ld===null?cd=ld=e:ld=ld.next=e),dd=!0,ud||(ud=!0,xd())}function hd(e,t){if(!fd&&dd){fd=!0;do for(var n=!1,r=cd;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-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,bd(r,a))}else a=ql,a=nt(r,r===Gl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,bd(r,a));r=r.next}while(n);fd=!1}}function gd(){_d()}function _d(){dd=ud=!1;var e=0;pd!==0&&af()&&(e=pd);for(var t=Ie(),n=null,r=cd;r!==null;){var i=r.next,a=vd(r,t);a===0?(r.next=null,n===null?cd=i:n.next=i,i===null&&(ld=n)):(n=r,(e!==0||a&3)&&(dd=!0)),r=i}mu!==0&&mu!==5||hd(e,!1),pd!==0&&(pd=0)}function vd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Gl,n=ql,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),pt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=yd.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function yd(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qu()&&e.callbackNode!==n)return null;var r=ql;return r=nt(e,e===Gl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Eu(e,r,t),vd(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?yd.bind(null,e):null)}function bd(e,t){if(Qu())return null;Eu(e,t,!0)}function xd(){lf(function(){Wl&6?Me(Re,gd):_d()})}function Sd(){if(pd===0){var e=Sa;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),pd=e}return pd}function Cd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:un(``+e)}function wd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Td(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Cd((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?Cd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(pd!==0){var e=o?wd(i,o):new FormData(i);As(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?wd(i,o):new FormData(i),As(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ed=0;Ed<ri.length;Ed++){var Dd=ri[Ed];ii(Dd.toLowerCase(),`on`+(Dd[0].toUpperCase()+Dd.slice(1)))}ii(Yr,`onAnimationEnd`),ii(Xr,`onAnimationIteration`),ii(Zr,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii(Qr,`onTransitionRun`),ii($r,`onTransitionStart`),ii(ei,`onTransitionCancel`),ii(ti,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Od=`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(` `),kd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Od));function Ad(e,t){t=(t&4)!=0;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){ai(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){ai(e)}i.currentTarget=null,a=c}}}}function jd(e,t){var n=t[bt];n===void 0&&(n=t[bt]=new Set);var r=e+`__bubble`;n.has(r)||(Fd(t,e,2,!1),n.add(r))}function Md(e,t,n){var r=0;t&&(r|=4),Fd(n,e,r,t)}var Nd=`_reactListening`+Math.random().toString(36).slice(2);function Pd(e){if(!e[Nd]){e[Nd]=!0,jt.forEach(function(t){t!==`selectionchange`&&(kd.has(t)||Md(t,!1,e),Md(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nd]||(t[Nd]=!0,Md(`selectionchange`,!1,t))}}function Fd(e,t,n,r){switch(Dp(t)){case 2:var i=xp;break;case 8:i=Sp;break;default:i=Cp}n=i.bind(null,t,n,e),i=void 0,!xn||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 Id(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=Et(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}vn(function(){var r=a,i=pn(n),s=[];a:{var c=ni.get(e);if(c!==void 0){var l=Mn,u=e;switch(e){case`keypress`:if(Dn(n)===0)break a;case`keydown`:case`keyup`:l=Xn;break;case`focusin`:u=`focus`,l=Vn;break;case`focusout`:u=`blur`,l=Vn;break;case`beforeblur`:case`afterblur`:l=Vn;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=Bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Qn;break;case Yr:case Xr:case Zr:l=Hn;break;case ti:l=$n;break;case`scroll`:case`scrollend`:l=Pn;break;case`wheel`:l=er;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Zn;break;case`toggle`:case`beforetoggle`:l=tr}var d=(t&4)!=0,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=yn(m,p),g!=null&&d.push(Ld(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(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==fn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[yt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?Et(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Ot(l),h=u==null?c:Ot(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=zd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Bd(s,c,l,d,!1),u!==null&&f!==null&&Bd(s,f,u,d,!0)}}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=yr;else if(pr(c))if(br)v=kr;else{v=Dr;var y=Er}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&sn(r.elementType)&&(v=yr):v=Or;if(v&&=v(e,r)){mr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Qt(c,`number`,c.value)}switch(y=r?Ot(r):window,e){case`focusin`:(pr(y)||y.contentEditable===`true`)&&(zr=y,Br=r,Vr=null);break;case`focusout`:Vr=Br=zr=null;break;case`mousedown`:Hr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Hr=!1,Ur(s,n,i);break;case`selectionchange`:if(Rr)break;case`keydown`:case`keyup`:Ur(s,n,i)}var b;if(nr)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else lr?sr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(ar&&n.locale!==`ko`&&(lr||x!==`onCompositionStart`?x===`onCompositionEnd`&&lr&&(b=En()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,lr=!0)),y=Rd(r,x),0<y.length&&(x=new Wn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=cr(n),b!==null&&(x.data=b)))),(b=ir?ur(e,n):dr(e,n))&&(x=Rd(r,`onBeforeInput`),0<x.length&&(y=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Td(s,e,r,n,i)}Ad(s,t)})}function Ld(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rd(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=yn(e,n),i!=null&&r.unshift(Ld(e,i,a)),i=yn(e,t),i!=null&&r.push(Ld(e,i,a))),e.tag===3)return r;e=e.return}return[]}function zd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Bd(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=yn(n,a),l!=null&&o.unshift(Ld(n,l,c))):i||(l=yn(n,a),l!=null&&o.push(Ld(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Vd=/\r\n?/g,Hd=/\u0000|\uFFFD/g;function Ud(e){return(typeof e==`string`?e:``+e).replace(Vd,`
|
|
9
|
+
`).replace(Hd,``)}function Wd(e,t){return t=Ud(t),Ud(e)===t}function Gd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&nn(e,``+r);break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:on(e,r,o);break;case`data`:if(t!==`object`){Bt(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=un(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Gd(e,t,`name`,a.name,a,null),Gd(e,t,`formEncType`,a.formEncType,a,null),Gd(e,t,`formMethod`,a.formMethod,a,null),Gd(e,t,`formTarget`,a.formTarget,a,null)):(Gd(e,t,`encType`,a.encType,a,null),Gd(e,t,`method`,a.method,a,null),Gd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`scrollend`,e);break;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));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=un(``+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`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`:jd(`beforetoggle`,e),jd(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=cn.get(n)||n,zt(e,n,r))}}function Kd(e,t,n,r,a,o){switch(n){case`style`:on(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&nn(e,``+r);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[vt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}}}function qd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:jd(`error`,e),jd(`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:Gd(e,t,o,s,n,null)}}a&&Gd(e,t,`srcSet`,n.srcSet,n,null),r&&Gd(e,t,`src`,n.src,n,null);return;case`input`:jd(`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:Gd(e,t,r,d,n,null)}}Zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in jd(`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:Gd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&$t(e,!!r,n,!0):$t(e,!!r,t,!1);return;case`textarea`:for(s in jd(`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:Gd(e,t,s,c,n,null)}tn(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:Gd(e,t,l,r,n,null)}return;case`dialog`:jd(`beforetoggle`,e),jd(`toggle`,e),jd(`cancel`,e),jd(`close`,e);break;case`iframe`:case`object`:jd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Od.length;r++)jd(Od[r],e);break;case`image`:jd(`error`,e),jd(`load`,e);break;case`details`:jd(`toggle`,e);break;case`embed`:case`source`:case`link`:jd(`error`,e),jd(`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:Gd(e,t,u,r,n,null)}return;default:if(sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Kd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Gd(e,t,c,r,n,null))}function Jd(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)||Gd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Gd(e,t,p,m,r,f)}}Xt(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)||Gd(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Gd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?$t(e,!!n,n?[]:``,!1):$t(e,!!n,t,!0)):$t(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:Gd(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Gd(e,t,s,a,r,o)}en(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:Gd(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Gd(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)&&Gd(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:Gd(e,t,u,p,r,m)}return;default:if(sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Kd(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||Kd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Gd(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||Gd(e,t,f,p,r,m)}function Yd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Xd(){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&&Yd(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&&Yd(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 Zd=null,Qd=null;function $d(e){return e.nodeType===9?e:e.ownerDocument}function ef(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 tf(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 nf(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 rf=null;function af(){var e=window.event;return e&&e.type===`popstate`?e===rf?!1:(rf=e,!0):(rf=null,!1)}var of=typeof setTimeout==`function`?setTimeout:void 0,sf=typeof clearTimeout==`function`?clearTimeout:void 0,cf=typeof Promise==`function`?Promise:void 0,lf=typeof queueMicrotask==`function`?queueMicrotask:cf===void 0?of:function(e){return cf.resolve(null).then(e).catch(uf)};function uf(e){setTimeout(function(){throw e})}function df(e){return e===`head`}function ff(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),Kp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Ef(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Ef(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Ef(e.ownerDocument.body);n=i}while(n);Kp(t)}function pf(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 mf(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`:mf(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function hf(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(!e[wt])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}}else 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;if(e=xf(e.nextSibling),e===null)break}return null}function gf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=xf(e.nextSibling),e===null))return null;return e}function _f(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=xf(e.nextSibling),e===null))return null;return e}function vf(e){return e.data===`$?`||e.data===`$~`}function yf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function bf(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 xf(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 Sf=null;function Cf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return xf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function wf(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 Tf(e,t,n){switch(t=$d(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 Ef(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var Df=new Map,Of=new Set;function kf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Af=le.d;le.d={f:jf,r:Mf,D:Ff,C:If,L:Lf,m:Rf,X:Bf,S:zf,M:Vf};function jf(){var e=Af.f(),t=Au();return e||t}function Mf(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?Ms(t):Af.r(e)}var Nf=typeof document>`u`?null:document;function Pf(e,t,n){var r=Nf;if(r&&typeof t==`string`&&t){var i=Yt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Of.has(i)||(Of.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),qd(t,`link`,e),At(t),r.head.appendChild(t)))}}function Ff(e){Af.D(e),Pf(`dns-prefetch`,e,null)}function If(e,t){Af.C(e,t),Pf(`preconnect`,e,t)}function Lf(e,t,n){Af.L(e,t,n);var r=Nf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Yt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Yt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Yt(n.imageSizes)+`"]`)):i+=`[href="`+Yt(e)+`"]`;var a=i;switch(t){case`style`:a=Uf(e);break;case`script`:a=qf(e)}Df.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Df.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Wf(a))||t===`script`&&r.querySelector(Jf(a))||(t=r.createElement(`link`),qd(t,`link`,e),At(t),r.head.appendChild(t)))}}function Rf(e,t){Af.m(e,t);var n=Nf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Yt(r)+`"][href="`+Yt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=qf(e)}if(!Df.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Df.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Jf(a)))return}r=n.createElement(`link`),qd(r,`link`,e),At(r),n.head.appendChild(r)}}}function zf(e,t,n){Af.S(e,t,n);var r=Nf;if(r&&e){var i=kt(r).hoistableStyles,a=Uf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Wf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Df.get(a))&&Zf(e,n);var c=o=r.createElement(`link`);At(c),qd(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,Xf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Bf(e,t){Af.X(e,t);var n=Nf;if(n&&e){var r=kt(n).hoistableScripts,i=qf(e),a=r.get(i);a||(a=n.querySelector(Jf(i)),a||(e=f({src:e,async:!0},t),(t=Df.get(i))&&Qf(e,t),a=n.createElement(`script`),At(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t){Af.M(e,t);var n=Nf;if(n&&e){var r=kt(n).hoistableScripts,i=qf(e),a=r.get(i);a||(a=n.querySelector(Jf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Df.get(i))&&Qf(e,t),a=n.createElement(`script`),At(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t,n,r){var a=(a=ve.current)?kf(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`?(t=Uf(n.href),n=kt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Uf(n.href);var o=kt(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(Wf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Df.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Df.set(e,n),o||Kf(a,e,n,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`?(t=qf(n),n=kt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Uf(e){return`href="`+Yt(e)+`"`}function Wf(e){return`link[rel="stylesheet"][`+e+`]`}function Gf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Kf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),qd(t,`link`,n),At(t),e.head.appendChild(t))}function qf(e){return`[src="`+Yt(e)+`"]`}function Jf(e){return`script[async]`+e}function Yf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Yt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),qd(r,`style`,a),Xf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Uf(n.href);var o=e.querySelector(Wf(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Gf(n),(a=Df.get(a))&&Zf(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),qd(o,`link`,r),t.state.loading|=4,Xf(o,n.precedence,e),t.instance=o;case`script`:return o=qf(n.src),(a=e.querySelector(Jf(o)))?(t.instance=a,At(a),a):(r=n,(a=Df.get(o))&&(r=f({},n),Qf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),qd(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,Xf(r,n.precedence,e));return t.instance}function Xf(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 Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var $f=null;function ep(e,t,n){if($f===null){var r=new Map,i=$f=new Map;i.set(n,r)}else i=$f,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[wt]||a[_t]||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 tp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function np(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 rp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ip(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=Uf(r.href),a=t.querySelector(Wf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=sp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Gf(r),(i=Df.get(i))&&Zf(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),qd(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=sp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ap=0;function op(e,t){return e.stylesheets&&e.count===0&&lp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ap===0&&(ap=62500*Xd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ap?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cp=null;function lp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cp=new Map,t.forEach(up,e),cp=null,sp.call(e))}function up(e,t){if(!(t.state.loading&4)){var n=cp.get(e);if(n)var r=n.get(null);else{n=new Map,cp.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=sp.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 dp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function fp(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=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function pp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=_i(3,null,null,t),e.current=a,a.stateNode=e,t=va(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ja(a),e}function mp(e){return e?(e=hi,e):hi}function hp(e,t,n,r,i,a){i=mp(i),r.context===null?r.context=i:r.pendingContext=i,r=Xa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Za(e,r,t),n!==null&&(Tu(n,e,t),Qa(n,e,t))}function gp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _p(e,t){gp(e,t),(e=e.alternate)&&gp(e,t)}function vp(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&Tu(t,e,67108864),_p(e,67108864)}}function yp(e){if(e.tag===13||e.tag===31){var t=Cu();t=ft(t);var n=fi(e,t);n!==null&&Tu(n,e,t),_p(e,t)}}var bp=!0;function xp(e,t,n,r){var i=D.T;D.T=null;var a=le.p;try{le.p=2,Cp(e,t,n,r)}finally{le.p=a,D.T=i}}function Sp(e,t,n,r){var i=D.T;D.T=null;var a=le.p;try{le.p=8,Cp(e,t,n,r)}finally{le.p=a,D.T=i}}function Cp(e,t,n,r){if(bp){var i=wp(r);if(i===null)Id(e,t,r,Tp,n),Ip(e,r);else if(Rp(i,e,t,n,r))r.stopPropagation();else if(Ip(e,r),t&4&&-1<Fp.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}md(a),!(Wl&6)&&(du=Ie()+500,hd(0,!1))}}break;case 31:case 13:s=fi(a,2),s!==null&&Tu(s,a,2),Au(),_p(a,2)}if(a=wp(r),a===null&&Id(e,t,r,Tp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Id(e,t,r,null,n)}}function wp(e){return e=pn(e),Ep(e)}var Tp=null;function Ep(e){if(Tp=null,e=Et(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 Tp=e,null}function Dp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var Op=!1,kp=null,Ap=null,jp=null,Mp=new Map,Np=new Map,Pp=[],Fp=`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 Ip(e,t){switch(e){case`focusin`:case`focusout`:kp=null;break;case`dragenter`:case`dragleave`:Ap=null;break;case`mouseover`:case`mouseout`:jp=null;break;case`pointerover`:case`pointerout`:Mp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Np.delete(t.pointerId)}}function Lp(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=Dt(t),t!==null&&vp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Rp(e,t,n,r,i){switch(t){case`focusin`:return kp=Lp(kp,e,t,n,r,i),!0;case`dragenter`:return Ap=Lp(Ap,e,t,n,r,i),!0;case`mouseover`:return jp=Lp(jp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Mp.set(a,Lp(Mp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Np.set(a,Lp(Np.get(a)||null,e,t,n,r,i)),!0}return!1}function zp(e){var t=Et(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,ht(e.priority,function(){yp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ht(e.priority,function(){yp(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 Bp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fn=r,n.target.dispatchEvent(r),fn=null}else return t=Dt(n),t!==null&&vp(t),e.blockedOn=n,!1;t.shift()}return!0}function Vp(e,t,n){Bp(e)&&n.delete(t)}function Hp(){Op=!1,kp!==null&&Bp(kp)&&(kp=null),Ap!==null&&Bp(Ap)&&(Ap=null),jp!==null&&Bp(jp)&&(jp=null),Mp.forEach(Vp),Np.forEach(Vp)}function Up(e,n){e.blockedOn===n&&(e.blockedOn=null,Op||(Op=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Hp)))}var Wp=null;function Gp(e){Wp!==e&&(Wp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wp===e&&(Wp=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(Ep(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,As(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Kp(e){function t(t){return Up(t,e)}kp!==null&&Up(kp,e),Ap!==null&&Up(Ap,e),jp!==null&&Up(jp,e),Mp.forEach(t),Np.forEach(t);for(var n=0;n<Pp.length;n++){var r=Pp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Pp.length&&(n=Pp[0],n.blockedOn===null);)zp(n),n.blockedOn===null&&Pp.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[vt]||null;if(typeof a==`function`)o||Gp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(Ep(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Gp(n)}}}function qp(){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 Jp(e){this._internalRoot=e}Yp.prototype.render=Jp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;hp(n,Cu(),e,t,null,null)},Yp.prototype.unmount=Jp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hp(e.current,2,null,e,null,null),Au(),t[yt]=null}};function Yp(e){this._internalRoot=e}Yp.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pp.length&&t!==0&&t<Pp[n].priority;n++);Pp.splice(n,0,e),n===0&&zp(e)}};var Xp=n.version;if(Xp!==`19.2.4`)throw Error(i(527,Xp,`19.2.4`));le.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=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Zp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:D,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qp.isDisabled&&Qp.supportsFiber)try{Ge=Qp.inject(Zp),Ke=Qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Qs,s=$s,c=ec;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=pp(e,1,!1,null,null,n,r,null,o,s,c,qp),e[yt]=t.current,Pd(e),new Jp(t)}})),y=s(((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=v()})),b=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(b||{});function x({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}var S=0,C=0,w=0,T=[],{link:ee,unlink:E,propagate:te,checkDirty:ne,shallowPropagate:re}=x({update(e){return e.depsTail===void 0?ce(e):se(e)},notify(e){let t=w,n=t;do if(T[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(w=t;n<--t;){let e=T[n];T[n++]=T[t],T[t]=e}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,de(e)):ue.call(e)}});function ie(){return S}function ae(){++S}function oe(){--S||le()}function se(e){e.depsTail=void 0,e.flags=5;try{let t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,de(e)}}function ce(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function D(e){let t=e.flags;if(t&16||t&32&&ne(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,de(e)}}else e.flags=2}function le(){try{for(;C<w;){let e=T[C];T[C++]=void 0,D(e)}}finally{for(;C<w;){let e=T[C];T[C++]=void 0,e.flags|=10}C=0,w=0}}function ue(){this.depsTail=void 0,this.flags=0,de(this);let e=this.subs;e!==void 0&&E(e)}function de(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=E(n,e)}function fe(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var pe=[],me=0,{link:he,unlink:ge,propagate:_e,checkDirty:ve,shallowPropagate:ye}=x({update(e){return e._update()},notify(e){pe[xe++]=e,e.flags&=~b.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=b.Mutable|b.Dirty,Ce(e))}}),be=0,xe=0,Se;function Ce(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=ge(n,e)}function we(){if(!(ie()>0)){for(;be<xe;){let e=pe[be];pe[be++]=void 0,e.notify()}be=0,xe=0}}function Te(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?b.None:b.Mutable,get(){return Se!==void 0&&he(i,Se,me),i._snapshot},subscribe(e){let t=fe(e),n={current:!1},r=Ee(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Se,o=t?.compare??Object.is;Se=i,++me,i.depsTail=void 0,n&&(i.flags=b.Mutable|b.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Se=a,n&&(i.flags&=~b.RecursedCheck),Ce(i)}}};return n?(i.flags=b.Mutable|b.Dirty,i.get=function(){let e=i.flags;if(e&b.Dirty||e&b.Pending&&ve(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ye(e)}}else e&b.Pending&&(i.flags=e&~b.Pending);return Se!==void 0&&he(i,Se,me),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(_e(e),ye(e),we())}},i}function Ee(e){let t=()=>{let t=Se;Se=n,++me,n.depsTail=void 0,n.flags=b.Watching|b.RecursedCheck;try{return e()}finally{Se=t,n.flags&=~b.RecursedCheck,Ce(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:b.Watching|b.RecursedCheck,notify(){let e=this.flags;e&b.Dirty||e&b.Pending&&ve(this.deps,this)?t():this.flags=b.Watching},stop(){this.flags=b.None,this.depsTail=void 0,Ce(this)}};return t(),n}var De=class{constructor(e){this.atom=Te(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(fe(e))}},Oe=class{constructor(e){this.atom=Te(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(fe(e))}};function ke(e){return typeof e==`function`?new Oe(e):new De(e)}function Ae(e){try{ae(),e()}finally{oe(),we()}}var je=`__TSR_index`,Me=`popstate`,Ne=`beforeunload`;function Pe(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Re(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[je];i=Fe(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[je];i=Fe(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[je]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Fe(e,t){t||={};let n=ze();return{...t,key:n,__TSR_key:n,[je]:e}}function Ie(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Re(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ze();t.history.replaceState({[je]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Re(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[je]-l.state[je],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Pe({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ne,S,{capture:!0}),t.removeEventListener(Me,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ne,S,{capture:!0}),t.addEventListener(Me,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Le(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Re(e,t){let n=Le(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=ze();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[je]:0,key:a,__TSR_key:a}}}function ze(){return(Math.random()+1).toString(36).substring(7)}function Be(e){let t;return Ae(()=>{t=e()}),t}function Ve(e){return e[e.length-1]}function He(e){return typeof e==`function`}function Ue(e,t){return He(e)?e(t):e}var We=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable;function Ke(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=t,i=Xe(e)&&Xe(r);if(!i&&!(Je(e)&&Je(r)))return r;let a=i?e:qe(e);if(!a)return r;let o=i?r:qe(r);if(!o)return r;let s=a.length,c=o.length,l=i?Array(c):{},u=0;for(let t=0;t<c;t++){let a=i?t:o[t],c=e[a],d=r[a];if(c===d){l[a]=c,(i?t<s:We.call(e,a))&&u++;continue}if(c===null||d===null||typeof c!=`object`||typeof d!=`object`){l[a]=d;continue}let f=Ke(c,d,n+1);l[a]=f,f===c&&u++}return s===c&&u===s?e:l}function qe(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Ge.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!Ge.call(e,t))return!1;r.push(t)}return r}function Je(e){if(!Ye(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ye(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Ye(e){return Object.prototype.toString.call(e)===`[object Object]`}function Xe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ze(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Ze(e[r],t[r],n))return!1;return!0}if(Je(e)&&Je(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Ze(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Ze(e[o],t[o],n)))return!1;return i===a}return!1}function Qe(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function $e(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function et(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function tt(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return et(t)}var nt=[`http:`,`https:`,`mailto:`,`tel:`];function rt(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var it={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},at=/[&><\u2028\u2029]/g;function ot(e){return e.replace(at,e=>it[e])}function st(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=tt(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=tt(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ct(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var lt=!0,ut=`Invariant failed`;function dt(e,t){if(!e){if(lt)throw Error(ut);var n=typeof t==`function`?t():t,r=n?`${ut}: ${n}`:ut;throw Error(r)}}function ft(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var pt=4,mt=5;function ht(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function gt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ht(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function _t(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=gt(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=bt(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=bt(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=xt(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=xt(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=xt(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=bt(n.fullPath??n.from);e.kind=mt,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=bt(n.fullPath??n.from);e.kind=pt,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)_t(e,t,r,s,i,a,o)}function vt(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function yt(e){if(e.pathless)for(let t of e.pathless)yt(t);if(e.static)for(let t of e.static.values())yt(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())yt(t);if(e.dynamic?.length){e.dynamic.sort(vt);for(let t of e.dynamic)yt(t)}if(e.optional?.length){e.optional.sort(vt);for(let t of e.optional)yt(t)}if(e.wildcard?.length){e.wildcard.sort(vt);for(let t of e.wildcard)yt(t)}}function bt(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function xt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function St(e,t){let n=bt(`/`),r=new Uint16Array(6);for(let t of e)_t(!1,r,t,1,n,0);yt(n),t.masksTree=n,t.flatCache=ft(1e3)}function Ct(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Ot(e,t.masksTree);return t.flatCache.set(e,r),r}function wt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=bt(`/`),_t(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ot(r,o,n)}function Tt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ot(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=At(a.route)),t.matchCache.set(r,a),a}function Et(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Dt(e,t=!1,n){let r=bt(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return _t(t,i,e,1,r,0,e=>{if(n?.(e,s),dt(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=Et(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),yt(r),{processedTree:{segmentTree:r,singleCache:ft(1e3),matchCache:ft(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Ot(e,t,n=!1){let r=e.split(`/`),i=Mt(e,r,t,n);if(!i)return null;let[a]=kt(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function kt(e,t,n){let r=jt(n.node),i=null,a={},o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===pt)break;if(u.kind===mt){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function At(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function jt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Mt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Ve(t),a=i&&e!==`/`,o=t.length-(i?1:0),s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!Nt(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==pt&&Pt(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Pt(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(Nt(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Pt(u,n)&&(u=n)}}if(i.wildcard&&Pt(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!Nt(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Pt(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??={},l.rawParams[`**`]=decodeURIComponent(r),l}return null}function Nt(e,t,n){try{let[r,i]=kt(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,a),!0}catch{return null}}function Pt(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===pt)>(e.node.kind===pt)||t.node.kind===pt==(e.node.kind===pt)&&t.depth>e.depth))):!0}function Ft(e){return It(e.filter(e=>e!==void 0).join(`/`))}function It(e){return e.replace(/\/{2,}/g,`/`)}function Lt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Rt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function zt(e){return Rt(Lt(e))}function Bt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Vt(e,t,n){return Bt(e,n)===Bt(t,n)}function Ht({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&Ve(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(Ve(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=gt(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=It(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function Ut(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Wt(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Kt(e,n)).join(`/`):Kt(r,n):r}function Gt({path:e,params:t,decoder:n,...r}){let i=!1,a={};if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=gt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Wt(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Wt(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Wt(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Kt(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function qt(e){return!!e?.isNotFound}function Jt(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var Yt=`tsr-scroll-restoration-v1_3`,Xt=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function Zt(){let e=Jt();if(!e)return null;let t=e.getItem(Yt),n=t?JSON.parse(t):{};return{state:n,set:t=>{n=Ue(t,n)||n;try{e.setItem(Yt,JSON.stringify(n))}catch{console.warn(`[ts-router] Could not persist scroll restoration state to sessionStorage.`)}}}}var Qt=Zt(),$t=e=>e.state.__TSR_key||e.href;function en(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var tn=!1;function nn({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];tn=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}tn=!1}function rn(e,t){if(!Qt||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Qt))return;e.isScrollRestorationSetup=!0,tn=!1;let n=e.options.getScrollRestorationKey||$t;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,Xt(t=>{if(tn||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:en(t.target)}let i=n(e.state.location);Qt.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(nn({storageKey:Yt,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Qt.set(e=>(e[r]||={},e)))})}function an(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function on(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function sn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function cn(e){let t=new URLSearchParams(e),n={};for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=sn(r):Array.isArray(t)?t.push(sn(r)):n[e]=[t,sn(r)]}return n}var ln=dn(JSON.parse),un=fn(JSON.stringify,JSON.parse);function dn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=cn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function fn(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=on(e,r);return t?`?${t}`:``}}var pn=`__root__`;function mn(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function hn(e){return e instanceof Response&&!!e.options}var gn=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},_n=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),vn=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},yn=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},bn=(e,t,n)=>{if(!(!hn(n)&&!qt(n)))throw hn(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:hn(n)?`redirected`:r.status===`pending`?`success`:r.status,context:vn(e,t.index),isFetching:!1,error:n})),qt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),hn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},xn=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,Sn=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,bn(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,bn(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!hn(n)&&!qt(n)&&(e.serialError??=n)},Cn=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!_n(e,t)&&(n.options.loader||n.options.beforeLoad||Nn(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{gn(e)},i);r._nonReactive.pendingTimeout=t}},wn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Cn(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&bn(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Tn=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Qe(()=>{a?.resolve()});let{paramsError:o,searchError:s}=i;o&&Sn(e,n,o,`PARSE_PARAMS`),s&&Sn(e,n,s,`VALIDATE_SEARCH`),Cn(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){Be(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=Qe();let f={...vn(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=_n(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){Be(()=>{u(),d()});return}(hn(r)||qt(r))&&(u(),Sn(e,n,r,`BEFORE_LOAD`)),Be(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),$e(y))return u(),y.catch(t=>{Sn(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Sn(e,n,t,`BEFORE_LOAD`)}v(y)},En=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Tn(e,n,t,i),s=()=>{if(xn(e,n))return;let t=wn(e,n,i);return $e(t)?t.then(o):o()};return a()},Dn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},On=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=vn(e,r),d=_n(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},kn=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Mn(i);let o=i.options.loader?.(On(e,t,n,r,i)),s=i.options.loader&&$e(o);if((s||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),i.options.loader){let t=s?await o:o;bn(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let c=a._nonReactive.minPendingPromise;c&&await c,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:vn(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:vn(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,qt(t)&&await i.options.notFoundComponent?.preload?.(),bn(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,bn(e,e.router.getMatch(n),t)}e.updateMatch(n,t=>({...t,error:o,context:vn(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),bn(e,r,t)}},An=async(e,t,n)=>{async function r(r,a,c,l){let u=Date.now()-a.updatedAt,d=r?l.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.router.options.defaultStaleTime??0,f=l.options.shouldReload,p=typeof f==`function`?f(On(e,t,i,n,l)):f,{status:m,invalid:h}=c;o=m===`success`&&(h||(p??u>d)),r&&l.options.preload===!1||(o&&!e.sync?(s=!0,(async()=>{try{await kn(e,t,i,n,l);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0}catch(t){hn(t)&&await e.router.navigate(t.options)}})()):(m!==`success`||o&&e.sync)&&await kn(e,t,i,n,l))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a];if(!xn(e,i)){let t=e.router.getMatch(i),n=_n(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload)return t;await t._nonReactive.loaderPromise;let a=e.router.getMatch(i),o=a._nonReactive.error||a.error;o&&bn(e,a,o),a.status===`pending`&&await r(n,t,a,c)}else{let a=n&&!e.router.state.matches.some(e=>e.id===i),o=e.router.getMatch(i);o._nonReactive.loaderPromise=Qe(),a!==o.preload&&e.updateMatch(i,e=>({...e,preload:a})),await r(n,t,o,c)}}let l=e.router.getMatch(i);s||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,s||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;let u=s?l.isFetching:!1;return u!==l.isFetching||l.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:u,invalid:!1})),e.router.getMatch(i)):l};async function jn(e){let t=e,n=[];t.router.state.matches.some(e=>e._forcePending)&&gn(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=En(t,e);$e(n)&&await n}catch(e){if(hn(e))throw e;if(qt(e))r=e;else if(!t.preload)throw e;break}if(t.serialError)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?yn(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(An(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(hn(e))throw e;qt(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!l&&r&&t.preload)return t.matches;if(l){let e=yn(t,l);dt(e!==void 0,`Could not find match for notFound boundary`);let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Mn(r)}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Mn(e)}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Dn(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=gn(t);if($e(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Mn(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){let t=()=>{let t=[];for(let n of Pn){let r=e.options[n]?.preload;r&&t.push(r())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Nn(e){for(let t of Pn)if(e.options[t]?.preload)return!0;return!1}var Pn=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Fn(e){return{input:({url:t})=>{for(let n of e)t=Ln(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Rn(e[n],t);return t}}}function In(e){let t=zt(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ft([`/`,t,e.pathname]),e)}}function Ln(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Rn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function zn(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}function Bn(e){let t=e.filter(e=>e.status!==`redirected`);return t.length===e.length?e:t}var Vn=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ut(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Ie()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=ft(1e3),e=this.buildRouteTree(),this.setRoutes(e)}!this.__store&&this.latestLocation&&(this.__store=ke(Wn(this.latestLocation)),rn(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=zt(o);t&&t!==`/`&&e.push(In({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Fn(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&this.__store.setState(e=>({...e,location:this.latestLocation})),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Dt(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&St(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let o=this.options.parseSearch(n),s=this.options.stringifySearch(o);return{href:e+s+r,publicHref:i,pathname:st(e).path,external:!1,searchStr:s,search:Ke(t?.search,o),hash:st(r.slice(1)).path,state:Ke(t?.state,a)}}let o=new URL(i,this.origin),s=Ln(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:st(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Ke(t?.search,c),hash:st(s.hash.slice(1)).path,state:Ke(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Ht({base:e,to:It(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Kn({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s={...r.params},c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?{}:(t.params??!0)===!0?s:Object.assign(s,Ue(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:st(Gt({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Gn(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=qn({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=Ke(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?Ue(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?Ue(t.state,n.state):{};_=Ke(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=Rn(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=ct(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n={};if(this.options.routeMasks){let o=Ct(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?{}:(s??!0)===!0?n:Object.assign(n,Ue(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=Ze(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=Rt(this.latestLocation.href)===Rt(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Qe(()=>{a?.resolve()}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Re(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Ln(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(rt(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r;for(r=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...zn({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...zn({resolvedLocation:n,location:t})}),await jn({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[],r=[];Be(()=>{this.__store.setState(i=>{let a=i.matches,o=i.pendingMatches||i.matches;return e=a.filter(e=>!o.some(t=>t.id===e.id)),t=a.filter(e=>!o.some(t=>t.routeId===e.routeId)),n=o.filter(e=>!a.some(t=>t.routeId===e.routeId)),r=o.filter(e=>a.some(t=>t.routeId===e.routeId)),{...i,isLoading:!1,loadedAt:Date.now(),matches:o,pendingMatches:void 0,cachedMatches:[...i.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]}}),this.clearExpiredCache()}),[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){hn(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):qt(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(e=>e.status===`error`)&&(i=500),i!==void 0&&this.__store.setState(e=>({...e,statusCode:i}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(zn({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&(n===`cachedMatches`?this.__store.setState(n=>({...n,cachedMatches:Bn(n.cachedMatches.map(n=>n.id===e?t(n):n))})):this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)})))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&rt(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=Mn,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);Be(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await jn({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(hn(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});qt(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=wt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!Ze(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Ze(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??un,parseSearch:e.parseSearch??ln,protocolAllowlist:e.protocolAllowlist??nt}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:Rt(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?Yn(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map(this.state.matches.map(e=>[e.routeId,e]));for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=Gn(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof Hn||(r=new Hn(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=Gt({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{Xn(r,_,a,x)}catch(e){if(S=qt(e)||hn(e)?e:new Un(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:Ke(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Nn(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?Ke(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:Qe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?Ke(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?Ke(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Ve(t),a={...e.search};for(let e of t)try{Object.assign(a,Gn(e.options.validateSearch,a))}catch{}let o=Ve(this.state.matches),s=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname,c;if(s)c=o.params;else{let e={...n};for(let i of t)try{Xn(i,n,r??{},e)}catch{}c=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:c}}},Hn=class extends Error{},Un=class extends Error{};function Wn(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Gn(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Hn(`Async validation not supported`);if(n.issues)throw new Hn(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Kn({pathname:e,routesById:t,processedTree:n}){let r={},i=Rt(e),a,o,s=Tt(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign({},s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function qn({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Jn(n)(e,t,r??!1)}function Jn(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Gn(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:Ue(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Yn(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return pn}function Xn(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var Zn=`Error preloading route! ☝️`,Qn=class{constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=pn:this.parentRoute||dt(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?pn:t?.path;r&&r!==`/`&&(r=Lt(r));let i=t?.id||r,a=n?pn:Ft([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ft([`/`,a]));let o=a===`__root__`?`/`:Ft([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Rt(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>mn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}},$n=class extends Qn{constructor(e){super(e)}},er=s((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})),tr=s(((e,t)=>{t.exports=er()})),O=u(h(),1);O.use;var nr=typeof window<`u`?O.useLayoutEffect:O.useEffect;function rr(e){let t=O.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function ir(e,t,n={},r={}){O.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function ar(e){let t=O.useRef(null);return O.useImperativeHandle(e,()=>t.current,[]),t}var k=u(tr(),1);function or(e){let t=e.errorComponent??cr;return(0,k.jsx)(sr,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?O.createElement(t,{error:n,reset:r}):e.children})}var sr=class extends O.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function cr({error:e}){let[t,n]=O.useState(!1);return(0,k.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,k.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,k.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,k.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,k.jsx)(`div`,{children:(0,k.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,k.jsx)(`code`,{children:e.message}):null})}):null]})}function lr({children:e,fallback:t=null}){return ur()?(0,k.jsx)(O.Fragment,{children:e}):(0,k.jsx)(O.Fragment,{children:t})}function ur(){return O.useSyncExternalStore(dr,()=>!0,()=>!1)}function dr(){return()=>{}}var fr=!0;function pr(e,t){if(!fr){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}var mr=pr,hr=s((e=>{var t=h();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),gr=s(((e,t)=>{t.exports=hr()})),_r=s((e=>{var t=h(),n=gr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),vr=s(((e,t)=>{t.exports=_r()})),yr=vr();function br(e,t){return e===t}function xr(e,t,n=br){let r=(0,O.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,O.useCallback)(()=>e?.get(),[e]);return(0,yr.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Sr=O.createContext(null);function Cr(e){let t=O.useContext(Sr);return mr(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}function wr(e){let t=Cr({warn:e?.router===void 0}),n=e?.router||t,r=(0,O.useRef)(void 0);return xr(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=Ke(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var Tr=O.createContext(void 0),Er=O.createContext(void 0);function Dr(e){let t=O.useContext(e.from?Er:Tr);return wr({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(dt(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function Or(e){return Dr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function kr(e){let{select:t,...n}=e;return Dr({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Ar(e){return Dr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function jr(e){return Dr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Mr(e){let t=Cr();return O.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Nr=_();function Pr(e,t){let n=Cr(),r=ar(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:m,children:h,target:g,disabled:_,style:v,className:y,onClick:b,onBlur:x,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:T,ignoreBlocker:ee,params:E,search:te,hash:ne,state:re,mask:ie,reloadDocument:ae,unsafeRelative:oe,from:se,_fromLocation:ce,...D}=e,le=ur(),ue=wr({select:e=>{let t=e.matches[e.matches.length-1];return{search:t?.search,hash:e.location.hash,path:t?.pathname}},structuralSharing:!0}),de=e.from,fe=O.useMemo(()=>({...e,from:de}),[n,ue,de,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),pe=O.useMemo(()=>n.buildLocation({...fe}),[n,fe]),me=pe.maskedLocation?pe.maskedLocation.publicHref:pe.publicHref,he=pe.maskedLocation?pe.maskedLocation.external:pe.external,ge=O.useMemo(()=>Ur(me,he,n.history,_),[_,he,me,n.history]),_e=O.useMemo(()=>{if(ge?.external)return rt(ge.href,n.protocolAllowlist)?void 0:ge.href;if(!Wr(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),rt(s,n.protocolAllowlist)?void 0:s}catch{}},[s,ge,n.protocolAllowlist]),ve=wr({select:e=>{if(_e)return!1;if(o?.exact){if(!Vt(e.location.pathname,pe.pathname,n.basepath))return!1}else{let t=Bt(e.location.pathname,n.basepath),r=Bt(pe.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!Ze(e.location.search,pe.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?le&&e.location.hash===pe.hash:!0}}),ye=ve?Ue(i,{})??Ir:Fr,be=ve?Fr:Ue(a,{})??Fr,xe=[y,ye.className,be.className].filter(Boolean).join(` `),Se=(v||ye.style||be.style)&&{...v,...ye.style,...be.style},[Ce,we]=O.useState(!1),Te=O.useRef(!1),Ee=e.reloadDocument||_e?!1:c??n.options.defaultPreload,De=l??n.options.defaultPreloadDelay??0,Oe=O.useCallback(()=>{n.preloadRoute({...fe,_builtLocation:pe}).catch(e=>{console.warn(e),console.warn(Zn)})},[n,fe,pe]);ir(r,O.useCallback(e=>{e?.isIntersecting&&Oe()},[Oe]),Vr,{disabled:!!_||Ee!==`viewport`}),O.useEffect(()=>{Te.current||!_&&Ee===`render`&&(Oe(),Te.current=!0)},[_,Oe,Ee]);let ke=e=>{let t=e.currentTarget.getAttribute(`target`),r=g===void 0?t:g;if(!_&&!Kr(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Nr.flushSync)(()=>{we(!0)});let t=n.subscribe(`onResolved`,()=>{t(),we(!1)});n.navigate({...fe,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:m,ignoreBlocker:ee})}};if(_e)return{...D,ref:r,href:_e,...h&&{children:h},...g&&{target:g},..._&&{disabled:_},...v&&{style:v},...y&&{className:y},...b&&{onClick:b},...x&&{onBlur:x},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...T&&{onTouchStart:T}};let Ae=e=>{if(_||Ee!==`intent`)return;if(!De){Oe();return}let t=e.currentTarget;if(Br.has(t))return;let n=setTimeout(()=>{Br.delete(t),Oe()},De);Br.set(t,n)},je=e=>{_||Ee!==`intent`||Oe()},Me=e=>{if(_||!Ee||!De)return;let t=e.currentTarget,n=Br.get(t);n&&(clearTimeout(n),Br.delete(t))};return{...D,...ye,...be,href:ge?.href,ref:r,onClick:Hr([b,ke]),onBlur:Hr([x,Me]),onFocus:Hr([S,Ae]),onMouseEnter:Hr([C,Ae]),onMouseLeave:Hr([w,Me]),onTouchStart:Hr([T,je]),disabled:!!_,target:g,...Se&&{style:Se},...xe&&{className:xe},..._&&Lr,...ve&&Rr,...le&&Ce&&zr}}var Fr={},Ir={className:`active`},Lr={role:`link`,"aria-disabled":!0},Rr={"data-status":`active`,"aria-current":`page`},zr={"data-transitioning":`transitioning`},Br=new WeakMap,Vr={rootMargin:`100px`},Hr=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ur(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Wr(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Gr=O.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Pr(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return O.createElement(`a`,t,o)}return O.createElement(n,a,o)});function Kr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var qr=class extends Qn{constructor(e){super(e),this.useMatch=e=>Dr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Dr({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>jr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ar({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>kr({...e,from:this.id}),this.useLoaderData=e=>Or({...e,from:this.id}),this.useNavigate=()=>Mr({from:this.fullPath}),this.Link=O.forwardRef((e,t)=>(0,k.jsx)(Gr,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Jr(e){return new qr(e)}var Yr=class extends $n{constructor(e){super(e),this.useMatch=e=>Dr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Dr({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>jr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ar({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>kr({...e,from:this.id}),this.useLoaderData=e=>Or({...e,from:this.id}),this.useNavigate=()=>Mr({from:this.fullPath}),this.Link=O.forwardRef((e,t)=>(0,k.jsx)(Gr,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Xr(e){return new Yr(e)}function Zr(e){return typeof e==`object`?new Qr(e,{silent:!0}).createRoute(e):new Qr(e,{silent:!0}).createRoute}var Qr=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Jr(e);return t.isRoot=!1,t},this.silent=t?.silent}},$r=class{constructor(e){this.useMatch=e=>Dr({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Dr({from:this.options.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>jr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>Ar({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>kr({...e,from:this.options.id}),this.useLoaderData=e=>Or({...e,from:this.options.id}),this.useNavigate=()=>Mr({from:Cr().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function ei(e){return typeof e==`object`?new $r(e):t=>new $r({id:e,...t})}function ti(){let e=Cr(),t=O.useRef({router:e,mounted:!1}),[n,r]=O.useState(!1),{hasPendingMatches:i,isLoading:a}=wr({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=rr(a),s=a||n||i,c=rr(s),l=a||i,u=rr(l);return e.startTransition=e=>{r(!0),O.startTransition(()=>{e(),r(!1)})},O.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Rt(e.latestLocation.publicHref)!==Rt(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),nr(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),nr(()=>{o&&!a&&e.emit({type:`onLoad`,...zn(e.state)})},[o,e,a]),nr(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...zn(e.state)})},[l,u,e]),nr(()=>{if(c&&!s){let t=zn(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&an(e)}},[s,c,e]),null}function ni(e){let t=wr({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,k.jsx)(or,{getResetKey:()=>t,onCatch:(t,n)=>{if(qt(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(qt(t))return e.fallback?.(t);throw t},children:e.children})}function ri(){return(0,k.jsx)(`p`,{children:`Not Found`})}function ii(e){return(0,k.jsx)(k.Fragment,{children:e.children})}function ai(e,t,n){return t.options.notFoundComponent?(0,k.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,k.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,k.jsx)(ri,{})}function oi({children:e}){return Cr(),null}function si(){let e=Cr();if(!e.isScrollRestoring||!0)return null;let t=(e.options.getScrollRestorationKey||$t)(e.latestLocation),n=t===$t(e.latestLocation)?void 0:t,r={storageKey:Yt,shouldScrollRestoration:!0};return n&&(r.key=n),(0,k.jsx)(oi,{children:`(${nn.toString()})(${ot(JSON.stringify(r))})`})}var ci=O.memo(function({matchId:e}){let t=Cr(),n=wr({select:t=>{let n=t.matches.findIndex(t=>t.id===e),r=t.matches[n];return dt(r,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:r.routeId,ssr:r.ssr,_displayPending:r._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[n-1]?.routeId}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,k.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||l))?O.Suspense:ii,d=o?or:ii,f=c?ni:ii;return(0,k.jsxs)(r.isRoot?r.options.shellComponent??ii:ii,{children:[(0,k.jsx)(Tr.Provider,{value:e,children:(0,k.jsx)(u,{fallback:a,children:(0,k.jsx)(d,{getResetKey:()=>n.resetKey,errorComponent:o||cr,onCatch:(t,n)=>{if(qt(t))throw t;mr(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,k.jsx)(f,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return O.createElement(c,e)},children:l||n._displayPending?(0,k.jsx)(lr,{fallback:a,children:(0,k.jsx)(ui,{matchId:e})}):(0,k.jsx)(ui,{matchId:e})})})})}),n.parentRouteId===`__root__`&&t.options.scrollRestoration?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(li,{}),(0,k.jsx)(si,{})]}):null]})});function li(){let e=Cr(),t=O.useRef(void 0);return(0,k.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...zn(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var ui=O.memo(function({matchId:e}){let t=Cr(),{match:n,key:r,routeId:i}=wr({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,invalid:r.invalid,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=O.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,k.jsx)(e,{},r):(0,k.jsx)(di,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise){let t=Qe();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return dt(qt(n.error),`Expected a notFound error`),ai(t,a,n.error);if(n.status===`redirected`)throw dt(hn(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`)throw n.error;return o}),di=O.memo(function(){let e=Cr(),t=O.useContext(Tr),n=wr({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=wr({select:e=>{let n=e.matches.find(e=>e.id===t);return dt(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=wr({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,k.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return ai(e,r,void 0);if(!a)return null;let s=(0,k.jsx)(ci,{matchId:a});return n===`__root__`?(0,k.jsx)(O.Suspense,{fallback:o,children:s}):s});function fi(){let e=Cr(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,k.jsx)(t,{}):null,r=(0,k.jsxs)(typeof document<`u`&&e.ssr?ii:O.Suspense,{fallback:n,children:[(0,k.jsx)(ti,{}),(0,k.jsx)(pi,{})]});return e.options.InnerWrap?(0,k.jsx)(e.options.InnerWrap,{children:r}):r}function pi(){let e=Cr(),t=wr({select:e=>e.matches[0]?.id}),n=wr({select:e=>e.loadedAt}),r=t?(0,k.jsx)(ci,{matchId:t}):null;return(0,k.jsx)(Tr.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,k.jsx)(or,{getResetKey:()=>n,errorComponent:cr,onCatch:void 0,children:r})})}var mi=e=>new hi(e),hi=class extends Vn{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=Zr,globalThis.createLazyFileRoute=ei):typeof window<`u`&&(window.createFileRoute=Zr,window.createLazyFileRoute=ei);function gi({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,k.jsx)(Sr.Provider,{value:e,children:t});return e.options.Wrap?(0,k.jsx)(e.options.Wrap,{children:r}):r}function _i({router:e,...t}){return(0,k.jsx)(gi,{router:e,...t,children:(0,k.jsx)(fi,{})})}var vi=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(){}},yi={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},bi=new class{#e=yi;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 xi(e){setTimeout(e,0)}var Si=typeof window>`u`||`Deno`in globalThis;function Ci(){}function wi(e,t){return typeof e==`function`?e(t):e}function Ti(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ei(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Di(e,t){return typeof e==`function`?e(t):e}function Oi(e,t){return typeof e==`function`?e(t):e}function ki(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ji(o,t.options))return!1}else if(!Ni(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 Ai(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Mi(t.options.mutationKey)!==Mi(a))return!1}else if(!Ni(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ji(e,t){return(t?.queryKeyHashFn||Mi)(e)}function Mi(e){return JSON.stringify(e,(e,t)=>Ri(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ni(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Ni(e[n],t[n])):!1}var Pi=Object.prototype.hasOwnProperty;function Fi(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Li(e)&&Li(t);if(!r&&!(Ri(e)&&Ri(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:Pi.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Fi(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Ii(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 Li(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ri(e){if(!zi(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!zi(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function zi(e){return Object.prototype.toString.call(e)===`[object Object]`}function Bi(e){return new Promise(t=>{bi.setTimeout(t,e)})}function Vi(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Fi(e,t)}function Hi(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ui(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Wi=Symbol();function Gi(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Wi?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ki(e,t){return typeof e==`function`?e(...t):!!e}function qi(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 Ji=new class extends vi{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Si&&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`}};function Yi(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Xi=xi;function Zi(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Xi,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 Qi=Zi(),$i=new class extends vi{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Si&&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 ea(e){return Math.min(1e3*2**e,3e4)}function ta(e){return(e??`online`)===`online`?$i.isOnline():!0}var na=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ra(e){let t=!1,n=0,r,i=Yi(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new na(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Ji.isFocused()&&(e.networkMode===`always`||$i.isOnline())&&e.canRun(),u=()=>ta(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())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(d).catch(r=>{if(a())return;let i=e.retry??(Si?0:3),o=e.retryDelay??ea,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Bi(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var ia=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ti(this.gcTime)&&(this.#e=bi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Si?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(bi.clearTimeout(this.#e),void 0)}},aa=class extends ia{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ca(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ca(this.options);e.data!==void 0&&(this.setState(sa(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=Vi(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Ci).catch(Ci):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Oi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wi||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Di(e.options.staleTime,this)===`static`):!1}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:!Ei(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.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.#o=!0,n.signal)})},i=()=>{let e=Gi(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!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.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=ra({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof na&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof na){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){this.state=(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,...oa(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...sa(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=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),Qi.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function oa(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ta(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function sa(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ca(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`}}function la(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=>{qi(e,()=>t.signal,()=>n=!0)},u=Gi(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Ui:Hi;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?da:ua,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:ua(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function ua(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 da(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var fa=class extends ia{#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||pa(),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.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ra({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)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),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:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}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.#n.runNext(this)}}#i(e){this.state=(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),Qi.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function pa(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ma=class extends vi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new fa({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=ha(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=ha(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=ha(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=ha(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Qi.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=>Ai(t,e))}findAll(e={}){return this.getAll().filter(t=>Ai(e,t))}notify(e){Qi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Qi.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ci))))}};function ha(e){return e.options.scope?.id}var ga=class extends vi{#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),Ii(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Mi(t.mutationKey)!==Mi(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}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??pa();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){Qi.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)})})}},_a=class extends vi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ji(r,t),a=this.get(i);return a||(a=new aa({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(){Qi.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=>ki(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ki(e,t)):t}notify(e){Qi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Qi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Qi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},va=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new _a,this.#t=e.mutationCache||new ma,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ji.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=$i.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(Di(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=wi(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Qi.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;Qi.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Qi.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Qi.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ci).catch(Ci)}invalidateQueries(e,t={}){return Qi.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=Qi.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(Ci)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ci)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Di(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ci).catch(Ci)}fetchInfiniteQuery(e){return e.behavior=la(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ci).catch(Ci)}ensureInfiniteQueryData(e){return e.behavior=la(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return $i.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(Mi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ni(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Mi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ni(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||=ji(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===Wi&&(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()}},ya=O.createContext(void 0),ba=e=>{let t=O.useContext(ya);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},xa=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,k.jsx)(ya.Provider,{value:e,children:t}));function Sa(e,t){let n=ba(t),[r]=O.useState(()=>new ga(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);let i=O.useSyncExternalStore(O.useCallback(e=>r.subscribe(Qi.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=O.useCallback((e,t)=>{r.mutate(e,t).catch(Ci)},[r]);if(i.error&&Ki(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ca=y();const wa=Xr({component:()=>(0,k.jsx)(di,{})}),Ta=e=>typeof e==`function`,A=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};case 4:return function(e,n,r,i){return arguments.length>=4?t(e,n,r,i):function(i){return t(i,e,n,r)}};case 5:return function(e,n,r,i,a){return arguments.length>=5?t(e,n,r,i,a):function(a){return t(a,e,n,r,i)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},Ea=e=>e,Da=e=>()=>e,Oa=Da(!0),ka=Da(!1),Aa=Da(void 0),ja=Aa;function j(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return a(i(r(n(t(e)))));case 7:return o(a(i(r(n(t(e))))));case 8:return s(o(a(i(r(n(t(e)))))));case 9:return c(s(o(a(i(r(n(t(e))))))));default:{let e=arguments[0];for(let t=1;t<arguments.length;t++)e=arguments[t](e);return e}}}const Ma=e=>(t,n)=>t===n||e(t,n),Na=A(2,(e,t)=>Ma((n,r)=>e(t(n),t(r)))),Pa=e=>Ma((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0});var Fa=`effect/GlobalValue`,Ia;const La=(e,t)=>(Ia||=(globalThis[Fa]??=new Map,globalThis[Fa]),Ia.has(e)||Ia.set(e,t()),Ia.get(e)),Ra=e=>typeof e==`string`,za=e=>typeof e==`number`,Ba=e=>typeof e==`boolean`,Va=e=>typeof e==`bigint`,Ha=e=>typeof e==`symbol`,Ua=Ta,Wa=e=>e===void 0,Ga=e=>!1,Ka=e=>typeof e==`object`&&!!e,qa=e=>Ka(e)||Ua(e),M=A(2,(e,t)=>qa(e)&&t in e),Ja=A(2,(e,t)=>M(e,`_tag`)&&e._tag===t),Ya=e=>e==null,Xa=e=>e!=null,Za=e=>e instanceof Uint8Array,Qa=e=>e instanceof Date,$a=e=>typeof e==`string`||M(e,Symbol.iterator),eo=e=>Ka(e)&&!Array.isArray(e),to=e=>M(e,`then`)&&Ua(e.then),no=e=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;Symbol.iterator;var ro=class e{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new e(this.self)}},io=335903614,ao=4150755663,oo=1481765933,so=1284865837,co=9007199254740992,lo=134217728,uo=class{_state;constructor(e,t,n,r){return Ya(t)&&Ya(e)?(t=Math.random()*4294967295>>>0,e=0):Ya(t)&&(t=e,e=0),Ya(r)&&Ya(n)?(r=this._state?this._state[3]:ao,n=this._state?this._state[2]:io):Ya(r)&&(r=n,n=0),this._state=new Int32Array([0,0,n>>>0,((r||0)|1)>>>0]),this._next(),po(this._state,this._state[0],this._state[1],e>>>0,t>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(e){this._state[0]=e[0],this._state[1]=e[1],this._state[2]=e[2],this._state[3]=e[3]|1}integer(e){return Math.round(this.number()*(2**53-1))%e}number(){let e=(this._next()&67108863)*1,t=(this._next()&134217727)*1;return(e*lo+t)/co}_next(){let e=this._state[0]>>>0,t=this._state[1]>>>0;fo(this._state,e,t,oo,so),po(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let n=e>>>18,r=(t>>>18|e<<14)>>>0;n=(n^e)>>>0,r=(r^t)>>>0;let i=(r>>>27|n<<5)>>>0,a=e>>>27,o=(-a>>>0&31)>>>0;return(i>>>a|i<<o)>>>0}};function fo(e,t,n,r,i){let a=(n>>>16)*(i&65535)>>>0,o=(n&65535)*(i>>>16)>>>0,s=(n&65535)*(i&65535)>>>0,c=(n>>>16)*(i>>>16)+((o>>>16)+(a>>>16))>>>0;o=o<<16>>>0,s=s+o>>>0,s>>>0<o>>>0&&(c=c+1>>>0),a=a<<16>>>0,s=s+a>>>0,s>>>0<a>>>0&&(c=c+1>>>0),c=c+Math.imul(n,r)>>>0,c=c+Math.imul(t,i)>>>0,e[0]=c,e[1]=s}function po(e,t,n,r,i){let a=t+r>>>0,o=n+i>>>0;o>>>0<n>>>0&&(a=a+1|0),e[0]=a,e[1]=o}const mo=Symbol.for(`effect/Utils/YieldWrap`);var ho=class{#e;constructor(e){this.#e=e}[mo](){return this.#e}};function go(e){if(typeof e==`object`&&e&&mo in e)return e[mo]();throw Error(no(`yieldWrapGet`))}const _o=La(`effect/Utils/isStructuralRegion`,()=>({enabled:!1,tester:void 0}));var vo={effect_internal_function:e=>e()};const yo=vo.effect_internal_function(()=>Error().stack)?.includes(`effect_internal_function`)===!0?vo.effect_internal_function:{effect_internal_function:e=>{try{return e()}finally{}}}.effect_internal_function;(function*(){}).constructor;var bo=La(Symbol.for(`effect/Hash/randomHashCache`),()=>new WeakMap);const N=Symbol.for(`effect/Hash`),P=e=>{if(_o.enabled===!0)return 0;switch(typeof e){case`number`:return wo(e);case`bigint`:return To(e.toString(10));case`boolean`:return To(String(e));case`symbol`:return To(String(e));case`string`:return To(e);case`undefined`:return To(`undefined`);case`function`:case`object`:return e===null?To(`null`):e instanceof Date?Number.isNaN(e.getTime())?To(`Invalid Date`):P(e.toISOString()):e instanceof URL?P(e.href):Co(e)?e[N]():xo(e);default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},xo=e=>(bo.has(e)||bo.set(e,wo(Math.floor(Math.random()*(2**53-1)))),bo.get(e)),F=e=>t=>t*53^e,So=e=>e&3221225471|e>>>1&1073741824,Co=e=>M(e,N),wo=e=>{if(e!==e||e===1/0)return 0;let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return So(t)},To=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return So(t)},Eo=(e,t)=>{let n=12289;for(let r=0;r<t.length;r++)n^=j(To(t[r]),F(P(e[t[r]])));return So(n)},Do=e=>Eo(e,Object.keys(e)),Oo=e=>{let t=6151;for(let n=0;n<e.length;n++)t=j(t,F(P(e[n])));return So(t)},ko=function(){if(arguments.length===1){let e=arguments[0];return function(t){return Object.defineProperty(e,N,{value(){return t},enumerable:!1}),t}}let e=arguments[0],t=arguments[1];return Object.defineProperty(e,N,{value(){return t},enumerable:!1}),t},I=Symbol.for(`effect/Equal`);function Ao(){return arguments.length===1?e=>jo(e,arguments[0]):jo(arguments[0],arguments[1])}function jo(e,t){if(e===t)return!0;let n=typeof e;if(n!==typeof t)return!1;if(n===`object`||n===`function`){if(e!==null&&t!==null){if(Mo(e)&&Mo(t))return P(e)===P(t)&&e[I](t)?!0:_o.enabled&&_o.tester?_o.tester(e,t):!1;if(e instanceof Date&&t instanceof Date){let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}else if(e instanceof URL&&t instanceof URL)return e.href===t.href}if(_o.enabled){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>jo(e,t[n]));if(Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){let n=Object.keys(e),r=Object.keys(t);if(n.length===r.length){for(let r of n)if(!(r in t&&jo(e[r],t[r])))return _o.tester?_o.tester(e,t):!1;return!0}}return _o.tester?_o.tester(e,t):!1}}return _o.enabled&&_o.tester?_o.tester(e,t):!1}const Mo=e=>M(e,I),No=()=>Ao,Po=Symbol.for(`nodejs.util.inspect.custom`),Fo=e=>{try{if(M(e,`toJSON`)&&Ua(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Fo)}catch{return{}}return Xo(e)};var Io=`[Circular]`;function Lo(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Ro(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function zo(e){return Ra(e)?JSON.stringify(e):String(e)}function Bo(e,t){let n=t?.space??0,r=new WeakSet,i=n?za(n)?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,n=0){if(Array.isArray(e)){if(r.has(e))return Io;if(r.add(e),!i||e.length<=1)return`[${e.map(e=>c(e,n)).join(`,`)}]`;let t=e.map(e=>c(e,n+1)).join(`,
|
|
10
|
+
`+a(n+1));return`[\n${a(n+1)}${t}\n${a(n)}]`}if(Qa(e))return Lo(e);if(!t?.ignoreToString&&M(e,`toString`)&&Ua(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Ro(e);return e instanceof Error&&e.cause?`${t} (cause: ${c(e.cause,n)})`:t}if(Ra(e))return JSON.stringify(e);if(za(e)||e==null||Ba(e)||Ha(e))return String(e);if(Va(e))return String(e)+`n`;if(e instanceof Set||e instanceof Map)return r.has(e)?Io:(r.add(e),`${e.constructor.name}(${c(Array.from(e),n)})`);if(qa(e)){if(r.has(e))return Io;r.add(e);let t=s(e);return!i||t.length<=1?o(e,`{${t.map(t=>`${zo(t)}:${c(e[t],n)}`).join(`,`)}}`):o(e,`{\n${t.map(t=>`${a(n+1)}${zo(t)}: ${c(e[t],n+1)}`).join(`,
|
|
11
|
+
`)}\n${a(n)}}`)}return String(e)}return c(e,0)}const Vo=e=>JSON.stringify(e,null,2),Ho={toJSON(){return Fo(this)},[Po](){return this.toJSON()},toString(){return Vo(this.toJSON())}};var Uo=class{[Po](){return this.toJSON()}toString(){return Vo(this.toJSON())}};const Wo=(e,t=2)=>{if(typeof e==`string`)return e;try{return typeof e==`object`?Go(e,t):String(e)}catch{return String(e)}},Go=(e,t)=>{let n=[],r=JSON.stringify(e,(e,t)=>typeof t==`object`&&t?n.includes(t)?void 0:n.push(t)&&(Jo.fiberRefs!==void 0&&qo(t)?t[Ko](Jo.fiberRefs):t):t,t);return n=void 0,r},Ko=Symbol.for(`effect/Inspectable/Redactable`),qo=e=>typeof e==`object`&&!!e&&Ko in e;var Jo=La(`effect/Inspectable/redactableState`,()=>({fiberRefs:void 0}));const Yo=(e,t)=>{let n=Jo.fiberRefs;Jo.fiberRefs=e;try{return t()}finally{Jo.fiberRefs=n}},Xo=e=>qo(e)&&Jo.fiberRefs!==void 0?e[Ko](Jo.fiberRefs):e,L=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},Zo=`Async`,Qo=`Commit`,$o=`Failure`,es=`OnFailure`,ts=`OnSuccess`,ns=`OnSuccessAndFailure`,rs=`Success`,is=`Sync`,as=`UpdateRuntimeFlags`,os=`While`,ss=`Iterator`,cs=`WithRuntime`,ls=`Yield`,us=`RevertFlags`;var ds=`3.19.19`;const fs=()=>ds,ps=Symbol.for(`effect/Effect`),ms=Symbol.for(`effect/Stream`),hs=Symbol.for(`effect/Sink`),gs=Symbol.for(`effect/Channel`),_s={_R:e=>e,_E:e=>e,_A:e=>e,_V:fs()};var vs={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e},ys={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e};const bs={[ps]:_s,[ms]:_s,[hs]:vs,[gs]:ys,[I](e){return this===e},[N](){return ko(this,xo(this))},[Symbol.iterator](){return new ro(new ho(this))},pipe(){return L(this,arguments)}},xs={[N](){return ko(this,Do(this))},[I](e){let t=Object.keys(this),n=Object.keys(e);if(t.length!==n.length)return!1;for(let n of t)if(!(n in e&&Ao(this[n],e[n])))return!1;return!0}},Ss={...bs,_op:Qo},Cs={...Ss,...xs},ws=function(){function e(){}return e.prototype=Ss,e}();var Ts=Symbol.for(`effect/Option`),Es={...bs,[Ts]:{_A:e=>e},[Po](){return this.toJSON()},toString(){return Vo(this.toJSON())}},Ds=Object.assign(Object.create(Es),{_tag:`Some`,_op:`Some`,[I](e){return As(e)&&Ms(e)&&Ao(this.value,e.value)},[N](){return ko(this,F(P(this._tag))(P(this.value)))},toJSON(){return{_id:`Option`,_tag:this._tag,value:Fo(this.value)}}}),Os=P(`None`),ks=Object.assign(Object.create(Es),{_tag:`None`,_op:`None`,[I](e){return As(e)&&js(e)},[N](){return Os},toJSON(){return{_id:`Option`,_tag:this._tag}}});const As=e=>M(e,Ts),js=e=>e._tag===`None`,Ms=e=>e._tag===`Some`,Ns=Object.create(ks),Ps=e=>{let t=Object.create(Ds);return t.value=e,t},Fs=Symbol.for(`effect/Either`);var Is={...bs,[Fs]:{_R:e=>e},[Po](){return this.toJSON()},toString(){return Vo(this.toJSON())}},Ls=Object.assign(Object.create(Is),{_tag:`Right`,_op:`Right`,[I](e){return zs(e)&&Vs(e)&&Ao(this.right,e.right)},[N](){return F(P(this._tag))(P(this.right))},toJSON(){return{_id:`Either`,_tag:this._tag,right:Fo(this.right)}}}),Rs=Object.assign(Object.create(Is),{_tag:`Left`,_op:`Left`,[I](e){return zs(e)&&Bs(e)&&Ao(this.left,e.left)},[N](){return F(P(this._tag))(P(this.left))},toJSON(){return{_id:`Either`,_tag:this._tag,left:Fo(this.left)}}});const zs=e=>M(e,Fs),Bs=e=>e._tag===`Left`,Vs=e=>e._tag===`Right`,Hs=e=>{let t=Object.create(Rs);return t.left=e,t},Us=e=>{let t=Object.create(Ls);return t.right=e,t},R=Hs;var Ws=e=>{if(Ua(e))try{return Us(e())}catch(e){return R(e)}else try{return Us(e.try())}catch(t){return R(e.catch(t))}};const Gs=zs,Ks=Bs,qs=Vs,Js=A(2,(e,{onLeft:t,onRight:n})=>Ks(e)?R(t(e.left)):Us(n(e.right))),Ys=A(2,(e,t)=>Ks(e)?R(t(e.left)):Us(e.right)),Xs=A(2,(e,t)=>qs(e)?Us(t(e.right)):R(e.left)),Zs=A(2,(e,{onLeft:t,onRight:n})=>Ks(e)?t(e.left):n(e.right)),Qs=Zs({onLeft:Ea,onRight:Ea}),$s=A(2,(e,t)=>{if(qs(e))return e.right;throw t(e.left)}),ec=$s(()=>Error(`getOrThrow called on a Left`)),tc=e=>e.length>0,nc=e=>(t,n)=>t===n?0:e(t,n),rc=nc((e,t)=>e<t?-1:1),ic=A(2,(e,t)=>nc((n,r)=>e(t(n),t(r)))),ac=e=>A(2,(t,n)=>e(t,n)===1),z=()=>Ns,B=Ps,oc=js,sc=Ms,cc=A(2,(e,{onNone:t,onSome:n})=>oc(e)?t():n(e.value)),lc=A(2,(e,t)=>oc(e)?t():e.value),uc=A(2,(e,t)=>oc(e)?t():e),dc=A(2,(e,t)=>oc(e)?B(t()):e),fc=e=>e==null?z():B(e),pc=lc(Aa),mc=e=>(...t)=>{try{return B(e(...t))}catch{return z()}},hc=A(2,(e,t)=>{if(sc(e))return e.value;throw t()})(()=>Error(`getOrThrow called on a None`)),gc=A(2,(e,t)=>oc(e)?z():B(t(e.value))),_c=A(2,(e,t)=>oc(e)?z():t(e.value)),vc=A(2,(e,t)=>oc(e)?z():fc(t(e.value))),yc=(e=>A(2,(t,n)=>oc(t)?!1:e(t.value,n)))(No()),bc=A(2,(e,t)=>oc(e)?!1:t(e.value)),xc=e=>(t,n)=>oc(t)?n:oc(n)?t:B(e(t.value,n.value)),Sc=(...e)=>e,Cc=A(2,(e,t)=>{let n={...e};for(let r of wc(e))n[r]=t(e[r],r);return n}),wc=e=>Object.keys(e),Tc=e=>Array(e),Ec=A(2,(e,t)=>{let n=Math.max(1,Math.floor(e)),r=Array(n);for(let e=0;e<n;e++)r[e]=t(e);return r}),Dc=e=>Array.isArray(e)?e:Array.from(e),Oc=e=>Array.isArray(e)?e:[e],kc=A(2,(e,{onEmpty:t,onNonEmpty:n})=>Ic(e)?n(Hc(e),Gc(e)):t()),Ac=A(2,(e,t)=>[t,...e]),jc=A(2,(e,t)=>[...e,t]),Mc=A(2,(e,t)=>Dc(e).concat(Dc(t))),Nc=Array.isArray,Pc=e=>e.length===0,Fc=tc,Ic=tc;var Lc=(e,t)=>e<0||e>=t.length,Rc=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length));const zc=A(2,(e,t)=>{let n=Math.floor(t);return Lc(n,e)?z():B(e[n])}),Bc=A(2,(e,t)=>{let n=Math.floor(t);if(Lc(n,e))throw Error(`Index ${n} out of bounds`);return e[n]}),Vc=zc(0),Hc=Bc(0),Uc=e=>Ic(e)?B(Wc(e)):z(),Wc=e=>e[e.length-1],Gc=e=>e.slice(1);var Kc=(e,t)=>{let n=0;for(let r of e){if(!t(r,n))break;n++}return n};const qc=A(2,(e,t)=>el(e,Kc(e,t))),Jc=A(2,(e,t)=>{let n=Dc(e);return n.slice(Rc(t,n),n.length)}),Yc=e=>Array.from(e).reverse(),Xc=A(2,(e,t)=>{let n=Array.from(e);return n.sort(t),n}),Zc=A(2,(e,t)=>Qc(e,t,Sc)),Qc=A(3,(e,t,n)=>{let r=Dc(e),i=Dc(t);if(Ic(r)&&Ic(i)){let e=[n(Hc(r),Hc(i))],t=Math.min(r.length,i.length);for(let a=1;a<t;a++)e[a]=n(r[a],i[a]);return e}return[]});var $c=No();const el=A(2,(e,t)=>{let n=Array.from(e),r=Math.floor(t);return Ic(n)?r>=1?tl(n,r):[[],n]:[n,[]]}),tl=A(2,(e,t)=>{let n=Math.max(1,Math.floor(t));return n>=e.length?[nl(e),[]]:[Ac(e.slice(1,n),Hc(e)),e.slice(n)]}),nl=e=>e.slice(),rl=A(3,(e,t,n)=>{let r=Dc(e),i=Dc(t);return Ic(r)?Ic(i)?hl(n)(Mc(r,i)):r:i}),il=A(2,(e,t)=>rl(e,t,$c)),al=()=>[],ol=e=>[e],sl=A(2,(e,t)=>e.map(t)),cl=A(2,(e,t)=>{if(Pc(e))return[];let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r);for(let e=0;e<i.length;e++)n.push(i[e])}return n}),ll=cl(Ea),ul=A(2,(e,t)=>{let n=Dc(e),r=[];for(let e=0;e<n.length;e++){let i=t(n[e],e);sc(i)&&r.push(i.value)}return r}),dl=A(2,(e,t)=>{let n=Dc(e),r=[];for(let e=0;e<n.length;e++)t(n[e],e)&&r.push(n[e]);return r}),fl=A(3,(e,t,n)=>Dc(e).reduce((e,t,r)=>n(e,t,r),t)),pl=(e,t)=>{let n=[],r=e,i;for(;sc(i=t(r));){let[e,t]=i.value;n.push(e),r=t}return n},ml=Pa,hl=A(2,(e,t)=>{let n=Dc(e);if(Ic(n)){let e=[Hc(n)],r=Gc(n);for(let n of r)e.every(e=>!t(n,e))&&e.push(n);return e}return[]}),gl=e=>hl(e,No()),_l=A(2,(e,t)=>Dc(e).join(t));var vl=Symbol.for(`effect/Chunk`);function yl(e,t,n,r,i){for(let a=t;a<Math.min(e.length,t+i);a++)n[r+a-t]=e[a];return n}var bl=[];const xl=e=>Ma((t,n)=>t.length===n.length&&Ml(t).every((t,r)=>e(t,Ll(n,r))));var Sl=xl(Ao),Cl={[vl]:{_A:e=>e},toString(){return Vo(this.toJSON())},toJSON(){return{_id:`Chunk`,values:Ml(this).map(Fo)}},[Po](){return this.toJSON()},[I](e){return Tl(e)&&Sl(this,e)},[N](){return ko(this,Oo(Ml(this)))},[Symbol.iterator](){switch(this.backing._tag){case`IArray`:return this.backing.array[Symbol.iterator]();case`IEmpty`:return bl[Symbol.iterator]();default:return Ml(this)[Symbol.iterator]()}},pipe(){return L(this,arguments)}},wl=e=>{let t=Object.create(Cl);switch(t.backing=e,e._tag){case`IEmpty`:t.length=0,t.depth=0,t.left=t,t.right=t;break;case`IConcat`:t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break;case`IArray`:t.length=e.array.length,t.depth=0,t.left=El,t.right=El;break;case`ISingleton`:t.length=1,t.depth=0,t.left=El,t.right=El;break;case`ISlice`:t.length=e.length,t.depth=e.chunk.depth+1,t.left=El,t.right=El;break}return t};const Tl=e=>M(e,vl);var El=wl({_tag:`IEmpty`});const Dl=()=>El,Ol=(...e)=>Il(e),kl=e=>wl({_tag:`ISingleton`,a:e}),Al=e=>Tl(e)?e:Fl(Dc(e));var jl=(e,t,n)=>{switch(e.backing._tag){case`IArray`:yl(e.backing.array,0,t,n,e.length);break;case`IConcat`:jl(e.left,t,n),jl(e.right,t,n+e.left.length);break;case`ISingleton`:t[n]=e.backing.a;break;case`ISlice`:{let r=0,i=n;for(;r<e.length;)t[i]=Ll(e,r),r+=1,i+=1;break}}};const Ml=e=>{switch(e.backing._tag){case`IEmpty`:return bl;case`IArray`:return e.backing.array;default:{let t=Array(e.length);return jl(e,t,0),e.backing={_tag:`IArray`,array:t},e.left=El,e.right=El,e.depth=0,t}}},Nl=e=>{switch(e.backing._tag){case`IEmpty`:case`ISingleton`:return e;case`IArray`:return wl({_tag:`IArray`,array:Yc(e.backing.array)});case`IConcat`:return wl({_tag:`IConcat`,left:Nl(e.backing.right),right:Nl(e.backing.left)});case`ISlice`:return Fl(Yc(Ml(e)))}},Pl=A(2,(e,t)=>t<0||t>=e.length?z():B(Ll(e,t))),Fl=e=>e.length===0?Dl():e.length===1?kl(e[0]):wl({_tag:`IArray`,array:e}),Il=e=>Fl(e),Ll=A(2,(e,t)=>{switch(e.backing._tag){case`IEmpty`:throw Error(`Index out of bounds`);case`ISingleton`:if(t!==0)throw Error(`Index out of bounds`);return e.backing.a;case`IArray`:if(t>=e.length||t<0)throw Error(`Index out of bounds`);return e.backing.array[t];case`IConcat`:return t<e.left.length?Ll(e.left,t):Ll(e.right,t-e.left.length);case`ISlice`:return Ll(e.backing.chunk,t+e.backing.offset)}}),Rl=A(2,(e,t)=>Ul(e,kl(t))),zl=A(2,(e,t)=>Ul(kl(t),e)),Bl=A(2,(e,t)=>{if(t<=0)return El;if(t>=e.length)return e;switch(e.backing._tag){case`ISlice`:return wl({_tag:`ISlice`,chunk:e.backing.chunk,length:t,offset:e.backing.offset});case`IConcat`:return t>e.left.length?wl({_tag:`IConcat`,left:e.left,right:Bl(e.right,t-e.left.length)}):Bl(e.left,t);default:return wl({_tag:`ISlice`,chunk:e,offset:0,length:t})}}),Vl=A(2,(e,t)=>{if(t<=0)return e;if(t>=e.length)return El;switch(e.backing._tag){case`ISlice`:return wl({_tag:`ISlice`,chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case`IConcat`:return t>e.left.length?Vl(e.right,t-e.left.length):wl({_tag:`IConcat`,left:Vl(e.left,t),right:e.right});default:return wl({_tag:`ISlice`,chunk:e,offset:t,length:e.length-t})}}),Hl=A(2,(e,t)=>{let n=Ml(e),r=n.length,i=0;for(;i<r&&t(n[i]);)i++;return Vl(e,i)}),Ul=A(2,(e,t)=>{if(e.backing._tag===`IEmpty`)return t;if(t.backing._tag===`IEmpty`)return e;let n=t.depth-e.depth;if(Math.abs(n)<=1)return wl({_tag:`IConcat`,left:e,right:t});if(n<-1)if(e.left.depth>=e.right.depth){let n=Ul(e.right,t);return wl({_tag:`IConcat`,left:e.left,right:n})}else{let n=Ul(e.right.right,t);if(n.depth===e.depth-3){let t=wl({_tag:`IConcat`,left:e.right.left,right:n});return wl({_tag:`IConcat`,left:e.left,right:t})}else return wl({_tag:`IConcat`,left:wl({_tag:`IConcat`,left:e.left,right:e.right.left}),right:n})}else if(t.right.depth>=t.left.depth)return wl({_tag:`IConcat`,left:Ul(e,t.left),right:t.right});else{let n=Ul(e,t.left.left);return n.depth===t.depth-3?wl({_tag:`IConcat`,left:wl({_tag:`IConcat`,left:n,right:t.left.right}),right:t.right}):wl({_tag:`IConcat`,left:n,right:wl({_tag:`IConcat`,left:t.left.right,right:t.right})})}}),Wl=A(2,(e,t)=>Fl(dl(e,t))),Gl=A(2,(e,t)=>{if(e.backing._tag===`ISingleton`)return t(e.backing.a,0);let n=El,r=0;for(let i of e)n=Ul(n,t(i,r++));return n})(Ea),Kl=e=>e.length===0,ql=e=>e.length>0,Jl=Pl(0),Yl=e=>Ll(e,0),Xl=Yl,Zl=e=>Ll(e,e.length-1),Ql=A(2,(e,t)=>e.backing._tag===`ISingleton`?kl(t(e.backing.a,0)):Fl(j(Ml(e),sl((e,n)=>t(e,n))))),$l=A(2,(e,t)=>[Bl(e,t),Vl(e,t)]),eu=e=>Vl(e,1),tu=A(2,(e,t)=>Vl(e,e.length-t)),nu=fl;function ru(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function iu(e,t){return t>>>e&31}function au(e){return 1<<e}function ou(e,t){return ru(e&t-1)}const su=(e,t)=>({value:e,previous:t});function cu(e,t,n,r){let i=r;if(!e){let e=r.length;i=Array(e);for(let t=0;t<e;++t)i[t]=r[t]}return i[t]=n,i}function lu(e,t,n){let r=n.length-1,i=0,a=0,o=n;if(e)i=a=t;else for(o=Array(r);i<t;)o[a++]=n[i++];for(++i;i<=r;)o[a++]=n[i++];return e&&(o.length=r),o}function uu(e,t,n,r){let i=r.length;if(e){let e=i;for(;e>=t;)r[e--]=r[e];return r[t]=n,r}let a=0,o=0,s=Array(i+1);for(;a<t;)s[o++]=r[a++];for(s[t]=n;a<i;)s[++o]=r[a++];return s}var du=class e{_tag=`EmptyNode`;modify(t,n,r,i,a,o){let s=r(z());return oc(s)?new e:(++o.value,new hu(t,i,a,s))}};function fu(e){return Ja(e,`EmptyNode`)}function pu(e){return fu(e)||e._tag===`LeafNode`||e._tag===`CollisionNode`}function mu(e,t){return fu(e)?!1:t===e.edit}var hu=class e{edit;hash;key;value;_tag=`LeafNode`;constructor(e,t,n,r){this.edit=e,this.hash=t,this.key=n,this.value=r}modify(t,n,r,i,a,o){if(Ao(a,this.key)){let n=r(this.value);return n===this.value?this:oc(n)?(--o.value,new du):mu(this,t)?(this.value=n,this):new e(t,i,a,n)}let s=r(z());return oc(s)?this:(++o.value,Su(t,n,this.hash,this,i,new e(t,i,a,s)))}},gu=class e{edit;hash;children;_tag=`CollisionNode`;constructor(e,t,n){this.edit=e,this.hash=t,this.children=n}modify(t,n,r,i,a,o){if(i===this.hash){let n=mu(this,t),i=this.updateCollisionList(n,t,this.hash,this.children,r,a,o);return i===this.children?this:i.length>1?new e(t,this.hash,i):i[0]}let s=r(z());return oc(s)?this:(++o.value,Su(t,n,this.hash,this,i,new hu(t,i,a,s)))}updateCollisionList(e,t,n,r,i,a,o){let s=r.length;for(let c=0;c<s;++c){let s=r[c];if(`key`in s&&Ao(a,s.key)){let l=s.value,u=i(l);return u===l?r:oc(u)?(--o.value,lu(e,c,r)):cu(e,c,new hu(t,n,a,u),r)}}let c=i(z());return oc(c)?r:(++o.value,cu(e,s,new hu(t,n,a,c),r))}},_u=class e{edit;mask;children;_tag=`IndexedNode`;constructor(e,t,n){this.edit=e,this.mask=t,this.children=n}modify(t,n,r,i,a,o){let s=this.mask,c=this.children,l=iu(n,i),u=au(l),d=ou(s,u),f=s&u,p=mu(this,t);if(!f){let f=new du().modify(t,n+5,r,i,a,o);return f?c.length>=16?bu(t,l,f,s,c):new e(t,s|u,uu(p,d,f,c)):this}let m=c[d],h=m.modify(t,n+5,r,i,a,o);if(m===h)return this;let g=s,_;if(fu(h)){if(g&=~u,!g)return new du;if(c.length<=2&&pu(c[d^1]))return c[d^1];_=lu(p,d,c)}else _=cu(p,d,h,c);return p?(this.mask=g,this.children=_,this):new e(t,g,_)}},vu=class e{edit;size;children;_tag=`ArrayNode`;constructor(e,t,n){this.edit=e,this.size=t,this.children=n}modify(t,n,r,i,a,o){let s=this.size,c=this.children,l=iu(n,i),u=c[l],d=(u||new du).modify(t,n+5,r,i,a,o);if(u===d)return this;let f=mu(this,t),p;if(fu(u)&&!fu(d))++s,p=cu(f,l,d,c);else if(!fu(u)&&fu(d)){if(--s,s<=8)return yu(t,s,l,c);p=cu(f,l,new du,c)}else p=cu(f,l,d,c);return f?(this.size=s,this.children=p,this):new e(t,s,p)}};function yu(e,t,n,r){let i=Array(t-1),a=0,o=0;for(let e=0,t=r.length;e<t;++e)if(e!==n){let t=r[e];t&&!fu(t)&&(i[a++]=t,o|=1<<e)}return new _u(e,o,i)}function bu(e,t,n,r,i){let a=[],o=r,s=0;for(let e=0;o;++e)o&1&&(a[e]=i[s++]),o>>>=1;return a[t]=n,new vu(e,s+1,a)}function xu(e,t,n,r,i,a){if(n===i)return new gu(e,n,[a,r]);let o=iu(t,n),s=iu(t,i);if(o===s)return t=>new _u(e,au(o)|au(s),[t]);{let t=o<s?[r,a]:[a,r];return new _u(e,au(o)|au(s),t)}}function Su(e,t,n,r,i,a){let o,s=t;for(;;){let t=xu(e,s,n,r,i,a);if(typeof t==`function`)o=su(t,o),s+=5;else{let e=t;for(;o!=null;)e=o.value(e),o=o.previous;return e}}}var Cu=`effect/HashMap`;const wu=Symbol.for(Cu);var Tu={[wu]:wu,[Symbol.iterator](){return new Du(this,(e,t)=>[e,t])},[N](){let e=P(Cu);for(let t of this)e^=j(P(t[0]),F(P(t[1])));return ko(this,e)},[I](e){if(Pu(e)){if(e._size!==this._size)return!1;for(let t of this){let n=j(e,Lu(t[0],P(t[0])));if(oc(n)||!Ao(t[1],n.value))return!1}return!0}return!1},toString(){return Vo(this.toJSON())},toJSON(){return{_id:`HashMap`,values:Array.from(this).map(Fo)}},[Po](){return this.toJSON()},pipe(){return L(this,arguments)}},Eu=(e,t,n,r)=>{let i=Object.create(Tu);return i._editable=e,i._edit=t,i._root=n,i._size=r,i},Du=class e{map;f;v;constructor(e,t){this.map=e,this.f=t,this.v=ku(this.map._root,this.f,void 0)}next(){if(oc(this.v))return{done:!0,value:void 0};let e=this.v.value;return this.v=Ou(e.cont),{done:!1,value:e.value}}[Symbol.iterator](){return new e(this.map,this.f)}},Ou=e=>e?Au(e[0],e[1],e[2],e[3],e[4]):z(),ku=(e,t,n=void 0)=>{switch(e._tag){case`LeafNode`:return sc(e.value)?B({value:t(e.key,e.value.value),cont:n}):Ou(n);case`CollisionNode`:case`ArrayNode`:case`IndexedNode`:{let r=e.children;return Au(r.length,r,0,t,n)}default:return Ou(n)}},Au=(e,t,n,r,i)=>{for(;n<e;){let a=t[n++];if(a&&!fu(a))return ku(a,r,[e,t,n,r,i])}return Ou(i)},ju=Eu(!1,0,new du,0);const Mu=()=>ju,Nu=e=>{let t=Uu(Mu());for(let n of e)zu(t,n[0],n[1]);return Wu(t)},Pu=e=>M(e,wu),Fu=e=>e&&fu(e._root),Iu=A(2,(e,t)=>Lu(e,t,P(t))),Lu=A(3,(e,t,n)=>{let r=e._root,i=0;for(;;)switch(r._tag){case`LeafNode`:return Ao(t,r.key)?r.value:z();case`CollisionNode`:if(n===r.hash){let e=r.children;for(let n=0,r=e.length;n<r;++n){let r=e[n];if(`key`in r&&Ao(t,r.key))return r.value}}return z();case`IndexedNode`:{let e=au(iu(i,n));if(r.mask&e){r=r.children[ou(r.mask,e)],i+=5;break}return z()}case`ArrayNode`:if(r=r.children[iu(i,n)],r){i+=5;break}return z();default:return z()}}),Ru=A(2,(e,t)=>sc(Lu(e,t,P(t)))),zu=A(3,(e,t,n)=>Gu(e,t,()=>B(n))),Bu=A(3,(e,t,n)=>e._editable?(e._root=t,e._size=n,e):t===e._root?e:Eu(e._editable,e._edit,t,n)),Vu=e=>new Du(e,e=>e),Hu=e=>e._size,Uu=e=>Eu(!0,e._edit+1,e._root,e._size),Wu=e=>(e._editable=!1,e),Gu=A(3,(e,t,n)=>Ku(e,t,P(t),n)),Ku=A(4,(e,t,n,r)=>{let i={value:e._size};return j(e,Bu(e._root.modify(e._editable?e._edit:NaN,0,r,n,t,i),i.value))}),qu=A(2,(e,t)=>Gu(e,t,z)),Ju=A(2,(e,t)=>Xu(e,Mu(),(e,n,r)=>zu(e,r,t(n,r)))),Yu=A(2,(e,t)=>Xu(e,void 0,(e,n,r)=>t(n,r))),Xu=A(3,(e,t,n)=>{let r=e._root;if(r._tag===`LeafNode`)return sc(r.value)?n(t,r.value.value,r.key):t;if(r._tag===`EmptyNode`)return t;let i=[r.children],a;for(;a=i.pop();)for(let e=0,r=a.length;e<r;){let r=a[e++];r&&!fu(r)&&(r._tag===`LeafNode`?sc(r.value)&&(t=n(t,r.value.value,r.key)):i.push(r.children))}return t});var Zu=`effect/HashSet`;const Qu=Symbol.for(Zu);var $u={[Qu]:Qu,[Symbol.iterator](){return Vu(this._keyMap)},[N](){return ko(this,F(P(this._keyMap))(P(Zu)))},[I](e){return td(e)?Hu(this._keyMap)===Hu(e._keyMap)&&Ao(this._keyMap,e._keyMap):!1},toString(){return Vo(this.toJSON())},toJSON(){return{_id:`HashSet`,values:Array.from(this).map(Fo)}},[Po](){return this.toJSON()},pipe(){return L(this,arguments)}};const ed=e=>{let t=Object.create($u);return t._keyMap=e,t},td=e=>M(e,Qu);var nd=ed(Mu());const rd=()=>nd,id=e=>{let t=ud(rd());for(let n of e)pd(t,n);return dd(t)},ad=(...e)=>{let t=ud(rd());for(let n of e)pd(t,n);return dd(t)},od=A(2,(e,t)=>Ru(e._keyMap,t)),sd=A(2,(e,t)=>{let n=!1;for(let r of e)if(n=t(r),n)break;return n}),cd=A(2,(e,t)=>!sd(e,e=>!t(e))),ld=e=>Hu(e._keyMap),ud=e=>ed(Uu(e._keyMap)),dd=e=>(e._keyMap._editable=!1,e),fd=A(2,(e,t)=>{let n=ud(e);return t(n),dd(n)}),pd=A(2,(e,t)=>e._keyMap._editable?(zu(t,!0)(e._keyMap),e):ed(zu(t,!0)(e._keyMap))),md=A(2,(e,t)=>e._keyMap._editable?(qu(t)(e._keyMap),e):ed(qu(t)(e._keyMap))),hd=A(2,(e,t)=>fd(e,e=>{for(let n of t)md(e,n)})),gd=A(2,(e,t)=>fd(rd(),n=>{_d(e,e=>pd(n,e));for(let e of t)pd(n,e)})),_d=A(2,(e,t)=>Yu(e._keyMap,(e,n)=>t(n))),vd=A(3,(e,t,n)=>Xu(e._keyMap,t,(e,t,r)=>n(e,r))),yd=rd,bd=id,xd=ad,Sd=od,Cd=cd,wd=ld,Td=pd,Ed=md,Dd=hd,Od=gd,kd=vd,Ad=`Empty`,jd=`Fail`,Md=`Interrupt`,Nd=`Parallel`,Pd=`Sequential`;var Fd=`effect/Cause`;const Id=Symbol.for(Fd);var Ld={_E:e=>e},Rd={[Id]:Ld,[N](){return j(P(Fd),F(P(df(this))),ko(this))},[I](e){return Gd(e)&&uf(this,e)},pipe(){return L(this,arguments)},toJSON(){switch(this._tag){case`Empty`:return{_id:`Cause`,_tag:this._tag};case`Die`:return{_id:`Cause`,_tag:this._tag,defect:Fo(this.defect)};case`Interrupt`:return{_id:`Cause`,_tag:this._tag,fiberId:this.fiberId.toJSON()};case`Fail`:return{_id:`Cause`,_tag:this._tag,failure:Fo(this.error)};case`Sequential`:case`Parallel`:return{_id:`Cause`,_tag:this._tag,left:Fo(this.left),right:Fo(this.right)}}},toString(){return xf(this)},[Po](){return this.toJSON()}};const zd=(()=>{let e=Object.create(Rd);return e._tag=Ad,e})(),Bd=e=>{let t=Object.create(Rd);return t._tag=jd,t.error=e,t},Vd=e=>{let t=Object.create(Rd);return t._tag=`Die`,t.defect=e,t},Hd=e=>{let t=Object.create(Rd);return t._tag=Md,t.fiberId=e,t},Ud=(e,t)=>{let n=Object.create(Rd);return n._tag=Nd,n.left=e,n.right=t,n},Wd=(e,t)=>{let n=Object.create(Rd);return n._tag=Pd,n.left=e,n.right=t,n},Gd=e=>M(e,Id),Kd=e=>e._tag===Ad,qd=e=>e._tag===jd,Jd=e=>e._tag===`Die`,Yd=e=>e._tag===`Empty`?!0:yf(e,!0,(e,t)=>{switch(t._tag){case Ad:return B(e);case`Die`:case jd:case Md:return B(!1);default:return z()}}),Xd=e=>sc(rf(e)),Zd=e=>bf(void 0,hf)(e),Qd=e=>Nl(yf(e,Dl(),(e,t)=>t._tag===`Fail`?B(j(e,zl(t.error))):z())),$d=e=>Nl(yf(e,Dl(),(e,t)=>t._tag===`Die`?B(j(e,zl(t.defect))):z())),ef=e=>yf(e,yd(),(e,t)=>t._tag===`Interrupt`?B(j(e,Td(t.fiberId))):z()),tf=e=>pf(e,e=>e._tag===`Fail`?B(e.error):z()),nf=e=>{let t=tf(e);switch(t._tag){case`None`:return Us(e);case`Some`:return R(t.value)}},rf=e=>pf(e,e=>e._tag===`Interrupt`?B(e.fiberId):z()),af=e=>vf(e,{onEmpty:z(),onFail:e=>B(Vd(e)),onDie:e=>B(Vd(e)),onInterrupt:()=>z(),onSequential:xc(Wd),onParallel:xc(Ud)}),of=e=>vf(e,{onEmpty:zd,onFail:()=>zd,onDie:Vd,onInterrupt:Hd,onSequential:Wd,onParallel:Ud}),sf=e=>vf(e,{onEmpty:zd,onFail:Vd,onDie:Vd,onInterrupt:Hd,onSequential:Wd,onParallel:Ud}),cf=A(2,(e,t)=>lf(e,e=>Bd(t(e)))),lf=A(2,(e,t)=>vf(e,{onEmpty:zd,onFail:e=>t(e),onDie:e=>Vd(e),onInterrupt:e=>Hd(e),onSequential:(e,t)=>Wd(e,t),onParallel:(e,t)=>Ud(e,t)}));var uf=(e,t)=>{let n=kl(e),r=kl(t);for(;ql(n)&&ql(r);){let[e,t]=j(Xl(n),yf([yd(),Dl()],([e,t],n)=>{let[r,i]=mf(n);return B([j(e,Od(r)),j(t,Ul(i))])})),[i,a]=j(Xl(r),yf([yd(),Dl()],([e,t],n)=>{let[r,i]=mf(n);return B([j(e,Od(r)),j(t,Ul(i))])}));if(!Ao(e,i))return!1;n=t,r=a}return!0},df=e=>ff(kl(e),Dl()),ff=(e,t)=>{for(;;){let[n,r]=j(e,fl([yd(),Dl()],([e,t],n)=>{let[r,i]=mf(n);return[j(e,Od(r)),j(t,Ul(i))]})),i=wd(n)>0?j(t,zl(n)):t;if(Kl(r))return Nl(i);e=r,t=i}throw Error(no(`Cause.flattenCauseLoop`))};const pf=A(2,(e,t)=>{let n=[e];for(;n.length>0;){let e=n.pop(),r=t(e);switch(r._tag){case`None`:switch(e._tag){case Pd:case Nd:n.push(e.right),n.push(e.left);break}break;case`Some`:return r}}return z()});var mf=e=>{let t=e,n=[],r=yd(),i=Dl();for(;t!==void 0;)switch(t._tag){case Ad:if(n.length===0)return[r,i];t=n.pop();break;case jd:if(r=Td(r,Ol(t._tag,t.error)),n.length===0)return[r,i];t=n.pop();break;case`Die`:if(r=Td(r,Ol(t._tag,t.defect)),n.length===0)return[r,i];t=n.pop();break;case Md:if(r=Td(r,Ol(t._tag,t.fiberId)),n.length===0)return[r,i];t=n.pop();break;case Pd:switch(t.left._tag){case Ad:t=t.right;break;case Pd:t=Wd(t.left.left,Wd(t.left.right,t.right));break;case Nd:t=Ud(Wd(t.left.left,t.right),Wd(t.left.right,t.right));break;default:i=zl(i,t.right),t=t.left;break}break;case Nd:n.push(t.right),t=t.left;break}throw Error(no(`Cause.evaluateCauseLoop`))},hf={emptyCase:Oa,failCase:ka,dieCase:ka,interruptCase:Oa,sequentialCase:(e,t,n)=>t&&n,parallelCase:(e,t,n)=>t&&n},gf=`SequentialCase`,_f=`ParallelCase`;const vf=A(2,(e,{onDie:t,onEmpty:n,onFail:r,onInterrupt:i,onParallel:a,onSequential:o})=>bf(e,void 0,{emptyCase:()=>n,failCase:(e,t)=>r(t),dieCase:(e,n)=>t(n),interruptCase:(e,t)=>i(t),sequentialCase:(e,t,n)=>o(t,n),parallelCase:(e,t,n)=>a(t,n)})),yf=A(3,(e,t,n)=>{let r=t,i=e,a=[];for(;i!==void 0;){let e=n(r,i);switch(r=sc(e)?e.value:r,i._tag){case Pd:a.push(i.right),i=i.left;break;case Nd:a.push(i.right),i=i.left;break;default:i=void 0;break}i===void 0&&a.length>0&&(i=a.pop())}return r}),bf=A(3,(e,t,n)=>{let r=[e],i=[];for(;r.length>0;){let e=r.pop();switch(e._tag){case Ad:i.push(Us(n.emptyCase(t)));break;case jd:i.push(Us(n.failCase(t,e.error)));break;case`Die`:i.push(Us(n.dieCase(t,e.defect)));break;case Md:i.push(Us(n.interruptCase(t,e.fiberId)));break;case Pd:r.push(e.right),r.push(e.left),i.push(R({_tag:gf}));break;case Nd:r.push(e.right),r.push(e.left),i.push(R({_tag:_f}));break}}let a=[];for(;i.length>0;){let e=i.pop();switch(e._tag){case`Left`:switch(e.left._tag){case gf:{let e=a.pop(),r=a.pop(),i=n.sequentialCase(t,e,r);a.push(i);break}case _f:{let e=a.pop(),r=a.pop(),i=n.parallelCase(t,e,r);a.push(i);break}}break;case`Right`:a.push(e.right);break}}if(a.length===0)throw Error(`BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues`);return a.pop()}),xf=(e,t)=>Zd(e)?`All fibers interrupted without errors.`:kf(e).map(function(e){return t?.renderErrorCause!==!0||e.cause===void 0?e.stack:`${e.stack} {\n${Sf(e.cause,` `)}\n}`}).join(`
|
|
12
|
+
`);var Sf=(e,t)=>{let n=e.stack.split(`
|
|
13
|
+
`),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${Sf(e.cause,`${t} `)}\n${t}}`),r},Cf=class e extends globalThis.Error{span=void 0;constructor(t){let n=typeof t==`object`&&!!t,r=Error.stackTraceLimit;Error.stackTraceLimit=1,super(wf(t),n&&`cause`in t&&t.cause!==void 0?{cause:new e(t.cause)}:void 0),this.message===``&&(this.message=`An error has occurred`),Error.stackTraceLimit=r,this.name=t instanceof Error?t.name:`Error`,n&&(Of in t&&(this.span=t[Of]),Object.keys(t).forEach(e=>{e in this||(this[e]=t[e])})),this.stack=Df(`${this.name}: ${this.message}`,t instanceof Error&&t.stack?t.stack:``,this.span)}};const wf=e=>{if(typeof e==`string`)return e;if(typeof e==`object`&&e&&e instanceof Error)return e.message;try{if(M(e,`toString`)&&Ua(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==globalThis.Array.prototype.toString)return e.toString()}catch{}return Go(e)};var Tf=/\((.*)\)/g;const Ef=La(`effect/Tracer/spanToTrace`,()=>new WeakMap);var Df=(e,t,n)=>{let r=[e],i=t.startsWith(e)?t.slice(e.length).split(`
|
|
14
|
+
`):t.split(`
|
|
15
|
+
`);for(let e=1;e<i.length;e++){if(i[e].includes(` at new BaseEffectError`)||i[e].includes(` at new YieldableError`)){e++;continue}if(i[e].includes(`Generator.next`)||i[e].includes(`effect_internal_function`))break;r.push(i[e].replace(/at .*effect_instruction_i.*\((.*)\)/,`at $1`).replace(/EffectPrimitive\.\w+/,`<anonymous>`))}if(n){let e=n,t=0;for(;e&&e._tag===`Span`&&t<10;){let n=Ef.get(e);if(typeof n==`function`){let t=n();if(typeof t==`string`){let n=t.matchAll(Tf),i=!1;for(let[,t]of n)i=!0,r.push(` at ${e.name} (${t})`);i||r.push(` at ${e.name} (${t.replace(/^at /,``)})`)}else r.push(` at ${e.name}`)}else r.push(` at ${e.name}`);e=pc(e.parent),t++}}return r.join(`
|
|
16
|
+
`)};const Of=Symbol.for(`effect/SpanAnnotation`),kf=e=>bf(e,void 0,{emptyCase:()=>[],dieCase:(e,t)=>[new Cf(t)],failCase:(e,t)=>[new Cf(t)],interruptCase:()=>[],parallelCase:(e,t,n)=>[...t,...n],sequentialCase:(e,t,n)=>[...t,...n]}),Af=Symbol.for(`effect/Context/Tag`),jf=Symbol.for(`effect/Context/Reference`),Mf=Symbol.for(`effect/STM`),Nf={...bs,_op:`Tag`,[Mf]:_s,[Af]:{_Service:e=>e,_Identifier:e=>e},toString(){return Vo(this.toJSON())},toJSON(){return{_id:`Tag`,key:this.key,stack:this.stack}},[Po](){return this.toJSON()},of(e){return e},context(e){return qf(this,e)}},Pf={...Nf,[jf]:jf},Ff=e=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=2;let n=Error();Error.stackTraceLimit=t;let r=Object.create(Nf);return Object.defineProperty(r,`stack`,{get(){return n.stack}}),r.key=e,r},If=e=>()=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=2;let n=Error();Error.stackTraceLimit=t;function r(){}return Object.setPrototypeOf(r,Nf),r.key=e,Object.defineProperty(r,`stack`,{get(){return n.stack}}),r},Lf=()=>(e,t)=>{let n=Error.stackTraceLimit;Error.stackTraceLimit=2;let r=Error();Error.stackTraceLimit=n;function i(){}return Object.setPrototypeOf(i,Pf),i.key=e,i.defaultValue=t.defaultValue,Object.defineProperty(i,`stack`,{get(){return r.stack}}),i},Rf=Symbol.for(`effect/Context`),zf={[Rf]:{_Services:e=>e},[I](e){if(Hf(e)&&this.unsafeMap.size===e.unsafeMap.size){for(let t of this.unsafeMap.keys())if(!e.unsafeMap.has(t)||!Ao(this.unsafeMap.get(t),e.unsafeMap.get(t)))return!1;return!0}return!1},[N](){return ko(this,wo(this.unsafeMap.size))},pipe(){return L(this,arguments)},toString(){return Vo(this.toJSON())},toJSON(){return{_id:`Context`,services:Array.from(this.unsafeMap).map(Fo)}},[Po](){return this.toJSON()}},Bf=e=>{let t=Object.create(zf);return t.unsafeMap=e,t};var Vf=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(e.stack){let n=e.stack.split(`
|
|
17
|
+
`);if(n.length>2){let e=n[2].match(/at (.*)/);e&&(t.message+=` (defined at ${e[1]})`)}}if(t.stack){let e=t.stack.split(`
|
|
18
|
+
`);e.splice(1,3),t.stack=e.join(`
|
|
19
|
+
`)}return t};const Hf=e=>M(e,Rf),Uf=e=>M(e,Af),Wf=e=>M(e,jf);var Gf=Bf(new Map);const Kf=()=>Gf,qf=(e,t)=>Bf(new Map([[e.key,t]])),Jf=A(3,(e,t,n)=>{let r=new Map(e.unsafeMap);return r.set(t.key,n),Bf(r)});var Yf=La(`effect/Context/defaultValueCache`,()=>new Map),Xf=e=>{if(Yf.has(e.key))return Yf.get(e.key);let t=e.defaultValue();return Yf.set(e.key,t),t};const Zf=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):Xf(t),Qf=A(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(jf in t)return Xf(t);throw Vf(t)}return e.unsafeMap.get(t.key)}),$f=Qf,ep=A(2,(e,t)=>e.unsafeMap.has(t.key)?Ps(e.unsafeMap.get(t.key)):Wf(t)?Ps(Xf(t)):Ns),tp=A(2,(e,t)=>{let n=new Map(e.unsafeMap);for(let[e,r]of t.unsafeMap)n.set(e,r);return Bf(n)}),np=(...e)=>{let t=new Map;for(let n=0;n<e.length;n++)e[n].unsafeMap.forEach((e,n)=>{t.set(n,e)});return Bf(t)},rp=Ff,ip=Bf,ap=Hf,op=Uf,sp=Kf,cp=qf,lp=Jf,up=$f,dp=Qf,fp=ep,pp=tp,mp=np,hp=If,gp=Lf;var _p=Symbol.for(`effect/Duration`),vp=BigInt(0),yp=BigInt(24),bp=BigInt(60),xp=BigInt(1e3),Sp=BigInt(1e6),Cp=BigInt(1e9),wp=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;const Tp=e=>{if(Ap(e))return e;if(za(e))return Ip(e);if(Va(e))return Pp(e);if(Array.isArray(e)&&e.length===2&&e.every(za))return e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1])?Mp:e[0]===1/0||e[1]===1/0?Np:Pp(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));if(Ra(e)){let t=wp.exec(e);if(t){let[e,n,r]=t,i=Number(n);switch(r){case`nano`:case`nanos`:return Pp(BigInt(n));case`micro`:case`micros`:return Fp(BigInt(n));case`milli`:case`millis`:return Ip(i);case`second`:case`seconds`:return Lp(i);case`minute`:case`minutes`:return Rp(i);case`hour`:case`hours`:return zp(i);case`day`:case`days`:return Bp(i);case`week`:case`weeks`:return Vp(i)}}}throw Error(`Invalid DurationInput`)};var Ep={_tag:`Millis`,millis:0},Dp={_tag:`Infinity`},Op={[_p]:_p,[N](){return ko(this,Do(this.value))},[I](e){return Ap(e)&&Xp(this,e)},toString(){return`Duration(${Qp(this)})`},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,hrtime:Wp(this)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`}}},[Po](){return this.toJSON()},pipe(){return L(this,arguments)}},kp=e=>{let t=Object.create(Op);return za(e)?isNaN(e)||e<=0?t.value=Ep:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:`Millis`,millis:e}:t.value={_tag:`Nanos`,nanos:BigInt(Math.round(e*1e6))}:t.value=Dp:e<=vp?t.value=Ep:t.value={_tag:`Nanos`,nanos:e},t};const Ap=e=>M(e,_p),jp=e=>{switch(e.value._tag){case`Millis`:return e.value.millis===0;case`Nanos`:return e.value.nanos===vp;case`Infinity`:return!1}},Mp=kp(0),Np=kp(1/0),Pp=e=>kp(e),Fp=e=>kp(e*xp),Ip=e=>kp(e),Lp=e=>kp(e*1e3),Rp=e=>kp(e*6e4),zp=e=>kp(e*36e5),Bp=e=>kp(e*864e5),Vp=e=>kp(e*6048e5),Hp=e=>Gp(e,{onMillis:e=>e,onNanos:e=>Number(e)/1e6}),Up=e=>{let t=Tp(e);switch(t.value._tag){case`Infinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return BigInt(Math.round(t.value.millis*1e6))}},Wp=e=>{let t=Tp(e);switch(t.value._tag){case`Infinity`:return[1/0,0];case`Nanos`:return[Number(t.value.nanos/Cp),Number(t.value.nanos%Cp)];case`Millis`:return[Math.floor(t.value.millis/1e3),Math.round(t.value.millis%1e3*1e6)]}},Gp=A(2,(e,t)=>{let n=Tp(e);switch(n.value._tag){case`Nanos`:return t.onNanos(n.value.nanos);case`Infinity`:return t.onMillis(1/0);case`Millis`:return t.onMillis(n.value.millis)}}),Kp=A(3,(e,t,n)=>{let r=Tp(e),i=Tp(t);if(r.value._tag===`Infinity`||i.value._tag===`Infinity`)return n.onMillis(Hp(r),Hp(i));if(r.value._tag===`Nanos`||i.value._tag===`Nanos`){let e=r.value._tag===`Nanos`?r.value.nanos:BigInt(Math.round(r.value.millis*1e6)),t=i.value._tag===`Nanos`?i.value.nanos:BigInt(Math.round(i.value.millis*1e6));return n.onNanos(e,t)}return n.onMillis(r.value.millis,i.value.millis)}),qp=(e,t)=>Kp(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t}),Jp=A(2,(e,t)=>Kp(e,t,{onMillis:(e,t)=>e<=t,onNanos:(e,t)=>e<=t})),Yp=A(2,(e,t)=>Kp(e,t,{onMillis:(e,t)=>e>=t,onNanos:(e,t)=>e>=t})),Xp=A(2,(e,t)=>qp(Tp(e),Tp(t))),Zp=e=>{let t=Tp(e);if(t.value._tag===`Infinity`)return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};let n=Up(t),r=n/Sp,i=r/xp,a=i/bp,o=a/bp,s=o/yp;return{days:Number(s),hours:Number(o%yp),minutes:Number(a%bp),seconds:Number(i%bp),millis:Number(r%xp),nanos:Number(n%Sp)}},Qp=e=>{let t=Tp(e);if(t.value._tag===`Infinity`)return`Infinity`;if(jp(t))return`0`;let n=Zp(t),r=[];return n.days!==0&&r.push(`${n.days}d`),n.hours!==0&&r.push(`${n.hours}h`),n.minutes!==0&&r.push(`${n.minutes}m`),n.seconds!==0&&r.push(`${n.seconds}s`),n.millis!==0&&r.push(`${n.millis}ms`),n.nanos!==0&&r.push(`${n.nanos}ns`),r.join(` `)};var $p=Symbol.for(`effect/MutableRef`),eee={[$p]:$p,toString(){return Vo(this.toJSON())},toJSON(){return{_id:`MutableRef`,current:Fo(this.current)}},[Po](){return this.toJSON()},pipe(){return L(this,arguments)}};const em=e=>{let t=Object.create(eee);return t.current=e,t},tee=A(3,(e,t,n)=>Ao(t,e.current)?(e.current=n,!0):!1),tm=e=>e.current,nm=A(2,(e,t)=>(e.current=t,e));var rm=`effect/FiberId`;const im=Symbol.for(rm);var am=`None`,om=`Runtime`,sm=`Composite`,nee=To(`${rm}-${am}`),ree=class{[im]=im;_tag=am;id=-1;startTimeMillis=-1;[N](){return nee}[I](e){return dm(e)&&e._tag===am}toString(){return Vo(this.toJSON())}toJSON(){return{_id:`FiberId`,_tag:this._tag}}[Po](){return this.toJSON()}},cm=class{id;startTimeMillis;[im]=im;_tag=om;constructor(e,t){this.id=e,this.startTimeMillis=t}[N](){return ko(this,To(`${rm}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[I](e){return dm(e)&&e._tag===om&&this.id===e.id&&this.startTimeMillis===e.startTimeMillis}toString(){return Vo(this.toJSON())}toJSON(){return{_id:`FiberId`,_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[Po](){return this.toJSON()}},lm=class{left;right;[im]=im;_tag=sm;constructor(e,t){this.left=e,this.right=t}_hash;[N](){return j(To(`${rm}-${this._tag}`),F(P(this.left)),F(P(this.right)),ko(this))}[I](e){return dm(e)&&e._tag===sm&&Ao(this.left,e.left)&&Ao(this.right,e.right)}toString(){return Vo(this.toJSON())}toJSON(){return{_id:`FiberId`,_tag:this._tag,left:Fo(this.left),right:Fo(this.right)}}[Po](){return this.toJSON()}};const um=new ree,iee=(e,t)=>new cm(e,t),aee=(e,t)=>new lm(e,t),dm=e=>M(e,im),fm=e=>e._tag===am||j(vm(e),Cd(e=>fm(e))),pm=A(2,(e,t)=>e._tag===am?t:t._tag===am?e:new lm(e,t)),oee=e=>j(e,kd(um,(e,t)=>pm(t)(e))),mm=e=>{switch(e._tag){case am:return yd();case om:return xd(e.id);case sm:return j(mm(e.left),Od(mm(e.right)))}};var hm=La(Symbol.for(`effect/Fiber/Id/_fiberCounter`),()=>em(0));const gm=(e,t)=>new cm(e,t),_m=e=>Array.from(mm(e)).map(e=>`#${e}`).join(`,`),vm=e=>{switch(e._tag){case am:return yd();case om:return xd(e);case sm:return j(vm(e.left),Od(vm(e.right)))}},see=()=>{let e=tm(hm);return j(hm,nm(e+1)),new cm(e,Date.now())},ym=um,bm=iee,xm=aee,Sm=pm,Cm=oee,wm=mm,Tm=gm,Em=_m,Dm=vm,Om=see,km=Mu,Am=Nu,jm=Fu,Mm=Iu,Nm=zu,Pm=Vu,cee=Gu,lee=Ju,uee=Yu,Fm=Xu,Im=Symbol.for(`effect/List`),Lm=e=>Dc(e);var dee=(e=>Na(ml(e),Lm))(Ao),fee={[Im]:Im,_tag:`Cons`,toString(){return Vo(this.toJSON())},toJSON(){return{_id:`List`,_tag:`Cons`,values:Lm(this).map(Fo)}},[Po](){return this.toJSON()},[I](e){return Vm(e)&&this._tag===e._tag&&dee(this,e)},[N](){return ko(this,Oo(Lm(this)))},[Symbol.iterator](){let e=!1,t=this;return{next(){if(e)return this.return();if(t._tag===`Nil`)return e=!0,this.return();let n=t.head;return t=t.tail,{done:e,value:n}},return(t){return e||=!0,{done:!0,value:t}}}},pipe(){return L(this,arguments)}},Rm=(e,t)=>{let n=Object.create(fee);return n.head=e,n.tail=t,n},pee=To(`Nil`),zm={[Im]:Im,_tag:`Nil`,toString(){return Vo(this.toJSON())},toJSON(){return{_id:`List`,_tag:`Nil`}},[Po](){return this.toJSON()},[N](){return pee},[I](e){return Vm(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return L(this,arguments)}},Bm=Object.create(zm);const Vm=e=>M(e,Im),Hm=e=>e._tag===`Nil`,Um=e=>e._tag===`Cons`,Wm=()=>Bm,Gm=(e,t)=>Rm(e,t),Km=Wm,qm=e=>Rm(e,Bm),Jm=A(2,(e,t)=>Xm(t,e)),Ym=A(2,(e,t)=>Gm(t,e)),Xm=A(2,(e,t)=>{if(Hm(e))return t;if(Hm(t))return e;{let n=Rm(t.head,e),r=n,i=t.tail;for(;!Hm(i);){let t=Rm(i.head,e);r.tail=t,r=t,i=i.tail}return n}}),Zm=A(3,(e,t,n)=>{let r=t,i=e;for(;!Hm(i);)r=n(r,i.head),i=i.tail;return r}),Qm=e=>{let t=Km(),n=e;for(;!Hm(n);)t=Ym(t,n.head),n=n.tail;return t};Array.prototype;const $m=function(){function e(e){e&&Object.assign(this,e)}return e.prototype=xs,e}();({...$m.prototype});const eh=Symbol.for(`effect/DifferContextPatch`);function th(e){return e}var nh={...$m.prototype,[eh]:{_Value:th,_Patch:th}},rh=Object.assign(Object.create(nh),{_tag:`Empty`}),ih=Object.create(rh);const ah=()=>ih;var oh=Object.assign(Object.create(nh),{_tag:`AndThen`}),sh=(e,t)=>{let n=Object.create(oh);return n.first=e,n.second=t,n},ch=Object.assign(Object.create(nh),{_tag:`AddService`}),lh=(e,t)=>{let n=Object.create(ch);return n.key=e,n.service=t,n},uh=Object.assign(Object.create(nh),{_tag:`RemoveService`}),dh=e=>{let t=Object.create(uh);return t.key=e,t},fh=Object.assign(Object.create(nh),{_tag:`UpdateService`}),ph=(e,t)=>{let n=Object.create(fh);return n.key=e,n.update=t,n};const mh=(e,t)=>{let n=new Map(e.unsafeMap),r=ah();for(let[e,i]of t.unsafeMap.entries())if(n.has(e)){let t=n.get(e);n.delete(e),Ao(t,i)||(r=hh(ph(e,()=>i))(r))}else n.delete(e),r=hh(lh(e,i))(r);for(let[e]of n.entries())r=hh(dh(e))(r);return r},hh=A(2,(e,t)=>sh(e,t)),gh=A(2,(e,t)=>{if(e._tag===`Empty`)return t;let n=!1,r=kl(e),i=new Map(t.unsafeMap);for(;ql(r);){let e=Xl(r),t=eu(r);switch(e._tag){case`Empty`:r=t;break;case`AddService`:i.set(e.key,e.service),r=t;break;case`AndThen`:r=zl(zl(t,e.second),e.first);break;case`RemoveService`:i.delete(e.key),r=t;break;case`UpdateService`:i.set(e.key,e.update(i.get(e.key))),n=!0,r=t;break}}if(!n)return Bf(i);let a=new Map;for(let[e]of t.unsafeMap)i.has(e)&&(a.set(e,i.get(e)),i.delete(e));for(let[e,t]of i)a.set(e,t);return Bf(a)});({...$m.prototype});const _h=Symbol.for(`effect/DifferHashSetPatch`);function vh(e){return e}var yh={...$m.prototype,[_h]:{_Value:vh,_Key:vh,_Patch:vh}},bh=Object.assign(Object.create(yh),{_tag:`Empty`}),xh=Object.create(bh);const Sh=()=>xh;var Ch=Object.assign(Object.create(yh),{_tag:`AndThen`});const mee=(e,t)=>{let n=Object.create(Ch);return n.first=e,n.second=t,n};var hee=Object.assign(Object.create(yh),{_tag:`Add`});const gee=e=>{let t=Object.create(hee);return t.value=e,t};var _ee=Object.assign(Object.create(yh),{_tag:`Remove`});const vee=e=>{let t=Object.create(_ee);return t.value=e,t},yee=(e,t)=>{let[n,r]=kd([e,Sh()],([e,t],n)=>Sd(n)(e)?[Ed(n)(e),t]:[e,wh(gee(n))(t)])(t);return kd(r,(e,t)=>wh(vee(t))(e))(n)},wh=A(2,(e,t)=>mee(e,t)),bee=A(2,(e,t)=>{if(e._tag===`Empty`)return t;let n=t,r=kl(e);for(;ql(r);){let e=Xl(r),t=eu(r);switch(e._tag){case`Empty`:r=t;break;case`AndThen`:r=zl(e.first)(zl(e.second)(t));break;case`Add`:n=Td(e.value)(n),r=t;break;case`Remove`:n=Ed(e.value)(n),r=t}}return n});({...$m.prototype});const xee=Symbol.for(`effect/DifferReadonlyArrayPatch`);function Th(e){return e}var Eh={...$m.prototype,[xee]:{_Value:Th,_Patch:Th}},See=Object.assign(Object.create(Eh),{_tag:`Empty`}),Cee=Object.create(See);const Dh=()=>Cee;var wee=Object.assign(Object.create(Eh),{_tag:`AndThen`}),Tee=(e,t)=>{let n=Object.create(wee);return n.first=e,n.second=t,n},Eee=Object.assign(Object.create(Eh),{_tag:`Append`}),Dee=e=>{let t=Object.create(Eee);return t.values=e,t},Oee=Object.assign(Object.create(Eh),{_tag:`Slice`}),kee=(e,t)=>{let n=Object.create(Oee);return n.from=e,n.until=t,n},Aee=Object.assign(Object.create(Eh),{_tag:`Update`}),jee=(e,t)=>{let n=Object.create(Aee);return n.index=e,n.patch=t,n};const Mee=e=>{let t=0,n=Dh();for(;t<e.oldValue.length&&t<e.newValue.length;){let r=e.oldValue[t],i=e.newValue[t],a=e.differ.diff(r,i);Ao(a,e.differ.empty)||(n=Oh(n,jee(t,a))),t+=1}return t<e.oldValue.length&&(n=Oh(n,kee(0,t))),t<e.newValue.length&&(n=Oh(n,Dee(Jc(t)(e.newValue)))),n},Oh=A(2,(e,t)=>Tee(e,t)),kh=A(3,(e,t,n)=>{if(e._tag===`Empty`)return t;let r=t.slice(),i=ol(e);for(;Fc(i);){let e=Hc(i),t=Gc(i);switch(e._tag){case`Empty`:i=t;break;case`AndThen`:t.unshift(e.first,e.second),i=t;break;case`Append`:for(let t of e.values)r.push(t);i=t;break;case`Slice`:r=r.slice(e.from,e.until),i=t;break;case`Update`:r[e.index]=n.patch(e.patch,r[e.index]),i=t;break}}return r}),Ah={[Symbol.for(`effect/Differ`)]:{_P:Ea,_V:Ea},pipe(){return L(this,arguments)}},jh=e=>{let t=Object.create(Ah);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},Mh=()=>jh({empty:ah(),combine:(e,t)=>hh(t)(e),diff:(e,t)=>mh(e,t),patch:(e,t)=>gh(t)(e)}),Nh=()=>jh({empty:Sh(),combine:(e,t)=>wh(t)(e),diff:(e,t)=>yee(e,t),patch:(e,t)=>bee(t)(e)}),Ph=e=>jh({empty:Dh(),combine:(e,t)=>Oh(e,t),diff:(t,n)=>Mee({oldValue:t,newValue:n,differ:e}),patch:(t,n)=>kh(t,n,e)}),Fh=()=>Ih((e,t)=>t),Ih=e=>jh({empty:Ea,combine:(e,t)=>e===Ea?t:t===Ea?e:n=>t(e(n)),diff:(e,t)=>Ao(e,t)?Ea:Da(t),patch:(t,n)=>e(n,t(n))});var Lh=255,Rh=8;const zh=e=>e&Lh,Bh=e=>e>>Rh&Lh,Vh=(e,t)=>(e&Lh)+((t&e&Lh)<<Rh),Hh=Vh(0,0),Uh=e=>Vh(e,e),Wh=e=>Vh(e,0),Gh=A(2,(e,t)=>Vh(zh(e)&~t,Bh(e))),Kh=A(2,(e,t)=>e|t),qh=e=>~e>>>0&Lh,Jh=e=>$h(e,32),Yh=A(2,(e,t)=>e&~t),Xh=A(2,(e,t)=>e|t),Zh=e=>Qh(e)&&!rg(e),Qh=e=>$h(e,1),$h=A(2,(e,t)=>(e&t)!==0),eg=(...e)=>e.reduce((e,t)=>e|t,0),tg=eg(0),ng=e=>$h(e,4),rg=e=>$h(e,16),ig=A(2,(e,t)=>Vh(e^t,t)),ag=A(2,(e,t)=>e&(qh(zh(t))|Bh(t))|zh(t)&Bh(t)),og=jh({empty:Hh,diff:(e,t)=>ig(e,t),combine:(e,t)=>Kh(t)(e),patch:(e,t)=>ag(t,e)}),sg=Uh,cg=Wh,lg=Gh,ug=(e,t)=>({_tag:`Par`,left:e,right:t}),dg=(e,t)=>({_tag:`Seq`,left:e,right:t}),fg=e=>{let t=qm(e),n=Km();for(;;){let[e,r]=Zm(t,[vg(),Km()],([e,t],n)=>{let[r,i]=pg(n);return[bg(e,r),Jm(t,i)]});if(n=mg(n,e),Hm(r))return Qm(n);t=r}throw Error(`BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues`)};var pg=e=>{let t=e,n=vg(),r=Km(),i=Km();for(;;)switch(t._tag){case`Empty`:if(Hm(r))return[n,i];t=r.head,r=r.tail;break;case`Par`:r=Gm(t.right,r),t=t.left;break;case`Seq`:{let e=t.left,n=t.right;switch(e._tag){case`Empty`:t=n;break;case`Par`:{let r=e.left,i=e.right;t=ug(dg(r,n),dg(i,n));break}case`Seq`:{let r=e.left,i=e.right;t=dg(r,dg(i,n));break}case`Single`:t=e,i=Gm(n,i);break}break}case`Single`:if(n=yg(n,t),Hm(r))return[n,i];t=r.head,r=r.tail;break}throw Error(`BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues`)},mg=(e,t)=>{if(Hm(e))return qm(Cg(t));if(xg(t))return e;let n=kg(e.head),r=Sg(t);return n.length===1&&r.length===1&&Ao(n[0],r[0])?Gm(Og(e.head,Cg(t)),e.tail):Gm(Cg(t),e)};const hg=Symbol.for(`effect/RequestBlock/RequestBlockParallel`);var gg={_R:e=>e},_g=class{map;[hg]=gg;constructor(e){this.map=e}};const vg=()=>new _g(km()),yg=(e,t)=>new _g(cee(e.map,t.dataSource,e=>dc(gc(e,Rl(t.blockedRequest)),()=>kl(t.blockedRequest)))),bg=(e,t)=>new _g(Fm(e.map,t.map,(e,t,n)=>Nm(e,n,cc(Mm(e,n),{onNone:()=>t,onSome:e=>Ul(t,e)})))),xg=e=>jm(e.map),Sg=e=>Array.from(Pm(e.map)),Cg=e=>Dg(lee(e.map,e=>kl(e))),wg=Symbol.for(`effect/RequestBlock/RequestBlockSequential`);var Tg={_R:e=>e},Eg=class{map;[wg]=Tg;constructor(e){this.map=e}};const Dg=e=>new Eg(e),Og=(e,t)=>new Eg(Fm(t.map,e.map,(e,t,n)=>Nm(e,n,cc(Mm(e,n),{onNone:()=>Dl(),onSome:e=>Ul(e,t)})))),kg=e=>Array.from(Pm(e.map)),Ag=e=>Array.from(e.map),jg=`Pending`,Mg=`Done`,Ng=Symbol.for(`effect/Deferred`),Pg={_E:e=>e,_A:e=>e},Fg=e=>({_tag:jg,joiners:e}),Ig=e=>({_tag:Mg,effect:e});var Lg=class e{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new e(this.self)}};const Rg=(e,t)=>{let n=new Vg(`Blocked`);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n},zg=e=>{let t=new Vg(`RunBlocked`);return t.effect_instruction_i0=e,t},Bg=Symbol.for(`effect/Effect`);var Nee=class{patch;op;_op=us;constructor(e,t){this.patch=e,this.op=t}},Vg=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Bg]=_s;constructor(e){this._op=e}[I](e){return this===e}[N](){return ko(this,xo(this))}pipe(){return L(this,arguments)}toJSON(){return{_id:`Effect`,_op:this._op,effect_instruction_i0:Fo(this.effect_instruction_i0),effect_instruction_i1:Fo(this.effect_instruction_i1),effect_instruction_i2:Fo(this.effect_instruction_i2)}}toString(){return Vo(this.toJSON())}[Po](){return this.toJSON()}[Symbol.iterator](){return new Lg(new ho(this))}},Hg=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Bg]=_s;constructor(e){this._op=e,this._tag=e}[I](e){return Jv(e)&&e._op===`Failure`&&Ao(this.effect_instruction_i0,e.effect_instruction_i0)}[N](){return j(To(this._tag),F(P(this.effect_instruction_i0)),ko(this))}get cause(){return this.effect_instruction_i0}pipe(){return L(this,arguments)}toJSON(){return{_id:`Exit`,_tag:this._op,cause:this.cause.toJSON()}}toString(){return Vo(this.toJSON())}[Po](){return this.toJSON()}[Symbol.iterator](){return new Lg(new ho(this))}},Ug=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Bg]=_s;constructor(e){this._op=e,this._tag=e}[I](e){return Jv(e)&&e._op===`Success`&&Ao(this.effect_instruction_i0,e.effect_instruction_i0)}[N](){return j(To(this._tag),F(P(this.effect_instruction_i0)),ko(this))}get value(){return this.effect_instruction_i0}pipe(){return L(this,arguments)}toJSON(){return{_id:`Exit`,_tag:this._op,value:Fo(this.value)}}toString(){return Vo(this.toJSON())}[Po](){return this.toJSON()}[Symbol.iterator](){return new Lg(new ho(this))}};const Wg=e=>M(e,Bg),Gg=e=>{let t=new Vg(cs);return t.effect_instruction_i0=e,t},Kg=A(3,(e,t,n)=>N_(r=>V(e,e=>V(o_(U(()=>r(t(e)))),t=>U(()=>n(e,t)).pipe(h_({onFailure:e=>{switch(t._tag){case $o:return l_(Wd(t.effect_instruction_i0,e));case rs:return l_(e)}},onSuccess:()=>t})))))),qg=A(2,(e,t)=>V(e,()=>H(t))),Jg=e=>qg(e,void 0),Yg=function(){let e=new Vg(Qo);switch(arguments.length){case 2:e.effect_instruction_i0=arguments[0],e.commit=arguments[1];break;case 3:e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.commit=arguments[2];break;case 4:e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.effect_instruction_i2=arguments[2],e.commit=arguments[3];break;default:throw Error(no(`you're not supposed to end up here`))}return e},Xg=(e,t=ym)=>{let n=new Vg(Zo),r;return n.effect_instruction_i0=t=>{r=e(t)},n.effect_instruction_i1=t,O_(n,e=>Wg(r)?r:P_)},Zg=(e,t=ym)=>U(()=>Xg(e,t));var Qg=(e,t=ym)=>Yg(e,function(){let e,n;function r(t){e?e(t):n===void 0&&(n=t)}let i=new Vg(Zo);i.effect_instruction_i0=t=>{e=t,n&&t(n)},i.effect_instruction_i1=t;let a,o;return this.effect_instruction_i0.length===1?a=yo(()=>this.effect_instruction_i0(r)):(o=new AbortController,a=yo(()=>this.effect_instruction_i0(r,o.signal))),a||o?O_(i,e=>(o&&o.abort(),a??P_)):i});const $g=A(2,(e,t)=>{let n=new Vg(es);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),e_=A(2,(e,t)=>g_(e,{onFailure:t,onSuccess:H}));var t_=Symbol.for(`effect/OriginalAnnotation`);const n_=(e,t)=>sc(t)?new Proxy(e,{has(e,t){return t===Of||t===t_||t in e},get(n,r){return r===Of?t.value:r===t_?e:n[r]}}):e,r_=e=>qa(e)&&!(Of in e)?Gg(t=>l_(Vd(n_(e,Ny(t))))):l_(Vd(e)),i_=e=>u_(()=>Vd(new Yee(e))),a_=e=>g_(e,{onFailure:e=>H(R(e)),onSuccess:e=>H(Us(e))}),o_=e=>m_(e,{onFailure:ny,onSuccess:ly}),s_=e=>qa(e)&&!(Of in e)?Gg(t=>l_(Bd(n_(e,Ny(t))))):l_(Bd(e)),c_=e=>V(W(e),s_),l_=e=>{let t=new Hg($o);return t.effect_instruction_i0=e,t},u_=e=>V(W(e),l_),d_=Gg(e=>H(e.id())),f_=e=>Gg(t=>e(t.id())),V=A(2,(e,t)=>{let n=new Vg(ts);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),Pee=e=>{let t=new Vg(`OnStep`);return t.effect_instruction_i0=e,t},p_=e=>V(e,Ea),m_=A(2,(e,t)=>h_(e,{onFailure:e=>H(t.onFailure(e)),onSuccess:e=>H(t.onSuccess(e))})),h_=A(2,(e,t)=>{let n=new Vg(ns);return n.effect_instruction_i0=e,n.effect_instruction_i1=t.onFailure,n.effect_instruction_i2=t.onSuccess,n}),g_=A(2,(e,t)=>h_(e,{onFailure:e=>{if($d(e).length>0)return l_(sf(e));let n=Qd(e);return n.length>0?t.onFailure(Yl(n)):l_(e)},onSuccess:t.onSuccess})),__=A(2,(e,t)=>U(()=>{let n=Dc(e),r=Tc(n.length),i=0;return qg(L_({while:()=>i<n.length,body:()=>t(n[i],i),step:e=>{r[i++]=e}}),r)})),v_=A(2,(e,t)=>U(()=>{let n=Dc(e),r=0;return L_({while:()=>r<n.length,body:()=>t(n[r],r),step:()=>{r++}})})),y_=V(d_,e=>b_(e)),b_=e=>l_(Hd(e)),x_=e=>{let t=new Vg(as);return t.effect_instruction_i0=sg(1),t.effect_instruction_i1=()=>e,t},S_=A(2,(e,t)=>N_(n=>V(o_(n(e)),e=>by(t,e)))),C_=A(2,(e,t)=>V(e,e=>W(()=>t(e)))),w_=A(2,(e,t)=>g_(e,{onFailure:e=>c_(()=>t.onFailure(e)),onSuccess:e=>W(()=>t.onSuccess(e))})),T_=A(2,(e,t)=>h_(e,{onFailure:e=>{let n=nf(e);switch(n._tag){case`Left`:return c_(()=>t(n.left));case`Right`:return l_(n.right)}},onSuccess:H})),E_=A(2,(e,t)=>D_(e,e=>Xv(e)?P_:t(e.effect_instruction_i0))),D_=A(2,(e,t)=>N_(n=>h_(n(e),{onFailure:e=>{let n=ny(e);return h_(t(n),{onFailure:t=>ny(Wd(e,t)),onSuccess:()=>n})},onSuccess:e=>{let n=ly(e);return G_(t(n),n)}}))),O_=A(2,(e,t)=>D_(e,sy({onFailure:e=>Zd(e)?Jg(t(ef(e))):P_,onSuccess:()=>P_}))),k_=A(2,(e,t)=>Ree(e,t,H)),A_=e=>Fee(e,Ea),Fee=A(2,(e,t)=>g_(e,{onFailure:e=>r_(t(e)),onSuccess:H})),Iee=Gg((e,t)=>H(t.runtimeFlags)),H=e=>{let t=new Ug(rs);return t.effect_instruction_i0=e,t},U=e=>{let t=new Vg(Qo);return t.commit=e,t},W=e=>{let t=new Vg(is);return t.effect_instruction_i0=e,t},j_=A(e=>e.length===3||e.length===2&&!(qa(e[1])&&`onlyEffect`in e[1]),(e,t)=>V(e,e=>{let n=typeof t==`function`?t(e):t;return Wg(n)?qg(n,e):to(n)?Xg(t=>{n.then(n=>t(H(e)),e=>t(s_(new qv(e,`An unknown error occurred in Effect.tap`))))}):H(e)})),Lee=e=>Gg(t=>e(uv(wv,B(j(t.getFiberRef(wv),lc(()=>t.scope())))))),Ree=A(3,(e,t,n)=>h_(e,{onFailure:e=>$d(e).length>0?l_(hc(af(e))):t(),onSuccess:n})),M_=e=>{let t=new Vg(as);return t.effect_instruction_i0=cg(1),t.effect_instruction_i1=()=>e,t},N_=e=>Yg(e,function(){let e=new Vg(as);return e.effect_instruction_i0=cg(1),e.effect_instruction_i1=e=>Qh(e)?yo(()=>this.effect_instruction_i0(x_)):yo(()=>this.effect_instruction_i0(M_)),e});var P_=H(void 0);const F_=e=>{let t=new Vg(as);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},I_=A(2,(e,t)=>V(t,t=>t?j(e,C_(B)):H(z()))),L_=e=>{let t=new Vg(os);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},R_=e=>U(()=>{let t=new Vg(ss);return t.effect_instruction_i0=e(),t}),z_=function(){let e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return R_(()=>e(j))},B_=(e,...t)=>Object.defineProperty(t.length===0?function(...t){return R_(()=>e.apply(this,t))}:function(...n){let r=R_(()=>e.apply(this,n));for(let e of t)r=e(r,...n);return r},`length`,{value:e.length,configurable:!0}),V_=A(2,(e,t)=>{let n=new Vg(as);return n.effect_instruction_i0=t,n.effect_instruction_i1=()=>e,n}),H_=e=>{let t=new Vg(ls);return e?.priority===void 0?t:Bee(t,e.priority)},U_=A(2,(e,t)=>V(e,e=>C_(t,t=>[e,t]))),W_=A(2,(e,t)=>V(e,e=>qg(t,e))),G_=A(2,(e,t)=>V(e,()=>t)),K_=A(3,(e,t,n)=>V(e,e=>C_(t,t=>n(e,t)))),q_=Zg(()=>{let e=setInterval(()=>{},2**31-1);return W(()=>clearInterval(e))}),J_=e=>V(d_,t=>j(e,Y_(t))),Y_=A(2,(e,t)=>V(e.interruptAsFork(t),()=>e.await)),X_={_tag:`All`,syslog:0,label:`ALL`,ordinal:-(2**53-1),pipe(){return L(this,arguments)}},Z_={_tag:`Fatal`,syslog:2,label:`FATAL`,ordinal:5e4,pipe(){return L(this,arguments)}},Q_={_tag:`Error`,syslog:3,label:`ERROR`,ordinal:4e4,pipe(){return L(this,arguments)}},$_={_tag:`Warning`,syslog:4,label:`WARN`,ordinal:3e4,pipe(){return L(this,arguments)}},ev={_tag:`Info`,syslog:6,label:`INFO`,ordinal:2e4,pipe(){return L(this,arguments)}},tv={_tag:`Debug`,syslog:7,label:`DEBUG`,ordinal:1e4,pipe(){return L(this,arguments)}},nv={_tag:`Trace`,syslog:7,label:`TRACE`,ordinal:0,pipe(){return L(this,arguments)}},rv={_tag:`None`,syslog:7,label:`OFF`,ordinal:2**53-1,pipe(){return L(this,arguments)}},iv=Symbol.for(`effect/FiberRef`);var av={_A:e=>e};const ov=e=>Gg(t=>ly(t.getFiberRef(e))),sv=A(2,(e,t)=>V(ov(e),t)),cv=A(2,(e,t)=>lv(e,()=>[void 0,t])),lv=A(2,(e,t)=>Gg(n=>{let[r,i]=t(n.getFiberRef(e));return n.setFiberRef(e,i),H(r)})),uv=A(3,(e,t,n)=>Kg(W_(ov(t),cv(t,n)),()=>e,e=>cv(t,e))),dv=A(3,(e,t,n)=>sv(t,r=>uv(e,t,n(r)))),fv=(e,t)=>gv(e,{differ:Fh(),fork:t?.fork??Ea,join:t?.join}),pv=e=>{let t=Nh();return gv(e,{differ:t,fork:t.empty})},mv=e=>{let t=Ph(Fh());return gv(e,{differ:t,fork:t.empty})},hv=e=>{let t=Mh();return gv(e,{differ:t,fork:t.empty})},gv=(e,t)=>({...Ss,[iv]:av,initial:e,commit(){return ov(this)},diff:(e,n)=>t.differ.diff(e,n),combine:(e,n)=>t.differ.combine(e,n),patch:e=>n=>t.differ.patch(e,n),fork:t.fork,join:t.join??((e,t)=>t)}),_v=e=>gv(e,{differ:og,fork:og.empty}),vv=La(Symbol.for(`effect/FiberRef/currentContext`),()=>hv(sp())),yv=La(Symbol.for(`effect/FiberRef/currentSchedulingPriority`),()=>fv(0)),bv=La(Symbol.for(`effect/FiberRef/currentMaxOpsBeforeYield`),()=>fv(2048)),xv=La(Symbol.for(`effect/FiberRef/currentLogAnnotation`),()=>fv(km())),Sv=La(Symbol.for(`effect/FiberRef/currentLogLevel`),()=>fv(ev)),zee=La(Symbol.for(`effect/FiberRef/currentLogSpan`),()=>fv(Km())),Bee=A(2,(e,t)=>uv(e,yv,t)),Vee=La(Symbol.for(`effect/FiberRef/currentConcurrency`),()=>fv(`unbounded`)),Hee=La(Symbol.for(`effect/FiberRef/currentRequestBatching`),()=>fv(!0)),Uee=La(Symbol.for(`effect/FiberRef/currentUnhandledErrorLogLevel`),()=>fv(B(tv))),Wee=La(Symbol.for(`effect/FiberRef/versionMismatchErrorLogLevel`),()=>fv(B($_))),Cv=La(Symbol.for(`effect/FiberRef/currentMetricLabels`),()=>mv(al())),wv=La(Symbol.for(`effect/FiberRef/currentForkScopeOverride`),()=>fv(z(),{fork:()=>z(),join:(e,t)=>e})),Tv=La(Symbol.for(`effect/FiberRef/currentInterruptedCause`),()=>fv(zd,{fork:()=>zd,join:(e,t)=>e})),Ev=La(Symbol.for(`effect/FiberRef/currentTracerEnabled`),()=>fv(!0)),Dv=La(Symbol.for(`effect/FiberRef/currentTracerTiming`),()=>fv(!0)),Gee=La(Symbol.for(`effect/FiberRef/currentTracerSpanAnnotations`),()=>fv(km())),Kee=La(Symbol.for(`effect/FiberRef/currentTracerSpanLinks`),()=>fv(Dl())),Ov=Symbol.for(`effect/Scope`),kv=Symbol.for(`effect/CloseableScope`),Av=(e,t)=>e.addFinalizer(()=>Jg(t)),jv=(e,t)=>e.addFinalizer(t),Mv=(e,t)=>e.close(t),Nv=(e,t)=>e.fork(t),qee=e=>Jee(Ea)(e),Jee=A(2,(e,t)=>{let n=j(e,tf,gc(t));switch(n._tag){case`None`:return j($d(e),Jl,cc({onNone:()=>{let t=Dc(ef(e)).flatMap(e=>Dc(wm(e)).map(e=>`#${e}`));return new Xee(t?`Interrupted by fibers: ${t.join(`, `)}`:void 0)},onSome:Ea}));case`Some`:return n.value}}),Pv=function(){class e extends globalThis.Error{commit(){return s_(this)}toJSON(){let e={...this};return this.message&&(e.message=this.message),this.cause&&(e.cause=this.cause),e}[Po](){return this.toString===globalThis.Error.prototype.toString?`Bun`in globalThis?xf(Bd(this),{renderErrorCause:!0}):this:this.stack?`${this.toString()}\n${this.stack.split(`
|
|
20
|
+
`).slice(1).join(`
|
|
21
|
+
`)}`:this.toString()}}return Object.assign(e.prototype,Cs),e}();var Fv=(e,t)=>{class n extends Pv{_tag=t}return Object.assign(n.prototype,e),n.prototype.name=t,n};const Iv=Symbol.for(`effect/Cause/errors/RuntimeException`),Yee=Fv({[Iv]:Iv},`RuntimeException`),Lv=Symbol.for(`effect/Cause/errors/InterruptedException`),Xee=Fv({[Lv]:Lv},`InterruptedException`),Rv=e=>M(e,Lv),zv=Symbol.for(`effect/Cause/errors/IllegalArgument`),Bv=Fv({[zv]:zv},`IllegalArgumentException`),Vv=Symbol.for(`effect/Cause/errors/NoSuchElement`),Hv=Fv({[Vv]:Vv},`NoSuchElementException`),Uv=Symbol.for(`effect/Cause/errors/Timeout`),Wv=Fv({[Uv]:Uv},`TimeoutException`),Gv=e=>new Wv(`Operation timed out after '${Qp(e)}'`),Kv=Symbol.for(`effect/Cause/errors/UnknownException`),qv=function(){class e extends Pv{_tag=`UnknownException`;error;constructor(e,t){super(t??`An unknown error occurred`,{cause:e}),this.error=e}}return Object.assign(e.prototype,{[Kv]:Kv,name:`UnknownException`}),e}(),Jv=e=>Wg(e)&&`_tag`in e&&(e._tag===`Success`||e._tag===`Failure`),Yv=e=>e._tag===`Failure`,Xv=e=>e._tag===`Success`,Zv=A(2,(e,t)=>{switch(e._tag){case $o:return ny(e.effect_instruction_i0);case rs:return ly(t)}}),Qv=e=>Zv(e,void 0),$v=(e,t)=>my(e,t?.parallel?Ud:Wd),ey=e=>ny(Vd(e)),ty=e=>ny(Bd(e)),ny=e=>{let t=new Hg($o);return t.effect_instruction_i0=e,t},ry=A(2,(e,t)=>{switch(e._tag){case $o:return ny(e.effect_instruction_i0);case rs:return t(e.effect_instruction_i0)}}),iy=e=>j(e,ry(Ea)),ay=e=>ny(Hd(e)),oy=A(2,(e,t)=>{switch(e._tag){case $o:return ny(e.effect_instruction_i0);case rs:return ly(t(e.effect_instruction_i0))}}),sy=A(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case $o:return t(e.effect_instruction_i0);case rs:return n(e.effect_instruction_i0)}}),cy=A(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case $o:return t(e.effect_instruction_i0);case rs:return n(e.effect_instruction_i0)}}),ly=e=>{let t=new Ug(rs);return t.effect_instruction_i0=e,t},uy=ly(void 0),dy=A(2,(e,t)=>py(e,t,{onSuccess:(e,t)=>[e,t],onFailure:Wd})),fy=A(2,(e,t)=>py(e,t,{onSuccess:(e,t)=>t,onFailure:Wd})),py=A(3,(e,t,{onFailure:n,onSuccess:r})=>{switch(e._tag){case $o:switch(t._tag){case rs:return ny(e.effect_instruction_i0);case $o:return ny(n(e.effect_instruction_i0,t.effect_instruction_i0))}case rs:switch(t._tag){case rs:return ly(r(e.effect_instruction_i0,t.effect_instruction_i0));case $o:return ny(t.effect_instruction_i0)}}});var my=(e,t)=>{let n=Al(e);return ql(n)?j(eu(n),fl(j(Xl(n),oy(kl)),(e,n)=>j(e,py(n,{onSuccess:(e,t)=>j(e,zl(t)),onFailure:t}))),oy(Nl),oy(e=>Ml(e)),B):z()};const hy=e=>({...Ss,[Ng]:Pg,state:em(Fg([])),commit(){return vy(this)},blockingOn:e}),gy=()=>V(d_,e=>_y(e)),_y=e=>W(()=>hy(e)),vy=e=>Zg(t=>{let n=tm(e.state);switch(n._tag){case Mg:return t(n.effect);case jg:return n.joiners.push(t),Ey(e,t)}},e.blockingOn),yy=A(2,(e,t)=>W(()=>{let n=tm(e.state);switch(n._tag){case Mg:return!1;case jg:nm(e.state,Ig(t));for(let e=0,r=n.joiners.length;e<r;e++)n.joiners[e](t);return!0}})),by=A(2,(e,t)=>yy(e,t)),xy=A(2,(e,t)=>yy(e,l_(t))),Sy=A(2,(e,t)=>yy(e,b_(t))),Cy=e=>W(()=>tm(e.state)._tag===Mg),wy=A(2,(e,t)=>yy(e,H(t))),Ty=(e,t)=>{let n=tm(e.state);if(n._tag===`Pending`){nm(e.state,Ig(t));for(let e=0,r=n.joiners.length;e<r;e++)n.joiners[e](t)}};var Ey=(e,t)=>W(()=>{let n=tm(e.state);if(n._tag===`Pending`){let e=n.joiners.indexOf(t);e>=0&&n.joiners.splice(e,1)}}),Dy=Gg(e=>ly(e.currentContext));const Oy=()=>Dy,ky=e=>V(Oy(),e),Ay=A(2,(e,t)=>uv(vv,t)(e)),jy=A(2,(e,t)=>dv(vv,e=>pp(e,t))(e)),My=A(2,(e,t)=>ky(n=>Ay(e,t(n)))),Ny=e=>{let t=e.currentSpan;return t!==void 0&&t._tag===`Span`?B(t):z()};var Py={_tag:`Span`,spanId:`noop`,traceId:`noop`,sampled:!1,status:{_tag:`Ended`,startTime:BigInt(0),endTime:BigInt(0),exit:uy},attributes:new Map,links:[],kind:`internal`,attribute(){},event(){},end(){},addLinks(){}};const Fy=e=>Object.assign(Object.create(Py),e),Iy=zd,Ly=Bd,Ry=Vd,zy=Hd,By=Ud,Vy=Wd,Hy=Gd,Uy=qd,Wy=Jd,Gy=Xd,Ky=ef,qy=nf,Jy=cf,Yy=qee,Xy=Bv,Zy=Hv,Qy=xf,$y=gy;var eb=vy;const tb=xy,nb=Cy,rb=wy,ib=Symbol.for(`effect/Clock`),ab=rp(`effect/Clock`),ob=2**31-1,sb={unsafeSchedule(e,t){let n=Hp(t);if(n>ob)return ka;let r=!1,i=setTimeout(()=>{r=!0,e()},n);return()=>(clearTimeout(i),!r)}};var cb=function(){let e=BigInt(1e6);if(typeof performance>`u`||typeof performance.now!=`function`)return()=>BigInt(Date.now())*e;let t;return()=>(t===void 0&&(t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6))),t+BigInt(Math.round(performance.now()*1e6)))}(),lb=function(){let e=typeof process==`object`&&`hrtime`in process&&typeof process.hrtime.bigint==`function`?process.hrtime:void 0;if(!e)return cb;let t=cb()-e.bigint();return()=>t+e.bigint()}(),ub=class{[ib]=ib;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return lb()}currentTimeMillis=W(()=>this.unsafeCurrentTimeMillis());currentTimeNanos=W(()=>this.unsafeCurrentTimeNanos());scheduler(){return H(sb)}sleep(e){return Qg(t=>Jg(W(sb.unsafeSchedule(()=>t(P_),e))))}};const db=()=>new ub,fb=rc,pb=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,`\\$&`),mb=`InvalidData`,hb=`MissingData`,gb=`SourceUnavailable`,_b=`Unsupported`,vb=Symbol.for(`effect/ConfigError`),yb={_tag:`ConfigError`,[vb]:vb},bb=(e,t)=>{let n=Object.create(yb);return n._op=`And`,n.left=e,n.right=t,Object.defineProperty(n,`toString`,{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(n,`message`,{enumerable:!1,get(){return this.toString()}}),n},xb=(e,t)=>{let n=Object.create(yb);return n._op=`Or`,n.left=e,n.right=t,Object.defineProperty(n,`toString`,{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(n,`message`,{enumerable:!1,get(){return this.toString()}}),n},Zee=(e,t,n={pathDelim:`.`})=>{let r=Object.create(yb);return r._op=mb,r.path=e,r.message=t,Object.defineProperty(r,`toString`,{enumerable:!1,value(){return`(Invalid data at ${j(this.path,_l(n.pathDelim))}: "${this.message}")`}}),r},Sb=(e,t,n={pathDelim:`.`})=>{let r=Object.create(yb);return r._op=hb,r.path=e,r.message=t,Object.defineProperty(r,`toString`,{enumerable:!1,value(){return`(Missing data at ${j(this.path,_l(n.pathDelim))}: "${this.message}")`}}),r},Qee=(e,t,n,r={pathDelim:`.`})=>{let i=Object.create(yb);return i._op=gb,i.path=e,i.message=t,i.cause=n,Object.defineProperty(i,`toString`,{enumerable:!1,value(){return`(Source unavailable at ${j(this.path,_l(r.pathDelim))}: "${this.message}")`}}),i},$ee=(e,t,n={pathDelim:`.`})=>{let r=Object.create(yb);return r._op=_b,r.path=e,r.message=t,Object.defineProperty(r,`toString`,{enumerable:!1,value(){return`(Unsupported operation at ${j(this.path,_l(n.pathDelim))}: "${this.message}")`}}),r},Cb=A(2,(e,t)=>{switch(e._op){case`And`:return bb(Cb(e.left,t),Cb(e.right,t));case`Or`:return xb(Cb(e.left,t),Cb(e.right,t));case mb:return Zee([...t,...e.path],e.message);case hb:return Sb([...t,...e.path],e.message);case gb:return Qee([...t,...e.path],e.message,e.cause);case _b:return $ee([...t,...e.path],e.message)}}),ete={_tag:`Empty`},wb=A(2,(e,t)=>{let n=qm(t),r=e;for(;Um(n);){let e=n.head;switch(e._tag){case`Empty`:n=n.tail;break;case`AndThen`:n=Gm(e.first,Gm(e.second,n.tail));break;case`MapName`:r=sl(r,e.f),n=n.tail;break;case`Nested`:r=Ac(r,e.name),n=n.tail;break;case`Unnested`:if(j(Vc(r),yc(e.name)))r=Gc(r),n=n.tail;else return R(Sb(r,`Expected ${e.name} to be in path in ConfigProvider#unnested`));break}}return Us(r)});var Tb=(e,t)=>[...e,...t];const Eb=Symbol.for(`effect/ConfigProvider`),tte=rp(`effect/ConfigProvider`),Db=Symbol.for(`effect/ConfigProviderFlat`),nte=e=>({[Eb]:Eb,pipe(){return L(this,arguments)},...e}),rte=e=>({[Db]:Db,patch:e.patch,load:(t,n,r=!0)=>e.load(t,n,r),enumerateChildren:e.enumerateChildren}),ite=e=>nte({load:t=>V(Ob(e,al(),t,!1),e=>cc(Vc(e),{onNone:()=>s_(Sb(al(),`Expected a single value having structure: ${t}`)),onSome:H})),flattened:e}),ate=e=>{let{pathDelim:t,seqDelim:n}=Object.assign({},{pathDelim:`_`,seqDelim:`,`},e),r=e=>j(e,_l(t)),i=e=>e.split(t),a=()=>(typeof process<`u`&&`env`in process,{});return ite(rte({load:(e,t,i=!0)=>{let o=r(e),s=a();return j(o in s?B(s[o]):z(),T_(()=>Sb(e,`Expected ${o} to exist in the process context`)),V(r=>ute(r,e,t,n,i)))},enumerateChildren:e=>W(()=>{let t=a();return bd(Object.keys(t).map(e=>i(e.toUpperCase())).filter(t=>{for(let n=0;n<e.length;n++){let r=j(e,Bc(n)),i=t[n];if(i===void 0||r!==i)return!1}return!0}).flatMap(t=>t.slice(e.length,e.length+1)))}),patch:ete}))};var ote=(e,t,n,r)=>{let i=pl(n.length,t=>t>=r.length?z():B([e(t),t+1])),a=pl(r.length,e=>e>=n.length?z():B([t(e),e+1]));return[Tb(n,i),Tb(r,a)]},ste=(e,t)=>{let n=t;if(n._tag===`Nested`){let t=e.slice();for(;n._tag===`Nested`;)t.push(n.name),n=n.config;return t}return e},Ob=(e,t,n,r)=>{let i=n;switch(i._tag){case`Constant`:return H(ol(i.value));case`Described`:return U(()=>Ob(e,t,i.config,r));case`Fail`:return s_(Sb(t,i.message));case`Fallback`:return j(U(()=>Ob(e,t,i.first,r)),e_(n=>i.condition(n)?j(Ob(e,t,i.second,r),e_(e=>s_(xb(n,e)))):s_(n)));case`Lazy`:return U(()=>Ob(e,t,i.config(),r));case`MapOrFail`:return U(()=>j(Ob(e,t,i.original,r),V(__(e=>j(i.mapOrFail(e),T_(Cb(ste(t,i.original))))))));case`Nested`:return U(()=>Ob(e,Tb(t,ol(i.name)),i.config,r));case`Primitive`:return j(wb(t,e.patch),V(t=>j(e.load(t,i,r),V(e=>{if(e.length===0){let e=j(Uc(t),lc(()=>`<n/a>`));return s_(Sb([],`Expected ${i.description} with name ${e}`))}return H(e)}))));case`Sequence`:return j(wb(t,e.patch),V(n=>j(e.enumerateChildren(n),V(fte),V(n=>n.length===0?U(()=>C_(Ob(e,t,i.config,!0),ol)):j(__(n,n=>Ob(e,jc(t,`[${n}]`),i.config,!0)),C_(e=>{let t=ll(e);return t.length===0?ol(al()):ol(t)}))))));case`HashMap`:return U(()=>j(wb(t,e.patch),V(t=>j(e.enumerateChildren(t),V(n=>j(n,__(n=>Ob(e,Tb(t,ol(n)),i.valueConfig,r)),C_(e=>e.length===0?ol(km()):j(dte(e),sl(e=>Am(Zc(Dc(n),e)))))))))));case`ZipWith`:return U(()=>j(Ob(e,t,i.left,r),a_,V(n=>j(Ob(e,t,i.right,r),a_,V(e=>{if(Ks(n)&&Ks(e))return s_(bb(n.left,e.left));if(Ks(n)&&qs(e))return s_(n.left);if(qs(n)&&Ks(e))return s_(e.left);if(qs(n)&&qs(e)){let r=cte(t,j(t,_l(`.`))),[a,o]=ote(r,r,j(n.right,sl(Us)),j(e.right,sl(Us)));return j(a,Zc(o),__(([e,t])=>j(U_(e,t),C_(([e,t])=>i.zip(e,t)))))}throw Error(`BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues`)})))))}},cte=(e,t)=>n=>R(Sb(e,`The element at index ${n} in a sequence at path "${t}" was missing`)),lte=(e,t)=>e.split(RegExp(`\\s*${pb(t)}\\s*`)),ute=(e,t,n,r,i)=>i?j(lte(e,r),__(e=>n.parse(e.trim())),T_(Cb(t))):j(n.parse(e),w_({onFailure:Cb(t),onSuccess:ol})),dte=e=>Object.keys(e[0]).map(t=>e.map(e=>e[t])),fte=e=>j(__(e,mte),w_({onFailure:()=>al(),onSuccess:Xc(fb)}),a_,C_(Qs)),pte=/^(\[(\d+)\])$/,mte=e=>{let t=e.match(pte);if(t!==null){let e=t[2];return j(e!==void 0&&e.length>0?B(e):z(),_c(hte))}return z()},hte=e=>{let t=Number.parseInt(e);return Number.isNaN(t)?z():B(t)};const kb=Symbol.for(`effect/Console`),Ab=rp(`effect/Console`),gte={[kb]:kb,assert(e,...t){return W(()=>{console.assert(e,...t)})},clear:W(()=>{console.clear()}),count(e){return W(()=>{console.count(e)})},countReset(e){return W(()=>{console.countReset(e)})},debug(...e){return W(()=>{console.debug(...e)})},dir(e,t){return W(()=>{console.dir(e,t)})},dirxml(...e){return W(()=>{console.dirxml(...e)})},error(...e){return W(()=>{console.error(...e)})},group(e){return e?.collapsed?W(()=>console.groupCollapsed(e?.label)):W(()=>console.group(e?.label))},groupEnd:W(()=>{console.groupEnd()}),info(...e){return W(()=>{console.info(...e)})},log(...e){return W(()=>{console.log(...e)})},table(e,t){return W(()=>{console.table(e,t)})},time(e){return W(()=>console.time(e))},timeEnd(e){return W(()=>console.timeEnd(e))},timeLog(e,...t){return W(()=>{console.timeLog(e,...t)})},trace(...e){return W(()=>{console.trace(...e)})},warn(...e){return W(()=>{console.warn(...e)})},unsafe:console},jb=Symbol.for(`effect/Random`),_te=rp(`effect/Random`);var vte=class{seed;[jb]=jb;PRNG;constructor(e){this.seed=e,this.PRNG=new uo(e)}get next(){return W(()=>this.PRNG.number())}get nextBoolean(){return C_(this.next,e=>e>.5)}get nextInt(){return W(()=>this.PRNG.integer(2**53-1))}nextRange(e,t){return C_(this.next,n=>(t-e)*n+e)}nextIntBetween(e,t){return W(()=>this.PRNG.integer(t-e)+e)}shuffle(e){return yte(e,e=>this.nextIntBetween(0,e))}},yte=(e,t)=>U(()=>j(W(()=>Array.from(e)),V(e=>{let n=[];for(let t=e.length;t>=2;--t)n.push(t);return j(n,v_(n=>j(t(n),C_(t=>bte(e,n-1,t)))),qg(Al(e)))}))),bte=(e,t,n)=>{let r=e[t];return e[t]=e[n],e[n]=r,e};const xte=e=>new vte(P(e)),Mb=Symbol.for(`effect/Tracer`),Ste=e=>({[Mb]:Mb,...e}),Nb=rp(`effect/Tracer`),Pb=rp(`effect/ParentSpan`);var Fb=function(){return function(e){let t=``;for(let n=0;n<e;n++)t+=`abcdef0123456789`.charAt(Math.floor(Math.random()*16));return t}}(),Cte=class{name;parent;context;startTime;kind;_tag=`Span`;spanId;traceId=`native`;sampled=!0;status;attributes;events=[];links;constructor(e,t,n,r,i,a){this.name=e,this.parent=t,this.context=n,this.startTime=i,this.kind=a,this.status={_tag:`Started`,startTime:i},this.attributes=new Map,this.traceId=t._tag===`Some`?t.value.traceId:Fb(32),this.spanId=Fb(16),this.links=Array.from(r)}end(e,t){this.status={_tag:`Ended`,endTime:e,exit:t,startTime:this.status.startTime}}attribute(e,t){this.attributes.set(e,t)}event(e,t,n){this.events.push([e,t,n??{}])}addLinks(e){this.links.push(...e)}};const wte=Ste({span:(e,t,n,r,i,a)=>new Cte(e,t,n,r,i,a),context:e=>e()}),Ib=e=>{if(e?.captureStackTrace===!1||e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=`boolean`)return e;let t=Error.stackTraceLimit;Error.stackTraceLimit=3;let n=Error();Error.stackTraceLimit=t;let r=!1;return{...e,captureStackTrace:()=>{if(r!==!1)return r;if(n.stack!==void 0){let e=n.stack.split(`
|
|
22
|
+
`);if(e[3]!==void 0)return r=e[3].trim(),r}}}},Lb=gp()(`effect/Tracer/DisablePropagation`,{defaultValue:ka}),Tte=j(sp(),lp(ab,db()),lp(Ab,gte),lp(_te,xte(Math.random())),lp(tte,ate()),lp(Nb,wte)),Rb=La(Symbol.for(`effect/DefaultServices/currentServices`),()=>hv(Tte)),Ete=e=>{let t=Tp(e);return zb(e=>e.sleep(t))},Dte=e=>Gg(t=>e(t.currentDefaultServices)),zb=e=>Dte(t=>e(t.unsafeMap.get(ab.key))),Ote=zb(e=>e.currentTimeMillis),kte=bs,Ate=Ss;var jte=ws,Bb=class extends jte{};const Vb=`Sequential`,Hb=`Parallel`,Ub={_tag:Vb},Wb={_tag:Hb},Mte=e=>({_tag:`ParallelN`,parallelism:e}),Nte=e=>e._tag===Vb,Pte=e=>e._tag===Hb,Gb=Ub,Kb=Wb,qb=Mte;function Fte(e){return new Yb(e)}function Ite(){return Fte(new Map)}const Jb=Symbol.for(`effect/FiberRefs`);var Yb=class{locals;[Jb]=Jb;constructor(e){this.locals=e}pipe(){return L(this,arguments)}},Lte=(e,t,n,r=!1)=>{let i=e,a=t,o=n,s=r,c;for(;c===void 0;)if(Ic(a)&&Ic(o)){let e=Hc(a)[0],t=Gc(a),n=Hc(o)[0],r=Hc(o)[1],i=Gc(o);e.startTimeMillis<n.startTimeMillis?(o=i,s=!0):e.startTimeMillis>n.startTimeMillis?a=t:e.id<n.id?(o=i,s=!0):e.id>n.id?a=t:c=[r,s]}else c=[i.initial,!0];return c};const Rte=A(3,(e,t,n)=>{let r=new Map(e.locals);return n.locals.forEach((e,n)=>{let i=e[0][1];if(!e[0][0][I](t)){if(!r.has(n)){if(Ao(i,n.initial))return;r.set(n,[[t,n.join(n.initial,i)]]);return}let a=r.get(n),[o,s]=Lte(n,a,e);if(s){let e=n.diff(o,i),s=a[0][1],c=n.join(s,n.patch(e)(s));if(!Ao(s,c)){let e,i=a[0][0];e=i[I](t)?[[i,c],...a.slice(1)]:[[t,c],...a],r.set(n,e)}}}}),new Yb(r)}),zte=A(2,(e,t)=>{let n=new Map;return Xb(e,n,t),new Yb(n)});var Xb=(e,t,n)=>{e.locals.forEach((e,r)=>{let i=e[0][1],a=r.patch(r.fork)(i);Ao(i,a)?t.set(r,e):t.set(r,[[n,a],...e])})};const Zb=A(2,(e,t)=>{let n=new Map(e.locals);return n.delete(t),new Yb(n)}),Qb=A(2,(e,t)=>e.locals.has(t)?B(Hc(e.locals.get(t))[1]):z()),$b=A(2,(e,t)=>j(Qb(e,t),lc(()=>t.initial))),ex=A(2,(e,{fiberId:t,fiberRef:n,value:r})=>{if(e.locals.size===0)return new Yb(new Map([[n,[[t,r]]]]));let i=new Map(e.locals);return tx(i,t,n,r),new Yb(i)});var tx=(e,t,n,r)=>{let i=e.get(n)??[],a;if(Ic(i)){let[e,n]=Hc(i);if(e[I](t)){if(Ao(n,r))return;a=[[t,r],...i.slice(1)]}else a=[[t,r],...i]}else a=[[t,r]];e.set(n,a)};const Bte=A(2,(e,{entries:t,forkAs:n})=>{if(e.locals.size===0)return new Yb(new Map(t));let r=new Map(e.locals);return n!==void 0&&Xb(e,r,n),t.forEach(([e,t])=>{t.length===1?tx(r,t[0][0],e,t[0][1]):t.forEach(([t,n])=>{tx(r,t,e,n)})}),new Yb(r)}),nx=Qb,rx=$b,Vte=Bte,Hte=Ite,ix=`Empty`,ax=`Remove`,ox=`Update`,sx=`AndThen`,Ute={_tag:ix},cx=(e,t)=>{let n=new Map(e.locals),r=Ute;for(let[e,i]of t.locals.entries()){let t=Hc(i)[1],a=n.get(e);if(a!==void 0){let n=Hc(a)[1];Ao(n,t)||(r=lx({_tag:ox,fiberRef:e,patch:e.diff(n,t)})(r))}else r=lx({_tag:`Add`,fiberRef:e,value:t})(r);n.delete(e)}for(let[e]of n.entries())r=lx({_tag:ax,fiberRef:e})(r);return r},lx=A(2,(e,t)=>({_tag:sx,first:e,second:t})),ux=A(3,(e,t,n)=>{let r=n,i=ol(e);for(;Ic(i);){let e=Hc(i),n=Gc(i);switch(e._tag){case ix:i=n;break;case`Add`:r=ex(r,{fiberId:t,fiberRef:e.fiberRef,value:e.value}),i=n;break;case ax:r=Zb(r,e.fiberRef),i=n;break;case ox:{let a=$b(r,e.fiberRef);r=ex(r,{fiberId:t,fiberRef:e.fiberRef,value:e.fiberRef.patch(e.patch)(a)}),i=n;break}case sx:i=Ac(e.first)(Ac(e.second)(n));break}}return r}),dx=cx,fx=ux;var px=`effect/FiberStatus`;const mx=Symbol.for(px),hx=`Done`;var gx=To(`${px}-${hx}`),_x=class{[mx]=mx;_tag=hx;[N](){return gx}[I](e){return Cx(e)&&e._tag===`Done`}},vx=class{runtimeFlags;[mx]=mx;_tag=`Running`;constructor(e){this.runtimeFlags=e}[N](){return j(P(px),F(P(this._tag)),F(P(this.runtimeFlags)),ko(this))}[I](e){return Cx(e)&&e._tag===`Running`&&this.runtimeFlags===e.runtimeFlags}},yx=class{runtimeFlags;blockingOn;[mx]=mx;_tag=`Suspended`;constructor(e,t){this.runtimeFlags=e,this.blockingOn=t}[N](){return j(P(px),F(P(this._tag)),F(P(this.runtimeFlags)),F(P(this.blockingOn)),ko(this))}[I](e){return Cx(e)&&e._tag===`Suspended`&&this.runtimeFlags===e.runtimeFlags&&Ao(this.blockingOn,e.blockingOn)}};const bx=new _x,xx=e=>new vx(e),Sx=(e,t)=>new yx(e,t),Cx=e=>M(e,mx),wx=e=>e._tag===hx,Tx=bx,Ex=xx,Dx=Sx,Ox=wx,kx=X_,Ax=Z_,jx=Q_,Mx=$_,Nx=ev,Px=tv,Fx=nv,Ix=rv,Lx=ac(j(fb,ic(e=>e.ordinal))),Rx=e=>{switch(e){case`All`:return kx;case`Debug`:return Px;case`Error`:return jx;case`Fatal`:return Ax;case`Info`:return Nx;case`Trace`:return Fx;case`None`:return Ix;case`Warning`:return Mx}},zx=Symbol.for(`effect/Micro`),Bx=Symbol.for(`effect/Micro/MicroExit`),Vx=Symbol.for(`effect/Micro/MicroCause`);var Hx={_E:Ea},Ux=class extends globalThis.Error{_tag;traces;[Vx];constructor(e,t,n){let r=`MicroCause.${e}`,i,a,o;if(t instanceof globalThis.Error){i=`(${r}) ${t.name}`,a=t.message;let e=a.split(`
|
|
23
|
+
`).length;o=t.stack?`(${r}) ${t.stack.split(`
|
|
24
|
+
`).slice(0,e+3).join(`
|
|
25
|
+
`)}`:`${i}: ${a}`}else i=r,a=Wo(t,0),o=`${i}: ${a}`;n.length>0&&(o+=`\n ${n.join(`
|
|
26
|
+
`)}`),super(a),this._tag=e,this.traces=n,this[Vx]=Hx,this.name=i,this.stack=o}pipe(){return L(this,arguments)}toString(){return this.stack}[Po](){return this.stack}},Wx=class extends Ux{defect;constructor(e,t=[]){super(`Die`,e,t),this.defect=e}};const Gx=(e,t=[])=>new Wx(e,t);var Kx=class extends Ux{constructor(e=[]){super(`Interrupt`,`interrupted`,e)}};const qx=(e=[])=>new Kx(e),Jx=e=>e._tag===`Interrupt`,Yx=Symbol.for(`effect/Micro/MicroFiber`);var Xx={_A:Ea,_E:Ea},Zx=class{context;interruptible;[Yx];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(e,t=!0){this.context=e,this.interruptible=t,this[Yx]=Xx}getRef(e){return Zf(this.context,e)}addObserver(e){return this._exit?(e(this._exit),ja):(this._observers.push(e),()=>{let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}_interrupted=!1;unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(SS))}unsafePoll(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===aS)return;let n=Qx.interruptChildren&&Qx.interruptChildren(this);if(n!==void 0)return this.evaluate(_S(n,()=>t));this._exit=t;for(let e=0;e<this._observers.length;e++)this._observers[e](t);this._observers.length=0}runLoop(e){let t=!1,n=e;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!t&&this.getRef(AS).shouldYield(this)){t=!0;let e=n;n=_S(mS,()=>e)}if(n=n[tS](this),n===aS){let e=this._yielded;return Bx in e?(this._yielded=void 0,e):aS}}}catch(e){return M(n,tS)?CS(e):CS(`MicroFiber.runLoop: Not a valid effect: ${String(n)}`)}}getCont(e){for(;;){let t=this._stack.pop();if(!t)return;let n=t[iS]&&t[iS](this);if(n)return{[e]:n};if(t[e])return t}}_yielded=void 0;yieldWith(e){return this._yielded=e,aS}children(){return this._children??=new Set}},Qx=La(`effect/Micro/fiberMiddleware`,()=>({interruptChildren:void 0})),$x=Symbol.for(`effect/Micro/identifier`),eS=Symbol.for(`effect/Micro/args`),tS=Symbol.for(`effect/Micro/evaluate`),nS=Symbol.for(`effect/Micro/successCont`),rS=Symbol.for(`effect/Micro/failureCont`),iS=Symbol.for(`effect/Micro/ensureCont`),aS=Symbol.for(`effect/Micro/Yield`),oS={_A:Ea,_E:Ea,_R:Ea},sS={...kte,_op:`Micro`,[zx]:oS,pipe(){return L(this,arguments)},[Symbol.iterator](){return new ro(new ho(this))},toJSON(){return{_id:`Micro`,op:this[$x],...eS in this?{args:this[eS]}:void 0}},toString(){return Vo(this)},[Po](){return Vo(this)}};function cS(e){return CS(`Micro.evaluate: Not implemented`)}var lS=e=>({...sS,[$x]:e.op,[tS]:e.eval??cS,[nS]:e.contA,[rS]:e.contE,[iS]:e.ensure}),uS=e=>{let t=lS(e);return function(){let n=Object.create(t);return n[eS]=e.single===!1?arguments:arguments[0],n}},dS=e=>{let t={...lS(e),[Bx]:Bx,_tag:e.op,get[e.prop](){return this[eS]},toJSON(){return{_id:`MicroExit`,_tag:e.op,[e.prop]:this[eS]}},[I](t){return yS(t)&&t._tag===e.op&&Ao(this[eS],t[eS])},[N](){return ko(this,F(To(e.op))(P(this[eS])))}};return function(e){let n=Object.create(t);return n[eS]=e,n[nS]=void 0,n[rS]=void 0,n[iS]=void 0,n}};const fS=dS({op:`Success`,prop:`value`,eval(e){let t=e.getCont(nS);return t?t[nS](this[eS],e):e.yieldWith(this)}}),pS=dS({op:`Failure`,prop:`cause`,eval(e){let t=e.getCont(rS);for(;Jx(this[eS])&&t&&e.interruptible;)t=e.getCont(rS);return t?t[rS](this[eS],e):e.yieldWith(this)}}),mS=uS({op:`Yield`,eval(e){let t=!1;return e.getRef(AS).scheduleTask(()=>{t||e.evaluate(wS)},this[eS]??0),e.yieldWith(()=>{t=!0})}})(0);var hS=fS(void 0);const gS=uS({op:`WithMicroFiber`,eval(e){return this[eS](e)}}),_S=A(2,(e,t)=>{let n=Object.create(vS);return n[eS]=e,n[nS]=t,n});var vS=lS({op:`OnSuccess`,eval(e){return e._stack.push(this),this[eS]}});const yS=e=>M(e,Bx),bS=fS,xS=pS,SS=xS(qx()),CS=e=>xS(Gx(e)),wS=bS(void 0);var TS=`setImmediate`in globalThis?globalThis.setImmediate:e=>setTimeout(e,0),ES=class{tasks=[];running=!1;scheduleTask(e,t){this.tasks.push(e),this.running||(this.running=!0,TS(this.afterScheduled))}afterScheduled=()=>{this.running=!1,this.runTasks()};runTasks(){let e=this.tasks;this.tasks=[];for(let t=0,n=e.length;t<n;t++)e[t]()}shouldYield(e){return e.currentOpCount>=e.getRef(kS)}flush(){for(;this.tasks.length>0;)this.runTasks()}};const DS=A(2,(e,t)=>gS(n=>{let r=n.context;return n.context=t(r),NS(e,()=>(n.context=r,hS))})),OS=A(2,(e,t)=>DS(e,pp(t)));var kS=class extends gp()(`effect/Micro/currentMaxOpsBeforeYield`,{defaultValue:()=>2048}){};gp()(`effect/Micro/currentConcurrency`,{defaultValue:()=>`unbounded`});var AS=class extends gp()(`effect/Micro/currentScheduler`,{defaultValue:()=>new ES}){};const jS=A(2,(e,t)=>{let n=Object.create(MS);return n[eS]=e,n[nS]=t.onSuccess,n[rS]=t.onFailure,n});var MS=lS({op:`OnSuccessAndFailure`,eval(e){return e._stack.push(this),this[eS]}});const NS=A(2,(e,t)=>IS(n=>jS(n(e),{onFailure:e=>_S(t(xS(e)),()=>pS(e)),onSuccess:e=>_S(t(bS(e)),()=>fS(e))})));var PS=uS({op:`SetInterruptible`,ensure(e){if(e.interruptible=this[eS],e._interrupted&&e.interruptible)return()=>SS}});const FS=e=>gS(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(PS(!1)),t._interrupted?SS:e)),IS=e=>gS(t=>t.interruptible?(t.interruptible=!1,t._stack.push(PS(!0)),e(FS)):e(Ea)),LS=(e,t)=>{let n=new Zx(AS.context(t?.scheduler??new ES));if(n.evaluate(e),t?.signal)if(t.signal.aborted)n.unsafeInterrupt();else{let e=()=>n.unsafeInterrupt();t.signal.addEventListener(`abort`,e,{once:!0}),n.addObserver(()=>t.signal.removeEventListener(`abort`,e))}return n},RS=Symbol.for(`effect/Readable`),zS=Symbol.for(`effect/Ref`),BS={_A:e=>e};var VS=class extends Bb{ref;commit(){return this.get}[zS]=BS;[RS]=RS;constructor(e){super(),this.ref=e,this.get=W(()=>tm(this.ref))}get;modify(e){return W(()=>{let t=tm(this.ref),[n,r]=e(t);return t!==r&&nm(r)(this.ref),n})}};const HS=e=>new VS(em(e)),US=e=>W(()=>HS(e)),WS=e=>e.get,GS=A(2,(e,t)=>e.modify(()=>[void 0,t])),KS=A(2,(e,t)=>e.modify(e=>[e,t])),qS=A(2,(e,t)=>e.modify(t)),JS=A(2,(e,t)=>e.modify(e=>[void 0,t(e)])),YS=US,XS=WS,ZS=KS,QS=qS,$S=GS,eC=JS;var tC=class{buckets=[];scheduleTask(e,t){let n=this.buckets.length,r,i=0;for(;i<n&&this.buckets[i][0]<=t;i++)r=this.buckets[i];r&&r[0]===t?r[1].push(e):i===n?this.buckets.push([t,[e]]):this.buckets.splice(i,0,[t,[e]])}},nC=class{maxNextTickBeforeTimer;running=!1;tasks=new tC;constructor(e){this.maxNextTickBeforeTimer=e}starveInternal(e){let t=this.tasks.buckets;this.tasks.buckets=[];for(let[e,n]of t)for(let e=0;e<n.length;e++)n[e]();this.tasks.buckets.length===0?this.running=!1:this.starve(e)}starve(e=0){e>=this.maxNextTickBeforeTimer?setTimeout(()=>this.starveInternal(0),0):Promise.resolve(void 0).then(()=>this.starveInternal(e+1))}shouldYield(e){return e.currentOpCount>e.getFiberRef(bv)?e.getFiberRef(yv):!1}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running||(this.running=!0,this.starve())}};const rC=La(Symbol.for(`effect/Scheduler/defaultScheduler`),()=>new nC(2048));var iC=class{tasks=new tC;deferred=!1;scheduleTask(e,t){this.deferred?rC.scheduleTask(e,t):this.tasks.scheduleTask(e,t)}shouldYield(e){return e.currentOpCount>e.getFiberRef(bv)?e.getFiberRef(yv):!1}flush(){for(;this.tasks.buckets.length>0;){let e=this.tasks.buckets;this.tasks.buckets=[];for(let[t,n]of e)for(let e=0;e<n.length;e++)n[e]()}this.deferred=!0}};const aC=La(Symbol.for(`effect/FiberRef/currentScheduler`),()=>fv(rC)),oC=La(Symbol.for(`effect/FiberRef/currentRequestMap`),()=>fv(new Map)),sC=(e,t,n,r)=>{switch(e){case void 0:return t();case`unbounded`:return n();case`inherit`:return sv(Vee,e=>e===`unbounded`?n():e>1?r(e):t());default:return e>1?r(e):t()}},cC=Ete,lC=Ote,uC=ab,dC=e=>e.replace(/[\s="]/g,`_`),fC=e=>t=>`${dC(t.label)}=${e-t.startTime}ms`;var pC=`effect/MetricLabel`;const mC=Symbol.for(pC);var hC=class{key;value;[mC]=mC;_hash;constructor(e,t){this.key=e,this.value=t,this._hash=To(pC+this.key+this.value)}[N](){return this._hash}[I](e){return _C(e)&&this.key===e.key&&this.value===e.value}pipe(){return L(this,arguments)}};const gC=(e,t)=>new hC(e,t),_C=e=>M(e,mC),vC=e=>C_(e,B),yC=e=>{let t,n;return typeof e==`function`?t=e:(t=e.try,n=e.catch),U(()=>{try{return H(yo(t))}catch(e){return s_(n?yo(()=>n(e)):new qv(e,`An unknown error occurred in Effect.try`))}})},bC=e=>qC(e,kC,cx),xC=e=>qC(e,U_(kC,Iee),([e,t],[n,r])=>[cx(e,n),ig(t,r)]),SC=A(2,(e,t)=>U(()=>{let n=e[Symbol.iterator](),r=[],i,a=H(!1),o=0;for(;(i=n.next())&&!i.done;){let e=i.value,n=o++;a=V(a,i=>i?(r.push(e),H(!0)):t(e,n))}return C_(a,()=>r)})),CC=A(2,(e,t)=>U(()=>{let n=e[Symbol.iterator](),r=[],i,a=H(!0),o=0;for(;(i=n.next())&&!i.done;){let e=i.value,n=o++;a=V(a,i=>C_(i?t(e,n):H(!1),t=>(t||r.push(e),t)))}return C_(a,()=>r)})),wC=e=>C_(Oy(),e),TC=e=>k_(e,()=>V(H_(),()=>TC(e)));var EC=(e,t,n,r)=>V(n(r,t),i=>{if(i)return H(B(r));let a=e.next();return a.done?H(z()):EC(e,t+1,n,a.value)});const DC=A(2,(e,t)=>g_(e,{onFailure:e=>H(t.onFailure(e)),onSuccess:e=>H(t.onSuccess(e))}));var OC=(e,t,n)=>{let r=e.next();return r.done?H(!0):V(n(r.value,t),r=>r?OC(e,t+1,n):H(r))};const kC=Gg(e=>H(e.getFiberRefs())),AC=e=>DC(e,{onFailure:ja,onSuccess:ja}),jC=(e,t)=>U(()=>t.while(e)?V(t.body(e),e=>jC(e,t)):H(e)),MC=(e=>(...t)=>{let n=fc(e),r;for(let e=0,n=t.length;e<n;e++){let n=t[e];Gd(n)&&(r=r===void 0?n:Wd(r,n),t=[...t.slice(0,e),...t.slice(e+1)],e--)}return r===void 0&&(r=zd),Gg(e=>(e.log(t,r,n),P_))})(jx);var NC=(e,t,n,r)=>U(()=>t(e)?V(r(e),i=>C_(NC(n(e),t,n,r),Ym(i))):W(()=>Km())),PC=(e,t,n,r)=>U(()=>t(e)?V(r(e),()=>PC(n(e),t,n,r)):P_);const FC=A(2,(e,t)=>h_(e,{onFailure:e=>u_(()=>t(e)),onSuccess:H})),IC=e=>j(gy(),V(t=>j(xC(e),S_(t),RC,C_(e=>G_(e,j(vy(t),V(([e,t])=>qg(U_(zC(e[0]),F_(e[1])),t)))))))),LC=e=>C_(e,e=>!e),RC=e=>C_(YS(!0),t=>Jg(I_(e,ZS(t,!1)))),zC=e=>QC((t,n)=>j(e,ux(t,n))),BC=e=>e.length>=1?Qg((t,n)=>{try{e(n).then(e=>t(H(e)),e=>t(r_(e)))}catch(e){t(r_(e))}}):Qg(t=>{try{e().then(e=>t(H(e)),e=>t(r_(e)))}catch(e){t(r_(e))}}),VC=A(3,(e,t,n)=>ky(r=>Ay(e,lp(r,t,n)))),HC=A(3,(e,t,n)=>ky(r=>V(n,n=>Ay(e,j(r,lp(t,n))))));var UC=(e,t,n,r,i)=>{let a=e.next();return!a.done&&r(n)?V(i(n,a.value,t),n=>UC(e,t+1,n,r,i)):H(n)},WC=(e,t)=>V(e,n=>t<=0?H(n):G_(H_(),WC(e,t-1)));const GC=cC,KC=H(z()),qC=A(3,(e,t,n)=>V(t,r=>V(e,e=>C_(t,t=>[n(r,t),e])))),JC=A(2,(e,t)=>U(()=>{let n=e[Symbol.iterator](),r=[],i,a=H(!0),o=0;for(;(i=n.next())&&!i.done;){let e=i.value,n=o++;a=V(a,i=>j(i?t(e,n):H(!1),C_(t=>(t&&r.push(e),t))))}return C_(a,()=>r)})),YC=A(2,(e,t)=>h_(e,{onFailure:e=>G_(t(e),l_(e)),onSuccess:H})),XC=e=>{let t,n;typeof e==`function`?t=e:(t=e.try,n=e.catch);let r=e=>n?c_(()=>n(e)):s_(new qv(e,`An unknown error occurred in Effect.tryPromise`));return t.length>=1?Qg((e,n)=>{try{t(n).then(t=>e(H(t)),t=>e(r(t)))}catch(t){e(r(t))}}):Qg(e=>{try{t().then(t=>e(H(t)),t=>e(r(t)))}catch(t){e(r(t))}})},ZC=A(2,(e,t)=>V(e,e=>yC({try:()=>t.try(e),catch:t.catch}))),QC=e=>Gg(t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),P_)),$C=A(2,(e,t)=>U(()=>t()?C_(e,B):H(z()))),ew=e=>new Proxy({},{get(t,n,r){return(...t)=>V(e,e=>e[n](...t))}});var tw=BigInt(0),nw=_c(e=>up(e.context,Lb)?e._tag===`Span`?nw(e.parent):z():B(e));const rw=(e,t,n)=>{let r=!e.getFiberRef(Ev)||n.context&&up(n.context,Lb),i=e.getFiberRef(vv),a=n.parent?B(n.parent):n.root?z():nw(fp(i,Pb)),o;if(r)o=Fy({name:t,parent:a,context:lp(n.context??sp(),Lb,!0)});else{let r=e.getFiberRef(Rb),i=up(r,Nb),s=up(r,uC),c=e.getFiberRef(Dv),l=e.getFiberRefs(),u=nx(l,Gee),d=nx(l,Kee),f=d._tag===`Some`?n.links===void 0?Ml(d.value):[...Ml(d.value),...n.links??[]]:n.links??al();o=i.span(t,a,n.context??sp(),f,c?s.unsafeCurrentTimeNanos():tw,n.kind??`internal`,n),u._tag===`Some`&&uee(u.value,(e,t)=>o.attribute(t,e)),n.attributes!==void 0&&Object.entries(n.attributes).forEach(([e,t])=>o.attribute(e,t))}return typeof n.captureStackTrace==`function`&&Ef.set(o,n.captureStackTrace),o},iw=(e,t,n,r)=>W(()=>{e.status._tag!==`Ended`&&(Yv(t)&&Ef.has(e)&&e.attribute(`code.stacktrace`,Ef.get(e)()),e.end(r?n.unsafeCurrentTimeNanos():tw,t))}),aw=(e,...t)=>{let n=Ib(t.length===1?void 0:t[0]),r=t[t.length-1];return Gg(t=>{let i=rw(t,e,n),a=t.getFiberRef(Dv),o=up(t.getFiberRef(Rb),ab);return D_(r(i),e=>iw(i,e,o,a))})},ow=A(2,(e,t)=>VC(e,Pb,t)),sw=Jv,cw=Yv,lw=Xv,uw=Qv,dw=$v,fw=ey,pw=ty,mw=ny,hw=iy,gw=ay,_w=oy,vw=sy,yw=ly;var bw=uy;const xw=dy,Sw=fy,Cw=`InterruptSignal`,ww=`Stateful`,Tw=`Resume`,Ew=`YieldNow`,Dw=e=>({_tag:Cw,cause:e}),Ow=e=>({_tag:ww,onFiber:e}),kw=e=>({_tag:Tw,effect:e}),Aw=()=>({_tag:Ew}),jw=Symbol.for(`effect/FiberScope`);var Mw=class{[jw]=jw;fiberId=ym;roots=new Set;add(e,t){this.roots.add(t),t.addObserver(()=>{this.roots.delete(t)})}},Nw=class{fiberId;parent;[jw]=jw;constructor(e,t){this.fiberId=e,this.parent=t}add(e,t){this.parent.tell(Ow(e=>{e.addChild(t),t.addObserver(()=>{e.removeChild(t)})}))}};const Pw=e=>new Nw(e.id(),e),Fw=La(Symbol.for(`effect/FiberScope/Global`),()=>new Mw),Iw=Symbol.for(`effect/Fiber`),Lw={_E:e=>e,_A:e=>e};var Rw={[Iw]:Lw,pipe(){return L(this,arguments)}};const zw=Symbol.for(`effect/Fiber`),Bw=e=>e.await,Vw=e=>e.inheritAll,Hw=e=>W_(p_(e.await),e.inheritAll);({...Ss}),{...Rw};const Uw=`effect/FiberCurrent`,Ww=()=>fc(globalThis[Uw]),Gw=Symbol.for(`effect/Logger`);var Kw={_Message:e=>e,_Output:e=>e};const qw=e=>({[Gw]:Kw,log:e,pipe(){return L(this,arguments)}});var Jw=/^[^\s"=]*$/;const Yw=qw(((e,t)=>({annotations:n,cause:r,date:i,fiberId:a,logLevel:o,message:s,spans:c})=>{let l=t=>t.match(Jw)?t:e(t),u=(e,t)=>`${dC(e)}=${l(t)}`,d=(e,t)=>` `+u(e,t),f=u(`timestamp`,i.toISOString());f+=d(`level`,o.label),f+=d(`fiber`,_m(a));let p=Oc(s);for(let e=0;e<p.length;e++)f+=d(`message`,Wo(p[e],t));Kd(r)||(f+=d(`cause`,xf(r,{renderErrorCause:!0})));for(let e of c)f+=` `+fC(i.getTime())(e);for(let[e,r]of n)f+=d(e,Wo(r,t));return f})(e=>`"${e.replace(/\\([\s\S])|(")/g,`\\$1$2`)}"`));var Xw={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Xw.gray,Xw.blue,Xw.green,Xw.yellow,Xw.red,Xw.bgBrightRed,Xw.black;var Zw=typeof process==`object`&&process!==null&&typeof process.stdout==`object`&&process.stdout!==null;Zw&&process.stdout.isTTY,Zw||`Deno`in globalThis;var Qw=`effect/MetricBoundaries`;const $w=Symbol.for(Qw);var eT=class{values;[$w]=$w;constructor(e){this.values=e,this._hash=j(To(Qw),F(Oo(this.values)))}_hash;[N](){return this._hash}[I](e){return tT(e)&&Ao(this.values,e.values)}pipe(){return L(this,arguments)}};const tT=e=>M(e,$w),nT=e=>new eT(j(e,Mc(kl(1/0)),gl)),rT=e=>j(Ec(e.count-1,t=>e.start*e.factor**+t),Fl,nT),iT=Symbol.for(`effect/MetricKeyType`);var aT=`effect/MetricKeyType/Counter`;const oT=Symbol.for(aT),sT=Symbol.for(`effect/MetricKeyType/Frequency`),cT=Symbol.for(`effect/MetricKeyType/Gauge`);var lT=`effect/MetricKeyType/Histogram`;const uT=Symbol.for(lT),dT=Symbol.for(`effect/MetricKeyType/Summary`);var fT={_In:e=>e,_Out:e=>e},pT=class{incremental;bigint;[iT]=fT;[oT]=oT;constructor(e,t){this.incremental=e,this.bigint=t,this._hash=To(aT)}_hash;[N](){return this._hash}[I](e){return _T(e)}pipe(){return L(this,arguments)}},mT=class{boundaries;[iT]=fT;[uT]=uT;constructor(e){this.boundaries=e,this._hash=j(To(lT),F(P(this.boundaries)))}_hash;[N](){return this._hash}[I](e){return bT(e)&&Ao(this.boundaries,e.boundaries)}pipe(){return L(this,arguments)}};const hT=e=>new pT(e?.incremental??!1,e?.bigint??!1),gT=e=>new mT(e),_T=e=>M(e,oT),vT=e=>M(e,sT),yT=e=>M(e,cT),bT=e=>M(e,uT),xT=e=>M(e,dT),ST=Symbol.for(`effect/MetricKey`);var CT={_Type:e=>e},wT=ml(Ao),TT=class{name;keyType;description;tags;[ST]=CT;constructor(e,t,n,r=[]){this.name=e,this.keyType=t,this.description=n,this.tags=r,this._hash=j(To(this.name+this.description),F(P(this.keyType)),F(Oo(this.tags)))}_hash;[N](){return this._hash}[I](e){return ET(e)&&this.name===e.name&&Ao(this.keyType,e.keyType)&&Ao(this.description,e.description)&&wT(this.tags,e.tags)}pipe(){return L(this,arguments)}};const ET=e=>M(e,ST),DT=(e,t)=>new TT(e,hT(t),fc(t?.description)),OT=(e,t,n)=>new TT(e,gT(t),fc(n)),kT=A(2,(e,t)=>t.length===0?e:new TT(e.name,e.keyType,e.description,il(e.tags,t)));var AT=Symbol.for(`effect/MutableHashMap`),jT={[AT]:AT,[Symbol.iterator](){return new MT(this)},toString(){return Vo(this.toJSON())},toJSON(){return{_id:`MutableHashMap`,values:Array.from(this).map(Fo)}},[Po](){return this.toJSON()},pipe(){return L(this,arguments)}},MT=class e{self;referentialIterator;bucketIterator;constructor(e){this.self=e,this.referentialIterator=e.referential[Symbol.iterator]()}next(){if(this.bucketIterator!==void 0)return this.bucketIterator.next();let e=this.referentialIterator.next();return e.done?(this.bucketIterator=new NT(this.self.buckets.values()),this.next()):e}[Symbol.iterator](){return new e(this.self)}},NT=class{backing;constructor(e){this.backing=e}currentBucket;next(){if(this.currentBucket===void 0){let e=this.backing.next();if(e.done)return e;this.currentBucket=e.value[Symbol.iterator]()}let e=this.currentBucket.next();return e.done?(this.currentBucket=void 0,this.next()):e}};const PT=()=>{let e=Object.create(jT);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e},FT=A(2,(e,t)=>{if(Mo(t)===!1)return e.referential.has(t)?B(e.referential.get(t)):z();let n=t[N](),r=e.buckets.get(n);return r===void 0?z():IT(e,r,t)});var IT=(e,t,n,r=!1)=>{for(let i=0,a=t.length;i<a;i++)if(n[I](t[i][0])){let n=t[i][1];return r&&(t.splice(i,1),e.bucketsSize--),B(n)}return z()};const LT=A(2,(e,t)=>sc(FT(e,t))),RT=A(3,(e,t,n)=>{if(Mo(t)===!1)return e.referential.set(t,n),e;let r=t[N](),i=e.buckets.get(r);return i===void 0?(e.buckets.set(r,[[t,n]]),e.bucketsSize++,e):(zT(e,i,t),i.push([t,n]),e.bucketsSize++,e)});var zT=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(n[I](t[r][0])){t.splice(r,1),e.bucketsSize--;return}};const BT=Symbol.for(`effect/MetricState`);var VT=`effect/MetricState/Counter`;const HT=Symbol.for(VT);var UT=`effect/MetricState/Frequency`;const WT=Symbol.for(UT);var GT=`effect/MetricState/Gauge`;const KT=Symbol.for(GT);var qT=`effect/MetricState/Histogram`;const JT=Symbol.for(qT);var YT=`effect/MetricState/Summary`;const XT=Symbol.for(YT);var ZT={_A:e=>e},QT=class{count;[BT]=ZT;[HT]=HT;constructor(e){this.count=e}[N](){return j(P(VT),F(P(this.count)),ko(this))}[I](e){return lE(e)&&this.count===e.count}pipe(){return L(this,arguments)}},$T=ml(Ao),eE=class{occurrences;[BT]=ZT;[WT]=WT;constructor(e){this.occurrences=e}_hash;[N](){return j(To(UT),F(Oo(Dc(this.occurrences.entries()))),ko(this))}[I](e){return uE(e)&&$T(Dc(this.occurrences.entries()),Dc(e.occurrences.entries()))}pipe(){return L(this,arguments)}},tE=class{value;[BT]=ZT;[KT]=KT;constructor(e){this.value=e}[N](){return j(P(GT),F(P(this.value)),ko(this))}[I](e){return dE(e)&&this.value===e.value}pipe(){return L(this,arguments)}},nE=class{buckets;count;min;max;sum;[BT]=ZT;[JT]=JT;constructor(e,t,n,r,i){this.buckets=e,this.count=t,this.min=n,this.max=r,this.sum=i}[N](){return j(P(qT),F(P(this.buckets)),F(P(this.count)),F(P(this.min)),F(P(this.max)),F(P(this.sum)),ko(this))}[I](e){return fE(e)&&Ao(this.buckets,e.buckets)&&this.count===e.count&&this.min===e.min&&this.max===e.max&&this.sum===e.sum}pipe(){return L(this,arguments)}},rE=class{error;quantiles;count;min;max;sum;[BT]=ZT;[XT]=XT;constructor(e,t,n,r,i,a){this.error=e,this.quantiles=t,this.count=n,this.min=r,this.max=i,this.sum=a}[N](){return j(P(YT),F(P(this.error)),F(P(this.quantiles)),F(P(this.count)),F(P(this.min)),F(P(this.max)),F(P(this.sum)),ko(this))}[I](e){return pE(e)&&this.error===e.error&&Ao(this.quantiles,e.quantiles)&&this.count===e.count&&this.min===e.min&&this.max===e.max&&this.sum===e.sum}pipe(){return L(this,arguments)}};const iE=e=>new QT(e),aE=e=>new eE(e),oE=e=>new tE(e),sE=e=>new nE(e.buckets,e.count,e.min,e.max,e.sum),cE=e=>new rE(e.error,e.quantiles,e.count,e.min,e.max,e.sum),lE=e=>M(e,HT),uE=e=>M(e,WT),dE=e=>M(e,KT),fE=e=>M(e,JT),pE=e=>M(e,XT),mE=Symbol.for(`effect/MetricHook`);var hE={_In:e=>e,_Out:e=>e};const gE=e=>({[mE]:hE,pipe(){return L(this,arguments)},...e});var _E=BigInt(0);const Wte=e=>{let t=e.keyType.bigint?_E:0,n=e.keyType.incremental?e.keyType.bigint?e=>e>=_E:e=>e>=0:e=>!0,r=e=>{n(e)&&(t+=e)};return gE({get:()=>iE(t),update:r,modify:r})},Gte=e=>{let t=new Map;for(let n of e.keyType.preregisteredWords)t.set(n,0);let n=e=>{let n=t.get(e)??0;t.set(e,n+1)};return gE({get:()=>aE(t),update:n,modify:n})},Kte=(e,t)=>{let n=t;return gE({get:()=>oE(n),update:e=>{n=e},modify:e=>{n+=e}})},qte=e=>{let t=e.keyType.boundaries.values,n=t.length,r=new Uint32Array(n+1),i=new Float64Array(n),a=0,o=0,s=Number.MAX_VALUE,c=Number.MIN_VALUE;j(t,Xc(fb),sl((e,t)=>{i[t]=e}));let l=e=>{let t=0,l=n;for(;t!==l;){let n=Math.floor(t+(l-t)/2);e<=i[n]?l=n:t=n,l===t+1&&(e<=i[t]?l=t:t=l)}r[t]=r[t]+1,a+=1,o+=e,e<s&&(s=e),e>c&&(c=e)},u=()=>{let e=Tc(n),t=0;for(let a=0;a<n;a++){let n=i[a],o=r[a];t+=o,e[a]=[n,t]}return e};return gE({get:()=>sE({buckets:u(),count:a,min:s,max:c,sum:o}),update:l,modify:l})},Jte=e=>{let{error:t,maxAge:n,maxSize:r,quantiles:i}=e.keyType,a=j(i,Xc(fb)),o=Tc(r),s=0,c=0,l=0,u=0,d=0,f=e=>{let i=[],s=0;for(;s!==r-1;){let t=o[s];if(t!=null){let[r,a]=t,o=Ip(e-r);Yp(o,Mp)&&Jp(o,n)&&i.push(a)}s+=1}return Yte(t,a,Xc(i,fb))},p=(e,t)=>{if(r>0){s+=1;let n=s%r;o[n]=[t,e]}u=c===0?e:Math.min(u,e),d=c===0?e:Math.max(d,e),c+=1,l+=e};return gE({get:()=>cE({error:t,quantiles:f(Date.now()),count:c,min:u,max:d,sum:l}),update:([e,t])=>p(e,t),modify:([e,t])=>p(e,t)})};var Yte=(e,t,n)=>{let r=n.length;if(!Ic(t))return al();let i=t[0],a=t.slice(1),o=vE(e,r,z(),0,i,n),s=ol(o);return a.forEach(t=>{s.push(vE(e,r,o.value,o.consumed,t,o.rest))}),sl(s,e=>[e.quantile,e.value])},vE=(e,t,n,r,i,a)=>{let o=e,s=t,c=n,l=r,u=i,d=a,f=e,p=t,m=n,h=r,g=i,_=a;for(;;){if(!Ic(d))return{quantile:u,value:z(),consumed:l,rest:[]};if(u===1)return{quantile:u,value:B(Wc(d)),consumed:l+d.length,rest:[]};let e=Hc(d),t=qc(d,t=>t===e),n=u*s,r=o/2*n,i=l+t[0].length,a=Math.abs(i-n);if(i<n-r){f=o,p=s,m=Vc(d),h=i,g=u,_=t[1],o=f,s=p,c=m,l=h,u=g,d=_;continue}if(i>n+r){let t=oc(c)?B(e):c;return{quantile:u,value:t,consumed:l,rest:d}}switch(c._tag){case`None`:f=o,p=s,m=Vc(d),h=i,g=u,_=t[1],o=f,s=p,c=m,l=h,u=g,d=_;continue;case`Some`:if(a<Math.abs(n-c.value)){f=o,p=s,m=Vc(d),h=i,g=u,_=t[1],o=f,s=p,c=m,l=h,u=g,d=_;continue}return{quantile:u,value:B(c.value),consumed:l,rest:d}}}throw Error(`BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues`)};const Xte=Symbol.for(`effect/MetricPair`);var Zte={_Type:e=>e};const Qte=(e,t)=>({[Xte]:Zte,metricKey:e,metricState:t,pipe(){return L(this,arguments)}}),yE=Symbol.for(`effect/MetricRegistry`);var $te=class{[yE]=yE;map=PT();snapshot(){let e=[];for(let[t,n]of this.map)e.push(Qte(t,n.get()));return e}get(e){let t=j(this.map,FT(e),pc);if(t==null){if(_T(e.keyType))return this.getCounter(e);if(yT(e.keyType))return this.getGauge(e);if(vT(e.keyType))return this.getFrequency(e);if(bT(e.keyType))return this.getHistogram(e);if(xT(e.keyType))return this.getSummary(e);throw Error(`BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues`)}else return t}getCounter(e){let t=j(this.map,FT(e),pc);if(t==null){let n=Wte(e);j(this.map,LT(e))||j(this.map,RT(e,n)),t=n}return t}getFrequency(e){let t=j(this.map,FT(e),pc);if(t==null){let n=Gte(e);j(this.map,LT(e))||j(this.map,RT(e,n)),t=n}return t}getGauge(e){let t=j(this.map,FT(e),pc);if(t==null){let n=Kte(e,e.keyType.bigint?BigInt(0):0);j(this.map,LT(e))||j(this.map,RT(e,n)),t=n}return t}getHistogram(e){let t=j(this.map,FT(e),pc);if(t==null){let n=qte(e);j(this.map,LT(e))||j(this.map,RT(e,n)),t=n}return t}getSummary(e){let t=j(this.map,FT(e),pc);if(t==null){let n=Jte(e);j(this.map,LT(e))||j(this.map,RT(e,n)),t=n}return t}};const ene=()=>new $te,tne=Symbol.for(`effect/Metric`);var nne={_Type:e=>e,_In:e=>e,_Out:e=>e};const bE=La(Symbol.for(`effect/Metric/globalMetricRegistry`),()=>ene()),xE=function(e,t,n,r){let i=Object.assign(e=>j_(e,e=>one(i,e)),{[tne]:nne,keyType:e,unsafeUpdate:t,unsafeValue:n,unsafeModify:r,register(){return this.unsafeValue([]),this},pipe(){return L(this,arguments)}});return i},SE=(e,t)=>CE(DT(e,t)),CE=e=>{let t,n=new WeakMap,r=r=>{if(r.length===0)return t===void 0&&(t=bE.get(e)),t;let i=n.get(r);return i===void 0?(i=bE.get(kT(e,r)),n.set(r,i),i):i};return xE(e.keyType,(e,t)=>r(t).update(e),e=>r(e).get(),(e,t)=>r(t).modify(e))},rne=(e,t,n)=>CE(OT(e,t,n)),ine=A(3,(e,t,n)=>ane(e,[gC(t,n)])),ane=A(2,(e,t)=>xE(e.keyType,(n,r)=>e.unsafeUpdate(n,il(t,r)),n=>e.unsafeValue(il(t,n)),(n,r)=>e.unsafeModify(n,il(t,r)))),one=A(2,(e,t)=>sv(Cv,n=>W(()=>e.unsafeUpdate(t,n))));({...xs});const sne=A(2,(e,t)=>sv(oC,n=>W(()=>{if(n.has(e)){let r=n.get(e);r.state.completed||(r.state.completed=!0,Ty(r.result,t))}}))),wE={Forward:0,Backward:1};Symbol.iterator;var cne=(e,t)=>{let n=e[Symbol.iterator](),r=0;return{[Symbol.iterator]:()=>cne(e,t),next:()=>{r++;let e=n.key;switch(t===wE.Forward?n.moveNext():n.movePrev(),e._tag){case`None`:return{done:!0,value:r};case`Some`:return{done:!1,value:e.value}}}}},lne=(e,t)=>{let n=e[Symbol.iterator](),r=0;return{[Symbol.iterator]:()=>lne(e,t),next:()=>{r++;let e=n.value;switch(t===wE.Forward?n.moveNext():n.movePrev(),e._tag){case`None`:return{done:!0,value:r};case`Some`:return{done:!1,value:e.value}}}}};Symbol.iterator;const TE=Symbol.for(`effect/Supervisor`),EE={_T:e=>e};var DE=class e{underlying;value0;[TE]=EE;constructor(e,t){this.underlying=e,this.value0=t}get value(){return this.value0}onStart(e,t,n,r){this.underlying.onStart(e,t,n,r)}onEnd(e,t){this.underlying.onEnd(e,t)}onEffect(e,t){this.underlying.onEffect(e,t)}onSuspend(e){this.underlying.onSuspend(e)}onResume(e){this.underlying.onResume(e)}map(t){return new e(this,j(this.value,C_(t)))}zip(e){return new OE(this,e)}},OE=class e{left;right;_tag=`Zip`;[TE]=EE;constructor(e,t){this.left=e,this.right=t}get value(){return U_(this.left.value,this.right.value)}onStart(e,t,n,r){this.left.onStart(e,t,n,r),this.right.onStart(e,t,n,r)}onEnd(e,t){this.left.onEnd(e,t),this.right.onEnd(e,t)}onEffect(e,t){this.left.onEffect(e,t),this.right.onEffect(e,t)}onSuspend(e){this.left.onSuspend(e),this.right.onSuspend(e)}onResume(e){this.left.onResume(e),this.right.onResume(e)}map(e){return new DE(this,j(this.value,C_(e)))}zip(t){return new e(this,t)}};const kE=e=>M(e,TE)&&Ja(e,`Zip`);var une=class{effect;[TE]=EE;constructor(e){this.effect=e}get value(){return this.effect}onStart(e,t,n,r){}onEnd(e,t){}onEffect(e,t){}onSuspend(e){}onResume(e){}map(e){return new DE(this,j(this.value,C_(e)))}zip(e){return new OE(this,e)}onRun(e,t){return e()}};const dne=e=>new une(e),AE=La(`effect/Supervisor/none`,()=>dne(P_)),fne=jh,jE=`Empty`,ME=`AddSupervisor`,NE=`RemoveSupervisor`,PE=`AndThen`,FE={_tag:jE},IE=(e,t)=>({_tag:PE,first:e,second:t}),pne=(e,t)=>mne(t,kl(e));var mne=(e,t)=>{let n=e,r=t;for(;ql(r);){let e=Xl(r);switch(e._tag){case jE:r=eu(r);break;case ME:n=n.zip(e.supervisor),r=eu(r);break;case NE:n=LE(n,e.supervisor),r=eu(r);break;case PE:r=zl(e.first)(zl(e.second)(eu(r)));break}}return n},LE=(e,t)=>Ao(e,t)?AE:kE(e)?LE(e.left,t).zip(LE(e.right,t)):e,RE=e=>Ao(e,AE)?yd():kE(e)?j(RE(e.left),Od(RE(e.right))):xd(e);const hne=fne({empty:FE,patch:pne,combine:IE,diff:(e,t)=>{if(Ao(e,t))return FE;let n=RE(e),r=RE(t);return IE(j(r,Dd(n),kd(FE,(e,t)=>IE(e,{_tag:ME,supervisor:t}))),j(n,Dd(r),kd(FE,(e,t)=>IE(e,{_tag:NE,supervisor:t}))))}}),gne=SE(`effect_fiber_started`,{incremental:!0}),zE=SE(`effect_fiber_active`),_ne=SE(`effect_fiber_successes`,{incremental:!0}),vne=SE(`effect_fiber_failures`,{incremental:!0}),yne=ine(rne(`effect_fiber_lifetimes`,rT({start:.5,factor:2,count:35})),`time_unit`,`milliseconds`);var BE=`Continue`,bne=`Done`,VE=`Yield`,xne={_E:e=>e,_A:e=>e},HE=e=>{throw Error(`BUG: FiberRuntime - ${Wo(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},UE=Symbol.for(`effect/internal/fiberRuntime/YieldedOp`),WE=La(`effect/internal/fiberRuntime/yieldedOpChannel`,()=>({currentOp:null})),GE={[ts]:(e,t,n)=>yo(()=>t.effect_instruction_i1(n)),OnStep:(e,t,n)=>ly(ly(n)),[ns]:(e,t,n)=>yo(()=>t.effect_instruction_i2(n)),[us]:(e,t,n)=>(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),Zh(e.currentRuntimeFlags)&&e.isInterrupted()?ny(e.getInterruptedCause()):ly(n)),[os]:(e,t,n)=>(yo(()=>t.effect_instruction_i2(n)),yo(()=>t.effect_instruction_i0())?(e.pushStack(t),yo(()=>t.effect_instruction_i1())):P_),[ss]:(e,t,n)=>{for(;;){let r=yo(()=>t.effect_instruction_i0.next(n));if(r.done)return ly(r.value);let i=go(r.value);if(Jv(i)){if(i._tag===`Failure`)return i}else return e.pushStack(t),i;n=i.value}}},Sne={[Cw]:(e,t,n,r)=>(e.processNewInterruptSignal(r.cause),Zh(t)?ny(r.cause):n),[Tw]:(e,t,n,r)=>{throw Error(`It is illegal to have multiple concurrent run loops in a single fiber`)},[ww]:(e,t,n,r)=>(r.onFiber(e,Ex(t)),n),[Ew]:(e,t,n,r)=>V(H_(),()=>n)},Cne=e=>v_(fg(e),e=>XE(Ag(e),([e,t])=>{let n=new Map,r=[];for(let e of t){r.push(Ml(e));for(let t of e)n.set(t.request,t)}let i=r.flat();return uv(Jne(e.runAll(r),i,()=>i.forEach(e=>{e.listeners.interrupted=!0})),oC,n)},!1,!1)),wne=fs(),KE=class extends Bb{[Iw]=Lw;[zw]=xne;_fiberRefs;_fiberId;_queue=[];_children=null;_observers=[];_running=!1;_stack=[];_asyncInterruptor=null;_asyncBlockingOn=null;_exitValue=null;_steps=[];_isYielding=!1;currentRuntimeFlags;currentOpCount=0;currentSupervisor;currentScheduler;currentTracer;currentSpan;currentContext;currentDefaultServices;constructor(e,t,n){if(super(),this.currentRuntimeFlags=n,this._fiberId=e,this._fiberRefs=t,ng(n)){let e=this.getFiberRef(Cv);gne.unsafeUpdate(1,e),zE.unsafeUpdate(1,e)}this.refreshRefCache()}commit(){return Hw(this)}id(){return this._fiberId}resume(e){this.tell(kw(e))}get status(){return this.ask((e,t)=>t)}get runtimeFlags(){return this.ask((e,t)=>Ox(t)?e.currentRuntimeFlags:t.runtimeFlags)}scope(){return Pw(this)}get children(){return this.ask(e=>Array.from(e.getChildren()))}getChildren(){return this._children===null&&(this._children=new Set),this._children}getInterruptedCause(){return this.getFiberRef(Tv)}fiberRefs(){return this.ask(e=>e.getFiberRefs())}ask(e){return U(()=>{let t=hy(this._fiberId);return this.tell(Ow((n,r)=>{Ty(t,W(()=>e(n,r)))})),vy(t)})}tell(e){this._queue.push(e),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Qg(e=>{let t=t=>e(H(t));if(this._exitValue!==null){t(this._exitValue);return}return this.tell(Ow((e,n)=>{e._exitValue===null?e.addObserver(t):t(this._exitValue)})),W(()=>this.tell(Ow((e,n)=>{e.removeObserver(t)})))},this.id())}get inheritAll(){return Gg((e,t)=>{let n=e.id(),r=e.getFiberRefs(),i=t.runtimeFlags,a=Rte(r,n,this.getFiberRefs());return e.setFiberRefs(a),F_(j(ig(i,e.getFiberRef(pD)),lg(1),lg(16)))})}get poll(){return W(()=>fc(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(e){return W(()=>this.tell(Dw(Hd(e))))}unsafeInterruptAsFork(e){this.tell(Dw(Hd(e)))}addObserver(e){this._exitValue===null?this._observers.push(e):e(this._exitValue)}removeObserver(e){this._observers=this._observers.filter(t=>t!==e)}getFiberRefs(){return this.setFiberRef(pD,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(e){this._fiberRefs=Zb(this._fiberRefs,e)}getFiberRef(e){return this._fiberRefs.locals.has(e)?this._fiberRefs.locals.get(e)[0][1]:e.initial}setFiberRef(e,t){this._fiberRefs=ex(this._fiberRefs,{fiberId:this._fiberId,fiberRef:e,value:t}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(Rb),this.currentTracer=this.currentDefaultServices.unsafeMap.get(Nb.key),this.currentSupervisor=this.getFiberRef(Kne),this.currentScheduler=this.getFiberRef(aC),this.currentContext=this.getFiberRef(vv),this.currentSpan=this.currentContext.unsafeMap.get(Pb.key)}setFiberRefs(e){this._fiberRefs=e,this.refreshRefCache()}addChild(e){this.getChildren().add(e)}removeChild(e){this.getChildren().delete(e)}transferChildren(e){let t=this._children;if(this._children=null,t!==null&&t.size>0)for(let n of t)n._exitValue===null&&e.add(this.currentRuntimeFlags,n)}drainQueueOnCurrentThread(){let e=!0;for(;e;){let t=BE,n=globalThis[Uw];globalThis[Uw]=this;try{for(;t===BE;)t=this._queue.length===0?bne:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[Uw]=n}this._queue.length>0&&!this._running?(this._running=!0,t===VE?(this.drainQueueLaterOnExecutor(),e=!1):e=!0):e=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(yv))}drainQueueWhileRunning(e,t){let n=t;for(;this._queue.length>0;){let t=this._queue.splice(0,1)[0];n=Sne[t._tag](this,e,n,t)}return n}isInterrupted(){return!Yd(this.getFiberRef(Tv))}addInterruptedCause(e){let t=this.getFiberRef(Tv);this.setFiberRef(Tv,Wd(t,e))}processNewInterruptSignal(e){this.addInterruptedCause(e),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(this._children===null||this._children.size===0)return!1;let e=!1;for(let t of this._children)t.tell(Dw(Hd(this.id()))),e=!0;return e}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){let e=this._children.values();this._children=null;let t=!1;return L_({while:()=>!t,body:()=>{let n=e.next();return n.done?W(()=>{t=!0}):Jg(n.value.await)},step:()=>{}})}return null}reportExitValue(e){if(ng(this.currentRuntimeFlags)){let t=this.getFiberRef(Cv),n=this.id().startTimeMillis,r=Date.now();switch(yne.unsafeUpdate(r-n,t),zE.unsafeUpdate(-1,t),e._tag){case rs:_ne.unsafeUpdate(1,t);break;case $o:vne.unsafeUpdate(1,t);break}}if(e._tag===`Failure`){let t=this.getFiberRef(Uee);!Zd(e.cause)&&t._tag===`Some`&&this.log(`Fiber terminated with an unhandled error`,e.cause,t)}}setExitValue(e){this._exitValue=e,this.reportExitValue(e);for(let t=this._observers.length-1;t>=0;t--)this._observers[t](e);this._observers=[]}getLoggers(){return this.getFiberRef(kne)}log(e,t,n){let r=sc(n)?n.value:this.getFiberRef(Sv);if(Lx(this.getFiberRef(Tne),r))return;let i=this.getFiberRef(zee),a=this.getFiberRef(xv),o=this.getLoggers(),s=this.getFiberRefs();if(wd(o)>0){let n=up(this.getFiberRef(Rb),ab),c=new Date(n.unsafeCurrentTimeMillis());Yo(s,()=>{for(let n of o)n.log({fiberId:this.id(),logLevel:r,message:e,cause:t,context:s,spans:i,annotations:a,date:c})})}}evaluateMessageWhileSuspended(e){switch(e._tag){case Ew:return VE;case Cw:return this.processNewInterruptSignal(e.cause),this._asyncInterruptor!==null&&(this._asyncInterruptor(ny(e.cause)),this._asyncInterruptor=null),BE;case Tw:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(e.effect),BE;case ww:return e.onFiber(this,this._exitValue===null?Dx(this.currentRuntimeFlags,this._asyncBlockingOn):Tx),BE;default:return HE(e)}}evaluateEffect(e){this.currentSupervisor.onResume(this);try{let t=Zh(this.currentRuntimeFlags)&&this.isInterrupted()?ny(this.getInterruptedCause()):e;for(;t!==null;){let e=t,n=this.runLoop(e);if(n===UE){let e=WE.currentOp;WE.currentOp=null,e._op===`Yield`?Jh(this.currentRuntimeFlags)?(this.tell(Aw()),this.tell(kw(uy)),t=null):t=uy:e._op===`Async`&&(t=null)}else{this.currentRuntimeFlags=j(this.currentRuntimeFlags,Xh(16));let e=this.interruptAllChildren();e===null?(this._queue.length===0?this.setExitValue(n):this.tell(kw(n)),t=null):t=V(e,()=>n)}}}finally{this.currentSupervisor.onSuspend(this)}}start(e){if(this._running)this.tell(kw(e));else{this._running=!0;let t=globalThis[Uw];globalThis[Uw]=this;try{this.evaluateEffect(e)}finally{this._running=!1,globalThis[Uw]=t,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(e){this.tell(kw(e))}patchRuntimeFlags(e,t){let n=ag(e,t);return globalThis[Uw]=this,this.currentRuntimeFlags=n,n}initiateAsync(e,t){let n=!1,r=e=>{n||(n=!0,this.tell(kw(e)))};Zh(e)&&(this._asyncInterruptor=r);try{t(r)}catch(e){r(l_(Vd(e)))}}pushStack(e){this._stack.push(e),e._op===`OnStep`&&this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){let e=this._stack.pop();if(e)return e._op===`OnStep`&&this._steps.pop(),e}getNextSuccessCont(){let e=this.popStack();for(;e;){if(e._op!==`OnFailure`)return e;e=this.popStack()}}getNextFailCont(){let e=this.popStack();for(;e;){if(e._op!==`OnSuccess`&&e._op!==`While`&&e._op!==`Iterator`)return e;e=this.popStack()}}Tag(e){return W(()=>dp(this.currentContext,e))}Left(e){return s_(e.left)}None(e){return s_(new Hv)}Right(e){return ly(e.right)}Some(e){return ly(e.value)}Micro(e){return Xg(t=>{let n=t,r=LS(OS(e,this.currentContext));return r.addObserver(e=>{if(e._tag===`Success`)return n(ly(e.value));switch(e.cause._tag){case`Interrupt`:return n(ny(Hd(ym)));case`Fail`:return n(s_(e.cause.error));case`Die`:return n(r_(e.cause.defect))}}),Xg(e=>{n=t=>{e(P_)},r.unsafeInterrupt()})})}[is](e){let t=yo(()=>e.effect_instruction_i0()),n=this.getNextSuccessCont();return n===void 0?(WE.currentOp=ly(t),UE):(n._op in GE||HE(n),GE[n._op](this,n,t))}[rs](e){let t=e,n=this.getNextSuccessCont();return n===void 0?(WE.currentOp=t,UE):(n._op in GE||HE(n),GE[n._op](this,n,t.effect_instruction_i0))}[$o](e){let t=e.effect_instruction_i0,n=this.getNextFailCont();if(n!==void 0)switch(n._op){case es:case ns:return Zh(this.currentRuntimeFlags)&&this.isInterrupted()?ny(of(t)):yo(()=>n.effect_instruction_i1(t));case`OnStep`:return Zh(this.currentRuntimeFlags)&&this.isInterrupted()?ny(of(t)):ly(ny(t));case us:return this.patchRuntimeFlags(this.currentRuntimeFlags,n.patch),Zh(this.currentRuntimeFlags)&&this.isInterrupted()?ny(Wd(t,this.getInterruptedCause())):ny(t);default:HE(n)}else return WE.currentOp=ny(t),UE}[cs](e){return yo(()=>e.effect_instruction_i0(this,Ex(this.currentRuntimeFlags)))}Blocked(e){let t=this.getFiberRefs(),n=this.currentRuntimeFlags;if(this._steps.length>0){let r=[],i=this._steps[this._steps.length-1],a=this.popStack();for(;a&&a._op!==`OnStep`;)r.push(a),a=this.popStack();this.setFiberRefs(i.refs),this.currentRuntimeFlags=i.flags;let o=dx(i.refs,t),s=ig(i.flags,n);return ly(Rg(e.effect_instruction_i0,Gg(t=>{for(;r.length>0;)t.pushStack(r.pop());return t.setFiberRefs(fx(t.id(),t.getFiberRefs())(o)),t.currentRuntimeFlags=ag(s)(t.currentRuntimeFlags),e.effect_instruction_i1})))}return N_(t=>V(QE(zg(e.effect_instruction_i0)),()=>t(e.effect_instruction_i1)))}RunBlocked(e){return Cne(e.effect_instruction_i0)}[as](e){let t=e.effect_instruction_i0,n=this.currentRuntimeFlags,r=ag(n,t);if(Zh(r)&&this.isInterrupted())return ny(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,t),e.effect_instruction_i1){let t=ig(r,n);return this.pushStack(new Nee(t,e)),yo(()=>e.effect_instruction_i1(n))}else return uy}[ts](e){return this.pushStack(e),e.effect_instruction_i0}OnStep(e){return this.pushStack(e),e.effect_instruction_i0}[es](e){return this.pushStack(e),e.effect_instruction_i0}[ns](e){return this.pushStack(e),e.effect_instruction_i0}[Zo](e){return this._asyncBlockingOn=e.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,e.effect_instruction_i0),WE.currentOp=e,UE}[ls](e){return this._isYielding=!1,WE.currentOp=e,UE}[os](e){let t=e.effect_instruction_i0,n=e.effect_instruction_i1;return t()?(this.pushStack(e),n()):uy}[ss](e){return GE[ss](this,e,void 0)}[Qo](e){return yo(()=>e.commit())}runLoop(e){let t=e;for(this.currentOpCount=0;;){if(this.currentRuntimeFlags&2&&this.currentSupervisor.onEffect(this,t),this._queue.length>0&&(t=this.drainQueueWhileRunning(this.currentRuntimeFlags,t)),!this._isYielding){this.currentOpCount+=1;let e=this.currentScheduler.shouldYield(this);if(e!==!1){this._isYielding=!0,this.currentOpCount=0;let n=t;t=V(H_({priority:e}),()=>n)}}try{if(t=this.currentTracer.context(()=>{if(wne!==t[Bg]._V){let e=this.getFiberRef(Wee);if(e._tag===`Some`){let n=t[Bg]._V;this.log(`Executing an Effect versioned ${n} with a Runtime of version ${fs()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,zd,e)}}return this[t._op](t)},this),t===UE){let e=WE.currentOp;return e._op===`Yield`||e._op===`Async`?UE:(WE.currentOp=null,e._op===`Success`||e._op===`Failure`?e:ny(Vd(e)))}}catch(e){t=t!==UE&&!M(t,`_op`)||!(t._op in this)?i_(`Not a valid effect: ${Wo(t)}`):Rv(e)?ny(Wd(Vd(e),Hd(ym))):r_(e)}}}run=()=>{this.drainQueueOnCurrentThread()}};const Tne=La(`effect/FiberRef/currentMinimumLogLevel`,()=>fv(Rx(`Info`))),Ene=e=>qw(t=>{up(rx(t.context,Rb),Ab).unsafe.log(e.log(t))}),Dne=La(Symbol.for(`effect/Logger/defaultLogger`),()=>Ene(Yw)),One=La(Symbol.for(`effect/Logger/tracerLogger`),()=>qw(({annotations:e,cause:t,context:n,fiberId:r,logLevel:i,message:a})=>{let o=fp($b(n,vv),Pb);if(o._tag===`None`||o.value._tag===`ExternalSpan`)return;let s=dp($b(n,Rb),ab),c={};for(let[t,n]of e)c[t]=n;c[`effect.fiberId`]=Em(r),c[`effect.logLevel`]=i.label,t!==null&&t._tag!==`Empty`&&(c[`effect.cause`]=xf(t,{renderErrorCause:!0})),o.value.event(Wo(Array.isArray(a)&&a.length===1?a[0]:a),s.unsafeCurrentTimeNanos(),c)})),kne=La(Symbol.for(`effect/FiberRef/currentLoggers`),()=>pv(xd(Dne,One))),Ane=A(e=>Wg(e[0]),(e,t)=>M_(j_(e,e=>jne(n=>t(e,n))))),jne=e=>Gg(t=>{let n=t.getFiberRefs(),r=Yh(t.currentRuntimeFlags,1);return V(lD,t=>jv(t,t=>Gg(i=>{let a=i.getFiberRefs(),o=i.currentRuntimeFlags,s=dx(a,n),c=ig(o,r),l=dx(n,a);return i.setFiberRefs(fx(s,i.id(),n)),_D(V_(e(t),c),W(()=>{i.setFiberRefs(fx(l,i.id(),i.getFiberRefs()))}))})))});var Mne=(e,t,n)=>{let r=e.next();return r.done?H(!1):V(n(r.value,t),r=>r?H(r):Mne(e,t+1,n))},Nne=e=>{if(Array.isArray(e)||$a(e))return[e,z()];let t=Object.keys(e),n=t.length;return[t.map(t=>e[t]),B(e=>{let r={};for(let i=0;i<n;i++)r[t[i]]=e[i];return r})]},Pne=(e,t,n)=>{let r=[];for(let t of e)r.push(a_(t));return V(JE(r,Ea,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),e=>{let r=z(),i=e.length,a=Array(i),o=Array(i),s=!1;for(let t=0;t<i;t++){let n=e[t];n._tag===`Left`?(a[t]=B(n.left),s=!0):(o[t]=n.right,a[t]=r)}return s?t._tag===`Some`?s_(t.value(a)):s_(a):n?.discard?P_:t._tag===`Some`?H(t.value(o)):H(o)})},Fne=(e,t,n)=>{let r=[];for(let t of e)r.push(a_(t));return n?.discard?JE(r,Ea,{concurrency:n?.concurrency,batching:n?.batching,discard:!0,concurrentFinalizers:n?.concurrentFinalizers}):C_(JE(r,Ea,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),e=>t._tag===`Some`?t.value(e):e)};const qE=(e,t)=>{let[n,r]=Nne(e);return t?.mode===`validate`?Pne(n,r,t):t?.mode===`either`?Fne(n,r,t):t?.discard!==!0&&r._tag===`Some`?C_(JE(n,Ea,t),r.value):JE(n,Ea,t)},JE=A(e=>$a(e[0]),(e,t,n)=>Gg(r=>{let i=n?.batching===!0||n?.batching===`inherit`&&r.getFiberRef(Hee);return n?.discard?sC(n.concurrency,()=>rD(Gb,n?.concurrentFinalizers)(n=>i?XE(e,(e,r)=>n(t(e,r)),!0,!1,1):v_(e,(e,r)=>n(t(e,r)))),()=>rD(Kb,n?.concurrentFinalizers)(n=>XE(e,(e,r)=>n(t(e,r)),i,!1)),r=>rD(qb(r),n?.concurrentFinalizers)(n=>XE(e,(e,r)=>n(t(e,r)),i,!1,r))):sC(n?.concurrency,()=>rD(Gb,n?.concurrentFinalizers)(n=>i?ZE(e,1,(e,r)=>n(t(e,r)),!0):__(e,(e,r)=>n(t(e,r)))),()=>rD(Kb,n?.concurrentFinalizers)(n=>YE(e,(e,r)=>n(t(e,r)),i)),r=>rD(qb(r),n?.concurrentFinalizers)(n=>ZE(e,r,(e,r)=>n(t(e,r)),i)))})),YE=(e,t,n)=>U(()=>{let r=Dc(e),i=Array(r.length);return G_(XE(r,(e,n)=>V(t(e,n),e=>W(()=>i[n]=e)),n,!1),H(i))}),XE=(e,t,n,r,i)=>N_(a=>Lee(o=>Gg(s=>{let c=Array.from(e).reverse(),l=c.length;if(l===0)return P_;let u=0,d=!1,f=i?Math.min(c.length,i):c.length,p=new Set,m=[],h=()=>p.forEach(e=>{e.currentScheduler.scheduleTask(()=>{e.unsafeInterruptAsFork(s.id())},0)}),g=[],_=[],v=[],y=()=>{let e=m.filter(({exit:e})=>e._tag===`Failure`).sort((e,t)=>e.index<t.index?-1:e.index===t.index?0:1).map(({exit:e})=>e);return e.length===0&&e.push(uy),e},b=(e,t=!1)=>{let n=M_(o(e)),r=Ine(n,s,s.currentRuntimeFlags,Fw);return s.currentScheduler.scheduleTask(()=>{t&&r.unsafeInterruptAsFork(s.id()),r.resume(n)},0),r},x=()=>{r||(l-=c.length,c=[]),d=!0,h()},S=n?Pee:o_,C=b(Qg(e=>{let r=(e,t)=>{e._op===`Blocked`?v.push(e):(m.push({index:t,exit:e}),e._op===`Failure`&&!d&&x())},o=()=>{if(c.length>0){let f=c.pop(),h=u++,x=()=>{let e=c.pop();return h=u++,V(H_(),()=>V(S(a(t(e,h))),C))},C=e=>c.length>0&&(r(e,h),c.length>0)?x():H(e),w=b(V(S(a(t(f,h))),C));g.push(w),p.add(w),d&&w.currentScheduler.scheduleTask(()=>{w.unsafeInterruptAsFork(s.id())},0),w.addObserver(t=>{let a;if(a=t._op===`Failure`?t:t.effect_instruction_i0,_.push(w),p.delete(w),r(a,h),m.length===l)e(H(lc($v(y(),{parallel:!0}),()=>uy)));else if(v.length+m.length===l){let t=y();e(H(Rg(v.map(e=>e.effect_instruction_i0).reduce(ug),XE([lc($v(t,{parallel:!0}),()=>uy),...v.map(e=>e.effect_instruction_i1)],e=>e,n,!0,i))))}else o()})}};for(let e=0;e<f;e++)o()}));return Jg(D_(p_(a(Hw(C))),sy({onFailure:e=>{x();let t=v.length+1,n=Math.min(typeof i==`number`?i:v.length,v.length),r=Array.from(v);return Qg(i=>{let a=[],o=0,s=0,c=(n,s)=>c=>{a[n]=c,o++,o===t&&i(ly(ny(e))),r.length>0&&s&&l()},l=()=>{b(r.pop(),!0).addObserver(c(s,!0)),s++};C.addObserver(c(s,!1)),s++;for(let e=0;e<n;e++)l()})},onSuccess:()=>__(_,e=>e.inheritAll)})))}))),ZE=(e,t,n,r)=>U(()=>{let i=Dc(e),a=Array(i.length);return G_(XE(i,(e,t)=>C_(n(e,t),e=>a[t]=e),r,!1,t),H(a))}),QE=e=>Lne(e,Fw),$E=(e,t,n,r=null)=>{let i=eD(e,t,n,r);return i.resume(e),i},Ine=(e,t,n,r=null)=>eD(e,t,n,r),eD=(e,t,n,r=null)=>{let i=Om(),a=zte(t.getFiberRefs(),i),o=new KE(i,a,n),s=$b(a,vv),c=o.currentSupervisor;return c.onStart(s,e,B(t),o),o.addObserver(e=>c.onEnd(e,o)),(r===null?j(t.getFiberRef(wv),lc(()=>t.scope())):r).add(n,o),o};var Lne=(e,t)=>Gg((n,r)=>H($E(e,n,r.runtimeFlags,t)));const tD=e=>ky(t=>cc(fp(t,cD),{onNone:()=>e,onSome:t=>{switch(t.strategy._tag){case`Parallel`:return e;case`Sequential`:case`ParallelN`:return V(Nv(t,Kb),t=>fD(e,t))}}})),nD=e=>t=>ky(n=>cc(fp(n,cD),{onNone:()=>t,onSome:n=>n.strategy._tag===`ParallelN`&&n.strategy.parallelism===e?t:V(Nv(n,qb(e)),e=>fD(t,e))})),rD=(e,t)=>n=>ky(r=>cc(fp(r,cD),{onNone:()=>n(Ea),onSome:r=>{if(t===!0){let t=e._tag===`Parallel`?tD:e._tag===`Sequential`?oD:nD(e.parallelism);switch(r.strategy._tag){case`Parallel`:return t(n(tD));case`Sequential`:return t(n(oD));case`ParallelN`:return t(n(nD(r.strategy.parallelism)))}}else return n(Ea)}})),iD=e=>V(cD,e),aD=e=>V(dD(),t=>D_(e(t),e=>t.close(e))),Rne=e=>V(dD(),t=>Wne(e,t)),oD=e=>ky(t=>cc(fp(t,cD),{onNone:()=>e,onSome:t=>{switch(t.strategy._tag){case`Sequential`:return e;case`Parallel`:case`ParallelN`:return V(Nv(t,Gb),t=>fD(e,t))}}})),zne=A(e=>Wg(e[1]),(e,t,n)=>sD(e,t,(e,t)=>[e,t],n)),Bne=A(e=>Wg(e[1]),(e,t,n)=>n?.concurrent!==!0&&(n?.batching===void 0||n.batching===!1)?W_(e,t):sD(e,t,(e,t)=>e,n)),Vne=A(e=>Wg(e[1]),(e,t,n)=>n?.concurrent!==!0&&(n?.batching===void 0||n.batching===!1)?G_(e,t):sD(e,t,(e,t)=>t,n)),sD=A(e=>Wg(e[1]),(e,t,n,r)=>C_(qE([e,t],{concurrency:r?.concurrent?2:1,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),([e,t])=>n(e,t))),cD=rp(`effect/Scope`),lD=cD;var Hne=(e,t)=>{e.state._tag===`Open`&&e.state.finalizers.set({},t)},Une={[Ov]:Ov,[kv]:kv,pipe(){return L(this,arguments)},fork(e){return W(()=>{let t=uD(e);if(this.state._tag===`Closed`)return t.state=this.state,t;let n={};return this.state.finalizers.set(n,e=>t.close(e)),Hne(t,e=>W(()=>{this.state._tag===`Open`&&this.state.finalizers.delete(n)})),t})},close(e){return U(()=>{if(this.state._tag===`Closed`)return P_;let t=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:`Closed`,exit:e},t.length===0?P_:Nte(this.strategy)?j(__(t,t=>o_(t(e))),V(e=>j($v(e),gc(Qv),lc(()=>uy)))):Pte(this.strategy)?j(YE(t,t=>o_(t(e)),!1),V(e=>j($v(e,{parallel:!0}),gc(Qv),lc(()=>uy)))):j(ZE(t,this.strategy.parallelism,t=>o_(t(e)),!1),V(e=>j($v(e,{parallel:!0}),gc(Qv),lc(()=>uy))))})},addFinalizer(e){return U(()=>this.state._tag===`Closed`?e(this.state.exit):(this.state.finalizers.set({},e),P_))}},uD=(e=Ub)=>{let t=Object.create(Une);return t.strategy=e,t.state={_tag:`Open`,finalizers:new Map},t};const dD=(e=Ub)=>W(()=>uD(e)),fD=A(2,(e,t)=>My(e,pp(cp(cD,t)))),Wne=A(2,(e,t)=>j(e,fD(t),D_(e=>t.close(e)))),Gne=e=>gv(e,{differ:hne,fork:FE}),pD=_v(tg),Kne=Gne(AE),mD=A(3,(e,t,n)=>hD(e,t,{onSelfWin:(e,t)=>V(e.await,r=>{switch(r._tag){case rs:return V(e.inheritAll,()=>n.onSelfDone(r,t));case $o:return n.onSelfDone(r,t)}}),onOtherWin:(e,t)=>V(e.await,r=>{switch(r._tag){case rs:return V(e.inheritAll,()=>n.onOtherDone(r,t));case $o:return n.onOtherDone(r,t)}})})),qne=A(2,(e,t)=>f_(n=>mD(e,t,{onSelfDone:(e,t)=>cy(e,{onFailure:e=>j(Hw(t),FC(t=>Ud(e,t))),onSuccess:e=>j(t,Y_(n),qg(e))}),onOtherDone:(e,t)=>cy(e,{onFailure:e=>j(Hw(t),FC(t=>Ud(t,e))),onSuccess:e=>j(t,Y_(n),qg(e))})}))),hD=A(3,(e,t,n)=>Gg((r,i)=>{let a=i.runtimeFlags,o=em(!0),s=eD(e,r,a,n.selfScope),c=eD(t,r,a,n.otherScope);return Qg(r=>{s.addObserver(()=>gD(s,c,n.onSelfWin,o,r)),c.addObserver(()=>gD(c,s,n.onOtherWin,o,r)),s.startFork(e),c.startFork(t)},Sm(s.id(),c.id()))}));var gD=(e,t,n,r,i)=>{tee(!0,!1)(r)&&i(n(e,t))};const _D=A(2,(e,t)=>N_(n=>h_(n(e),{onFailure:e=>h_(t,{onFailure:t=>l_(Wd(e,t)),onSuccess:()=>l_(e)}),onSuccess:e=>qg(t,e)}))),Jne=(e,t,n)=>f_(r=>V(V(QE(x_(e)),e=>Qg(r=>{let i=t.map(e=>e.listeners.count),a=()=>{i.every(e=>e===0)&&t.every(e=>e.result.state.current._tag===`Pending`?!0:!!(e.result.state.current._tag===`Done`&&Jv(e.result.state.current.effect)&&e.result.state.current.effect._tag===`Failure`&&Xd(e.result.state.current.effect.cause)))&&(o.forEach(e=>e()),n?.(),r(J_(e)))};e.addObserver(e=>{o.forEach(e=>e()),r(e)});let o=t.map((e,t)=>{let n=e=>{i[t]=e,a()};return e.listeners.addObserver(n),()=>e.listeners.removeObserver(n)});return a(),W(()=>{o.forEach(e=>e())})})),()=>U(()=>v_(t.flatMap(e=>e.state.completed?[]:[e]),e=>sne(e.request,ay(r)))))),Yne=(e,t)=>(t=Ib(t),M_(Gg(n=>{let r=dp(n.getFiberRef(vv),cD),i=rw(n,e,t),a=n.getFiberRef(Dv),o=up(n.getFiberRef(Rb),ab);return qg(jv(r,e=>iw(i,e,o,a)),i)}))),vD=Symbol.for(`effect/ScheduleInterval`),yD={[vD]:vD,startMillis:0,endMillis:0},bD=(e,t)=>e>t?yD:{[vD]:vD,startMillis:e,endMillis:t},Xne=A(2,(e,t)=>Zne(e,t)===e),Zne=A(2,(e,t)=>e.endMillis<=t.startMillis?e:t.endMillis<=e.startMillis?t:e.startMillis<t.startMillis?e:t.startMillis<e.startMillis?t:e.endMillis<=t.endMillis?e:t),Qne=e=>e.startMillis>=e.endMillis,$ne=A(2,(e,t)=>bD(Math.max(e.startMillis,t.startMillis),Math.min(e.endMillis,t.endMillis))),ere=e=>bD(e,1/0),xD=yD,tre=Xne,nre=Qne,rre=$ne,ire=ere,SD=Symbol.for(`effect/ScheduleIntervals`),CD=e=>({[SD]:SD,intervals:e}),are=A(2,(e,t)=>ore(e.intervals,t.intervals,Dl()));var ore=(e,t,n)=>{let r=e,i=t,a=n;for(;ql(r)&&ql(i);){let e=j(Xl(r),rre(Xl(i))),t=nre(e)?a:j(a,zl(e));j(Xl(r),tre(Xl(i)))?r=eu(r):i=eu(i),a=t}return CD(Nl(a))};const wD=e=>j(e.intervals,Jl,lc(()=>xD)).startMillis,sre=e=>j(e.intervals,Jl,lc(()=>xD)).endMillis,cre=A(2,(e,t)=>wD(e)<wD(t)),lre=e=>ql(e.intervals),ure=CD,dre=are,TD=wD,ED=sre,fre=cre,pre=lre,DD=`Continue`,OD=`Done`,mre=e=>({_tag:DD,intervals:e}),hre=e=>({_tag:DD,intervals:ure(kl(e))}),gre={_tag:OD},_re=e=>e._tag===DD,vre=e=>e._tag===OD;var yre=mre;const bre=hre,kD=gre,AD=_re,jD=vre,MD=cD,ND=Av,PD=jv,FD=Mv,ID=fD,LD=Nv,xre=dD;var Sre=class{permits;waiters=new Set;taken=0;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take=e=>Zg(t=>{if(this.free<e){let n=()=>{this.free<e||(this.waiters.delete(n),t(U(()=>this.free<e?this.take(e):(this.taken+=e,H(e)))))};return this.waiters.add(n),W(()=>{this.waiters.delete(n)})}t(U(()=>this.free<e?this.take(e):(this.taken+=e,H(e))))});updateTakenUnsafe(e,t){return this.taken=t(this.taken),this.waiters.size>0&&e.getFiberRef(aC).scheduleTask(()=>{let e=this.waiters.values(),t=e.next();for(;t.done===!1&&this.free>0;)t.value(),t=e.next()},e.getFiberRef(yv)),H(this.free)}updateTaken(e){return Gg(t=>this.updateTakenUnsafe(t,e))}resize=e=>Jg(Gg(t=>(this.permits=e,this.free<0?P_:this.updateTakenUnsafe(t,e=>e))));release=e=>this.updateTaken(t=>t-e);releaseAll=this.updateTaken(e=>0);withPermits=e=>t=>N_(n=>V(n(this.take(e)),e=>_D(n(t),this.release(e))));withPermitsIfAvailable=e=>t=>N_(n=>U(()=>this.free<e?KC:(this.taken+=e,_D(n(vC(t)),this.release(e)))))};const RD=e=>new Sre(e),Cre=e=>W(()=>RD(e));var zD=class extends Bb{isOpen;waiters=[];scheduled=!1;constructor(e){super(),this.isOpen=e}commit(){return this.await}unsafeSchedule(e){return this.scheduled||this.waiters.length===0?P_:(this.scheduled=!0,e.currentScheduler.scheduleTask(this.flushWaiters,e.getFiberRef(yv)),P_)}flushWaiters=()=>{this.scheduled=!1;let e=this.waiters;this.waiters=[];for(let t=0;t<e.length;t++)e[t](uy)};open=Gg(e=>this.isOpen?P_:(this.isOpen=!0,this.unsafeSchedule(e)));unsafeOpen(){this.isOpen||(this.isOpen=!0,this.flushWaiters())}release=Gg(e=>this.isOpen?P_:this.unsafeSchedule(e));await=Zg(e=>this.isOpen?e(P_):(this.waiters.push(e),W(()=>{let t=this.waiters.indexOf(e);t!==-1&&this.waiters.splice(t,1)})));unsafeClose(){this.isOpen=!1}close=W(()=>{this.isOpen=!1});whenOpen=e=>G_(this.await,e)};const wre=e=>new zD(e??!1),BD=A(2,(e,t)=>Gg((n,r)=>{let i=t,a=$E(e,n,r.runtimeFlags,Fw);if(i.state._tag===`Open`){let e=()=>f_(e=>Ao(e,a.id())?P_:Jg(J_(a))),t={};i.state.finalizers.set(t,e),a.addObserver(()=>{i.state._tag!==`Closed`&&i.state.finalizers.delete(t)})}else a.unsafeInterruptAsFork(n.id());return H(a)})),VD=e=>iD(t=>BD(e,t)),HD=A(2,(e,t)=>UD(e,{onTimeout:()=>Gv(t),duration:t})),UD=A(2,(e,{duration:t,onTimeout:n})=>p_(WD(e,{onTimeout:()=>c_(n),onSuccess:H,duration:t}))),WD=A(2,(e,{duration:t,onSuccess:n,onTimeout:r})=>f_(i=>N_(a=>hD(a(e),x_(GC(t)),{onSelfWin:(e,t)=>V(e.await,r=>r._tag===`Success`?V(e.inheritAll,()=>qg(Y_(t,i),n(r.value))):V(Y_(t,i),()=>ny(r.cause))),onOtherWin:(e,t)=>V(e.await,n=>n._tag===`Success`?V(e.inheritAll,()=>qg(Y_(t,i),r())):V(Y_(t,i),()=>ny(n.cause))),otherScope:Fw})))),GD=Symbol.for(`effect/Ref/SynchronizedRef`),KD={_A:e=>e};var qD=class extends Bb{ref;withLock;[GD]=KD;[zS]=BS;[RS]=RS;constructor(e,t){super(),this.ref=e,this.withLock=t,this.get=WS(this.ref)}get;commit(){return this.get}modify(e){return this.modifyEffect(t=>H(e(t)))}modifyEffect(e){return this.withLock(j(V(WS(this.ref),e),V(([e,t])=>qg(GS(this.ref,t),e))))}};const JD=e=>W(()=>YD(e)),YD=e=>new qD(HS(e),RD(1).withPermits(1)),XD=Symbol.for(`effect/ManagedRuntime`),ZD=`Fresh`;var QD=Bw;const $D=Ww,eO=Vw,tO=J_,nO=Y_,rO=Hw;var iO=e=>function(){if(arguments.length===1){let t=arguments[0];return(n,...r)=>e(t,n,...r)}return e.apply(this,arguments)};const aO=iO((e,t,n)=>{let r=Om(),i=[[vv,[[r,e.context]]]];n?.scheduler&&i.push([aC,[[r,n.scheduler]]]);let a=Vte(e.fiberRefs,{entries:i,forkAs:r});n?.updateRefs&&(a=n.updateRefs(a,r));let o=new KE(r,a,e.runtimeFlags),s=t;n?.scope&&(s=V(LD(n.scope,Ub),e=>G_(Av(e,f_(e=>Ao(e,o.id())?P_:Y_(o,e))),D_(t,t=>FD(e,t)))));let c=o.currentSupervisor;return c!==AE&&(c.onStart(e.context,s,z(),o),o.addObserver(e=>c.onEnd(e,o))),Fw.add(e.runtimeFlags,o),n?.immediate===!1?o.resume(s):o.start(s),o}),oO=iO((e,t,n={})=>{let r=aO(e,t,n);return n.onExit&&r.addObserver(e=>{n.onExit(e)}),(t,n)=>oO(e)(j(r,nO(t??ym)),{...n,onExit:n?.onExit?e=>n.onExit(hw(e)):void 0})}),sO=iO((e,t)=>{let n=hO(e)(t);if(n._tag===`Failure`)throw pO(n.effect_instruction_i0);return n.effect_instruction_i0});var cO=class extends Error{fiber;_tag=`AsyncFiberException`;constructor(e){super(`Fiber #${e.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`),this.fiber=e,this.name=this._tag,this.stack=this.message}},lO=e=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=0;let n=new cO(e);return Error.stackTraceLimit=t,n};const uO=Symbol.for(`effect/Runtime/FiberFailure`),dO=Symbol.for(`effect/Runtime/FiberFailure/Cause`);var fO=class extends Error{[uO];[dO];constructor(e){let t=kf(e)[0];super(t?.message||`An error has occurred`),this[uO]=uO,this[dO]=e,this.name=t?`(FiberFailure) ${t.name}`:`FiberFailure`,t?.stack&&(this.stack=t.stack)}toJSON(){return{_id:`FiberFailure`,cause:this[dO].toJSON()}}toString(){return`(FiberFailure) `+xf(this[dO],{renderErrorCause:!0})}[Po](){return this.toString()}};const pO=e=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=0;let n=new fO(e);return Error.stackTraceLimit=t,n};var mO=e=>{let t=e;switch(t._op){case`Failure`:case`Success`:return t;case`Left`:return ty(t.left);case`Right`:return ly(t.right);case`Some`:return ly(t.value);case`None`:return ty(new Hv)}};const hO=iO((e,t)=>{let n=mO(t);if(n)return n;let r=new iC,i=aO(e)(t,{scheduler:r});return r.flush(),i.unsafePoll()||ey(n_(lO(i),Ny(i)))}),gO=iO((e,t,n)=>_O(e,t,n).then(e=>{switch(e._tag){case rs:return e.effect_instruction_i0;case $o:throw pO(e.effect_instruction_i0)}})),_O=iO((e,t,n)=>new Promise(r=>{let i=mO(t);i&&r(i);let a=aO(e)(t);a.addObserver(e=>{r(e)}),n?.signal!==void 0&&(n.signal.aborted?a.unsafeInterruptAsFork(a.id()):n.signal.addEventListener(`abort`,()=>{a.unsafeInterruptAsFork(a.id())},{once:!0}))}));var vO=class{context;runtimeFlags;fiberRefs;constructor(e,t,n){this.context=e,this.runtimeFlags=t,this.fiberRefs=n}pipe(){return L(this,arguments)}};const yO=e=>new vO(e.context,e.runtimeFlags,e.fiberRefs),bO=()=>Gg((e,t)=>H(new vO(e.getFiberRef(vv),t.runtimeFlags,e.getFiberRefs()))),xO=yO({context:sp(),runtimeFlags:eg(1,32,4),fiberRefs:Hte()}),SO=aO(xO),CO=gO(xO),Tre=_O(xO),wO=sO(xO),Ere=hO(xO),Dre=A(2,(e,t)=>e.modifyEffect(t)),TO=Symbol.for(`effect/Layer`);var Ore={_RIn:e=>e,_E:e=>e,_ROut:e=>e};const EO={[TO]:Ore,pipe(){return L(this,arguments)}},DO=Symbol.for(`effect/Layer/MemoMap`),OO=gp()(`effect/Layer/CurrentMemoMap`,{defaultValue:()=>NO()}),kO=e=>M(e,TO),AO=e=>e._op_layer===ZD;var jO=class{ref;[DO];constructor(e){this.ref=e,this[DO]=DO}getOrElseMemoize(e,t){return j(Dre(this.ref,n=>{let r=n.get(e);if(r!==void 0){let[e,i]=r;return H([j(e,V(([e,t])=>j(zC(e),qg(t))),D_(sy({onFailure:()=>P_,onSuccess:()=>jv(t,i)}))),n])}return j(US(0),V(r=>j(gy(),V(i=>j(US(()=>P_),C_(a=>{let o=N_(o=>j(dD(),V(s=>j(o(V(IO(e,s,!0),e=>bC(e(this)))),o_,V(o=>{switch(o._tag){case $o:return j(xy(i,o.effect_instruction_i0),G_(Mv(s,o)),G_(l_(o.effect_instruction_i0)));case rs:return j(GS(a,e=>j(Mv(s,e),I_(qS(r,e=>[e===1,e-1])),Jg)),G_(JS(r,e=>e+1)),G_(jv(t,t=>j(W(()=>n.delete(e)),G_(WS(a)),V(e=>e(t))))),G_(wy(i,o.effect_instruction_i0)),qg(o.effect_instruction_i0[1]))}}))))),s=[j(vy(i),D_(cy({onFailure:()=>P_,onSuccess:()=>JS(r,e=>e+1)}))),e=>j(WS(a),V(t=>t(e)))];return[o,AO(e)?n:n.set(e,s)]}))))))}),p_)}};const MO=U(()=>C_(JD(new Map),e=>new jO(e))),NO=()=>new jO(YD(new Map)),PO=A(2,(e,t)=>V(MO,n=>FO(e,n,t))),FO=A(3,(e,t,n)=>V(IO(e,n),e=>VC(e(t),OO,t)));var IO=(e,t,n=!1)=>{let r=e;switch(r._op_layer){case`Locally`:return W(()=>e=>r.f(e.getOrElseMemoize(r.self,t)));case`ExtendScope`:return W(()=>e=>iD(t=>e.getOrElseMemoize(r.layer,t)));case`Fold`:return W(()=>e=>j(e.getOrElseMemoize(r.layer,t),h_({onFailure:n=>e.getOrElseMemoize(r.failureK(n),t),onSuccess:n=>e.getOrElseMemoize(r.successK(n),t)})));case`Fresh`:return W(()=>e=>j(r.layer,PO(t)));case`FromEffect`:return W(n?()=>e=>r.effect:()=>n=>n.getOrElseMemoize(e,t));case`Provide`:return W(()=>e=>j(e.getOrElseMemoize(r.first,t),V(n=>j(e.getOrElseMemoize(r.second,t),Ay(n)))));case`Scoped`:return W(n?()=>e=>fD(r.effect,t):()=>n=>n.getOrElseMemoize(e,t));case`Suspend`:return W(()=>e=>e.getOrElseMemoize(r.evaluate(),t));case`ProvideMerge`:return W(()=>e=>j(e.getOrElseMemoize(r.first,t),K_(e.getOrElseMemoize(r.second,t),r.zipK)));case`ZipWith`:return z_(function*(){let e=yield*Nv(t,Wb),n=yield*Nv(e,Ub),i=yield*Nv(e,Ub);return e=>j(e.getOrElseMemoize(r.first,n),sD(e.getOrElseMemoize(r.second,i),r.zipK,{concurrent:!0}))});case`MergeAll`:{let e=r.layers;return C_(Nv(t,Wb),t=>n=>{let r=Array(e.length);return C_(XE(e,B_(function*(e,i){let a=yield*Nv(t,Ub);r[i]=yield*n.getOrElseMemoize(e,a)}),!1,!1),()=>mp(...r))})}}};const LO=A(2,(e,t)=>KO(e,{onFailure:t,onSuccess:$O})),RO=()=>WO(Oy()),zO=e=>BO(Ly(e)),BO=e=>WO(l_(e)),VO=A(2,(e,t)=>KO(e,{onFailure:zO,onSuccess:t})),HO=e=>{let t=Object.create(EO);return t._op_layer=ZD,t.layer=e,t},UO=A(2,(e,t)=>{let n=op(e),r=n?e:t;return WO(C_(n?t:e,e=>cp(r,e)))});function WO(e){let t=Object.create(EO);return t._op_layer=`FromEffect`,t.effect=e,t}const GO=A(2,(e,{onFailure:t,onSuccess:n})=>{let r=Object.create(EO);return r._op_layer=`Fold`,r.layer=e,r.failureK=t,r.successK=n,r}),KO=A(2,(e,{onFailure:t,onSuccess:n})=>GO(e,{onFailure:e=>{let n=qy(e);switch(n._tag){case`Left`:return t(n.left);case`Right`:return BO(n.right)}},onSuccess:n})),qO=(...e)=>{let t=Object.create(EO);return t._op_layer=`MergeAll`,t.layers=e,t};var JO=(e,t,n,r)=>j(e,LO(i=>j(YO(t,n,i,r),VO(r=>HO(JO(e,t,n,j(r,up(n)).state)))))),YO=(e,t,n,r)=>UO(t,j(lC,V(t=>j(e.step(t,n,r),V(([e,r,i])=>jD(i)?s_(n):j(cC(Ip(TD(i.intervals)-t)),qg({state:e})))))));const XO=A(2,(e,t)=>{let n=op(e),r=n?e:t;return ZO(C_(n?t:e,e=>cp(r,e)))}),ZO=e=>{let t=Object.create(EO);return t._op_layer=`Scoped`,t.effect=e,t},QO=A(2,(e,t)=>{let n=op(e);return WO(H(cp(n?e:t,n?t:e)))}),$O=e=>WO(H(e)),ek=e=>{let t=Object.create(EO);return t._op_layer=`Suspend`,t.evaluate=e,t},tk=A(2,(e,t)=>V(iD(n=>FO(e,t,n)),e=>j(bO(),Ay(e)))),nk=A(2,(e,t)=>ek(()=>{let n=Object.create(EO);return n._op_layer=`Provide`,n.first=Object.create(EO,{_op_layer:{value:`ProvideMerge`,enumerable:!0},first:{value:RO(),enumerable:!0},second:{value:Array.isArray(t)?qO(...t):t},zipK:{value:(e,t)=>j(e,pp(t))}}),n.second=e,n}));var rk=A(2,(e,t)=>aD(n=>V(PO(t,n),t=>jy(e,t)))),ik=A(2,(e,t)=>{let n=dx(xO.fiberRefs,t.fiberRefs),r=ig(xO.runtimeFlags,t.runtimeFlags);return N_(i=>Gg(a=>{let o=a.getFiberRef(vv),s=a.getFiberRefs(),c=fx(a.id(),s)(n),l=a.currentRuntimeFlags,u=ag(r)(l),d=dx(c,s),f=ig(u,l);return a.setFiberRefs(c),a.currentRuntimeFlags=u,_D(jy(i(e),pp(o,t.context)),Gg(e=>(e.setFiberRefs(fx(e.id(),e.getFiberRefs())(d)),e.currentRuntimeFlags=ag(f)(e.currentRuntimeFlags),P_)))}))});const ak=A(2,(e,t)=>Array.isArray(t)?rk(e,qO(...t)):kO(t)?rk(e,t):ap(t)?jy(e,t):XD in t?V(t.runtimeEffect,t=>ik(e,t)):ik(e,t)),kre=$m,ok=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return{BaseEffectError:class extends Pv{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Object.assign(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}.BaseEffectError}(),sk=e=>{let t={BaseEffectError:class extends ok{_tag=e}};return t.BaseEffectError.prototype.name=e,t.BaseEffectError},ck=Symbol.for(`effect/DateTime`),lk=Symbol.for(`effect/DateTime/TimeZone`);var uk={[ck]:ck,pipe(){return L(this,arguments)},[Po](){return this.toString()},toJSON(){return mk(this).toJSON()}},Are={...uk,_tag:`Utc`,[N](){return ko(this,wo(this.epochMillis))},[I](e){return fk(e)&&e._tag===`Utc`&&this.epochMillis===e.epochMillis},toString(){return`DateTime.Utc(${mk(this).toJSON()})`}};({...uk});var dk={[lk]:lk,[Po](){return this.toString()}};({...dk}),{...dk};const fk=e=>M(e,ck),jre=e=>e._tag===`Utc`,Mre=Ma((e,t)=>e.epochMillis===t.epochMillis);var Nre=e=>{let t=Object.create(Are);return t.epochMillis=e,Object.defineProperty(t,`partsUtc`,{value:void 0,enumerable:!1,writable:!0}),t};const pk=e=>{let t=e.getTime();if(Number.isNaN(t))throw new Xy(`Invalid date`);return Nre(t)},Pre=e=>{if(fk(e))return e;if(e instanceof Date)return pk(e);if(typeof e==`object`){let t=new Date(0);return zre(t,e),pk(t)}else if(typeof e==`string`&&!Fre(e))return pk(new Date(e+`Z`));return pk(new Date(e))};var Fre=e=>/Z|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e);const mk=e=>new Date(e.epochMillis),Ire=e=>{if(e._tag===`Utc`)return new Date(e.epochMillis);if(e.zone._tag===`Offset`)return new Date(e.epochMillis+e.zone.offset);if(e.adjustedEpochMillis!==void 0)return new Date(e.adjustedEpochMillis);let t=e.zone.format.formatToParts(e.epochMillis).filter(e=>e.type!==`literal`),n=new Date(0);return n.setUTCFullYear(Number(t[2].value),Number(t[0].value)-1,Number(t[1].value)),n.setUTCHours(Number(t[3].value),Number(t[4].value),Number(t[5].value),Number(t[6].value)),e.adjustedEpochMillis=n.getTime(),n},Lre=e=>Ire(e).getTime()-hk(e);var Rre=e=>{let t=Math.abs(e),n=Math.floor(t/(3600*1e3)),r=Math.round(t%(3600*1e3)/(60*1e3));return r===60&&(n+=1,r=0),`${e<0?`-`:`+`}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`};const hk=e=>e.epochMillis;var zre=(e,t)=>{if(t.year!==void 0&&e.setUTCFullYear(t.year),t.month!==void 0&&e.setUTCMonth(t.month-1),t.day!==void 0&&e.setUTCDate(t.day),t.weekDay!==void 0){let n=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+n)}t.hours!==void 0&&e.setUTCHours(t.hours),t.minutes!==void 0&&e.setUTCMinutes(t.minutes),t.seconds!==void 0&&e.setUTCSeconds(t.seconds),t.millis!==void 0&&e.setUTCMilliseconds(t.millis)};const Bre=e=>mk(e).toISOString();sk(`CronParseError`);const gk=Symbol.for(`effect/Schedule`),Vre=e=>M(e,gk),Hre=Symbol.for(`effect/ScheduleDriver`);var _k={start:0,now:0,input:void 0,output:void 0,elapsed:Mp,elapsedSincePrevious:Mp,recurrence:0};const vk=gp()(`effect/Schedule/CurrentIterationMetadata`,{defaultValue:()=>_k});var yk={_Out:e=>e,_In:e=>e,_R:e=>e},bk={_Out:e=>e,_In:e=>e,_R:e=>e},xk=class{initial;step;[gk]=yk;constructor(e,t){this.initial=e,this.step=t}pipe(){return L(this,arguments)}},Sk=(e,t,n,r)=>JS(e,e=>e.recurrence===0?{now:t,input:n,output:r,recurrence:e.recurrence+1,elapsed:Mp,elapsedSincePrevious:Mp,start:t}:{now:t,input:n,output:r,recurrence:e.recurrence+1,elapsed:Ip(t-e.start),elapsedSincePrevious:Ip(t-e.now),start:e.start}),Ck=class{schedule;ref;[Hre]=bk;constructor(e,t){this.schedule=e,this.ref=t}get state(){return C_(WS(this.ref),e=>e[1])}get last(){return V(WS(this.ref),([e,t])=>{switch(e._tag){case`None`:return c_(()=>new Hv);case`Some`:return H(e.value)}})}iterationMeta=HS(_k);get reset(){return GS(this.ref,[z(),this.schedule.initial]).pipe(W_(GS(this.iterationMeta,_k)))}next(e){return j(C_(WS(this.ref),e=>e[1]),V(t=>j(lC,V(n=>j(U(()=>this.schedule.step(n,e,t)),V(([t,r,i])=>{let a=GS(this.ref,[B(r),t]);if(jD(i))return a.pipe(G_(s_(z())));let o=TD(i.intervals)-n;if(o<=0)return a.pipe(G_(Sk(this.iterationMeta,n,e,r)),qg(r));let s=Ip(o);return j(a,G_(Sk(this.iterationMeta,n,e,r)),G_(GC(s)),qg(r))}))))))}};const wk=(e,t)=>new xk(e,t),Tk=A(2,(e,t)=>Ek(e,(e,n)=>W(()=>t(e,n)))),Ek=A(2,(e,t)=>wk(e.initial,(n,r,i)=>V(e.step(n,r,i),([e,n,i])=>jD(i)?H([e,n,kD]):C_(t(r,n),t=>t?[e,n,i]:[e,n,kD])))),Dk=e=>j(US([z(),e.initial]),C_(t=>new Ck(e,t))),Ok=A(2,(e,t)=>kk(e,t,dre)),kk=A(3,(e,t,n)=>wk([e.initial,t.initial],(r,i,a)=>j(K_(e.step(r,i,a[0]),t.step(r,i,a[1]),(e,t)=>[e,t]),V(([[r,a,o],[s,c,l]])=>AD(o)&&AD(l)?Ak(e,t,i,r,a,o.intervals,s,c,l.intervals,n):H([[r,s],[a,c],kD])))));var Ak=(e,t,n,r,i,a,o,s,c,l)=>{let u=l(a,c);return pre(u)?H([[r,o],[i,s],yre(u)]):j(a,fre(c))?V(e.step(ED(a),n,r),([r,i,a])=>jD(a)?H([[r,o],[i,s],kD]):Ak(e,t,n,r,i,a.intervals,o,s,c,l)):V(t.step(ED(c),n,o),([o,s,c])=>jD(c)?H([[r,o],[i,s],kD]):Ak(e,t,n,r,i,a,o,s,c.intervals,l))};const jk=A(2,(e,t)=>Mk(e,e=>W(()=>t(e)))),Mk=A(2,(e,t)=>wk(e.initial,(n,r,i)=>V(e.step(n,r,i),([e,n,r])=>C_(t(n),t=>[e,t,r])))),Nk=e=>wk(e.initial,(t,n,r)=>j(e.step(t,n,r),C_(([e,t,r])=>[e,n,r]))),Pk=e=>zk($k,t=>t<e);var Fk=(e,t,n,r,i)=>{if(!ql(n))return H(i);let a=Xl(n),o=eu(n);return V(e.step(t,a,r),([t,n,r])=>jD(r)?W(()=>j(i,zl(n))):Fk(e,TD(r.intervals),o,t,zl(i,n)))};const Ik=(e,t)=>wk(e,(e,n,r)=>W(()=>[t(r),r,bre(ire(e))])),Lk=A(2,(e,t)=>Ek(e,(e,n)=>LC(t(e)))),Rk=A(2,(e,t)=>Ek(e,(e,n)=>t(e))),zk=A(2,(e,t)=>Tk(e,(e,n)=>t(n))),Bk=(e,t,n)=>{let r=new Date(e),i=new Date(r.setDate(t));if(new Date(i.setMonth(i.getMonth()+n)).getDate()===t){let r=new Date(e),i=new Date(r.setDate(t));return i.setMonth(i.getMonth()+n)}return Bk(e,t,n+1)};var Vk=Symbol.for(`effect/Schedule/ScheduleDefect`),Hk=class{error;[Vk];constructor(e){this.error=e,this[Vk]=Vk}},Uk=e=>M(e,Vk),Wk=e=>e_(e,e=>r_(new Hk(e)));const Gk=e=>cc(pf(e,e=>Jd(e)&&Uk(e.defect)?B(e.defect):z()),{onNone:()=>e,onSome:e=>Bd(e.error)}),Kk=e=>$g(e,e=>l_(Gk(e))),qk=A(2,(e,t)=>Yk(e,t,(e,t)=>s_(e))),Jk=A(2,(e,t)=>{if(Vre(t))return qk(e,t);let n=t.schedule??Nk($k),r=t.while?Rk(n,e=>{let n=t.while(e);return typeof n==`boolean`?H(n):Wk(n)}):n,i=t.until?Lk(r,e=>{let n=t.until(e);return typeof n==`boolean`?H(n):Wk(n)}):r;return Kk(qk(e,t.times?Ok(i,Pk(t.times)).pipe(jk(e=>e[0])):i))}),Yk=A(3,(e,t,n)=>V(Dk(t),t=>g_(e,{onFailure:e=>n(e,z()),onSuccess:r=>Xk(HC(e,vk,WS(t.iterationMeta)),t,(e,r)=>HC(n(e,r),vk,WS(t.iterationMeta)),r)})));var Xk=(e,t,n,r)=>g_(t.next(r),{onFailure:()=>A_(t.last),onSuccess:r=>g_(e,{onFailure:e=>n(e,B(r)),onSuccess:r=>Xk(e,t,n,r)})}),Zk=(e,t,n)=>e_(e,r=>g_(t.next(r),{onFailure:()=>j(t.last,A_,V(e=>n(r,e))),onSuccess:()=>Zk(e,t,n)})),Qk=(e,t,n)=>g_(n.next(t),{onFailure:()=>A_(n.last),onSuccess:()=>V(e,t=>Qk(e,t,n))});const $k=Ik(0,e=>e+1);var eA=Symbol.for(`effect/MutableList`),tA={[eA]:eA,[Symbol.iterator](){let e=!1,t=this.head;return{next(){if(e)return this.return();if(t==null)return e=!0,this.return();let n=t.value;return t=t.next,{done:e,value:n}},return(t){return e||=!0,{done:!0,value:t}}}},toString(){return Vo(this.toJSON())},toJSON(){return{_id:`MutableList`,values:Array.from(this).map(Fo)}},[Po](){return this.toJSON()},pipe(){return L(this,arguments)}},nA=e=>({value:e,removed:!1,prev:void 0,next:void 0});const rA=()=>{let e=Object.create(tA);return e.head=void 0,e.tail=void 0,e._length=0,e},iA=e=>aA(e)===0,aA=e=>e._length,oA=A(2,(e,t)=>{let n=nA(t);return e.head===void 0&&(e.head=n),e.tail===void 0?e.tail=n:(e.tail.next=n,n.prev=e.tail,e.tail=n),e._length+=1,e}),sA=e=>{let t=e.head;if(t!==void 0)return cA(e,t),t.value};var cA=(e,t)=>{t.removed||(t.removed=!0,t.prev!==void 0&&t.next!==void 0?(t.prev.next=t.next,t.next.prev=t.prev):t.prev===void 0?t.next===void 0?(e.tail=void 0,e.head=void 0):(e.head=t.next,t.next.prev=void 0):(e.tail=t.prev,t.prev.next=void 0),e._length>0&&--e._length)},lA=Symbol.for(`effect/MutableQueue`);const uA=Symbol.for(`effect/mutable/MutableQueue/Empty`);var dA={[lA]:lA,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return Vo(this.toJSON())},toJSON(){return{_id:`MutableQueue`,values:Array.from(this).map(Fo)}},[Po](){return this.toJSON()},pipe(){return L(this,arguments)}},fA=e=>{let t=Object.create(dA);return t.queue=rA(),t.capacity=e,t};const pA=e=>fA(e),mA=()=>fA(void 0),hA=e=>aA(e.queue),gA=e=>iA(e.queue),_A=e=>e.capacity===void 0?1/0:e.capacity,vA=A(2,(e,t)=>{let n=aA(e.queue);return e.capacity!==void 0&&n===e.capacity?!1:(oA(t)(e.queue),!0)}),yA=A(2,(e,t)=>{let n=t[Symbol.iterator](),r,i=Dl(),a=!0;for(;a&&(r=n.next())&&!r.done;)a=vA(r.value)(e);for(;r!=null&&!r.done;)i=zl(r.value)(i),r=n.next();return Nl(i)}),bA=A(2,(e,t)=>iA(e.queue)?t:sA(e.queue)),xA=A(2,(e,t)=>{let n=Dl(),r=0;for(;r<t;){let t=bA(uA)(e);if(t===uA)break;n=zl(t)(n),r+=1}return Nl(n)}),SA=Bg,CA=Wg,wA=IC,TA=qE,EA=SC,DA=CC,OA=JC,kA=JE,AA=Qg,jA=Gg,MA=s_,NA=l_,PA=r_,FA=i_,IA=z_,LA=q_,RA=BC,zA=H,BA=U,VA=W;var HA=P_;const UA=e_,WA=$g,GA=AC;var KA=yC;const qA=ZC,JA=XC,YA=y_,XA=x_,ZA=O_,QA=M_,$A=N_,ej=qg,tj=Jg,nj=C_,rj=w_,ij=T_,aj=Ane,oj=Kg,sj=_D,cj=E_,lj=D_,uj=lD,dj=aD,fj=Rne,pj=f_,mj=QE,hj=BD,gj=VD,_j=HD,vj=Oy,yj=wC,bj=My,xj=ak,Sj=ew,Cj=a_,wj=o_,Ure=S_,Wre=$C,G=V,Tj=p_,Ej=qne,Dj=mD,Gre=j_,Oj=YC,kj=Jk,Aj=L_,jj=uv,Kre=DC,Mj=m_,Nj=h_,qre=g_,Jre=MC,Pj=A_,Fj=bO,Yre=RD,Xre=Cre,Zre=wre,Qre=SO,$re=CO,Ij=wO,Lj=zne,eie=Bne,Rj=Vne,zj=sD,tie=Yne,Bj=aw,Vj=ow,Hj=B_,Uj=fv,Wj=vv,nie=yv,rie=aC,iie=Ev,aie=UO,oie=XO,Gj=ZO,sie=QO,cie=nk,lie=Symbol.for(`effect/QueueEnqueue`),Kj=Symbol.for(`effect/QueueDequeue`),qj=Symbol.for(`effect/QueueStrategy`),uie=Symbol.for(`effect/BackingQueue`);var Jj={_A:e=>e},die={_A:e=>e};const fie={_In:e=>e},Yj={_Out:e=>e};var pie=class extends Bb{queue;takers;shutdownHook;shutdownFlag;strategy;[lie]=fie;[Kj]=Yj;constructor(e,t,n,r,i){super(),this.queue=e,this.takers=t,this.shutdownHook=n,this.shutdownFlag=r,this.strategy=i}pipe(){return L(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return U(()=>e_(this.unsafeSize(),()=>y_))}unsafeSize(){return tm(this.shutdownFlag)?z():B(this.queue.length()-hA(this.takers)+this.strategy.surplusSize())}get isEmpty(){return C_(this.size,e=>e<=0)}get isFull(){return C_(this.size,e=>e>=this.capacity())}get shutdown(){return M_(Gg(e=>(j(this.shutdownFlag,nm(!0)),j(XE(nM(this.takers),t=>Sy(t,e.id()),!1,!1),G_(this.strategy.shutdown),I_(wy(this.shutdownHook,void 0)),Jg))))}get isShutdown(){return W(()=>tm(this.shutdownFlag))}get awaitShutdown(){return vy(this.shutdownHook)}isActive(){return!tm(this.shutdownFlag)}unsafeOffer(e){if(tm(this.shutdownFlag))return!1;let t;if(this.queue.length()===0){let n=j(this.takers,bA(uA));n===uA?t=!1:(eM(n,e),t=!0)}else t=!1;if(t)return!0;let n=this.queue.offer(e);return rM(this.strategy,this.queue,this.takers),n}offer(e){return U(()=>{if(tm(this.shutdownFlag))return y_;let t;if(this.queue.length()===0){let n=j(this.takers,bA(uA));n===uA?t=!1:(eM(n,e),t=!0)}else t=!1;if(t)return H(!0);let n=this.queue.offer(e);return rM(this.strategy,this.queue,this.takers),n?H(!0):this.strategy.handleSurplus([e],this.queue,this.takers,this.shutdownFlag)})}offerAll(e){return U(()=>{if(tm(this.shutdownFlag))return y_;let t=Dc(e),n=this.queue.length()===0?Dc(Die(this.takers,t.length)):al,[r,i]=j(t,el(n.length));for(let e=0;e<n.length;e++){let t=n[e],i=r[e];eM(t,i)}if(i.length===0)return H(!0);let a=this.queue.offerAll(i);return rM(this.strategy,this.queue,this.takers),Kl(a)?H(!0):this.strategy.handleSurplus(a,this.queue,this.takers,this.shutdownFlag)})}get take(){return Gg(e=>{if(tm(this.shutdownFlag))return y_;let t=this.queue.poll(uA);if(t!==uA)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),H(t);{let t=hy(e.id());return j(U(()=>(j(this.takers,vA(t)),rM(this.strategy,this.queue,this.takers),tm(this.shutdownFlag)?y_:vy(t))),O_(()=>W(()=>Oie(this.takers,t))))}})}get takeAll(){return U(()=>tm(this.shutdownFlag)?y_:W(()=>{let e=this.queue.pollUpTo(1/0);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Al(e)}))}takeUpTo(e){return U(()=>tm(this.shutdownFlag)?y_:W(()=>{let t=this.queue.pollUpTo(e);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Al(t)}))}takeBetween(e,t){return U(()=>Xj(this,e,t,Dl()))}},Xj=(e,t,n,r)=>n<t?H(r):j(Sie(e,n),V(i=>{let a=t-i.length;return a===1?j($j(e),C_(e=>j(r,Ul(i),Rl(e)))):a>1?j($j(e),V(t=>Xj(e,a-1,n-i.length-1,j(r,Ul(i),Rl(t))))):H(j(r,Ul(i)))}));const mie=e=>j(W(()=>pA(e)),V(e=>Zj(Qj(e),Cie()))),hie=()=>j(W(()=>mA()),V(e=>Zj(Qj(e),wie())));var gie=(e,t,n,r,i)=>new pie(e,t,n,r,i);const Zj=(e,t)=>j(gy(),C_(n=>gie(e,mA(),n,em(!1),t)));var _ie=class{mutable;[uie]=die;constructor(e){this.mutable=e}poll(e){return bA(this.mutable,e)}pollUpTo(e){return xA(this.mutable,e)}offerAll(e){return yA(this.mutable,e)}offer(e){return vA(this.mutable,e)}capacity(){return _A(this.mutable)}length(){return hA(this.mutable)}};const Qj=e=>new _ie(e),vie=e=>e.size,yie=e=>e.shutdown,bie=A(2,(e,t)=>e.offer(t)),xie=A(2,(e,t)=>e.offerAll(t)),$j=e=>e.take,Sie=A(2,(e,t)=>e.takeUpTo(t)),Cie=()=>new Tie,wie=()=>new Eie;var Tie=class{[qj]=Jj;putters=mA();surplusSize(){return hA(this.putters)}onCompleteTakersWithEmptyQueue(e){for(;!gA(this.putters)&&!gA(e);){let t=bA(e,void 0),n=bA(this.putters,void 0);n[2]&&eM(n[1],!0),eM(t,n[0])}}get shutdown(){return j(d_,V(e=>j(W(()=>nM(this.putters)),V(t=>XE(t,([t,n,r])=>r?j(Sy(n,e),Jg):P_,!1,!1)))))}handleSurplus(e,t,n,r){return Gg(i=>{let a=hy(i.id());return j(U(()=>(this.unsafeOffer(e,a),this.unsafeOnQueueEmptySpace(t,n),rM(this,t,n),tm(r)?y_:vy(a))),O_(()=>W(()=>this.unsafeRemove(a))))})}unsafeOnQueueEmptySpace(e,t){let n=!0;for(;n&&(e.capacity()===1/0||e.length()<e.capacity());){let r=j(this.putters,bA(uA));if(r===uA)n=!1;else{let n=e.offer(r[0]);n&&r[2]?eM(r[1],!0):n||tM(this.putters,j(nM(this.putters),zl(r))),rM(this,e,t)}}}unsafeOffer(e,t){let n=Dc(e);for(let e=0;e<n.length;e++){let r=n[e];e===n.length-1?j(this.putters,vA([r,t,!0])):j(this.putters,vA([r,t,!1]))}}unsafeRemove(e){tM(this.putters,j(nM(this.putters),Wl(([,t])=>t!==e)))}},Eie=class{[qj]=Jj;surplusSize(){return 0}get shutdown(){return P_}onCompleteTakersWithEmptyQueue(){}handleSurplus(e,t,n,r){return H(!1)}unsafeOnQueueEmptySpace(e,t){}},eM=(e,t)=>Ty(e,H(t)),tM=(e,t)=>j(e,yA(t)),nM=e=>j(e,xA(1/0)),Die=(e,t)=>j(e,xA(t));const Oie=(e,t)=>{tM(e,j(nM(e),Wl(e=>t!==e)))},rM=(e,t,n)=>{let r=!0;for(;r&&t.length()!==0;){let i=j(n,bA(uA));if(i!==uA){let a=t.poll(uA);a===uA?tM(n,j(nM(n),zl(i))):(eM(i,a),e.unsafeOnQueueEmptySpace(t,n)),r=!0}else r=!1}r&&t.length()===0&&!gA(n)&&e.onCompleteTakersWithEmptyQueue(n)};var kie=(e,t)=>n=>{n.has(e)||n.set(e,new Set),n.get(e).add(t)},Aie=class extends Bb{pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;[Kj]=Yj;constructor(e,t,n,r,i,a,o,s){super(),this.pubsub=e,this.subscribers=t,this.subscription=n,this.pollers=r,this.shutdownHook=i,this.shutdownFlag=a,this.strategy=o,this.replayWindow=s}commit(){return this.take}pipe(){return L(this,arguments)}capacity(){return this.pubsub.capacity}isActive(){return!tm(this.shutdownFlag)}get size(){return U(()=>tm(this.shutdownFlag)?y_:H(this.subscription.size()+this.replayWindow.remaining))}unsafeSize(){return tm(this.shutdownFlag)?z():B(this.subscription.size()+this.replayWindow.remaining)}get isFull(){return U(()=>tm(this.shutdownFlag)?y_:H(this.subscription.size()===this.capacity()))}get isEmpty(){return C_(this.size,e=>e===0)}get shutdown(){return M_(Gg(e=>(nm(this.shutdownFlag,!0),j(YE(aM(this.pollers),t=>Sy(t,e.id()),!1),G_(W(()=>{this.subscribers.delete(this.subscription),this.subscription.unsubscribe(),this.strategy.unsafeOnPubSubEmptySpace(this.pubsub,this.subscribers)})),I_(wy(this.shutdownHook,void 0)),Jg))))}get isShutdown(){return W(()=>tm(this.shutdownFlag))}get awaitShutdown(){return vy(this.shutdownHook)}get take(){return Gg(e=>{if(tm(this.shutdownFlag))return y_;if(this.replayWindow.remaining>0)return H(this.replayWindow.take());let t=gA(this.pollers)?this.subscription.poll(uA):uA;if(t===uA){let t=hy(e.id());return j(U(()=>(j(this.pollers,vA(t)),j(this.subscribers,kie(this.subscription,this.pollers)),this.strategy.unsafeCompletePollers(this.pubsub,this.subscribers,this.subscription,this.pollers),tm(this.shutdownFlag)?y_:vy(t))),O_(()=>W(()=>Pie(this.pollers,t))))}else return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub,this.subscribers),H(t)})}get takeAll(){return U(()=>{if(tm(this.shutdownFlag))return y_;let e=gA(this.pollers)?Mie(this.subscription):Dl();return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub,this.subscribers),this.replayWindow.remaining>0?H(Ul(this.replayWindow.takeAll(),e)):H(e)})}takeUpTo(e){return U(()=>{if(tm(this.shutdownFlag))return y_;let t;if(this.replayWindow.remaining>=e)return H(this.replayWindow.takeN(e));this.replayWindow.remaining>0&&(t=this.replayWindow.takeAll(),e-=t.length);let n=gA(this.pollers)?Nie(this.subscription,e):Dl();return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub,this.subscribers),H(t?Ul(t,n):n)})}takeBetween(e,t){return U(()=>iM(this,e,t,Dl()))}},iM=(e,t,n,r)=>n<t?H(r):j(e.takeUpTo(n),V(i=>{let a=t-i.length;return a===1?j(e.take,C_(e=>j(r,Ul(i),Rl(e)))):a>1?j(e.take,V(t=>iM(e,a-1,n-i.length-1,j(r,Ul(i),Rl(t))))):H(j(r,Ul(i)))})),jie=(e,t)=>j(e,yA(t)),aM=e=>j(e,xA(1/0)),Mie=e=>e.pollUpTo(1/0),Nie=(e,t)=>e.pollUpTo(t),Pie=(e,t)=>{jie(e,j(aM(e),Wl(e=>e!==t)))};const Fie=mie,Iie=hie,Lie=vie,oM=yie,sM=bie,Rie=xie,cM=$j,lM=`Continue`,uM=Symbol.for(`effect/ChannelChildExecutorDecision`);var zie={[uM]:uM};const dM=e=>{let t=Object.create(zie);return t._tag=lM,t},fM=Symbol.for(`effect/ChannelContinuation`);var pM={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutDone:e=>e,_OutErr2:e=>e,_OutElem:e=>e,_OutDone2:e=>e},mM=class{onSuccess;onHalt;_tag=`ContinuationK`;[fM]=pM;constructor(e,t){this.onSuccess=e,this.onHalt=t}onExit(e){return cw(e)?this.onHalt(e.cause):this.onSuccess(e.value)}},hM=class{finalizer;_tag=`ContinuationFinalizer`;[fM]=pM;constructor(e){this.finalizer=e}};const gM=`PullAfterNext`,_M=Symbol.for(`effect/ChannelUpstreamPullStrategy`);var vM={_A:e=>e},yM={[_M]:vM};const bM=e=>{let t=Object.create(yM);return t._tag=gM,t.emitSeparator=e,t},xM=`BracketOut`,SM=`Bridge`,CM=`ConcatAll`,wM=`Emit`,TM=`Ensuring`,EM=`Fail`,DM=`Fold`,OM=`FromEffect`,kM=`PipeTo`,AM=`Provide`,jM=`Read`,MM=`Succeed`,NM=`SucceedNow`,PM=`Suspend`,FM=Symbol.for(`effect/Channel`);var IM={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},LM={[FM]:IM,pipe(){return L(this,arguments)}};const RM=e=>M(e,FM)||CA(e),zM=A(2,(e,t)=>{let n=Object.create(LM);return n._tag=xM,n.acquire=()=>e,n.finalizer=t,n}),BM=A(2,(e,t)=>{let n=Object.create(LM);return n._tag=DM,n.channel=e,n.k=new mM(nN,t),n});var VM=e=>eN({onInput:t=>YM(aN(()=>{e.push(t)}),()=>VM(e)),onFailure:KM,onDone:rN});const HM=(e,t,n)=>{let r=Object.create(LM);return r._tag=CM,r.combineInners=t,r.combineAll=n,r.onPull=()=>bM(z()),r.onEmit=()=>dM,r.value=()=>e,r.k=Ea,r},UM=A(4,(e,t,n,r)=>{let i=Object.create(LM);return i._tag=CM,i.combineInners=n,i.combineAll=r,i.onPull=()=>bM(z()),i.onEmit=()=>dM,i.value=()=>e,i.k=t,i}),WM=A(2,(e,t)=>{let n=Object.create(LM);return n._tag=SM,n.input=t,n.channel=e,n}),GM=A(2,(e,t)=>{let n=Object.create(LM);return n._tag=TM,n.channel=e,n.finalizer=t,n}),KM=e=>qM(Ly(e)),qM=e=>JM(()=>e),JM=e=>{let t=Object.create(LM);return t._tag=EM,t.error=e,t},YM=A(2,(e,t)=>{let n=Object.create(LM);return n._tag=DM,n.channel=e,n.k=new mM(t,qM),n}),XM=A(2,(e,t)=>{let n=Object.create(LM);return n._tag=DM,n.channel=e,n.k=new mM(t.onSuccess,t.onFailure),n}),ZM=e=>{let t=Object.create(LM);return t._tag=OM,t.effect=()=>e,t},QM=A(2,(e,t)=>{let n=Object.create(LM);return n._tag=kM,n.left=()=>e,n.right=()=>t,n}),$M=A(2,(e,t)=>{let n=Object.create(LM);return n._tag=AM,n.context=()=>t,n.inner=e,n}),eN=e=>tN({onInput:e.onInput,onFailure:t=>Zs(qy(t),{onLeft:e.onFailure,onRight:qM}),onDone:e.onDone}),tN=e=>{let t=Object.create(LM);return t._tag=jM,t.more=e.onInput,t.done=new mM(e.onDone,e.onFailure),t},nN=e=>aN(()=>e),rN=e=>{let t=Object.create(LM);return t._tag=NM,t.terminal=e,t},iN=e=>{let t=Object.create(LM);return t._tag=PM,t.channel=e,t},aN=e=>{let t=Object.create(LM);return t._tag=MM,t.evaluate=e,t};var oN=rN(void 0);const sN=e=>{let t=Object.create(LM);return t._tag=wM,t.out=e,t},cN=`Done`,lN=`Emit`,uN=`FromEffect`,dN=`Read`,fN=Symbol.for(`effect/ChannelState`);var pN={_E:e=>e,_R:e=>e},mN={[fN]:pN};const hN=()=>{let e=Object.create(mN);return e._tag=cN,e},gN=()=>{let e=Object.create(mN);return e._tag=lN,e},_N=e=>{let t=Object.create(mN);return t._tag=uN,t.effect=e,t},vN=(e,t,n,r)=>{let i=Object.create(mN);return i._tag=dN,i.upstream=e,i.onEffect=t,i.onEmit=n,i.onDone=r,i},yN=e=>e._tag===uN,bN=e=>yN(e)?e.effect:HA,xN=e=>yN(e)?GA(e.effect):void 0,SN=`PullFromChild`,CN=`PullFromUpstream`,wN=`DrainChildExecutors`,TN=`Emit`;var EN=class{childExecutor;parentSubexecutor;onEmit;_tag=SN;constructor(e,t,n){this.childExecutor=e,this.parentSubexecutor=t,this.onEmit=n}close(e){let t=this.childExecutor.close(e),n=this.parentSubexecutor.close(e);if(t!==void 0&&n!==void 0)return zj(wj(t),wj(n),(e,t)=>j(e,Sw(t)));if(t!==void 0)return t;if(n!==void 0)return n}enqueuePullFromChild(e){return this}},DN=class e{upstreamExecutor;createChild;lastDone;activeChildExecutors;combineChildResults;combineWithChildResult;onPull;onEmit;_tag=CN;constructor(e,t,n,r,i,a,o,s){this.upstreamExecutor=e,this.createChild=t,this.lastDone=n,this.activeChildExecutors=r,this.combineChildResults=i,this.combineWithChildResult=a,this.onPull=o,this.onEmit=s}close(e){let t=this.upstreamExecutor.close(e);return[...this.activeChildExecutors.map(t=>t===void 0?void 0:t.childExecutor.close(e)),t].reduce((e,t)=>{if(e!==void 0&&t!==void 0)return zj(e,wj(t),(e,t)=>Sw(e,t));if(e!==void 0)return e;if(t!==void 0)return wj(t)},void 0)}enqueuePullFromChild(t){return new e(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}},ON=class e{upstreamExecutor;lastDone;activeChildExecutors;upstreamDone;combineChildResults;combineWithChildResult;onPull;_tag=wN;constructor(e,t,n,r,i,a,o){this.upstreamExecutor=e,this.lastDone=t,this.activeChildExecutors=n,this.upstreamDone=r,this.combineChildResults=i,this.combineWithChildResult=a,this.onPull=o}close(e){let t=this.upstreamExecutor.close(e);return[...this.activeChildExecutors.map(t=>t===void 0?void 0:t.childExecutor.close(e)),t].reduce((e,t)=>{if(e!==void 0&&t!==void 0)return zj(e,wj(t),(e,t)=>Sw(e,t));if(e!==void 0)return e;if(t!==void 0)return wj(t)},void 0)}enqueuePullFromChild(t){return new e(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}},kN=class{value;next;_tag=TN;constructor(e,t){this.value=e,this.next=t}close(e){return this.next.close(e)}enqueuePullFromChild(e){return this}};const AN=Symbol.for(`effect/ChannelUpstreamPullRequest`);var jN={_A:e=>e},MN={[AN]:jN};const NN=e=>{let t=Object.create(MN);return t._tag=`Pulled`,t.value=e,t},PN=e=>{let t=Object.create(MN);return t._tag=`NoUpstream`,t.activeDownstreamCount=e,t};var FN=class e{_activeSubexecutor=void 0;_cancelled=void 0;_closeLastSubstream=void 0;_currentChannel;_done=void 0;_doneStack=[];_emitted=void 0;_executeCloseLastSubstream;_input=void 0;_inProgressFinalizer=void 0;_providedEnv;constructor(e,t,n){this._currentChannel=e,this._executeCloseLastSubstream=n,this._providedEnv=t}run(){let t;for(;t===void 0;)if(this._cancelled!==void 0)t=this.processCancellation();else if(this._activeSubexecutor!==void 0)t=this.runSubexecutor();else try{if(this._currentChannel===void 0)t=hN();else switch(CA(this._currentChannel)&&(this._currentChannel=ZM(this._currentChannel)),this._currentChannel._tag){case xM:t=this.runBracketOut(this._currentChannel);break;case SM:{let e=this._currentChannel.input;if(this._currentChannel=this._currentChannel.channel,this._input!==void 0){let n=this._input;this._input=void 0;let r=()=>G(e.awaitRead(),()=>BA(()=>{let t=n.run();switch(t._tag){case cN:return vw(n.getDone(),{onFailure:t=>e.error(t),onSuccess:t=>e.done(t)});case lN:return G(e.emit(n.getEmit()),()=>r());case uN:return Nj(t.effect,{onFailure:t=>e.error(t),onSuccess:()=>r()});case dN:return RN(t,()=>r(),t=>e.error(t))}}));t=_N(G(mj(XA(r())),e=>VA(()=>this.addFinalizer(t=>G(tO(e),()=>BA(()=>{let e=this.restorePipe(t,n);return e===void 0?HA:e}))))))}break}case CM:{let t=new e(this._currentChannel.value(),this._providedEnv,e=>VA(()=>{this._closeLastSubstream=j(this._closeLastSubstream===void 0?HA:this._closeLastSubstream,Rj(e))}));t._input=this._input;let n=this._currentChannel;this._activeSubexecutor=new DN(t,e=>n.k(e),void 0,[],(e,t)=>n.combineInners(e,t),(e,t)=>n.combineAll(e,t),e=>n.onPull(e),e=>n.onEmit(e)),this._closeLastSubstream=void 0,this._currentChannel=void 0;break}case wM:this._emitted=this._currentChannel.out,this._currentChannel=this._activeSubexecutor===void 0?oN:void 0,t=gN();break;case TM:this.runEnsuring(this._currentChannel);break;case EM:t=this.doneHalt(this._currentChannel.error());break;case DM:this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break;case OM:t=_N(Nj(this._providedEnv===void 0?this._currentChannel.effect():j(this._currentChannel.effect(),xj(this._providedEnv)),{onFailure:e=>{let t=this.doneHalt(e);return t!==void 0&&yN(t)?t.effect:HA},onSuccess:e=>{let t=this.doneSucceed(e);return t!==void 0&&yN(t)?t.effect:HA}}));break;case kM:{let t=this._input,n=new e(this._currentChannel.left(),this._providedEnv,e=>this._executeCloseLastSubstream(e));n._input=t,this._input=n,this.addFinalizer(e=>{let n=this.restorePipe(e,t);return n===void 0?HA:n}),this._currentChannel=this._currentChannel.right();break}case AM:{let e=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer(()=>VA(()=>{this._providedEnv=e}));break}case jM:{let e=this._currentChannel;t=vN(this._input,Ea,t=>{try{this._currentChannel=e.more(t)}catch(t){this._currentChannel=e.done.onExit(fw(t))}},t=>{this._currentChannel=(t=>e.done.onExit(t))(t)});break}case MM:t=this.doneSucceed(this._currentChannel.evaluate());break;case NM:t=this.doneSucceed(this._currentChannel.terminal);break;case PM:this._currentChannel=this._currentChannel.channel();break}}catch(e){this._currentChannel=qM(Ry(e))}return t}getDone(){return this._done}getEmit(){return this._emitted}cancelWith(e){this._cancelled=e}clearInProgressFinalizer(){this._inProgressFinalizer=void 0}storeInProgressFinalizer(e){this._inProgressFinalizer=e}popAllFinalizers(e){let t=[],n=this._doneStack.pop();for(;n;)n._tag===`ContinuationFinalizer`&&t.push(n.finalizer),n=this._doneStack.pop();let r=t.length===0?HA:LN(t,e);return this.storeInProgressFinalizer(r),r}popNextFinalizers(){let e=[];for(;this._doneStack.length!==0;){let t=this._doneStack[this._doneStack.length-1];if(t._tag===`ContinuationK`)return e;e.push(t),this._doneStack.pop()}return e}restorePipe(e,t){let n=this._input;return this._input=t,n===void 0?HA:n.close(e)}close(e){let t,n=this._inProgressFinalizer;n!==void 0&&(t=j(n,sj(VA(()=>this.clearInProgressFinalizer()))));let r,i=this.popAllFinalizers(e);i!==void 0&&(r=j(i,sj(VA(()=>this.clearInProgressFinalizer()))));let a=this._activeSubexecutor===void 0?void 0:this._activeSubexecutor.close(e);if(!(a===void 0&&t===void 0&&r===void 0))return j(wj(IN(a)),Lj(wj(IN(t))),Lj(wj(IN(r))),nj(([[e,t],n])=>j(e,Sw(t),Sw(n))),QA,G(e=>BA(()=>e)))}doneSucceed(e){if(this._doneStack.length===0)return this._done=yw(e),this._currentChannel=void 0,hN();let t=this._doneStack[this._doneStack.length-1];if(t._tag===`ContinuationK`){this._doneStack.pop(),this._currentChannel=t.onSuccess(e);return}let n=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=n.reverse(),this._done=yw(e),this._currentChannel=void 0,hN();let r=LN(n.map(e=>e.finalizer),yw(e));return this.storeInProgressFinalizer(r),_N(j(r,sj(VA(()=>this.clearInProgressFinalizer())),QA,G(()=>VA(()=>this.doneSucceed(e)))))}doneHalt(e){if(this._doneStack.length===0)return this._done=mw(e),this._currentChannel=void 0,hN();let t=this._doneStack[this._doneStack.length-1];if(t._tag===`ContinuationK`){this._doneStack.pop();try{this._currentChannel=t.onHalt(e)}catch(e){this._currentChannel=qM(Ry(e))}return}let n=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=n.reverse(),this._done=mw(e),this._currentChannel=void 0,hN();let r=LN(n.map(e=>e.finalizer),mw(e));return this.storeInProgressFinalizer(r),_N(j(r,sj(VA(()=>this.clearInProgressFinalizer())),QA,G(()=>VA(()=>this.doneHalt(e)))))}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,hN()}runBracketOut(e){return _N(QA(Nj(this.provide(e.acquire()),{onFailure:e=>VA(()=>{this._currentChannel=qM(e)}),onSuccess:t=>VA(()=>{this.addFinalizer(n=>this.provide(e.finalizer(t,n))),this._currentChannel=sN(t)})})))}provide(e){return this._providedEnv===void 0?e:j(e,xj(this._providedEnv))}runEnsuring(e){this.addFinalizer(e.finalizer),this._currentChannel=e.channel}addFinalizer(e){this._doneStack.push(new hM(e))}runSubexecutor(){let e=this._activeSubexecutor;switch(e._tag){case SN:return this.pullFromChild(e.childExecutor,e.parentSubexecutor,e.onEmit,e);case CN:return this.pullFromUpstream(e);case wN:return this.drainChildExecutors(e);case TN:return this._emitted=e.value,this._activeSubexecutor=e.next,gN()}}replaceSubexecutor(e){this._currentChannel=void 0,this._activeSubexecutor=e}finishWithExit(e){let t=vw(e,{onFailure:e=>this.doneHalt(e),onSuccess:e=>this.doneSucceed(e)});return this._activeSubexecutor=void 0,t===void 0?HA:bN(t)}finishSubexecutorWithCloseEffect(e,...t){this.addFinalizer(()=>j(t,kA(t=>j(VA(()=>t(e)),G(e=>e===void 0?HA:e)),{discard:!0})));let n=j(e,vw({onFailure:e=>this.doneHalt(e),onSuccess:e=>this.doneSucceed(e)}));return this._activeSubexecutor=void 0,n}applyUpstreamPullStrategy(e,t,n){switch(n._tag){case gM:{let r=!e||t.some(e=>e!==void 0);return[n.emitSeparator,r?[void 0,...t]:t]}case`PullAfterAllEnqueued`:{let r=!e||t.some(e=>e!==void 0);return[n.emitSeparator,r?[...t,void 0]:t]}}}pullFromChild(e,t,n,r){return vN(e,Ea,i=>{let a=n(i);switch(a._tag){case lM:break;case`Close`:this.finishWithDoneValue(e,t,a.value);break;case`Yield`:{let e=t.enqueuePullFromChild(r);this.replaceSubexecutor(e);break}}this._activeSubexecutor=new kN(i,this._activeSubexecutor)},vw({onFailure:n=>{let r=this.handleSubexecutorFailure(e,t,n);return r===void 0?void 0:xN(r)},onSuccess:n=>{this.finishWithDoneValue(e,t,n)}}))}finishWithDoneValue(e,t,n){let r=t;switch(r._tag){case CN:{let t=new DN(r.upstreamExecutor,r.createChild,r.lastDone===void 0?n:r.combineChildResults(r.lastDone,n),r.activeChildExecutors,r.combineChildResults,r.combineWithChildResult,r.onPull,r.onEmit);this._closeLastSubstream=e.close(yw(n)),this.replaceSubexecutor(t);break}case wN:{let t=new ON(r.upstreamExecutor,r.lastDone===void 0?n:r.combineChildResults(r.lastDone,n),r.activeChildExecutors,r.upstreamDone,r.combineChildResults,r.combineWithChildResult,r.onPull);this._closeLastSubstream=e.close(yw(n)),this.replaceSubexecutor(t);break}default:break}}handleSubexecutorFailure(e,t,n){return this.finishSubexecutorWithCloseEffect(mw(n),e=>t.close(e),t=>e.close(t))}pullFromUpstream(e){if(e.activeChildExecutors.length===0)return this.performPullFromUpstream(e);let t=e.activeChildExecutors[0],n=new DN(e.upstreamExecutor,e.createChild,e.lastDone,e.activeChildExecutors.slice(1),e.combineChildResults,e.combineWithChildResult,e.onPull,e.onEmit);if(t===void 0)return this.performPullFromUpstream(n);this.replaceSubexecutor(new EN(t.childExecutor,n,t.onEmit))}performPullFromUpstream(t){return vN(t.upstreamExecutor,e=>{let t=this._closeLastSubstream===void 0?HA:this._closeLastSubstream;return this._closeLastSubstream=void 0,j(this._executeCloseLastSubstream(t),Rj(e))},n=>{if(this._closeLastSubstream!==void 0){let r=this._closeLastSubstream;return this._closeLastSubstream=void 0,j(this._executeCloseLastSubstream(r),nj(()=>{let r=new e(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);r._input=this._input;let[i,a]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(NN(n)));this._activeSubexecutor=new EN(r,new DN(t.upstreamExecutor,t.createChild,t.lastDone,a,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),sc(i)&&(this._activeSubexecutor=new kN(i.value,this._activeSubexecutor))}))}let r=new e(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);r._input=this._input;let[i,a]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(NN(n)));this._activeSubexecutor=new EN(r,new DN(t.upstreamExecutor,t.createChild,t.lastDone,a,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),sc(i)&&(this._activeSubexecutor=new kN(i.value,this._activeSubexecutor))},e=>{if(t.activeChildExecutors.some(e=>e!==void 0)){let e=new ON(t.upstreamExecutor,t.lastDone,[void 0,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(this._closeLastSubstream!==void 0){let t=this._closeLastSubstream;return this._closeLastSubstream=void 0,j(this._executeCloseLastSubstream(t),nj(()=>this.replaceSubexecutor(e)))}this.replaceSubexecutor(e);return}let n=this._closeLastSubstream,r=this.finishSubexecutorWithCloseEffect(j(e,_w(e=>t.combineWithChildResult(t.lastDone,e))),()=>n,e=>t.upstreamExecutor.close(e));return r===void 0?void 0:xN(r)})}drainChildExecutors(e){if(e.activeChildExecutors.length===0){let t=this._closeLastSubstream;return t!==void 0&&this.addFinalizer(()=>zA(t)),this.finishSubexecutorWithCloseEffect(e.upstreamDone,()=>t,t=>e.upstreamExecutor.close(t))}let t=e.activeChildExecutors[0],n=e.activeChildExecutors.slice(1);if(t===void 0){let[t,r]=this.applyUpstreamPullStrategy(!0,n,e.onPull(PN(n.reduce((e,t)=>t===void 0?e:e+1,0))));return this.replaceSubexecutor(new ON(e.upstreamExecutor,e.lastDone,r,e.upstreamDone,e.combineChildResults,e.combineWithChildResult,e.onPull)),sc(t)?(this._emitted=t.value,gN()):void 0}let r=new ON(e.upstreamExecutor,e.lastDone,n,e.upstreamDone,e.combineChildResults,e.combineWithChildResult,e.onPull);this.replaceSubexecutor(new EN(t.childExecutor,r,t.onEmit))}},IN=e=>e===void 0?HA:e,LN=(e,t)=>j(kA(e,e=>wj(e(t))),nj(e=>j(dw(e),lc(()=>bw))),G(e=>BA(()=>e)));const RN=(e,t,n)=>{let r=[e],i=()=>{let e=r.pop();if(e===void 0||e.upstream===void 0)return FA(`Unexpected end of input for channel execution`);let a=e.upstream.run();switch(a._tag){case lN:{let a=e.onEmit(e.upstream.getEmit());return r.length===0?a===void 0?BA(t):j(a,Nj({onFailure:n,onSuccess:t})):a===void 0?BA(()=>i()):j(a,Nj({onFailure:n,onSuccess:()=>i()}))}case cN:{let a=e.onDone(e.upstream.getDone());return r.length===0?a===void 0?BA(t):j(a,Nj({onFailure:n,onSuccess:t})):a===void 0?BA(()=>i()):j(a,Nj({onFailure:n,onSuccess:()=>i()}))}case uN:return r.push(e),j(e.onEffect(a.effect),WA(t=>BA(()=>{let n=e.onDone(mw(t));return n===void 0?HA:n})),Nj({onFailure:n,onSuccess:()=>i()}));case dN:return r.push(e),r.push(a),BA(()=>i())}};return i()},zN=A(2,(e,t)=>{let n=(t,n,r)=>oj(VA(()=>new FN(e,void 0,Ea)),e=>BA(()=>BN(e.run(),e).pipe(Ure(t),Rj(eb(t)),eie(eb(n)))),(e,t)=>{let n=e.close(t);return n===void 0?HA:Oj(n,e=>ND(r,NA(e)))});return $A(e=>TA([LD(t,Gb),$y(),$y()]).pipe(G(([r,i,a])=>e(n(i,a,r)).pipe(hj(t),G(n=>t.addFinalizer(e=>{let t=cw(e)?Ky(e.cause):void 0;return nb(i).pipe(G(e=>e?rb(a,void 0).pipe(Rj(QD(n)),Rj(eO(n))):rb(a,void 0).pipe(Rj(t&&wd(t)>0?nO(n,Cm(t)):tO(n)),Rj(eO(n)))))}).pipe(Rj(e(eb(i)))))))))});var BN=(e,t)=>{let n=e;switch(n._tag){case uN:return j(n.effect,G(()=>BN(t.run(),t)));case lN:return BN(t.run(),t);case cN:return BA(()=>t.getDone());case dN:return RN(n,()=>BN(t.run(),t),NA)}},VN={[Symbol.for(`effect/ChannelMergeDecision`)]:{_R:e=>e,_E0:e=>e,_Z0:e=>e,_E:e=>e,_Z:e=>e}};const HN=e=>{let t=Object.create(VN);return t._tag=`Done`,t.effect=e,t},UN=e=>{let t=Object.create(VN);return t._tag=`Await`,t.f=e,t},WN=`BothRunning`,GN=`LeftDone`,KN=`RightDone`,qN=Symbol.for(`effect/ChannelMergeState`);var JN={[qN]:qN};const YN=(e,t)=>{let n=Object.create(JN);return n._tag=WN,n.left=e,n.right=t,n},XN=e=>{let t=Object.create(JN);return t._tag=GN,t.f=e,t},ZN=e=>{let t=Object.create(JN);return t._tag=KN,t.f=e,t},QN=`BackPressure`,$N=`BufferSliding`,eP=Symbol.for(`effect/ChannelMergeStrategy`);var tP={[eP]:eP};const nP=e=>{let t=Object.create(tP);return t._tag=QN,t},rP=e=>{let t=Object.create(tP);return t._tag=$N,t},iP=A(2,(e,{onBackPressure:t,onBufferSliding:n})=>{switch(e._tag){case QN:return t();case $N:return n()}});var aP=`Empty`,oP=`Emit`,sP=`Error`,cP=`Done`,lP=e=>({_tag:aP,notifyProducer:e}),uP=e=>({_tag:oP,notifyConsumers:e}),dP=e=>({_tag:sP,cause:e}),fP=e=>({_tag:cP,done:e}),pP=class{ref;constructor(e){this.ref=e}awaitRead(){return Tj(QS(this.ref,e=>e._tag===aP?[eb(e.notifyProducer),e]:[HA,e]))}get close(){return pj(e=>this.error(zy(e)))}done(e){return Tj(QS(this.ref,t=>{switch(t._tag){case aP:return[eb(t.notifyProducer),t];case oP:return[kA(t.notifyConsumers,t=>rb(t,R(e)),{discard:!0}),fP(e)];case sP:return[YA,t];case cP:return[YA,t]}}))}emit(e){return G($y(),t=>Tj(QS(this.ref,n=>{switch(n._tag){case aP:return[eb(n.notifyProducer),n];case oP:{let r=n.notifyConsumers[0],i=n.notifyConsumers.slice(1);if(r!==void 0)return[rb(r,Us(e)),i.length===0?lP(t):uP(i)];throw Error(`Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues`)}case sP:return[YA,n];case cP:return[YA,n]}})))}error(e){return Tj(QS(this.ref,t=>{switch(t._tag){case aP:return[eb(t.notifyProducer),t];case oP:return[kA(t.notifyConsumers,t=>tb(t,e),{discard:!0}),dP(e)];case sP:return[YA,t];case cP:return[YA,t]}}))}get take(){return this.takeWith(e=>mw(Jy(e,R)),e=>yw(e),e=>pw(Us(e)))}takeWith(e,t,n){return G($y(),r=>Tj(QS(this.ref,i=>{switch(i._tag){case aP:return[Rj(rb(i.notifyProducer,void 0),Mj(eb(r),{onFailure:e,onSuccess:Zs({onLeft:n,onRight:t})})),uP([r])];case oP:return[Mj(eb(r),{onFailure:e,onSuccess:Zs({onLeft:n,onRight:t})}),uP([...i.notifyConsumers,r])];case sP:return[zA(e(i.cause)),i];case cP:return[zA(n(i.done)),i]}})))}};const mP=()=>j($y(),G(e=>YS(lP(e))),nj(e=>new pP(e))),hP=A(2,(e,t)=>DP(e,()=>t)),gP=A(2,(e,t)=>BM(e,e=>Zs(qy(e),{onLeft:t,onRight:qM}))),_P=A(2,(e,t)=>UM(e,t,()=>void 0,()=>void 0)),vP=e=>iN(()=>{let t=[];return j(QM(e,yP(t)),YM(e=>nN([Fl(t),e])))});var yP=e=>eN({onInput:t=>YM(aN(()=>{e.push(t)}),()=>yP(e)),onFailure:KM,onDone:nN});const bP=e=>{let t=tN({onInput:()=>t,onFailure:qM,onDone:nN});return QM(e,t)},xP=A(2,(e,t)=>GM(e,()=>t)),SP=e=>YM(e,Ea),CP=A(2,(e,t)=>XM(e,{onFailure:e=>{let n=qy(e);switch(n._tag){case`Left`:return t.onFailure(n.left);case`Right`:return qM(n.right)}},onSuccess:t.onSuccess})),wP=e=>WP(e.takeWith(qM,t=>YM(sN(t),()=>wP(e)),nN));var TP=e=>j(ZM(cM(e)),YM(Zs({onLeft:vw({onFailure:qM,onSuccess:rN}),onRight:t=>YM(sN(t),()=>TP(e))})));const EP=()=>eN({onInput:e=>YM(sN(e),()=>EP()),onFailure:KM,onDone:rN}),DP=A(2,(e,t)=>YM(e,e=>aN(()=>t(e)))),OP=A(2,(e,t)=>{let n=eN({onInput:e=>YM(sN(t(e)),()=>n),onFailure:KM,onDone:rN});return QM(e,n)}),kP=A(2,(e,t)=>{let n=tN({onInput:e=>j(ZM(t(e)),YM(sN),YM(()=>n)),onFailure:qM,onDone:rN});return QM(e,n)}),AP=e=>t=>jP(e)(t,ja),jP=({bufferSize:e=16,concurrency:t,mergeStrategy:n=nP()})=>(r,i)=>KP(a=>IA(function*(){let o=t===`unbounded`?2**53-1:t,s=yield*mP(),c=wP(s),l=yield*Fie(e);yield*ND(a,oM(l));let u=yield*Iie();yield*ND(a,oM(u));let d=yield*YS(z()),f=yield*$y(),p=(yield*Xre(o)).withPermits,m=yield*VP(QM(c,r),a);function h(e){return e.pipe(G(Zs({onLeft:e=>zA(B(e)),onRight:e=>ej(sM(l,zA(Us(e))),z())})),kj({until:e=>sc(e)}),G(e=>eC(d,cc({onNone:()=>B(e.value),onSome:t=>B(i(t,e.value))}))),WA(e=>Gy(e)?NA(e):sM(l,NA(e)).pipe(Rj(rb(f,void 0)),tj)))}yield*m.pipe(Nj({onFailure:e=>sM(l,NA(e)).pipe(Rj(zA(!1))),onSuccess:Zs({onLeft:e=>Dj(XA(eb(f)),XA(p(o)(HA)),{onSelfDone:(e,t)=>ej(tO(t),!1),onOtherDone:(t,n)=>Rj(tO(n),XS(d).pipe(G(cc({onNone:()=>sM(l,zA(R(e))),onSome:t=>sM(l,zA(R(i(t,e))))})),ej(!1)))}),onRight:e=>iP(n,{onBackPressure:()=>IA(function*(){let t=yield*$y(),n=dj(t=>VP(QM(c,e),t).pipe(G(e=>Ej(wj(h(e)),wj(XA(eb(f))))),G(Ea)));return yield*rb(t,void 0).pipe(Rj(n),p(1),hj(a)),yield*eb(t),!(yield*nb(f))}),onBufferSliding:()=>IA(function*(){let t=yield*$y(),n=yield*$y(),r=yield*Lie(u);yield*cM(u).pipe(G(e=>rb(e,void 0)),Wre(()=>r>=o)),yield*sM(u,t);let i=dj(n=>VP(QM(c,e),n).pipe(G(e=>wj(h(e)).pipe(Ej(wj(XA(eb(f)))),Ej(wj(XA(eb(t)))))),G(Ea)));return yield*rb(n,void 0).pipe(Rj(i),p(1),hj(a)),yield*eb(n),!(yield*nb(f))})})})}),kj({while:e=>e}),hj(a));let g=j(cM(l),Tj,Mj({onFailure:qM,onSuccess:Zs({onLeft:rN,onRight:e=>YM(sN(e),()=>g)})}),WP);return WM(g,s)})),MP=A(3,(e,t,n)=>AP(n)(OP(e,t))),NP=A(2,(e,t)=>{function n(n){return IA(function*(){let r=yield*mP(),i=wP(r),a=yield*VP(QM(i,e),n),o=yield*VP(QM(i,t.other),n);function s(e,t,r){return(i,a,o)=>{function s(e){let n=e;return n._tag===`Done`?zA(ZM(Rj(tO(t),n.effect))):nj(QD(t),vw({onFailure:e=>ZM(n.f(mw(e))),onSuccess:Zs({onLeft:e=>ZM(n.f(yw(e))),onRight:e=>ZP(sN(e),c(o(n.f)))})}))}return vw(e,{onFailure:e=>s(i(mw(e))),onSuccess:Zs({onLeft:e=>s(i(yw(e))),onRight:e=>zA(YM(sN(e),()=>YM(ZM(hj(XA(r),n)),e=>c(a(e,t)))))})})}}function c(e){switch(e._tag){case WN:return WP(Dj(XA(rO(e.left)),XA(rO(e.right)),{onSelfDone:(n,r)=>Rj(tO(r),s(n,e.right,a)(t.onSelfDone,YN,e=>XN(e))),onOtherDone:(n,r)=>Rj(tO(r),s(n,e.left,o)(t.onOtherDone,(e,t)=>YN(t,e),e=>ZN(e)))}));case GN:return WP(nj(wj(o),vw({onFailure:t=>ZM(e.f(mw(t))),onSuccess:Zs({onLeft:t=>ZM(e.f(yw(t))),onRight:t=>YM(sN(t),()=>c(XN(e.f)))})})));case KN:return WP(nj(wj(a),vw({onFailure:t=>ZM(e.f(mw(t))),onSuccess:Zs({onLeft:t=>ZM(e.f(yw(t))),onRight:t=>YM(sN(t),()=>c(ZN(e.f)))})})))}}return ZM(jA(e=>{let t=jA(t=>(t.transferChildren(e.scope()),HA));return zj(XA(a).pipe(sj(t),hj(n)),XA(o).pipe(sj(t),hj(n)),(e,t)=>YN(e,t))})).pipe(YM(c),WM(r))})}return KP(n)}),PP=A(2,(e,t)=>iN(()=>{let n,r=eN({onInput:e=>YM(sN(e),()=>r),onFailure:e=>(n=$P(e),qM(Ry(n))),onDone:rN}),i=tN({onInput:e=>j(sN(e),YM(()=>i)),onFailure:e=>Wy(e)&&eF(e.defect)&&Ao(e.defect,n)?KM(e.defect.error):qM(e),onDone:rN});return QM(QM(QM(e,r),t),i)})),FP=e=>YM(e,()=>FP(e)),IP=e=>dj(t=>zN(e,t)),LP=e=>IP(bP(e)),RP=e=>WP($A(t=>nj(xre(),n=>zM(Oj(t(ID(e,n)),e=>FD(n,mw(e))),(e,t)=>FD(n,t))))),zP=e=>GP(nj(uj,t=>YM(ZM(e(t)),sN))),BP=e=>G(uj,t=>VP(e,t)),VP=A(2,(e,t)=>Lj(VA(()=>new FN(e,void 0,Ea)),Fj()).pipe(Gre(([e,n])=>PD(t,t=>{let r=e.close(t);return r===void 0?HA:xj(r,n)})),QA,nj(([e])=>BA(()=>HP(e.run(),e)))));var HP=(e,t)=>{let n=e;switch(n._tag){case cN:return vw(t.getDone(),{onFailure:NA,onSuccess:e=>zA(R(e))});case lN:return zA(Us(t.getEmit()));case uN:return j(n.effect,G(()=>HP(t.run(),t)));case dN:return RN(n,()=>HP(t.run(),t),e=>NA(e))}},UP=e=>tN({onInput:t=>YM(ZM(sM(e,Us(t))),()=>UP(e)),onFailure:t=>ZM(sM(e,R(mw(t)))),onDone:t=>ZM(sM(e,R(yw(t))))});const WP=e=>SP(ZM(e)),GP=e=>HM(RP(e),(e,t)=>e,(e,t)=>e),KP=e=>HM(zP(e),(e,t)=>e,(e,t)=>e),qP=(...e)=>JP(Al(e)),JP=e=>YP(0,e.length,e);var YP=(e,t,n)=>e===t?oN:j(sN(j(n,Ll(e))),YM(()=>YP(e+1,t,n)));const XP=A(e=>RM(e[1]),(e,t,n)=>n?.concurrent?NP(e,{other:t,onSelfDone:e=>UN(t=>BA(()=>xw(e,t))),onOtherDone:e=>UN(t=>BA(()=>xw(t,e)))}):YM(e,e=>DP(t,t=>[e,t]))),ZP=A(e=>RM(e[1]),(e,t,n)=>n?.concurrent?DP(XP(e,t,{concurrent:!0}),e=>e[1]):YM(e,()=>t)),QP=Symbol.for(`effect/Channel/ChannelException`),$P=e=>({_tag:`ChannelException`,[QP]:QP,error:e}),eF=e=>M(e,QP),tF=Symbol.for(`effect/Sink`);var nF={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e},rF=class{channel;[tF]=nF;constructor(e){this.channel=e}pipe(){return L(this,arguments)}},iF=e=>tN({onInput:t=>iF(j(e,Ul(t))),onFailure:qM,onDone:()=>nN(e)}),aF=(e,t)=>tN({onInput:n=>{let[r,i]=$l(n,e);return r.length<e?aF(e-r.length,Ul(t,r)):Kl(i)?nN(Ul(t,r)):YM(sN(i),()=>nN(Ul(t,r)))},onFailure:qM,onDone:()=>nN(t)}),oF=(e,t)=>eN({onInput:n=>{let[r,i]=j(Ml(n),qc(e));return i.length===0?oF(e,j(t,Ul(Fl(r)))):j(sN(Fl(i)),ZP(nN(j(t,Ul(Fl(r))))))},onFailure:KM,onDone:()=>nN(t)}),sF=(e,t)=>eN({onInput:n=>j(ZM(j(n,OA(e),nj(Fl))),YM(r=>{let i=j(n,Vl(r.length));return Kl(i)?sF(e,j(t,Ul(r))):j(sN(i),ZP(nN(j(t,Ul(r)))))})),onFailure:KM,onDone:()=>nN(t)}),cF=(e,t,n,r,i,a)=>j(jF(e),vP,CP({onFailure:KM,onSuccess:([o,s])=>i(s)?j(ZM($S(t,Gl(o))),YM(()=>j(ZM(XS(n)),YM(c=>{let l=a(r,s);return c?j(sN(Gl(o)),hP(l)):cF(e,t,n,l,i,a)})))):j(sN(Gl(o)),hP(r))})),lF=e=>eN({onInput:t=>{let n=j(t,Vl(e)),r=Math.max(e-t.length,0);return Kl(t)||r>0?lF(r):j(sN(n),ZP(EP()))},onFailure:KM,onDone:()=>oN}),uF=e=>eN({onInput:t=>j(t,EA(e),nj(t=>t.length===0?uF(e):j(sN(Fl(t)),ZP(EP()))),WP),onFailure:KM,onDone:()=>oN}),dF=e=>eN({onInput:t=>{let n=j(t,Hl(e));return Kl(n)?dF(e):j(sN(n),ZP(EP()))},onFailure:KM,onDone:rN}),fF=e=>eN({onInput:t=>j(t,DA(e),nj(t=>t.length===0?fF(e):j(sN(Fl(t)),ZP(EP()))),WP),onFailure:KM,onDone:()=>oN}),pF=(e,t,n)=>t(e)?eN({onInput:r=>{let[i,a]=mF(e,r,t,n,0,r.length);return ql(a)?j(sN(a),hP(i)):pF(i,t,n)},onFailure:KM,onDone:()=>rN(e)}):rN(e),mF=(e,t,n,r,i,a)=>{if(i===a)return[e,Dl()];let o=r(e,j(t,Ll(i)));return n(o)?mF(o,t,n,r,i+1,a):[o,j(t,Vl(i+1))]},hF=(e,t,n)=>t(e)?eN({onInput:r=>hF(n(e,r),t,n),onFailure:KM,onDone:()=>rN(e)}):rN(e),gF=(e,t,n)=>t(e)?eN({onInput:r=>j(ZM(n(e,r)),YM(e=>gF(e,t,n))),onFailure:KM,onDone:()=>rN(e)}):rN(e),_F=(e,t,n)=>t(e)?eN({onInput:r=>j(ZM(vF(e,r,t,n)),YM(([e,r])=>j(r,cc({onNone:()=>_F(e,t,n),onSome:t=>j(sN(t),hP(e))})))),onFailure:KM,onDone:()=>rN(e)}):rN(e),vF=(e,t,n,r)=>yF(e,t,0,t.length,n,r),yF=(e,t,n,r,i,a)=>n===r?zA([e,z()]):j(a(e,j(t,Ll(n))),G(e=>i(e)?yF(e,t,n+1,r,i,a):zA([e,B(j(t,Vl(n+1)))]))),bF=(e,t,n,r,i,a,o)=>eN({onInput:s=>{let[c,l,u,d]=xF(s,e,t,n,r,i,a,o);return ql(d)?j(sN(d),ZP(rN(c))):t>r?rN(c):bF(c,l,u,r,i,a,o)},onFailure:KM,onDone:()=>rN(e)}),xF=(e,t,n,r,i,a,o,s)=>{for(let c=0;c<e.length;c++){let l=Ll(e,c),u=n;if(n+=a(t,l),n<=i){t=s(t,l),r=!0;continue}let d=o(l);if(d.length<=1&&!r)return[s(t,l),n,!0,Vl(e,c+1)];if(d.length<=1&&r)return[t,u,r,Vl(e,c)];e=Ul(d,Vl(e,c+1)),n=u,c=-1}return[t,n,r,Dl()]},SF=(e,t,n,r,i,a,o)=>eN({onInput:s=>j(ZM(CF(e,t,n,r,i,s,o,a,0)),YM(([e,o,s,c])=>ql(c)?j(sN(c),ZP(rN(e))):a>t?rN(e):SF(e,t,n,r,i,o,s))),onFailure:KM,onDone:()=>rN(e)}),CF=(e,t,n,r,i,a,o,s,c)=>{if(c===a.length)return zA([e,s,o,Dl()]);let l=j(a,Ll(c));return j(n(e,l),nj(e=>s+e),G(u=>u<=t?j(i(e,l),G(e=>CF(e,t,n,r,i,a,!0,u,c+1))):j(r(l),G(d=>d.length<=1&&!o?j(i(e,l),nj(e=>[e,u,!0,j(a,Vl(c+1))])):d.length<=1&&o?zA([e,s,o,j(a,Vl(c))]):CF(e,t,n,r,i,j(d,Ul(j(a,Vl(c+1)))),o,s,0)))))};const wF=e=>{let t=tN({onInput:n=>j(ZM(e(n)),YM(()=>t)),onFailure:qM,onDone:()=>oN});return new rF(t)};var TF=(e,t,n,r,i)=>n===r?i:j(ZM(e(j(t,Ll(n)))),YM(a=>a?TF(e,t,n+1,r,i):sN(j(t,Vl(n)))),gP(e=>j(sN(j(t,Vl(n))),ZP(KM(e)))));const EF=e=>new rF(ZM(e));var DF=e=>eN({onInput:t=>CP(ZM(e(B(t))),{onFailure:([e,t])=>Zs(e,{onLeft:e=>j(sN(t),ZP(KM(e))),onRight:e=>j(sN(t),ZP(rN(e)))}),onSuccess:()=>DF(e)}),onFailure:KM,onDone:()=>CP(ZM(e(z())),{onFailure:([e,t])=>Zs(e,{onLeft:e=>j(sN(t),ZP(KM(e))),onRight:e=>j(sN(t),ZP(rN(e)))}),onSuccess:()=>ZM(FA(`BUG: Sink.fromPush - please report an issue at https://github.com/Effect-TS/effect/issues`))})});const OF=(e,t)=>t?.shutdown?MF(nj(aj(zA(e),oM),OF)):wF(t=>Rie(e,t));var kF=(e,t,n)=>tN({onInput:r=>{if(Kl(r))return kF(e,t,n);if(e){let e=AF(r,n);if(e===-1)return ZP(sN(r),kF(!0,t,n));let[i,a]=$l(r,e);return ZP(sN(i),ZM($S(t,a)))}let i=AF(r,n,1);if(i===-1)return ZP(sN(r),kF(!0,t,n));let[a,o]=j(r,$l(Math.max(i,1)));return ZP(sN(a),ZM($S(t,o)))},onFailure:qM,onDone:nN}),AF=(e,t,n=0)=>{let r=e[Symbol.iterator](),i=0,a=-1,o;for(;a<0&&(o=r.next())&&!o.done;){let e=o.value;i>=n&&t(e)&&(a=i),i+=1}return a};const jF=e=>CA(e)?jF(EF(e)):e.channel,MF=e=>new rF(GP(e.pipe(nj(e=>jF(e))))),NF=HN,PF=UN,FF=aO,IF=xO,LF=yO,RF={_tag:`Left`},zF={_tag:`Right`},BF={_tag:`Both`},VF={_tag:`Either`},HF=e=>{switch(e){case`left`:return RF;case`right`:return zF;case`both`:return BF;case`either`:return VF;default:return e}},UF=BF;var WF=class{value;constructor(e){this.value=e}};const GF=e=>{e.ref.versioned=new WF(e.newValue)},KF=e=>e.ref.versioned!==e.expected,qF=e=>e.isChanged,JF=e=>{for(let t of e)GF(t[1])},YF=e=>{let t=`ReadOnly`;for(let[,n]of e)if(t=KF(n)?`Invalid`:qF(n)?`ReadWrite`:t,t===`Invalid`)return t;return t},XF=e=>{let t=new Map;for(let[,n]of e){for(let e of n.ref.todos)t.set(e[0],e[1]);n.ref.todos=new Map}return t},ZF=e=>{let t=Array.from(e.entries()).sort((e,t)=>e[0]-t[0]);for(let[e,n]of t)n()},QF=(e,t,n)=>{let r=!1;for(let[,i]of t)i.ref.todos.has(e)||(i.ref.todos.set(e,n),r=!0);return r},$F=`WithSTMRuntime`,eI=`OnFailure`,tI=`OnSuccess`,nI=`Sync`,rI=`Succeed`,iI=`Fail`,aI=`Fail`,oI=`Interrupt`,sI=`Succeed`,cI=`Retry`,lI=`Done`,uI=`Suspend`,dI=`Done`,fI=`Interrupted`,pI=`Running`;var mI=`effect/STM/State`;const hI=Symbol.for(mI),gI=e=>M(e,hI),_I=e=>e._tag===pI,vI=e=>e._tag===dI,yI=e=>({[hI]:hI,_tag:dI,exit:e,[N](){return j(P(mI),F(P(dI)),F(P(e)),ko(this))},[I](t){return gI(t)&&t._tag===`Done`&&Ao(e,t.exit)}});var bI=j(P(mI),F(P(fI)),F(P(`interrupted`)));const xI={[hI]:hI,_tag:fI,[N](){return bI},[I](e){return gI(e)&&e._tag===`Interrupted`}};var SI=j(P(mI),F(P(pI)),F(P(`running`)));const CI={[hI]:hI,_tag:pI,[N](){return SI},[I](e){return gI(e)&&e._tag===`Running`}},wI=e=>{switch(e._tag){case aI:return yI(pw(e.error));case`Die`:return yI(fw(e.defect));case oI:return yI(gw(e.fiberId));case sI:return yI(yw(e.value));case cI:throw Error(`BUG: STM.STMState.fromTExit - please report an issue at https://github.com/Effect-TS/effect/issues`)}};var TI=`effect/TExit`;const EI=Symbol.for(TI);var DI={_A:e=>e,_E:e=>e};const OI=e=>M(e,EI),kI=e=>e._tag===sI,AI=e=>e._tag===cI,jI=e=>({[EI]:DI,_tag:aI,error:e,[N](){return j(P(TI),F(P(aI)),F(P(e)),ko(this))},[I](t){return OI(t)&&t._tag===`Fail`&&Ao(e,t.error)}}),MI=e=>({[EI]:DI,_tag:`Die`,defect:e,[N](){return j(P(TI),F(P(`Die`)),F(P(e)),ko(this))},[I](t){return OI(t)&&t._tag===`Die`&&Ao(e,t.defect)}}),NI=e=>({[EI]:DI,_tag:oI,fiberId:e,[N](){return j(P(TI),F(P(oI)),F(P(e)),ko(this))},[I](t){return OI(t)&&t._tag===`Interrupt`&&Ao(e,t.fiberId)}}),PI=e=>({[EI]:DI,_tag:sI,value:e,[N](){return j(P(TI),F(P(sI)),F(P(e)),ko(this))},[I](t){return OI(t)&&t._tag===`Succeed`&&Ao(e,t.value)}});var FI=j(P(TI),F(P(cI)),F(P(`retry`)));const II={[EI]:DI,_tag:cI,[N](){return FI},[I](e){return OI(e)&&AI(e)}},LI=e=>({_tag:lI,exit:e}),RI=e=>({_tag:uI,journal:e});var zI={ref:0};const BI=()=>{let e=zI.ref+1;return zI.ref=e,e},VI=Symbol.for(`effect/STM`);var HI={_R:e=>e,_E:e=>e,_A:e=>e},UI=class{effect_instruction_i0;_op=Qo;effect_instruction_i1=void 0;effect_instruction_i2=void 0;[SA];[ms];[tF];[FM];get[VI](){return HI}constructor(e){this.effect_instruction_i0=e,this[SA]=_s,this[ms]=HI,this[tF]=HI,this[FM]=HI}[I](e){return this===e}[N](){return ko(this,xo(this))}[Symbol.iterator](){return new Lg(new ho(this))}commit(){return WI(this,ja,ja)}pipe(){return L(this,arguments)}};const WI=(e,t,n)=>Gg(r=>{let i=r.id(),a=r.getFiberRef(Wj),o=r.getFiberRef(rie),s=r.getFiberRef(nie),c=KI(i,e,a,o,s);switch(c._tag){case lI:return t(c.exit),c.exit;case uI:{let r=BI(),c={value:CI},l=AA(t=>qI(i,e,r,c,a,o,s,t));return $A(e=>j(e(l),WA(e=>{let r=c.value;return _I(r)&&(c.value=xI),r=c.value,vI(r)?(t(r.exit),r.exit):(n(),NA(e))})))}}});var GI=(e,t,n,r,i,a)=>{let o=new Map,s=new XI(t,o,e,r).run(),c=YF(o);if(c===`ReadWrite`)JF(o);else if(c===`Invalid`)throw Error(`BUG: STM.TryCommit.tryCommit - please report an issue at https://github.com/Effect-TS/effect/issues`);switch(s._tag){case sI:return n.value=wI(s),JI(yw(s.value),o,i,a);case aI:return n.value=wI(s),JI(mw(Ly(s.error)),o,i,a);case`Die`:return n.value=wI(s),JI(mw(Ry(s.defect)),o,i,a);case oI:return n.value=wI(s),JI(mw(zy(e)),o,i,a);case cI:return RI(o)}},KI=(e,t,n,r,i)=>{let a=new Map,o=new XI(t,a,e,n).run(),s=YF(a);if(s===`ReadWrite`&&kI(o))JF(a);else if(s===`Invalid`)throw Error(`BUG: STM.TryCommit.tryCommitSync - please report an issue at https://github.com/Effect-TS/effect/issues`);switch(o._tag){case sI:return JI(yw(o.value),a,r,i);case aI:return JI(mw(Ly(o.error)),a,r,i);case`Die`:return JI(mw(Ry(o.defect)),a,r,i);case oI:return JI(mw(zy(e)),a,r,i);case cI:return RI(a)}},qI=(e,t,n,r,i,a,o,s)=>{if(_I(r.value)){let c=GI(e,t,r,i,a,o);switch(c._tag){case lI:YI(c.exit,s);break;case uI:QF(n,c.journal,()=>qI(e,t,n,r,i,a,o,s));break}}},JI=(e,t,n,r)=>{let i=XF(t);return i.size>0&&n.scheduleTask(()=>ZF(i),r),LI(e)},YI=(e,t)=>{t(e)},XI=class{self;journal;fiberId;contStack=[];env;constructor(e,t,n,r){this.self=e,this.journal=t,this.fiberId=n,this.env=r}getEnv(){return this.env}pushStack(e){this.contStack.push(e)}popStack(){return this.contStack.pop()}nextSuccess(){let e=this.popStack();for(;e!==void 0&&e.effect_instruction_i0!==`OnSuccess`;)e=this.popStack();return e}nextFailure(){let e=this.popStack();for(;e!==void 0&&e.effect_instruction_i0!==`OnFailure`;)e=this.popStack();return e}nextRetry(){let e=this.popStack();for(;e!==void 0&&e.effect_instruction_i0!==`OnRetry`;)e=this.popStack();return e}run(){let e=this.self,t;for(;t===void 0&&e!==void 0;)try{let n=e;if(n)switch(n._op){case`Tag`:e=eL((e,t,r)=>dp(r,n));break;case`Left`:e=nL(n.left);break;case`None`:e=nL(new Zy);break;case`Right`:e=cL(n.right);break;case`Some`:e=cL(n.value);break;case`Commit`:switch(n.effect_instruction_i0){case`Die`:t=MI(yo(()=>n.effect_instruction_i1()));break;case iI:{let r=this.nextFailure();r===void 0?t=jI(yo(()=>n.effect_instruction_i1())):e=yo(()=>r.effect_instruction_i2(yo(()=>n.effect_instruction_i1())));break}case`Retry`:{let n=this.nextRetry();n===void 0?t=II:e=yo(()=>n.effect_instruction_i2());break}case`Interrupt`:t=NI(this.fiberId);break;case $F:e=yo(()=>n.effect_instruction_i1(this));break;case tI:case eI:case`OnRetry`:this.pushStack(n),e=n.effect_instruction_i1;break;case`Provide`:{let t=this.env;this.env=yo(()=>n.effect_instruction_i2(t)),e=j(n.effect_instruction_i1,tL(lL(()=>this.env=t)));break}case rI:{let r=n.effect_instruction_i1,i=this.nextSuccess();i===void 0?t=PI(r):e=yo(()=>i.effect_instruction_i2(r));break}case nI:{let r=yo(()=>n.effect_instruction_i1()),i=this.nextSuccess();i===void 0?t=PI(r):e=yo(()=>i.effect_instruction_i2(r));break}}break}}catch(t){e=QI(t)}return t}};const ZI=A(2,(e,t)=>{let n=new UI(eI);return n.effect_instruction_i1=e,n.effect_instruction_i2=t,n}),QI=e=>$I(()=>e),$I=e=>{let t=new UI(`Die`);return t.effect_instruction_i1=e,t},eL=e=>oL(t=>cL(e(t.journal,t.fiberId,t.getEnv()))),tL=A(2,(e,t)=>aL(e,{onFailure:e=>uL(t,nL(e)),onSuccess:e=>uL(t,cL(e))})),nL=e=>rL(()=>e),rL=e=>{let t=new UI(iI);return t.effect_instruction_i1=e,t},iL=A(2,(e,t)=>{let n=new UI(tI);return n.effect_instruction_i1=e,n.effect_instruction_i2=t,n}),aL=A(2,(e,{onFailure:t,onSuccess:n})=>j(e,sL(Us),ZI(e=>j(t(e),sL(R))),iL(e=>{switch(e._tag){case`Left`:return cL(e.left);case`Right`:return n(e.right)}}))),oL=e=>{let t=new UI($F);return t.effect_instruction_i1=e,t},sL=A(2,(e,t)=>j(e,iL(e=>lL(()=>t(e))))),cL=e=>{let t=new UI(rI);return t.effect_instruction_i1=e,t},lL=e=>{let t=new UI(nI);return t.effect_instruction_i1=e,t},uL=A(2,(e,t)=>j(e,iL(()=>t)));var dL=(e,t)=>iL(e.take,n=>t(n)?cL(n):dL(e,t));const fL=`Empty`,pL=`Full`;var mL=e=>({_tag:fL,notifyConsumer:e}),hL=(e,t)=>({_tag:pL,value:e,notifyProducer:t}),gL=(e,t)=>n=>{switch(n._tag){case fL:return e(n.notifyConsumer);case pL:return t(n.value,n.notifyProducer)}};const _L=A(2,(e,t)=>G($y(),n=>Tj(QS(e.ref,r=>j(r,gL(e=>[Rj(rb(e,void 0),eb(n)),hL(t,n)],(n,i)=>[G(eb(i),()=>j(e,_L(t))),r])))))),vL=e=>G($y(),t=>Tj(QS(e.ref,n=>j(n,gL(t=>[G(eb(t),()=>vL(e)),n],(e,n)=>[ej(rb(n,void 0),e),mL(t)]))))),yL=Symbol.for(`effect/Stream`);var bL={_R:e=>e,_E:e=>e,_A:e=>e},xL=class{channel;[yL]=bL;constructor(e){this.channel=e}pipe(){return L(this,arguments)}};const SL=e=>M(e,yL)||CA(e),CL=A(2,(e,t)=>wL(e,e=>Zs(qy(e),{onLeft:t,onRight:Gie}))),wL=A(2,(e,t)=>new xL(j(OL(e),BM(e=>OL(t(e)))))),Bie=A(2,(e,t)=>new xL(j(OL(e),ZP(OL(t))))),Vie=e=>AL(PA(e)),Hie=new xL(oN),Uie=A(2,(e,t)=>new xL(j(OL(e),xP(t)))),Wie=e=>jL(MA(B(e))),Gie=e=>AL(NA(e)),TL=A(e=>SL(e[0]),(e,t,n)=>{let r=n?.bufferSize??16;return n?.switch?EL(n?.concurrency,()=>DL(e,1,r,t),n=>DL(e,n,r,t)):EL(n?.concurrency,()=>new xL(_P(OL(e),e=>j(e,Ql(e=>OL(t(e))),nu(oN,(e,t)=>j(e,ZP(t)))))),r=>new xL(j(OL(e),_P(JP),MP(e=>OL(t(e)),n))))}),EL=(e,t,n)=>{switch(e){case void 0:return t();case`unbounded`:return n(2**53-1);default:return e>1?n(e):t()}};var DL=A(4,(e,t,n,r)=>new xL(j(OL(e),_P(JP),MP(e=>OL(r(e)),{concurrency:t,mergeStrategy:rP(),bufferSize:n}))));const Kie=A(e=>SL(e[0]),(e,t)=>TL(e,Ea,t)),qie=e=>new xL(e),OL=e=>{if(`channel`in e)return e.channel;if(CA(e))return OL(AL(e));throw TypeError(`Expected a Stream.`)},kL=e=>new xL(Kl(e)?oN:sN(e)),AL=e=>j(e,ij(B),jL),jL=e=>new xL(WP(Kre(e,{onFailure:cc({onNone:()=>oN,onSome:KM}),onSuccess:e=>sN(kl(e))}))),Jie=e=>j(e,nj(PL),zL),Yie=(...e)=>{let t=e.length===1?e[0].evaluate:e[0],n=e.length===1?e[0].onError:e[1],r=e.length===1?e[0].releaseLockOnEnd===!0:!1;return zL(nj(aj(VA(()=>t().getReader()),e=>r?VA(()=>e.releaseLock()):RA(()=>e.cancel())),e=>FL(G(JA({try:()=>e.read(),catch:e=>B(n(e))}),({done:e,value:t})=>e?MA(z()):zA(t)))))},ML=A(2,(e,t)=>new xL(j(OL(e),OP(Ql(t))))),Xie=A(2,(e,t)=>new xL(j(OL(e),kP(t)))),Zie=A(2,(e,t)=>{let n=e=>{let r=e.next();if(r.done)return tN({onInput:e=>n(e[Symbol.iterator]()),onFailure:qM,onDone:nN});{let i=r.value;return WP(nj(t(i),t=>YM(sN(kl(t)),()=>n(e))))}};return new xL(j(OL(e),QM(iN(()=>n(Dl()[Symbol.iterator]())))))}),Qie=A(2,(e,t)=>$ie(e,t,{onSelf:R,onOther:Us})),$ie=A(3,(e,t,n)=>{let r=n.haltStrategy?HF(n.haltStrategy):UF,i=e=>t=>e||!lw(t)?NF(BA(()=>t)):PF(e=>BA(()=>e));return new xL(NP(OL(ML(e,n.onSelf)),{other:OL(ML(t,n.onOther)),onSelfDone:i(r._tag===`Either`||r._tag===`Left`),onOtherDone:i(r._tag===`Either`||r._tag===`Right`)}))}),eae=A(2,(e,t)=>new xL(j(OL(e),$M(t))));var NL=(e,t)=>tN({onInput:n=>{if(n.length===t&&e.isEmpty())return YM(sN(n),()=>NL(e,t));if(n.length>0){let r=[],i,a=0;for(;a<n.length;){for(;a<n.length&&i===void 0;)i=e.write(j(n,Ll(a))),a+=1;i!==void 0&&(r.push(i),i=void 0)}return YM(qP(...r),()=>NL(e,t))}return iN(()=>NL(e,t))},onFailure:t=>ZP(e.emitIfNotEmpty(),qM(t)),onDone:()=>e.emitIfNotEmpty()});const PL=e=>aae(e,e=>j(nj(e,t=>B([t,e])),UA(cc({onNone:()=>zA(z()),onSome:MA})))),FL=e=>PL(j(e,nj(kl))),tae=A(2,(e,t)=>OL(e).pipe(PP(jF(t)),LP)),IL=A(2,(e,t)=>tae(e,wF(t))),nae=e=>new xL(xP(RP(j(e,nj(kl))),HA)),LL=e=>new xL(iN(()=>OL(e()))),RL=e=>nj(BP(OL(e)),e=>j(e,ij(B),G(Zs({onLeft:()=>MA(z()),onRight:zA})))),rae=A(e=>SL(e[0]),(e,t)=>nj(Fj(),n=>iae(e,n,t))),iae=A(e=>SL(e[0]),(e,t,n)=>{let r=FF(t),i,a,o=Zre(!1);return new ReadableStream({start(t){a=r(IL(e,e=>e.length===0?HA:o.whenOpen(VA(()=>{o.unsafeClose();for(let n of e)t.enqueue(n);i(),i=void 0})))),a.addObserver(e=>{try{e._tag===`Failure`?t.error(Yy(e.cause)):t.close()}catch{}})},pull(){return new Promise(e=>{i=e,Ij(o.open)})},cancel(){if(a)return $re(tj(tO(a)))}},n?.strategy)}),aae=(e,t)=>LL(()=>{let n=e=>WP(nj(t(e),cc({onNone:()=>oN,onSome:([e,t])=>YM(sN(e),()=>n(t))})));return new xL(n(e))}),zL=e=>Kie(nae(e)),oae=(...e)=>{if(e.length===0)return Hie;if(e.length===1)return ML(e[0],e=>[e]);let[t,...n]=e;return sae(t,oae(...n),(e,t)=>[e,...t])},sae=A(3,(e,t,n)=>{let r=e=>j(e,G(t=>Kl(t)?r(e):zA(t)));return j(RL(e),nj(r),Lj(j(RL(t),nj(r))),G(([e,t])=>j(jL(Dj(e,t,{onSelfDone:(e,t)=>j(BA(()=>e),zj(rO(t),(e,t)=>[e,t,!0])),onOtherDone:(e,t)=>j(BA(()=>e),zj(rO(t),(e,t)=>[t,e,!1]))})),TL(([r,i,a])=>j(AL(YS([Zl(r),Zl(i)])),TL(o=>j(kL(a?j(i,Ql(e=>n(Zl(r),e))):j(r,Ql(e=>n(e,Zl(i))))),Bie(j(FL(e),Qie(FL(t)),Zie(Zs({onLeft:e=>QS(o,([t,r])=>[j(e,Ql(e=>n(e,r))),[Zl(e),r]]),onRight:e=>QS(o,([t,r])=>[j(e,Ql(e=>n(t,e))),[t,Zl(e)]])})),TL(kL))))))),RL)),Jie)});var BL=`effect/Redacted`;const VL=La(`effect/Redacted/redactedRegistry`,()=>new WeakMap),HL=Symbol.for(BL),cae={[HL]:{_A:e=>e},pipe(){return L(this,arguments)},toString(){return`<redacted>`},toJSON(){return`<redacted>`},[Po](){return`<redacted>`},[N](){return j(P(BL),F(P(VL.get(this))),ko(this))},[I](e){return lae(e)&&Ao(VL.get(this),VL.get(e))}},lae=e=>M(e,HL),uae=e=>{let t=Object.create(cae);return VL.set(t,e),t},dae=fk,fae=jre,pae=Mre,mae=pk,hae=Pre,UL=hk,gae=Bre,WL=(e,t)=>{switch(t._tag){case`StringKeyword`:case`TemplateLiteral`:return Object.keys(e);case`SymbolKeyword`:return Object.getOwnPropertySymbols(e);case`Refinement`:return WL(e,t.from)}},GL=e=>{let t=!1,n;return()=>t?n:(n=e(),t=!0,n)},KL=e=>Array.isArray(e),_ae=e=>!Array.isArray(e),qL=e=>`[${zo(e)}]`,JL=e=>KL(e)?e.map(qL).join(``):qL(e);var YL=(e,t,n,r)=>{let i=e;return n&&Ic(n)&&(i+=`\nat path: ${JL(n)}`),t!==void 0&&(i+=`\ndetails: ${t}`),r&&(i+=`\nschema (${r._tag}): ${r}`),i};const XL=(e,t,n)=>YL(`Unsupported schema or overlapping types`,`cannot extend ${e} with ${t}`,n),vae=e=>YL(`Unsupported key schema`,void 0,void 0,e),yae=e=>YL(`Unsupported literal`,`literal value: ${Bo(e)}`),ZL=e=>YL(`Duplicate index signature`,`${e} index signature`),bae=YL(`Unsupported index signature parameter`,"An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),xae=YL(`Invalid element`,`A required element cannot follow an optional element. ts(1257)`),QL=e=>YL(`Duplicate property signature transformation`,`Duplicate key ${Bo(e)}`),$L=e=>YL(`Duplicate property signature`,`Duplicate key ${Bo(e)}`),Sae=Symbol.for(`effect/SchemaId/Int`),Cae=Symbol.for(`effect/annotation/TypeConstructor`),wae=Symbol.for(`effect/annotation/Brand`),eR=Symbol.for(`effect/annotation/SchemaId`),tR=Symbol.for(`effect/annotation/Message`),nR=Symbol.for(`effect/annotation/MissingMessage`),rR=Symbol.for(`effect/annotation/Identifier`),iR=Symbol.for(`effect/annotation/Title`),aR=Symbol.for(`effect/annotation/AutoTitle`),oR=Symbol.for(`effect/annotation/Description`),sR=Symbol.for(`effect/annotation/Examples`),cR=Symbol.for(`effect/annotation/Default`),lR=Symbol.for(`effect/annotation/JSONSchema`),uR=Symbol.for(`effect/annotation/Arbitrary`),dR=Symbol.for(`effect/annotation/Pretty`),fR=Symbol.for(`effect/annotation/Equivalence`),Tae=Symbol.for(`effect/annotation/Documentation`),pR=Symbol.for(`effect/annotation/Concurrency`),mR=Symbol.for(`effect/annotation/Batching`),hR=Symbol.for(`effect/annotation/ParseIssueTitle`),gR=Symbol.for(`effect/annotation/ParseOptions`),_R=Symbol.for(`effect/annotation/DecodingFallback`),vR=Symbol.for(`effect/annotation/Surrogate`),Eae=Symbol.for(`effect/annotation/StableFilter`),yR=A(2,(e,t)=>Object.prototype.hasOwnProperty.call(e.annotations,t)?B(e.annotations[t]):z()),Dae=yR(wae),Oae=yR(tR),kae=yR(nR),bR=yR(iR),xR=yR(aR),SR=yR(rR),CR=yR(oR),Aae=yR(pR),jae=yR(mR),Mae=yR(hR),Nae=yR(gR),Pae=yR(_R),wR=yR(vR);var Fae=yR(Eae);const TR=e=>bc(Fae(e),e=>e===!0),ER=Symbol.for(`effect/annotation/JSONIdentifier`),Iae=yR(ER),Lae=e=>uc(Iae(e),()=>SR(e));var DR=class{typeParameters;decodeUnknown;encodeUnknown;annotations;_tag=`Declaration`;constructor(e,t,n,r={}){this.typeParameters=e,this.decodeUnknown=t,this.encodeUnknown=n,this.annotations=r}toString(){return lc(Cz(this),()=>`<declaration schema>`)}toJSON(){return{_tag:this._tag,typeParameters:this.typeParameters.map(e=>e.toJSON()),annotations:yz(this.annotations)}}},OR=e=>t=>t._tag===e,kR=class{literal;annotations;_tag=`Literal`;constructor(e,t={}){this.literal=e,this.annotations=t}toString(){return lc(Cz(this),()=>Bo(this.literal))}toJSON(){return{_tag:this._tag,literal:Va(this.literal)?String(this.literal):this.literal,annotations:yz(this.annotations)}}};const AR=OR(`Literal`);var Rae=new kR(null),zae=class{symbol;annotations;_tag=`UniqueSymbol`;constructor(e,t={}){this.symbol=e,this.annotations=t}toString(){return lc(Cz(this),()=>Bo(this.symbol))}toJSON(){return{_tag:this._tag,symbol:String(this.symbol),annotations:yz(this.annotations)}}};const jR=new class{annotations;_tag=`UndefinedKeyword`;constructor(e={}){this.annotations=e}toString(){return xz(this)}toJSON(){return{_tag:this._tag,annotations:yz(this.annotations)}}}({[iR]:`undefined`}),Bae=new class{annotations;_tag=`VoidKeyword`;constructor(e={}){this.annotations=e}toString(){return xz(this)}toJSON(){return{_tag:this._tag,annotations:yz(this.annotations)}}}({[iR]:`void`}),MR=new class{annotations;_tag=`NeverKeyword`;constructor(e={}){this.annotations=e}toString(){return xz(this)}toJSON(){return{_tag:this._tag,annotations:yz(this.annotations)}}}({[iR]:`never`}),NR=new class{annotations;_tag=`UnknownKeyword`;constructor(e={}){this.annotations=e}toString(){return xz(this)}toJSON(){return{_tag:this._tag,annotations:yz(this.annotations)}}}({[iR]:`unknown`}),Vae=new class{annotations;_tag=`AnyKeyword`;constructor(e={}){this.annotations=e}toString(){return xz(this)}toJSON(){return{_tag:this._tag,annotations:yz(this.annotations)}}}({[iR]:`any`}),PR=new class{annotations;_tag=`StringKeyword`;constructor(e={}){this.annotations=e}toString(){return xz(this)}toJSON(){return{_tag:this._tag,annotations:yz(this.annotations)}}}({[iR]:`string`,[oR]:`a string`}),FR=OR(`StringKeyword`),IR=new class{annotations;_tag=`NumberKeyword`;constructor(e={}){this.annotations=e}toString(){return xz(this)}toJSON(){return{_tag:this._tag,annotations:yz(this.annotations)}}}({[iR]:`number`,[oR]:`a number`}),LR=OR(`NumberKeyword`),RR=new class{annotations;_tag=`BooleanKeyword`;constructor(e={}){this.annotations=e}toString(){return xz(this)}toJSON(){return{_tag:this._tag,annotations:yz(this.annotations)}}}({[iR]:`boolean`,[oR]:`a boolean`}),zR=OR(`BooleanKeyword`),Hae=OR(`SymbolKeyword`);var BR=class{type;annotations;constructor(e,t={}){this.type=e,this.annotations=t}toJSON(){return{type:this.type.toJSON(),annotations:yz(this.annotations)}}toString(){return String(this.type)}},VR=class extends BR{isOptional;constructor(e,t,n={}){super(e,n),this.isOptional=t}toJSON(){return{type:this.type.toJSON(),isOptional:this.isOptional,annotations:yz(this.annotations)}}toString(){return String(this.type)+(this.isOptional?`?`:``)}},HR=e=>e.map(e=>e.type),UR=class{elements;rest;isReadonly;annotations;_tag=`TupleType`;constructor(e,t,n,r={}){this.elements=e,this.rest=t,this.isReadonly=n,this.annotations=r;let i=!1,a=!1;for(let t of e)if(t.isOptional)i=!0;else if(i){a=!0;break}if(a||i&&t.length>1)throw Error(xae)}toString(){return lc(Cz(this),()=>Uae(this))}toJSON(){return{_tag:this._tag,elements:this.elements.map(e=>e.toJSON()),rest:this.rest.map(e=>e.toJSON()),isReadonly:this.isReadonly,annotations:yz(this.annotations)}}},Uae=e=>{let t=e.elements.map(String).join(`, `);return kc(e.rest,{onEmpty:()=>`readonly [${t}]`,onNonEmpty:(n,r)=>{let i=String(n),a=i.includes(` | `)?`(${i})`:i;if(r.length>0){let n=r.map(String).join(`, `);return e.elements.length>0?`readonly [${t}, ...${a}[], ${n}]`:`readonly [...${a}[], ${n}]`}else if(e.elements.length>0)return`readonly [${t}, ...${a}[]]`;else return`ReadonlyArray<${i}>`}})},WR=class extends VR{name;isReadonly;constructor(e,t,n,r,i){super(t,n,i),this.name=e,this.isReadonly=r}toString(){return(this.isReadonly?`readonly `:``)+String(this.name)+(this.isOptional?`?`:``)+`: `+this.type}toJSON(){return{name:String(this.name),type:this.type.toJSON(),isOptional:this.isOptional,isReadonly:this.isReadonly,annotations:yz(this.annotations)}}};const GR=e=>{switch(e._tag){case`StringKeyword`:case`SymbolKeyword`:case`TemplateLiteral`:return!0;case`Refinement`:return GR(e.from)}return!1};var KR=class{type;isReadonly;parameter;constructor(e,t,n){if(this.type=t,this.isReadonly=n,GR(e))this.parameter=e;else throw Error(bae)}toString(){return(this.isReadonly?`readonly `:``)+`[x: ${this.parameter}]: ${this.type}`}toJSON(){return{parameter:this.parameter.toJSON(),type:this.type.toJSON(),isReadonly:this.isReadonly}}},qR=class{annotations;_tag=`TypeLiteral`;propertySignatures;indexSignatures;constructor(e,t,n={}){this.annotations=n;let r={};for(let t=0;t<e.length;t++){let n=e[t].name;if(Object.prototype.hasOwnProperty.call(r,n))throw Error($L(n));r[n]=null}let i={string:!1,symbol:!1};for(let e=0;e<t.length;e++){let n=bz(t[e].parameter);if(FR(n)){if(i.string)throw Error(ZL(`string`));i.string=!0}else if(Hae(n)){if(i.symbol)throw Error(ZL(`symbol`));i.symbol=!0}}this.propertySignatures=e,this.indexSignatures=t}toString(){return lc(Cz(this),()=>Wae(this))}toJSON(){return{_tag:this._tag,propertySignatures:this.propertySignatures.map(e=>e.toJSON()),indexSignatures:this.indexSignatures.map(e=>e.toJSON()),annotations:yz(this.annotations)}}},JR=e=>e.map(String).join(`; `),Wae=e=>{if(e.propertySignatures.length>0){let t=e.propertySignatures.map(String).join(`; `);return e.indexSignatures.length>0?`{ ${t}; ${JR(e.indexSignatures)} }`:`{ ${t} }`}else if(e.indexSignatures.length>0)return`{ ${JR(e.indexSignatures)} }`;else return`{}`};const YR=OR(`TypeLiteral`);var Gae=Xc(ic(fb,e=>{switch(e._tag){case`AnyKeyword`:return 0;case`UnknownKeyword`:return 1;case`ObjectKeyword`:return 2;case`StringKeyword`:case`NumberKeyword`:case`BooleanKeyword`:case`BigIntKeyword`:case`SymbolKeyword`:return 3}return 4})),Kae={string:`StringKeyword`,number:`NumberKeyword`,boolean:`BooleanKeyword`,bigint:`BigIntKeyword`};const XR=e=>cl(e,e=>$R(e)?XR(e.types):[e]),qae=e=>{let t=Gae(e),n=[],r={},i=[];for(let e of t)switch(e._tag){case`NeverKeyword`:break;case`AnyKeyword`:return[Vae];case`UnknownKeyword`:return[NR];case`ObjectKeyword`:case`UndefinedKeyword`:case`VoidKeyword`:case`StringKeyword`:case`NumberKeyword`:case`BooleanKeyword`:case`BigIntKeyword`:case`SymbolKeyword`:r[e._tag]||(r[e._tag]=e,n.push(e));break;case`Literal`:{let t=typeof e.literal;switch(t){case`string`:case`number`:case`bigint`:case`boolean`:!r[Kae[t]]&&!i.includes(e.literal)&&(i.push(e.literal),n.push(e));break;case`object`:i.includes(e.literal)||(i.push(e.literal),n.push(e));break}break}case`UniqueSymbol`:!r.SymbolKeyword&&!i.includes(e.symbol)&&(i.push(e.symbol),n.push(e));break;case`TupleType`:r.ObjectKeyword||n.push(e);break;case`TypeLiteral`:e.propertySignatures.length===0&&e.indexSignatures.length===0?r[`{}`]||(r[`{}`]=e,n.push(e)):r.ObjectKeyword||n.push(e);break;default:n.push(e)}return n};var ZR=class e{types;annotations;static make=(t,n)=>QR(t)?new e(t,n):t.length===1?t[0]:MR;static unify=(t,n)=>e.make(qae(XR(t)),n);_tag=`Union`;constructor(e,t={}){this.types=e,this.annotations=t}toString(){return lc(Cz(this),()=>this.types.map(String).join(` | `))}toJSON(){return{_tag:this._tag,types:this.types.map(e=>e.toJSON()),annotations:yz(this.annotations)}}};const Jae=(e,t)=>e.map(t),QR=e=>e.length>1,$R=OR(`Union`);var ez=La(Symbol.for(`effect/Schema/AST/toJSONMemoMap`),()=>new WeakMap),tz=class{f;annotations;_tag=`Suspend`;constructor(e,t={}){this.f=e,this.annotations=t,this.f=GL(e)}toString(){return Cz(this).pipe(uc(()=>_c(mc(this.f)(),e=>Cz(e))),lc(()=>`<suspended schema>`))}toJSON(){let e=this.f(),t=ez.get(e);return t||(ez.set(e,{_tag:this._tag}),t={_tag:this._tag,ast:e.toJSON(),annotations:yz(this.annotations)},ez.set(e,t),t)}},nz=class{from;filter;annotations;_tag=`Refinement`;constructor(e,t,n={}){this.from=e,this.filter=t,this.annotations=n}toString(){return SR(this).pipe(lc(()=>cc(Sz(this),{onNone:()=>`{ ${this.from} | filter }`,onSome:e=>rz(this.from)?String(this.from)+` & `+e:e})))}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),annotations:yz(this.annotations)}}};const rz=OR(`Refinement`),iz={};var az=class{from;to;transformation;annotations;_tag=`Transformation`;constructor(e,t,n,r={}){this.from=e,this.to=t,this.transformation=n,this.annotations=r}toString(){return lc(Cz(this),()=>`(${String(this.from)} <-> ${String(this.to)})`)}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),to:this.to.toJSON(),annotations:yz(this.annotations)}}};const Yae=OR(`Transformation`);var oz=class{decode;encode;_tag=`FinalTransformation`;constructor(e,t){this.decode=e,this.encode=t}},Xae=e=>t=>t._tag===e;const Zae=new class{_tag=`ComposeTransformation`};var Qae=class{from;to;decode;encode;constructor(e,t,n,r){this.from=e,this.to=t,this.decode=n,this.encode=r}},sz=class{propertySignatureTransformations;_tag=`TypeLiteralTransformation`;constructor(e){this.propertySignatureTransformations=e;let t={},n={};for(let r of e){let e=r.from;if(t[e])throw Error(QL(e));t[e]=!0;let i=r.to;if(n[i])throw Error(QL(i));n[i]=!0}}};const cz=Xae(`TypeLiteralTransformation`),lz=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={...e.annotations};delete r[rR];let i={...r,...t},a=wR(e);return sc(a)&&(i[vR]=lz(a.value,t)),n.annotations.value=i,Object.create(Object.getPrototypeOf(e),n)};var $ae=`[\\s\\S]*?`,eoe=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`,uz=(e,t)=>{switch(e._tag){case`Literal`:return pb(String(e.literal));case`StringKeyword`:return $ae;case`NumberKeyword`:return eoe;case`TemplateLiteral`:return dz(e,t,!1);case`Union`:return e.types.map(e=>uz(e,t)).join(`|`)}},toe=(e,t,n,r)=>{if($R(e)){if(n&&!r)return`(?:${t})`}else if(!n||!r)return t;return`(${t})`},dz=(e,t,n)=>{let r=``;if(e.head!==``){let i=pb(e.head);r+=t&&n?`(${i})`:i}for(let i of e.spans){let e=uz(i.type,t);if(r+=toe(i.type,e,t,n),i.literal!==``){let e=pb(i.literal);r+=t&&n?`(${e})`:e}}return r};const noe=e=>RegExp(`^${dz(e,!1,!0)}$`),fz=(e,t)=>{let n=[],r=[],i=e=>{switch(e._tag){case`NeverKeyword`:break;case`StringKeyword`:case`SymbolKeyword`:case`TemplateLiteral`:case`Refinement`:r.push(new KR(e,t,!0));break;case`Literal`:if(Ra(e.literal)||za(e.literal))n.push(new WR(e.literal,t,!1,!0));else throw Error(yae(e.literal));break;case`Enums`:for(let[r,i]of e.enums)n.push(new WR(i,t,!1,!0));break;case`UniqueSymbol`:n.push(new WR(e.symbol,t,!1,!0));break;case`Union`:e.types.forEach(i);break;default:throw Error(vae(e))}};return i(e),{propertySignatures:n,indexSignatures:r}},pz=e=>t=>{let n;for(let r of e)Object.prototype.hasOwnProperty.call(t.annotations,r)&&(n===void 0&&(n={}),n[r]=t.annotations[r]);return n},roe=e=>t=>{let n={...t.annotations};for(let t of e)delete n[t];return n};var ioe=pz([sR,cR,lR,uR,dR,fR]);const mz=e=>{switch(e._tag){case`Declaration`:{let t=hz(e.typeParameters,mz);return t===e.typeParameters?e:new DR(t,e.decodeUnknown,e.encodeUnknown,e.annotations)}case`TupleType`:{let t=hz(e.elements,e=>{let t=mz(e.type);return t===e.type?e:new VR(t,e.isOptional)}),n=HR(e.rest),r=hz(n,mz);return t===e.elements&&r===n?e:new UR(t,r.map(e=>new BR(e)),e.isReadonly,e.annotations)}case`TypeLiteral`:{let t=hz(e.propertySignatures,e=>{let t=mz(e.type);return t===e.type?e:new WR(e.name,t,e.isOptional,e.isReadonly)}),n=hz(e.indexSignatures,e=>{let t=mz(e.type);return t===e.type?e:new KR(e.parameter,t,e.isReadonly)});return t===e.propertySignatures&&n===e.indexSignatures?e:new qR(t,n,e.annotations)}case`Union`:{let t=hz(e.types,mz);return t===e.types?e:ZR.make(t,e.annotations)}case`Suspend`:return new tz(()=>mz(e.f()),e.annotations);case`Refinement`:{let t=mz(e.from);return t===e.from?e:new nz(t,e.filter,e.annotations)}case`Transformation`:{let t=ioe(e);return mz(t===void 0?e.to:lz(e.to,t))}}return e};function hz(e,t){let n=!1,r=Tc(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}const gz=e=>{switch(e._tag){case`Transformation`:return e.from;case`Refinement`:return gz(e.from);case`Suspend`:return gz(e.f())}};var _z=(e,t)=>{switch(e._tag){case`Declaration`:{let n=hz(e.typeParameters,e=>_z(e,t));return n===e.typeParameters?e:new DR(n,e.decodeUnknown,e.encodeUnknown)}case`TupleType`:{let n=hz(e.elements,e=>{let n=_z(e.type,t);return n===e.type?e:new VR(n,e.isOptional)}),r=HR(e.rest),i=hz(r,e=>_z(e,t));return n===e.elements&&i===r?e:new UR(n,i.map(e=>new BR(e)),e.isReadonly)}case`TypeLiteral`:{let n=hz(e.propertySignatures,e=>{let n=_z(e.type,t);return n===e.type?e:new WR(e.name,n,e.isOptional,e.isReadonly)}),r=hz(e.indexSignatures,e=>{let n=_z(e.type,t);return n===e.type?e:new KR(e.parameter,n,e.isReadonly)});return n===e.propertySignatures&&r===e.indexSignatures?e:new qR(n,r)}case`Union`:{let n=hz(e.types,e=>_z(e,t));return n===e.types?e:ZR.make(n)}case`Suspend`:{let n,r=Lae(e);if(sc(r)){let e=t?`Bound`:``;n={[ER]:`${r.value}Encoded${e}`}}return new tz(()=>_z(e.f(),t),n)}case`Refinement`:{let n=_z(e.from,t);return t?n===e.from?e:gz(e.from)===void 0&&TR(e)?new nz(n,e.filter,e.annotations):n:n}case`Transformation`:return _z(e.from,t)}return e};const vz=e=>_z(e,!1);var yz=e=>{let t={};for(let n of Object.getOwnPropertySymbols(e))t[String(n)]=e[n];return t};const bz=e=>{switch(e._tag){case`StringKeyword`:case`SymbolKeyword`:case`TemplateLiteral`:return e;case`Refinement`:return bz(e.from)}};var xz=e=>lc(Cz(e),()=>e._tag);function aoe(e){return cc(Dae(e),{onNone:()=>``,onSome:e=>e.map(e=>` & Brand<${Bo(e)}>`).join(``)})}var Sz=e=>bR(e).pipe(uc(()=>CR(e)),uc(()=>xR(e)),gc(t=>t+aoe(e))),Cz=e=>uc(SR(e),()=>Sz(e)),wz=class{path;actual;issue;_tag=`Pointer`;constructor(e,t,n){this.path=e,this.actual=t,this.issue=n}},Tz=class{actual;message;_tag=`Unexpected`;constructor(e,t){this.actual=e,this.message=t}},Ez=class{ast;message;_tag=`Missing`;actual=void 0;constructor(e,t){this.ast=e,this.message=t}},Dz=class{ast;actual;issues;output;_tag=`Composite`;constructor(e,t,n,r){this.ast=e,this.actual=t,this.issues=n,this.output=r}},Oz=class{ast;actual;kind;issue;_tag=`Refinement`;constructor(e,t,n,r){this.ast=e,this.actual=t,this.kind=n,this.issue=r}},kz=class{ast;actual;kind;issue;_tag=`Transformation`;constructor(e,t,n,r){this.ast=e,this.actual=t,this.kind=n,this.issue=r}},Az=class{ast;actual;message;_tag=`Type`;constructor(e,t,n){this.ast=e,this.actual=t,this.message=n}},jz=class{ast;actual;message;_tag=`Forbidden`;constructor(e,t,n){this.ast=e,this.actual=t,this.message=n}};const Mz=Symbol.for(`effect/Schema/ParseErrorTypeId`),ooe=e=>M(e,Mz);var soe=class extends sk(`ParseError`){[Mz]=Mz;get message(){return this.toString()}toString(){return rB.formatIssueSync(this.issue)}toJSON(){return{_id:`ParseError`,message:this.toString()}}[Po](){return this.toJSON()}};const Nz=e=>new soe({issue:e}),Pz=Us,Fz=R;var coe=Ws,Iz=Gs;const Lz=A(2,(e,t)=>Iz(e)?Zs(e,{onLeft:R,onRight:t}):G(e,t)),Rz=A(2,(e,t)=>Iz(e)?Xs(e,t):nj(e,t)),zz=A(2,(e,t)=>Iz(e)?Ys(e,t):ij(e,t)),loe=A(2,(e,t)=>Iz(e)?Js(e,{onLeft:t.onFailure,onRight:t.onSuccess}):rj(e,t)),Bz=A(2,(e,t)=>Iz(e)?Zs(e,{onLeft:t,onRight:Us}):UA(e,t)),Vz=(e,t)=>t===void 0||za(t)?e:e===void 0?t:{...e,...t};var uoe=(e,t,n)=>{let r=Jz(e,t);return(e,t)=>r(e,Vz(n,t))},Hz=(e,t,n)=>{let r=uoe(e,t,n);return(e,t)=>$s(r(e,t),Nz)},Uz=(e,t,n)=>{let r=Jz(e,t);return(e,t)=>r(e,{...Vz(n,t),isEffectAllowed:!0})};const Wz=(e,t)=>Hz(e.ast,!0,t),Gz=(e,t)=>Uz(e.ast,!0,t),Kz=(e,t)=>Uz(e.ast,!1,t),doe=Wz,qz=(e,t)=>Hz(mz(e.ast),!0,t),foe=(e,t)=>{let n=Jz(mz(e.ast),!0);return(e,r)=>qs(n(e,{exact:!0,...Vz(t,r)}))};var poe=La(Symbol.for(`effect/ParseResult/decodeMemoMap`),()=>new WeakMap),moe=La(Symbol.for(`effect/ParseResult/encodeMemoMap`),()=>new WeakMap),Jz=(e,t)=>{let n=t?poe:moe,r=n.get(e);if(r)return r;let i=hoe(e,t),a=Nae(e),o=sc(a)?(e,t)=>i(e,Vz(t,a.value)):i,s=Pae(e),c=t&&sc(s)?(t,n)=>eB(Bz(o(t,n),s.value),e,t,n):o;return n.set(e,c),c},Yz=e=>pc(Aae(e)),Xz=e=>pc(jae(e)),hoe=(e,t)=>{switch(e._tag){case`Refinement`:if(t){let t=Jz(e.from,!0);return(n,r)=>{r??=iz;let i=r?.errors===`all`;return eB(Lz(Bz(t(n,r),t=>{let a=new Oz(e,n,`From`,t);return i&&TR(e)&&cB(t)?cc(e.filter(n,r,e),{onNone:()=>R(a),onSome:t=>R(new Dz(e,n,[a,new Oz(e,n,`Predicate`,t)]))}):R(a)}),t=>cc(e.filter(t,r,e),{onNone:()=>Us(t),onSome:t=>R(new Oz(e,n,`Predicate`,t))})),e,n,r)}}else{let t=Jz(mz(e),!0),n=Jz($z(e.from),!1);return(r,i)=>eB(Lz(t(r,i),e=>n(e,i)),e,r,i)}case`Transformation`:{let n=voe(e.transformation,t),r=t?Jz(e.from,!0):Jz(e.to,!1),i=t?Jz(e.to,!0):Jz(e.from,!1);return(a,o)=>eB(Lz(zz(r(a,o),n=>new kz(e,a,t?`Encoded`:`Type`,n)),r=>Lz(zz(n(r,o??iz,e,a),t=>new kz(e,a,`Transformation`,t)),n=>zz(i(n,o),n=>new kz(e,a,t?`Type`:`Encoded`,n)))),e,a,o)}case`Declaration`:{let n=t?e.decodeUnknown(...e.typeParameters):e.encodeUnknown(...e.typeParameters);return(t,r)=>eB(n(t,r??iz,e),e,t,r)}case`Literal`:return Zz(e,t=>t===e.literal);case`UniqueSymbol`:return Zz(e,t=>t===e.symbol);case`UndefinedKeyword`:return Zz(e,Wa);case`NeverKeyword`:return Zz(e,Ga);case`UnknownKeyword`:case`AnyKeyword`:case`VoidKeyword`:return Us;case`StringKeyword`:return Zz(e,Ra);case`NumberKeyword`:return Zz(e,za);case`BooleanKeyword`:return Zz(e,Ba);case`BigIntKeyword`:return Zz(e,Va);case`SymbolKeyword`:return Zz(e,Ha);case`ObjectKeyword`:return Zz(e,qa);case`Enums`:return Zz(e,t=>e.enums.some(([e,n])=>n===t));case`TemplateLiteral`:{let t=noe(e);return Zz(e,e=>Ra(e)&&t.test(e))}case`TupleType`:{let n=e.elements.map(e=>Jz(e.type,t)),r=e.rest.map(e=>Jz(e.type,t)),i=e.elements.filter(e=>!e.isOptional);e.rest.length>0&&(i=i.concat(e.rest.slice(1)));let a=i.length,o=e.elements.length>0?e.elements.map((e,t)=>t).join(` | `):`never`,s=Yz(e),c=Xz(e);return(t,l)=>{if(!Nc(t))return R(new Az(e,t));let u=l?.errors===`all`,d=[],f=0,p=[],m=t.length;for(let n=m;n<=a-1;n++){let r=new wz(n,t,new Ez(i[n-m]));if(u){d.push([f++,r]);continue}else return R(new Dz(e,t,r,p))}if(e.rest.length===0)for(let n=e.elements.length;n<=m-1;n++){let r=new wz(n,t,new Tz(t[n],`is unexpected, expected: ${o}`));if(u){d.push([f++,r]);continue}else return R(new Dz(e,t,r,p))}let h=0,g;for(;h<n.length;h++)if(m<h+1){if(e.elements[h].isOptional)continue}else{let r=n[h],i=r(t[h],l);if(Iz(i)){if(Ks(i)){let n=new wz(h,t,i.left);if(u){d.push([f++,n]);continue}else return R(new Dz(e,t,n,tB(p)))}p.push([f++,i.right])}else{let n=f++,r=h;g||=[],g.push(({es:a,output:o})=>G(Cj(i),i=>{if(Ks(i)){let s=new wz(r,t,i.left);return u?(a.push([n,s]),HA):R(new Dz(e,t,s,tB(o)))}return o.push([n,i.right]),HA}))}}if(Ic(r)){let[n,...i]=r;for(;h<m-i.length;h++){let r=n(t[h],l);if(Iz(r))if(Ks(r)){let n=new wz(h,t,r.left);if(u){d.push([f++,n]);continue}else return R(new Dz(e,t,n,tB(p)))}else p.push([f++,r.right]);else{let n=f++,i=h;g||=[],g.push(({es:a,output:o})=>G(Cj(r),r=>{if(Ks(r)){let s=new wz(i,t,r.left);return u?(a.push([n,s]),HA):R(new Dz(e,t,s,tB(o)))}else return o.push([n,r.right]),HA}))}}for(let n=0;n<i.length;n++)if(h+=n,!(m<h+1)){let r=i[n](t[h],l);if(Iz(r)){if(Ks(r)){let n=new wz(h,t,r.left);if(u){d.push([f++,n]);continue}else return R(new Dz(e,t,n,tB(p)))}p.push([f++,r.right])}else{let n=f++,i=h;g||=[],g.push(({es:a,output:o})=>G(Cj(r),r=>{if(Ks(r)){let s=new wz(i,t,r.left);return u?(a.push([n,s]),HA):R(new Dz(e,t,s,tB(o)))}return o.push([n,r.right]),HA}))}}}let _=({es:n,output:r})=>Fc(n)?R(new Dz(e,t,tB(n),tB(r))):Us(tB(r));if(g&&g.length>0){let e=g;return BA(()=>{let t={es:nl(d),output:nl(p)};return G(kA(e,e=>e(t),{concurrency:s,batching:c,discard:!0}),()=>_(t))})}return _({output:p,es:d})}}case`TypeLiteral`:{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return Zz(e,Xa);let n=[],r={},i=[];for(let a of e.propertySignatures)n.push([Jz(a.type,t),a]),r[a.name]=null,i.push(a.name);let a=e.indexSignatures.map(e=>[Jz(e.parameter,t),Jz(e.type,t),e.parameter]),o=ZR.make(e.indexSignatures.map(e=>e.parameter).concat(i.map(e=>Ha(e)?new zae(e):new kR(e)))),s=Jz(o,t),c=Yz(e),l=Xz(e);return(t,u)=>{if(!eo(t))return R(new Az(e,t));let d=u?.errors===`all`,f=[],p=0,m=u?.onExcessProperty===`error`,h=u?.onExcessProperty===`preserve`,g={},_;if(m||h){_=Reflect.ownKeys(t);for(let n of _){let r=s(n,u);if(Iz(r)&&Ks(r))if(m){let r=new wz(n,t,new Tz(t[n],`is unexpected, expected: ${String(o)}`));if(d){f.push([p++,r]);continue}else return R(new Dz(e,t,r,g))}else g[n]=t[n]}}let v,y=u?.exact===!0;for(let r=0;r<n.length;r++){let i=n[r][1],a=i.name,o=Object.prototype.hasOwnProperty.call(t,a);if(!o){if(i.isOptional)continue;if(y){let n=new wz(a,t,new Ez(i));if(d){f.push([p++,n]);continue}else return R(new Dz(e,t,n,g))}}let s=n[r][0],c=s(t[a],u);if(Iz(c)){if(Ks(c)){let n=new wz(a,t,o?c.left:new Ez(i));if(d){f.push([p++,n]);continue}else return R(new Dz(e,t,n,g))}g[a]=c.right}else{let n=p++,r=a;v||=[],v.push(({es:a,output:s})=>G(Cj(c),c=>{if(Ks(c)){let l=new wz(r,t,o?c.left:new Ez(i));return d?(a.push([n,l]),HA):R(new Dz(e,t,l,s))}return s[r]=c.right,HA}))}}for(let n=0;n<a.length;n++){let i=a[n],o=i[0],s=i[1],c=WL(t,i[2]);for(let n of c){let i=o(n,u);if(Iz(i)&&qs(i)){let i=s(t[n],u);if(Iz(i))if(Ks(i)){let r=new wz(n,t,i.left);if(d){f.push([p++,r]);continue}else return R(new Dz(e,t,r,g))}else Object.prototype.hasOwnProperty.call(r,n)||(g[n]=i.right);else{let a=p++,o=n;v||=[],v.push(({es:s,output:c})=>G(Cj(i),i=>{if(Ks(i)){let n=new wz(o,t,i.left);return d?(s.push([a,n]),HA):R(new Dz(e,t,n,c))}else return Object.prototype.hasOwnProperty.call(r,n)||(c[n]=i.right),HA}))}}}}let b=({es:n,output:r})=>{if(Fc(n))return R(new Dz(e,t,tB(n),r));if(u?.propertyOrder===`original`){let e=_||Reflect.ownKeys(t);for(let t of i)e.indexOf(t)===-1&&e.push(t);let n={};for(let t of e)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t]);return Us(n)}return Us(r)};if(v&&v.length>0){let e=v;return BA(()=>{let t={es:nl(f),output:Object.assign({},g)};return G(kA(e,e=>e(t),{concurrency:c,batching:l,discard:!0}),()=>b(t))})}return b({es:f,output:g})}}case`Union`:{let n=goe(e.types,t),r=Reflect.ownKeys(n.keys),i=r.length,a=e.types.length,o=new Map;for(let n=0;n<a;n++)o.set(e.types[n],Jz(e.types[n],t));let s=Yz(e)??1,c=Xz(e);return(t,l)=>{let u=[],d=0,f=[];if(i>0)if(Ka(t))for(let e=0;e<i;e++){let i=r[e],o=n.keys[i].buckets;if(Object.prototype.hasOwnProperty.call(t,i)){let e=String(t[i]);if(Object.prototype.hasOwnProperty.call(o,e))f=f.concat(o[e]);else{let{candidates:e,literals:r}=n.keys[i],o=ZR.make(r),s=e.length===a?new qR([new WR(i,o,!1,!0)],[]):ZR.make(e);u.push([d++,new Dz(s,t,new wz(i,t,new Az(o,t[i])))])}}else{let{candidates:e,literals:r}=n.keys[i],o=new WR(i,ZR.make(r),!1,!0),s=e.length===a?new qR([o],[]):ZR.make(e);u.push([d++,new Dz(s,t,new wz(i,t,new Ez(o)))])}}else{let r=n.candidates.length===a?e:ZR.make(n.candidates);u.push([d++,new Az(r,t)])}n.otherwise.length>0&&(f=f.concat(n.otherwise));let p;for(let e=0;e<f.length;e++){let n=f[e],r=o.get(n)(t,l);if(Iz(r)&&(!p||p.length===0)){if(qs(r))return r;u.push([d++,r.left])}else{let e=d++;p||=[],p.push(t=>BA(()=>`finalResult`in t?HA:G(Cj(r),n=>(qs(n)?t.finalResult=n:t.es.push([e,n.left]),HA))))}}let m=n=>Fc(n)?n.length===1&&n[0][1]._tag===`Type`?R(n[0][1]):R(new Dz(e,t,tB(n))):R(new Az(e,t));if(p&&p.length>0){let e=p;return BA(()=>{let t={es:nl(u)};return G(kA(e,e=>e(t),{concurrency:s,batching:c,discard:!0}),()=>`finalResult`in t?t.finalResult:m(t.es))})}return m(u)}}case`Suspend`:{let n=GL(()=>Jz(e.f(),t));return(e,t)=>n()(e,t)}}},Zz=(e,t)=>n=>t(n)?Us(n):R(new Az(e,n));const Qz=(e,t)=>{switch(e._tag){case`Declaration`:{let n=wR(e);if(sc(n))return Qz(n.value,t);break}case`TypeLiteral`:{let n=[];for(let r=0;r<e.propertySignatures.length;r++){let i=e.propertySignatures[r],a=t?vz(i.type):mz(i.type);AR(a)&&!i.isOptional&&n.push([i.name,a])}return n}case`TupleType`:{let n=[];for(let r=0;r<e.elements.length;r++){let i=e.elements[r],a=t?vz(i.type):mz(i.type);AR(a)&&!i.isOptional&&n.push([r,a])}return n}case`Refinement`:return Qz(e.from,t);case`Suspend`:return Qz(e.f(),t);case`Transformation`:return Qz(t?e.from:e.to,t)}return[]},goe=(e,t)=>{let n={},r=[],i=[];for(let a=0;a<e.length;a++){let o=e[a],s=Qz(o,t);if(s.length>0){i.push(o);for(let e=0;e<s.length;e++){let[t,r]=s[e],i=String(r.literal);n[t]=n[t]||{buckets:{},literals:[],candidates:[]};let a=n[t].buckets;if(Object.prototype.hasOwnProperty.call(a,i)){if(e<s.length-1)continue;a[i].push(o),n[t].literals.push(r),n[t].candidates.push(o)}else{a[i]=[o],n[t].literals.push(r),n[t].candidates.push(o);break}}}else r.push(o)}return{keys:n,otherwise:r,candidates:i}};var $z=e=>rz(e)?$z(e.from):e,eB=(e,t,n,r)=>{if(r?.isEffectAllowed===!0||Iz(e))return e;let i=new iC,a=Qre(e,{scheduler:i});i.flush();let o=a.unsafePoll();if(o){if(lw(o))return Us(o.value);let e=o.cause;return Uy(e)?R(e.error):R(new jz(t,n,Qy(e)))}return R(new jz(t,n,`cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work`))},_oe=([e],[t])=>e>t?1:e<t?-1:0;function tB(e){return e.sort(_oe).map(e=>e[1])}const voe=(e,t)=>{switch(e._tag){case`FinalTransformation`:return t?e.decode:e.encode;case`ComposeTransformation`:return Us;case`TypeLiteralTransformation`:return n=>{let r=Us(n);for(let n of e.propertySignatureTransformations){let[e,i]=t?[n.from,n.to]:[n.to,n.from],a=t?n.decode:n.encode;r=Rz(r,t=>{let n=a(Object.prototype.hasOwnProperty.call(t,e)?B(t[e]):z());return delete t[e],sc(n)&&(t[i]=n.value),t})}return r}}};var nB=(e,t=[])=>({value:e,forest:t});const rB={formatIssue:e=>Rz(mB(e),yoe),formatIssueSync:e=>{let t=rB.formatIssue(e);return Iz(t)?ec(t):Ij(t)},formatError:e=>rB.formatIssue(e.issue),formatErrorSync:e=>rB.formatIssueSync(e.issue)};var yoe=e=>e.value+iB(`
|
|
27
|
+
`,e.forest),iB=(e,t)=>{let n=``,r=t.length,i;for(let a=0;a<r;a++){i=t[a];let o=a===r-1;n+=e+(o?`└`:`├`)+`─ `+i.value,n+=iB(e+(r>1&&!o?`│ `:` `),i.forest)}return n},boe=e=>{switch(e){case`Encoded`:return`Encoded side transformation failure`;case`Transformation`:return`Transformation process failure`;case`Type`:return`Type side transformation failure`}},xoe=e=>{switch(e){case`From`:return`From side refinement failure`;case`Predicate`:return`Predicate refinement failure`}},aB=e=>`ast`in e?B(e.ast):z(),oB=Us(void 0),Soe=e=>aB(e).pipe(_c(Oae),cc({onNone:()=>oB,onSome:t=>{let n=t(e);return Ra(n)?Us({message:n,override:!1}):CA(n)?nj(n,e=>({message:e,override:!1})):Ra(n.message)?Us({message:n.message,override:n.override}):nj(n.message,e=>({message:e,override:n.override}))}})),sB=e=>t=>t._tag===e;const cB=sB(`Composite`);var lB=sB(`Refinement`),uB=sB(`Transformation`),dB=e=>Lz(Soe(e),t=>t===void 0?oB:!t.override&&(cB(e)||lB(e)&&e.kind===`From`||uB(e)&&e.kind!==`Transformation`)?uB(e)||lB(e)?dB(e.issue):oB:Us(t.message)),fB=e=>aB(e).pipe(_c(Mae),vc(t=>t(e)),pc);function Coe(e){return CR(e).pipe(uc(()=>bR(e)),uc(()=>xR(e)),uc(()=>SR(e)),lc(()=>`{ ${e.from} | filter }`))}function woe(e){return e.message===void 0?`Expected ${rz(e.ast)?Coe(e.ast):String(e.ast)}, actual ${Bo(e.actual)}`:e.message}var Toe=e=>Rz(dB(e),t=>t??fB(e)??woe(e)),pB=e=>fB(e)??String(e.ast),Eoe=e=>e.message??`is forbidden`,Doe=e=>e.message??`is unexpected`,Ooe=e=>{let t=kae(e.ast);if(sc(t)){let e=t.value();return Ra(e)?Us(e):e}return Us(e.message??`is missing`)},mB=e=>{switch(e._tag){case`Type`:return Rz(Toe(e),nB);case`Forbidden`:return Us(nB(pB(e),[nB(Eoe(e))]));case`Unexpected`:return Us(nB(Doe(e)));case`Missing`:return Rz(Ooe(e),nB);case`Transformation`:return Lz(dB(e),t=>t===void 0?Rz(mB(e.issue),t=>nB(pB(e),[nB(boe(e.kind),[t])])):Us(nB(t)));case`Refinement`:return Lz(dB(e),t=>t===void 0?Rz(mB(e.issue),t=>nB(pB(e),[nB(xoe(e.kind),[t])])):Us(nB(t)));case`Pointer`:return Rz(mB(e.issue),t=>nB(JL(e.path),[t]));case`Composite`:return Lz(dB(e),t=>{if(t!==void 0)return Us(nB(t));let n=pB(e);return KL(e.issues)?Rz(kA(e.issues,mB),e=>nB(n,e)):Rz(mB(e.issues),e=>nB(n,[e]))})}};const hB=uae,koe=A(e=>qa(e[0]),(e,...t)=>{let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}),Aoe=A(e=>qa(e[0]),(e,...t)=>{let n={...e};for(let e of t)delete n[e];return n}),gB=Symbol.for(`effect/Schema`);function _B(e){return class{[gB]=vB;static ast=e;static annotations(e){return _B(xB(this.ast,e))}static pipe(){return L(this,arguments)}static toString(){return String(e)}static Type;static Encoded;static Context;static[gB]=vB}}var vB={_A:e=>e,_I:e=>e,_R:e=>e},yB={typeConstructor:Cae,schemaId:eR,message:tR,missingMessage:nR,identifier:rR,title:iR,description:oR,examples:sR,default:cR,documentation:Tae,jsonSchema:lR,arbitrary:uR,pretty:dR,equivalence:fR,concurrency:pR,batching:mR,parseIssueTitle:hR,parseOptions:gR,decodingFallback:_R},bB=e=>{if(!e)return{};let t={...e};for(let n in yB)if(n in e){let r=yB[n];t[r]=e[n],delete t[n]}return t},xB=(e,t)=>lz(e,bB(t));function SB(e){return e}const CB=e=>String(e.ast),joe=e=>_B(vz(e.ast)),wB=e=>_B(mz(e.ast)),TB=(e,t)=>{let n=Kz(e,t);return(e,t)=>zz(n(e,t),Nz)},EB=(e,t)=>{let n=Gz(e,t);return(e,t)=>zz(n(e,t),Nz)},DB=EB,OB=e=>M(e,gB)&&qa(e[gB]);function kB(e){return QR(e)?ZR.make(Jae(e,e=>new kR(e))):new kR(e[0])}function AB(e,t=kB(e)){return class extends _B(t){static annotations(e){return AB(this.literals,xB(this.ast,e))}static literals=[...e]}}function jB(...e){return Ic(e)?AB(e):zB}var MB=(e,t,n)=>PB(e,new DR(e.map(e=>e.ast),(...e)=>t.decode(...e.map(_B)),(...e)=>t.encode(...e.map(_B)),bB(n))),NB=(e,t)=>{let n=()=>(t,n,r)=>e(t)?Pz(t):Fz(new Az(r,t));return PB([],new DR([],n,n,bB(t)))};function PB(e,t){return class extends _B(t){static annotations(e){return PB(this.typeParameters,xB(this.ast,e))}static typeParameters=[...e]}}const FB=function(){if(Array.isArray(arguments[0])){let e=arguments[0],t=arguments[1],n=arguments[2];return MB(e,t,n)}let e=arguments[0],t=arguments[1];return NB(e,t)};var IB=class extends _B(jR){},LB=class extends _B(Bae){},RB=class extends _B(Rae){},zB=class extends _B(MR){},BB=class extends _B(NR){},K=class extends _B(PR){},VB=class extends _B(IR){},HB=class extends _B(RR){},UB=e=>ZR.make(e.map(e=>e.ast));function WB(e,t=UB(e)){return class extends _B(t){static annotations(e){return WB(this.members,xB(this.ast,e))}static members=[...e]}}function GB(...e){return QR(e)?WB(e):Ic(e)?e[0]:zB}const KB=e=>GB(e,RB),qB=e=>GB(e,IB);var JB=(e,t)=>new UR(e.map(e=>OB(e)?new VR(e.ast,!1):e.ast),t.map(e=>OB(e)?new BR(e.ast):e.ast),!0);function YB(e,t,n=JB(e,t)){return class extends _B(n){static annotations(e){return YB(this.elements,this.rest,xB(this.ast,e))}static elements=[...e];static rest=[...t]}}function XB(e,t){return class extends YB([],[e],t){static annotations(e){return XB(this.value,xB(this.ast,e))}static value=e}}var ZB=e=>XB(e);function QB(e,t){return class extends YB([e],[e],t){static annotations(e){return QB(this.value,xB(this.ast,e))}static value=e}}const $B=e=>QB(e);var eV=e=>e?`"?:"`:`":"`,tV=class extends VR{isReadonly;defaultValue;_tag=`PropertySignatureDeclaration`;constructor(e,t,n,r,i){super(e,t,r),this.isReadonly=n,this.defaultValue=i}toString(){let e=eV(this.isOptional),t=String(this.type);return`PropertySignature<${e}, ${t}, never, ${e}, ${t}>`}},nV=class extends VR{isReadonly;defaultValue;constructor(e,t,n,r,i){super(e,t,r),this.isReadonly=n,this.defaultValue=i}},rV=e=>e===void 0?`never`:Ra(e)?JSON.stringify(e):String(e),iV=class{from;to;decode;encode;_tag=`PropertySignatureTransformation`;constructor(e,t,n,r){this.from=e,this.to=t,this.decode=n,this.encode=r}toString(){return`PropertySignature<${eV(this.to.isOptional)}, ${this.to.type}, ${rV(this.from.fromKey)}, ${eV(this.from.isOptional)}, ${this.from.type}>`}},aV=(e,t)=>{switch(e._tag){case`PropertySignatureDeclaration`:return new tV(e.type,e.isOptional,e.isReadonly,{...e.annotations,...t},e.defaultValue);case`PropertySignatureTransformation`:return new iV(e.from,new nV(e.to.type,e.to.isOptional,e.to.isReadonly,{...e.to.annotations,...t},e.to.defaultValue),e.decode,e.encode)}};const oV=Symbol.for(`effect/PropertySignature`),sV=e=>M(e,oV);var cV=class e{ast;[gB];[oV]=null;_TypeToken;_Key;_EncodedToken;_HasDefault;constructor(e){this.ast=e}pipe(){return L(this,arguments)}annotations(t){return new e(aV(this.ast,bB(t)))}toString(){return String(this.ast)}};const lV=e=>new cV(e);var uV=class e extends cV{from;constructor(e,t){super(e),this.from=t}annotations(t){return new e(aV(this.ast,bB(t)),this.from)}};const dV=e=>new uV(new tV(e.ast,!1,!0,{},void 0),e),fV=A(2,(e,t)=>{let n=e.ast;switch(n._tag){case`PropertySignatureDeclaration`:return lV(new tV(n.type,n.isOptional,n.isReadonly,n.annotations,t));case`PropertySignatureTransformation`:return lV(new iV(n.from,new nV(n.to.type,n.to.isOptional,n.to.isReadonly,n.to.annotations,t),n.decode,n.encode))}}),pV=e=>new uV(new tV(e.ast===jR||e.ast===MR?jR:qB(e).ast,!0,!0,{},void 0),e);var mV=pz([nR]),hV=(e,t)=>{let n=Reflect.ownKeys(e),r=[];if(n.length>0){let i=[],a=[],o=[];for(let t=0;t<n.length;t++){let s=n[t],c=e[s];if(sV(c)){let e=c.ast;switch(e._tag){case`PropertySignatureDeclaration`:{let t=e.type,n=e.isOptional,o=e.annotations;i.push(new WR(s,t,n,!0,mV(e))),a.push(new WR(s,mz(t),n,!0,o)),r.push(new WR(s,t,n,!0,o));break}case`PropertySignatureTransformation`:{let t=e.from.fromKey??s;i.push(new WR(t,e.from.type,e.from.isOptional,!0,e.from.annotations)),a.push(new WR(s,e.to.type,e.to.isOptional,!0,e.to.annotations)),o.push(new Qae(t,s,e.decode,e.encode));break}}}else i.push(new WR(s,c.ast,!1,!0)),a.push(new WR(s,mz(c.ast),!1,!0)),r.push(new WR(s,c.ast,!1,!0))}if(Ic(o)){let e=[],n=[];for(let r of t){let{indexSignatures:t,propertySignatures:o}=fz(r.key.ast,r.value.ast);o.forEach(e=>{i.push(e),a.push(new WR(e.name,mz(e.type),e.isOptional,e.isReadonly,e.annotations))}),t.forEach(t=>{e.push(t),n.push(new KR(t.parameter,mz(t.type),t.isReadonly))})}return new az(new qR(i,e,{[aR]:`Struct (Encoded side)`}),new qR(a,n,{[aR]:`Struct (Type side)`}),new sz(o))}}let i=[];for(let e of t){let{indexSignatures:t,propertySignatures:n}=fz(e.key.ast,e.value.ast);n.forEach(e=>r.push(e)),t.forEach(e=>i.push(e))}return new qR(r,i)},gV=(e,t)=>{let n=Reflect.ownKeys(e);for(let r of n){let n=e[r];if(t[r]===void 0&&sV(n)){let e=n.ast,i=e._tag===`PropertySignatureDeclaration`?e.defaultValue:e.to.defaultValue;i!==void 0&&(t[r]=i())}}return t};function _V(e,t,n=hV(e,t)){return class extends _B(n){static annotations(e){return _V(this.fields,this.records,xB(this.ast,e))}static fields={...e};static records=[...t];static make=(t,n)=>{let r=gV(e,{...t});return nH(n)?r:qz(this)(r)};static pick(...t){return vV(koe(e,...t))}static omit(...t){return vV(Aoe(e,...t))}}}function vV(e,...t){return _V(e,t)}function yV(e,t,n){return class extends _V({},[{key:e,value:t}],n){static annotations(n){return yV(e,t,xB(this.ast,n))}static key=e;static value=t}}var bV=(e,t,n)=>{if(YR(e)&&YR(t)){let r=[...e.propertySignatures];for(let e of t.propertySignatures){let t=e.name,i=r.findIndex(e=>e.name===t);if(i===-1)r.push(e);else{let{isOptional:a,type:o}=r[i];r[i]=new WR(t,CV(o,e.type,n.concat(t)),a,!0)}}return new qR(r,e.indexSignatures.concat(t.indexSignatures))}throw Error(XL(e,t,n))},xV=roe([rR]),SV=(e,t)=>t.map(t=>new nz(t,e.filter,xV(e))),CV=(e,t,n)=>ZR.make(TV([e],[t],n)),wV=e=>$R(e)?e.types:[e],TV=(e,t,n)=>cl(e,e=>cl(t,t=>{switch(t._tag){case`Literal`:if(Ra(t.literal)&&FR(e)||za(t.literal)&&LR(e)||Ba(t.literal)&&zR(e))return[t];break;case`StringKeyword`:if(t===PR){if(FR(e)||AR(e)&&Ra(e.literal))return[e];if(rz(e))return SV(e,TV(wV(e.from),[t],n))}else if(e===PR)return[t];break;case`NumberKeyword`:if(t===IR){if(LR(e)||AR(e)&&za(e.literal))return[e];if(rz(e))return SV(e,TV(wV(e.from),[t],n))}else if(e===IR)return[t];break;case`BooleanKeyword`:if(t===RR){if(zR(e)||AR(e)&&Ba(e.literal))return[e];if(rz(e))return SV(e,TV(wV(e.from),[t],n))}else if(e===RR)return[t];break;case`Union`:return TV(wV(e),t.types,n);case`Suspend`:return[new tz(()=>CV(e,t.f(),n))];case`Refinement`:return SV(t,TV(wV(e),wV(t.from),n));case`TypeLiteral`:switch(e._tag){case`Union`:return TV(e.types,[t],n);case`Suspend`:return[new tz(()=>CV(e.f(),t,n))];case`Refinement`:return SV(e,TV(wV(e.from),[t],n));case`TypeLiteral`:return[bV(e,t,n)];case`Transformation`:{let r=e.transformation,i=bV(e.from,t,n),a=bV(e.to,mz(t),n);switch(r._tag){case`TypeLiteralTransformation`:return[new az(i,a,new sz(r.propertySignatureTransformations))];case`ComposeTransformation`:return[new az(i,a,Zae)];case`FinalTransformation`:return[new az(i,a,new oz((e,t,n,i)=>Rz(r.decode(e,t,n,i),t=>({...e,...t})),(e,t,n,i)=>Rz(r.encode(e,t,n,i),t=>({...e,...t}))))]}}}break;case`Transformation`:if(Yae(e)){if(cz(t.transformation)&&cz(e.transformation))return[new az(bV(e.from,t.from,n),bV(e.to,t.to,n),new sz(t.transformation.propertySignatureTransformations.concat(e.transformation.propertySignatureTransformations)))]}else return TV([t],[e],n);break}throw Error(XL(e,t,n))}));const EV=A(2,(e,t)=>_B(CV(e.ast,t.ast,[]))),DV=e=>_B(new tz(()=>e().ast)),OV=Symbol.for(`effect/SchemaId/Refine`);function kV(e,t,n){return class extends _B(n){static annotations(e){return kV(this.from,this.filter,xB(this.ast,e))}static[OV]=e;static from=e;static filter=t;static make=(e,t)=>nH(t)?e:qz(this)(e)}}var AV=(e,t,n)=>{if(Ba(e))return e?z():B(new Az(t,n));if(Ra(e))return B(new Az(t,n,e));if(e!==void 0){if(`_tag`in e)return B(e);let r=new Az(t,n,e.message);return B(Ic(e.path)?new wz(e.path,n,r):r)}return z()},jV=(e,t,n)=>{if(_ae(e))return AV(e,t,n);if(Ic(e)){let r=ul(e,e=>AV(e,t,n));if(Ic(r))return B(r.length===1?r[0]:new Dz(t,n,r))}return z()};function MV(e,t){return n=>{function r(t,n,r){return jV(e(t,n,r),r,t)}return kV(n,r,new nz(n.ast,r,bB(t)))}}function NV(e,t,n){return class extends _B(n){static annotations(e){return NV(this.from,this.to,xB(this.ast,e))}static from=e;static to=t}}const PV=A(e=>OB(e[0])&&OB(e[1]),(e,t,n)=>NV(e,t,new az(e.ast,t.ast,new oz(n.decode,n.encode)))),FV=A(e=>OB(e[0])&&OB(e[1]),(e,t,n)=>PV(e,t,{strict:!0,decode:(e,t,r,i)=>Pz(n.decode(e,i)),encode:(e,t,r,i)=>Pz(n.encode(e,i))})),IV=Sae,LV=e=>t=>t.pipe(MV(e=>Number.isSafeInteger(e),{schemaId:IV,title:`int`,description:`an integer`,jsonSchema:{type:`integer`},...e}));var RV=class extends VB.pipe(LV({identifier:`Int`})){},zV=(e,t,n,r)=>loe(e,{onFailure:e=>new Dz(n,r,e),onSuccess:t});FB(Za,{typeConstructor:{_tag:`Uint8Array`},identifier:`Uint8ArrayFromSelf`,pretty:()=>e=>`new Uint8Array(${JSON.stringify(Array.from(e))})`,arbitrary:()=>e=>e.uint8Array(),equivalence:()=>ml(Ao)});var BV=class extends FB(e=>dae(e)&&fae(e),{typeConstructor:{_tag:`effect/DateTime.Utc`},identifier:`DateTimeUtcFromSelf`,description:`a DateTime.Utc instance`,pretty:()=>e=>e.toString(),arbitrary:()=>e=>e.date({noInvalidDate:!0}).map(e=>mae(e)),equivalence:()=>pae}){},VV=(e,t)=>coe({try:()=>hae(e),catch:()=>new Az(t,e,`Unable to decode ${Bo(e)} into a DateTime.Utc`)}),HV=class extends PV(K.annotations({description:`a string to be decoded into a DateTime.Utc`}),BV,{strict:!0,decode:(e,t,n)=>VV(e,n),encode:e=>Pz(gae(e))}).annotations({identifier:`DateTimeUtc`}){},UV=(e,t)=>n=>{let r=n.array(e(n));return(t.depthIdentifier===void 0?r:n.oneof(t,n.constant([]),r)).map(Al)},WV=e=>t=>`Chunk(${Ml(t).map(e).join(`, `)})`,GV=e=>(t,n,r)=>Tl(t)?Kl(t)?Pz(Dl()):zV(e(Ml(t),n),Al,r,t):Fz(new Az(r,t));const KV=e=>FB([e],{decode:e=>GV(Gz(ZB(e))),encode:e=>GV(Kz(ZB(e)))},{typeConstructor:{_tag:`effect/Chunk`},description:`Chunk<${CB(e)}>`,pretty:WV,arbitrary:UV,equivalence:xl});var qV=e=>OB(e)||sV(e),JV=e=>Reflect.ownKeys(e).every(t=>qV(e[t])),YV=e=>`fields`in e?e.fields:YV(e[OV]),XV=e=>JV(e)?vV(e):OB(e)?e:vV(YV(e)),ZV=e=>JV(e)?e:YV(e);const QV=e=>(t,n)=>aH({kind:`Class`,identifier:e,schema:XV(t),fields:ZV(t),Base:kre,annotations:n}),$V=e=>fV(dV(jB(e)),()=>e),eH=e=>(t,n,r)=>{class i extends ok{}i.prototype.name=t;let a=ZV(n),o=XV(n),s={_tag:$V(t)},c=tH(s,a),l=`message`in c;class u extends aH({kind:`TaggedError`,identifier:e??t,schema:EV(o,vV(s)),fields:c,Base:i,annotations:r,disableToString:!0}){static _tag=t}return l||Object.defineProperty(u.prototype,`message`,{get(){return`{ ${Reflect.ownKeys(a).map(e=>`${zo(e)}: ${Bo(this[e])}`).join(`, `)} }`},enumerable:!1,configurable:!0}),u};var tH=(e,t)=>{let n={...e};for(let r of Reflect.ownKeys(t)){if(r in e)throw Error($L(r));n[r]=t[r]}return n};function nH(e){return Ba(e)?e:e?.disableValidation??!1}var rH=La(`effect/Schema/astCache`,()=>new WeakMap),iH=e=>e===void 0?[]:Array.isArray(e)?e:[e],aH=({Base:e,annotations:t,disableToString:n,fields:r,identifier:i,kind:a,schema:o})=>{let s=Symbol.for(`effect/Schema/${a}/${i}`),[c,l,u]=iH(t),d=wB(o),f=d.annotations({identifier:i,...c}),p=d.annotations({[aR]:`${i} (Type side)`,...c}),m=o.annotations({[aR]:`${i} (Constructor)`,...c}),h=o.annotations({[aR]:`${i} (Encoded side)`,...u}),g=o.annotations({...u,...c,...l}),_=e=>M(e,s)&&foe(p)(e),v=class extends e{constructor(e={},t=!1){e={...e},a!==`Class`&&delete e._tag,e=gV(r,e),nH(t)||(e=qz(m)(e)),super(e,!0)}static[gB]=vB;static get ast(){let e=rH.get(this);return e||(e=FV(h,FB([o],{decode:()=>(e,t,n)=>e instanceof this||_(e)?Pz(e):Fz(new Az(n,e)),encode:()=>(e,t)=>e instanceof this?Pz(e):Rz(Kz(p)(e,t),e=>new this(e,!0))},{identifier:i,pretty:e=>t=>`${i}(${e(t)})`,arbitrary:e=>t=>e(t).map(e=>new this(e)),equivalence:Ea,[vR]:f.ast,...c}),{strict:!0,decode:e=>new this(e,!0),encode:Ea}).annotations({[vR]:g.ast,...l}).ast,rH.set(this,e),e)}static pipe(){return L(this,arguments)}static annotations(e){return _B(this.ast).annotations(e)}static toString(){return`(${String(h)} <-> ${i})`}static make(...e){return new this(...e)}static fields={...r};static identifier=i;static extend(e){return(t,n)=>{let i=ZV(t),s=XV(t),c=tH(r,i);return aH({kind:a,identifier:e,schema:EV(o,s),fields:c,Base:this,annotations:n})}}static transformOrFail(e){return(t,n,i)=>{let s=tH(r,t);return aH({kind:a,identifier:e,schema:PV(o,wB(vV(s)),n),fields:s,Base:this,annotations:i})}}static transformOrFailFrom(e){return(t,n,i)=>{let s=tH(r,t);return aH({kind:a,identifier:e,schema:PV(joe(o),vV(s),n),fields:s,Base:this,annotations:i})}}get[s](){return s}};return n!==!0&&Object.defineProperty(v.prototype,`toString`,{value(){return`${i}({ ${Reflect.ownKeys(r).map(e=>`${zo(e)}: ${Bo(this[e])}`).join(`, `)} })`},configurable:!0,writable:!0}),v},oH=GB(vV({_tag:jB(`None`)}).annotations({identifier:`FiberIdNoneEncoded`}),vV({_tag:jB(`Runtime`),id:RV,startTimeMillis:RV}).annotations({identifier:`FiberIdRuntimeEncoded`}),vV({_tag:jB(`Composite`),left:DV(()=>oH),right:DV(()=>oH)}).annotations({identifier:`FiberIdCompositeEncoded`})).annotations({identifier:`FiberIdEncoded`}),sH=e=>e.letrec(t=>({None:e.record({_tag:e.constant(`None`)}),Runtime:e.record({_tag:e.constant(`Runtime`),id:e.integer(),startTimeMillis:e.integer()}),Composite:e.record({_tag:e.constant(`Composite`),left:t(`FiberId`),right:t(`FiberId`)}),FiberId:e.oneof(t(`None`),t(`Runtime`),t(`Composite`))})).FiberId.map(lH),cH=e=>{switch(e._tag){case`None`:return`FiberId.none`;case`Runtime`:return`FiberId.runtime(${e.id}, ${e.startTimeMillis})`;case`Composite`:return`FiberId.composite(${cH(e.right)}, ${cH(e.left)})`}},lH=e=>{switch(e._tag){case`None`:return ym;case`Runtime`:return bm(e.id,e.startTimeMillis);case`Composite`:return xm(lH(e.left),lH(e.right))}},uH=e=>vV({_tag:jB(`Die`),defect:e}),dH=vV({_tag:jB(`Empty`)}),fH=e=>vV({_tag:jB(`Fail`),error:e}),pH=vV({_tag:jB(`Interrupt`),fiberId:oH}),mH=0,hH=(e,t)=>{let n=SB(e),r=SB(t),i=DV(()=>a),a=GB(dH,fH(n),uH(r),pH,vV({_tag:jB(`Sequential`),left:i,right:i}),vV({_tag:jB(`Parallel`),left:i,right:i})).annotations({title:`CauseEncoded<${CB(e)}>`,[ER]:`CauseEncoded${mH++}`});return a},gH=(e,t)=>n=>n.letrec(r=>({Empty:n.record({_tag:n.constant(`Empty`)}),Fail:n.record({_tag:n.constant(`Fail`),error:e(n)}),Die:n.record({_tag:n.constant(`Die`),defect:t(n)}),Interrupt:n.record({_tag:n.constant(`Interrupt`),fiberId:sH(n)}),Sequential:n.record({_tag:n.constant(`Sequential`),left:r(`Cause`),right:r(`Cause`)}),Parallel:n.record({_tag:n.constant(`Parallel`),left:r(`Cause`),right:r(`Cause`)}),Cause:n.oneof(r(`Empty`),r(`Fail`),r(`Die`),r(`Interrupt`),r(`Sequential`),r(`Parallel`))})).Cause.map(bH),_H=e=>t=>{let n=t=>{switch(t._tag){case`Empty`:return`Cause.empty`;case`Fail`:return`Cause.fail(${e(t.error)})`;case`Die`:return`Cause.die(${Qy(t)})`;case`Interrupt`:return`Cause.interrupt(${cH(t.fiberId)})`;case`Sequential`:return`Cause.sequential(${n(t.left)}, ${n(t.right)})`;case`Parallel`:return`Cause.parallel(${n(t.left)}, ${n(t.right)})`}};return n(t)},vH=e=>(t,n,r)=>Hy(t)?zV(e(xH(t),n),bH,r,t):Fz(new Az(r,t));const yH=({defect:e,error:t})=>FB([t,e],{decode:(e,t)=>vH(Gz(hH(e,t))),encode:(e,t)=>vH(Kz(hH(e,t)))},{typeConstructor:{_tag:`effect/Cause`},title:`Cause<${t.ast}>`,pretty:_H,arbitrary:gH});function bH(e){switch(e._tag){case`Empty`:return Iy;case`Fail`:return Ly(e.error);case`Die`:return Ry(e.defect);case`Interrupt`:return zy(lH(e.fiberId));case`Sequential`:return Vy(bH(e.left),bH(e.right));case`Parallel`:return By(bH(e.left),bH(e.right))}}function xH(e){switch(e._tag){case`Empty`:return{_tag:`Empty`};case`Fail`:return{_tag:`Fail`,error:e.error};case`Die`:return{_tag:`Die`,defect:e.defect};case`Interrupt`:return{_tag:`Interrupt`,fiberId:e.fiberId};case`Sequential`:return{_tag:`Sequential`,left:xH(e.left),right:xH(e.right)};case`Parallel`:return{_tag:`Parallel`,left:xH(e.left),right:xH(e.right)}}}var SH=class extends FV(BB,BB,{strict:!0,decode:e=>{if(qa(e)&&`message`in e&&typeof e.message==`string`){let t=Error(e.message,{cause:e});return`name`in e&&typeof e.name==`string`&&(t.name=e.name),t.stack=`stack`in e&&typeof e.stack==`string`?e.stack:``,t}return wf(e)},encode:e=>e instanceof Error?{name:e.name,message:e.message}:wf(e)}).annotations({identifier:`Defect`}){},CH=(e,t)=>vV({_tag:jB(`Failure`),cause:hH(e,t)}),wH=e=>vV({_tag:jB(`Success`),value:e}),TH=(e,t,n)=>GB(CH(t,n),wH(e)).annotations({title:`ExitEncoded<${CB(e)}, ${CB(t)}, ${CB(n)}>`}),EH=e=>{switch(e._tag){case`Failure`:return mw(bH(e.cause));case`Success`:return yw(e.value)}},DH=(e,t,n)=>r=>r.oneof(r.record({_tag:r.constant(`Failure`),cause:gH(t,n)(r)}),r.record({_tag:r.constant(`Success`),value:e(r)})).map(EH),OH=(e,t)=>n=>n._tag===`Failure`?`Exit.failCause(${_H(t)(n.cause)})`:`Exit.succeed(${e(n.value)})`,kH=(e,t)=>(n,r,i)=>sw(n)?vw(n,{onFailure:e=>zV(t(e,r),mw,i,n),onSuccess:t=>zV(e(t,r),yw,i,n)}):Fz(new Az(i,n));const AH=({defect:e,failure:t,success:n})=>FB([n,t,e],{decode:(e,t,n)=>kH(Gz(e),Gz(yH({error:t,defect:n}))),encode:(e,t,n)=>kH(Kz(e),Kz(yH({error:t,defect:n})))},{typeConstructor:{_tag:`effect/Exit`},title:`Exit<${n.ast}, ${t.ast}>`,pretty:OH,arbitrary:DH}),jH=({defect:e,failure:t,success:n})=>{let r=SB(n),i=SB(t),a=SB(e);return FV(TH(r,i,a),AH({failure:wB(i),success:wB(r),defect:wB(a)}),{strict:!1,decode:e=>EH(e),encode:e=>e._tag===`Failure`?{_tag:`Failure`,cause:e.cause}:{_tag:`Success`,value:e.value}})},MH=yL,NH=CL,PH=Vie,FH=Uie,IH=Wie,LH=Yie,RH=Xie,zH=eae,BH=IL,VH=LL,HH=rae,UH=zL,WH=(e,t)=>{class n extends ok{_tag=t}return n.prototype[e]=e,n.prototype.name=t,n},GH=jB(`Clipboard`,`Command`,`FileSystem`,`KeyValueStore`,`Path`,`Stream`,`Terminal`);eH(`@effect/platform/Error/BadArgument`)(`BadArgument`,{module:GH,method:K,description:pV(K),cause:pV(SH)});const KH=jB(`AlreadyExists`,`BadResource`,`Busy`,`InvalidData`,`NotFound`,`PermissionDenied`,`TimedOut`,`UnexpectedEof`,`Unknown`,`WouldBlock`,`WriteZero`);eH(`@effect/platform/Error/SystemError`)(`SystemError`,{reason:KH,module:GH,method:K,description:pV(K),syscall:pV(K),pathOrDescriptor:pV(GB(K,VB)),cause:pV(SH)});const qH=Symbol.for(`@effect/platform/Cookies`),JH=Symbol.for(`@effect/platform/Cookies/Cookie`);var YH={[qH]:qH,...Ho,toJSON(){return{_id:`@effect/platform/Cookies`,cookies:Cc(this.cookies,e=>e.toJSON())}},pipe(){return L(this,arguments)}};const XH=e=>{let t=Object.create(YH);return t.cookies=e,t},ZH=e=>{let t={};for(let n of e)t[n.name]=n;return XH(t)},QH=e=>{let t=typeof e==`string`?[e]:e,n=[];for(let e of t){let t=$H(e.trim());sc(t)&&n.push(t.value)}return ZH(n)};function $H(e){let t=e.split(`;`).map(e=>e.trim()).filter(e=>e!==``);if(t.length===0)return z();let n=t[0].indexOf(`=`);if(n===-1)return z();let r=t[0].slice(0,n);if(!eU.test(r))return z();let i=t[0].slice(n+1),a=nU(i);if(t.length===1)return B(Object.assign(Object.create(tU),{name:r,value:a,valueEncoded:i}));let o={};for(let e=1;e<t.length;e++){let n=t[e],r=n.indexOf(`=`),i=r===-1?n:n.slice(0,r).trim(),a=r===-1?void 0:n.slice(r+1).trim();switch(i.toLowerCase()){case`domain`:{if(a===void 0)break;let e=a.trim().replace(/^\./,``);e&&(o.domain=e);break}case`expires`:{if(a===void 0)break;let e=new Date(a);isNaN(e.getTime())||(o.expires=e);break}case`max-age`:{if(a===void 0)break;let e=parseInt(a,10);isNaN(e)||(o.maxAge=Lp(e));break}case`path`:if(a===void 0)break;a[0]===`/`&&(o.path=a);break;case`priority`:if(a===void 0)break;switch(a.toLowerCase()){case`low`:o.priority=`low`;break;case`medium`:o.priority=`medium`;break;case`high`:o.priority=`high`;break}break;case`httponly`:o.httpOnly=!0;break;case`secure`:o.secure=!0;break;case`partitioned`:o.partitioned=!0;break;case`samesite`:if(a===void 0)break;switch(a.toLowerCase()){case`lax`:o.sameSite=`lax`;break;case`strict`:o.sameSite=`strict`;break;case`none`:o.sameSite=`none`;break}break}}return B(Object.assign(Object.create(tU),{name:r,value:a,valueEncoded:i,options:Object.keys(o).length>0?o:void 0}))}var eU=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,tU={[JH]:JH,...Ho,toJSON(){return{_id:`@effect/platform/Cookies/Cookie`,name:this.name,value:this.value,options:this.options}}},nU=e=>{try{return decodeURIComponent(e)}catch{return e}};const rU=Symbol.for(`@effect/platform/Headers`);var iU=Object.assign(Object.create(null),{[rU]:rU,[Ko](e){return pU(this,rx(e,mU))}}),aU=e=>Object.assign(Object.create(iU),e);const oU=Object.create(iU),sU=e=>{if(e===void 0)return oU;if(Symbol.iterator in e){let t=Object.create(iU);for(let[n,r]of e)t[n.toLowerCase()]=r;return t}let t=Object.create(iU);for(let[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(`, `):r!==void 0&&(t[n.toLowerCase()]=r);return t},cU=e=>Object.setPrototypeOf(e,iU),lU=A(3,(e,t,n)=>{let r=aU(e);return r[t.toLowerCase()]=n,r}),uU=A(2,(e,t)=>aU({...e,...sU(t)})),dU=A(2,(e,t)=>{let n=aU(e);return Object.assign(n,t),n}),fU=A(2,(e,t)=>{let n=aU(e),r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&delete n[r]}else for(let r in e)t.test(r)&&delete n[r]};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),pU=A(2,(e,t)=>{let n={...e},r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&(n[r]=hB(e[r]))}else for(let r in e)t.test(r)&&(n[r]=hB(e[r]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),mU=La(`@effect/platform/Headers/currentRedactedNames`,()=>Uj([`authorization`,`cookie`,`set-cookie`,`x-api-key`])),hU=Symbol.for(`@effect/platform/HttpClientError`);var gU=class extends WH(hU,`RequestError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return this.description?`${this.reason}: ${this.description} (${this.methodAndUrl})`:`${this.reason} error (${this.methodAndUrl})`}},_U=class extends WH(hU,`ResponseError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return this.description?`${this.reason}: ${this.description} (${e})`:`${this.reason} error (${e})`}},vU=BigInt(1024);vU*vU*vU*vU*vU;const yU=e=>{let t=bU(e),n=[];for(let e=0;e<t.length;e++)if(Array.isArray(t[e][0])){let[r,i]=t[e];n.push([`${r[0]}[${r.slice(1).join(`][`)}]`,i])}else n.push(t[e]);return n};var bU=e=>{let t=Symbol.iterator in e?Dc(e):Object.entries(e),n=[];for(let[e,r]of t)if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]!==void 0&&n.push([e,String(r[t])]);else if(typeof r==`object`){let t=bU(r);for(let[r,i]of t)n.push([[e,...typeof r==`string`?[r]:r],i])}else r!==void 0&&n.push([e,String(r)]);return n};const xU=[],SU=A(2,(e,t)=>{let n=yU(t),r=new Set;for(let e=0;e<n.length;e++)r.add(n[e][0]);for(let t=0;t<e.length;t++)r.has(e[t][0])||n.push(e[t]);return n}),CU=(e,t,n)=>{try{let r=new URL(e,wU());for(let e=0;e<t.length;e++){let[n,i]=t[e];i!==void 0&&r.searchParams.append(n,i)}return n._tag===`Some`&&(r.hash=n.value),Us(r)}catch(e){return R(e)}};var wU=()=>{if(`location`in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname};const TU=Symbol.for(`@effect/platform/HttpIncomingMessage`),EU=(e,t)=>{let n=e.headers[`content-type`]??``,r;if(n.includes(`application/json`))try{r=Ij(e.json)}catch{}else if(n.includes(`text/`)||n.includes(`urlencoded`))try{r=Ij(e.text)}catch{}let i={...t,headers:Xo(e.headers),remoteAddress:e.remoteAddress.toJSON()};return r!==void 0&&(i.body=r),i},DU=e=>cU({b3:`${e.traceId}-${e.spanId}-${e.sampled?`1`:`0`}${e.parent._tag===`Some`?`-${e.parent.value.spanId}`:``}`,traceparent:`00-${e.traceId}-${e.spanId}-${e.sampled?`01`:`00`}`}),OU=Symbol.for(`@effect/platform/HttpBody`);var kU=class{[OU];constructor(){this[OU]=OU}[Po](){return this.toJSON()}toString(){return Vo(this)}};const AU=new class extends kU{_tag=`Empty`;toJSON(){return{_id:`@effect/platform/HttpBody`,_tag:`Empty`}}};var jU=class extends kU{body;contentType;_tag=`Uint8Array`;constructor(e,t){super(),this.body=e,this.contentType=t}get contentLength(){return this.body.length}toJSON(){return{_id:`@effect/platform/HttpBody`,_tag:`Uint8Array`,body:this.contentType.startsWith(`text/`)||this.contentType.endsWith(`json`)?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}};const MU=(e,t)=>new jU(e,t??`application/octet-stream`);var NU=new TextEncoder;const PU=(e,t)=>MU(NU.encode(e),t??`text/plain`),FU=Symbol.for(`@effect/platform/HttpClientRequest`);var IU={[FU]:FU,...Ho,toJSON(){return{_id:`@effect/platform/HttpClientRequest`,method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:Xo(this.headers),body:this.body.toJSON()}},pipe(){return L(this,arguments)}};function LU(e,t,n,r,i,a){let o=Object.create(IU);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=i,o.body=a,o}const RU=LU(`GET`,``,xU,z(),oU,AU),zU=e=>(t,n)=>qU(RU,{method:e,url:t,...n??void 0}),BU=zU(`GET`),VU=zU(`POST`),HU=zU(`PUT`),UU=zU(`PATCH`),WU=zU(`DELETE`),GU=zU(`HEAD`),KU=zU(`OPTIONS`),qU=A(2,(e,t)=>{let n=e;return t.method&&(n=QU(n,t.method)),t.url&&(n=$U(n,t.url)),t.headers&&(n=YU(n,t.headers)),t.urlParams&&(n=tW(n,t.urlParams)),t.hash&&(n=nW(n,t.hash)),t.body&&(n=rW(n,t.body)),t.accept&&(n=XU(n,t.accept)),t.acceptJson&&(n=ZU(n)),n}),JU=A(3,(e,t,n)=>LU(e.method,e.url,e.urlParams,e.hash,lU(e.headers,t,n),e.body)),YU=A(2,(e,t)=>LU(e.method,e.url,e.urlParams,e.hash,uU(e.headers,t),e.body)),XU=A(2,(e,t)=>JU(e,`Accept`,t)),ZU=XU(`application/json`),QU=A(2,(e,t)=>LU(t,e.url,e.urlParams,e.hash,e.headers,e.body)),$U=A(2,(e,t)=>{if(typeof t==`string`)return LU(e.method,t,e.urlParams,e.hash,e.headers,e.body);let n=new URL(t.toString()),r=yU(n.searchParams),i=n.hash?B(n.hash.slice(1)):z();return n.search=``,n.hash=``,LU(e.method,n.toString(),r,i,e.headers,e.body)}),eW=A(2,(e,t)=>LU(e.method,t.endsWith(`/`)&&e.url.startsWith(`/`)?t+e.url.slice(1):t+e.url,e.urlParams,e.hash,e.headers,e.body)),tW=A(2,(e,t)=>LU(e.method,e.url,SU(e.urlParams,t),e.hash,e.headers,e.body)),nW=A(2,(e,t)=>LU(e.method,e.url,e.urlParams,B(t),e.headers,e.body)),rW=A(2,(e,t)=>{let n=e.headers;if(t._tag===`Empty`||t._tag===`FormData`)n=fU(n,[`Content-type`,`Content-length`]);else{let e=t.contentType;e&&(n=lU(n,`content-type`,e));let r=t.contentLength;r&&(n=lU(n,`content-length`,r.toString()))}return LU(e.method,e.url,e.urlParams,e.hash,n,t)}),iW=Symbol.for(`@effect/platform/HttpClientResponse`),aW=(e,t)=>new oW(e,t);var oW=class extends Uo{request;source;[TU];[iW];constructor(e,t){super(),this.request=e,this.source=t,this[TU]=TU,this[iW]=iW}toJSON(){return EU(this,{_id:`@effect/platform/HttpClientResponse`,request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return sU(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=QH(this.source.headers.getSetCookie())}get remoteAddress(){return z()}get stream(){return this.source.body?LH(()=>this.source.body,e=>new _U({request:this.request,response:this,reason:`Decode`,cause:e})):IH(new _U({request:this.request,response:this,reason:`EmptyBody`,description:`can not create stream from empty body`}))}get json(){return qA(this.text,{try:e=>e===``?null:JSON.parse(e),catch:e=>new _U({request:this.request,response:this,reason:`Decode`,cause:e})})}textBody;get text(){return this.textBody??=JA({try:()=>this.source.text(),catch:e=>new _U({request:this.request,response:this,reason:`Decode`,cause:e})}).pipe(wA,Ij)}get urlParamsBody(){return G(this.text,e=>KA({try:()=>yU(new URLSearchParams(e)),catch:e=>new _U({request:this.request,response:this,reason:`Decode`,cause:e})}))}formDataBody;get formData(){return this.formDataBody??=JA({try:()=>this.source.formData(),catch:e=>new _U({request:this.request,response:this,reason:`Decode`,cause:e})}).pipe(wA,Ij)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody??=JA({try:()=>this.source.arrayBuffer(),catch:e=>new _U({request:this.request,response:this,reason:`Decode`,cause:e})}).pipe(wA,Ij)}},sW=e=>`http.request.header.${e}`,cW=`http.request.method`,lW=e=>`http.response.header.${e}`,uW=`http.response.status_code`,dW=`server.address`,fW=`server.port`,pW=`url.full`,mW=`url.path`,hW=`url.scheme`,gW=`url.query`;const _W=Symbol.for(`@effect/platform/HttpClient`),vW=rp(`@effect/platform/HttpClient`),yW=La(Symbol.for(`@effect/platform/HttpClient/tracerDisabledWhen`),()=>Uj(ka)),bW=La(Symbol.for(`@effect/platform/HttpClient/currentTracerPropagation`),()=>Uj(!0)),xW=gp()(`@effect/platform/HttpClient/SpanNameGenerator`,{defaultValue:()=>e=>`http.client ${e.method}`});var SW={[_W]:_W,pipe(){return L(this,arguments)},...Ho,toJSON(){return{_id:`@effect/platform/HttpClient`}},get(e,t){return this.execute(BU(e,t))},head(e,t){return this.execute(GU(e,t))},post(e,t){return this.execute(VU(e,t))},put(e,t){return this.execute(HU(e,t))},patch(e,t){return this.execute(UU(e,t))},del(e,t){return this.execute(WU(e,t))},options(e,t){return this.execute(KU(e,t))}};const CW=(e,t)=>{let n=Object.create(SW);return n.preprocess=t,n.postprocess=e,n.execute=function(n){return e(t(n))},n};var wW=La(`@effect/platform/HttpClient/responseRegistry`,()=>{if(`FinalizationRegistry`in globalThis&&globalThis.FinalizationRegistry){let e=new FinalizationRegistry(e=>{e.abort()});return{register(t,n){e.register(t,n,t)},unregister(t){e.unregister(t)}}}let e=new Map;return{register(t,n){e.set(t,setTimeout(()=>n.abort(),5e3))},unregister(t){let n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))}}}),TW=La(`@effect/platform/HttpClient/scopedRequests`,()=>new WeakMap);const EW=e=>CW(t=>G(t,t=>jA(n=>{let r=TW.get(t),i=r??new AbortController,a=CU(t.url,t.urlParams,t.hash);if(a._tag===`Left`)return MA(new gU({request:t,reason:`InvalidUrl`,cause:a.left}));let o=a.right;if(!n.getFiberRef(iie)||n.getFiberRef(yW)(t)){let a=e(t,o,i.signal,n);return r?a:$A(e=>Nj(e(a),{onSuccess(e){return wW.register(e,i),zA(new DW(e,i))},onFailure(e){return Gy(e)&&i.abort(),NA(e)}}))}return Bj(up(n.currentContext,xW)(t),{kind:`client`,captureStackTrace:!1},a=>{a.attribute(cW,t.method),a.attribute(dW,o.origin),o.port!==``&&a.attribute(fW,+o.port),a.attribute(pW,o.toString()),a.attribute(mW,o.pathname),a.attribute(hW,o.protocol.slice(0,-1));let s=o.search.slice(1);s!==``&&a.attribute(gW,s);let c=n.getFiberRef(mU),l=pU(t.headers,c);for(let e in l)a.attribute(sW(e),String(l[e]));return t=n.getFiberRef(bW)?YU(t,DU(a)):t,$A(s=>s(e(t,o,i.signal,n)).pipe(Vj(a),Nj({onSuccess:e=>{a.attribute(uW,e.status);let t=pU(e.headers,c);for(let e in t)a.attribute(lW(e),String(t[e]));return r?zA(e):(wW.register(e,i),zA(new DW(e,i)))},onFailure(e){return!r&&Gy(e)&&i.abort(),NA(e)}})))})})),zA);var DW=class{original;controller;constructor(e,t){this.original=e,this.controller=t}[iW]=iW;[TU]=TU;applyInterrupt(e){return BA(()=>(wW.unregister(this.original),ZA(e,()=>VA(()=>{this.controller.abort()}))))}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return VH(()=>(wW.unregister(this.original),FH(this.original.stream,VA(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[Po](){return this.original[Po]()}};const{del:Moe,execute:Noe,get:Poe,head:Foe,options:Ioe,patch:Loe,post:Roe,put:zoe}=Sj(vW),OW=A(2,(e,t)=>{let n=e;return CW(e=>t(n.postprocess(e)),n.preprocess)}),kW=A(2,(e,t)=>{let n=e;return CW(n.postprocess,e=>nj(n.preprocess(e),t))}),AW=(e=>aie(vW,G(vj(),t=>nj(e,e=>OW(e,bj(e=>pp(t,e)))))))(zA(EW((e,t,n,r)=>{let i=r.getFiberRef(Wj),a=i.unsafeMap.get(`@effect/platform/FetchHttpClient/Fetch`)??globalThis.fetch,o=i.unsafeMap.get(`@effect/platform/FetchHttpClient/FetchOptions`)??{},s=o.headers?dU(sU(o.headers),e.headers):e.headers,c=r=>nj(JA({try:()=>a(t,{...o,method:e.method,headers:s,body:r,duplex:e.body._tag===`Stream`?`half`:void 0,signal:n}),catch:t=>new gU({request:e,reason:`Transport`,cause:t})}),t=>aW(e,t));switch(e.body._tag){case`Raw`:case`Uint8Array`:return c(e.body.body);case`FormData`:return c(e.body.formData);case`Stream`:return G(HH(e.body.stream),c)}return c(void 0)}))),jW=MU,MW=PU,NW=Symbol.for(`effect/Mailbox`),PW=Symbol.for(`effect/Mailbox/ReadonlyMailbox`);var FW=Dl(),IW=ly(FW),LW=ly(!1),RW=ly(!0),zW=[FW,!0],BW=class extends Bb{scheduler;capacity;strategy;[NW]=NW;[PW]=PW;state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set};messages=[];messagesChunk=Dl();constructor(e,t,n){super(),this.scheduler=e,this.capacity=t,this.strategy=n}offer(e){return U(()=>{if(this.state._tag!==`Open`)return LW;if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case`dropping`:return LW;case`suspend`:return this.capacity<=0&&this.state.takers.size>0?(this.messages.push(e),this.releaseTaker(),RW):this.offerRemainingSingle(e);case`sliding`:return this.unsafeTake(),this.messages.push(e),RW}return this.messages.push(e),this.scheduleReleaseTaker(),RW})}unsafeOffer(e){return this.state._tag===`Open`?this.messages.length+this.messagesChunk.length>=this.capacity?this.strategy===`sliding`?(this.unsafeTake(),this.messages.push(e),!0):this.capacity<=0&&this.state.takers.size>0?(this.messages.push(e),this.releaseTaker(),!0):!1:(this.messages.push(e),this.scheduleReleaseTaker(),!0):!1}offerAll(e){return U(()=>{if(this.state._tag!==`Open`)return H(Al(e));let t=this.unsafeOfferAllArray(e);return t.length===0?IW:this.strategy===`dropping`?H(Fl(t)):this.offerRemainingArray(t)})}unsafeOfferAll(e){return Fl(this.unsafeOfferAllArray(e))}unsafeOfferAllArray(e){if(this.state._tag!==`Open`)return Dc(e);if(this.capacity===1/0||this.strategy===`sliding`)return this.messages.length>0&&(this.messagesChunk=Ul(this.messagesChunk,Fl(this.messages))),this.strategy===`sliding`?this.messagesChunk=this.messagesChunk.pipe(Ul(Al(e)),tu(this.capacity)):Tl(e)?this.messagesChunk=Ul(this.messagesChunk,e):this.messages=Dc(e),this.scheduleReleaseTaker(),[];let t=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(t===0)return Dc(e);let n=[],r=0;for(let i of e)r<t?this.messages.push(i):n.push(i),r++;return this.scheduleReleaseTaker(),n}fail(e){return this.done(ty(e))}failCause(e){return this.done(ny(e))}unsafeDone(e){return this.state._tag===`Open`?this.state.offers.size===0&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(e),!0):(this.state={...this.state,_tag:`Closing`,exit:e},!0):!1}shutdown=W(()=>{if(this.state._tag===`Done`)return!0;this.messages=[],this.messagesChunk=FW;let e=this.state.offers;if(this.finalize(this.state._tag===`Open`?uy:this.state.exit),e.size>0){for(let t of e)t._tag===`Single`?t.resume(LW):t.resume(ly(Fl(t.remaining.slice(t.offset))));e.clear()}return!0});done(e){return W(()=>this.unsafeDone(e))}end=this.done(uy);clear=U(()=>{if(this.state._tag===`Done`)return Zv(this.state.exit,FW);let e=this.unsafeTakeAll();return this.releaseCapacity(),H(e)});takeAll=U(()=>{if(this.state._tag===`Done`)return Zv(this.state.exit,zW);let e=this.unsafeTakeAll();return e.length===0?G_(this.awaitTake,this.takeAll):H([e,this.releaseCapacity()])});takeN(e){return U(()=>{if(this.state._tag===`Done`)return Zv(this.state.exit,zW);if(e<=0)return H([FW,!1]);e=Math.min(e,this.capacity);let t;if(e<=this.messagesChunk.length)t=Bl(this.messagesChunk,e),this.messagesChunk=Vl(this.messagesChunk,e);else if(e<=this.messages.length+this.messagesChunk.length)this.messagesChunk=Ul(this.messagesChunk,Fl(this.messages)),this.messages=[],t=Bl(this.messagesChunk,e),this.messagesChunk=Vl(this.messagesChunk,e);else return G_(this.awaitTake,this.takeN(e));return H([t,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag===`Done`)return fy(this.state.exit,ty(new Zy));let e;if(this.messagesChunk.length>0)e=Yl(this.messagesChunk),this.messagesChunk=Vl(this.messagesChunk,1);else if(this.messages.length>0)e=this.messages[0],this.messagesChunk=Vl(Fl(this.messages),1),this.messages=[];else if(this.capacity<=0&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,this.messages.length>0?ly(this.messages.pop()):void 0;else return;return this.releaseCapacity(),ly(e)}take=U(()=>this.unsafeTake()??G_(this.awaitTake,this.take));await=Zg(e=>this.state._tag===`Done`?e(this.state.exit):(this.state.awaiters.add(e),W(()=>{this.state._tag!==`Done`&&this.state.awaiters.delete(e)})));unsafeSize(){let e=this.messages.length+this.messagesChunk.length;return this.state._tag===`Done`?z():B(e)}size=W(()=>this.unsafeSize());commit(){return this.takeAll}pipe(){return L(this,arguments)}toJSON(){return{_id:`effect/Mailbox`,state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return Vo(this)}[Po](){return Vo(this)}offerRemainingSingle(e){return Zg(t=>{if(this.state._tag!==`Open`)return t(LW);let n={_tag:`Single`,message:e,resume:t};return this.state.offers.add(n),W(()=>{this.state._tag===`Open`&&this.state.offers.delete(n)})})}offerRemainingArray(e){return Zg(t=>{if(this.state._tag!==`Open`)return t(ly(Fl(e)));let n={_tag:`Array`,remaining:e,offset:0,resume:t};return this.state.offers.add(n),W(()=>{this.state._tag===`Open`&&this.state.offers.delete(n)})})}releaseCapacity(){if(this.state._tag===`Done`)return this.state.exit._tag===`Success`;if(this.state.offers.size===0)return this.state._tag===`Closing`&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(this.state.exit),this.state.exit._tag===`Success`):!1;let e=this.capacity-this.messages.length-this.messagesChunk.length;for(let t of this.state.offers)if(e===0)return!1;else if(t._tag===`Single`)this.messages.push(t.message),e--,t.resume(RW),this.state.offers.delete(t);else{for(;t.offset<t.remaining.length;t.offset++){if(e===0)return!1;this.messages.push(t.remaining[t.offset]),e--}t.resume(IW),this.state.offers.delete(t)}return!1}awaitTake=Zg(e=>this.state._tag===`Done`?e(this.state.exit):(this.state.takers.add(e),W(()=>{this.state._tag!==`Done`&&this.state.takers.delete(e)})));scheduleRunning=!1;scheduleReleaseTaker(){this.scheduleRunning||(this.scheduleRunning=!0,this.scheduler.scheduleTask(this.releaseTaker,0))}releaseTaker=()=>{if(this.scheduleRunning=!1,this.state._tag!==`Done`&&this.state.takers.size!==0){for(let e of this.state.takers)if(this.state.takers.delete(e),e(uy),this.messages.length+this.messagesChunk.length===0)break}};unsafeTakeAll(){if(this.messagesChunk.length>0){let e=this.messages.length>0?Ul(this.messagesChunk,Fl(this.messages)):this.messagesChunk;return this.messagesChunk=FW,this.messages=[],e}else if(this.messages.length>0){let e=Fl(this.messages);return this.messages=[],e}else if(this.state._tag!==`Done`&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,kl(this.messages.pop());return FW}finalize(e){if(this.state._tag===`Done`)return;let t=this.state;this.state={_tag:`Done`,exit:e};for(let n of t.takers)n(e);t.takers.clear();for(let n of t.awaiters)n(e);t.awaiters.clear()}};const VW=e=>Gg(t=>H(new BW(t.currentScheduler,typeof e==`number`?e:e?.capacity??1/0,typeof e==`number`?`suspend`:e?.strategy??`suspend`))),HW=e=>{let t=YM(e.takeAll,([e,n])=>n?e.length===0?oN:sN(e):ZP(sN(e),t));return t},UW=e=>qie(HW(e)),WW=VW,GW=UW,KW=vW,qW=kW,JW=eW;var YW;try{YW=new TextDecoder}catch{}var q,XW,J=0,ZW=[],QW=ZW,$W=0,eG={},tG,nG,rG=0,iG=0,aG,oG,sG=[],cG,lG={useRecords:!1,mapsAsObjects:!0},uG=class{};const dG=new uG;dG.name=`MessagePack 0xC1`;var fG=!1,pG=2,mG,hG,gG;try{Function(``)}catch{pG=1/0}var _G=class e{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.sequential&&e.trusted!==!1&&(e.trusted=!0,!e.structures&&e.useRecords!=0&&(e.structures=[],e.maxSharedStructures||=0)),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType=`number`)),Object.assign(this,e)}unpack(t,n){if(q)return KG(()=>(qG(),this?this.unpack(t,n):e.prototype.unpack.call(lG,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<`u`?Buffer.from(t):new Uint8Array(t)),typeof n==`object`?(XW=n.end||t.length,J=n.start||0):(J=0,XW=n>-1?n:t.length),$W=0,iG=0,nG=null,QW=ZW,aG=null,q=t;try{cG=t.dataView||=new DataView(t.buffer,t.byteOffset,t.byteLength)}catch(e){throw q=null,t instanceof Uint8Array?e:Error(`Source must be a Uint8Array or Buffer but was a `+(t&&typeof t==`object`?t.constructor.name:typeof t))}if(this instanceof e){if(eG=this,this.structures)return tG=this.structures,vG(n);(!tG||tG.length>0)&&(tG=[])}else eG=lG,(!tG||tG.length>0)&&(tG=[]);return vG(n)}unpackMultiple(e,t){let n,r=0;try{fG=!0;let i=e.length,a=this?this.unpack(e,i):YG.unpack(e,i);if(t){if(t(a,r,J)===!1)return;for(;J<i;)if(r=J,t(vG(),r,J)===!1)return}else{for(n=[a];J<i;)r=J,n.push(vG());return n}}catch(e){throw e.lastPosition=r,e.values=n,e}finally{fG=!1,qG()}}_mergeStructures(e,t){hG&&(e=hG.call(this,e)),e||=[],Object.isFrozen(e)&&(e=e.map(e=>e.slice(0)));for(let t=0,n=e.length;t<n;t++){let n=e[t];n&&(n.isShared=!0,t>=32&&(n.highByte=t-32>>5))}for(let n in e.sharedLength=e.length,t||[])if(n>=0){let r=e[n],i=t[n];i&&(r&&((e.restoreStructures||=[])[n]=r),e[n]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}};function vG(e){try{if(!eG.trusted&&!fG){let e=tG.sharedLength||0;e<tG.length&&(tG.length=e)}let t;if(eG.randomAccessStructure&&q[J]<64&&q[J]>=32&&mG?(t=mG(q,J,XW,eG),q=null,!(e&&e.lazy)&&t&&(t=t.toJSON()),J=XW):t=bG(),aG&&=(J=aG.postBundlePosition,null),fG&&(tG.restoreStructures=null),J==XW)tG&&tG.restoreStructures&&yG(),tG=null,q=null,oG&&=null;else if(J>XW)throw Error(`Unexpected end of MessagePack data`);else if(!fG){let e;try{e=JSON.stringify(t,(e,t)=>typeof t==`bigint`?`${t}n`:t).slice(0,100)}catch(t){e=`(JSON view not available `+t+`)`}throw Error(`Data read, but end of buffer not reached `+e)}return t}catch(e){throw tG&&tG.restoreStructures&&yG(),qG(),(e instanceof RangeError||e.message.startsWith(`Unexpected end of buffer`)||J>XW)&&(e.incomplete=!0),e}}function yG(){for(let e in tG.restoreStructures)tG[e]=tG.restoreStructures[e];tG.restoreStructures=null}function bG(){let e=q[J++];if(e<160)if(e<128){if(e<64)return e;{let t=tG[e&63]||eG.getStructures&&wG()[e&63];return t?(t.read||=SG(t,e&63),t.read()):e}}else if(e<144)if(e-=128,eG.mapsAsObjects){let t={};for(let n=0;n<e;n++){let e=zG();e===`__proto__`&&(e=`__proto_`),t[e]=bG()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(bG(),bG());return t}else{e-=144;let t=Array(e);for(let n=0;n<e;n++)t[n]=bG();return eG.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(iG>=J)return nG.slice(J-rG,(J+=t)-rG);if(iG==0&&XW<140){let e=t<16?PG(t):NG(t);if(e!=null)return e}return TG(t)}else{let t;switch(e){case 192:return null;case 193:return aG?(t=bG(),t>0?aG[1].slice(aG.position1,aG.position1+=t):aG[0].slice(aG.position0,aG.position0-=t)):dG;case 194:return!1;case 195:return!0;case 196:if(t=q[J++],t===void 0)throw Error(`Unexpected end of buffer`);return IG(t);case 197:return t=cG.getUint16(J),J+=2,IG(t);case 198:return t=cG.getUint32(J),J+=4,IG(t);case 199:return LG(q[J++]);case 200:return t=cG.getUint16(J),J+=2,LG(t);case 201:return t=cG.getUint32(J),J+=4,LG(t);case 202:if(t=cG.getFloat32(J),eG.useFloat32>2){let e=JG[(q[J]&127)<<1|q[J+1]>>7];return J+=4,(e*t+(t>0?.5:-.5)>>0)/e}return J+=4,t;case 203:return t=cG.getFloat64(J),J+=8,t;case 204:return q[J++];case 205:return t=cG.getUint16(J),J+=2,t;case 206:return t=cG.getUint32(J),J+=4,t;case 207:return eG.int64AsType===`number`?(t=cG.getUint32(J)*4294967296,t+=cG.getUint32(J+4)):eG.int64AsType===`string`?t=cG.getBigUint64(J).toString():eG.int64AsType===`auto`?(t=cG.getBigUint64(J),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=cG.getBigUint64(J),J+=8,t;case 208:return cG.getInt8(J++);case 209:return t=cG.getInt16(J),J+=2,t;case 210:return t=cG.getInt32(J),J+=4,t;case 211:return eG.int64AsType===`number`?(t=cG.getInt32(J)*4294967296,t+=cG.getUint32(J+4)):eG.int64AsType===`string`?t=cG.getBigInt64(J).toString():eG.int64AsType===`auto`?(t=cG.getBigInt64(J),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=cG.getBigInt64(J),J+=8,t;case 212:if(t=q[J++],t==114)return VG(q[J++]&63);{let e=sG[t];if(e)return e.read?(J++,e.read(bG())):e.noBuffer?(J++,e()):e(q.subarray(J,++J));throw Error(`Unknown extension `+t)}case 213:return t=q[J],t==114?(J++,VG(q[J++]&63,q[J++])):LG(2);case 214:return LG(4);case 215:return LG(8);case 216:return LG(16);case 217:return t=q[J++],iG>=J?nG.slice(J-rG,(J+=t)-rG):EG(t);case 218:return t=cG.getUint16(J),J+=2,iG>=J?nG.slice(J-rG,(J+=t)-rG):DG(t);case 219:return t=cG.getUint32(J),J+=4,iG>=J?nG.slice(J-rG,(J+=t)-rG):OG(t);case 220:return t=cG.getUint16(J),J+=2,AG(t);case 221:return t=cG.getUint32(J),J+=4,AG(t);case 222:return t=cG.getUint16(J),J+=2,jG(t);case 223:return t=cG.getUint32(J),J+=4,jG(t);default:if(e>=224)return e-256;if(e===void 0){let e=Error(`Unexpected end of MessagePack data`);throw e.incomplete=!0,e}throw Error(`Unknown MessagePack token `+e)}}}var xG=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function SG(e,t){function n(){if(n.count++>pG){let n=e.read=Function(`r`,`return function(){return `+(eG.freezeData?`Object.freeze`:``)+`({`+e.map(e=>e===`__proto__`?`__proto_:r()`:xG.test(e)?e+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`})}`)(bG);return e.highByte===0&&(e.read=CG(t,e.read)),n()}let r={};for(let t=0,n=e.length;t<n;t++){let n=e[t];n===`__proto__`&&(n=`__proto_`),r[n]=bG()}return eG.freezeData?Object.freeze(r):r}return n.count=0,e.highByte===0?CG(t,n):n}var CG=(e,t)=>function(){let n=q[J++];if(n===0)return t();let r=e<32?-(e+(n<<5)):e+(n<<5),i=tG[r]||wG()[r];if(!i)throw Error(`Record id is not defined for `+r);return i.read||=SG(i,e),i.read()};function wG(){let e=KG(()=>(q=null,eG.getStructures()));return tG=eG._mergeStructures(e,tG)}var TG=kG,EG=kG,DG=kG,OG=kG;function kG(e){let t;if(e<16&&(t=PG(e)))return t;if(e>64&&YW)return YW.decode(q.subarray(J,J+=e));let n=J+e,r=[];for(t=``;J<n;){let e=q[J++];if(!(e&128))r.push(e);else if((e&224)==192){let t=q[J++]&63;r.push((e&31)<<6|t)}else if((e&240)==224){let t=q[J++]&63,n=q[J++]&63;r.push((e&31)<<12|t<<6|n)}else if((e&248)==240){let t=q[J++]&63,n=q[J++]&63,i=q[J++]&63,a=(e&7)<<18|t<<12|n<<6|i;a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a)}else r.push(e);r.length>=4096&&(t+=MG.apply(String,r),r.length=0)}return r.length>0&&(t+=MG.apply(String,r)),t}function AG(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=bG();return eG.freezeData?Object.freeze(t):t}function jG(e){if(eG.mapsAsObjects){let t={};for(let n=0;n<e;n++){let e=zG();e===`__proto__`&&(e=`__proto_`),t[e]=bG()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(bG(),bG());return t}}var MG=String.fromCharCode;function NG(e){let t=J,n=Array(e);for(let r=0;r<e;r++){let e=q[J++];if((e&128)>0){J=t;return}n[r]=e}return MG.apply(String,n)}function PG(e){if(e<4)if(e<2){if(e===0)return``;{let e=q[J++];if((e&128)>1){--J;return}return MG(e)}}else{let t=q[J++],n=q[J++];if((t&128)>0||(n&128)>0){J-=2;return}if(e<3)return MG(t,n);let r=q[J++];if((r&128)>0){J-=3;return}return MG(t,n,r)}else{let t=q[J++],n=q[J++],r=q[J++],i=q[J++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){J-=4;return}if(e<6){if(e===4)return MG(t,n,r,i);{let e=q[J++];if((e&128)>0){J-=5;return}return MG(t,n,r,i,e)}}else if(e<8){let a=q[J++],o=q[J++];if((a&128)>0||(o&128)>0){J-=6;return}if(e<7)return MG(t,n,r,i,a,o);let s=q[J++];if((s&128)>0){J-=7;return}return MG(t,n,r,i,a,o,s)}else{let a=q[J++],o=q[J++],s=q[J++],c=q[J++];if((a&128)>0||(o&128)>0||(s&128)>0||(c&128)>0){J-=8;return}if(e<10){if(e===8)return MG(t,n,r,i,a,o,s,c);{let e=q[J++];if((e&128)>0){J-=9;return}return MG(t,n,r,i,a,o,s,c,e)}}else if(e<12){let l=q[J++],u=q[J++];if((l&128)>0||(u&128)>0){J-=10;return}if(e<11)return MG(t,n,r,i,a,o,s,c,l,u);let d=q[J++];if((d&128)>0){J-=11;return}return MG(t,n,r,i,a,o,s,c,l,u,d)}else{let l=q[J++],u=q[J++],d=q[J++],f=q[J++];if((l&128)>0||(u&128)>0||(d&128)>0||(f&128)>0){J-=12;return}if(e<14){if(e===12)return MG(t,n,r,i,a,o,s,c,l,u,d,f);{let e=q[J++];if((e&128)>0){J-=13;return}return MG(t,n,r,i,a,o,s,c,l,u,d,f,e)}}else{let p=q[J++],m=q[J++];if((p&128)>0||(m&128)>0){J-=14;return}if(e<15)return MG(t,n,r,i,a,o,s,c,l,u,d,f,p,m);let h=q[J++];if((h&128)>0){J-=15;return}return MG(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}}}}}function FG(){let e=q[J++],t;if(e<192)t=e-160;else switch(e){case 217:t=q[J++];break;case 218:t=cG.getUint16(J),J+=2;break;case 219:t=cG.getUint32(J),J+=4;break;default:throw Error(`Expected string`)}return kG(t)}function IG(e){return eG.copyBuffers?Uint8Array.prototype.slice.call(q,J,J+=e):q.subarray(J,J+=e)}function LG(e){let t=q[J++];if(sG[t]){let n;return sG[t](q.subarray(J,n=J+=e),e=>{J=e;try{return bG()}finally{J=n}})}else throw Error(`Unknown extension type `+t)}var RG=Array(4096);function zG(){let e=q[J++];if(e>=160&&e<192){if(e-=160,iG>=J)return nG.slice(J-rG,(J+=e)-rG);if(!(iG==0&&XW<180))return TG(e)}else return J--,BG(bG());let t=(e<<5^(e>1?cG.getUint16(J):e>0?q[J]:0))&4095,n=RG[t],r=J,i=J+e-3,a,o=0;if(n&&n.bytes==e){for(;r<i;){if(a=cG.getUint32(r),a!=n[o++]){r=1879048192;break}r+=4}for(i+=3;r<i;)if(a=q[r++],a!=n[o++]){r=1879048192;break}if(r===i)return J=r,n.string;i-=3,r=J}for(n=[],RG[t]=n,n.bytes=e;r<i;)a=cG.getUint32(r),n.push(a),r+=4;for(i+=3;r<i;)a=q[r++],n.push(a);let s=e<16?PG(e):NG(e);return s==null?n.string=TG(e):n.string=s}function BG(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return e.toString();if(e==null)return e+``;if(eG.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every(e=>[`string`,`number`,`boolean`,`bigint`].includes(typeof e)))return e.flat().toString();throw Error(`Invalid property type for record: ${typeof e}`)}var VG=(e,t)=>{let n=bG().map(BG),r=e;t!==void 0&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let i=tG[e];return i&&(i.isShared||fG)&&((tG.restoreStructures||=[])[e]=i),tG[e]=n,n.read=SG(n,r),n.read()};sG[0]=()=>{},sG[0].noBuffer=!0,sG[66]=e=>{let t=e.byteLength%8||8,n=BigInt(e[0]&128?e[0]-256:e[0]);for(let r=1;r<t;r++)n<<=BigInt(8),n+=BigInt(e[r]);if(e.byteLength!==t){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=(e,t)=>{let n=t-e;if(n<=40){let n=r.getBigUint64(e);for(let i=e+8;i<t;i+=8)n<<=64n,n|=r.getBigUint64(i);return n}let a=e+(n>>4<<3),o=i(e,a),s=i(a,t);return o<<BigInt((t-a)*8)|s};n=n<<BigInt((r.byteLength-t)*8)|i(t,r.byteLength)}return n};var HG={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError==`function`?AggregateError:null};sG[101]=()=>{let e=bG();if(!HG[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return HG[e[0]](e[1],{cause:e[2]})},sG[105]=e=>{if(eG.structuredClone===!1)throw Error(`Structured clone extension is disabled`);let t=cG.getUint32(J-4);oG||=new Map;let n=q[J],r;r=n>=144&&n<160||n==220||n==221?[]:n>=128&&n<144||n==222||n==223?new Map:(n>=199&&n<=201||n>=212&&n<=216)&&q[J+1]===115?new Set:{};let i={target:r};oG.set(t,i);let a=bG();if(i.used)Object.assign(r,a);else return i.target=a;if(r instanceof Map)for(let[e,t]of a.entries())r.set(e,t);if(r instanceof Set)for(let e of Array.from(a))r.add(e);return r},sG[112]=e=>{if(eG.structuredClone===!1)throw Error(`Structured clone extension is disabled`);let t=cG.getUint32(J-4),n=oG.get(t);return n.used=!0,n.target},sG[115]=()=>new Set(bG());const UG=[`Int8`,`Uint8`,`Uint8Clamped`,`Int16`,`Uint16`,`Int32`,`Uint32`,`Float32`,`Float64`,`BigInt64`,`BigUint64`].map(e=>e+`Array`);var WG=typeof globalThis==`object`?globalThis:window;sG[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,r=UG[t];if(!r){if(t===16)return n;if(t===17)return new DataView(n);throw Error(`Could not find typed array for code `+t)}return new WG[r](n)},sG[120]=()=>{let e=bG();return new RegExp(e[0],e[1])};var GG=[];sG[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=J;return J+=t-e.length,aG=GG,aG=[FG(),FG()],aG.position0=0,aG.position1=0,aG.postBundlePosition=J,J=n,bG()},sG[255]=e=>e.length==4?new Date((e[0]*16777216+(e[1]<<16)+(e[2]<<8)+e[3])*1e3):e.length==8?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+((e[3]&3)*4294967296+e[4]*16777216+(e[5]<<16)+(e[6]<<8)+e[7])*1e3):e.length==12?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+((e[4]&128?-281474976710656:0)+e[6]*1099511627776+e[7]*4294967296+e[8]*16777216+(e[9]<<16)+(e[10]<<8)+e[11])*1e3):new Date(`invalid`);function KG(e){gG&&gG();let t=XW,n=J,r=$W,i=rG,a=iG,o=nG,s=QW,c=oG,l=aG,u=new Uint8Array(q.slice(0,XW)),d=tG,f=tG.slice(0,tG.length),p=eG,m=fG,h=e();return XW=t,J=n,$W=r,rG=i,iG=a,nG=o,QW=s,oG=c,aG=l,q=u,fG=m,tG=d,tG.splice(0,tG.length,...f),eG=p,cG=new DataView(q.buffer,q.byteOffset,q.byteLength),h}function qG(){q=null,oG=null,tG=null}const JG=Array(147);for(let e=0;e<256;e++)JG[e]=+(`1e`+Math.floor(45.15-e*.30103));var YG=new _G({useRecords:!1});YG.unpack,YG.unpackMultiple,YG.unpack;const XG={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};var ZG=new Float32Array(1);new Uint8Array(ZG.buffer,0,4);var QG;try{QG=new TextEncoder}catch{}var $G,eK,tK=typeof Buffer<`u`,nK=tK?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,rK=tK?Buffer:Uint8Array,iK=tK?4294967296:2144337920,Y,aK,oK,X=0,sK,cK=null,lK,uK=21760,dK=/[\u0080-\uFFFF]/;const fK=Symbol(`record-id`);var pK=class extends _G{constructor(e){super(e),this.offset=0;let t,n,r,i,a=rK.prototype.utf8Write?function(e,t){return Y.utf8Write(e,t,Y.byteLength-t)}:QG&&QG.encodeInto?function(e,t){return QG.encodeInto(e,Y.subarray(t)).written}:!1,o=this;e||={};let s=e&&e.sequential,c=e.structures||e.saveStructures,l=e.maxSharedStructures;if(l??=c?32:0,l>8160)throw Error(`Maximum maxSharedStructure is 8160`);e.structuredClone&&e.moreTypes==null&&(this.moreTypes=!0);let u=e.maxOwnStructures;u??=c?32:64,!this.structures&&e.useRecords!=0&&(this.structures=[]);let d=l>32||u+l>64,f=l+64,p=l+u+64;if(p>8256)throw Error(`Maximum maxSharedStructure + maxOwnStructure is 8192`);let m=[],h=0,g=0;this.pack=this.encode=function(e,a){if(Y||(Y=new nK(8192),oK=Y.dataView||=new DataView(Y.buffer,0,8192),X=0),sK=Y.length-10,sK-X<2048?(Y=new nK(Y.length),oK=Y.dataView||=new DataView(Y.buffer,0,Y.length),sK=Y.length-10,X=0):X=X+7&2147483640,t=X,a&2048&&(X+=a&255),i=o.structuredClone?new Map:null,o.bundleStrings&&typeof e!=`string`?(cK=[],cK.size=1/0):cK=null,r=o.structures,r){r.uninitialized&&(r=o._mergeStructures(o.getStructures()));let e=r.sharedLength||0;if(e>l)throw Error(`Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to `+r.sharedLength);if(!r.transitions){r.transitions=Object.create(null);for(let t=0;t<e;t++){let e=r[t];if(!e)continue;let n,i=r.transitions;for(let t=0,r=e.length;t<r;t++){let r=e[t];n=i[r],n||=i[r]=Object.create(null),i=n}i[fK]=t+64}this.lastNamedStructuresLength=e}s||(r.nextId=e+64)}n&&=!1;let c;try{o.randomAccessStructure&&e&&typeof e==`object`?e.constructor===Object?E(e):e.constructor!==Map&&!Array.isArray(e)&&!eK.some(t=>e instanceof t)?E(e.toJSON?e.toJSON():e):y(e):y(e);let n=cK;if(cK&&vK(t,y,0),i&&i.idsToInsert){let e=i.idsToInsert.sort((e,t)=>e.offset>t.offset?1:-1),r=e.length,a=-1;for(;n&&r>0;){let i=e[--r].offset+t;i<n.stringsPosition+t&&a===-1&&(a=0),i>n.position+t?a>=0&&(a+=6):(a>=0&&(oK.setUint32(n.position+t,oK.getUint32(n.position+t)+a),a=-1),n=n.previous,r++)}a>=0&&n&&oK.setUint32(n.position+t,oK.getUint32(n.position+t)+a),X+=e.length*6,X>sK&&w(X),o.offset=X;let s=_K(Y.subarray(t,X),e);return i=null,s}return o.offset=X,a&512?(Y.start=t,Y.end=X,Y):Y.subarray(t,X)}catch(e){throw c=e,e}finally{if(r&&(_(),n&&o.saveStructures)){let n=r.sharedLength||0,i=Y.subarray(t,X),s=yK(r,o);if(!c)return o.saveStructures(s,s.isCompatible)===!1?o.pack(e,a):(o.lastNamedStructuresLength=n,Y.length>1073741824&&(Y=null),i)}Y.length>1073741824&&(Y=null),a&1024&&(X=t)}};let _=()=>{g<10&&g++;let e=r.sharedLength||0;if(r.length>e&&!s&&(r.length=e),h>1e4)r.transitions=null,g=0,h=0,m.length>0&&(m=[]);else if(m.length>0&&!s){for(let e=0,t=m.length;e<t;e++)m[e][fK]=0;m=[]}},v=e=>{var t=e.length;t<16?Y[X++]=144|t:t<65536?(Y[X++]=220,Y[X++]=t>>8,Y[X++]=t&255):(Y[X++]=221,oK.setUint32(X,t),X+=4);for(let n=0;n<t;n++)y(e[n])},y=e=>{X>sK&&(Y=w(X));var n=typeof e,r;if(n===`string`){let n=e.length;if(cK&&n>=4&&n<4096){if((cK.size+=n)>uK){let e,n=(cK[0]?cK[0].length*3+cK[1].length:0)+10;X+n>sK&&(Y=w(X+n));let r;cK.position?(r=cK,Y[X]=200,X+=3,Y[X++]=98,e=X-t,X+=4,vK(t,y,0),oK.setUint16(e+t-3,X-t-e)):(Y[X++]=214,Y[X++]=98,e=X-t,X+=4),cK=[``,``],cK.previous=r,cK.size=0,cK.position=e}let r=dK.test(e);cK[r?0:1]+=e,Y[X++]=193,y(r?-n:n);return}let i;i=n<32?1:n<256?2:n<65536?3:5;let o=n*3;if(X+o>sK&&(Y=w(X+o)),n<64||!a){let t,a,o,s=X+i;for(t=0;t<n;t++)a=e.charCodeAt(t),a<128?Y[s++]=a:a<2048?(Y[s++]=a>>6|192,Y[s++]=a&63|128):(a&64512)==55296&&((o=e.charCodeAt(t+1))&64512)==56320?(a=65536+((a&1023)<<10)+(o&1023),t++,Y[s++]=a>>18|240,Y[s++]=a>>12&63|128,Y[s++]=a>>6&63|128,Y[s++]=a&63|128):(Y[s++]=a>>12|224,Y[s++]=a>>6&63|128,Y[s++]=a&63|128);r=s-X-i}else r=a(e,X+i);r<32?Y[X++]=160|r:r<256?(i<2&&Y.copyWithin(X+2,X+1,X+1+r),Y[X++]=217,Y[X++]=r):r<65536?(i<3&&Y.copyWithin(X+3,X+2,X+2+r),Y[X++]=218,Y[X++]=r>>8,Y[X++]=r&255):(i<5&&Y.copyWithin(X+5,X+3,X+3+r),Y[X++]=219,oK.setUint32(X,r),X+=4),X+=r}else if(n===`number`)if(e>>>0===e)e<32||e<128&&this.useRecords===!1||e<64&&!this.randomAccessStructure?Y[X++]=e:e<256?(Y[X++]=204,Y[X++]=e):e<65536?(Y[X++]=205,Y[X++]=e>>8,Y[X++]=e&255):(Y[X++]=206,oK.setUint32(X,e),X+=4);else if(e>>0===e)e>=-32?Y[X++]=256+e:e>=-128?(Y[X++]=208,Y[X++]=e+256):e>=-32768?(Y[X++]=209,oK.setInt16(X,e),X+=2):(Y[X++]=210,oK.setInt32(X,e),X+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){Y[X++]=202,oK.setFloat32(X,e);let n;if(t<4||(n=e*JG[(Y[X]&127)<<1|Y[X+1]>>7])>>0===n){X+=4;return}else X--}Y[X++]=203,oK.setFloat64(X,e),X+=8}else if(n===`object`||n===`function`)if(!e)Y[X++]=192;else{if(i){let n=i.get(e);if(n){n.id||=(i.idsToInsert||=[]).push(n),Y[X++]=214,Y[X++]=112,oK.setUint32(X,n.id),X+=4;return}else i.set(e,{offset:X-t})}let a=e.constructor;if(a===Object)C(e);else if(a===Array)v(e);else if(a===Map)if(this.mapAsEmptyObject)Y[X++]=128;else{r=e.size,r<16?Y[X++]=128|r:r<65536?(Y[X++]=222,Y[X++]=r>>8,Y[X++]=r&255):(Y[X++]=223,oK.setUint32(X,r),X+=4);for(let[t,n]of e)y(t),y(n)}else{for(let t=0,n=$G.length;t<n;t++){let n=eK[t];if(e instanceof n){let n=$G[t];if(n.write){n.type&&(Y[X++]=212,Y[X++]=n.type,Y[X++]=0);let t=n.write.call(this,e);t===e?Array.isArray(e)?v(e):C(e):y(t);return}let r=Y,i=oK,a=X;Y=null;let o;try{o=n.pack.call(this,e,e=>(Y=r,r=null,X+=e,X>sK&&w(X),{target:Y,targetView:oK,position:X-e}),y)}finally{r&&(Y=r,oK=i,X=a,sK=Y.length-10)}o&&(o.length+X>sK&&w(o.length+X),X=gK(o,Y,X,n.type));return}}if(Array.isArray(e))v(e);else{if(e.toJSON){let t=e.toJSON();if(t!==e)return y(t)}if(n===`function`)return y(this.writeFunction&&this.writeFunction(e));C(e)}}}else if(n===`boolean`)Y[X++]=e?195:194;else if(n===`bigint`){if(e<0x8000000000000000&&e>=-0x8000000000000000)Y[X++]=211,oK.setBigInt64(X,e);else if(e<0x10000000000000000&&e>0)Y[X++]=207,oK.setBigUint64(X,e);else if(this.largeBigIntToFloat)Y[X++]=203,oK.setFloat64(X,Number(e));else if(this.largeBigIntToString)return y(e.toString());else if(this.useBigIntExtension||this.moreTypes){let t=e<0?BigInt(-1):BigInt(0),n;if(e>>BigInt(65536)===t){let r=BigInt(0x10000000000000000)-BigInt(1),i=[];for(;i.push(e&r),e>>BigInt(63)!==t;)e>>=BigInt(64);n=new Uint8Array(new BigUint64Array(i).buffer),n.reverse()}else{let t=e<0,r=(t?~e:e).toString(16);if(r.length%2?r=`0`+r:parseInt(r.charAt(0),16)>=8&&(r=`00`+r),tK)n=Buffer.from(r,`hex`);else{n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++)n[e]=parseInt(r.slice(e*2,e*2+2),16)}if(t)for(let e=0;e<n.length;e++)n[e]=~n[e]}n.length+X>sK&&w(n.length+X),X=gK(n,Y,X,66);return}else throw RangeError(e+` was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string`);X+=8}else if(n===`undefined`)this.encodeUndefinedAsNil?Y[X++]=192:(Y[X++]=212,Y[X++]=0,Y[X++]=0);else throw Error(`Unknown type: `+n)},b=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?e=>{let t;if(this.skipValues)for(let n in t=[],e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(n))&&!this.skipValues.includes(e[n])&&t.push(n);else t=Object.keys(e);let n=t.length;n<16?Y[X++]=128|n:n<65536?(Y[X++]=222,Y[X++]=n>>8,Y[X++]=n&255):(Y[X++]=223,oK.setUint32(X,n),X+=4);let r;if(this.coercibleKeyAsNumber)for(let i=0;i<n;i++){r=t[i];let n=Number(r);y(isNaN(n)?r:n),y(e[r])}else for(let i=0;i<n;i++)y(r=t[i]),y(e[r])}:e=>{Y[X++]=222;let n=X-t;X+=2;let r=0;for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(y(t),y(e[t]),r++);if(r>65535)throw Error(`Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object`);Y[n+++t]=r>>8,Y[n+t]=r&255},x=this.useRecords===!1?b:e.progressiveRecords&&!d?e=>{let n,i=r.transitions||=Object.create(null),a=X++-t,o;for(let s in e)if(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(s)){if(n=i[s],n)i=n;else{let c=Object.keys(e),l=i;i=r.transitions;let u=0;for(let e=0,t=c.length;e<t;e++){let t=c[e];n=i[t],n||(n=i[t]=Object.create(null),u++),i=n}a+t+1==X?(X--,T(i,c,u)):ee(i,c,a,u),o=!0,i=l[s]}y(e[s])}if(!o){let n=i[fK];n?Y[a+t]=n:ee(i,Object.keys(e),a,0)}}:e=>{let t,n=r.transitions||=Object.create(null),i=0;for(let r in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(r))&&(t=n[r],t||(t=n[r]=Object.create(null),i++),n=t);let a=n[fK];for(let t in a?a>=96&&d?(Y[X++]=((a-=96)&31)+96,Y[X++]=a>>5):Y[X++]=a:T(n,n.__keys__||Object.keys(e),i),e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&y(e[t])},S=typeof this.useRecords==`function`&&this.useRecords,C=S?e=>{S(e)?x(e):b(e)}:x,w=e=>{let n;if(e>16777216){if(e-t>iK)throw Error(`Packed buffer would be larger than maximum buffer size`);n=Math.min(iK,Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096)*4096)}else n=(Math.max(e-t<<2,Y.length-1)>>12)+1<<12;let r=new nK(n);return oK=r.dataView||=new DataView(r.buffer,0,n),e=Math.min(e,Y.length),Y.copy?Y.copy(r,0,t,e):r.set(Y.slice(t,e)),X-=t,t=0,sK=r.length-10,Y=r},T=(e,t,i)=>{let a=r.nextId;a||=64,a<f&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(a=r.nextOwnId,a<p||(a=f),r.nextOwnId=a+1):(a>=p&&(a=f),r.nextId=a+1);let o=t.highByte=a>=96&&d?a-96>>5:-1;e[fK]=a,e.__keys__=t,r[a-64]=t,a<f?(t.isShared=!0,r.sharedLength=a-63,n=!0,o>=0?(Y[X++]=(a&31)+96,Y[X++]=o):Y[X++]=a):(o>=0?(Y[X++]=213,Y[X++]=114,Y[X++]=(a&31)+96,Y[X++]=o):(Y[X++]=212,Y[X++]=114,Y[X++]=a),i&&(h+=g*i),m.length>=u&&(m.shift()[fK]=0),m.push(e),y(t))},ee=(e,n,r,i)=>{let a=Y,o=X,s=sK,c=t;Y=aK,X=0,t=0,Y||(aK=Y=new nK(8192)),sK=Y.length-10,T(e,n,i),aK=Y;let l=X;if(Y=a,X=o,sK=s,t=c,l>1){let e=X+l-1;e>sK&&w(e);let n=r+t;Y.copyWithin(n+l,n+1,X),Y.set(aK.slice(0,l),n),X=e}else Y[r+t]=aK[0]},E=e=>{let i=lK(e,Y,t,X,r,w,(e,t,r)=>{if(r)return n=!0;X=t;let i=Y;return y(e),_(),i===Y?X:{position:X,targetView:oK,target:Y}},this);if(i===0)return C(e);X=i}}useBuffer(e){Y=e,Y.dataView||=new DataView(Y.buffer,Y.byteOffset,Y.byteLength),oK=Y.dataView,X=0}set position(e){X=e}get position(){return X}clearSharedData(){this.structures&&=[],this.typedStructs&&=[]}};eK=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,uG],$G=[{pack(e,t,n){let r=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&r>=0&&r<4294967296){let{target:e,targetView:n,position:i}=t(6);e[i++]=214,e[i++]=255,n.setUint32(i,r)}else if(r>0&&r<4294967296){let{target:n,targetView:i,position:a}=t(10);n[a++]=215,n[a++]=255,i.setUint32(a,e.getMilliseconds()*4e6+(r/1e3/4294967296>>0)),i.setUint32(a+4,r)}else if(isNaN(r)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:e,targetView:r,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:n,targetView:i,position:a}=t(15);n[a++]=199,n[a++]=12,n[a++]=255,i.setUint32(a,e.getMilliseconds()*1e6),i.setBigInt64(a+4,BigInt(Math.floor(r)))}}},{pack(e,t,n){if(this.setAsEmptyObject)return t(0),n({});let r=Array.from(e),{target:i,position:a}=t(this.moreTypes?3:0);this.moreTypes&&(i[a++]=212,i[a++]=115,i[a++]=0),n(r)}},{pack(e,t,n){let{target:r,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(r[i++]=212,r[i++]=101,r[i++]=0),n([e.name,e.message,e.cause])}},{pack(e,t,n){let{target:r,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(r[i++]=212,r[i++]=120,r[i++]=0),n([e.source,e.flags])}},{pack(e,t){this.moreTypes?mK(e,16,t):hK(tK?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==rK&&this.moreTypes?mK(e,UG.indexOf(n.name),t):hK(e,t)}},{pack(e,t){this.moreTypes?mK(e,17,t):hK(tK?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:r}=t(1);n[r]=193}}];function mK(e,t,n,r){let i=e.byteLength;if(i+1<256){var{target:a,position:o}=n(4+i);a[o++]=199,a[o++]=i+1}else if(i+1<65536){var{target:a,position:o}=n(5+i);a[o++]=200,a[o++]=i+1>>8,a[o++]=i+1&255}else{var{target:a,position:o,targetView:s}=n(7+i);a[o++]=201,s.setUint32(o,i+1),o+=4}a[o++]=116,a[o++]=t,e.buffer||(e=new Uint8Array(e)),a.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function hK(e,t){let n=e.byteLength;var r,i;if(n<256){var{target:r,position:i}=t(n+2);r[i++]=196,r[i++]=n}else if(n<65536){var{target:r,position:i}=t(n+3);r[i++]=197,r[i++]=n>>8,r[i++]=n&255}else{var{target:r,position:i,targetView:a}=t(n+5);r[i++]=198,a.setUint32(i,n),i+=4}r.set(e,i)}function gK(e,t,n,r){let i=e.length;switch(i){case 1:t[n++]=212;break;case 2:t[n++]=213;break;case 4:t[n++]=214;break;case 8:t[n++]=215;break;case 16:t[n++]=216;break;default:i<256?(t[n++]=199,t[n++]=i):i<65536?(t[n++]=200,t[n++]=i>>8,t[n++]=i&255):(t[n++]=201,t[n++]=i>>24,t[n++]=i>>16&255,t[n++]=i>>8&255,t[n++]=i&255)}return t[n++]=r,t.set(e,n),n+=i,n}function _K(e,t){let n,r=t.length*6,i=e.length-r;for(;n=t.pop();){let t=n.offset,a=n.id;e.copyWithin(t+r,t,i),r-=6;let o=t+r;e[o++]=214,e[o++]=105,e[o++]=a>>24,e[o++]=a>>16&255,e[o++]=a>>8&255,e[o++]=a&255,i=t}return e}function vK(e,t,n){if(cK.length>0){oK.setUint32(cK.position+e,X+n-cK.position-e),cK.stringsPosition=X-e;let r=cK;cK=null,t(r[0]),t(r[1])}}function yK(e,t){return e.isCompatible=e=>{let n=!e||(t.lastNamedStructuresLength||0)===e.length;return n||t._mergeStructures(e),n},e}var bK=new pK({useRecords:!1});bK.pack,bK.pack;const{NEVER:Boe,ALWAYS:Voe,DECIMAL_ROUND:Hoe,DECIMAL_FIT:Uoe}=XG;var xK=class extends hp(`@effect/platform/Transferable/Collector`)(){};const SK=()=>{let e=[],t=t=>{e.push(...t)},n=()=>e,r=()=>{let t=e;return e=[],t};return xK.of({unsafeAddAll:t,addAll:e=>VA(()=>t(e)),unsafeRead:n,read:VA(n),unsafeClear:r,clear:VA(r)})},CK=Symbol.for(`effect/PrimaryKey`),wK=Symbol.for(`@effect/rpc/RpcSchema/Stream`),TK=e=>e.ast.annotations[eR]===wK,EK=e=>e.annotations[wK]?B(e.annotations[wK]):z(),DK=({failure:e,success:t})=>Object.assign(FB([t,e],{decode:(e,t)=>kK(Gz(KV(e)),Gz(t)),encode:(e,t)=>kK(Kz(KV(e)),Kz(t))},{schemaId:wK,[wK]:{success:t,failure:e}}),{success:t,failure:e});var OK=e=>M(e,MH),kK=(e,t)=>(n,r,i)=>G(vj(),a=>OK(n)?zA(n.pipe(RH(t=>e(t,r)),NH(e=>ooe(e)?PH(e):qre(t(e,r),{onFailure:PA,onSuccess:MA})),zH(a))):MA(new Az(i,n)));const AK=Symbol.for(`@effect/rpc/Rpc`);var jK={[AK]:AK,pipe(){return L(this,arguments)},setSuccess(e){return MK({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return MK({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return MK({_tag:this._tag,payloadSchema:OB(e)?e:vV(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return MK({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return MK({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return MK({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:lp(this.annotations,e,t)})},annotateContext(e){return MK({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:pp(this.annotations,e)})}},MK=e=>{function t(){}return Object.setPrototypeOf(t,jK),Object.assign(t,e),t.key=`@effect/rpc/Rpc/${e._tag}`,t};const NK=(e,t)=>{let n=t?.success??LB,r=t?.error??zB,i;return i=t?.primaryKey?class extends QV(`@effect/rpc/Rpc/${e}`)(t.payload){[CK](){return t.primaryKey(this)}}:OB(t?.payload)?t?.payload:t?.payload?vV(t?.payload):LB,MK({_tag:e,payloadSchema:i,successSchema:t?.stream?DK({success:n,failure:r}):n,errorSchema:t?.stream?zB:r,defectSchema:t?.defect??SH,annotations:sp(),middlewares:new Set})},PK=e=>MK({_tag:e._tag,payloadSchema:e,successSchema:e.success,errorSchema:e.failure,defectSchema:SH,annotations:sp(),middlewares:new Set});var FK=La(`@effect/rpc/Rpc/exitSchemaCache`,()=>new WeakMap);const IK=e=>{if(FK.has(e))return FK.get(e);let t=e,n=new Set([t.errorSchema]),r=EK(t.successSchema.ast);sc(r)&&n.add(r.value.failure);for(let e of t.middlewares)n.add(e.failure);let i=jH({success:sc(r)?LB:t.successSchema,failure:GB(...n),defect:t.defectSchema});return FK.set(e,i),i},LK=Symbol.for(`@effect/rpc/Rpc/Wrapper`),RK=e=>LK in e,zK=()=>e=>BA(()=>{let t=Yre(1),n=[],r=(...e)=>yj(t=>{n.push([e,t])});return nj(e((...e)=>r(...e)),e=>({...e,run(e){return t.withPermits(1)(IA(function*(){let t=r;r=e;for(let[e,t]of n)yield*xj(r(...e),t);return n=[],yield*lj(LA,()=>(r=t,HA))}))}}))}),BK=Symbol.for(`@effect/rpc/RpcClientError`);var VK=class extends eH(`@effect/rpc/RpcClientError`)(`RpcClientError`,{reason:jB(`Protocol`,`Unknown`),message:K,cause:pV(SH)}){[BK]=BK};const HK=e=>typeof e==`bigint`?e:BigInt(e);var UK=class extends hp(`@effect/rpc/RpcSerialization`)(){};const WK=sie(UK,UK.of({contentType:`application/ndjson`,includesFraming:!0,unsafeMake:()=>{let e=new TextDecoder,t=``;return{decode:n=>{t+=typeof n==`string`?n:e.decode(n);let r=0,i=t.indexOf(`
|
|
28
|
+
`,r),a=[];for(;i!==-1;){let e=JSON.parse(t.slice(r,i));a.push(e),r=i+1,i=t.indexOf(`
|
|
29
|
+
`,r)}return t=t.slice(r),a},encode:e=>{if(Array.isArray(e)){if(e.length===0)return;let t=``;for(let n=0;n<e.length;n++)t+=JSON.stringify(e[n])+`
|
|
30
|
+
`;return t}return JSON.stringify(e)+`
|
|
31
|
+
`}}}}));var GK=BigInt(0);const KK=Hj(function*(e,t){let n=t?.spanPrefix??`RpcClient`,r=t?.supportsAck??!0,i=t?.disableTracing??!1,a=t?.generateRequestId??(()=>GK++),o=yield*vj(),s=up(o,MD),c=new Map,l=!1;yield*ND(s,BA(()=>(l=!0,u(gw(qK)))));let u=Hj(function*(e){for(let[t,n]of c)c.delete(t),n._tag===`Mailbox`?yield*n.mailbox.done(e):n.resume(e)}),d=e=>{let r=TK(e.successSchema),a=m(e);return(o,s)=>{let c=s?.headers?sU(s.headers):oU,l=s?.context??sp();if(!r){let r=t=>f(e,a,t,e.payloadSchema.make?e.payloadSchema.make(o):o,c,l,s?.discard??!1);return i?r(void 0):Bj(`${n}.${e._tag}`,{captureStackTrace:!1,attributes:t.spanAttributes},r)}let u=p(e,a,e.payloadSchema.make?e.payloadSchema.make(o):o,c,s?.streamBufferSize??16,l);return s?.asMailbox?u:UH(nj(u,GW))}},f=(e,n,r,i,o,s,u)=>jA(d=>{if(l)return YA;let f=a(),p=n({_tag:`Request`,id:f,tag:e._tag,payload:i,traceId:r?.traceId,spanId:r?.spanId,sampled:r?.sampled,headers:dU(d.getFiberRef(YK),o)});if(u)return G(p,e=>t.onFromClient({message:e,context:s,discard:u}));let m=LF({context:d.currentContext,fiberRefs:d.getFiberRefs(),runtimeFlags:IF.runtimeFlags}),g,_=!1;return ZA(AA(n=>{let i={_tag:`Effect`,rpc:e,context:s,resume(e){_=!0,n(e),g&&!g.unsafePoll()&&d.currentScheduler.scheduleTask(()=>{g.unsafeInterruptAsFork(d.id())},0)}};c.set(f,i),g=p.pipe(G(e=>t.onFromClient({message:e,context:s,discard:u})),r?Vj(r):Ea,FF(m)),g.addObserver(e=>{if(e._tag===`Failure`)return n(e)})}),e=>{if(_)return HA;c.delete(f);let t=Array.from(e).flatMap(e=>Array.from(Dm(e)));return Rj(tO(g),h(f,t,s))})}),p=Hj(function*(e,r,o,s,u,d){if(l)return yield*YA;let f=i?void 0:yield*tie(`${n}.${e._tag}`,{captureStackTrace:!1,attributes:t.spanAttributes}),p=hc($D()),m=a(),g=dp(p.currentContext,MD);yield*PD(g,e=>c.has(m)?(c.delete(m),h(m,cw(e)?Array.from(Ky(e.cause)).flatMap(e=>Array.from(Dm(e))):[],d)):HA);let _=yield*WW(u);return c.set(m,{_tag:`Mailbox`,rpc:e,mailbox:_,scope:g,context:d}),yield*r({_tag:`Request`,id:m,tag:e._tag,traceId:f?.traceId,payload:o,spanId:f?.spanId,sampled:f?.sampled,headers:dU(p.getFiberRef(YK),s)}).pipe(G(e=>t.onFromClient({message:e,context:d,discard:!1})),f?Vj(f):Ea,WA(e=>_.failCause(e)),XA,hj(g)),_}),m=e=>{let t=[];for(let n of e.middlewares.values()){let e=o.unsafeMap.get(`${n.key}/Client`);e&&t.push(e)}return t.length===0?zA:function(n){let r=0;return nj(Aj({while:()=>r<t.length,body:()=>t[r]({rpc:e,request:n}),step(e){n=e,r++}}),()=>n)}},h=(e,n,r)=>AA(i=>{let a=hc($D()),o=LF({context:a.currentContext,fiberRefs:a.getFiberRefs(),runtimeFlags:IF.runtimeFlags});t.onFromClient({message:{_tag:`Interrupt`,requestId:e,interruptors:n},context:r,discard:!1}).pipe(_j(1e3),FF(o)).addObserver(()=>{i(HA)})}),g=e=>{switch(e._tag){case`Chunk`:{let n=e.requestId,i=c.get(n);return!i||i._tag!==`Mailbox`?HA:i.mailbox.offerAll(e.values).pipe(r?Rj(t.onFromClient({message:{_tag:`Ack`,requestId:e.requestId},context:i.context,discard:!1})):Ea,WA(e=>i.mailbox.done(mw(e))))}case`Exit`:{let t=e.requestId,n=c.get(t);return n?(c.delete(t),n._tag===`Effect`?(n.resume(e.exit),HA):n.mailbox.done(uw(e.exit))):HA}case`Defect`:return u(fw(e.defect));case`ClientEnd`:return HA}},_;if(t.flatten){let t=new Map;_=function(n,r,i){let a=t.get(n);return a||(a=d(e.requests.get(n)),t.set(n,a)),a(r,i)}}else{_={};for(let t of e.requests.values()){let e=t._tag.indexOf(`.`),n=e===-1?void 0:t._tag.slice(0,e);n!==void 0&&!(n in _)&&(_[n]={});let r=n===void 0?_:_[n],i=n===void 0?t._tag:t._tag.slice(e+1);r[i]=d(t)}}return{client:_,write:g}});var qK=Tm(-503,0);const JK=Hj(function*(e,t){let{run:n,send:r,supportsAck:i,supportsTransferables:a}=yield*XK,o=new Map,{client:s,write:c}=yield*KK(e,{...t,supportsAck:i,onFromClient({message:t}){switch(t._tag){case`Request`:{let n=e.requests.get(t.tag),i=EK(n.successSchema.ast),s=a?SK():void 0,c=hc($D()),l={rpc:n,context:s?lp(c.currentContext,xK,s):c.currentContext,decodeChunk:sc(i)?EB($B(i.value.success)):void 0};return o.set(t.id,l),TB(n.payloadSchema)(t.payload).pipe(jj(Wj,l.context),Pj,G(e=>r({...t,id:String(t.id),payload:e,headers:Object.entries(t.headers)},s&&s.unsafeClear())))}case`Ack`:return o.get(t.requestId)?r({_tag:`Ack`,requestId:String(t.requestId)}):HA;case`Interrupt`:return o.get(t.requestId)?(o.delete(t.requestId),r({_tag:`Interrupt`,requestId:String(t.requestId)})):HA;case`Eof`:return HA}}});return yield*n(e=>{switch(e._tag){case`Chunk`:{let t=HK(e.requestId),n=o.get(t);return!n||!n.decodeChunk?HA:n.decodeChunk(e.values).pipe(jj(Wj,n.context),Pj,G(t=>c({_tag:`Chunk`,clientId:0,requestId:HK(e.requestId),values:t})),cj(t=>c({_tag:`Exit`,clientId:0,requestId:HK(e.requestId),exit:mw(t)})))}case`Exit`:{let t=HK(e.requestId),n=o.get(t);return n?(o.delete(t),DB(IK(n.rpc))(e.exit).pipe(jj(Wj,n.context),Pj,Nj({onSuccess:e=>c({_tag:`Exit`,clientId:0,requestId:t,exit:e}),onFailure:e=>c({_tag:`Exit`,clientId:0,requestId:t,exit:mw(e)})}))):HA}case`Defect`:return o.clear(),c({_tag:`Defect`,clientId:0,defect:$K(e.defect)});case`ClientProtocolError`:{let t=pw(e.error);return kA(o.keys(),e=>(o.delete(e),c({_tag:`Exit`,clientId:0,requestId:e,exit:t})))}default:return HA}}).pipe(WA(Jre),XA,gj),s}),YK=La(`@effect/rpc/RpcClient/currentHeaders`,()=>Uj(oU));var XK=class extends hp(`@effect/rpc/RpcClient/Protocol`)(){static make=zK()};const ZK=e=>XK.make(Hj(function*(t){let n=yield*UK,r=n.contentType===`application/json`;return{send:i=>{if(i._tag!==`Request`)return HA;let a=n.unsafeMake(),o=a.encode(i),s=typeof o==`string`?MW(o,n.contentType):jW(o,n.contentType);return r?e.post(``,{body:s}).pipe(G(e=>e.json),ij(e=>new VK({reason:`Protocol`,message:`Failed to send HTTP request`,cause:e})),G(e=>{if(!Array.isArray(e))return FA(`Expected an array of responses, but got: ${e}`);let n=0;return Aj({while:()=>n<e.length,body:()=>t(e[n++]),step:ja})})):e.post(``,{body:s}).pipe(G(e=>BH(e.stream,e=>{let n=Ml(e).flatMap(a.decode);if(n.length===0)return HA;let r=0;return Aj({while:()=>r<n.length,body:()=>t(n[r++]),step:ja})})),ij(e=>new VK({reason:`Protocol`,message:`Failed to send HTTP request`,cause:e})))},supportsAck:!1,supportsTransferables:!1}})),QK=e=>oie(XK,G(KW,t=>(t=qW(t,JW(e.url)),ZK(e.transformClient?e.transformClient(t):t))));var $K=doe(SH),eq={add(...e){return tq({requests:nq(...this.requests.values(),...e),annotations:this.annotations})},merge(...e){let t=new Map(this.requests),n=new Map(this.annotations.unsafeMap);for(let r of e){for(let[e,n]of r.requests)t.set(e,n);for(let[e,t]of r.annotations.unsafeMap)n.set(e,t)}return tq({requests:t,annotations:ip(n)})},middleware(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.middleware(e));return tq({requests:t,annotations:this.annotations})},toHandlersContext(e){return IA(this,function*(){let t=yield*vj(),n=CA(e)?yield*e:e,r=new Map;for(let[e,i]of Object.entries(n)){let n=this.requests.get(e);r.set(n.key,{handler:i,context:t})}return ip(r)})},prefix(e){let t=new Map;for(let n of this.requests.values()){let r=n.prefix(e);t.set(r._tag,r)}return tq({requests:t,annotations:this.annotations})},toLayer(e){return Gj(this.toHandlersContext(e))},of:Ea,toLayerHandler(e,t){return Gj(IA(this,function*(){let n=yield*vj(),r=CA(t)?yield*t:t,i=new Map,a=this.requests.get(e);return i.set(a.key,{handler:r,context:n}),ip(i)}))},accessHandler(e){return yj(t=>{let n=this.requests.get(e),{context:r,handler:i}=t.unsafeMap.get(n.key);return(e,t)=>{let n=i(e,t),a=RK(n)?n.value:n;return CA(a)?xj(a,r):zH(a,r)}})},annotate(e,t){return tq({requests:this.requests,annotations:lp(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsContext(cp(e,t))},annotateContext(e){return tq({requests:this.requests,annotations:pp(this.annotations,e)})},annotateRpcsContext(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.annotateContext(pp(e,r.annotations)));return tq({requests:t,annotations:this.annotations})}},tq=e=>Object.assign(function(){},eq,{requests:e.requests,annotations:e.annotations}),nq=(...e)=>{let t=new Map;for(let n of e)t.set(n._tag,OB(n)?PK(n):n);return t};const rq=(...e)=>tq({requests:nq(...e),annotations:sp()});function iq(e,t){return V(e.runtimeEffect,e=>Gg(n=>(n.setFiberRefs(e.fiberRefs),n.currentRuntimeFlags=e.runtimeFlags,Ay(t,e.context))))}var aq={...Ate,[XD]:XD,pipe(){return L(this,arguments)},commit(){return this.runtimeEffect}};const oq=(e,t)=>{t??=NO();let n=wO(dD()),r,i=U(()=>{if(!r){let i=new iC;r=SO(j_(ID(tk(e,t),n),e=>{a.cachedRuntime=e}),{scope:n,scheduler:i}),i.flush()}return p_(r.await)}),a=Object.assign(Object.create(aq),{memoMap:t,scope:n,runtimeEffect:i,cachedRuntime:void 0,runtime(){return a.cachedRuntime===void 0?CO(a.runtimeEffect):Promise.resolve(a.cachedRuntime)},dispose(){return CO(a.disposeEffect)},disposeEffect:U(()=>(a.runtimeEffect=r_(`ManagedRuntime disposed`),a.cachedRuntime=void 0,FD(a.scope,uy))),runFork(e,t){return a.cachedRuntime===void 0?SO(iq(a,e),t):aO(a.cachedRuntime)(e,t)},runSyncExit(e){return a.cachedRuntime===void 0?Ere(iq(a,e)):hO(a.cachedRuntime)(e)},runSync(e){return a.cachedRuntime===void 0?wO(iq(a,e)):sO(a.cachedRuntime)(e)},runPromiseExit(e,t){return a.cachedRuntime===void 0?Tre(iq(a,e),t):_O(a.cachedRuntime)(e,t)},runCallback(e,t){return a.cachedRuntime===void 0?oO(xO)(iq(a,e),t):oO(a.cachedRuntime)(e,t)},runPromise(e,t){return a.cachedRuntime===void 0?CO(iq(a,e),t):gO(a.cachedRuntime)(e,t)}});return a},sq=GB(class extends eH()(`IssueNotFound`,{identifier:K,message:K}){},class extends eH()(`OrchestratorUnavailable`,{message:K}){}),cq=jB(`agent_start`,`agent_end`,`turn_start`,`turn_end`,`message_start`,`message_update`,`message_end`,`tool_execution_start`,`tool_execution_update`,`tool_execution_end`,`auto_compaction_start`,`auto_compaction_end`,`auto_retry_start`,`auto_retry_end`,`notification`);var lq=class extends QV(`AgentRuntimeEvent`)({event:cq,timestamp:HV,agentPid:KB(K),issueId:K,issueIdentifier:K,sessionId:KB(K),message:KB(K),usage:pV(vV({inputTokens:VB,outputTokens:VB,totalTokens:VB})),toolCallId:pV(K),toolName:pV(K),isError:pV(HB)}){},uq=class extends QV(`WorkpadSection`)({title:K,body:K,itemCount:VB}){},dq=class extends QV(`TrackerRunContext`)({raw:KB(K),promptContext:KB(K),workpad:KB(K),reviewFeedback:KB(K),workpadSections:ZB(uq)}){},fq=class extends QV(`ToolExecution`)({toolCallId:K,toolName:K}){};const pq=jB(`idle`,`thinking`,`tool_execution`,`compacting`,`retrying`);var mq=class extends QV(`LiveSession`)({sessionId:K,threadId:K,turnId:K,agentPid:KB(K),lastEvent:KB(K),lastEventAt:KB(HV),lastMessage:KB(K),inputTokens:VB,outputTokens:VB,totalTokens:VB,turnCount:VB,phase:pq,activeTools:ZB(fq),lastAssistantMessage:KB(K)}){},hq=class extends QV(`RunningEntry`)({issueId:K,issueIdentifier:K,state:K,startedAt:HV,workspacePath:KB(K),session:mq}){},gq=class extends QV(`RetryEntry`)({issueId:K,identifier:K,attempt:VB,dueAt:HV,error:KB(K)}){};const _q=jB(`system`,`user`);var vq=class extends QV(`PromptSection`)({id:K,title:K,kind:_q,content:K,charCount:VB}){},yq=class extends QV(`PromptSnapshot`)({system:K,user:K,stablePrefix:K,stablePrefixHash:K,systemCharCount:VB,userCharCount:VB,systemSections:ZB(vq),userSections:ZB(vq)}){},bq=class extends QV(`TokenTotals`)({inputTokens:VB,outputTokens:VB,totalTokens:VB,secondsRunning:VB}){},xq=class extends QV(`RuntimeObservability`)({commandQueueDepth:VB,commandQueuePeak:VB,commandQueuePressureCount:VB,staleRetryDropCount:VB,retriesScheduledByReason:vV({continuation:VB,failure:VB,backpressure:VB}),workerStopsByReason:vV({terminal:VB,inactive:VB,stalled:VB}),workerExitsByReason:vV({success:VB,interrupted:VB,failure:VB})}){};const Sq=jB(`running`,`retrying`);var Cq=class extends QV(`RuntimeSnapshot`)({generatedAt:HV,counts:vV({running:VB,retrying:VB}),running:ZB(hq),retrying:ZB(gq),codexTotals:bq,observability:xq,rateLimits:RB}){},wq=class extends QV(`IssueDetail`)({issueIdentifier:K,issueId:K,status:Sq,workspacePath:KB(K),running:KB(hq),retry:KB(gq),lastError:KB(K),eventTail:ZB(lq),promptSnapshot:KB(yq),runContext:KB(dq)}){},Tq=class extends QV(`IssueEventLog`)({issueId:K,issueIdentifier:K,events:ZB(lq)}){},Eq=class extends QV(`RefreshResult`)({queued:HB,coalesced:HB,requestedAt:HV,operations:ZB(K)}){},Dq=class extends rq(NK(`GetState`,{success:Cq,error:sq}),NK(`GetIssue`,{success:wq,error:sq,payload:{identifier:K}}),NK(`TriggerRefresh`,{success:Eq,error:sq}),NK(`GetEventLog`,{success:Tq,error:sq,payload:{identifier:K}})){};const Oq=e=>{let t=oq(QK({url:e}).pipe(cie([AW,WK]))),n=e=>t.runPromise(e),r=JK(Dq);return{getState:()=>n(fj(G(r,e=>e.GetState()))),getIssue:e=>n(fj(G(r,t=>t.GetIssue({identifier:e})))),getEventLog:e=>n(fj(G(r,t=>t.GetEventLog({identifier:e})))),triggerRefresh:()=>n(fj(G(r,e=>e.TriggerRefresh())))}};var kq=Wz(lq);function Aq(e,t,n){let r=!1,i=null,a=new AbortController,o=async(e,i,a=``)=>{if(r)return;let{done:s,value:c}=await e.read();if(s||!c){n(`disconnected`);return}let l=(a+i.decode(c,{stream:!0})).split(`
|
|
32
|
+
`),u=l.pop()??``;for(let e of l)if(e.startsWith(`data: `))try{t(kq(JSON.parse(e.slice(6))))}catch(e){typeof console<`u`&&console.warn(`plot sse parse:`,e instanceof Error?e.message:String(e))}return o(e,i,u)},s=()=>{r||(n(`reconnecting`),i=setTimeout(()=>{a=new AbortController,c()},2e3))},c=async()=>{if(!r){n(`connecting`);try{let t=await fetch(e,{signal:a.signal,headers:{Accept:`text/event-stream`}});if(!t.ok||!t.body)throw Error(`SSE fetch failed: ${t.status}`);n(`connected`),await o(t.body.getReader(),new TextDecoder)}catch(e){if(r)return;n(`disconnected`),typeof console<`u`&&console.warn(`plot sse:`,e instanceof Error?e.message:String(e))}s()}};return c(),{close:()=>{r=!0,i&&clearTimeout(i),a.abort(),n(`disconnected`)}}}function jq(e,t,n){let{phase:r,activeTools:i,lastAssistantMessage:a}=e;switch(t){case`message_start`:case`message_update`:r=`thinking`;break;case`message_end`:n.message&&(a=n.message),r=`idle`;break;case`tool_execution_start`:n.toolCallId&&n.toolName&&(i=[...i,{toolCallId:n.toolCallId,toolName:n.toolName}]),r=`tool_execution`;break;case`tool_execution_end`:n.toolCallId&&(i=i.filter(e=>e.toolCallId!==n.toolCallId)),r=i.length>0?`tool_execution`:`idle`;break;case`turn_start`:r=`thinking`;break;case`turn_end`:r=`idle`,i=[];break;case`auto_compaction_start`:r=`compacting`;break;case`auto_compaction_end`:r=`idle`;break;case`auto_retry_start`:r=`retrying`;break;case`auto_retry_end`:r=`idle`;break}return{phase:r,activeTools:i,lastAssistantMessage:a}}function Mq(e,t){if(!e)return{type:`resync`};let n=e.running.findIndex(e=>e.issueId===t.issueId);if(n===-1||t.event===`agent_end`)return{type:`resync`};let r=e.running[n],i=r.session,a=i.lastMessage;t.message&&t.event!==`notification`?a=t.message:t.event===`notification`&&t.message&&(a=((a??``)+t.message).slice(-200));let o=t.event===`turn_end`,s=jq({phase:i.phase,activeTools:i.activeTools,lastAssistantMessage:i.lastAssistantMessage},t.event,t),c=new mq({sessionId:i.sessionId,threadId:i.threadId,turnId:i.turnId,agentPid:i.agentPid,lastEvent:t.event,lastEventAt:t.timestamp,lastMessage:a,inputTokens:t.usage?.inputTokens??i.inputTokens,outputTokens:t.usage?.outputTokens??i.outputTokens,totalTokens:t.usage?.totalTokens??i.totalTokens,turnCount:o?i.turnCount+1:i.turnCount,phase:s.phase,activeTools:s.activeTools.map(e=>new fq(e)),lastAssistantMessage:s.lastAssistantMessage}),l=new hq({issueId:r.issueId,issueIdentifier:r.issueIdentifier,state:r.state,startedAt:r.startedAt,workspacePath:r.workspacePath,session:c}),u=[...e.running];return u[n]=l,{type:`patched`,snapshot:new Cq({generatedAt:e.generatedAt,counts:e.counts,running:u,retrying:e.retrying,codexTotals:e.codexTotals,observability:e.observability,rateLimits:e.rateLimits})}}const Nq=new class{#e=null;#t=`connecting`;#n=new Set;#r=new Set;#i=new Set;#a=null;#o;#s;#c=null;#l=!1;#u=!1;constructor(e,t){this.#o=Oq(e),this.#s=`${e.replace(/\/+$/,``)}/events`,this.#a=Aq(this.#s,e=>this.#d(e),e=>this.#f(e));let n=t?.resyncIntervalMs??3e4;this.#c=setInterval(()=>void this.#p(),n)}subscribe=e=>(this.#n.add(e),()=>this.#n.delete(e));getSnapshot=()=>this.#e;subscribeStatus=e=>(this.#r.add(e),()=>this.#r.delete(e));getStatus=()=>this.#t;triggerRefresh=()=>this.#o.triggerRefresh();getIssue=e=>this.#o.getIssue(e);getEventLog=e=>this.#o.getEventLog(e);onEvent=e=>(this.#i.add(e),()=>this.#i.delete(e));close(){this.#u=!0,this.#a?.close(),this.#c&&clearInterval(this.#c)}#d(e){for(let t of this.#i)t(e);let t=Mq(this.#e,e);if(t.type===`resync`){this.#p();return}this.#e=t.snapshot,this.#m()}#f(e){this.#t=e,this.#h(),e===`connected`&&this.#p()}async#p(){if(!(this.#l||this.#u)){this.#l=!0;try{this.#e=await this.#o.getState(),this.#m()}catch{}finally{this.#l=!1}}}#m(){for(let e of this.#n)e()}#h(){for(let e of this.#r)e()}}(`/rpc`);var Pq=()=>null,Fq=()=>`connecting`;function Iq(){return(0,O.useSyncExternalStore)(Nq.subscribe,Nq.getSnapshot,Pq)}function Lq(){return(0,O.useSyncExternalStore)(Nq.subscribeStatus,Nq.getStatus,Fq)}function Rq(){return Sa({mutationFn:()=>Nq.triggerRefresh()})}var zq=(0,O.createContext)(null);function Bq(){let e=(0,O.use)(zq);if(!e)throw Error(`Dashboard compound components must be used within Dashboard.Root`);return e}function Vq({children:e}){let[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(!1),a=Iq(),o=a?.running??[],s=a?.retrying??[],c=(0,O.useCallback)(()=>i(e=>!e),[]);return(0,O.useEffect)(()=>{o.length===1&&!t&&n(o[0]?.issueId??null),t&&!o.some(e=>e.issueId===t)&&n(null)},[o,t]),(0,k.jsx)(zq,{value:(0,O.useMemo)(()=>({state:{focusedIssueId:t,opsOpen:r},actions:{focusIssue:n,toggleOps:c},meta:{runningCount:o.length,retryingCount:s.length}}),[t,r,c,o.length,s.length]),children:e})}var Hq=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Uq=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Wq=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Gq=e=>{let t=Wq(e);return t.charAt(0).toUpperCase()+t.slice(1)},Kq={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},qq=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Jq=(0,O.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,O.createElement)(`svg`,{ref:c,...Kq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Hq(`lucide`,i),...!a&&!qq(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,O.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Yq=(e,t)=>{let n=(0,O.forwardRef)(({className:n,...r},i)=>(0,O.createElement)(Jq,{ref:i,iconNode:t,className:Hq(`lucide-${Uq(Gq(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Gq(e),n},Xq=Yq(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Zq=Yq(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Qq=Yq(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),$q=Yq(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);function eJ(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=eJ(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function tJ(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=eJ(e))&&(r&&(r+=` `),r+=t);return r}var nJ=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},rJ=(e,t)=>({classGroupId:e,validator:t}),iJ=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),aJ=`-`,oJ=[],sJ=`arbitrary..`,cJ=e=>{let t=dJ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return uJ(e);let n=e.split(aJ);return lJ(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?nJ(i,t):t:i||oJ}return n[e]||oJ}}},lJ=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=lJ(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(aJ):e.slice(t).join(aJ),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},uJ=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?sJ+r:void 0})(),dJ=e=>{let{theme:t,classGroups:n}=e;return fJ(n,t)},fJ=(e,t)=>{let n=iJ();for(let r in e){let i=e[r];pJ(i,n,r,t)}return n},pJ=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];mJ(i,t,n,r)}},mJ=(e,t,n,r)=>{if(typeof e==`string`){hJ(e,t,n);return}if(typeof e==`function`){gJ(e,t,n,r);return}_J(e,t,n,r)},hJ=(e,t,n)=>{let r=e===``?t:vJ(t,e);r.classGroupId=n},gJ=(e,t,n,r)=>{if(yJ(e)){pJ(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(rJ(n,e))},_J=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];pJ(o,vJ(t,a),n,r)}},vJ=(e,t)=>{let n=e,r=t.split(aJ),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=iJ(),n.nextPart.set(t,i)),n=i}return n},yJ=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,bJ=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},xJ=`!`,SJ=`:`,CJ=[],wJ=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),TJ=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===SJ){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(xJ)?(c=s.slice(0,-1),l=!0):s.startsWith(xJ)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return wJ(t,l,c,u)};if(t){let e=t+SJ,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):wJ(CJ,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},EJ=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},DJ=e=>({cache:bJ(e.cacheSize),parseClassName:TJ(e),sortModifiers:EJ(e),...cJ(e)}),OJ=/\s+/,kJ=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(OJ),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+xJ:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},AJ=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=jJ(n))&&(i&&(i+=` `),i+=r);return i},jJ=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=jJ(e[r]))&&(n&&(n+=` `),n+=t);return n},MJ=(e,...t)=>{let n,r,i,a,o=o=>(n=DJ(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=kJ(e,n);return i(e,a),a};return a=o,(...e)=>a(AJ(...e))},NJ=[],PJ=e=>{let t=t=>t[e]||NJ;return t.isThemeGetter=!0,t},FJ=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,IJ=/^\((?:(\w[\w-]*):)?(.+)\)$/i,LJ=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,RJ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zJ=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,BJ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,VJ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,HJ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,UJ=e=>LJ.test(e),WJ=e=>!!e&&!Number.isNaN(Number(e)),GJ=e=>!!e&&Number.isInteger(Number(e)),KJ=e=>e.endsWith(`%`)&&WJ(e.slice(0,-1)),qJ=e=>RJ.test(e),JJ=()=>!0,YJ=e=>zJ.test(e)&&!BJ.test(e),XJ=()=>!1,ZJ=e=>VJ.test(e),QJ=e=>HJ.test(e),$J=e=>!Z(e)&&!Q(e),eY=e=>hY(e,yY,XJ),Z=e=>FJ.test(e),tY=e=>hY(e,bY,YJ),nY=e=>hY(e,xY,WJ),rY=e=>hY(e,CY,JJ),iY=e=>hY(e,SY,XJ),aY=e=>hY(e,_Y,XJ),oY=e=>hY(e,vY,QJ),sY=e=>hY(e,wY,ZJ),Q=e=>IJ.test(e),cY=e=>gY(e,bY),lY=e=>gY(e,SY),uY=e=>gY(e,_Y),dY=e=>gY(e,yY),fY=e=>gY(e,vY),pY=e=>gY(e,wY,!0),mY=e=>gY(e,CY,!0),hY=(e,t,n)=>{let r=FJ.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gY=(e,t,n=!1)=>{let r=IJ.exec(e);return r?r[1]?t(r[1]):n:!1},_Y=e=>e===`position`||e===`percentage`,vY=e=>e===`image`||e===`url`,yY=e=>e===`length`||e===`size`||e===`bg-size`,bY=e=>e===`length`,xY=e=>e===`number`,SY=e=>e===`family-name`,CY=e=>e===`number`||e===`weight`,wY=e=>e===`shadow`,TY=MJ(()=>{let e=PJ(`color`),t=PJ(`font`),n=PJ(`text`),r=PJ(`font-weight`),i=PJ(`tracking`),a=PJ(`leading`),o=PJ(`breakpoint`),s=PJ(`container`),c=PJ(`spacing`),l=PJ(`radius`),u=PJ(`shadow`),d=PJ(`inset-shadow`),f=PJ(`text-shadow`),p=PJ(`drop-shadow`),m=PJ(`blur`),h=PJ(`perspective`),g=PJ(`aspect`),_=PJ(`ease`),v=PJ(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Q,Z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Q,Z,c],T=()=>[UJ,`full`,`auto`,...w()],ee=()=>[GJ,`none`,`subgrid`,Q,Z],E=()=>[`auto`,{span:[`full`,GJ,Q,Z]},GJ,Q,Z],te=()=>[GJ,`auto`,Q,Z],ne=()=>[`auto`,`min`,`max`,`fr`,Q,Z],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ie=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ae=()=>[`auto`,...w()],oe=()=>[UJ,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],se=()=>[UJ,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[UJ,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[e,Q,Z],le=()=>[...b(),uY,aY,{position:[Q,Z]}],ue=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],de=()=>[`auto`,`cover`,`contain`,dY,eY,{size:[Q,Z]}],fe=()=>[KJ,cY,tY],pe=()=>[``,`none`,`full`,l,Q,Z],me=()=>[``,WJ,cY,tY],he=()=>[`solid`,`dashed`,`dotted`,`double`],ge=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],_e=()=>[WJ,KJ,uY,aY],ve=()=>[``,`none`,m,Q,Z],ye=()=>[`none`,WJ,Q,Z],be=()=>[`none`,WJ,Q,Z],xe=()=>[WJ,Q,Z],Se=()=>[UJ,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[qJ],breakpoint:[qJ],color:[JJ],container:[qJ],"drop-shadow":[qJ],ease:[`in`,`out`,`in-out`],font:[$J],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[qJ],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[qJ],shadow:[qJ],spacing:[`px`,WJ],text:[qJ],"text-shadow":[qJ],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,UJ,Z,Q,g]}],container:[`container`],columns:[{columns:[WJ,Z,Q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[GJ,`auto`,Q,Z]}],basis:[{basis:[UJ,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[WJ,UJ,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,WJ,Q,Z]}],shrink:[{shrink:[``,WJ,Q,Z]}],order:[{order:[GJ,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...ie(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ie()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...ie(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ie(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ie()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mbs:[{mbs:ae()}],mbe:[{mbe:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:oe()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...oe()]}],"min-w":[{"min-w":[s,`screen`,`none`,...oe()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...oe()]}],h:[{h:[`screen`,`lh`,...oe()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...oe()]}],"max-h":[{"max-h":[`screen`,`lh`,...oe()]}],"font-size":[{text:[`base`,n,cY,tY]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,mY,rY]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,KJ,Z]}],"font-family":[{font:[lY,iY,t]}],"font-features":[{"font-features":[Z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Q,Z]}],"line-clamp":[{"line-clamp":[WJ,`none`,Q,nY]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...he(),`wavy`]}],"text-decoration-thickness":[{decoration:[WJ,`from-font`,`auto`,Q,tY]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[WJ,`auto`,Q,Z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Q,Z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:de()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},GJ,Q,Z],radial:[``,Q,Z],conic:[GJ,Q,Z]},fY,oY]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":me()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...he(),`hidden`,`none`]}],"divide-style":[{divide:[...he(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...he(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[WJ,Q,Z]}],"outline-w":[{outline:[``,WJ,cY,tY]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,pY,sY]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,pY,sY]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:me()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[WJ,tY]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,f,pY,sY]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[WJ,Q,Z]}],"mix-blend":[{"mix-blend":[...ge(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[WJ]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[WJ]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:ve()}],brightness:[{brightness:[WJ,Q,Z]}],contrast:[{contrast:[WJ,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,pY,sY]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,WJ,Q,Z]}],"hue-rotate":[{"hue-rotate":[WJ,Q,Z]}],invert:[{invert:[``,WJ,Q,Z]}],saturate:[{saturate:[WJ,Q,Z]}],sepia:[{sepia:[``,WJ,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[WJ,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[WJ,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,WJ,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[WJ,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,WJ,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[WJ,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[WJ,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,WJ,Q,Z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[WJ,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[WJ,Q,Z]}],animate:[{animate:[`none`,v,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":[`scale-3d`],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":[`translate-none`],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Q,Z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Q,Z]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[WJ,cY,tY,nY]}],stroke:[{stroke:[`none`,...D()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function EY(...e){return TY(tJ(e))}var DY={connected:`bg-success`,connecting:`bg-warning animate-pulse`,disconnected:`bg-destructive`};function OY({status:e,className:t}){return(0,k.jsx)(`span`,{className:EY(`size-1.5 rounded-full`,DY[e],t),"aria-label":e})}function kY(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var AY={};function jY(e,t,n,r,i){let a={...LY(e,AY)};return t&&(a=NY(a,t)),n&&(a=NY(a,n)),r&&(a=NY(a,r)),i&&(a=NY(a,i)),a}function MY(e){if(e.length===0)return AY;if(e.length===1)return LY(e[0],AY);let t={...LY(e[0],AY)};for(let n=1;n<e.length;n+=1)t=NY(t,e[n]);return t}function NY(e,t){return IY(t)?t(e):PY(e,t)}function PY(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=kY(e.style,r);break;case`className`:e[n]=BY(e.className,r);break;default:FY(n,r)?e[n]=RY(e[n],r):e[n]=r}}return e}function FY(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function IY(e){return typeof e==`function`}function LY(e,t){return IY(e)?e(t):e??AY}function RY(e,t){return t?e?n=>{if(VY(n)){let r=n;zY(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function zY(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function BY(e,t){return t?e?t+` `+e:t:e}function VY(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function HY(e,...t){let n=new URL(`https://base-ui.com/production-error`);return n.searchParams.set(`code`,e.toString()),t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var UY={};function WY(e,t){let n=O.useRef(UY);return n.current===UY&&(n.current=e(t)),n}function GY(e,t,n,r){let i=WY(qY).current;return JY(i,e,t,n,r)&&XY(i,[e,t,n,r]),i.callback}function KY(e){let t=WY(qY).current;return YY(t,e)&&XY(t,e),t.callback}function qY(){return{callback:null,cleanup:null,refs:[]}}function JY(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function YY(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function XY(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var ZY=19;function QY(e){return ZY>=e}function $Y(e){if(!O.isValidElement(e))return null;let t=e,n=t.props;return(QY(19)?n?.ref:t.ref)??null}function eX(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function tX(e,t){return typeof e==`function`?e(t):e}function nX(e,t){return typeof e==`function`?e(t):e}function rX(){}Object.freeze([]);const iX=Object.freeze({}),aX={style:{transition:`none`}},oX={fallbackAxisSide:`end`};function sX(e,t,n={}){let r=t.render,i=cX(t,n);return n.enabled===!1?null:uX(e,r,i,n.state??iX)}function cX(e,t={}){let{className:n,style:r,render:i}=e,{state:a=iX,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?tX(n,a):void 0,d=l?nX(r,a):void 0,f=l?eX(a,c):iX,p=l?kY(f,Array.isArray(s)?MY(s):s)??iX:iX;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=KY([p.ref,$Y(i),...o]):p.ref=GY(p.ref,$Y(i),o):GY(null,null)),l?(u!==void 0&&(p.className=BY(p.className,u)),d!==void 0&&(p.style=kY(p.style,d)),p):iX}var lX=Symbol.for(`react.lazy`);function uX(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=jY(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===lX&&(i=O.Children.toArray(t)[0]),O.cloneElement(i,e)}if(e&&typeof e==`string`)return dX(e,n);throw Error(HY(8))}function dX(e,t){return e===`button`?(0,O.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,O.createElement)(`img`,{alt:``,...t,key:t.key}):O.createElement(e,t)}function fX(e){return sX(e.defaultTagName??`div`,e,e)}var pX=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;const mX=tJ,hX=(e,t)=>n=>{if(t?.variants==null)return mX(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=pX(t)||pX(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return mX(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};var gX=hX(`[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-9 px-[calc(--spacing(3)-1px)] sm:h-8`,icon:`size-9 sm:size-8`,"icon-lg":`size-10 sm:size-9`,"icon-sm":`size-8 sm:size-7`,"icon-xl":`size-11 sm:size-10 [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,"icon-xs":`size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-3.5`,lg:`h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9`,sm:`h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7`,xl:`h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,xs:`h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5`},variant:{default:`not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 data-pressed:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none`,destructive:`not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 data-pressed:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none`,"destructive-outline":`border-input bg-popover not-dark:bg-clip-padding text-destructive-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:border-destructive/32 hover:bg-destructive/4 data-pressed:border-destructive/32 data-pressed:bg-destructive/4 dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none`,ghost:`border-transparent text-foreground hover:bg-accent data-pressed:bg-accent`,link:`border-transparent underline-offset-4 hover:underline data-pressed:underline`,outline:`border-input bg-popover not-dark:bg-clip-padding text-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:bg-accent/50 data-pressed:bg-accent/50 dark:bg-input/32 dark:data-pressed:bg-input/64 dark:hover:bg-input/64 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80`}}});function _X({className:e,variant:t,size:n,render:r,...i}){let a=r?void 0:`button`;return fX({defaultTagName:`button`,props:jY({className:EY(gX({className:e,size:n,variant:t})),"data-slot":`button`,type:a},i),render:r})}var vX=[],yX=void 0;function bX(){return yX}function xX(e){vX.push(e)}function SX(e){let t=(t,n)=>{let r=WY(wX).current,i;try{yX=r;for(let e of vX)e.before(r);i=e(t,n);for(let e of vX)e.after(r);r.didInitialize=!0}finally{yX=void 0}return i};return t.displayName=e.displayName||e.name,t}function CX(e){return O.forwardRef(SX(e))}function wX(){return{didInitialize:!1}}function TX(e){let t=O.useRef(!0);t.current&&(t.current=!1,e())}const EX=typeof document<`u`?O.useLayoutEffect:()=>{},DX=O.createContext(void 0);function OX(e){let t=O.useContext(DX);if(t===void 0&&!e)throw Error(HY(72));return t}var kX=[];function AX(e){O.useEffect(e,kX)}var jX=0,MX=class e{static create(){return new e}currentId=jX;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=jX,t()},e)}isStarted(){return this.currentId!==jX}clear=()=>{this.currentId!==jX&&(clearTimeout(this.currentId),this.currentId=jX)};disposeEffect=()=>this.clear};function NX(){let e=WY(MX.create).current;return AX(e.disposeEffect),e}function PX(){return typeof window<`u`}function FX(e){return RX(e)?(e.nodeName||``).toLowerCase():`#document`}function IX(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function LX(e){return((RX(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function RX(e){return PX()?e instanceof Node||e instanceof IX(e).Node:!1}function zX(e){return PX()?e instanceof Element||e instanceof IX(e).Element:!1}function BX(e){return PX()?e instanceof HTMLElement||e instanceof IX(e).HTMLElement:!1}function VX(e){return!PX()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof IX(e).ShadowRoot}function HX(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=$X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function UX(e){return/^(table|td|th)$/.test(FX(e))}function WX(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var GX=/transform|translate|scale|rotate|perspective|filter/,KX=/paint|layout|strict|content/,qX=e=>!!e&&e!==`none`,JX;function YX(e){let t=zX(e)?$X(e):e;return qX(t.transform)||qX(t.translate)||qX(t.scale)||qX(t.rotate)||qX(t.perspective)||!ZX()&&(qX(t.backdropFilter)||qX(t.filter))||GX.test(t.willChange||``)||KX.test(t.contain||``)}function XX(e){let t=tZ(e);for(;BX(t)&&!QX(t);){if(YX(t))return t;if(WX(t))return null;t=tZ(t)}return null}function ZX(){return JX??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),JX}function QX(e){return/^(html|body|#document)$/.test(FX(e))}function $X(e){return IX(e).getComputedStyle(e)}function eZ(e){return zX(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tZ(e){if(FX(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||VX(e)&&e.host||LX(e);return VX(t)?t.host:t}function nZ(e){let t=tZ(e);return QX(t)?e.ownerDocument?e.ownerDocument.body:e.body:BX(t)&&HX(t)?t:nZ(t)}function rZ(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=nZ(e),i=r===e.ownerDocument?.body,a=IX(r);if(i){let e=iZ(a);return t.concat(a,a.visualViewport||[],HX(r)?r:[],e&&n?rZ(e):[])}else return t.concat(r,rZ(r,[],n))}function iZ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function aZ(e){let t=WY(oZ,e).current;return t.next=e,EX(t.effect),t}function oZ(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var sZ=O[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],cZ=sZ&&sZ!==O.useLayoutEffect?sZ:e=>e();function lZ(e){let t=WY(uZ).current;return t.next=e,cZ(t.effect),t.trampoline}function uZ(){let e={next:void 0,callback:dZ,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function dZ(){}function fZ(e){return e?.ownerDocument||document}var pZ=typeof navigator<`u`,mZ=bZ(),hZ=SZ(),gZ=xZ();typeof CSS>`u`||!CSS.supports||CSS.supports(`-webkit-backdrop-filter:none`),mZ.platform===`MacIntel`&&mZ.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(mZ.platform),pZ&&/firefox/i.test(gZ);const _Z=pZ&&/apple/i.test(navigator.vendor);pZ&&/Edg/i.test(gZ),pZ&&/android/i.test(hZ)||/android/i.test(gZ);const vZ=pZ&&hZ.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,yZ=gZ.includes(`jsdom/`);function bZ(){if(!pZ)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function xZ(){if(!pZ)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function SZ(){if(!pZ)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}const CZ=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function wZ(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function TZ(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&VX(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function EZ(e,t){if(!zX(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(TZ(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function DZ(e){return`composedPath`in e?e.composedPath()[0]:e.target}function OZ(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function kZ(e){return e.matches(`html,body`)}function AZ(e){return BX(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function jZ(e){if(!e||yZ)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function MZ(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...MZ(e,t.id,n)])}function NZ(e){return`nativeEvent`in e}function PZ(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function FZ(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var IZ=[`top`,`right`,`bottom`,`left`],LZ=Math.min,RZ=Math.max,zZ=Math.round,BZ=Math.floor,VZ=e=>({x:e,y:e}),HZ={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function UZ(e,t,n){return RZ(e,LZ(t,n))}function WZ(e,t){return typeof e==`function`?e(t):e}function GZ(e){return e.split(`-`)[0]}function KZ(e){return e.split(`-`)[1]}function qZ(e){return e===`x`?`y`:`x`}function JZ(e){return e===`y`?`height`:`width`}function YZ(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function XZ(e){return qZ(YZ(e))}function ZZ(e,t,n){n===void 0&&(n=!1);let r=KZ(e),i=XZ(e),a=JZ(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=oQ(o)),[o,oQ(o)]}function QZ(e){let t=oQ(e);return[$Z(e),t,$Z(t)]}function $Z(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var eQ=[`left`,`right`],tQ=[`right`,`left`],nQ=[`top`,`bottom`],rQ=[`bottom`,`top`];function iQ(e,t,n){switch(e){case`top`:case`bottom`:return n?t?tQ:eQ:t?eQ:tQ;case`left`:case`right`:return t?nQ:rQ;default:return[]}}function aQ(e,t,n,r){let i=KZ(e),a=iQ(GZ(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map($Z)))),a}function oQ(e){let t=GZ(e);return HZ[t]+e.slice(t.length)}function sQ(e){return{top:0,right:0,bottom:0,left:0,...e}}function cQ(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:sQ(e)}function lQ(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}const uQ={...O};var dQ=0;function fQ(e,t=`mui`){let[n,r]=O.useState(e),i=e||n;return O.useEffect(()=>{n??(dQ+=1,r(`${t}-${dQ}`))},[n,t]),i}var pQ=uQ.useId;function mQ(e,t){if(pQ!==void 0){let n=pQ();return e??(t?`${t}-${n}`:n)}return fQ(e,t)}function hQ(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var gQ=O.createContext(null),_Q=O.createContext(null);const vQ=()=>O.useContext(gQ)?.id||null,yQ=e=>{let t=O.useContext(_Q);return e??t},bQ=`none`,xQ=`trigger-hover`,SQ=`trigger-focus`;function CQ(e,t,n,r){let i=!1,a=!1,o=r??iX;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function wQ(e){return`data-base-ui-${e}`}wQ(`safe-polygon`),`${CZ}`;function TQ(e,t,n){if(n&&!PZ(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var EQ=O.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new MX,currentIdRef:{current:null},currentContextRef:{current:null}});function DQ(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=O.useRef(n),a=O.useRef(n),o=O.useRef(null),s=O.useRef(null),c=NX();return(0,k.jsx)(EQ.Provider,{value:O.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function OQ(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=O.useContext(EQ),[f,p]=O.useState(!1);return EX(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(p(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),EX(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:p},a.current=r,o.current={open:0,close:TQ(c.current,`close`)},t!==null&&t!==r?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,CQ(bQ))):(p(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),EX(()=>()=>{l.current=null},[l]),O.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}var kQ=null;globalThis.requestAnimationFrame;var AQ=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},jQ=class e{static create(){return new e}static request(e){return AQ.request(e)}static cancel(e){return AQ.cancel(e)}currentId=kQ;request(e){this.cancel(),this.currentId=AQ.request(()=>{this.currentId=kQ,e()})}cancel=()=>{this.currentId!==kQ&&(AQ.cancel(this.currentId),this.currentId=kQ)};disposeEffect=()=>this.cancel};function MQ(){let e=WY(jQ.create).current;return AX(e.disposeEffect),e}var NQ=u(_()),PQ=O.createContext(null);const FQ=()=>O.useContext(PQ);var IQ=wQ(`portal`);function LQ(e={}){let{ref:t,container:n,componentProps:r=iX,elementProps:i}=e,a=mQ(),o=FQ()?.portalNode,[s,c]=O.useState(null),[l,u]=O.useState(null),d=lZ(e=>{e!==null&&u(e)}),f=O.useRef(null);EX(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(RX(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=sX(`div`,r,{ref:[t,d],props:[{id:a,[IQ]:``},i]});return{portalNode:l,portalSubtree:s&&p?NQ.createPortal(p,s):null}}function RQ(e){return e==null?e:`current`in e?e.current:e}function zQ(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function BQ(e){return e!=null&&e.clientX!=null}function VQ(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=O.useRef(!1),u=O.useRef(null),[d,f]=O.useState(),[p,m]=O.useState([]),h=lZ((e,t,r)=>{l.current||o.current.openEvent&&!BQ(o.current.openEvent)||n.set(`positionReference`,zQ(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),g=lZ(e=>{r?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),_=PZ(d)?i:r,v=O.useCallback(()=>{if(!_||!s)return;let e=IX(i);function t(n){TZ(i,DZ(n))?(e.removeEventListener(`mousemove`,t),u.current=null):h(n.clientX,n.clientY)}if(!o.current.openEvent||BQ(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),u.current=null};return u.current=n,n}n.set(`positionReference`,a)},[_,s,i,o,a,n,h]);O.useEffect(()=>v(),[v,p]),O.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),O.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let y=O.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return O.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}function HQ(e,t,n){let{reference:r,floating:i}=e,a=YZ(t),o=XZ(t),s=JZ(o),c=GZ(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(KZ(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function UQ(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=WZ(t,e),p=cQ(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=lQ(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=lQ(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var WQ=50,GQ=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:UQ},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=HQ(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<WQ&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=HQ(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},KQ=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=WZ(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=GZ(r),_=YZ(o),v=GZ(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[oQ(o)]:QZ(o)),x=p!==`none`;!d&&x&&b.push(...aQ(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ZZ(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==YZ(t))||T.every(e=>YZ(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=YZ(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function qQ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JQ(e){return IZ.some(t=>e[t]>=0)}var YQ=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=WZ(e,t);switch(i){case`referenceHidden`:{let e=qQ(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:JQ(e)}}}case`escaped`:{let e=qQ(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:JQ(e)}}}default:return{}}}}},XQ=new Set([`left`,`top`]);async function ZQ(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=GZ(n),s=KZ(n),c=YZ(n)===`y`,l=XQ.has(o)?-1:1,u=a&&c?-1:1,d=WZ(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var QQ=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ZQ(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},$Q=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=WZ(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=YZ(GZ(i)),p=qZ(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=UZ(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=UZ(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},e$=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=WZ(e,t),u={x:n,y:r},d=YZ(i),f=qZ(d),p=u[f],m=u[d],h=WZ(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=XQ.has(GZ(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},t$=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=WZ(e,t),u=await o.detectOverflow(t,l),d=GZ(i),f=KZ(i),p=YZ(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=LZ(h-u[g],v),x=LZ(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=RZ(u.left,0),t=RZ(u.right,0),n=RZ(u.top,0),r=RZ(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:RZ(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:RZ(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function n$(e){let t=$X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=BX(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=zZ(n)!==a||zZ(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function r$(e){return zX(e)?e:e.contextElement}function i$(e){let t=r$(e);if(!BX(t))return VZ(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=n$(t),o=(a?zZ(n.width):n.width)/r,s=(a?zZ(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var a$=VZ(0);function o$(e){let t=IX(e);return!ZX()||!t.visualViewport?a$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function s$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==IX(e)?!1:t}function c$(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=r$(e),o=VZ(1);t&&(r?zX(r)&&(o=i$(r)):o=i$(e));let s=s$(a,n,r)?o$(a):VZ(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=IX(a),t=r&&zX(r)?IX(r):r,n=e,i=iZ(n);for(;i&&r&&t!==n;){let e=i$(i),t=i.getBoundingClientRect(),r=$X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=IX(i),i=iZ(n)}}return lQ({width:u,height:d,x:c,y:l})}function l$(e,t){let n=eZ(e).scrollLeft;return t?t.left+n:c$(LX(e)).left+n}function u$(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-l$(e,n),y:n.top+t.scrollTop}}function d$(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=LX(r),s=t?WX(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=VZ(1),u=VZ(0),d=BX(r);if((d||!d&&!a)&&((FX(r)!==`body`||HX(o))&&(c=eZ(r)),d)){let e=c$(r);l=i$(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?u$(o,c):VZ(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function f$(e){return Array.from(e.getClientRects())}function p$(e){let t=LX(e),n=eZ(e),r=e.ownerDocument.body,i=RZ(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=RZ(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+l$(e),s=-n.scrollTop;return $X(r).direction===`rtl`&&(o+=RZ(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var m$=25;function h$(e,t){let n=IX(e),r=LX(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ZX();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=l$(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=m$&&(a-=o)}else l<=m$&&(a+=l);return{width:a,height:o,x:s,y:c}}function g$(e,t){let n=c$(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=BX(e)?i$(e):VZ(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function _$(e,t,n){let r;if(t===`viewport`)r=h$(e,n);else if(t===`document`)r=p$(LX(e));else if(zX(t))r=g$(t,n);else{let n=o$(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return lQ(r)}function v$(e,t){let n=tZ(e);return n===t||!zX(n)||QX(n)?!1:$X(n).position===`fixed`||v$(n,t)}function y$(e,t){let n=t.get(e);if(n)return n;let r=rZ(e,[],!1).filter(e=>zX(e)&&FX(e)!==`body`),i=null,a=$X(e).position===`fixed`,o=a?tZ(e):e;for(;zX(o)&&!QX(o);){let t=$X(o),n=YX(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||HX(o)&&!n&&v$(e,o))?r=r.filter(e=>e!==o):i=t,o=tZ(o)}return t.set(e,r),r}function b$(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?WX(t)?[]:y$(t,this._c):[].concat(n),r],o=_$(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=_$(t,a[e],i);s=RZ(n.top,s),c=LZ(n.right,c),l=LZ(n.bottom,l),u=RZ(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function x$(e){let{width:t,height:n}=n$(e);return{width:t,height:n}}function S$(e,t,n){let r=BX(t),i=LX(t),a=n===`fixed`,o=c$(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=VZ(0);function l(){c.x=l$(i)}if(r||!r&&!a)if((FX(t)!==`body`||HX(i))&&(s=eZ(t)),r){let e=c$(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?u$(i,s):VZ(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function C$(e){return $X(e).position===`static`}function w$(e,t){if(!BX(e)||$X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return LX(e)===n&&(n=n.ownerDocument.body),n}function T$(e,t){let n=IX(e);if(WX(e))return n;if(!BX(e)){let t=tZ(e);for(;t&&!QX(t);){if(zX(t)&&!C$(t))return t;t=tZ(t)}return n}let r=w$(e,t);for(;r&&UX(r)&&C$(r);)r=w$(r,t);return r&&QX(r)&&C$(r)&&!YX(r)?n:r||XX(e)||n}var E$=async function(e){let t=this.getOffsetParent||T$,n=this.getDimensions,r=await n(e.floating);return{reference:S$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function D$(e){return $X(e).direction===`rtl`}var O$={convertOffsetParentRelativeRectToViewportRelativeRect:d$,getDocumentElement:LX,getClippingRect:b$,getOffsetParent:T$,getElementRects:E$,getClientRects:f$,getDimensions:x$,getScale:i$,isElement:zX,isRTL:D$};function k$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function A$(e,t){let n=null,r,i=LX(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=BZ(d),h=BZ(i.clientWidth-(u+f)),g=BZ(i.clientHeight-(d+p)),_=BZ(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:RZ(0,LZ(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!k$(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function j$(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=r$(e),u=i||a?[...l?rZ(l):[],...t?rZ(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?A$(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?c$(e):null;c&&g();function g(){let t=c$(e);h&&!k$(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var M$=QQ,N$=$Q,P$=KQ,F$=t$,I$=YQ,L$=e$,R$=(e,t,n)=>{let r=new Map,i={platform:O$,...n},a={...i.platform,_c:r};return GQ(e,t,{...i,platform:a})},z$=u(_(),1),B$=typeof document<`u`?O.useLayoutEffect:function(){};function V$(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!V$(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!V$(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function H$(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function U$(e,t){let n=H$(e);return Math.round(t*n)/n}function W$(e){let t=O.useRef(e);return B$(()=>{t.current=e}),t}function G$(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=O.useState(r);V$(f,r)||p(r);let[m,h]=O.useState(null),[g,_]=O.useState(null),v=O.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=O.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=O.useRef(null),C=O.useRef(null),w=O.useRef(u),T=c!=null,ee=W$(c),E=W$(i),te=W$(l),ne=O.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};E.current&&(e.platform=E.current),R$(S.current,C.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};re.current&&!V$(w.current,t)&&(w.current=t,z$.flushSync(()=>{d(t)}))})},[f,t,n,E,te]);B$(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=O.useRef(!1);B$(()=>(re.current=!0,()=>{re.current=!1}),[]),B$(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,ne);ne()}},[b,x,ne,ee,T]);let ie=O.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ae=O.useMemo(()=>({reference:b,floating:x}),[b,x]),oe=O.useMemo(()=>{let e={position:n,left:0,top:0};if(!ae.floating)return e;let t=U$(ae.floating,u.x),r=U$(ae.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...H$(ae.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ae.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:ne,refs:ie,elements:ae,floatingStyles:oe}),[u,ne,ie,ae,oe])}var K$=(e,t)=>{let n=M$(e);return{name:n.name,fn:n.fn,options:[e,t]}},q$=(e,t)=>{let n=N$(e);return{name:n.name,fn:n.fn,options:[e,t]}},J$=(e,t)=>({fn:L$(e).fn,options:[e,t]}),Y$=(e,t)=>{let n=P$(e);return{name:n.name,fn:n.fn,options:[e,t]}},X$=(e,t)=>{let n=F$(e);return{name:n.name,fn:n.fn,options:[e,t]}},Z$=(e,t)=>{let n=I$(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q$={intentional:`onClick`,sloppy:`onPointerDown`};function $$(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function e1(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=yQ(_),y=lZ(typeof d==`function`?d:()=>!1),b=typeof d==`function`?y:d,x=O.useRef(!1),{escapeKey:S,outsidePress:C}=$$(g),w=O.useRef(null),T=NX(),ee=NX(),E=lZ(()=>{ee.clear(),c.current.insideReactTree=!1}),te=O.useRef(!1),ne=O.useRef(``),re=lZ(e=>{ne.current=e.pointerType}),ie=lZ(()=>{let e=ne.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),ae=lZ(e=>{if(!r||!l||!u||e.key!==`Escape`||te.current)return;let t=c.current.floatingContext?.nodeId,i=v?MZ(v.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=CQ(`escape-key`,NZ(e)?e.nativeEvent:e);n.setOpen(!1,a),!S&&!a.isPropagationAllowed&&e.stopPropagation()}),oe=lZ(e=>{let t=ie();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),se=lZ(()=>{c.current.insideReactTree=!0,ee.start(0,E)}),ce=lZ((e,t=!1)=>{if(oe(e)){E();return}if(c.current.insideReactTree){E();return}if(ie()===`intentional`&&t||typeof b==`function`&&!b(e))return;let r=DZ(e),i=`[${wQ(`inert`)}]`,a=fZ(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>TZ(e,r))))return;let s=zX(r)?r:null;for(;s&&!QX(s);){let e=tZ(s);if(QX(e)||!zX(e))break;s=e}if(a.length&&zX(r)&&!kZ(r)&&!TZ(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!TZ(s,e)))return;if(BX(r)&&!(`touches`in e)){let t=QX(r),n=$X(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&MZ(v.nodesRef.current,l).some(t=>OZ(e,t.context?.elements.floating));if(OZ(e,n.select(`floatingElement`))||OZ(e,n.select(`domReferenceElement`))||u)return;let d=v?MZ(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,CQ(`outside-press`,e)),E()}),D=lZ(e=>{ie()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!l||OZ(e,n.select(`floatingElement`))||OZ(e,n.select(`domReferenceElement`))||ce(e)}),le=lZ(e=>{if(ie()!==`sloppy`||!n.select(`open`)||!l||OZ(e,n.select(`floatingElement`))||OZ(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}),ue=lZ(e=>{let t=DZ(e);function n(){le(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),de=lZ(e=>{let t=x.current;if(x.current=!1,T.clear(),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let n=DZ(e);function r(){e.type===`pointerdown`?D(e):ce(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),fe=lZ(e=>{if(ie()!==`sloppy`||!w.current||OZ(e,n.select(`floatingElement`))||OZ(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(ce(e),T.clear(),w.current=null)}),pe=lZ(e=>{let t=DZ(e);function n(){fe(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),me=lZ(e=>{ie()!==`sloppy`||!w.current||OZ(e,n.select(`floatingElement`))||OZ(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&ce(e),T.clear(),w.current=null)}),he=lZ(e=>{let t=DZ(e);function n(){me(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});O.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=S,c.current.__outsidePressBubbles=C;let e=new MX;function t(e){n.setOpen(!1,CQ(bQ,e))}function s(){e.clear(),te.current=!0}function d(){e.start(ZX()?5:0,()=>{te.current=!1})}let f=fZ(i);f.addEventListener(`pointerdown`,re,!0),u&&(f.addEventListener(`keydown`,ae),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),b&&(f.addEventListener(`click`,de,!0),f.addEventListener(`pointerdown`,de,!0),f.addEventListener(`touchstart`,ue,!0),f.addEventListener(`touchmove`,pe,!0),f.addEventListener(`touchend`,he,!0),f.addEventListener(`mousedown`,de,!0));let p=[];return h&&(zX(o)&&(p=rZ(o)),zX(i)&&(p=p.concat(rZ(i))),!zX(a)&&a&&a.contextElement&&(p=p.concat(rZ(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,re,!0),u&&(f.removeEventListener(`keydown`,ae),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),b&&(f.removeEventListener(`click`,de,!0),f.removeEventListener(`pointerdown`,de,!0),f.removeEventListener(`touchstart`,ue,!0),f.removeEventListener(`touchmove`,pe,!0),f.removeEventListener(`touchend`,he,!0),f.removeEventListener(`mousedown`,de,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear(),x.current=!1}},[c,i,a,o,u,b,r,s,h,l,S,C,ae,ce,de,D,ue,pe,he,re,n]),O.useEffect(E,[b,E]);let ge=O.useMemo(()=>({onKeyDown:ae,...p&&{[Q$[m]]:e=>{n.setOpen(!1,CQ(`trigger-press`,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,CQ(`trigger-press`,e.nativeEvent))}}}}),[ae,n,p,m]),_e=lZ(e=>{let t=DZ(e.nativeEvent);!TZ(n.select(`floatingElement`),t)||e.button!==0||(x.current=!0)}),ve=lZ(e=>{!r||!l||e.button!==0||(x.current=!0)}),ye=O.useMemo(()=>({onKeyDown:ae,onPointerDown:_e,onMouseDown:_e,onMouseUp:_e,onClickCapture:se,onMouseDownCapture(e){se(),ve(e)},onPointerDownCapture(e){se(),ve(e)},onMouseUpCapture:se,onTouchEndCapture:se,onTouchMoveCapture:se}),[ae,_e,se,ve]);return O.useMemo(()=>l?{reference:ge,floating:ye,trigger:ge}:{},[l,ge,ye])}var t1=Symbol(`NOT_FOUND`);function n1(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function r1(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function i1(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var a1=e=>Array.isArray(e)?e:[e];function o1(e){let t=Array.isArray(e[0])?e[0]:e;return i1(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function s1(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function c1(e){let t;return{get(n){return t&&e(t.key,n)?t.value:t1},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function l1(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return t1}function i(t,i){r(t)===t1&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var u1=(e,t)=>e===t;function d1(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function f1(e,t){let{equalityCheck:n=u1,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=d1(n),o=0,s=r<=1?c1(a):l1(r,a);function c(){let t=s.get(arguments);if(t===t1){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var p1=class{constructor(e){this.value=e}deref(){return this.value}},m1=typeof WeakRef<`u`?WeakRef:p1,h1=0,g1=1;function _1(){return{s:h1,v:void 0,o:null,p:null}}function v1(e,t={}){let n=_1(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=_1(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=_1(),e.set(n,t)):t=r}}let s=t,c;if(t.s===g1)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new m1(c):c}return s.s=g1,s.v=c,c}return o.clearCache=()=>{n=_1(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function y1(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),n1(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=v1,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=a1(c),p=a1(u),m=o1(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=s1(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var b1=y1(v1),x1=Object.assign((e,t=b1)=>{r1(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>x1});y1({memoize:f1,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const S1=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(HY(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s};var C1=gr(),w1=vr(),T1=QY(19)?O1:k1;function E1(e,t,n,r,i){return T1(e,t,n,r,i)}function D1(e,t,n,r,i){let a=O.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,C1.useSyncExternalStore)(e.subscribe,a,a)}xX({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,C1.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function O1(e,t,n,r,i){let a=bX();if(!a)return D1(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function k1(e,t,n,r,i){return(0,w1.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var A1=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return E1(this,e,t,n,r)}},j1=class extends A1{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){O.useDebugValue(e),EX(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;EX(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;EX(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){O.useDebugValue(e);let n=t!==void 0;EX(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return O.useDebugValue(e),E1(this,this.selectors[e],t,n,r)}useContextCallback(e,t){O.useDebugValue(e);let n=lZ(t??rX);this.context[e]=n}useStateSetter(e){let t=O.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},M1={open:S1(e=>e.open),domReferenceElement:S1(e=>e.domReferenceElement),referenceElement:S1(e=>e.positionReference??e.referenceElement),floatingElement:S1(e=>e.floatingElement),floatingId:S1(e=>e.floatingId)},N1=class extends j1{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:hQ(),nested:t,noEmit:n,triggerElements:i},M1)}setOpen=(e,t)=>{if((!e||!this.state.open||FZ(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function P1(e,t=!1,n=!1){let[r,i]=O.useState(e&&t?`idle`:void 0),[a,o]=O.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),EX(()=>{if(!e&&a&&r!==`ending`&&n){let e=jQ.request(()=>{i(`ending`)});return()=>{jQ.cancel(e)}}},[e,a,r,n]),EX(()=>{if(!e||t)return;let n=jQ.request(()=>{i(void 0)});return()=>{jQ.cancel(n)}},[t,e]),EX(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=jQ.request(()=>{i(`idle`)});return()=>{jQ.cancel(n)}},[t,e,a,i,r]),O.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}let F1=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({});var I1={[F1.startingStyle]:``},L1={[F1.endingStyle]:``};const R1={transitionStatus(e){return e===`starting`?I1:e===`ending`?L1:null}};var z1=u(_());function B1(e,t=!1,n=!0){let r=MQ();return lZ((i,a=null)=>{r.cancel();function o(){z1.flushSync(i)}let s=RQ(e);if(s==null)return;let c=s;if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{function e(){let e=F1.startingStyle;if(!c.hasAttribute(e)){r.request(i);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),i())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function i(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||o()}).catch(()=>{let e=c.getAnimations();if(n){if(a?.aborted)return;o()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&i()})}if(t){e();return}r.request(i)}})}function V1(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=lZ(i),o=B1(r,n,!1);O.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function H1(e,t){let n=O.useRef(null),r=O.useRef(null);return O.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function U1(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=H1(e,n),o=lZ(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return EX(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function W1(e){let t=e.useState(`open`);EX(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function G1(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=P1(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=lZ(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return V1({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var K1=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function q1(){return new N1({open:!1,floatingElement:null,referenceElement:null,triggerElements:new K1,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function J1(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:`idle`,floatingRootContext:q1(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:iX,inactiveTriggerProps:iX,popupProps:iX}}var Y1=S1(e=>e.triggerIdProp??e.activeTriggerId);const X1={open:S1(e=>e.openProp??e.open),mounted:S1(e=>e.mounted),transitionStatus:S1(e=>e.transitionStatus),floatingRootContext:S1(e=>e.floatingRootContext),preventUnmountingOnClose:S1(e=>e.preventUnmountingOnClose),payload:S1(e=>e.payload),activeTriggerId:Y1,activeTriggerElement:S1(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:S1((e,t)=>t!==void 0&&Y1(e)===t),isOpenedByTrigger:S1((e,t)=>t!==void 0&&Y1(e)===t&&e.open),isMountedByTrigger:S1((e,t)=>t!==void 0&&Y1(e)===t&&e.mounted),triggerProps:S1((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:S1(e=>e.popupProps),popupElement:S1(e=>e.popupElement),positionerElement:S1(e=>e.positionerElement)};function Z1(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=mQ(),a=vQ()!=null,o=WY(()=>new N1({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new K1,floatingId:i,nested:a,noEmit:!1})).current;return EX(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=zX(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=!1,o}function Q1(e={}){let{nodeId:t,externalTree:n}=e,r=Z1(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=O.useState(null),c=O.useRef(null),l=yQ(n);EX(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=G$({...e,elements:{...a,...o&&{reference:o}}}),d=O.useCallback(e=>{let t=zX(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=O.useState(null),[m,h]=O.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,zX(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=O.useCallback(e=>{(zX(e)||e===null)&&(c.current=e,p(e)),(zX(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!zX(e))&&u.refs.setReference(e)},[u.refs,p]),_=O.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=O.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=O.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=O.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return EX(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),O.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function $1(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=mQ(),o=vQ()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=WY(()=>new N1({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return EX(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};zX(c)&&(e.domReferenceElement=c),d.state.positionReference===d.state.referenceElement&&(e.positionReference=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var e0=vZ&&_Z;function t0(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=O.useRef(!1),c=O.useRef(null),l=NX(),u=O.useRef(!0);O.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=IX(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&BX(e)&&e===wZ(fZ(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return t.addEventListener(`blur`,r),e0&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),e0&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),O.useEffect(()=>{if(!a)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=n.select(`domReferenceElement`);zX(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=O.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=DZ(e.nativeEvent);if(zX(r)){if(e0&&!e.relatedTarget){if(!u.current&&!AZ(r))return}else if(!jZ(r))return}let i=EZ(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,CQ(SQ,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,CQ(SQ,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=zX(t)&&t.hasAttribute(wQ(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=wZ(e?e.ownerDocument:document);!t&&o===e||TZ(i.current.floatingContext?.refs.floating.current,o)||TZ(e,o)||a||EZ(t??o,n.context.triggerElements)||n.setOpen(!1,CQ(SQ,r))})}}),[i,n,l,o]);return O.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}const n0=wQ(`safe-polygon`);var r0=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${CZ}`;function i0(e){return e?!!e.closest(r0):!1}var a0=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new MX,this.restTimeout=new MX,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};function o0(e){let t=WY(a0.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,AX(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}var s0=new Set([`click`,`mousedown`]);function c0(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0}=t,l=o0(n),u=yQ(),d=vQ(),f=lZ(()=>l.interactedInside?!0:o.current.openEvent?s0.has(o.current.openEvent.type):!1),p=lZ(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),m=lZ(e=>EZ(e,n.context.triggerElements)),h=O.useCallback((e,t=!0)=>{let r=l0(c,l.pointerType);r&&!l.handler?l.openChangeTimeout.start(r,()=>n.setOpen(!1,CQ(xQ,e))):t&&(l.openChangeTimeout.clear(),n.setOpen(!1,CQ(xQ,e)))},[c,n,l]),g=lZ(()=>{l.unbindMouseMove(),l.handler=void 0}),_=lZ(()=>{if(l.performedPointerEventsMutation){let e=fZ(i).body;e.style.pointerEvents=``,e.removeAttribute(n0),l.performedPointerEventsMutation=!1}}),v=lZ(e=>{if(!i0(DZ(e))){l.interactedInside=!1;return}l.interactedInside=!0});EX(()=>{r||(l.pointerType=void 0,l.restTimeoutPending=!1,l.interactedInside=!1,g(),_())},[r,l,g,_]),O.useEffect(()=>()=>{g()},[g]),O.useEffect(()=>_,[_]),EX(()=>{if(s&&r&&l.handleCloseOptions?.blockPointerEvents&&p()&&zX(a)&&i){l.performedPointerEventsMutation=!0;let e=fZ(i).body;e.setAttribute(n0,``);let t=a,n=i,r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,l,p,u,d]),O.useEffect(()=>{if(!s)return;function e(e){f()||!o.current.floatingContext||!n.select(`open`)||m(e.relatedTarget)||(_(),g(),f()||h(e))}function t(e){l.openChangeTimeout.clear(),_(),l.handler?.(e),g()}function r(e){f()||h(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,v,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,v,!0))}},[s,i,n,o,f,m,h,_,g,v,l])}function l0(e,t){return t&&!PZ(t)?0:typeof e==`function`?e():e}var u0=u(_());function d0(e){return typeof e==`function`?e():e}var f0={current:null};function p0(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=f0,externalTree:f,isActiveTrigger:p=!0}=t,m=yQ(f),h=o0(n),g=aZ(s),_=aZ(o),v=aZ(l),y=aZ(a);p&&(h.handleCloseOptions=g.current?.__options);let b=lZ(()=>h.interactedInside?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),x=lZ(e=>EZ(e,n.context.triggerElements)),S=O.useCallback((e,t=!0)=>{let r=TQ(_.current,`close`,h.pointerType);r&&!h.handler?h.openChangeTimeout.start(r,()=>n.setOpen(!1,CQ(xQ,e))):t&&(h.openChangeTimeout.clear(),n.setOpen(!1,CQ(xQ,e)))},[_,n,h]),C=lZ(()=>{h.unbindMouseMove(),h.handler=void 0}),w=lZ(()=>{if(h.performedPointerEventsMutation){let e=fZ(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(n0),h.performedPointerEventsMutation=!1}});O.useEffect(()=>{if(!a)return;function e(e){e.open||(h.openChangeTimeout.clear(),h.restTimeout.clear(),h.blockMouseMove=!0,h.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,h]);let T=lZ(e=>{if(b()||!r.current.floatingContext||x(e.relatedTarget))return;let t=d.current;g.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){w(),C(),!b()&&t===n.select(`domReferenceElement`)&&S(e)}})(e)});return O.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!zX(e))return;function t(e){if(h.openChangeTimeout.clear(),h.blockMouseMove=!1,c&&!PZ(h.pointerType)||d0(v.current)>0&&!TQ(_.current,`open`))return;let t=TQ(_.current,`open`,h.pointerType),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>TZ(t,e.target)))&&(!r||!TZ(r,e.target)),o=e.currentTarget??null,s=n.select(`open`),l=!s||a;a&&s?n.setOpen(!0,CQ(xQ,e,o)):t?h.openChangeTimeout.start(t,()=>{l&&n.setOpen(!0,CQ(xQ,e,o))}):l&&n.setOpen(!0,CQ(xQ,e,o))}function i(e){if(b()){w();return}h.unbindMouseMove();let t=fZ(n.select(`domReferenceElement`));if(h.restTimeout.clear(),h.restTimeoutPending=!1,!x(e.relatedTarget)){if(g.current&&r.current.floatingContext){n.select(`open`)||h.openChangeTimeout.clear();let i=d.current;h.handler=g.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){w(),C(),y.current&&!b()&&i===n.select(`domReferenceElement`)&&S(e,!0)}});let a=h.handler;a(e),t.addEventListener(`mousemove`,a),h.unbindMouseMove=()=>{t.removeEventListener(`mousemove`,a)};return}(h.pointerType!==`touch`||!TZ(n.select(`floatingElement`),e.relatedTarget))&&S(e)}}function o(e){T(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[C,w,r,_,S,n,a,g,T,h,p,b,x,c,u,v,d,m,y]),O.useMemo(()=>{if(!a)return;function e(e){h.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>TZ(t,e.target)))&&(!i||!TZ(i,e.target));if(c&&!PZ(h.pointerType)||o&&!s||d0(v.current)===0||!s&&h.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;h.restTimeout.clear();function l(){if(h.restTimeoutPending=!1,b())return;let e=n.select(`open`);!h.blockMouseMove&&(!e||s)&&n.setOpen(!0,CQ(xQ,t,r))}h.pointerType===`touch`?u0.flushSync(()=>{l()}):s&&o?l():(h.restTimeoutPending=!0,h.restTimeout.start(d0(v.current),l))}}},[a,h,b,c,n,v])}function m0(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=O.useCallback(t=>h0(t,e,`reference`),t),o=O.useCallback(t=>h0(t,e,`floating`),n),s=O.useCallback(t=>h0(t,e,`item`),r),c=O.useCallback(t=>h0(t,e,`trigger`),i);return O.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function h0(e,t,n){let r=new Map,i=n===`item`,a={};for(let t in n===`floating`&&(a.tabIndex=-1,a[`data-base-ui-focusable`]=``),e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&g0(a,s,i,r)}return g0(a,e,i,r),a}function g0(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}function _0(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function v0(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function y0(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new MX,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=DZ(f),v=f.type===`mouseleave`,y=TZ(s.floating,_),b=TZ(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,ee=v0(g,x),E=S.width>x.width,te=S.height>x.height,ne=(E?x:S).left,re=(E?x:S).right,ie=(te?x:S).top,ae=(te?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&zX(f.relatedTarget)&&TZ(s.floating,f.relatedTarget)||d&&MZ(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let oe=[];switch(C){case`top`:oe=[[ne,x.top+1],[ne,S.bottom-1],[re,S.bottom-1],[re,x.top+1]];break;case`bottom`:oe=[[ne,S.top+1],[ne,x.bottom-1],[re,x.bottom-1],[re,S.top+1]];break;case`left`:oe=[[S.right-1,ae],[S.right-1,ie],[x.left+1,ie],[x.left+1,ae]];break;case`right`:oe=[[x.right-1,ae],[x.right-1,ie],[S.left+1,ie],[S.left+1,ae]];break;default:}function se([e,n]){switch(C){case`top`:return[[E?e+t/2:w?e+t*4:e-t*4,n+t+1],[E?e-t/2:w?e+t*4:e-t*4,n+t+1],...[[S.left,w||E?S.bottom-t:S.top],[S.right,w?E?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[E?e+t/2:w?e+t*4:e-t*4,n-t],[E?e-t/2:w?e+t*4:e-t*4,n-t],...[[S.left,w||E?S.top+t:S.bottom],[S.right,w?E?S.top+t:S.bottom:S.top+t]]];case`left`:{let r=[e+t+1,te?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,te?n-t/2:T?n+t*4:n-t*4];return[...[[T||te?S.right-t:S.left,S.top],[T?te?S.right-t:S.left:S.right-t,S.bottom]],r,i]}case`right`:return[[e-t,te?n+t/2:T?n+t*4:n-t*4],[e-t,te?n-t/2:T?n+t*4:n-t*4],...[[T||te?S.left+t:S.right,S.top],[T?te?S.left+t:S.right:S.left+t,S.bottom]]];default:return[]}}if(!_0([m,h],oe)){if(a&&!ee)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}_0([m,h],se([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var b0=u(_()),x0={...X1,disabled:S1(e=>e.disabled),instantType:S1(e=>e.instantType),isInstantPhase:S1(e=>e.isInstantPhase),trackCursorAxis:S1(e=>e.trackCursorAxis),disableHoverablePopup:S1(e=>e.disableHoverablePopup),lastOpenChangeReason:S1(e=>e.openChangeReason),closeDelay:S1(e=>e.closeDelay),hasViewport:S1(e=>e.hasViewport)},S0=class e extends j1{constructor(e){super({...C0(),...e},{popupRef:O.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new K1},x0)}setOpen=(e,t)=>{let n=t.reason,r=n===xQ,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?b0.flushSync(o):o()};static useStore(t,n){let r=WY(()=>new e(n)).current,i=t??r,a=$1({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function C0(){return{...J1(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const w0=SX(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=S0.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});TX(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),EX(()=>{m&&t&&p.setOpen(!1,CQ(`disabled`))},[m,t,p]),p.useSyncedValue(`disabled`,t),W1(p);let{forceUnmount:v,transitionStatus:y}=G1(h,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=O.useRef(null);EX(()=>{y===`ending`&&S===`none`||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),EX(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let w=O.useCallback(()=>{p.setOpen(!1,T0(p,`imperative-action`))},[p]);O.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:ee,getFloatingProps:E,getTriggerProps:te}=m0([e1(T,{enabled:!t,referencePress:!0}),VQ(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),ne=O.useMemo(()=>ee(),[ee]),re=O.useMemo(()=>te(),[te]),ie=O.useMemo(()=>E(),[E]);return p.useSyncedValues({activeTriggerProps:ne,inactiveTriggerProps:re,popupProps:ie}),(0,k.jsx)(DX.Provider,{value:p,children:typeof f==`function`?f({payload:_}):f})});function T0(e,t){let n=CQ(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}let E0=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=F1.startingStyle]=`startingStyle`,e[e.endingStyle=F1.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),D0=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({});var O0={[D0.popupOpen]:``};D0.popupOpen,D0.pressed;var k0={[E0.open]:``},A0={[E0.closed]:``},j0={[E0.anchorHidden]:``};const M0={open(e){return e?O0:null}},N0={open(e){return e?k0:A0},anchorHidden(e){return e?j0:null}};function P0(e){return mQ(e,`base-ui`)}const F0=O.createContext(void 0);function I0(){return O.useContext(F0)}let L0=function(e){return e[e.popupOpen=D0.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({});const R0=CX(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=OX(!0),f=i?.store??d;if(!f)throw Error(HY(82));let p=P0(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`floatingRootContext`),_=O.useRef(null),v=s??600,y=c??0,{registerTrigger:b,isMountedByThisTrigger:x}=U1(p,_,f,{payload:a,closeDelay:y}),S=I0(),{delayRef:C,isInstantPhase:w,hasProvider:T}=OQ(g,{open:h});f.useSyncedValue(`isInstantPhase`,w);let ee=f.useState(`disabled`),E=o??ee,te=f.useState(`trackCursorAxis`),ne=f.useState(`disableHoverablePopup`),re=p0(g,{enabled:!E,mouseOnly:!0,move:!1,handleClose:!ne&&te!==`both`?y0():null,restMs(){let e=S?.delay,t=typeof C.current==`object`?C.current.open:void 0,n=v;return T&&(n=t===0?0:s??e??v),n},delay(){let e=typeof C.current==`object`?C.current.close:void 0,t=y;return c==null&&T&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),ie=t0(g,{enabled:!E}).reference,ae={open:h},oe=f.useState(`triggerProps`,x);return sX(`button`,e,{state:ae,ref:[t,b,_],props:[re,ie,oe,{id:p,[L0.triggerDisabled]:E?``:void 0},u],stateAttributesMapping:M0})}),z0=O.createContext(void 0);function B0(){let e=O.useContext(z0);if(e===void 0)throw Error(HY(70));return e}var V0=u(_());const H0=O.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=LQ({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,k.jsxs)(O.Fragment,{children:[c,s&&V0.createPortal(n,s)]})}),U0=O.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return OX().useState(`mounted`)||n?(0,k.jsx)(z0.Provider,{value:n,children:(0,k.jsx)(H0,{ref:t,...r})}):null}),W0=O.createContext(void 0);function G0(){let e=O.useContext(W0);if(e===void 0)throw Error(HY(71));return e}const K0=O.createContext(void 0);function q0(){return O.useContext(K0)?.direction??`ltr`}const J0=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=WZ(e,t)||{};if(l==null)return{};let f=cQ(u),p={x:n,y:r},m=XZ(i),h=JZ(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,ee=w/2-g[h]/2-1,E=Math.min(f[v],ee),te=Math.min(f[y],ee),ne=E,re=w-g[h]-te,ie=w/2-g[h]/2+T,ae=UZ(ne,ie,re),oe=!c.arrow&&KZ(i)!=null&&ie!==ae&&a.reference[h]/2-(ie<ne?E:te)-g[h]/2<0,se=oe?ie<ne?ie-ne:ie-re:0;return{[m]:p[m]+se,data:{[m]:ae,centerOffset:ie-ae-se,...oe&&{alignmentOffset:se}},reset:oe}}}),Y0=(e,t)=>({...J0(e),options:[e,t]}),X0={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Z$().fn(e)).data?.referenceHidden||a}}}},Z0={sideX:`left`,sideY:`top`},Q0={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=IX(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Z0};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=fZ(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=GZ(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Z0.sideX,g=f===`top`?`bottom`:Z0.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function $0(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function e2(e,t,n){let{rects:r,placement:i}=e;return{side:$0(t,GZ(i),n),align:KZ(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function t2(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=O.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,ee=typeof t==`function`?t:void 0,E=lZ(ee),te=ee?E:t,ne=aZ(t),re=q0()===`rtl`,ie=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":re?`left`:`right`,"inline-start":re?`right`:`left`}[r],ae=a===`center`?ie:`${ie}-${a}`,oe=c,se=r===`bottom`?1:0,ce=r===`top`?1:0,D=r===`right`?1:0,le=r===`left`?1:0;typeof oe==`number`?oe={top:oe+se,right:oe+le,bottom:oe+ce,left:oe+D}:oe&&={top:(oe.top||0)+se,right:(oe.right||0)+le,bottom:(oe.bottom||0)+ce,left:(oe.left||0)+D};let ue={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:oe},de=O.useRef(null),fe=aZ(i),pe=aZ(o),me=[K$(e=>{let t=e2(e,r,re),n=typeof fe.current==`function`?fe.current(t):fe.current,i=typeof pe.current==`function`?pe.current(t):pe.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,re,r])],he=w===`none`&&C!==`shift`,ge=!he&&(l||g||C===`shift`),_e=C===`none`?null:Y$({...ue,padding:{top:oe.top+1,right:oe.right+1,bottom:oe.bottom+1,left:oe.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),ve=he?null:q$(e=>{let t=fZ(e.elements.floating).documentElement;return{...ue,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:ge,limiter:l||g?void 0:J$(e=>{if(!de.current)return{};let{width:t,height:n}=de.current.getBoundingClientRect(),r=YZ(GZ(e.placement)),i=r===`y`?t:n,a=r===`y`?oe.left+oe.right:oe.top+oe.bottom;return{offset:i/2+a/2}})}},[ue,l,g,oe,w]);C===`shift`||w===`shift`||a===`center`?me.push(ve,_e):me.push(_e,ve),me.push(X$({...ue,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){let i=e.style;i.setProperty(`--available-width`,`${n}px`),i.setProperty(`--available-height`,`${r}px`),i.setProperty(`--anchor-width`,`${t.width}px`),i.setProperty(`--anchor-height`,`${t.height}px`)}}),Y0(()=>({element:de.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=GZ(a),l=YZ(c),u=de.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(e2(e,r,re)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ge&&l===`y`&&b?S:x),{}}},X0,v),EX(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let ye=O.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:be,elements:xe,x:Se,y:Ce,middlewareData:we,update:Te,placement:Ee,context:De,isPositioned:Oe,floatingStyles:ke}=Q1({rootContext:p,placement:ae,middleware:me,strategy:n,whileElementsMounted:f?void 0:(...e)=>j$(...e,ye),nodeId:_,externalTree:b}),{sideX:Ae,sideY:je}=we.adaptiveOrigin||Z0,Me=Oe?n:`fixed`,Ne=O.useMemo(()=>{let e=v?{position:Me,[Ae]:Se,[je]:Ce}:{position:Me,...ke};return Oe||(e.opacity=0),e},[v,Me,Ae,Se,je,Ce,ke,Oe]),Pe=O.useRef(null);EX(()=>{if(!m)return;let e=ne.current,t=typeof e==`function`?e():e,n=(n2(t)?t.current:t)||null;n!==Pe.current&&(be.setPositionReference(n),Pe.current=n)},[m,be,te,ne]),O.useEffect(()=>{if(!m)return;let e=ne.current;typeof e!=`function`&&n2(e)&&e.current!==Pe.current&&(be.setPositionReference(e.current),Pe.current=e.current)},[m,be,te,ne]),O.useEffect(()=>{if(f&&m&&xe.domReference&&xe.floating)return j$(xe.domReference,xe.floating,Te,ye)},[f,m,xe,Te,ye]);let Fe=GZ(Ee),Ie=$0(r,Fe,re),Le=KZ(Ee)||`center`,Re=!!we.hide?.referenceHidden;EX(()=>{y&&m&&Oe&&S(Fe)},[y,m,Oe,Fe]);let ze=O.useMemo(()=>({position:`absolute`,top:we.arrow?.y,left:we.arrow?.x}),[we.arrow]),Be=we.arrow?.centerOffset!==0;return O.useMemo(()=>({positionerStyles:Ne,arrowStyles:ze,arrowRef:de,arrowUncentered:Be,side:Ie,align:Le,physicalSide:Fe,anchorHidden:Re,refs:be,context:De,isPositioned:Oe,update:Te}),[Ne,ze,de,Be,Ie,Le,Fe,Re,be,De,Oe,Te])}function n2(e){return e!=null&&`current`in e}function r2(e){return e===`starting`?aX:iX}const i2=O.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=oX,...g}=e,_=OX(),v=B0(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),ee=t2({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:_.useState(`hasViewport`)?Q0:void 0}),E=O.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...ee.positionerStyles,...e}}},[y,x,S,b,ee.positionerStyles]),te=O.useMemo(()=>({open:y,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,ee.side,ee.align,ee.anchorHidden,x,w]),ne=O.useMemo(()=>({...te,arrowRef:ee.arrowRef,arrowStyles:ee.arrowStyles,arrowUncentered:ee.arrowUncentered}),[te,ee.arrowRef,ee.arrowStyles,ee.arrowUncentered]),re=sX(`div`,e,{state:te,props:[E,r2(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:N0});return(0,k.jsx)(W0.Provider,{value:ne,children:re})});var a2={...N0,...R1};const o2=O.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=OX(),{side:o,align:s}=G0(),c=a.useState(`open`),l=a.useState(`instantType`),u=a.useState(`transitionStatus`),d=a.useState(`popupProps`),f=a.useState(`floatingRootContext`);V1({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});let p=a.useState(`disabled`),m=a.useState(`closeDelay`);return c0(f,{enabled:!p,closeDelay:m}),sX(`div`,e,{state:{open:c,side:o,align:s,instant:l,transitionStatus:u},ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[d,r2(u),i],stateAttributesMapping:a2})}),s2=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=O.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=O.useMemo(()=>({open:t,close:n}),[t,n]);return(0,k.jsx)(F0.Provider,{value:i,children:(0,k.jsx)(DQ,{delay:a,timeoutMs:r,children:e.children})})};let c2=function(e){return e.popupWidth=`--popup-width`,e.popupHeight=`--popup-height`,e}({});function l2(e){return QY(19)?e:e?`true`:void 0}function u2(e){let[t,n]=O.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function d2(e){let t=$X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=BX(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(zZ(n)!==a||zZ(r)!==o)&&(n=a,r=o),{width:n,height:r}}var f2=typeof ResizeObserver<`u`,p2=()=>!0;function m2(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=p2,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=B1(t,!0,!1),d=MQ(),f=O.useRef(null),p=O.useRef(null),m=O.useRef(!0),h=O.useRef(rX),g=lZ(o),_=lZ(s),v=O.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:iX},[c,l]);EX(()=>{if(!i||!a()||!f2){h.current=rX,m.current=!0,f.current=null,p.current=null;return}if(!t||!n)return;h.current=g2(t,v);let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});e.observe(t),_2(t,`auto`);let r=h2(t,`position`,`static`),o=h2(t,`transform`,`none`),s=h2(t,`scale`,`1`),c=g2(n,{"--available-width":`max-content`,"--available-height":`max-content`});function l(){r(),o(),c()}function y(){l(),s()}if(g?.(),m.current||f.current===null){v2(n,`max-content`);let r=d2(t);return f.current=r,v2(n,r),y(),_?.(null,r),m.current=!1,()=>{e.disconnect(),h.current(),h.current=rX}}_2(t,`auto`),v2(n,`max-content`);let b=f.current??p.current,x=d2(t);if(f.current=x,!b)return v2(n,x),y(),_?.(null,x),()=>{e.disconnect(),d.cancel(),h.current(),h.current=rX};_2(t,b),y(),_?.(b,x),v2(n,x);let S=new AbortController;return d.request(()=>{_2(t,x),u(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},S.signal)}),()=>{e.disconnect(),S.abort(),d.cancel(),h.current(),h.current=rX}},[r,t,n,u,d,a,i,g,_,v])}function h2(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function g2(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(h2(e,r,i));return n.length?()=>{n.forEach(e=>e())}:rX}function _2(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function v2(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}function y2(e){let{store:t,side:n,cssVars:r,children:i}=e,a=q0(),o=t.useState(`activeTriggerElement`),s=t.useState(`activeTriggerId`),c=t.useState(`open`),l=t.useState(`payload`),u=t.useState(`mounted`),d=t.useState(`popupElement`),f=t.useState(`positionerElement`),p=u2(c?o:null),m=C2(s,l),h=O.useRef(null),[g,_]=O.useState(null),[v,y]=O.useState(null),b=O.useRef(null),x=O.useRef(null),S=B1(b,!0,!1),C=MQ(),[w,T]=O.useState(null),[ee,E]=O.useState(!1);EX(()=>(t.set(`hasViewport`,!0),()=>{t.set(`hasViewport`,!1)}),[t]);let te=lZ(()=>{b.current?.style.setProperty(`animation`,`none`),b.current?.style.setProperty(`transition`,`none`),x.current?.style.setProperty(`display`,`none`)}),ne=lZ(e=>{b.current?.style.removeProperty(`animation`),b.current?.style.removeProperty(`transition`),x.current?.style.removeProperty(`display`),e&&T(e)}),re=O.useRef(null);EX(()=>{o&&p&&o!==p&&re.current!==o&&h.current&&(_(h.current),E(!0),y(S2(p,o)),C.request(()=>{C.request(()=>{E(!1),S(()=>{_(null),T(null),h.current=null})})}),re.current=o)},[o,p,g,S,C]),EX(()=>{let e=b.current;if(!e)return;let t=document.createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));h.current=t});let ie=g!=null,ae;ae=ie?(0,k.jsxs)(O.Fragment,{children:[(0,k.jsx)(`div`,{"data-previous":!0,inert:l2(!0),ref:x,style:{[r.popupWidth]:`${w?.width}px`,[r.popupHeight]:`${w?.height}px`,position:`absolute`},"data-ending-style":ee?void 0:``},`previous`),(0,k.jsx)(`div`,{"data-current":!0,ref:b,"data-starting-style":ee?``:void 0,children:i},m)]}):(0,k.jsx)(`div`,{"data-current":!0,ref:b,children:i},m),EX(()=>{let e=x.current;!e||!g||e.replaceChildren(...Array.from(g.childNodes))},[g]),m2({popupElement:d,positionerElement:f,mounted:u,content:l,onMeasureLayout:te,onMeasureLayoutComplete:ne,side:n,direction:a});let oe={activationDirection:b2(v),transitioning:ie};return{children:ae,state:oe}}function b2(e){if(e)return`${x2(e.horizontal,5,`right`,`left`)} ${x2(e.vertical,5,`down`,`up`)}`}function x2(e,t,n,r){return e>t?n:e<-t?r:``}function S2(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function C2(e,t){let[n,r]=O.useState(0),i=O.useRef(e),a=O.useRef(t),o=O.useRef(!1);return EX(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}var w2={activationDirection:e=>e?{"data-activation-direction":e}:null};const T2=O.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,o=OX(),s=G0(),c=o.useState(`instantType`),{children:l,state:u}=y2({store:o,side:s.side,cssVars:c2,children:i});return sX(`div`,e,{state:{activationDirection:u.activationDirection,transitioning:u.transitioning,instant:c},ref:t,props:[a,{children:l}],stateAttributesMapping:w2})});var E2=s2,D2=w0;function O2(e){return(0,k.jsx)(R0,{"data-slot":`tooltip-trigger`,...e})}function k2({className:e,align:t=`center`,sideOffset:n=4,side:r=`top`,anchor:i,children:a,...o}){return(0,k.jsx)(U0,{children:(0,k.jsx)(i2,{align:t,anchor:i,className:`z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,"data-slot":`tooltip-positioner`,side:r,sideOffset:n,children:(0,k.jsx)(o2,{className:EY(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) text-balance rounded-md border bg-popover not-dark:bg-clip-padding text-popover-foreground text-xs shadow-md/5 transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 data-instant:duration-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e),"data-slot":`tooltip-popup`,...o,children:(0,k.jsx)(T2,{className:`relative size-full overflow-clip px-(--viewport-inline-padding) py-1 [--viewport-inline-padding:--spacing(2)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:truncate **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,"data-slot":`tooltip-viewport`,children:a})})})})}function A2(){let{meta:e,state:t,actions:n}=Bq(),r=Rq(),i=Lq(),a=(0,O.useCallback)(()=>{r.mutate()},[r]);return(0,k.jsx)(`header`,{className:`header-surface`,children:(0,k.jsxs)(`div`,{className:`header-shell`,children:[(0,k.jsxs)(`h1`,{className:`type-title`,children:[`plot`,` `,(0,k.jsxs)(`span`,{className:`type-meta`,children:[`· `,e.runningCount,` active`,e.retryingCount>0?` · ${e.retryingCount} retrying`:``]})]}),(0,k.jsxs)(`div`,{className:`cluster-shell-lg`,children:[(0,k.jsx)(E2,{children:(0,k.jsxs)(D2,{children:[(0,k.jsxs)(O2,{className:`flex items-center`,children:[(0,k.jsx)(OY,{status:i,className:`size-2`}),i!==`connected`&&(0,k.jsx)(`span`,{className:`type-meta ml-2 capitalize`,children:i})]}),(0,k.jsxs)(k2,{children:[`stream `,i]})]})}),(0,k.jsx)(_X,{variant:`ghost`,size:`icon-xs`,onClick:n.toggleOps,className:EY(t.opsOpen&&`bg-accent`),"aria-label":`toggle ops`,children:(0,k.jsx)(Xq,{})}),(0,k.jsx)(_X,{variant:`ghost`,size:`icon-xs`,onClick:a,"aria-label":`refresh`,children:(0,k.jsx)(Qq,{})})]})]})})}var j2=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1});function M2(e){return j2.format(e).toLowerCase()}function N2(e){let t=typeof e==`string`?new Date(e).getTime():Number(UL(e)),n=(Date.now()-t)/1e3;return n<60?`${Math.round(n)}s ago`:n<3600?`${Math.round(n/60)}m ago`:`${Math.round(n/3600)}h ago`}var P2={PreparingWorkspace:`Setting up`,BuildingPrompt:`Preparing`,LaunchingAgentProcess:`Launching`,InitializingSession:`Starting`,StreamingTurn:`Working`,Finishing:`Wrapping up`,Succeeded:`Done`,Failed:`Failed`,TimedOut:`Timed out`,Stalled:`Stalled`,CanceledByReconciliation:`Canceled`};function F2(e){return P2[e]??e}var I2={StreamingTurn:`default`,PreparingWorkspace:`info`,BuildingPrompt:`info`,LaunchingAgentProcess:`info`,InitializingSession:`info`,Finishing:`info`,Succeeded:`success`,Failed:`error`,TimedOut:`error`,Stalled:`warning`,CanceledByReconciliation:`outline`};function L2(e){return I2[e]??`outline`}var R2=new Set([`StreamingTurn`,`BuildingPrompt`,`LaunchingAgentProcess`,`InitializingSession`,`PreparingWorkspace`,`Finishing`]);function z2(e){return R2.has(e)}var B2=hX(`relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs`,lg:`h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm`,sm:`h-5 min-w-5 rounded-[.25rem] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]`},variant:{default:`bg-primary text-primary-foreground [button&,a&]:hover:bg-primary/90`,destructive:`bg-destructive text-white [button&,a&]:hover:bg-destructive/90`,error:`bg-destructive/8 text-destructive-foreground dark:bg-destructive/16`,info:`bg-info/8 text-info-foreground dark:bg-info/16`,outline:`border-input bg-background text-foreground dark:bg-input/32 [button&,a&]:hover:bg-accent/50 dark:[button&,a&]:hover:bg-input/48`,secondary:`bg-secondary text-secondary-foreground [button&,a&]:hover:bg-secondary/90`,success:`bg-success/8 text-success-foreground dark:bg-success/16`,warning:`bg-warning/8 text-warning-foreground dark:bg-warning/16`}}});function V2({className:e,variant:t,size:n,render:r,...i}){return fX({defaultTagName:`span`,props:jY({className:EY(B2({className:e,size:n,variant:t})),"data-slot":`badge`},i),render:r})}function H2(e,t){e.indexOf(t)===-1&&e.push(t)}function U2(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var W2=(e,t,n)=>n>t?t:n<e?e:n,G2={},K2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function q2(e){return typeof e==`object`&&!!e}var J2=e=>/^0[^.\s]+$/u.test(e);function Y2(e){let t;return()=>(t===void 0&&(t=e()),t)}var X2=e=>e,Z2=(e,t)=>n=>t(e(n)),Q2=(...e)=>e.reduce(Z2),$2=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},e4=class{constructor(){this.subscriptions=[]}add(e){return H2(this.subscriptions,e),()=>U2(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},t4=e=>e*1e3,n4=e=>e/1e3;function r4(e,t){return t?1e3/t*e:0}var i4=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},a4=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,o4=1e-7,s4=12;function c4(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=a4(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>o4&&++s<s4);return o}function l4(e,t,n,r){if(e===t&&n===r)return X2;let i=t=>c4(t,0,1,e,n);return e=>e===0||e===1?e:a4(i(e),t,r)}var u4=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,d4=e=>t=>1-e(1-t),f4=l4(.33,1.53,.69,.99),p4=d4(f4),m4=u4(p4),h4=e=>(e*=2)<1?.5*p4(e):.5*(2-2**(-10*(e-1))),g4=e=>1-Math.sin(Math.acos(e)),_4=d4(g4),v4=u4(g4),y4=l4(.42,0,1,1),b4=l4(0,0,.58,1),x4=l4(.42,0,.58,1),S4=e=>Array.isArray(e)&&typeof e[0]!=`number`;function C4(e,t){return S4(e)?e[i4(0,e.length,t)]:e}var w4=e=>Array.isArray(e)&&typeof e[0]==`number`,T4={linear:X2,easeIn:y4,easeInOut:x4,easeOut:b4,circIn:g4,circInOut:v4,circOut:_4,backIn:p4,backInOut:m4,backOut:f4,anticipate:h4},Woe=e=>typeof e==`string`,E4=e=>{if(w4(e)){e.length;let[t,n,r,i]=e;return l4(t,n,r,i)}else if(Woe(e))return T4[e],`${e}`,T4[e];return e},D4=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],O4={value:null,addProjectionMetrics:null};function Goe(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&O4.value&&O4.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var Koe=40;function k4(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=D4.reduce((e,n)=>(e[n]=Goe(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=G2.useManualTiming?i.timestamp:performance.now();n=!1,G2.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,Koe),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:D4.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<D4.length;t++)o[D4[t]].cancel(e)},state:i,steps:o}}var{schedule:A4,cancel:j4,state:M4,steps:N4}=k4(typeof requestAnimationFrame<`u`?requestAnimationFrame:X2,!0),P4;function qoe(){P4=void 0}var F4={now:()=>(P4===void 0&&F4.set(M4.isProcessing||G2.useManualTiming?M4.timestamp:performance.now()),P4),set:e=>{P4=e,queueMicrotask(qoe)}},I4={layout:0,mainThread:0,waapi:0},L4=e=>t=>typeof t==`string`&&t.startsWith(e),R4=L4(`--`),Joe=L4(`var(--`),z4=e=>Joe(e)?Yoe.test(e.split(`/*`)[0].trim()):!1,Yoe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function B4(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var V4={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},H4={...V4,transform:e=>W2(0,1,e)},U4={...V4,default:1},W4=e=>Math.round(e*1e5)/1e5,G4=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Xoe(e){return e==null}var Zoe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,K4=(e,t)=>n=>!!(typeof n==`string`&&Zoe.test(n)&&n.startsWith(e)||t&&!Xoe(n)&&Object.prototype.hasOwnProperty.call(n,t)),q4=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(G4);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Qoe=e=>W2(0,255,e),J4={...V4,transform:e=>Math.round(Qoe(e))},Y4={test:K4(`rgb`,`red`),parse:q4(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+J4.transform(e)+`, `+J4.transform(t)+`, `+J4.transform(n)+`, `+W4(H4.transform(r))+`)`};function $oe(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var X4={test:K4(`#`),parse:$oe,transform:Y4.transform},Z4=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Q4=Z4(`deg`),$4=Z4(`%`),$=Z4(`px`),ese=Z4(`vh`),tse=Z4(`vw`),e3=(()=>({...$4,parse:e=>$4.parse(e)/100,transform:e=>$4.transform(e*100)}))(),t3={test:K4(`hsl`,`hue`),parse:q4(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+$4.transform(W4(t))+`, `+$4.transform(W4(n))+`, `+W4(H4.transform(r))+`)`},n3={test:e=>Y4.test(e)||X4.test(e)||t3.test(e),parse:e=>Y4.test(e)?Y4.parse(e):t3.test(e)?t3.parse(e):X4.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Y4.transform(e):t3.transform(e),getAnimatableNone:e=>{let t=n3.parse(e);return t.alpha=0,n3.transform(t)}},nse=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rse(e){return isNaN(e)&&typeof e==`string`&&(e.match(G4)?.length||0)+(e.match(nse)?.length||0)>0}var r3=`number`,i3=`color`,ise=`var`,ase=`var(`,a3="${}",ose=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function o3(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(ose,e=>(n3.test(e)?(r.color.push(a),i.push(i3),n.push(n3.parse(e))):e.startsWith(ase)?(r.var.push(a),i.push(ise),n.push(e)):(r.number.push(a),i.push(r3),n.push(parseFloat(e))),++a,a3)).split(a3),indexes:r,types:i}}function s3(e){return o3(e).values}function c3(e){let{split:t,types:n}=o3(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===r3?i+=W4(e[a]):t===i3?i+=n3.transform(e[a]):i+=e[a]}return i}}var sse=e=>typeof e==`number`?0:n3.test(e)?n3.getAnimatableNone(e):e;function cse(e){let t=s3(e);return c3(e)(t.map(sse))}var l3={test:rse,parse:s3,createTransformer:c3,getAnimatableNone:cse};function u3(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function lse({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=u3(s,r,e+1/3),a=u3(s,r,e),o=u3(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function d3(e,t){return n=>n>0?t:e}var f3=(e,t,n)=>e+(t-e)*n,p3=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},use=[X4,Y4,t3],dse=e=>use.find(t=>t.test(e));function m3(e){let t=dse(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===t3&&(n=lse(n)),n}var h3=(e,t)=>{let n=m3(e),r=m3(t);if(!n||!r)return d3(e,t);let i={...n};return e=>(i.red=p3(n.red,r.red,e),i.green=p3(n.green,r.green,e),i.blue=p3(n.blue,r.blue,e),i.alpha=f3(n.alpha,r.alpha,e),Y4.transform(i))},g3=new Set([`none`,`hidden`]);function fse(e,t){return g3.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function pse(e,t){return n=>f3(e,t,n)}function _3(e){return typeof e==`number`?pse:typeof e==`string`?z4(e)?d3:n3.test(e)?h3:gse:Array.isArray(e)?v3:typeof e==`object`?n3.test(e)?h3:mse:d3}function v3(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>_3(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function mse(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=_3(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function hse(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var gse=(e,t)=>{let n=l3.createTransformer(t),r=o3(e),i=o3(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?g3.has(e)&&!i.values.length||g3.has(t)&&!r.values.length?fse(e,t):Q2(v3(hse(r,i),i.values),n):(`${e}${t}`,d3(e,t))};function y3(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?f3(e,t,n):_3(e)(e,t)}var _se=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>A4.update(t,e),stop:()=>j4(t),now:()=>M4.isProcessing?M4.timestamp:F4.now()}},b3=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},x3=2e4;function S3(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function C3(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(S3(r),x3);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:n4(i)}}var vse=5;function w3(e,t,n){let r=Math.max(t-vse,0);return r4(n-e(r),t-r)}var T3={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},E3=.001;function yse({duration:e=T3.duration,bounce:t=T3.bounce,velocity:n=T3.velocity,mass:r=T3.mass}){let i,a;T3.maxDuration;let o=1-t;o=W2(T3.minDamping,T3.maxDamping,o),e=W2(T3.minDuration,T3.maxDuration,n4(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=D3(t,o),c=Math.exp(-i);return E3-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=D3(t**2,o);return(-i(t)+E3>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-E3+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=xse(i,a,s);if(e=t4(e),isNaN(c))return{stiffness:T3.stiffness,damping:T3.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var bse=12;function xse(e,t,n){let r=n;for(let n=1;n<bse;n++)r-=e(r)/t(r);return r}function D3(e,t){return e*Math.sqrt(1-t*t)}var Sse=[`duration`,`bounce`],Cse=[`stiffness`,`damping`,`mass`];function O3(e,t){return t.some(t=>e[t]!==void 0)}function wse(e){let t={velocity:T3.velocity,stiffness:T3.stiffness,damping:T3.damping,mass:T3.mass,isResolvedFromDuration:!1,...e};if(!O3(e,Cse)&&O3(e,Sse))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*W2(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:T3.mass,stiffness:i,damping:a}}else{let n=yse({...e,velocity:0});t={...t,...n,mass:T3.mass},t.isResolvedFromDuration=!0}return t}function k3(e=T3.visualDuration,t=T3.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=wse({...n,velocity:-n4(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=n4(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?T3.restSpeed.granular:T3.restSpeed.default,i||=v?T3.restDelta.granular:T3.restDelta.default;let y;if(h<1){let e=D3(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?t4(m):w3(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(S3(b),x3),t=b3(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}k3.applyToOptions=e=>{let t=C3(e,100,k3);return e.ease=t.ease,e.duration=t4(t.duration),e.type=`keyframes`,e};function A3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=k3({keyframes:[f.value,m(f.value)],velocity:w3(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Tse(e,t,n){let r=[],i=n||G2.mix||y3,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Q2(Array.isArray(t)?t[n]||X2:t,a)),r.push(a)}return r}function Ese(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Tse(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=$2(e[r],e[r+1],n);return s[r](i)};return n?t=>l(W2(e[0],e[a-1],t)):l}function j3(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=$2(0,t,r);e.push(f3(n,1,i))}}function M3(e){let t=[0];return j3(t,e.length-1),t}function Dse(e,t){return e.map(e=>e*t)}function Ose(e,t){return e.map(()=>t||x4).splice(0,e.length-1)}function N3({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=S4(r)?r.map(E4):E4(r),a={done:!1,value:t[0]},o=Ese(Dse(n&&n.length===t.length?n:M3(t),e),t,{ease:Array.isArray(i)?i:Ose(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var kse=e=>e!==null;function P3(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(kse),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Ase={decay:A3,inertia:A3,tween:N3,keyframes:N3,spring:k3};function F3(e){typeof e.type==`string`&&(e.type=Ase[e.type])}var I3=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},jse=e=>e/100,L3=class extends I3{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==F4.now()&&this.tick(F4.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},I4.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;F3(e);let{type:t=N3,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||N3;s!==N3&&typeof o[0]!=`number`&&(this.mixKeyframes=Q2(jse,y3(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=S3(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=W2(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==A3&&(b.value=P3(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return n4(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+n4(e)}get time(){return n4(this.currentTime)}set time(e){e=t4(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(F4.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=n4(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=_se,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(F4.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,I4.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Mse(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var R3=e=>e*180/Math.PI,z3=e=>B3(R3(Math.atan2(e[1],e[0]))),Nse={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:z3,rotateZ:z3,skewX:e=>R3(Math.atan(e[1])),skewY:e=>R3(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},B3=e=>(e%=360,e<0&&(e+=360),e),V3=z3,H3=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),U3=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Pse={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:H3,scaleY:U3,scale:e=>(H3(e)+U3(e))/2,rotateX:e=>B3(R3(Math.atan2(e[6],e[5]))),rotateY:e=>B3(R3(Math.atan2(-e[2],e[0]))),rotateZ:V3,rotate:V3,skewX:e=>R3(Math.atan(e[4])),skewY:e=>R3(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function W3(e){return e.includes(`scale`)?1:0}function G3(e,t){if(!e||e===`none`)return W3(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Pse,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Nse,i=t}if(!i)return W3(t);let a=r[t],o=i[1].split(`,`).map(Ise);return typeof a==`function`?a(o):o[a]}var Fse=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return G3(n,t)};function Ise(e){return parseFloat(e.trim())}var K3=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],q3=(()=>new Set(K3))(),J3=e=>e===V4||e===$,Lse=new Set([`x`,`y`,`z`]),Rse=K3.filter(e=>!Lse.has(e));function zse(e){let t=[];return Rse.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var Y3={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>G3(t,`x`),y:(e,{transform:t})=>G3(t,`y`)};Y3.translateX=Y3.x,Y3.translateY=Y3.y;var X3=new Set,Z3=!1,Q3=!1,$3=!1;function e6(){if(Q3){let e=Array.from(X3).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=zse(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Q3=!1,Z3=!1,X3.forEach(e=>e.complete($3)),X3.clear()}function t6(){X3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Q3=!0)})}function Bse(){$3=!0,t6(),e6(),$3=!1}var n6=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(X3.add(this),Z3||(Z3=!0,A4.read(t6),A4.resolveKeyframes(e6))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Mse(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),X3.delete(this)}cancel(){this.state===`scheduled`&&(X3.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Vse=e=>e.startsWith(`--`);function Hse(e,t,n){Vse(t)?e.style.setProperty(t,n):e.style[t]=n}var Use={};function r6(e,t){let n=Y2(e);return()=>Use[t]??n()}var Wse=r6(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),i6=r6(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),a6=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,o6={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:a6([0,.65,.55,1]),circOut:a6([.55,0,1,.45]),backIn:a6([.31,.01,.66,-.59]),backOut:a6([.33,1.53,.69,.99])};function s6(e,t){if(e)return typeof e==`function`?i6()?b3(e,t):`ease-out`:w4(e)?a6(e):Array.isArray(e)?e.map(e=>s6(e,t)||o6.easeOut):o6[e]}function Gse(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=s6(s,i);Array.isArray(d)&&(u.easing=d),O4.value&&I4.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return O4.value&&p.finished.finally(()=>{I4.waapi--}),p}function c6(e){return typeof e==`function`&&`applyToOptions`in e}function Kse({type:e,...t}){return c6(e)&&i6()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var l6=class extends I3{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Kse(e);this.animation=Gse(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=P3(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Hse(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return n4(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+n4(e)}get time(){return n4(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=t4(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Wse()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),X2):r(this)}},u6={anticipate:h4,backInOut:m4,circInOut:v4};function qse(e){return e in u6}function Jse(e){typeof e.ease==`string`&&qse(e.ease)&&(e.ease=u6[e.ease])}var d6=10,Yse=class extends l6{constructor(e){Jse(e),F3(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new L3({...a,autoplay:!1}),s=Math.max(d6,F4.now()-this.startTime),c=W2(0,d6,s-d6);t.setWithVelocity(o.sample(Math.max(0,s-c)).value,o.sample(s).value,c),o.stop()}},f6=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(l3.test(e)||e===`0`)&&!e.startsWith(`url(`));function Xse(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Zse(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=f6(i,t),s=f6(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Xse(e)||(n===`spring`||c6(n))&&r}function p6(e){e.duration=0,e.type=`keyframes`}var Qse=new Set([`opacity`,`clipPath`,`filter`,`transform`]),$se=Y2(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function ece(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return $se()&&n&&Qse.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var tce=40,nce=class extends I3{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=F4.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||n6)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=F4.now(),Zse(e,i,a,o)||((G2.instantAnimations||!s)&&l?.(P3(e,n,t)),e[0]=e[e.length-1],p6(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>tce?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&ece(u),f=u.motionValue?.owner?.current,p=d?new Yse({...u,element:f}):new L3(u);p.finished.then(()=>{this.notifyFinished()}).catch(X2),this.pendingTimeline&&=(this.stopTimeline=p.attachTimeline(this.pendingTimeline),void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Bse()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},rce=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return m6(this.animations,`duration`)}get iterationDuration(){return m6(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function m6(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ice=class extends rce{then(e,t){return this.finished.finally(e).then(()=>{})}};function h6(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var ace=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function oce(e){let t=ace.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function g6(e,t,n=1){`${e}`;let[r,i]=oce(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return K2(e)?parseFloat(e):e}return z4(i)?g6(i,t,n+1):i}var sce={type:`spring`,stiffness:500,damping:25,restSpeed:10},cce=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),lce={type:`keyframes`,duration:.8},uce={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},dce=(e,{keyframes:t})=>t.length>2?lce:q3.has(e)?e.startsWith(`scale`)?cce(t[1]):sce:uce,fce=e=>e!==null;function pce(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(fce),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}function _6(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function v6(e,t){let n=e?.[t]??e?.default??e;return n===e?n:_6(n,e)}function mce({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var y6=(e,t,n,r={},i,a)=>o=>{let s=v6(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=t4(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};mce(s)||Object.assign(u,dce(e,u)),u.duration&&=t4(u.duration),u.repeatDelay&&=t4(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(p6(u),u.delay===0&&(d=!0)),(G2.instantAnimations||G2.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,p6(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=pce(u.keyframes,s);if(e!==void 0){A4.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new L3(u):new nce(u)};function b6(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function x6(e,t,n,r){if(typeof t==`function`){let[i,a]=b6(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=b6(r);t=t(n===void 0?e.custom:n,i,a)}return t}function S6(e,t,n){let r=e.getProps();return x6(r,t,n===void 0?r.custom:n,e)}var C6=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...K3]),w6=30,hce=e=>!isNaN(parseFloat(e)),T6={current:void 0},gce=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=F4.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=F4.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=hce(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new e4);let n=this.events[e].add(t);return e===`change`?()=>{n(),A4.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return T6.current&&T6.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=F4.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>w6)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,w6);return r4(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function E6(e,t){return new gce(e,t)}var D6=e=>Array.isArray(e);function _ce(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,E6(n))}function vce(e){return D6(e)?e[e.length-1]||0:e}function yce(e,t){let{transitionEnd:n={},transition:r={},...i}=S6(e,t)||{};for(let t in i={...i,...n},i)_ce(e,t,vce(i[t]))}var O6=e=>!!(e&&e.getVelocity);function bce(e){return!!(O6(e)&&e.add)}function k6(e,t){let n=e.getValue(`willChange`);if(bce(n))return n.add(t);if(!n&&G2.WillChange){let n=new G2.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function A6(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var j6=`data-`+A6(`framerAppearId`);function M6(e){return e.props[j6]}function xce({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function N6(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?_6(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&xce(d,t))continue;let o={delay:n,...v6(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===c&&!o.velocity)continue;let f=!1;if(window.MotionHandoffAnimation){let n=M6(e);if(n){let e=window.MotionHandoffAnimation(n,t,A4);e!==null&&(o.startTime=e,f=!0)}}k6(e,t);let p=l??e.shouldReduceMotion;r.start(y6(t,r,i,p&&C6.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>A4.update(()=>{o&&yce(e,o)});u.length?Promise.all(u).then(t):t()}return u}function P6(e,t,n={}){let r=S6(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(N6(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Sce(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Sce(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(P6(c,t,{...o,delay:n+(typeof r==`function`?0:r)+h6(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Cce(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>P6(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=P6(e,t,n);else{let i=typeof t==`function`?S6(e,t,n.custom):t;r=Promise.all(N6(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var wce={test:e=>e===`auto`,parse:e=>e},F6=e=>t=>t.test(e),I6=[V4,$,$4,Q4,tse,ese,wce],L6=e=>I6.find(F6(e));function Tce(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||J2(e)}var Ece=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Dce(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(G4)||[];if(!r)return e;let i=n.replace(r,``),a=Ece.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var Oce=/\b([a-z-]*)\(.*?\)/gu,R6={...l3,getAnimatableNone:e=>{let t=e.match(Oce);return t?t.map(Dce).join(` `):e}},z6={...l3,getAnimatableNone:e=>{let t=l3.parse(e);return l3.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},B6={...V4,transform:Math.round},V6={borderWidth:$,borderTopWidth:$,borderRightWidth:$,borderBottomWidth:$,borderLeftWidth:$,borderRadius:$,borderTopLeftRadius:$,borderTopRightRadius:$,borderBottomRightRadius:$,borderBottomLeftRadius:$,width:$,maxWidth:$,height:$,maxHeight:$,top:$,right:$,bottom:$,left:$,inset:$,insetBlock:$,insetBlockStart:$,insetBlockEnd:$,insetInline:$,insetInlineStart:$,insetInlineEnd:$,padding:$,paddingTop:$,paddingRight:$,paddingBottom:$,paddingLeft:$,paddingBlock:$,paddingBlockStart:$,paddingBlockEnd:$,paddingInline:$,paddingInlineStart:$,paddingInlineEnd:$,margin:$,marginTop:$,marginRight:$,marginBottom:$,marginLeft:$,marginBlock:$,marginBlockStart:$,marginBlockEnd:$,marginInline:$,marginInlineStart:$,marginInlineEnd:$,fontSize:$,backgroundPositionX:$,backgroundPositionY:$,rotate:Q4,rotateX:Q4,rotateY:Q4,rotateZ:Q4,scale:U4,scaleX:U4,scaleY:U4,scaleZ:U4,skew:Q4,skewX:Q4,skewY:Q4,distance:$,translateX:$,translateY:$,translateZ:$,x:$,y:$,z:$,perspective:$,transformPerspective:$,opacity:H4,originX:e3,originY:e3,originZ:$,zIndex:B6,fillOpacity:H4,strokeOpacity:H4,numOctaves:B6},kce={...V6,color:n3,backgroundColor:n3,outlineColor:n3,fill:n3,stroke:n3,borderColor:n3,borderTopColor:n3,borderRightColor:n3,borderBottomColor:n3,borderLeftColor:n3,filter:R6,WebkitFilter:R6,mask:z6,WebkitMask:z6},H6=e=>kce[e],Ace=new Set([R6,z6]);function U6(e,t){let n=H6(e);return Ace.has(n)||(n=l3),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var jce=new Set([`auto`,`none`,`0`]);function Mce(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!jce.has(t)&&o3(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=U6(n,i)}var Nce=class extends n6{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),z4(r))){let i=g6(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!C6.has(n)||e.length!==2)return;let[r,i]=e,a=L6(r),o=L6(i);if(B4(r)!==B4(i)&&Y3[n]){this.needsMeasurement=!0;return}if(a!==o)if(J3(a)&&J3(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Y3[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Tce(e[t]))&&n.push(t);n.length&&Mce(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Y3[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Y3[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},Pce=new Set([`opacity`,`clipPath`,`filter`,`transform`]);function W6(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var G6=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function K6(e){return q2(e)&&`offsetHeight`in e}var{schedule:q6,cancel:Fce}=k4(queueMicrotask,!1),J6={x:!1,y:!1};function Y6(){return J6.x||J6.y}function Ice(e){return e===`x`||e===`y`?J6[e]?null:(J6[e]=!0,()=>{J6[e]=!1}):J6.x||J6.y?null:(J6.x=J6.y=!0,()=>{J6.x=J6.y=!1})}function X6(e,t){let n=W6(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Lce(e){return!(e.pointerType===`touch`||Y6())}function Rce(e,t,n={}){let[r,i,a]=X6(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Lce(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Z6=(e,t)=>t?e===t?!0:Z6(e,t.parentElement):!1,Q6=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,zce=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Bce(e){return zce.has(e.tagName)||e.isContentEditable===!0}var Vce=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Hce(e){return Vce.has(e.tagName)||e.isContentEditable===!0}var $6=new WeakSet;function e8(e){return t=>{t.key===`Enter`&&e(t)}}function t8(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Uce=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=e8(()=>{if($6.has(n))return;t8(n,`down`);let e=e8(()=>{t8(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>t8(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function n8(e){return Q6(e)&&!Y6()}var r8=new WeakSet;function Wce(e,t,n={}){let[r,i,a]=X6(e,n),o=e=>{let r=e.currentTarget;if(!n8(e)||r8.has(e))return;$6.add(r),n.stopPropagation&&r8.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),$6.has(r)&&$6.delete(r),n8(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Z6(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),K6(e)&&(e.addEventListener(`focus`,e=>Uce(e,i)),!Bce(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function i8(e){return q2(e)&&`ownerSVGElement`in e}var a8=new WeakMap,o8,s8=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:i8(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Gce=s8(`inline`,`width`,`offsetWidth`),Kce=s8(`block`,`height`,`offsetHeight`);function qce({target:e,borderBoxSize:t}){a8.get(e)?.forEach(n=>{n(e,{get width(){return Gce(e,t)},get height(){return Kce(e,t)}})})}function Jce(e){e.forEach(qce)}function Yce(){typeof ResizeObserver>`u`||(o8=new ResizeObserver(Jce))}function Xce(e,t){o8||Yce();let n=W6(e);return n.forEach(e=>{let n=a8.get(e);n||(n=new Set,a8.set(e,n)),n.add(t),o8?.observe(e)}),()=>{n.forEach(e=>{let n=a8.get(e);n?.delete(t),n?.size||o8?.unobserve(e)})}}var c8=new Set,l8;function Zce(){l8=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};c8.forEach(t=>t(e))},window.addEventListener(`resize`,l8)}function Qce(e){return c8.add(e),l8||Zce(),()=>{c8.delete(e),!c8.size&&typeof l8==`function`&&(window.removeEventListener(`resize`,l8),l8=void 0)}}function u8(e,t){return typeof e==`function`?Qce(e):Xce(e,t)}function d8(e){return i8(e)&&e.tagName===`svg`}var $ce=[...I6,n3,l3],ele=e=>$ce.find(F6(e)),f8=()=>({translate:0,scale:1,origin:0,originPoint:0}),p8=()=>({x:f8(),y:f8()}),m8=()=>({min:0,max:0}),h8=()=>({x:m8(),y:m8()}),g8=new WeakMap;function _8(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function v8(e){return typeof e==`string`||Array.isArray(e)}var y8=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],b8=[`initial`,...y8];function x8(e){return _8(e.animate)||b8.some(t=>v8(e[t]))}function S8(e){return!!(x8(e)||e.variants)}function tle(e,t,n){for(let r in t){let i=t[r],a=n[r];if(O6(i))e.addValue(r,i);else if(O6(a))e.addValue(r,E6(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,E6(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var C8={current:null},w8={current:!1},nle=typeof window<`u`;function rle(){if(w8.current=!0,nle)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>C8.current=e.matches;e.addEventListener(`change`,t),t()}else C8.current=!1}var T8=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],E8={};function D8(e){E8=e}function ile(){return E8}var O8=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=n6,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=F4.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,A4.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=x8(t),this.isVariantNode=S8(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&O6(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,g8.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(w8.current||rle(),this.shouldReduceMotion=C8.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let e in this.projection&&this.projection.unmount(),j4(this.notifyUpdate),j4(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Pce.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new l6({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:t4(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=q3.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&A4.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in E8){let t=E8[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):h8()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<T8.length;t++){let n=T8[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=tle(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=E6(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(K2(n)||J2(n))?n=parseFloat(n):!ele(n)&&l3.test(t)&&(n=U6(e,t)),this.setBaseTarget(e,O6(n)?n.get():n)),O6(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=x6(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!O6(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new e4),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){q6.render(this.render)}},k8=class extends O8{constructor(){super(...arguments),this.KeyframeResolver=Nce}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;O6(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},A8=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function j8({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ale({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ole(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function M8(e){return e===void 0||e===1}function N8({scale:e,scaleX:t,scaleY:n}){return!M8(e)||!M8(t)||!M8(n)}function P8(e){return N8(e)||F8(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function F8(e){return I8(e.x)||I8(e.y)}function I8(e){return e&&e!==`0%`}function L8(e,t,n){return n+t*(e-n)}function R8(e,t,n,r,i){return i!==void 0&&(e=L8(e,i,r)),L8(e,n,r)+t}function z8(e,t=0,n=1,r,i){e.min=R8(e.min,t,n,r,i),e.max=R8(e.max,t,n,r,i)}function B8(e,{x:t,y:n}){z8(e.x,t.translate,t.scale,t.originPoint),z8(e.y,n.translate,n.scale,n.originPoint)}var V8=.999999999999,H8=1.0000000000001;function sle(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&K8(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,B8(e,o)),r&&P8(a.latestValues)&&K8(e,a.latestValues))}t.x<H8&&t.x>V8&&(t.x=1),t.y<H8&&t.y>V8&&(t.y=1)}function U8(e,t){e.min+=t,e.max+=t}function W8(e,t,n,r,i=.5){z8(e,t,n,f3(e.min,e.max,i),r)}function G8(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function K8(e,t){W8(e.x,G8(t.x,e.x),t.scaleX,t.scale,t.originX),W8(e.y,G8(t.y,e.y),t.scaleY,t.scale,t.originY)}function q8(e,t){return j8(ole(e.getBoundingClientRect(),t))}function cle(e,t,n){let r=q8(e,n),{scroll:i}=t;return i&&(U8(r.x,i.offset.x),U8(r.y,i.offset.y)),r}var lle={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ule=K3.length;function dle(e,t,n){let r=``,i=!0;for(let a=0;a<ule;a++){let o=K3[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===(o.startsWith(`scale`)?1:0);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=G6(s,V6[o]);if(!c){i=!1;let t=lle[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function J8(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(q3.has(e)){o=!0;continue}else if(R4(e)){i[e]=n;continue}else{let t=G6(n,V6[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=dle(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Y8(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function X8(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Z8={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if($.test(e))e=parseFloat(e);else return e;return`${X8(e,t.target.x)}% ${X8(e,t.target.y)}%`}},fle={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=l3.parse(e);if(i.length>5)return r;let a=l3.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=f3(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Q8={borderRadius:{...Z8,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Z8,borderTopRightRadius:Z8,borderBottomLeftRadius:Z8,borderBottomRightRadius:Z8,boxShadow:fle};function $8(e,{layout:t,layoutId:n}){return q3.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Q8[e]||e===`opacity`)}function e5(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(O6(r[t])||i&&O6(i[t])||$8(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function ple(e){return window.getComputedStyle(e)}var t5=class extends k8{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Y8}readValueFromInstance(e,t){if(q3.has(t))return this.projection?.isProjecting?W3(t):Fse(e,t);{let n=ple(e),r=(R4(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return q8(e,t)}build(e,t,n){J8(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return e5(e,t,n)}};function mle(e,t){return e in t}var hle=class extends O8{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(mle(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return h8()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},gle={offset:`stroke-dashoffset`,array:`stroke-dasharray`},_le={offset:`strokeDashoffset`,array:`strokeDasharray`};function vle(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?gle:_le;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var yle=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function n5(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(J8(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of yle)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&vle(d,i,a,o,!1)}var r5=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),i5=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ble(e,t,n,r){for(let n in Y8(e,t,void 0,r),t.attrs)e.setAttribute(r5.has(n)?n:A6(n),t.attrs[n])}function a5(e,t,n){let r=e5(e,t,n);for(let n in e)if(O6(e[n])||O6(t[n])){let t=K3.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var o5=class extends k8{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=h8}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(q3.has(t)){let e=H6(t);return e&&e.default||0}return t=r5.has(t)?t:A6(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return a5(e,t,n)}build(e,t,n){n5(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ble(e,t,n,r)}mount(e){this.isSVGTag=i5(e.tagName),super.mount(e)}},xle=b8.length;function s5(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&s5(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<xle;n++){let r=b8[n],i=e.props[r];(v8(i)||i===!1)&&(t[r]=i)}return t}function c5(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Sle=[...y8].reverse(),Cle=y8.length;function wle(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Cce(e,t,n)))}function Tle(e){let t=wle(e),n=u5(),r=!0,i=!1,a=t=>(n,r)=>{let i=S6(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=s5(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Cle;t++){let p=Sle[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=v8(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||_8(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Ele(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},ee=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=D6(t)&&D6(n)?!c5(t,n):t!==n,r?t==null?u.add(e):ee(e):t!==void 0&&u.has(e)?ee(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let E=v&&y;b&&(!E||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=S6(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=h6(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=S6(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=u5(),i=!0}}}function Ele(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!c5(t,e):!1}function l5(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function u5(){return{animate:l5(!0),whileInView:l5(),whileHover:l5(),whileTap:l5(),whileDrag:l5(),whileFocus:l5(),exit:l5()}}function d5(e,t){e.min=t.min,e.max=t.max}function f5(e,t){d5(e.x,t.x),d5(e.y,t.y)}function p5(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var m5=1e-4,Dle=1-m5,Ole=1+m5,h5=.01,kle=0-h5,Ale=0+h5;function g5(e){return e.max-e.min}function jle(e,t,n){return Math.abs(e-t)<=n}function _5(e,t,n,r=.5){e.origin=r,e.originPoint=f3(t.min,t.max,e.origin),e.scale=g5(n)/g5(t),e.translate=f3(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Dle&&e.scale<=Ole||isNaN(e.scale))&&(e.scale=1),(e.translate>=kle&&e.translate<=Ale||isNaN(e.translate))&&(e.translate=0)}function v5(e,t,n,r){_5(e.x,t.x,n.x,r?r.originX:void 0),_5(e.y,t.y,n.y,r?r.originY:void 0)}function y5(e,t,n){e.min=n.min+t.min,e.max=e.min+g5(t)}function Mle(e,t,n){y5(e.x,t.x,n.x),y5(e.y,t.y,n.y)}function b5(e,t,n){e.min=t.min-n.min,e.max=e.min+g5(t)}function x5(e,t,n){b5(e.x,t.x,n.x),b5(e.y,t.y,n.y)}function S5(e,t,n,r,i){return e-=t,e=L8(e,1/n,r),i!==void 0&&(e=L8(e,1/i,r)),e}function Nle(e,t=0,n=1,r=.5,i,a=e,o=e){if($4.test(t)&&(t=parseFloat(t),t=f3(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=f3(a.min,a.max,r);e===a&&(s-=t),e.min=S5(e.min,t,n,s,i),e.max=S5(e.max,t,n,s,i)}function C5(e,t,[n,r,i],a,o){Nle(e,t[n],t[r],t[i],t.scale,a,o)}var Ple=[`x`,`scaleX`,`originX`],Fle=[`y`,`scaleY`,`originY`];function w5(e,t,n,r){C5(e.x,t,Ple,n?n.x:void 0,r?r.x:void 0),C5(e.y,t,Fle,n?n.y:void 0,r?r.y:void 0)}function T5(e){return e.translate===0&&e.scale===1}function E5(e){return T5(e.x)&&T5(e.y)}function D5(e,t){return e.min===t.min&&e.max===t.max}function Ile(e,t){return D5(e.x,t.x)&&D5(e.y,t.y)}function O5(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function k5(e,t){return O5(e.x,t.x)&&O5(e.y,t.y)}function A5(e){return g5(e.x)/g5(e.y)}function j5(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function M5(e){return[e(`x`),e(`y`)]}function Lle(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var N5=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],Rle=N5.length,P5=e=>typeof e==`string`?parseFloat(e):e,F5=e=>typeof e==`number`||$.test(e);function zle(e,t,n,r,i,a){i?(e.opacity=f3(0,n.opacity??1,Ble(r)),e.opacityExit=f3(t.opacity??1,0,Vle(r))):a&&(e.opacity=f3(t.opacity??1,n.opacity??1,r));for(let i=0;i<Rle;i++){let a=`border${N5[i]}Radius`,o=I5(t,a),s=I5(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||F5(o)===F5(s)?(e[a]=Math.max(f3(P5(o),P5(s),r),0),($4.test(s)||$4.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=f3(t.rotate||0,n.rotate||0,r))}function I5(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Ble=L5(0,.5,_4),Vle=L5(.5,.95,X2);function L5(e,t,n){return r=>r<e?0:r>t?1:n($2(e,t,r))}function R5(e,t,n){let r=O6(e)?e:E6(e);return r.start(y6(``,r,t,n)),r.animation}function z5(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var Hle=(e,t)=>e.depth-t.depth,Ule=class{constructor(){this.children=[],this.isDirty=!1}add(e){H2(this.children,e),this.isDirty=!0}remove(e){U2(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Hle),this.isDirty=!1,this.children.forEach(e)}};function Wle(e,t){let n=F4.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(j4(r),e(a-t))};return A4.setup(r,!0),()=>j4(r)}function B5(e){return O6(e)?e.get():e}var Gle=class{constructor(){this.members=[]}add(e){H2(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(U2(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(U2(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},V5={hasAnimatedSinceResize:!0,hasEverUpdated:!1},H5={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},U5=[``,`X`,`Y`,`Z`],Kle=1e3,qle=0;function W5(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function G5(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=M6(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,A4,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&G5(r)}function K5({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=qle++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,O4.value&&(H5.nodes=H5.calculatedTargetDeltas=H5.calculatedProjections=0),this.nodes.forEach(Xle),this.nodes.forEach(eue),this.nodes.forEach(tue),this.nodes.forEach(Zle),O4.addProjectionMetrics&&O4.addProjectionMetrics(H5)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ule)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new e4),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=i8(t)&&!d8(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;A4.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Wle(i,250),V5.hasAnimatedSinceResize&&(V5.hasAnimatedSinceResize=!1,this.nodes.forEach(Y5)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||oue,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!k5(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...v6(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||Y5(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),j4(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nue),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&G5(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(q5);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(J5);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach($le),this.nodes.forEach(Jle),this.nodes.forEach(Yle)):this.nodes.forEach(J5),this.clearAllSnapshots();let e=F4.now();M4.delta=W2(0,1e3/60,e-M4.timestamp),M4.timestamp=e,M4.isProcessing=!0,N4.update.process(M4),N4.preRender.process(M4),N4.render.process(M4),M4.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,q6.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Qle),this.sharedNodes.forEach(rue)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,A4.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){A4.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!g5(this.snapshot.measuredBox.x)&&!g5(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=h8(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!E5(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||P8(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),sue(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return h8();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(cue))){let{scroll:e}=this.root;e&&(U8(t.x,e.offset.x),U8(t.y,e.offset.y))}return t}removeElementScroll(e){let t=h8();if(f5(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&f5(t,e),U8(t.x,i.offset.x),U8(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=h8();f5(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&K8(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),P8(r.latestValues)&&K8(n,r.latestValues)}return P8(this.latestValues)&&K8(n,this.latestValues),n}removeTransform(e){let t=h8();f5(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!P8(n.latestValues))continue;N8(n.latestValues)&&n.updateSnapshot();let r=h8();f5(r,n.measurePageBox()),w5(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return P8(this.latestValues)&&w5(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==M4.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=M4.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=h8(),this.targetWithTransforms=h8()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Mle(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):f5(this.target,this.layout.layoutBox),B8(this.target,this.targetDelta)):f5(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),O4.value&&H5.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||N8(this.parent.latestValues)||F8(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=h8(),this.relativeTargetOrigin=h8(),x5(this.relativeTargetOrigin,t,n),f5(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===M4.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;f5(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;sle(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=h8());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(p5(this.prevProjectionDelta.x,this.projectionDelta.x),p5(this.prevProjectionDelta.y,this.projectionDelta.y)),v5(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!j5(this.projectionDelta.x,this.prevProjectionDelta.x)||!j5(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),O4.value&&H5.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=p8(),this.projectionDelta=p8(),this.projectionDeltaWithTransform=p8()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=p8();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=h8(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(aue));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;X5(a.x,e.x,n),X5(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(x5(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),iue(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Ile(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=h8(),f5(d,this.relativeTarget)),s&&(this.animationValues=i,zle(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(j4(this.pendingAnimation),void 0),this.pendingAnimation=A4.update(()=>{V5.hasAnimatedSinceResize=!0,I4.layout++,this.motionValue||=E6(0),this.motionValue.jump(0,!1),this.currentAnimation=R5(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{I4.layout--},onComplete:()=>{I4.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Kle),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&t7(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||h8();let t=g5(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=g5(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}f5(t,n),K8(t,i),v5(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Gle),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&W5(`z`,e,r,this.animationValues);for(let t=0;t<U5.length;t++)W5(`rotate${U5[t]}`,e,r,this.animationValues),W5(`skew${U5[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=B5(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=B5(t?.pointerEvents)||``),this.hasProjected&&!P8(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Lle(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,Q8){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Q8[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?B5(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(q5),this.root.sharedNodes.clear()}}}function Jle(e){e.updateLayout()}function Yle(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?M5(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=g5(r);r.min=n[e].min,r.max=r.min+i}):t7(i,t.layoutBox,n)&&M5(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=g5(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=p8();v5(o,n,t.layoutBox);let s=p8();a?v5(s,e.applyTransform(r,!0),t.measuredBox):v5(s,n,t.layoutBox);let c=!E5(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=h8();x5(o,t.layoutBox,i.layoutBox);let s=h8();x5(s,n,a.layoutBox),k5(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Xle(e){O4.value&&H5.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Zle(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Qle(e){e.clearSnapshot()}function q5(e){e.clearMeasurements()}function J5(e){e.isLayoutDirty=!1}function $le(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Y5(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function eue(e){e.resolveTargetDelta()}function tue(e){e.calcProjection()}function nue(e){e.resetSkewAndRotation()}function rue(e){e.removeLeadSnapshot()}function X5(e,t,n){e.translate=f3(t.translate,0,n),e.scale=f3(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Z5(e,t,n,r){e.min=f3(t.min,n.min,r),e.max=f3(t.max,n.max,r)}function iue(e,t,n,r){Z5(e.x,t.x,n.x,r),Z5(e.y,t.y,n.y,r)}function aue(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var oue={duration:.45,ease:[.4,0,.1,1]},Q5=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),$5=Q5(`applewebkit/`)&&!Q5(`chrome/`)?Math.round:X2;function e7(e){e.min=$5(e.min),e.max=$5(e.max)}function sue(e){e7(e.x),e7(e.y)}function t7(e,t,n){return e===`position`||e===`preserve-aspect`&&!jle(A5(t),A5(n),.2)}function cue(e){return e!==e.root&&e.scroll?.wasRoot}var lue=K5({attachResizeListener:(e,t)=>z5(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),n7={current:void 0},r7=K5({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!n7.current){let e=new lue({});e.mount(window),e.setOptions({layoutScroll:!0}),n7.current=e}return n7.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`});function i7(e){return typeof e==`object`&&!Array.isArray(e)}function a7(e,t,n,r){return e==null?[]:typeof e==`string`&&i7(t)?W6(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function uue(e,t,n){return e*(t+1)}function o7(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function due(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(U2(e,i),r--)}}function fue(e,t,n,r,i,a){due(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:f3(i,a,r[o]),easing:C4(n,o)})}function pue(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function mue(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var hue=`easeInOut`;function gue(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,o7(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=o7(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=_ue(e),{delay:l=0,times:u=M3(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=c6(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&bue(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=t4(b));let r=C3(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&j3(u,T),c.length===1&&c.unshift(null),m){b=uue(b,m);let e=[...c],t=[...u];y=Array.isArray(y)?[...y]:[y];let n=[...y];for(let r=0;r<m;r++){c.push(...e);for(let i=0;i<e.length;i++)u.push(t[i]+(r+1)),y.push(i===0?`linear`:C4(n,i-1))}pue(u,m)}let ee=w+b;fue(r,c,y,u,w,ee),g=Math.max(x+b,g),f=Math.max(ee,f)};if(O6(p)){let e=s7(p,s);_(m,h,c7(`default`,e))}else{let e=a7(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=s7(r,s);for(let e in m)_(m[e],vue(h,e),c7(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(mue);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push($2(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(hue)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function s7(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function c7(e,t){return t[e]||(t[e]=[]),t[e]}function _ue(e){return Array.isArray(e)?e:[e]}function vue(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var yue=e=>typeof e==`number`,bue=e=>e.every(yue);function xue(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=i8(e)&&!d8(e)?new o5(t):new t5(t);n.mount(e),g8.set(e,n)}function Sue(e){let t=new hle({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),g8.set(e,t)}function Cue(e,t){return O6(e)||typeof e==`number`||typeof e==`string`&&!i7(t)}function l7(e,t,n,r){let i=[];if(Cue(e,t))i.push(R5(e,i7(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=a7(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?xue:Sue;g8.has(r)||s(r);let c=g8.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...N6(c,{...t,transition:l},{}))}}return i}function wue(e,t,n){let r=[];return gue(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=E6(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:k3}).forEach(({keyframes:e,transition:t},n)=>{r.push(...l7(n,e,t))}),r}function Tue(e){return Array.isArray(e)&&e.some(Array.isArray)}function Eue(e={}){let{scope:t,reduceMotion:n}=e;function r(e,r,i){let a=[],o;if(Tue(e)){let{onComplete:i,...s}=r||{};typeof i==`function`&&(o=i),a=wue(e,n===void 0?s:{reduceMotion:n,...s},t)}else{let{onComplete:s,...c}=i||{};typeof s==`function`&&(o=s),a=l7(e,r,n===void 0?c:{reduceMotion:n,...c},t)}let s=new ice(a);return o&&s.finished.then(o),t&&(t.animations.push(s),s.finished.then(()=>{U2(t.animations,s)})),s}return r}var u7=Eue(),d7=(e,t)=>Math.abs(e-t);function Due(e,t){let n=d7(e.x,t.x),r=d7(e.y,t.y);return Math.sqrt(n**2+r**2)}var f7={type:`spring`,visualDuration:.35,bounce:0};function Oue({text:e,className:t}){let n=(0,O.useRef)(null),r=(0,O.useRef)(null),i=(0,O.useRef)(void 0);return(0,O.useEffect)(()=>{let t=i.current;if(i.current=e,t===e)return;let a=n.current,o=r.current;t!==void 0&&(o&&t&&(o.textContent=t,o.style.position=`absolute`,o.style.inset=`0`,o.style.opacity=`1`,u7(o,{opacity:[1,0],filter:[`blur(0px)`,`blur(2px)`],transform:[`translateY(0)`,`translateY(2px)`]},f7).finished.then(()=>{o.style.opacity=`0`,o.style.filter=``,o.style.transform=``,o.style.position=``,o.style.inset=``,o.textContent=``})),a&&e&&u7(a,{opacity:[0,1],filter:[`blur(2px)`,`blur(0px)`],transform:[`translateY(-2px)`,`translateY(0)`]},f7))}),e?(0,k.jsxs)(`span`,{className:EY(`relative inline-block overflow-hidden`,t),children:[(0,k.jsx)(`span`,{ref:n,children:e}),(0,k.jsx)(`span`,{ref:r,className:`pointer-events-none`,"aria-hidden":!0})]}):null}function kue(e){switch(e.phase){case`thinking`:return`thinking…`;case`tool_execution`:{let t=e.activeTools[e.activeTools.length-1];return t?({read:`reading`,edit:`editing`,write:`writing`,bash:`running command`,grep:`searching`,find:`finding files`,ls:`listing`}[t.toolName]??t.toolName)+`…`:`executing…`}case`compacting`:return`compacting…`;case`retrying`:return`retrying…`;default:return null}}function Aue(){let{state:{focusedIssueId:e},actions:t}=Bq(),n=Iq(),r=[...n?.running??[]].sort((e,t)=>{let n=e.session.lastEventAt?Number(UL(e.session.lastEventAt)):0;return(t.session.lastEventAt?Number(UL(t.session.lastEventAt)):0)-n}),i=n?.retrying??[];return r.length===0&&i.length===0?(0,k.jsx)(`div`,{className:`work-rail`,children:(0,k.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,k.jsx)(`p`,{className:`type-meta`,children:`no active work`})})}):(0,k.jsx)(`div`,{className:`work-rail`,children:(0,k.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-y-auto`,children:[r.map(n=>(0,k.jsx)(jue,{entry:n,isSelected:n.issueId===e,onClick:t.focusIssue},n.issueId)),i.length>0&&(0,k.jsxs)(`div`,{className:`border-t border-border px-3 py-2`,children:[(0,k.jsx)(`p`,{className:`type-meta mb-1`,children:`retrying`}),i.map(n=>(0,k.jsx)(Mue,{entry:n,isSelected:n.issueId===e,onClick:t.focusIssue},n.issueId))]})]})})}function jue({entry:e,isSelected:t,onClick:n}){let{session:r}=e,i=z2(e.state),a=kue(r),o=(0,O.useCallback)(()=>{n(e.issueId)},[n,e.issueId]);return(0,k.jsxs)(`button`,{type:`button`,className:EY(`row-shell px-3 py-2`,i&&`border-l-2 border-l-emerald-400`,t&&`bg-accent/60`),onClick:o,children:[(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`cluster-shell`,children:[(0,k.jsx)(`span`,{className:`type-title truncate`,children:e.issueIdentifier}),(0,k.jsx)(V2,{variant:L2(e.state),size:`sm`,children:F2(e.state)})]}),(0,k.jsx)(Oue,{text:a,className:`type-meta truncate`})]}),(0,k.jsxs)(`div`,{className:`type-meta shrink-0 text-right`,children:[(0,k.jsxs)(`span`,{children:[`t`,r.turnCount,` · `,M2(r.totalTokens)]}),(0,k.jsx)(`br`,{}),(0,k.jsx)(`span`,{children:r.lastEventAt?N2(r.lastEventAt):`idle`})]})]})}function Mue({entry:e,isSelected:t,onClick:n}){let r=(0,O.useCallback)(()=>{n(e.issueId)},[n,e.issueId]);return(0,k.jsxs)(`button`,{type:`button`,className:EY(`row-shell px-3 py-2 opacity-60`,t&&`bg-accent/60`),onClick:r,children:[(0,k.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,k.jsxs)(`div`,{className:`cluster-shell`,children:[(0,k.jsx)(`span`,{className:`type-title truncate`,children:e.identifier}),(0,k.jsxs)(V2,{variant:`outline`,size:`sm`,children:[`attempt `,e.attempt]})]})}),(0,k.jsx)(`div`,{className:`type-meta shrink-0`,children:N2(e.dueAt)})]})}var p7=e=>Number(UL(e)),m7=2e3;function Nue(e){let[t,n]=(0,O.useState)([]),[r,i]=(0,O.useState)(!1),a=(0,O.useRef)(null),o=(0,O.useRef)(0),s=(0,O.useCallback)(async e=>{i(!0);try{let t=await Nq.getEventLog(e);a.current=t.issueId;let r=t.events;o.current=r.length>0?p7(r[r.length-1].timestamp):0,n(r)}catch{n([])}finally{i(!1)}},[]);return(0,O.useEffect)(()=>{if(!e){n([]),a.current=null,o.current=0;return}s(e)},[e,s]),(0,O.useEffect)(()=>{if(e)return Nq.onEvent(e=>{a.current&&e.issueId===a.current&&p7(e.timestamp)>o.current&&(o.current=p7(e.timestamp),n(t=>{if(e.event===`notification`&&t.length>0&&t[t.length-1].event===`notification`){let n=t[t.length-1],r={...n,timestamp:e.timestamp,message:(n.message??``)+(e.message??``)};return[...t.slice(0,-1),r]}let n=[...t,e];return n.length>m7?n.slice(-m7):n}))})},[e]),{events:t,isLoading:r}}var h7=(0,O.createContext)(null);function g7(){let e=(0,O.use)(h7);if(!e)throw Error(`TraceViewer compound components must be used within TraceViewer.Root`);return e}function Pue(e,t){let n=t.toLowerCase();return!!(e.event.toLowerCase().includes(n)||e.message?.toLowerCase().includes(n)||e.toolName?.toLowerCase().includes(n))}function Fue({events:e,issueId:t,issueIdentifier:n,isLoading:r,children:i}){let[a,o]=(0,O.useState)(``),[s,c]=(0,O.useState)(new Set),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(!0),[p,m]=(0,O.useState)(`grouped`),h=(0,O.useCallback)(e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),g=(0,O.useCallback)(()=>{c(new Set)},[]),_=(0,O.useCallback)(()=>{f(e=>!e)},[]),v=(0,O.useCallback)(()=>{m(e=>e===`grouped`?`raw`:`grouped`)},[]);return(0,k.jsx)(h7,{value:(0,O.useMemo)(()=>({state:{events:e,selectedEvent:l,query:a,typeFilter:s,isFollowingTail:d,viewMode:p},actions:{setQuery:o,toggleTypeFilter:h,clearTypeFilter:g,selectEvent:u,toggleFollowTail:_,toggleViewMode:v},meta:{issueId:t,issueIdentifier:n,isLoading:r,total:e.length}}),[e,l,a,s,d,p,t,n,r,h,g,_,v]),children:i})}let _7=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});const Iue={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Lue={valid(e){return e===null?null:e?{[_7.valid]:``}:{[_7.invalid]:``}}},Rue=O.createContext({invalid:void 0,name:void 0,validityData:{state:Iue,errors:[],error:``,value:``,initialValue:null},setValidityData:rX,disabled:void 0,touched:!1,setTouched:rX,dirty:!1,setDirty:rX,filled:!1,setFilled:rX,focused:!1,setFocused:rX,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=iX)=>e,getInputValidationProps:(e=iX)=>e,inputRef:{current:null},commit:async()=>{}}});function v7(e=!0){let t=O.useContext(Rue);if(t.setValidityData===rX&&!e)throw Error(HY(28));return t}const zue=O.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:rX,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function Bue(){return O.useContext(zue)}const Vue=O.createContext({controlId:void 0,registerControlId:rX,labelId:void 0,setLabelId:rX,messageIds:[],setMessageIds:rX,getDescriptionProps:e=>e});function y7(){return O.useContext(Vue)}function Hue(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function b7({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=O.useRef(e!==void 0),[a,o]=O.useState(t);return[i?e:a,O.useCallback(e=>{i||o(e)},[])]}function Uue(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=y7(),o=P0(t),s=n?i:void 0,c=WY(()=>Symbol(`labelable-control`)),l=O.useRef(!1),u=O.useRef(t!=null),d=lZ(()=>{!l.current||a===rX||(l.current=!1,a(c.current,void 0))});return EX(()=>{if(a===rX)return;let e;if(n){let n=r?.current;e=zX(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),O.useEffect(()=>d,[d]),i??o}var Wue=u(_());function Gue(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=Bue(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=v7(),f=lZ(e.getValue);EX(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),EX(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:Hue(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?Wue.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),EX(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}const Kue=O.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,...d}=e,{state:f,name:p,disabled:m,setTouched:h,setDirty:g,validityData:_,setFocused:v,setFilled:y,validationMode:b,validation:x}=v7(),S=m||s,C=p??a,w={...f,disabled:S},{labelId:T}=y7(),ee=Uue({id:i});EX(()=>{let e=o!=null;x.inputRef.current?.value||e&&o!==``?y(!0):e&&o===``&&y(!1)},[x.inputRef,y,o]);let E=O.useRef(null);EX(()=>{u&&E.current===wZ(fZ(E.current))&&v(!0)},[u,v]);let[te]=b7({controlled:o,default:l,name:`FieldControl`,state:`value`}),ne=o!==void 0,re=ne?te:void 0;return Gue({id:ee,name:C,commit:x.commit,value:re,getValue:()=>x.inputRef.current?.value,controlRef:x.inputRef}),sX(`input`,e,{ref:[t,E],state:w,props:[{id:ee,disabled:S,name:C,ref:x.inputRef,"aria-labelledby":T,autoFocus:u,...ne?{value:re}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,CQ(bQ,e.nativeEvent)),g(t!==_.initialValue),y(t!==``)},onFocus(){v(!0)},onBlur(e){h(!0),v(!1),b===`onBlur`&&x.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(h(!0),x.commit(e.currentTarget.value))}},x.getInputValidationProps(),d],stateAttributesMapping:Lue})}),que=O.forwardRef(function(e,t){return(0,k.jsx)(Kue,{ref:t,...e})});function Jue({className:e,size:t=`default`,unstyled:n=!1,nativeInput:r=!1,...i}){let a=EY(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,i.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,i.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`);return(0,k.jsx)(`span`,{className:EY(!n&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:r?(0,k.jsx)(`input`,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,...i}):(0,k.jsx)(que,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,...i})})}function Yue(){let{state:e,actions:t,meta:n}=g7(),r=(0,O.useCallback)(e=>t.setQuery(e.target.value),[t]);return(0,k.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2`,children:[(0,k.jsx)(Jue,{placeholder:`search…`,value:e.query,onChange:r,className:`h-7 flex-1 text-xs`,nativeInput:!0}),(0,k.jsx)(`button`,{type:`button`,className:`type-meta hover:text-foreground`,onClick:t.toggleViewMode,"aria-label":`switch to ${e.viewMode===`grouped`?`raw`:`grouped`} view`,children:e.viewMode===`grouped`?`raw`:`grouped`}),(0,k.jsxs)(`span`,{className:`type-meta flex shrink-0 items-center gap-2`,children:[n.isLoading?(0,k.jsxs)(`span`,{className:`relative flex size-2`,children:[(0,k.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-emerald-400/40`}),(0,k.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-emerald-400`})]}):(0,k.jsx)(`span`,{className:EY(`inline-flex size-2 rounded-full`,n.total>0?`bg-emerald-400`:`bg-zinc-400`)}),n.total]})]})}function Xue(e){let t=new Date(Number(UL(e)));return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}var Zue={agent_start:`border-l-zinc-500`,agent_end:`border-l-zinc-500`,turn_start:`border-l-sky-400`,turn_end:`border-l-sky-400`,message_start:`border-l-violet-400`,message_update:`border-l-violet-400`,message_end:`border-l-violet-400`,tool_execution_start:`border-l-emerald-400`,tool_execution_update:`border-l-emerald-400`,tool_execution_end:`border-l-emerald-400`,auto_compaction_start:`border-l-amber-400`,auto_compaction_end:`border-l-amber-400`,auto_retry_start:`border-l-red-400`,auto_retry_end:`border-l-red-400`,notification:`border-l-zinc-600`},Que={agent_start:`agent▸`,agent_end:`agent◂`,turn_start:`turn▸`,turn_end:`turn◂`,message_start:`msg▸`,message_update:`msg`,message_end:`msg◂`,tool_execution_start:`tool▸`,tool_execution_update:`tool`,tool_execution_end:`tool◂`,auto_compaction_start:`compact▸`,auto_compaction_end:`compact◂`,auto_retry_start:`retry▸`,auto_retry_end:`retry◂`,notification:`··`};function $ue(e){return Que[e]??e}function ede(e){return Zue[e]??`border-l-zinc-500`}function tde(e){return e.toolName?e.toolName:e.message?e.message.length>120?e.message.slice(0,120)+`…`:e.message:``}function x7({event:e}){let{state:t,actions:n}=g7(),r=t.selectedEvent===e,i=(0,O.useCallback)(()=>{n.selectEvent(r?null:e)},[n,e,r]);if(e.event===`message_start`&&!e.message&&!e.toolName)return null;let a=tde(e),o=e.event===`turn_end`&&e.usage?` ${e.usage.totalTokens.toLocaleString()} tok`:``;return(0,k.jsxs)(`button`,{type:`button`,className:EY(`trace-row`,ede(e.event),r&&`trace-row-selected`,e.isError&&`trace-row-error`),onClick:i,children:[(0,k.jsx)(`span`,{className:`type-meta shrink-0 tabular-nums`,children:Xue(e.timestamp)}),(0,k.jsx)(`span`,{className:`w-[72px] shrink-0 truncate text-muted-foreground`,children:$ue(e.event)}),a&&(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-foreground`,children:a}),o&&(0,k.jsx)(`span`,{className:`type-meta shrink-0`,children:o})]})}function S7(e){return Number(UL(e))}function nde(e,t){return{kind:`turn`,turnIndex:e,startedAt:t,toolCalls:[],notifications:[],events:[],isActive:!0}}function C7(e,t,n){return{toolName:e,toolCallId:t,startedAt:n,isActive:!0,events:[]}}function w7(e,t){if(t)return e.toolCalls.find(e=>e.toolCallId===t&&e.isActive);for(let t=e.toolCalls.length-1;t>=0;t--){let n=e.toolCalls[t];if(n&&n.isActive)return n}}function rde(e){let t=[],n=[],r=null,i=0,a=-1,o=0;for(let s of e){let e=o++;switch(s.event){case`turn_start`:i++,r=nde(i,s.timestamp),r.events.push(s),t.push(r);break;case`turn_end`:if(r){r.events.push(s),r.endedAt=s.timestamp,r.durationMs=S7(s.timestamp)-S7(r.startedAt),r.isActive=!1,s.usage&&(r.tokenUsage={inputTokens:s.usage.inputTokens,outputTokens:s.usage.outputTokens,totalTokens:s.usage.totalTokens});for(let e of r.toolCalls)e.isActive&&(e.isActive=!1,e.endedAt=s.timestamp,e.durationMs=S7(s.timestamp)-S7(e.startedAt));a=e,r=null}break;case`tool_execution_start`:if(r){let e=C7(s.toolName??`unknown`,s.toolCallId,s.timestamp);e.events.push(s),r.toolCalls.push(e),r.events.push(s)}break;case`tool_execution_update`:if(r){let e=w7(r,s.toolCallId);e&&(e.events.push(s),s.message&&(e.summary=s.message)),r.events.push(s)}break;case`tool_execution_end`:if(r){let e=w7(r,s.toolCallId);e&&(e.events.push(s),e.endedAt=s.timestamp,e.durationMs=S7(s.timestamp)-S7(e.startedAt),e.isActive=!1,e.isError=s.isError,s.message&&(e.summary=s.message)),r.events.push(s)}break;case`auto_compaction_start`:case`auto_retry_start`:if(r){let e=C7(s.event===`auto_compaction_start`?`compaction`:`retry`,void 0,s.timestamp);e.events.push(s),r.toolCalls.push(e),r.events.push(s)}break;case`auto_compaction_end`:case`auto_retry_end`:if(r){let e=s.event===`auto_compaction_end`?`compaction`:`retry`,t=r.toolCalls.find(t=>t.toolName===e&&t.isActive);t&&(t.events.push(s),t.endedAt=s.timestamp,t.durationMs=S7(s.timestamp)-S7(t.startedAt),t.isActive=!1,s.message&&(t.summary=s.message)),r.events.push(s)}break;case`message_start`:case`message_update`:case`message_end`:r?(s.message&&!r.narration&&(r.narration=s.message),r.events.push(s)):n.push(s);break;case`notification`:r?(s.message&&(r.narration===s.message||r.notifications.includes(s.message)||r.notifications.push(s.message)),r.events.push(s)):n.push(s);break;default:r?r.events.push(s):n.push(s);break}}if(n.length>0&&t.unshift({kind:`preamble`,events:n}),a>=0&&a<e.length-1){let n=[];for(let r of e.slice(a+1))r.event!==`turn_start`&&(t.some(e=>e.kind===`turn`&&e.events.includes(r))||n.push(r));n.length>0&&t.push({kind:`epilogue`,events:n})}return i===0&&n.length===0&&e.length>0?[{kind:`preamble`,events:[...e]}]:t}function T7(e,t){return e?e.toLowerCase().includes(t.toLowerCase()):!1}function ide(e,t,n){if(!t&&n.size===0)return e;let r=[];for(let i of e)if(i.kind===`turn`){if(!(!t||T7(i.narration,t)||i.toolCalls.some(e=>T7(e.toolName,t)||T7(e.summary,t))||i.notifications.some(e=>T7(e,t))))continue;if(n.size===0)r.push(i);else{let e=i.toolCalls.filter(e=>n.has(e.toolName));r.push({...i,toolCalls:e})}}else{let e=i.events.filter(e=>{let r=!t||T7(e.event,t)||T7(e.message,t)||T7(e.toolName,t),i=n.size===0||n.has(e.event);return r&&i});e.length>0&&r.push({...i,events:e})}return r}var ade={bash:`text-emerald-400`,read:`text-sky-400`,edit:`text-violet-400`,write:`text-amber-400`,grep:`text-cyan-400`,find:`text-teal-400`,skill:`text-purple-400`,finder:`text-cyan-400`,ls:`text-teal-400`,compaction:`text-amber-400`,retry:`text-red-400`};function E7(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`}function ode(e,t){let n=Number(UL(t))-Number(UL(e));return`+${E7(Math.abs(n))}`}function D7(e,t){return e.length>t?e.slice(0,t)+`…`:e}function sde(e){let t=new Date(Number(UL(e)));return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}function O7(){return(0,k.jsxs)(`span`,{className:`relative flex size-2 shrink-0`,children:[(0,k.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-emerald-400/40`}),(0,k.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-emerald-400`})]})}function cde({turn:e}){let{actions:t}=g7(),n=[];for(let t of e.toolCalls)n.push({kind:`tool`,tc:t});for(let t of e.notifications)n.push({kind:`notification`,message:t});return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`trace-turn-header flex items-center gap-2 border-b border-border/50 bg-muted/30 px-3 py-2 type-body`,children:[(0,k.jsxs)(`span`,{className:`shrink-0 type-meta`,children:[`turn `,e.turnIndex]}),e.narration&&(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-foreground`,children:D7(e.narration,80)}),!e.narration&&(0,k.jsx)(`span`,{className:`flex-1`}),(0,k.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 type-meta tabular-nums`,children:[e.tokenUsage&&(0,k.jsxs)(`span`,{children:[e.tokenUsage.totalTokens.toLocaleString(),` tok`]}),e.durationMs!=null&&(0,k.jsx)(`span`,{children:E7(e.durationMs)}),e.isActive&&(0,k.jsx)(O7,{})]})]}),n.map((r,i)=>{let a=i===n.length-1?`└─`:`├─`;if(r.kind===`tool`){let{tc:n}=r,o=ade[n.toolName]??`text-zinc-400`;return(0,k.jsxs)(`button`,{type:`button`,className:EY(`trace-tool-row flex w-full items-center gap-2 px-3 py-1 pl-6 type-body hover:bg-accent/20 cursor-pointer text-left`,n.isError&&`text-red-400/80`),onClick:()=>t.selectEvent(n.events[n.events.length-1]??null),children:[(0,k.jsx)(`span`,{className:`w-4 shrink-0 type-meta`,children:a}),(0,k.jsx)(`span`,{className:EY(`w-[72px] shrink-0 truncate`,o),children:n.toolName}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-foreground`,children:n.summary?D7(n.summary,80):``}),(0,k.jsx)(`span`,{className:`shrink-0 type-meta tabular-nums`,children:ode(e.startedAt,n.startedAt)}),(0,k.jsx)(`span`,{className:`w-14 shrink-0 text-right type-meta tabular-nums`,children:n.isActive?(0,k.jsx)(O7,{}):n.durationMs==null?``:E7(n.durationMs)})]},n.toolCallId??`tc-${i}`)}return(0,k.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1 pl-6 type-body`,children:[(0,k.jsx)(`span`,{className:`w-4 shrink-0 type-meta`,children:a}),(0,k.jsx)(`span`,{className:`w-[72px] shrink-0 text-muted-foreground`,children:`··`}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:D7(r.message,80)})]},`notif-${i}`)})]})}function lde({section:e}){return(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`px-3 py-1 type-meta`,children:e.kind===`preamble`?`agent lifecycle`:`agent shutdown`}),e.events.map((t,n)=>(0,k.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1 type-meta`,children:[(0,k.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:sde(t.timestamp)}),(0,k.jsx)(`span`,{className:`w-[72px] shrink-0 truncate`,children:t.event}),t.message&&(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:D7(t.message,120)})]},`${e.kind}-${n}`))]})}function ude(){let{state:e}=g7(),t=(0,O.useMemo)(()=>rde(e.events),[e.events]),n=(0,O.useMemo)(()=>ide(t,e.query,e.typeFilter),[t,e.query,e.typeFilter]);return n.length===0?(0,k.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,k.jsx)(`p`,{className:`type-meta`,children:e.events.length===0?`no events yet`:`no matching events`})}):(0,k.jsx)(k.Fragment,{children:n.map(e=>e.kind===`turn`?(0,k.jsx)(cde,{turn:e},`turn-${e.turnIndex}`):(0,k.jsx)(lde,{section:e},e.kind))})}var dde={damping:.7,stiffness:.05,mass:1.25},fde=70,pde=1e3/60,mde=350,k7=!1;globalThis.document?.addEventListener(`mousedown`,()=>{k7=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{k7=!1}),globalThis.document?.addEventListener(`click`,()=>{k7=!1});const hde=(e={})=>{let[t,n]=(0,O.useState)(!1),[r,i]=(0,O.useState)(e.initial!==!1),[a,o]=(0,O.useState)(!1),s=(0,O.useRef)(null);s.current=e;let c=(0,O.useCallback)(()=>{if(!k7)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,O.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,O.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,O.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){g.current&&(g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=fde}}},[]),f=(0,O.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=M7(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/pde;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:M7(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,O.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,O.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,O.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=A7(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=A7(e=>{if(d.resizeObserver?.disconnect(),!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=M7(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:mde})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function A7(e,t){let n=(0,O.useCallback)(t=>(n.current=t,e(t)),t);return n}var j7=new Map;function M7(...e){let t={...dde},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return j7.has(r)||j7.set(r,Object.freeze(t)),n?`instant`:j7.get(r)}var N7=(0,O.createContext)(null),gde=typeof window<`u`?O.useLayoutEffect:O.useEffect;function P7({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,O.useRef)(null),d=hde({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:O.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,O.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,O.useImperativeHandle)(c,()=>y,[y]),gde(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),O.createElement(N7.Provider,{value:y},O.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=_de();return O.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},O.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(P7||={});function _de(){let e=(0,O.useContext)(N7);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}function vde(){let{state:e}=g7();return e.events.length===0?(0,k.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,k.jsx)(`p`,{className:`type-meta`,children:`no events yet`})}):(0,k.jsx)(P7,{className:`relative min-h-0 flex-1`,resize:`smooth`,initial:`smooth`,children:(0,k.jsx)(P7.Content,{children:e.viewMode===`grouped`?(0,k.jsx)(ude,{}):(0,k.jsx)(yde,{})})})}function yde(){let{state:e}=g7(),t=(0,O.useMemo)(()=>{let t=e.events;return e.query&&(t=t.filter(t=>Pue(t,e.query))),e.typeFilter.size>0&&(t=t.filter(t=>e.typeFilter.has(t.event))),t},[e.events,e.query,e.typeFilter]);return t.length===0?(0,k.jsx)(`div`,{className:`flex items-center justify-center p-8`,children:(0,k.jsx)(`p`,{className:`type-meta`,children:`no matching events`})}):(0,k.jsx)(k.Fragment,{children:t.map((e,t)=>(0,k.jsx)(x7,{event:e},`${Number(e.timestamp)}-${t}`))})}function bde(e){return new Date(Number(UL(e))).toISOString()}var xde={agent_start:`border-l-zinc-500`,agent_end:`border-l-zinc-500`,turn_start:`border-l-sky-400`,turn_end:`border-l-sky-400`,message_start:`border-l-violet-400`,message_update:`border-l-violet-400`,message_end:`border-l-violet-400`,tool_execution_start:`border-l-emerald-400`,tool_execution_update:`border-l-emerald-400`,tool_execution_end:`border-l-emerald-400`,auto_compaction_start:`border-l-amber-400`,auto_compaction_end:`border-l-amber-400`,auto_retry_start:`border-l-red-400`,auto_retry_end:`border-l-red-400`,notification:`border-l-zinc-600`};function Sde(e){return xde[e]??`border-l-zinc-700`}function Cde(e){let t=[];return e.message&&t.push({key:`message`,value:e.message,valueClass:`text-foreground`}),e.toolName&&t.push({key:`toolName`,value:e.toolName,valueClass:`text-foreground`}),e.toolCallId&&t.push({key:`toolCallId`,value:e.toolCallId,valueClass:`text-foreground`}),e.isError!==void 0&&t.push({key:`isError`,value:String(e.isError),valueClass:e.isError?`text-red-400`:`text-foreground`}),e.usage&&(t.push({key:`usage.inputTokens`,value:String(e.usage.inputTokens),valueClass:`text-emerald-400`}),t.push({key:`usage.outputTokens`,value:String(e.usage.outputTokens),valueClass:`text-emerald-400`}),t.push({key:`usage.totalTokens`,value:String(e.usage.totalTokens),valueClass:`text-emerald-400`})),t}function wde(){let{state:e}=g7(),[t,n]=(0,O.useState)(!1);if(!e.selectedEvent)return(0,k.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-4`,children:(0,k.jsx)(`span`,{className:`type-meta`,children:`select an event to inspect`})});let r=e.selectedEvent,i=Cde(r);return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-3 py-2`,children:[(0,k.jsxs)(`span`,{className:`type-body tabular-nums`,children:[(0,k.jsx)(`span`,{className:`text-foreground`,children:r.event}),(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:bde(r.timestamp)})]}),(0,k.jsx)(`button`,{type:`button`,className:`type-meta hover:text-foreground`,onClick:()=>n(e=>!e),"aria-label":`toggle raw json`,children:`{}`})]}),(0,k.jsxs)(`div`,{className:`overflow-y-auto border-l-2 p-3 type-body ${Sde(r.event)}`,children:[(0,k.jsx)(`div`,{children:i.map((e,t)=>(0,k.jsxs)(`div`,{className:`whitespace-pre-wrap`,children:[(0,k.jsxs)(`span`,{className:`text-muted-foreground`,children:[t===i.length-1?`└─`:`├─`,` `]}),(0,k.jsx)(`span`,{className:`text-sky-400`,children:e.key}),(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`: `}),(0,k.jsx)(`span`,{className:e.valueClass,children:e.value})]},e.key))}),t&&(0,k.jsx)(`pre`,{className:`mt-3 overflow-x-auto whitespace-pre-wrap type-meta`,children:JSON.stringify(r,null,2)})]})]})}const F7={Root:Fue,Toolbar:Yue,EventList:vde,EventRow:x7,DetailPane:wde};function Tde(){let{state:{focusedIssueId:e}}=Bq(),t=Iq(),n=e?t?.running.find(t=>t.issueId===e):void 0,r=n?.issueIdentifier??``,{events:i,isLoading:a}=Nue(n?r:``);return n?(0,k.jsx)(`div`,{className:`agent-workspace`,children:(0,k.jsx)(F7.Root,{events:i,issueId:n.issueId,issueIdentifier:n.issueIdentifier,isLoading:a,children:(0,k.jsxs)(`div`,{className:`trace-split`,children:[(0,k.jsxs)(`div`,{className:`trace-event-pane`,children:[(0,k.jsx)(F7.Toolbar,{}),(0,k.jsx)(F7.EventList,{})]}),(0,k.jsx)(`div`,{className:`trace-detail-pane`,children:(0,k.jsx)(F7.DetailPane,{})})]})})}):(0,k.jsx)(`div`,{className:`agent-workspace flex items-center justify-center`,children:(0,k.jsx)(`span`,{className:`type-meta`,children:`select an issue to inspect`})})}function I7({className:e,render:t,...n}){return fX({defaultTagName:`div`,props:jY({className:EY(`relative flex flex-col rounded-2xl border bg-card not-dark:bg-clip-padding text-card-foreground shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e),"data-slot":`card`},n),render:t})}function L7({className:e,render:t,...n}){return fX({defaultTagName:`div`,props:jY({className:EY(`grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 p-6 in-[[data-slot=card]:has(>[data-slot=card-panel])]:pb-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]`,e),"data-slot":`card-header`},n),render:t})}function R7({className:e,render:t,...n}){return fX({defaultTagName:`div`,props:jY({className:EY(`font-semibold text-lg leading-none`,e),"data-slot":`card-title`},n),render:t})}function z7({className:e,render:t,...n}){return fX({defaultTagName:`div`,props:jY({className:EY(`flex-1 p-6 in-[[data-slot=card]:has(>[data-slot=card-header]:not(.border-b))]:pt-0 in-[[data-slot=card]:has(>[data-slot=card-footer]:not(.border-t))]:pb-0`,e),"data-slot":`card-panel`},n),render:t})}const B7=O.createContext(void 0);function V7(){let e=O.useContext(B7);if(e===void 0)throw Error(HY(38));return e}const H7=new Map;function Ede(e,t){let n=JSON.stringify({locale:e,options:t}),r=H7.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return H7.set(n,i),i}function U7(e,t,n){return e==null?``:Ede(t,n).format(e)}function Dde(e,t,n){return e==null?``:n?U7(e,t,n):U7(e/100,t,{style:`percent`})}const Ode=O.forwardRef(function(e,t){let{format:n,getAriaValueText:r,locale:i,max:a=100,min:o=0,value:s,render:c,className:l,...u}=e,[d,f]=O.useState(),p=Dde(s,i,n),m=`${s}%`;r?m=r(p,s):n&&(m=p);let h={"aria-labelledby":d,"aria-valuemax":a,"aria-valuemin":o,"aria-valuenow":s,"aria-valuetext":m,role:`meter`},g=O.useMemo(()=>({formattedValue:p,max:a,min:o,setLabelId:f,value:s}),[p,a,o,f,s]),_=sX(`div`,e,{ref:t,props:[h,u]});return(0,k.jsx)(B7.Provider,{value:g,children:_})}),kde=O.forwardRef(function(e,t){let{render:n,className:r,...i}=e;return sX(`div`,e,{ref:t,props:i})});function Ade(e,t,n){return(e-t)*100/(n-t)}const jde=O.forwardRef(function(e,t){let{render:n,className:r,...i}=e,a=V7();return sX(`div`,e,{ref:t,props:[{style:{insetInlineStart:0,height:`inherit`,width:`${Ade(a.value,a.min,a.max)}%`}},i]})}),Mde=O.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,o=P0(i),{setLabelId:s}=V7();return EX(()=>(s(o),()=>s(void 0)),[o,s]),sX(`span`,e,{ref:t,props:[{id:o},a]})});function W7({className:e,children:t,...n}){return(0,k.jsx)(Ode,{className:EY(`flex w-full flex-col gap-2`,e),...n,children:t||(0,k.jsx)(G7,{children:(0,k.jsx)(K7,{})})})}function Nde({className:e,...t}){return(0,k.jsx)(Mde,{className:EY(`font-medium text-foreground text-sm`,e),"data-slot":`meter-label`,...t})}function G7({className:e,...t}){return(0,k.jsx)(kde,{className:EY(`block h-2 w-full overflow-hidden bg-input`,e),"data-slot":`meter-track`,...t})}function K7({className:e,...t}){return(0,k.jsx)(jde,{className:EY(`bg-primary transition-all duration-500`,e),"data-slot":`meter-indicator`,...t})}function q7(e){return Object.values(e).reduce((e,t)=>e+t,0)}function Pde(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Fde({depth:e,peak:t}){let n=Math.max(t,e,1),r=Math.min(e,n),i=r/n;return(0,k.jsxs)(W7,{value:r,max:n,className:`gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between type-meta`,children:[(0,k.jsx)(Nde,{children:`depth vs peak`}),(0,k.jsxs)(`span`,{className:`type-body`,children:[e,` / `,t]})]}),(0,k.jsx)(G7,{className:`h-1.5 rounded-full`,children:(0,k.jsx)(K7,{className:EY(`rounded-full transition-all`,i>=.85?`bg-destructive`:i>=.6?`bg-warning`:`bg-success`)})})]})}function J7({reasons:e,zeroLabel:t}){let n=Object.entries(e).sort((e,t)=>t[1]-e[1]),r=q7(e);return r===0?(0,k.jsx)(`p`,{className:`type-meta`,children:t}):(0,k.jsx)(`div`,{className:`space-y-2`,children:n.map(([e,t])=>{let n=r===0?0:Math.round(t/r*100);return(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3 type-body`,children:[(0,k.jsx)(`span`,{className:`type-meta`,children:Pde(e)}),(0,k.jsxs)(`span`,{className:`type-body`,children:[t,` `,(0,k.jsxs)(`span`,{className:`type-meta`,children:[`(`,n,`%)`]})]})]}),(0,k.jsx)(W7,{value:n,max:100,className:`gap-0`,children:(0,k.jsx)(G7,{className:`h-1.5 rounded-full`,children:(0,k.jsx)(K7,{className:`rounded-full bg-foreground/60 transition-all`})})})]},e)})})}function Y7({label:e,value:t,tone:n=`default`}){return(0,k.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 px-3 py-2`,children:[(0,k.jsx)(`div`,{className:`type-meta uppercase`,children:e}),(0,k.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`type-title`,children:t}),n===`warning`&&t>0?(0,k.jsx)(V2,{variant:`warning`,size:`sm`,children:`hot`}):null]})]})}function X7(){let e=Iq();if(!e)return null;let{counts:t,observability:n}=e;return(0,k.jsx)(`section`,{className:`space-y-3`,children:(0,k.jsxs)(`div`,{className:`grid gap-4`,children:[(0,k.jsxs)(I7,{children:[(0,k.jsx)(L7,{children:(0,k.jsx)(R7,{className:`type-title`,children:`queue`})}),(0,k.jsxs)(z7,{className:`space-y-4`,children:[(0,k.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,k.jsx)(Y7,{label:`depth`,value:n.commandQueueDepth}),(0,k.jsx)(Y7,{label:`peak`,value:n.commandQueuePeak}),(0,k.jsx)(Y7,{label:`pressure`,value:n.commandQueuePressureCount,tone:`warning`})]}),(n.commandQueueDepth>0||n.commandQueuePeak>0)&&(0,k.jsx)(Fde,{depth:n.commandQueueDepth,peak:n.commandQueuePeak})]})]}),(0,k.jsxs)(I7,{children:[(0,k.jsx)(L7,{children:(0,k.jsx)(R7,{className:`type-title`,children:`retries`})}),(0,k.jsxs)(z7,{className:`space-y-4`,children:[(0,k.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,k.jsx)(Y7,{label:`queued`,value:t.retrying}),(0,k.jsx)(Y7,{label:`stale drops`,value:n.staleRetryDropCount,tone:`warning`})]}),(0,k.jsx)(J7,{reasons:n.retriesScheduledByReason,zeroLabel:`no retries scheduled yet`})]})]}),(0,k.jsxs)(I7,{children:[(0,k.jsx)(L7,{children:(0,k.jsx)(R7,{className:`type-title`,children:`workers`})}),(0,k.jsx)(z7,{className:`space-y-4`,children:(0,k.jsxs)(`div`,{className:`space-y-3`,children:[(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between type-body`,children:[(0,k.jsx)(`span`,{className:`type-meta`,children:`stops`}),(0,k.jsx)(`span`,{className:`type-body`,children:q7(n.workerStopsByReason)})]}),(0,k.jsx)(J7,{reasons:n.workerStopsByReason,zeroLabel:`no worker stops recorded`})]}),(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between type-body`,children:[(0,k.jsx)(`span`,{className:`type-meta`,children:`exits`}),(0,k.jsx)(`span`,{className:`type-body`,children:q7(n.workerExitsByReason)})]}),(0,k.jsx)(J7,{reasons:n.workerExitsByReason,zeroLabel:`no worker exits recorded`})]})]})})]})]})})}var Z7=(0,O.createContext)({});function Q7(e){let t=(0,O.useRef)(null);return t.current===null&&(t.current=e()),t.current}var $7=typeof window<`u`?O.useLayoutEffect:O.useEffect,e9=(0,O.createContext)(null),t9=(0,O.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function n9(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ide(...e){return t=>{let n=!1,r=e.map(e=>{let r=n9(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():n9(e[t],null)}}}}function Lde(...e){return O.useCallback(Ide(...e),e)}var Rde=class extends O.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=K6(e)&&e.offsetWidth||0,r=K6(e)&&e.offsetHeight||0,i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft,i.right=n-i.width-i.left,i.bottom=r-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}};function zde({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,O.useId)(),s=(0,O.useRef)(null),c=(0,O.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=(0,O.useContext)(t9),u=Lde(s,e.props?.ref??e?.ref);return(0,O.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m}=c.current;if(t||a===!1||!s.current||!e||!u)return;let h=n===`left`?`left: ${f}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let _=document.createElement(`style`);l&&(_.nonce=l);let v=i??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
|
|
33
|
+
[data-motion-pop-id="${o}"] {
|
|
34
|
+
position: absolute !important;
|
|
35
|
+
width: ${e}px !important;
|
|
36
|
+
height: ${u}px !important;
|
|
37
|
+
${h}px !important;
|
|
38
|
+
${g}px !important;
|
|
39
|
+
}
|
|
40
|
+
`),()=>{v.contains(_)&&v.removeChild(_)}},[t]),(0,k.jsx)(Rde,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:O.cloneElement(e,{ref:u})})}var Bde=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Q7(Vde),d=(0,O.useId)(),f=!0,p=(0,O.useMemo)(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[n,u,r]);return a&&f&&(p={...p}),(0,O.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),O.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,k.jsx)(zde,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,k.jsx)(e9.Provider,{value:p,children:e})};function Vde(){return new Map}function r9(e=!0){let t=(0,O.useContext)(e9);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,O.useId)();(0,O.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,O.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var i9=e=>e.key||``;function a9(e){let t=[];return O.Children.forEach(e,e=>{(0,O.isValidElement)(e)&&t.push(e)}),t}var Hde=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=r9(o),f=(0,O.useMemo)(()=>a9(e),[e]),p=o&&!u?[]:f.map(i9),m=(0,O.useRef)(!0),h=(0,O.useRef)(f),g=Q7(()=>new Map),_=(0,O.useRef)(new Set),[v,y]=(0,O.useState)(f),[b,x]=(0,O.useState)(f);$7(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=i9(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=i9(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(a9(e)),y(f),null}let{forceRender:C}=(0,O.useContext)(Z7);return(0,k.jsx)(k.Fragment,{children:b.map(e=>{let v=i9(e),y=o&&!u?!1:f===b||p.includes(v);return(0,k.jsx)(Bde,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(_.current.add(v),g.has(v))g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},o9=(0,O.createContext)({strict:!1}),s9={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},c9=!1;function Ude(){if(c9)return;let e={};for(let t in s9)e[t]={isEnabled:e=>s9[t].some(t=>!!e[t])};D8(e),c9=!0}function l9(){return Ude(),ile()}function Wde(e){let t=l9();for(let n in e)t[n]={...t[n],...e[n]};D8(t)}var Gde=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function u9(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Gde.has(e)}var Kde=c({default:()=>d9},1),d9,qde=o((()=>{throw d9={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),f9=e=>!u9(e);function Jde(e){typeof e==`function`&&(f9=t=>t.startsWith(`on`)?!u9(t):e(t))}try{Jde((qde(),d(Kde)).default)}catch{}function Yde(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(f9(i)||n===!0&&u9(i)||!t&&!u9(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var p9=(0,O.createContext)({});function Xde(e,t){if(x8(e)){let{initial:t,animate:n}=e;return{initial:t===!1||v8(t)?t:void 0,animate:v8(n)?n:void 0}}return e.inherit===!1?{}:t}function Zde(e){let{initial:t,animate:n}=Xde(e,(0,O.useContext)(p9));return(0,O.useMemo)(()=>({initial:t,animate:n}),[m9(t),m9(n)])}function m9(e){return Array.isArray(e)?e.join(` `):e}var h9=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function g9(e,t,n){for(let r in t)!O6(t[r])&&!$8(r,n)&&(e[r]=t[r])}function Qde({transformTemplate:e},t){return(0,O.useMemo)(()=>{let n=h9();return J8(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $de(e,t){let n=e.style||{},r={};return g9(r,n,e),Object.assign(r,Qde(e,t)),r}function efe(e,t){let n={},r=$de(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var _9=()=>({...h9(),attrs:{}});function tfe(e,t,n,r){let i=(0,O.useMemo)(()=>{let n=_9();return n5(n,t,i5(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};g9(t,e.style,e),i.style={...t,...i.style}}return i}var nfe=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function v9(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(nfe.indexOf(e)>-1||/[A-Z]/u.test(e))}function rfe(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??v9(e)?tfe:efe)(t,r,i,e),c=Yde(t,typeof e==`string`,a),l=e===O.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,O.useMemo)(()=>O6(u)?u.get():u,[u]);return(0,O.createElement)(e,{...l,children:d})}function ife({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:afe(n,r,i,e),renderState:t()}}function afe(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=B5(a[e]);let{initial:o,animate:s}=e,c=x8(e),l=S8(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!_8(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=x6(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var y9=e=>(t,n)=>{let r=(0,O.useContext)(p9),i=(0,O.useContext)(e9),a=()=>ife(e,t,r,i);return n?a():Q7(a)},ofe=y9({scrapeMotionValuesFromProps:e5,createRenderState:h9}),sfe=y9({scrapeMotionValuesFromProps:a5,createRenderState:_9}),cfe=Symbol.for(`motionComponentSymbol`);function lfe(e,t,n){let r=(0,O.useRef)(n);(0,O.useInsertionEffect)(()=>{r.current=n});let i=(0,O.useRef)(null);return(0,O.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var b9=(0,O.createContext)({});function x9(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function ufe(e,t,n,r,i,a){let{visualElement:o}=(0,O.useContext)(p9),s=(0,O.useContext)(o9),c=(0,O.useContext)(e9),l=(0,O.useContext)(t9),u=l.reducedMotion,d=l.skipAnimations,f=(0,O.useRef)(null),p=(0,O.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,O.useContext)(b9);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&dfe(f.current,n,i,h);let g=(0,O.useRef)(!1);(0,O.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[j6],v=(0,O.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return $7(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,O.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function dfe(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:S9(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&x9(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function S9(e){if(e)return e.options.allowProjection===!1?S9(e.parent):e.projection}function C9(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Wde(r);let a=n?n===`svg`:v9(e),o=a?sfe:ofe;function s(n,s){let c,l={...(0,O.useContext)(t9),...n,layoutId:ffe(n)},{isStatic:u}=l,d=Zde(n),f=o(n,u);if(!u&&typeof window<`u`){pfe(l,r);let t=mfe(l);c=t.MeasureLayout,d.visualElement=ufe(e,f,l,i,t.ProjectionNode,a)}return(0,k.jsxs)(p9.Provider,{value:d,children:[c&&d.visualElement?(0,k.jsx)(c,{visualElement:d.visualElement,...l}):null,rfe(e,n,lfe(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,O.forwardRef)(s);return c[cfe]=e,c}function ffe({layoutId:e}){let t=(0,O.useContext)(Z7).id;return t&&e!==void 0?t+`-`+e:e}function pfe(e,t){(0,O.useContext)(o9).strict}function mfe(e){let{drag:t,layout:n}=l9();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function hfe(e,t){if(typeof Proxy>`u`)return C9;let n=new Map,r=(n,r)=>C9(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,C9(a,void 0,e,t)),n.get(a))})}var gfe=(e,t)=>t.isSVG??v9(e)?new o5(t):new t5(t,{allowProjection:e!==O.Fragment}),_fe=class extends A8{constructor(e){super(e),e.animationState||=Tle(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();_8(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},vfe=0,yfe={animation:{Feature:_fe},exit:{Feature:class extends A8{constructor(){super(...arguments),this.id=vfe++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function w9(e){return{point:{x:e.pageX,y:e.pageY}}}var bfe=e=>t=>Q6(t)&&e(t,w9(t));function T9(e,t,n,r){return z5(e,t,bfe(n),r)}var E9=({current:e})=>e?e.ownerDocument.defaultView:null,D9=new Set([`auto`,`scroll`]),O9=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=j9(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Due(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=M4;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=k9(t,this.transformPagePoint),A4.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=j9(e.type===`pointercancel`?this.lastMoveEventInfo:k9(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Q6(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=k9(w9(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=M4;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,j9(s,this.history)),this.removeListeners=Q2(T9(this.contextWindow,`pointermove`,this.handlePointerMove),T9(this.contextWindow,`pointerup`,this.handlePointerUp),T9(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(D9.has(e.overflowX)||D9.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),A4.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),j4(this.updatePoint)}};function k9(e,t){return t?{point:t(e.point)}:e}function A9(e,t){return{x:e.x-t.x,y:e.y-t.y}}function j9({point:e},t){return{point:e,delta:A9(e,M9(t)),offset:A9(e,xfe(t)),velocity:Sfe(t,.1)}}function xfe(e){return e[0]}function M9(e){return e[e.length-1]}function Sfe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=M9(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>t4(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>t4(t)*2&&(r=e[1]);let a=n4(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Cfe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?f3(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?f3(n,e,r.max):Math.min(e,n)),e}function N9(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function wfe(e,{top:t,left:n,bottom:r,right:i}){return{x:N9(e.x,n,i),y:N9(e.y,t,r)}}function P9(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Tfe(e,t){return{x:P9(e.x,t.x),y:P9(e.y,t.y)}}function Efe(e,t){let n=.5,r=g5(e),i=g5(t);return i>r?n=$2(t.min,t.max-r,e.min):r>i&&(n=$2(e.min,e.max-i,t.min)),W2(0,1,n)}function Dfe(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var F9=.35;function Ofe(e=F9){return e===!1?e=0:e===!0&&(e=F9),{x:I9(e,`left`,`right`),y:I9(e,`top`,`bottom`)}}function I9(e,t,n){return{min:L9(e,t),max:L9(e,n)}}function L9(e,t){return typeof e==`number`?e:e[t]||0}var kfe=new WeakMap,Afe=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=h8(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(w9(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ice(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),M5(e=>{let t=this.getAxisMotionValue(e).get()||0;if($4.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=g5(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&A4.update(()=>i(e,t),!1,!0),k6(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Mfe(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&A4.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new O9(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:E9(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&A4.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!z9(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Cfe(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&x9(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=wfe(n.layoutBox,e):this.constraints=!1,this.elastic=Ofe(t),r!==this.constraints&&!x9(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&M5(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Dfe(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!x9(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=cle(n,r.root,this.visualElement.getTransformPagePoint()),a=Tfe(r.layout.layoutBox,i);if(t){let e=t(ale(a));this.hasMutatedConstraints=!!e,e&&(a=j8(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=M5(o=>{if(!z9(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return k6(this.visualElement,e),n.start(y6(e,n,0,t,this.visualElement,!1))}stopAnimation(){M5(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){M5(t=>{let{drag:n}=this.getProps();if(!z9(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-f3(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!x9(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};M5(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Efe({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),M5(t=>{if(!z9(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(f3(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;kfe.set(this.visualElement,this);let e=this.visualElement.current,t=T9(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Hce(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();x9(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=jfe(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),A4.read(r);let o=z5(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(M5(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=F9,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function R9(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function jfe(e,t,n){let r=u8(e,R9(n)),i=u8(t,R9(n));return()=>{r(),i()}}function z9(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Mfe(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Nfe=class extends A8{constructor(e){super(e),this.removeGroupControls=X2,this.removeListeners=X2,this.controls=new Afe(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||X2}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},B9=e=>(t,n)=>{e&&A4.update(()=>e(t,n),!1,!0)},Pfe=class extends A8{constructor(){super(...arguments),this.removePointerDownListener=X2}onPointerDown(e){this.session=new O9(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:E9(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:B9(e),onStart:B9(t),onMove:B9(n),onEnd:(e,t)=>{delete this.session,r&&A4.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=T9(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},V9=!1,Ffe=class extends O.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),V9&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),V5.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),V9=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||A4.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),q6.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;V9=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function H9(e){let[t,n]=r9(),r=(0,O.useContext)(Z7);return(0,k.jsx)(Ffe,{...e,layoutGroup:r,switchLayoutGroup:(0,O.useContext)(b9),isPresent:t,safeToRemove:n})}var Ife={pan:{Feature:Pfe},drag:{Feature:Nfe,ProjectionNode:r7,MeasureLayout:H9}};function U9(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&A4.postRender(()=>i(t,w9(t)))}var Lfe=class extends A8{mount(){let{current:e}=this.node;e&&(this.unmount=Rce(e,(e,t)=>(U9(this.node,t,`Start`),e=>U9(this.node,e,`End`))))}unmount(){}},Rfe=class extends A8{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Q2(z5(this.node.current,`focus`,()=>this.onFocus()),z5(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function W9(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&A4.postRender(()=>i(t,w9(t)))}var zfe=class extends A8{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Wce(e,(e,t)=>(W9(this.node,t,`Start`),(e,{success:t})=>W9(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},G9=new WeakMap,K9=new WeakMap,Bfe=e=>{let t=G9.get(e.target);t&&t(e)},Vfe=e=>{e.forEach(Bfe)};function Hfe({root:e,...t}){let n=e||document;K9.has(n)||K9.set(n,{});let r=K9.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Vfe,{root:e,...t})),r[i]}function Ufe(e,t,n){let r=Hfe(t);return G9.set(e,n),r.observe(e),()=>{G9.delete(e),r.unobserve(e)}}var Wfe={some:0,all:1},Gfe=class extends A8{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Wfe[r]};return Ufe(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Kfe(e,t))&&this.startObserver()}unmount(){}};function Kfe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var qfe={inView:{Feature:Gfe},tap:{Feature:zfe},focus:{Feature:Rfe},hover:{Feature:Lfe}},Jfe={layout:{ProjectionNode:r7,MeasureLayout:H9}},Yfe=hfe({...yfe,...qfe,...Ife,...Jfe},gfe),Xfe=hX(`relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-3.5 py-3 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-lh [&>svg]:w-4`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 [&>svg]:text-destructive`,info:`border-info/32 bg-info/4 [&>svg]:text-info`,success:`border-success/32 bg-success/4 [&>svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&>svg]:text-warning`}}});function Zfe({className:e,variant:t,...n}){return(0,k.jsx)(`div`,{className:EY(Xfe({variant:t}),e),"data-slot":`alert`,role:`alert`,...n})}function Qfe({className:e,...t}){return(0,k.jsx)(`div`,{className:EY(`font-medium [svg~&]:col-start-2`,e),"data-slot":`alert-title`,...t})}function $fe({className:e,...t}){return(0,k.jsx)(`div`,{className:EY(`flex flex-col gap-2.5 text-muted-foreground [svg~&]:col-start-2`,e),"data-slot":`alert-description`,...t})}function epe(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=b7({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=P1(o,!0,!0),[d,f]=O.useState(o),[{height:p,width:m},h]=O.useState({height:void 0,width:void 0}),g=P0(),[_,v]=O.useState(),y=_??g,[b,x]=O.useState(!1),[S,C]=O.useState(!1),w=O.useRef(null),T=O.useRef(null),ee=O.useRef(null),E=O.useRef(null),te=B1(E,!1),ne=lZ(e=>{let t=!o,n=CQ(`trigger-press`,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=E.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return EX(()=>{a&&T.current===`none`&&!S&&!o&&l(!1)},[a,S,o,t,l]),O.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:ne,height:p,mounted:c,open:o,panelId:y,panelRef:E,runOnceAnimationsFinish:te,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:ee,transitionStatus:u,visible:d,width:m}),[w,T,i,ne,p,c,o,y,E,te,h,x,C,l,s,f,ee,u,d,m])}const q9=O.createContext(void 0);function J9(){let e=O.useContext(q9);if(e===void 0)throw Error(HY(15));return e}let Y9=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=F1.startingStyle]=`startingStyle`,e[e.endingStyle=F1.endingStyle]=`endingStyle`,e}({}),tpe=function(e){return e.panelOpen=`data-panel-open`,e}({});var npe={[Y9.open]:``},rpe={[Y9.closed]:``};const ipe={open(e){return e?{[tpe.panelOpen]:``}:null}},X9={open(e){return e?npe:rpe},...R1},ape=O.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,...c}=e,l=lZ(o),u=epe({open:s,defaultOpen:i,onOpenChange:l,disabled:a}),d=O.useMemo(()=>({open:u.open,disabled:u.disabled,transitionStatus:u.transitionStatus}),[u.open,u.disabled,u.transitionStatus]),f=O.useMemo(()=>({...u,onOpenChange:l,state:d}),[u,l,d]),p=sX(`div`,e,{state:d,ref:t,props:c,stateAttributesMapping:X9});return(0,k.jsx)(q9.Provider,{value:f,children:p})}),ope=O.createContext(void 0);function spe(e=!1){let t=O.useContext(ope);if(t===void 0&&!e)throw Error(HY(16));return t}function cpe(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:O.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function lpe(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=O.useRef(null),o=spe(!0)!==void 0,s=lZ(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=cpe({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=O.useCallback(()=>{let e=a.current;upe(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return EX(l,[l]),{getButtonProps:O.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return jY({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(zY(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(zY(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:lZ(e=>{a.current=e,l()})}}function upe(e){return BX(e)&&e.tagName===`BUTTON`}var dpe={...ipe,...R1};const fpe=O.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=J9(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,...f}=e,{getButtonProps:p,buttonRef:m}=lpe({disabled:c,focusableWhenDisabled:!0,native:d}),h=O.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return sX(`button`,e,{state:a,ref:[t,m],props:[h,f,p],stateAttributesMapping:dpe})});let ppe=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function mpe(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=O.useRef(!1),x=O.useRef(null),S=O.useRef(u),C=O.useRef(u),w=MQ(),T=O.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),ee=GY(r,d,lZ(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(ppe.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=jQ.request(()=>{C.current=!1,r=jQ.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{jQ.cancel(t),jQ.cancel(r)}}));return EX(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!C.current&&!o&&e.setAttribute(Y9.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=jQ.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=Y9.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{jQ.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),EX(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),AX(()=>{let e=jQ.request(()=>{S.current=!1});return()=>jQ.cancel(e)}),EX(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=jQ.request(()=>{b.current=!1,n=jQ.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{jQ.cancel(t),jQ.cancel(n)}},[a,u,d,p]),EX(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(Y9.startingStyle,``))},[a,T,n,d]),O.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,CQ(bQ,e))}return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},[l,d,h]),O.useMemo(()=>({props:{hidden:T,id:s,ref:ee}}),[T,s,ee])}let Z9=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({});const hpe=O.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,...s}=e,{abortControllerRef:c,animationTypeRef:l,height:u,mounted:d,onOpenChange:f,open:p,panelId:m,panelRef:h,runOnceAnimationsFinish:g,setDimensions:_,setHiddenUntilFound:v,setKeepMounted:y,setMounted:b,setPanelIdState:x,setOpen:S,setVisible:C,state:w,transitionDimensionRef:T,visible:ee,width:E,transitionStatus:te}=J9(),ne=r??!1,re=i??!1;EX(()=>{if(o)return x(o),()=>{x(void 0)}},[o,x]),EX(()=>{v(ne)},[v,ne]),EX(()=>{y(re)},[y,re]);let{props:ie}=mpe({abortControllerRef:c,animationTypeRef:l,externalRef:t,height:u,hiddenUntilFound:ne,id:m,keepMounted:re,mounted:d,onOpenChange:f,open:p,panelRef:h,runOnceAnimationsFinish:g,setDimensions:_,setMounted:b,setOpen:S,setVisible:C,transitionDimensionRef:T,visible:ee,width:E});V1({open:p&&te===`idle`,ref:h,onComplete(){p&&_({height:void 0,width:void 0})}});let ae=sX(`div`,e,{state:O.useMemo(()=>({...w,transitionStatus:te}),[w,te]),ref:[t,h],props:[ie,{style:{[Z9.collapsiblePanelHeight]:u===void 0?`auto`:`${u}px`,[Z9.collapsiblePanelWidth]:E===void 0?`auto`:`${E}px`}},s],stateAttributesMapping:X9});return re||ne||!re&&d?ae:null});function gpe({...e}){return(0,k.jsx)(ape,{"data-slot":`collapsible`,...e})}function _pe({className:e,...t}){return(0,k.jsx)(fpe,{className:EY(`cursor-pointer`,e),"data-slot":`collapsible-trigger`,...t})}function vpe({className:e,...t}){return(0,k.jsx)(hpe,{className:EY(`h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0`,e),"data-slot":`collapsible-panel`,...t})}var ype={opacity:0},bpe={opacity:1},xpe={opacity:0},Spe={duration:.15};function Cpe(e){let t=(UL(e)-Date.now())/1e3;return t<=0?`now`:t<60?`${Math.round(t)}s`:t<3600?`${Math.round(t/60)}m`:`${Math.floor(t/3600)}h ${Math.round(t%3600/60)}m`}function wpe(){let e=Iq()?.retrying??[],[t,n]=(0,O.useState)(!1);return e.length===0?null:(0,k.jsxs)(gpe,{open:t,onOpenChange:n,children:[(0,k.jsxs)(_pe,{className:`flex w-full items-center gap-2 py-2 type-meta`,children:[(0,k.jsx)(Zq,{className:`size-4 transition-transform duration-200 ${t?`rotate-90`:``}`}),(0,k.jsx)(`span`,{children:`Retrying`}),(0,k.jsx)(V2,{variant:`warning`,size:`sm`,children:e.length})]}),(0,k.jsx)(vpe,{children:(0,k.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:(0,k.jsx)(Hde,{children:e.map(e=>(0,k.jsx)(Yfe.div,{initial:ype,animate:bpe,exit:xpe,transition:Spe,children:(0,k.jsxs)(Zfe,{variant:`warning`,children:[(0,k.jsx)($q,{}),(0,k.jsxs)(Qfe,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{children:e.identifier}),(0,k.jsxs)(V2,{variant:`outline`,size:`sm`,children:[`attempt `,e.attempt]}),(0,k.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· due in `,Cpe(e.dueAt)]})]}),e.error&&(0,k.jsx)($fe,{children:e.error})]})},e.issueId))})})})]})}function Tpe(){return(0,k.jsxs)(`div`,{className:`ops-panel`,children:[(0,k.jsx)(`div`,{className:`border-b border-border px-4 py-2`,children:(0,k.jsx)(`span`,{className:`type-title`,children:`ops`})}),(0,k.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-6`,children:[(0,k.jsx)(wpe,{}),(0,k.jsx)(X7,{})]})]})}const Q9={Root:Vq,Header:A2,WorkRail:Aue,AgentWorkspace:Tde,ObservabilitySection:X7,OpsPanel:Tpe,StatusDot:OY};function Epe(){let{state:e}=Bq();return(0,k.jsx)(`div`,{className:`view-shell`,children:(0,k.jsxs)(`div`,{className:e.opsOpen?`workspace-grid-with-detail`:`workspace-grid`,children:[(0,k.jsx)(Q9.WorkRail,{}),(0,k.jsx)(Q9.AgentWorkspace,{}),e.opsOpen&&(0,k.jsx)(Q9.OpsPanel,{})]})})}function Dpe(){return(0,k.jsxs)(Q9.Root,{children:[(0,k.jsx)(Q9.Header,{}),(0,k.jsx)(Epe,{})]})}const Ope=Jr({getParentRoute:()=>wa,path:`/`,component:Dpe}),kpe=mi({routeTree:wa.addChildren([Ope])});var Ape=new va({defaultOptions:{queries:{staleTime:2e3,retry:2}}}),$9=document.getElementById(`root`);$9&&(0,Ca.createRoot)($9).render((0,k.jsx)(xa,{client:Ape,children:(0,k.jsx)(_i,{router:kpe})}));
|