niceeval 0.13.4-canary.49 → 0.14.0
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/INDEX.md +3 -3
- package/dist/inspection/overview.cjs +20 -4
- package/dist/inspection/overview.cjs.map +1 -1
- package/dist/inspection/overview.d.cts +5 -0
- package/dist/inspection/overview.d.mts +5 -0
- package/dist/inspection/overview.d.ts +5 -0
- package/dist/inspection/protocol.d.cts +238 -0
- package/dist/inspection/protocol.d.mts +238 -0
- package/dist/inspection/protocol.d.ts +238 -0
- package/dist/inspection/public.mjs +19 -16
- package/dist/inspection/results.cjs +11 -10
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +34 -0
- package/dist/inspection/results.d.mts +34 -0
- package/dist/inspection/results.d.ts +34 -0
- package/dist/show/contribution.cjs +11 -2
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/contribution.d.cts +7 -0
- package/dist/show/contribution.d.mts +7 -0
- package/dist/show/contribution.d.ts +7 -0
- package/dist/show/model.cjs +1 -0
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +2 -0
- package/dist/show/model.d.mts +2 -0
- package/dist/show/model.d.ts +2 -0
- package/dist/show/render.cjs +149 -81
- package/dist/show/render.cjs.map +1 -1
- package/dist/show/render.d.cts +3 -1
- package/dist/show/render.d.mts +3 -1
- package/dist/show/render.d.ts +3 -1
- package/dist/view/app-dist/.vite/manifest.json +18 -18
- package/dist/view/app-dist/assets/{AttemptDialog-zlgkBA66.js → AttemptDialog-76dX1VQq.js} +1 -1
- package/dist/view/app-dist/assets/{AttemptRoute-DN6R4719.js → AttemptRoute-DRHVh2JA.js} +1 -1
- package/dist/view/app-dist/assets/{ResultsPage-BfH9vA6y.js → ResultsPage-9CSI8dvZ.js} +2 -2
- package/dist/view/app-dist/assets/{RunPage-XiJvNLB-.js → RunPage-BUF0REv7.js} +1 -1
- package/dist/view/app-dist/assets/{TableContentView-V8MYLnmk.js → TableContentView-_Sbg5wDr.js} +1 -1
- package/dist/view/app-dist/assets/index-BGr_6pGY.js +19 -0
- package/dist/view/app-dist/assets/{quality-cost-scatter-Bxyj_9oc.js → quality-cost-scatter-B5wDa_F1.js} +1 -1
- package/dist/view/app-dist/assets/useSuspenseQuery-D3W8Uy33.js +1 -0
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/function-runtime.mjs +35 -20
- package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
- package/docs-site/zh/examples/index.mdx +1 -3
- package/docs-site/zh/explanation/evals.mdx +1 -1
- package/docs-site/zh/explanation/experiment.mdx +3 -1
- package/docs-site/zh/explanation/overview.mdx +6 -4
- package/docs-site/zh/explanation/record.mdx +9 -5
- package/docs-site/zh/explanation/runner.mdx +3 -3
- package/docs-site/zh/index.mdx +4 -8
- package/docs-site/zh/introduction.mdx +2 -2
- package/docs-site/zh/reference/cli.mdx +8 -7
- package/docs-site/zh/troubleshooting/debug-sandbox.mdx +5 -5
- package/docs-site/zh/troubleshooting/debugging.mdx +8 -8
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +35 -55
- package/docs-site/zh/tutorials/accept-results.mdx +4 -4
- package/docs-site/zh/tutorials/agent-onboarding.mdx +2 -2
- package/docs-site/zh/tutorials/authoring.mdx +1 -1
- package/docs-site/zh/tutorials/compare-runs.mdx +3 -3
- package/docs-site/zh/tutorials/concurrency.mdx +6 -6
- package/docs-site/zh/tutorials/connect-your-agent.mdx +2 -2
- package/docs-site/zh/tutorials/docker-in-docker.mdx +1 -1
- package/docs-site/zh/tutorials/experiments.mdx +1 -1
- package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +1 -1
- package/docs-site/zh/tutorials/quickstart.mdx +2 -2
- package/docs-site/zh/tutorials/reporters.mdx +3 -3
- package/docs-site/zh/tutorials/sandbox-agent.mdx +2 -2
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +3 -3
- package/docs-site/zh/tutorials/viewing-results.mdx +10 -11
- package/package.json +1 -1
- package/dist/view/app-dist/assets/index-BSJP_UAR.js +0 -19
- package/dist/view/app-dist/assets/useSuspenseQuery-Bdi9nQF1.js +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ResultsPage-9CSI8dvZ.js","assets/jsx-runtime-BnHLaUks.js","assets/useSuspenseQuery-D3W8Uy33.js","assets/TableContentView-_Sbg5wDr.js","assets/RunPage-BUF0REv7.js","assets/AttemptDialog-76dX1VQq.js","assets/AttemptRoute-DRHVh2JA.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,c as t,n,o as r,r as i,t as a}from"./jsx-runtime-BnHLaUks.js";(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 o=r((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&&ne(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(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(ee)};else if(typeof MessageChannel<`u`){var D=new MessageChannel,O=D.port2;D.port1.onmessage=ee,te=function(){O.postMessage(null)}}else te=function(){_(ee,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),s=r(((e,t)=>{t.exports=o()})),c=r((t=>{var n=e();function r(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 i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.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??a.d.M(e)},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.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})}},t.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.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 a.d.m(e)},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.8`})),l=r(((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=c()})),u=r((t=>{var n=s(),r=e(),i=l();function a(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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(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 u(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 d(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 f(e){if(c(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=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`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?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 E:return`SuspenseList`;case D: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 ee:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,k=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function be(e){e.memoizedState!==null&&pe(_e,e);var t=me.current,n=nf(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function xe(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),fp._currentValue=ce)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!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(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);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=`
|
|
7
|
+
`+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{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=n.unstable_scheduleCallback,je=n.unstable_cancelCallback,Me=n.unstable_shouldYield,Ne=n.unstable_requestPaint,Pe=n.unstable_now,Fe=n.unstable_getCurrentPriorityLevel,Ie=n.unstable_ImmediatePriority,Le=n.unstable_UserBlockingPriority,Re=n.unstable_NormalPriority,ze=n.unstable_LowPriority,Be=n.unstable_IdlePriority,Ve=n.log,He=n.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(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 et(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=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(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 tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(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 rt(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function it(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(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-Ke(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&&st(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function st(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ke(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ke(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function lt(e,t){var n=t&-t;return n=n&42?1:ut(n),(n&(e.suspendedLanes|t))===0?n:0}function ut(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 dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ft(){var e=se.p;return e===0?(e=window.event,e===void 0?32:Op(e.type)):e}function pt(e,t){var n=se.p;try{return se.p=e,t()}finally{se.p=n}}var mt=Math.random().toString(36).slice(2),ht=`__reactFiber$`+mt,gt=`__reactProps$`+mt,_t=`__reactContainer$`+mt,vt=`__reactEvents$`+mt,yt=`__reactListeners$`+mt,bt=`__reactHandles$`+mt,xt=`__reactResources$`+mt,St=`__reactMarker$`+mt;function Ct(e){delete e[ht],delete e[gt],delete e[vt],delete e[yt],delete e[bt]}function wt(e){var t=e[ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tf(e);e!==null;){if(n=e[ht])return n;e=Tf(e)}return t}e=n,n=e.parentNode}return null}function Tt(e){if(e=e[ht]||e[_t]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Et(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Dt(e){var t=e[xt];return t||=e[xt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ot(e){e[St]=!0}var kt=new Set,At={};function jt(e,t){Mt(e,t),Mt(e+`Capture`,t)}function Mt(e,t){for(At[e]=t,e=0;e<t.length;e++)kt.add(t[e])}var Nt=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]*$`),Pt={},Ft={};function It(e){return ke.call(Ft,e)?!0:ke.call(Pt,e)?!1:Nt.test(e)?Ft[e]=!0:(Pt[e]=!0,!1)}function Lt(e,t,n){if(It(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 Rt(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 zt(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 Bt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Vt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ht(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 Ut(e){if(!e._valueTracker){var t=Vt(e)?`checked`:`value`;e._valueTracker=Ht(e,t,``+e[t])}}function Wt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Vt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Gt(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 Kt=/[\n"\\]/g;function qt(e){return e.replace(Kt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Jt(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=``+Bt(t)):e.value!==``+Bt(t)&&(e.value=``+Bt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Xt(e,o,Bt(n)):Xt(e,o,Bt(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=``+Bt(s):e.removeAttribute(`name`)}function Yt(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)){Ut(e);return}n=n==null?``:``+Bt(n),t=t==null?n:``+Bt(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),Ut(e)}function Xt(e,t,n){t===`number`&&Gt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Zt(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=``+Bt(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 Qt(e,t,n){if(t!=null&&(t=``+Bt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Bt(n)}function $t(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(oe(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Bt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ut(e)}function en(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tn=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 nn(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||tn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function rn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(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 i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&nn(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&nn(e,o,t[o])}function an(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 on=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`]]),sn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function cn(e){return sn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function ln(){}var un=null;function dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fn=null,pn=null;function mn(e){var t=Tt(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Jt(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="`+qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[gt]||null;if(!i)throw Error(a(90));Jt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Wt(r)}break a;case`textarea`:Qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Zt(e,!!n.multiple,t,!1)}}}var hn=!1;function gn(e,t,n){if(hn)return e(t,n);hn=!0;try{return e(t)}finally{if(hn=!1,(fn!==null||pn!==null)&&(Mu(),fn&&(t=fn,e=pn,pn=fn=null,mn(t),e)))for(t=0;t<e.length;t++)mn(e[t])}}function _n(e,t){var n=e.stateNode;if(n===null)return null;var r=n[gt]||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(a(231,t,typeof n));return n}var vn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),yn=!1;if(vn)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){yn=!0}}),window.addEventListener(`test`,bn,bn),window.removeEventListener(`test`,bn,bn)}catch{yn=!1}var xn=null,Sn=null,Cn=null;function wn(){if(Cn)return Cn;var e,t=Sn,n=t.length,r,i=`value`in xn?xn.value:xn.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 Cn=i.slice(e,1<r?1-r:void 0)}function Tn(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 En(){return!0}function Dn(){return!1}function On(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)?En:Dn,this.isPropagationStopped=Dn,this}return h(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=En)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=En)},persist:function(){},isPersistent:En}),t}var kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},An=On(kn),jn=h({},kn,{view:0,detail:0}),Mn=On(jn),Nn,Pn,Fn,In=h({},jn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qn,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!==Fn&&(Fn&&e.type===`mousemove`?(Nn=e.screenX-Fn.screenX,Pn=e.screenY-Fn.screenY):Pn=Nn=0,Fn=e),Nn)},movementY:function(e){return`movementY`in e?e.movementY:Pn}}),Ln=On(In),Rn=On(h({},In,{dataTransfer:0})),zn=On(h({},jn,{relatedTarget:0})),Bn=On(h({},kn,{animationName:0,elapsedTime:0,pseudoElement:0})),Vn=On(h({},kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Hn=On(h({},kn,{data:0})),Un={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Wn={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`},Gn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gn[e])?!!t[e]:!1}function qn(){return Kn}var Jn=On(h({},jn,{key:function(e){if(e.key){var t=Un[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Tn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Wn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qn,charCode:function(e){return e.type===`keypress`?Tn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Tn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Yn=On(h({},In,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Xn=On(h({},jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qn})),Zn=On(h({},kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Qn=On(h({},In,{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})),$n=On(h({},kn,{newState:0,oldState:0})),er=[9,13,27,32],tr=vn&&`CompositionEvent`in window,nr=null;vn&&`documentMode`in document&&(nr=document.documentMode);var rr=vn&&`TextEvent`in window&&!nr,ir=vn&&(!tr||nr&&8<nr&&11>=nr),ar=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return er.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,ar):null;case`textInput`:return e=t.data,e===ar&&or?null:e;default:return null}}function dr(e,t){if(lr)return e===`compositionend`||!tr&&sr(e,t)?(e=wn(),Cn=Sn=xn=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 ir&&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){fn?pn?pn.push(r):pn=[r]:fn=r,t=zd(t,`onChange`),0<t.length&&(n=new An(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var hr=null,gr=null;function _r(e){Md(e,0)}function vr(e){if(Wt(Et(e)))return e}function yr(e,t){if(e===`change`)return t}var br=!1;if(vn){var xr;if(vn){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,dn(e)),gn(_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(!ke.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=Gt(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=Gt(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=vn&&`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!==Gt(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=zd(Br,`onSelect`),0<r.length&&(t=new An(`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={};vn&&(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),jt(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-Ke(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<Cu)throw Cu=0,wu=null,Error(a(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,i,o){var s=0;if(r=e,typeof e==`function`)vi(e)&&(s=1);else if(typeof e==`string`)s=rp(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=_i(31,n,t,i),e.elementType=D,e.lanes=o,e;case y:return Si(n.children,i,o,t);case b:s=8,i|=24;break;case x:return e=_i(12,n,t,i|2),e.elementType=x,e.lanes=o,e;case T:return e=_i(13,n,t,i),e.elementType=T,e.lanes=o,e;case E:return e=_i(19,n,t,i),e.elementType=E,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 ee:s=14;break a;case te:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=_i(s,n,t,i),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:Oe(t)},Ei.set(e,t),t):n}return{value:e,source:t,stack:Oe(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-Ke(r)-1;r&=~(1<<i),n+=1;var a=32-Ke(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Fi=1<<32-Ke(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,A=!1,Wi=null,Gi=!1,Ki=Error(a(519));function qi(e){throw $i(Di(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ki}function Ji(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ht]=e,t[gt]=r,n){case`dialog`:z(`cancel`,t),z(`close`,t);break;case`iframe`:case`object`:case`embed`:z(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ad.length;n++)z(Ad[n],t);break;case`source`:z(`error`,t);break;case`img`:case`image`:case`link`:z(`error`,t),z(`load`,t);break;case`details`:z(`toggle`,t);break;case`input`:z(`invalid`,t),Yt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:z(`invalid`,t);break;case`textarea`:z(`invalid`,t),$t(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||Gd(t.textContent,n)?(r.popover!=null&&(z(`beforetoggle`,t),z(`toggle`,t)),r.onScroll!=null&&z(`scroll`,t),r.onScrollEnd!=null&&z(`scrollend`,t),r.onClick!=null&&(t.onclick=ln),t=!0):t=!1,t||qi(e,!0)}function Yi(e){for(Hi=e.return;Hi;)switch(Hi.tag){case 5:case 31:case 13:Gi=!1;return;case 27:case 3:Gi=!0;return;default:Hi=Hi.return}}function Xi(e){if(e!==Hi)return!1;if(!A)return Yi(e),A=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||rf(e.type,e.memoizedProps)),n=!n),n&&Ui&&qi(e),Yi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ui=wf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ui=wf(e)}else t===27?(t=Ui,ff(e.type)?(e=Cf,Cf=null,Ui=e):Ui=t):Ui=Hi?Sf(e.stateNode.nextSibling):null;return!0}function Zi(){Ui=Hi=null,A=!1}function Qi(){var e=Wi;return e!==null&&(lu===null?lu=e:lu.push.apply(lu,e),Wi=null),e}function $i(e){Wi===null?Wi=[e]:Wi.push(e)}var ea=de(null),ta=null,na=null;function ra(e,t,n){pe(ea,t._currentValue),t._currentValue=n}function ia(e){e._currentValue=ea.current,fe(ea)}function aa(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 oa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),aa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),aa(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function sa(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;jr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===_e.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[fp]:e.push(fp))}i=i.return}e!==null&&oa(t,e,n,r),t.flags|=262144}function ca(e){for(e=e.firstContext;e!==null;){if(!jr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function la(e){ta=e,na=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function j(e){return da(ta,e)}function ua(e,t){return ta===null&&la(e),da(e,t)}function da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},na===null){if(e===null)throw Error(a(308));na=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else na=na.next=t;return n}var fa=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()})}},pa=n.unstable_scheduleCallback,ma=n.unstable_NormalPriority,ha={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ga(){return{controller:new fa,data:new Map,refCount:0}}function _a(e){e.refCount--,e.refCount===0&&pa(ma,function(){e.controller.abort()})}var va=null,ya=0,ba=0,xa=null;function Sa(e,t){if(va===null){var n=va=[];ya=0,ba=wd(),xa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ya++,t.then(Ca,Ca),t}function Ca(){if(--ya===0&&va!==null){xa!==null&&(xa.status=`fulfilled`);var e=va;va=null,ba=0,xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ta=k.S;k.S=function(e,t){fu=Pe(),typeof t==`object`&&t&&typeof t.then==`function`&&Sa(e,t),Ta!==null&&Ta(e,t)};var Ea=de(null);function Da(){var e=Ea.current;return e===null?Yl.pooledCache:e}function Oa(e,t){t===null?pe(Ea,Ea.current):pe(Ea,t.pool)}function ka(){var e=Da();return e===null?null:{parent:ha._currentValue,pool:e}}var Aa=Error(a(460)),ja=Error(a(474)),Ma=Error(a(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(ln,ln),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(ln,ln);else{if(e=Yl,e!==null&&100<e.shellSuspendCounter)throw Error(a(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,Aa}}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,Aa):e}}var La=null;function Ra(){if(La===null)throw Error(a(459));var e=La;return La=null,e}function za(e){if(e===Aa||e===Ma)throw Error(a(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===g?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(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 i(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=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===te&&Ia(a)===t.type)?(t=i(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=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Si(n,e.mode,r,a),t.return=e,t):(t=i(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 _: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(oe(t)||re(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,ua(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 _: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(oe(n)||re(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,ua(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 _: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(oe(r)||re(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,ua(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),A&&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 A&&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)}),A&&Li(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(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(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),A&&Li(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return A&&Li(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,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(i,e)}),A&&Li(i,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 _: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=i(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=i(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=i(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(oe(o))return h(e,r,o,c);if(re(o)){if(l=re(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ha(o),c);if(o.$$typeof===C)return b(e,r,ua(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=i(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===Aa||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),Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xa(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 Za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Jl&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 $a(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,ct(e,n)}}function eo(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 to=!1;function no(){if(to){var e=xa;if(e!==null)throw e}}function ro(e,t,n,r){to=!1;var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(R&f)===f:(r&f)===f){f!==0&&f===ba&&(to=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ja=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ru|=o,e.lanes=o,e.memoizedState=d}}function io(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function ao(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)io(n[e],t)}var oo=de(null),so=de(0);function co(e,t){e=tu,pe(so,e),pe(oo,t),tu=e|t.baseLanes}function lo(){pe(so,tu),pe(oo,oo.current)}function uo(){tu=so.current,fe(oo),fe(so)}var fo=de(null),po=null;function M(e){var t=e.alternate;pe(vo,vo.current&1),pe(fo,e),po===null&&(t===null||oo.current!==null||t.memoizedState!==null)&&(po=e)}function mo(e){pe(vo,vo.current),pe(fo,e),po===null&&(po=e)}function ho(e){e.tag===22?(pe(vo,vo.current),pe(fo,e),po===null&&(po=e)):go(e)}function go(){pe(vo,vo.current),pe(fo,fo.current)}function _o(e){fe(fo),po===e&&(po=null),fe(vo)}var vo=de(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||yf(n)||bf(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,xo=null,So=null,Co=!1,wo=!1,To=!1,Eo=0,Do=0,Oo=null,ko=0;function Ao(){throw Error(a(321))}function jo(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 Mo(e,t,n,r,i,a){return bo=a,N=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Ys:Xs,To=!1,a=n(r,i),To=!1,wo&&(a=Po(t,n,r,i)),No(e),a}function No(e){k.H=Js;var t=xo!==null&&xo.next!==null;if(bo=0,So=xo=N=null,Co=!1,Do=0,Oo=null,t)throw Error(a(300));e===null||P||(e=e.dependencies,e!==null&&ca(e)&&(P=!0))}function Po(e,t,n,r){N=e;var i=0;do{if(wo&&(Oo=null),Do=0,wo=!1,25<=i)throw Error(a(301));if(i+=1,So=xo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Zs,o=t(n,r)}while(wo);return o}function Fo(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Ho(t):t,e=e.useState()[0],(xo===null?null:xo.memoizedState)!==e&&(N.flags|=1024),t}function Io(){var e=Eo!==0;return Eo=0,e}function Lo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ro(e){if(Co){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Co=!1}bo=0,So=xo=N=null,wo=!1,Do=Eo=0,Oo=null}function zo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return So===null?N.memoizedState=So=e:So=So.next=e,So}function Bo(){if(xo===null){var e=N.alternate;e=e===null?null:e.memoizedState}else e=xo.next;var t=So===null?N.memoizedState:So.next;if(t!==null)So=t,xo=e;else{if(e===null)throw N.alternate===null?Error(a(467)):Error(a(310));xo=e,e={memoizedState:xo.memoizedState,baseState:xo.baseState,baseQueue:xo.baseQueue,queue:xo.queue,next:null},So===null?N.memoizedState=So=e:So=So.next=e}return So}function Vo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ho(e){var t=Do;return Do+=1,Oo===null&&(Oo=[]),e=Fa(Oo,e,t),t=N,(So===null?t.memoizedState:So.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Ys:Xs),e}function Uo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ho(e);if(e.$$typeof===C)return j(e)}throw Error(a(438,String(e)))}function Wo(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=Vo(),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]=O;return t.index++,n}function Go(e,t){return typeof t==`function`?t(e):t}function Ko(e){return qo(Bo(),xo,e)}function qo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(bo&f)===f:(R&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ba&&(d=!0);else if((bo&p)===p){u=u.next,p===ba&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,N.lanes|=p,ru|=p;f=u.action,To&&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,ru|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!jr(o,e.memoizedState)&&(P=!0,d&&(n=xa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Jo(e){var t=Bo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);jr(o,t.memoizedState)||(P=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Yo(e,t,n){var r=N,i=Bo(),o=A;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!jr((xo||i).memoizedState,n);if(s&&(i.memoizedState=n,P=!0),i=i.queue,bs(Qo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||So!==null&&So.memoizedState.tag&1){if(r.flags|=2048,hs(9,{destroy:void 0},Zo.bind(null,r,i,n,t),null),Yl===null)throw Error(a(349));o||bo&127||Xo(r,t,n)}return n}function Xo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=N.updateQueue,t===null?(t=Vo(),N.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Zo(e,t,n,r){t.value=n,t.getSnapshot=r,$o(t)&&es(e)}function Qo(e,t,n){return n(function(){$o(t)&&es(e)})}function $o(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jr(e,n)}catch{return!0}}function es(e){var t=fi(e,2);t!==null&&Du(t,e,2)}function ts(e){var t=zo();if(typeof e==`function`){var n=e;if(e=n(),To){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:e},t}function ns(e,t,n,r){return e.baseState=n,qo(e,xo,typeof r==`function`?r:Go)}function rs(e,t,n,r,i){if(Gs(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,is(t,o)):(o.next=n.next,t.pending=n.next=o)}}function is(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),as(e,t,s)}catch(n){ss(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),as(e,t,a)}catch(n){ss(e,t,n)}}function as(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){os(e,t,n)},function(n){return ss(e,t,n)}):os(e,t,n)}function os(e,t,n){t.status=`fulfilled`,t.value=n,cs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,is(e,n)))}function ss(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,cs(t),t=t.next;while(t!==r)}e.action=null}function cs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ls(e,t){return t}function us(e,t){if(A){var n=Yl.formState;if(n!==null){a:{var r=N;if(A){if(Ui){b:{for(var i=Ui,a=Gi;i.nodeType!==8;){if(!a){i=null;break b}if(i=Sf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ui=Sf(i.nextSibling),r=i.data===`F!`;break a}}qi(r)}r=!1}r&&(t=n[0])}}return n=zo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:t},n.queue=r,n=Hs.bind(null,N,r),r.dispatch=n,r=ts(!1),a=Ws.bind(null,N,!1,r.queue),r=zo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=rs.bind(null,N,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ds(e){return fs(Bo(),xo,e)}function fs(e,t,n){if(t=qo(e,t,ls)[0],e=Ko(Go)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ho(t)}catch(e){throw e===Aa?Ma:e}else r=t;t=Bo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(N.flags|=2048,hs(9,{destroy:void 0},ps.bind(null,i,n),null)),[r,a,e]}function ps(e,t){e.action=t}function ms(e){var t=Bo(),n=xo;if(n!==null)return fs(t,n,e);Bo(),t=t.memoizedState,n=Bo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function hs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=N.updateQueue,t===null&&(t=Vo(),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 gs(){return Bo().memoizedState}function _s(e,t,n,r){var i=zo();N.flags|=e,i.memoizedState=hs(1|t,{destroy:void 0},n,r===void 0?null:r)}function vs(e,t,n,r){var i=Bo();r=r===void 0?null:r;var a=i.memoizedState.inst;xo!==null&&r!==null&&jo(r,xo.memoizedState.deps)?i.memoizedState=hs(t,a,n,r):(N.flags|=e,i.memoizedState=hs(1|t,a,n,r))}function ys(e,t){_s(8390656,8,e,t)}function bs(e,t){vs(2048,8,e,t)}function xs(e){N.flags|=4;var t=N.updateQueue;if(t===null)t=Vo(),N.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ss(e){var t=Bo().memoizedState;return xs({ref:t,nextImpl:e}),function(){if(Jl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Cs(e,t){return vs(4,2,e,t)}function ws(e,t){return vs(4,4,e,t)}function Ts(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 Es(e,t,n){n=n==null?null:n.concat([e]),vs(4,4,Ts.bind(null,t,e),n)}function Ds(){}function Os(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ks(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&jo(t,r[1]))return r[0];if(r=e(),To){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r}function As(e,t,n){return n===void 0||bo&1073741824&&!(R&261930)?e.memoizedState=t:(e.memoizedState=n,e=Eu(),N.lanes|=e,ru|=e,n)}function js(e,t,n,r){return jr(n,t)?n:oo.current===null?!(bo&42)||bo&1073741824&&!(R&261930)?(P=!0,e.memoizedState=n):(e=Eu(),N.lanes|=e,ru|=e,t):(e=As(e,n,r),jr(e,t)||(P=!0),e)}function Ms(e,t,n,r,i){var a=se.p;se.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,Ws(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Us(e,t,wa(c,r),Tu(e)):Us(e,t,r,Tu(e))}catch(n){Us(e,t,{then:function(){},status:`rejected`,reason:n},Tu())}finally{se.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Ns(){}function Ps(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Fs(e).queue;Ms(e,i,t,ce,n===null?Ns:function(){return Is(e),n(r)})}function Fs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Is(e){var t=Fs(e);t.next===null&&(t=e.alternate.memoizedState),Us(e,t.next.queue,{},Tu())}function Ls(){return j(fp)}function Rs(){return Bo().memoizedState}function zs(){return Bo().memoizedState}function Bs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tu();e=Za(n);var r=Qa(t,e,n);r!==null&&(Du(r,t,n),$a(r,t,n)),t={cache:ga()},e.payload=t;return}t=t.return}}function Vs(e,t,n){var r=Tu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Gs(e)?Ks(t,n):(n=di(e,t,n,r),n!==null&&(Du(n,e,r),qs(n,t,r)))}function Hs(e,t,n){Us(e,t,n,Tu())}function Us(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gs(e))Ks(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),Yl===null&&li(),!1}catch{}if(n=di(e,t,i,r),n!==null)return Du(n,e,r),qs(n,t,r),!0}return!1}function Ws(e,t,n,r){if(r={lane:2,revertLane:wd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Gs(e)){if(t)throw Error(a(479))}else t=di(e,n,r,2),t!==null&&Du(t,e,2)}function Gs(e){var t=e.alternate;return e===N||t!==null&&t===N}function Ks(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var Js={readContext:j,use:Uo,useCallback:Ao,useContext:Ao,useEffect:Ao,useImperativeHandle:Ao,useLayoutEffect:Ao,useInsertionEffect:Ao,useMemo:Ao,useReducer:Ao,useRef:Ao,useState:Ao,useDebugValue:Ao,useDeferredValue:Ao,useTransition:Ao,useSyncExternalStore:Ao,useId:Ao,useHostTransitionStatus:Ao,useFormState:Ao,useActionState:Ao,useOptimistic:Ao,useMemoCache:Ao,useCacheRefresh:Ao};Js.useEffectEvent=Ao;var Ys={readContext:j,use:Uo,useCallback:function(e,t){return zo().memoizedState=[e,t===void 0?null:t],e},useContext:j,useEffect:ys,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),_s(4194308,4,Ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){_s(4,2,e,t)},useMemo:function(e,t){var n=zo();t=t===void 0?null:t;var r=e();if(To){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zo();if(n!==void 0){var i=n(t);if(To){Ge(!0);try{n(t)}finally{Ge(!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=Vs.bind(null,N,e),[r.memoizedState,e]},useRef:function(e){var t=zo();return e={current:e},t.memoizedState=e},useState:function(e){e=ts(e);var t=e.queue,n=Hs.bind(null,N,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ds,useDeferredValue:function(e,t){return As(zo(),e,t)},useTransition:function(){var e=ts(!1);return e=Ms.bind(null,N,e.queue,!0,!1),zo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=N,i=zo();if(A){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Yl===null)throw Error(a(349));R&127||Xo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ys(Qo.bind(null,r,o,e),[e]),r.flags|=2048,hs(9,{destroy:void 0},Zo.bind(null,r,o,n,t),null),n},useId:function(){var e=zo(),t=Yl.identifierPrefix;if(A){var n=Ii,r=Fi;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Eo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ls,useFormState:us,useActionState:us,useOptimistic:function(e){var t=zo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ws.bind(null,N,!0,n),n.dispatch=t,[e,t]},useMemoCache:Wo,useCacheRefresh:function(){return zo().memoizedState=Bs.bind(null,N)},useEffectEvent:function(e){var t=zo(),n={impl:e};return t.memoizedState=n,function(){if(Jl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Xs={readContext:j,use:Uo,useCallback:Os,useContext:j,useEffect:bs,useImperativeHandle:Es,useInsertionEffect:Cs,useLayoutEffect:ws,useMemo:ks,useReducer:Ko,useRef:gs,useState:function(){return Ko(Go)},useDebugValue:Ds,useDeferredValue:function(e,t){return js(Bo(),xo.memoizedState,e,t)},useTransition:function(){var e=Ko(Go)[0],t=Bo().memoizedState;return[typeof e==`boolean`?e:Ho(e),t]},useSyncExternalStore:Yo,useId:Rs,useHostTransitionStatus:Ls,useFormState:ds,useActionState:ds,useOptimistic:function(e,t){return ns(Bo(),xo,e,t)},useMemoCache:Wo,useCacheRefresh:zs};Xs.useEffectEvent=Ss;var Zs={readContext:j,use:Uo,useCallback:Os,useContext:j,useEffect:bs,useImperativeHandle:Es,useInsertionEffect:Cs,useLayoutEffect:ws,useMemo:ks,useReducer:Jo,useRef:gs,useState:function(){return Jo(Go)},useDebugValue:Ds,useDeferredValue:function(e,t){var n=Bo();return xo===null?As(n,e,t):js(n,xo.memoizedState,e,t)},useTransition:function(){var e=Jo(Go)[0],t=Bo().memoizedState;return[typeof e==`boolean`?e:Ho(e),t]},useSyncExternalStore:Yo,useId:Rs,useHostTransitionStatus:Ls,useFormState:ms,useActionState:ms,useOptimistic:function(e,t){var n=Bo();return xo===null?(n.baseState=e,[e,n.queue.dispatch]):ns(n,xo,e,t)},useMemoCache:Wo,useCacheRefresh:zs};Zs.useEffectEvent=Ss;function Qs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $s={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tu(),i=Za(r);i.payload=t,n!=null&&(i.callback=n),t=Qa(e,i,r),t!==null&&(Du(t,e,r),$a(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tu(),i=Za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Qa(e,i,r),t!==null&&(Du(t,e,r),$a(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tu(),r=Za(n);r.tag=2,t!=null&&(r.callback=t),t=Qa(e,r,n),t!==null&&(Du(t,e,n),$a(t,e,n))}};function ec(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 tc(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&&$s.enqueueReplaceState(t,t.state,null)}function nc(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function rc(e){ai(e)}function ic(e){console.error(e)}function ac(e){ai(e)}function oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function sc(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 cc(e,t,n){return n=Za(n),n.tag=3,n.payload={element:null},n.callback=function(){oc(e,t)},n}function lc(e){return e=Za(e),e.tag=3,e}function uc(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(){sc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){sc(t,n,r),typeof i!=`function`&&(hu===null?hu=new Set([this]):hu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function dc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&sa(t,n,i,!0),n=fo.current,n!==null){switch(n.tag){case 31:case 13:return po===null?zu():n.alternate===null&&nu===0&&(nu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Na?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),id(e,r,i)),!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)),id(e,r,i)),!1}throw Error(a(435,n.tag))}return id(e,r,i),zu(),!1}if(A)return t=fo.current,t===null?(r!==Ki&&(t=Error(a(423),{cause:r}),$i(Di(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Di(r,n),i=cc(e.stateNode,r,i),eo(e,i),nu!==4&&(nu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ki&&(e=Error(a(422),{cause:r}),$i(Di(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Di(o,n),cu===null?cu=[o]:cu.push(o),nu!==4&&(nu=2),t===null)return!0;r=Di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=cc(n.stateNode,r,e),eo(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`&&(hu===null||!hu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=lc(i),uc(i,e,n,r),eo(n,i),!1}n=n.return}while(n!==null);return!1}var fc=Error(a(461)),P=!1;function pc(e,t,n,r){t.child=e===null?qa(t,null,n,r):Ka(t,e.child,n,r)}function mc(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 la(t),r=Mo(e,t,n,o,a,i),s=Io(),e!==null&&!P?(Lo(e,t,i),Rc(e,t,i)):(A&&s&&zi(t),t.flags|=1,pc(e,t,r,i),t.child)}function hc(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,gc(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,!zc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Mr:n,n(o,r)&&e.ref===t.ref)return Rc(e,t,i)}return t.flags|=1,e=yi(a,r),e.ref=t.ref,e.return=t,t.child=e}function gc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mr(a,r)&&e.ref===t.ref)if(P=!1,t.pendingProps=r=a,zc(e,i))e.flags&131072&&(P=!0);else return t.lanes=e.lanes,Rc(e,t,i)}return wc(e,t,n,r,i)}function _c(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 yc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Oa(t,a===null?null:a.cachePool),a===null?lo():co(t,a),ho(t);else return r=t.lanes=536870912,yc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Oa(t,null),lo(),go(t)):(Oa(t,a.cachePool),co(t,a),go(t),t.memoizedState=null);return pc(e,t,i,n),t.child}function vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function yc(e,t,n,r,i){var a=Da();return a=a===null?null:{parent:ha._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Oa(t,null),lo(),ho(t),e!==null&&sa(e,t,r,!0),t.childLanes=i,null}function bc(e,t){return t=Nc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xc(e,t,n){return Ka(t,e.child,null,n),e=bc(t,t.pendingProps),e.flags|=2,_o(t),t.memoizedState=null,e}function Sc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(A){if(r.mode===`hidden`)return e=bc(t,r),t.lanes=536870912,vc(null,e);if(mo(t),(e=Ui)?(e=vf(e,Gi),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 qi(t);return t.lanes=536870912,null}return bc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(mo(t),i)if(t.flags&256)t.flags&=-257,t=xc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(P||sa(e,t,n,!1),i=(n&e.childLanes)!==0,P||i){if(r=Yl,r!==null&&(s=lt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,fi(e,s),Du(r,e,s),fc;zu(),t=xc(e,t,n)}else e=o.treeContext,Ui=Sf(s.nextSibling),Hi=t,A=!0,Wi=null,Gi=!1,e!==null&&Vi(t,e),t=bc(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 Cc(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(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function wc(e,t,n,r,i){return la(t),n=Mo(e,t,n,r,void 0,i),r=Io(),e!==null&&!P?(Lo(e,t,i),Rc(e,t,i)):(A&&r&&zi(t),t.flags|=1,pc(e,t,n,i),t.child)}function Tc(e,t,n,r,i,a){return la(t),t.updateQueue=null,n=Po(t,r,n,i),No(e),r=Io(),e!==null&&!P?(Lo(e,t,a),Rc(e,t,a)):(A&&r&&zi(t),t.flags|=1,pc(e,t,n,a),t.child)}function Ec(e,t,n,r,i){if(la(t),t.stateNode===null){var a=hi,o=n.contextType;typeof o==`object`&&o&&(a=j(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=$s,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ya(t),o=n.contextType,a.context=typeof o==`object`&&o?j(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&&$s.enqueueReplaceState(a,a.state,null),ro(t,r,a,i),no(),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=nc(n,s);a.props=c;var l=a.context,u=n.contextType;o=hi,typeof u==`object`&&u&&(o=j(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)&&tc(t,a,r,o),Ja=!1;var f=t.memoizedState;a.state=f,ro(t,r,a,i),no(),l=t.memoizedState,s||f!==l||Ja?(typeof d==`function`&&(Qs(t,n,d,r),l=t.memoizedState),(c=Ja||ec(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,Xa(e,t),o=t.memoizedProps,u=nc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=hi,typeof l==`object`&&l&&(c=j(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)&&tc(t,a,r,c),Ja=!1,f=t.memoizedState,a.state=f,ro(t,r,a,i),no();var p=t.memoizedState;o!==d||f!==p||Ja||e!==null&&e.dependencies!==null&&ca(e.dependencies)?(typeof s==`function`&&(Qs(t,n,s,r),p=t.memoizedState),(u=Ja||ec(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ca(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,Cc(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)):pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Rc(e,t,i),e}function Dc(e,t,n,r){return Zi(),t.flags|=256,pc(e,t,n,r),t.child}var Oc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kc(e){return{baseLanes:e,cachePool:ka()}}function Ac(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ou),e}function jc(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(vo.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(A){if(i?M(t):go(t),(e=Ui)?(e=vf(e,Gi),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 qi(t);return bf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(go(t),i=t.mode,c=Nc({mode:`hidden`,children:c},i),r=Si(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=kc(n),r.childLanes=Ac(e,s,n),t.memoizedState=Oc,vc(null,r)):(M(t),Mc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(M(t),t.flags&=-257,t=Pc(e,t,n)):t.memoizedState===null?(go(t),c=r.fallback,i=t.mode,r=Nc({mode:`visible`,children:r.children},i),c=Si(c,i,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=kc(n),r.childLanes=Ac(e,s,n),t.memoizedState=Oc,t=vc(null,r)):(go(t),t.child=e.child,t.flags|=128,t=null);else if(M(t),bf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,$i({value:r,source:null,stack:null}),t=Pc(e,t,n)}else if(P||sa(e,t,n,!1),s=(n&e.childLanes)!==0,P||s){if(s=Yl,s!==null&&(r=lt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,fi(e,r),Du(s,e,r),fc;yf(c)||zu(),t=Pc(e,t,n)}else yf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ui=Sf(c.nextSibling),Hi=t,A=!0,Wi=null,Gi=!1,e!==null&&Vi(t,e),t=Mc(t,r.children),t.flags|=4096);return t}return i?(go(t),c=r.fallback,i=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,i,n,null),c.flags|=2):c=yi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,vc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=kc(n):(i=c.cachePool,i===null?i=ka():(l=ha._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=Ac(e,s,n),t.memoizedState=Oc,vc(e.child,r)):(M(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 Mc(e,t){return t=Nc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Nc(e,t){return e=_i(22,e,null,t),e.lanes=0,e}function Pc(e,t,n){return Ka(t,e.child,null,n),e=Mc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Fc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),aa(e.return,t,n)}function Ic(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 Lc(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,pe(vo,o),pc(e,t,r,n),r=A?ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fc(e,n,t);else if(e.tag===19)Fc(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),Ic(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}Ic(t,!0,n,null,a,r);break;case`together`:Ic(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Rc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ru|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(sa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(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 zc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ca(e))):!0}function Bc(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),ra(t,ha,e.memoizedState.cache),Zi();break;case 27:case 5:be(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:ra(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?(M(t),e=Rc(e,t,n),e===null?null:e.sibling):jc(e,t,n):(M(t),t.flags|=128,null);M(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(sa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Lc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),pe(vo,vo.current),r)break;return null;case 22:return t.lanes=0,_c(e,t,n,t.pendingProps);case 24:ra(t,ha,e.memoizedState.cache)}return Rc(e,t,n)}function Vc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)P=!0;else{if(!zc(e,n)&&!(t.flags&128))return P=!1,Bc(e,t,n);P=!!(e.flags&131072)}else P=!1,A&&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=nc(e,r),t.tag=1,t=Ec(null,t,e,r,n)):(t.tag=0,t=wc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=mc(null,t,e,r,n);break a}else if(i===ee){t.tag=14,t=hc(null,t,e,r,n);break a}}throw t=ae(e)||e,Error(a(306,t,``))}}return t;case 0:return wc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=nc(r,t.pendingProps),Ec(e,t,r,i,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Xa(e,t),ro(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ra(t,ha,r),r!==o.cache&&oa(t,[ha],n,!0),no(),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=Dc(e,t,r,n);break a}else if(r!==i){i=Di(Error(a(424)),t),$i(i),t=Dc(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=Sf(e.firstChild),Hi=t,A=!0,Wi=null,Gi=!0,n=qa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Zi(),r===i){t=Rc(e,t,n);break a}pc(e,t,r,n)}t=t.child}return t;case 26:return Cc(e,t),e===null?(n=Uf(t.type,null,t.pendingProps,null))?t.memoizedState=n:A||(n=t.type,e=t.pendingProps,r=ef(ge.current).createElement(n),r[ht]=t,r[gt]=e,Jd(r,n,e),Ot(r),t.stateNode=r):t.memoizedState=Uf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&A&&(r=t.stateNode=Ef(t.type,t.pendingProps,ge.current),Hi=t,Gi=!0,i=Ui,ff(t.type)?(Cf=i,Ui=Sf(r.firstChild)):Ui=i),pc(e,t,t.pendingProps.children,n),Cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&A&&((i=r=Ui)&&(r=gf(r,t.type,t.pendingProps,Gi),r===null?i=!1:(t.stateNode=r,Hi=t,Ui=Sf(r.firstChild),Gi=!1,i=!0)),i||qi(t)),be(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,rf(i,o)?r=null:s!==null&&rf(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Mo(e,t,Fo,null,null,n),fp._currentValue=i),Cc(e,t),pc(e,t,r,n),t.child;case 6:return e===null&&A&&((e=n=Ui)&&(n=_f(n,t.pendingProps,Gi),n===null?e=!1:(t.stateNode=n,Hi=t,Ui=null,e=!0)),e||qi(t)),null;case 13:return jc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ka(t,null,r,n):pc(e,t,r,n),t.child;case 11:return mc(e,t,t.type,t.pendingProps,n);case 7:return pc(e,t,t.pendingProps,n),t.child;case 8:return pc(e,t,t.pendingProps.children,n),t.child;case 12:return pc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ra(t,t.type,r.value),pc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,la(t),i=j(i),r=r(i),t.flags|=1,pc(e,t,r,n),t.child;case 14:return hc(e,t,t.type,t.pendingProps,n);case 15:return gc(e,t,t.type,t.pendingProps,n);case 19:return Lc(e,t,n);case 31:return Sc(e,t,n);case 22:return _c(e,t,n,t.pendingProps);case 24:return la(t),r=j(ha),e===null?(i=Da(),i===null&&(i=Yl,o=ga(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ya(t),ra(t,ha,i)):((e.lanes&n)!==0&&(Xa(e,t),ro(t,null,null,n),no()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,ra(t,ha,r),r!==i.cache&&oa(t,[ha],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ra(t,ha,r))),pc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Hc(e){e.flags|=4}function Uc(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(Iu())e.flags|=8192;else throw La=Na,ja}else e.flags&=-16777217}function Wc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ip(t))if(Iu())e.flags|=8192;else throw La=Na,ja}function Gc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:rt(),e.lanes|=t,su|=t)}function Kc(e,t){if(!A)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 F(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 qc(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 F(t),null;case 1:return F(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ia(ha),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Xi(t)?Hc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Qi())),F(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Hc(t),o===null?(F(t),Uc(t,i,null,r,n)):(F(t),Wc(t,o))):o?o===e.memoizedState?(F(t),t.flags&=-16777217):(Hc(t),F(t),Wc(t,o)):(e=e.memoizedProps,e!==r&&Hc(t),F(t),Uc(t,i,e,r,n)),null;case 27:if(xe(t),n=ge.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Hc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return F(t),null}e=me.current,Xi(t)?Ji(t,e):(e=Ef(i,r,n),t.stateNode=e,Hc(t))}return F(t),null;case 5:if(xe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Hc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return F(t),null}if(o=me.current,Xi(t))Ji(t,o);else{var s=ef(ge.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);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(i,{is:r.is}):s.createElement(i)}}o[ht]=t,o[gt]=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(Jd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Hc(t)}}return F(t),Uc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Hc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=ge.current,Xi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Hi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Gd(e.nodeValue,n)),e||qi(t,!0)}else e=ef(e).createTextNode(r),e[ht]=t,t.stateNode=e}return F(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Xi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[ht]=t}else Zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;F(t),e=!1}else n=Qi(),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(a(558))}return F(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Xi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[ht]=t}else Zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;F(t),i=!1}else i=Qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)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,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Gc(t,t.updateQueue),F(t),null);case 4:return ye(),e===null&&Fd(t.stateNode.containerInfo),F(t),null;case 10:return ia(t.type),F(t),null;case 19:if(fe(vo),r=t.memoizedState,r===null)return F(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Kc(r,!1);else{if(nu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=yo(e),o!==null){for(t.flags|=128,Kc(r,!1),e=o.updateQueue,t.updateQueue=e,Gc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bi(n,e),n=n.sibling;return pe(vo,vo.current&1|2),A&&Li(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>pu&&(t.flags|=128,i=!0,Kc(r,!1),t.lanes=4194304)}else{if(!i)if(e=yo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Gc(t,e),Kc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!A)return F(t),null}else 2*Pe()-r.renderingStartTime>pu&&n!==536870912&&(t.flags|=128,i=!0,Kc(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?(F(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,n=vo.current,pe(vo,i?n&1|2:n&1),A&&Li(t,r.treeForkCount),e);case 22:case 23:return _o(t),uo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(F(t),t.subtreeFlags&6&&(t.flags|=8192)):F(t),n=t.updateQueue,n!==null&&Gc(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&&fe(Ea),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ia(ha),F(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Jc(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 ia(ha),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(_o(t),t.alternate===null)throw Error(a(340));Zi()}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(a(340));Zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(vo),null;case 4:return ye(),null;case 10:return ia(t.type),null;case 22:case 23:return _o(t),uo(),e!==null&&fe(Ea),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ia(ha),null;case 25:return null;default:return null}}function Yc(e,t){switch(Bi(t),t.tag){case 3:ia(ha),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&_o(t);break;case 13:_o(t);break;case 19:fe(vo);break;case 10:ia(t.type);break;case 22:case 23:_o(t),uo(),e!==null&&fe(Ea);break;case 24:ia(ha)}}function Xc(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){rd(t,t.return,e)}}function Zc(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){rd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){rd(t,t.return,e)}}function Qc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ao(t,n)}catch(t){rd(e,e.return,t)}}}function $c(e,t,n){n.props=nc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){rd(e,t,n)}}function el(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){rd(e,t,n)}}function tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){rd(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){rd(e,t,n)}else n.current=null}function nl(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){rd(e,e.return,t)}}function rl(e,t,n){try{var r=e.stateNode;Yd(r,e.type,n,t),r[gt]=t}catch(t){rd(e,e.return,t)}}function il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ff(e.type)||e.tag===4}function al(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||il(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&&ff(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 ol(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=ln));else if(r!==4&&(r===27&&ff(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(ol(e,t,n),e=e.sibling;e!==null;)ol(e,t,n),e=e.sibling}function sl(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&&ff(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(sl(e,t,n),e=e.sibling;e!==null;)sl(e,t,n),e=e.sibling}function I(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Jd(t,r,n),t[ht]=e,t[gt]=n}catch(t){rd(e,e.return,t)}}var cl=!1,ll=!1,ul=!1,dl=typeof WeakSet==`function`?WeakSet:Set,fl=null;function pl(e,t){if(e=e.containerInfo,Qd=xp,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 i=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||i!==0&&f.nodeType!==3||(c=s+i),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===i&&(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($d={focusedElem:e,selectionRange:n},xp=!1,fl=t;fl!==null;)if(t=fl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,fl=e;else for(;fl!==null;){switch(t=fl,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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=nc(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){rd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)hf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:hf(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(a(163))}if(e=t.sibling,e!==null){e.return=t.return,fl=e;break}fl=t.return}}function ml(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:kl(e,n),r&4&&Xc(5,n);break;case 1:if(kl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){rd(n,n.return,e)}else{var i=nc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){rd(n,n.return,e)}}r&64&&Qc(n),r&512&&el(n,n.return);break;case 3:if(kl(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{ao(e,t)}catch(e){rd(n,n.return,e)}}break;case 27:t===null&&r&4&&I(n);case 26:case 5:kl(e,n),t===null&&r&4&&nl(n),r&512&&el(n,n.return);break;case 12:kl(e,n);break;case 31:kl(e,n),r&4&&bl(e,n);break;case 13:kl(e,n),r&4&&xl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=sd.bind(null,n),xf(e,n))));break;case 22:if(r=n.memoizedState!==null||cl,!r){t=t!==null&&t.memoizedState!==null||ll,i=cl;var a=ll;cl=r,(ll=t)&&!a?jl(e,n,(n.subtreeFlags&8772)!=0):kl(e,n),cl=i,ll=a}break;case 30:break;default:kl(e,n)}}function hl(e){var t=e.alternate;t!==null&&(e.alternate=null,hl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ct(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 gl=null,_l=!1;function vl(e,t,n){for(n=n.child;n!==null;)yl(e,t,n),n=n.sibling}function yl(e,t,n){if(We&&typeof We.onCommitFiberUnmount==`function`)try{We.onCommitFiberUnmount(Ue,n)}catch{}switch(n.tag){case 26:ll||tl(n,t),vl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ll||tl(n,t);var r=gl,i=_l;ff(n.type)&&(gl=n.stateNode,_l=!1),vl(e,t,n),Df(n.stateNode),gl=r,_l=i;break;case 5:ll||tl(n,t);case 6:if(r=gl,i=_l,gl=null,vl(e,t,n),gl=r,_l=i,gl!==null)if(_l)try{(gl.nodeType===9?gl.body:gl.nodeName===`HTML`?gl.ownerDocument.body:gl).removeChild(n.stateNode)}catch(e){rd(n,t,e)}else try{gl.removeChild(n.stateNode)}catch(e){rd(n,t,e)}break;case 18:gl!==null&&(_l?(e=gl,pf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qp(e)):pf(gl,n.stateNode));break;case 4:r=gl,i=_l,gl=n.stateNode.containerInfo,_l=!0,vl(e,t,n),gl=r,_l=i;break;case 0:case 11:case 14:case 15:Zc(2,n,t),ll||Zc(4,n,t),vl(e,t,n);break;case 1:ll||(tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&$c(n,t,r)),vl(e,t,n);break;case 21:vl(e,t,n);break;case 22:ll=(r=ll)||n.memoizedState!==null,vl(e,t,n),ll=r;break;default:vl(e,t,n)}}function bl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qp(e)}catch(e){rd(t,t.return,e)}}}function xl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qp(e)}catch(e){rd(t,t.return,e)}}function Sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dl),t;default:throw Error(a(435,e.tag))}}function Cl(e,t){var n=Sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=cd.bind(null,e,t);t.then(r,r)}})}function wl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ff(c.type)){gl=c.stateNode,_l=!1;break a}break;case 5:gl=c.stateNode,_l=!1;break a;case 3:case 4:gl=c.stateNode.containerInfo,_l=!0;break a}c=c.return}if(gl===null)throw Error(a(160));yl(o,s,i),gl=null,_l=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)El(t,e),t=t.sibling}var Tl=null;function El(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wl(t,e),Dl(e),r&4&&(Zc(3,e,e.return),Xc(3,e),Zc(5,e,e.return));break;case 1:wl(t,e),Dl(e),r&512&&(ll||n===null||tl(n,n.return)),r&64&&cl&&(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 i=Tl;if(wl(t,e),Dl(e),r&512&&(ll||n===null||tl(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,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[St]||o[ht]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Jd(o,r,n),o[ht]=e,Ot(o),r=o;break a;case`link`:var s=tp(`link`,`href`,i).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=i.createElement(r),Jd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=tp(`meta`,`content`,i).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=i.createElement(r),Jd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[ht]=e,Ot(o),r=o}e.stateNode=r}else np(i,e.type,e.stateNode);else e.stateNode=Xf(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&rl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?np(i,e.type,e.stateNode):Xf(i,r,e.memoizedProps))}break;case 27:wl(t,e),Dl(e),r&512&&(ll||n===null||tl(n,n.return)),n!==null&&r&4&&rl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(wl(t,e),Dl(e),r&512&&(ll||n===null||tl(n,n.return)),e.flags&32){i=e.stateNode;try{en(i,``)}catch(t){rd(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,rl(e,i,n===null?i:n.memoizedProps)),r&1024&&(ul=!0);break;case 6:if(wl(t,e),Dl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){rd(e,e.return,t)}}break;case 3:if(ep=null,i=Tl,Tl=Af(t.containerInfo),wl(t,e),Tl=i,Dl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{qp(t.containerInfo)}catch(t){rd(e,e.return,t)}ul&&(ul=!1,Ol(e));break;case 4:r=Tl,Tl=Af(e.stateNode.containerInfo),wl(t,e),Dl(e),Tl=r;break;case 12:wl(t,e),Dl(e);break;case 31:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 13:wl(t,e),Dl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(du=Pe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=cl,d=ll;if(cl=u||i,ll=d||l,wl(t,e),ll=d,cl=u,Dl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||cl||ll||Al(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)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){rd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){rd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?mf(m,!0):mf(l.stateNode,!1)}catch(e){rd(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,Cl(e,n))));break;case 19:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 30:break;case 21:break;default:wl(t,e),Dl(e)}}function Dl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(il(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;sl(e,al(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(en(o,``),n.flags&=-33),sl(e,al(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;ol(e,al(e),s);break;default:throw Error(a(161))}}catch(t){rd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ol(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ol(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function kl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ml(e,t.alternate,t),t=t.sibling}function Al(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zc(4,t,t.return),Al(t);break;case 1:tl(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&$c(t,t.return,n),Al(t);break;case 27:Df(t.stateNode);case 26:case 5:tl(t,t.return),Al(t);break;case 22:t.memoizedState===null&&Al(t);break;case 30:Al(t);break;default:Al(t)}e=e.sibling}}function jl(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:jl(i,a,n),Xc(4,a);break;case 1:if(jl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){rd(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++)io(c[i],s)}catch(e){rd(r,r.return,e)}}n&&o&64&&Qc(a),el(a,a.return);break;case 27:I(a);case 26:case 5:jl(i,a,n),n&&r===null&&o&4&&nl(a),el(a,a.return);break;case 12:jl(i,a,n);break;case 31:jl(i,a,n),n&&o&4&&bl(i,a);break;case 13:jl(i,a,n),n&&o&4&&xl(i,a);break;case 22:a.memoizedState===null&&jl(i,a,n),el(a,a.return);break;case 30:break;default:jl(i,a,n)}t=t.sibling}}function Ml(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&&_a(n))}function Nl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_a(e))}function Pl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fl(e,t,n,r),t=t.sibling}function Fl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Pl(e,t,n,r),i&2048&&Xc(9,t);break;case 1:Pl(e,t,n,r);break;case 3:Pl(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&&_a(e)));break;case 12:if(i&2048){Pl(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){rd(t,t.return,e)}}else Pl(e,t,n,r);break;case 31:Pl(e,t,n,r);break;case 13:Pl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Pl(e,t,n,r):(a._visibility|=2,Il(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Pl(e,t,n,r):Ll(e,t),i&2048&&Ml(o,t);break;case 24:Pl(e,t,n,r),i&2048&&Nl(t.alternate,t);break;default:Pl(e,t,n,r)}}function Il(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:Il(a,o,s,c,i),Xc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Il(a,o,s,c,i)):u._visibility&2?Il(a,o,s,c,i):Ll(a,o),i&&l&2048&&Ml(o.alternate,o);break;case 24:Il(a,o,s,c,i),i&&l&2048&&Nl(o.alternate,o);break;default:Il(a,o,s,c,i)}t=t.sibling}}function Ll(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:Ll(n,r),i&2048&&Ml(r.alternate,r);break;case 24:Ll(n,r),i&2048&&Nl(r.alternate,r);break;default:Ll(n,r)}t=t.sibling}}var Rl=8192;function zl(e,t,n){if(e.subtreeFlags&Rl)for(e=e.child;e!==null;)Bl(e,t,n),e=e.sibling}function Bl(e,t,n){switch(e.tag){case 26:zl(e,t,n),e.flags&Rl&&e.memoizedState!==null&&ap(n,Tl,e.memoizedState,e.memoizedProps);break;case 5:zl(e,t,n);break;case 3:case 4:var r=Tl;Tl=Af(e.stateNode.containerInfo),zl(e,t,n),Tl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Rl,Rl=16777216,zl(e,t,n),Rl=r):zl(e,t,n));break;default:zl(e,t,n)}}function Vl(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 Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ul(e),e=e.sibling}function Ul(e){switch(e.tag){case 0:case 11:case 15:Hl(e),e.flags&2048&&Zc(9,e,e.return);break;case 3:Hl(e);break;case 12:Hl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wl(e)):Hl(e);break;default:Hl(e)}}function Wl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zc(8,t,t.return),Wl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wl(t));break;default:Wl(t)}e=e.sibling}}function Gl(e,t){for(;fl!==null;){var n=fl;switch(n.tag){case 0:case 11:case 15:Zc(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:_a(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fl=r;else a:for(n=e;fl!==null;){r=fl;var i=r.sibling,a=r.return;if(hl(r),r===n){fl=null;break a}if(i!==null){i.return=a,fl=i;break a}fl=a}}}var Kl={getCacheForType:function(e){var t=j(ha),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return j(ha).controller.signal}},ql=typeof WeakMap==`function`?WeakMap:Map,Jl=0,Yl=null,L=null,R=0,Xl=0,Zl=null,Ql=!1,$l=!1,eu=!1,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=0,cu=null,lu=null,uu=!1,du=0,fu=0,pu=1/0,mu=null,hu=null,gu=0,_u=null,vu=null,yu=0,bu=0,xu=null,Su=null,Cu=0,wu=null;function Tu(){return Jl&2&&R!==0?R&-R:k.T===null?ft():wd()}function Eu(){if(ou===0)if(!(R&536870912)||A){var e=Ze;Ze<<=1,!(Ze&3932160)&&(Ze=262144),ou=e}else ou=536870912;return e=fo.current,e!==null&&(e.flags|=32),ou}function Du(e,t,n){(e===Yl&&(Xl===2||Xl===9)||e.cancelPendingCommit!==null)&&(Pu(e,0),ju(e,R,ou,!1)),at(e,n),(!(Jl&2)||e!==Yl)&&(e===Yl&&(!(Jl&2)&&(iu|=n),nu===4&&ju(e,R,ou,!1)),gd(e))}function Ou(e,t,n){if(Jl&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||tt(e,t),i=r?Hu(e,t):Bu(e,t,!0),o=r;do{if(i===0){$l&&!r&&ju(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Au(n)){i=Bu(e,t,!1),o=!1;continue}if(i===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;i=cu;var l=c.current.memoizedState.isDehydrated;if(l&&(Pu(c,s).flags|=256),s=Bu(c,s,!1),s!==2){if(eu&&!l){c.errorRecoveryDisabledLanes|=o,iu|=o,i=4;break a}o=lu,lu=i,o!==null&&(lu===null?lu=o:lu.push.apply(lu,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Pu(e,0),ju(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:ju(r,t,ou,!Ql);break a;case 2:lu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=du+300-Pe(),10<i)){if(ju(r,t,ou,!Ql),et(r,0,!0)!==0)break a;yu=t,r.timeoutHandle=sf(ku.bind(null,r,n,lu,mu,uu,t,ou,iu,su,Ql,o,`Throttled`,-0,0),i);break a}ku(r,n,lu,mu,uu,t,ou,iu,su,Ql,o,null,-0,0)}}break}while(1);gd(e)}function ku(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:ln},Bl(t,a,d);var m=(a&62914560)===a?du-Pe():(a&4194048)===a?fu-Pe():0;if(m=sp(d,m),m!==null){yu=a,e.cancelPendingCommit=m(Yu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ju(e,a,o,!l);return}}Yu(e,t,a,n,r,i,o,s,c)}function Au(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 ju(e,t,n,r){t&=~au,t&=~iu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ke(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&st(e,n,t)}function Mu(){return Jl&6?!0:(_d(0,!1),!1)}function Nu(){if(L!==null){if(Xl===0)var e=L.return;else e=L,na=ta=null,Ro(e),Ba=null,Va=0,e=L;for(;e!==null;)Yc(e.alternate,e),e=e.return;L=null}}function Pu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),yu=0,Nu(),Yl=e,L=n=yi(e.current,null),R=t,Xl=0,Zl=null,Ql=!1,$l=tt(e,t),eu=!1,su=ou=au=iu=ru=nu=0,lu=cu=null,uu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ke(r),a=1<<i;t|=e[i],r&=~a}return tu=t,li(),n}function Fu(e,t){N=null,k.H=Js,t===Aa||t===Ma?(t=Ra(),Xl=3):t===ja?(t=Ra(),Xl=4):Xl=t===fc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Zl=t,L===null&&(nu=1,oc(e,Di(t,e.current)))}function Iu(){var e=fo.current;return e===null?!0:(R&4194048)===R?po===null:(R&62914560)===R||R&536870912?e===po:!1}function Lu(){var e=k.H;return k.H=Js,e===null?Js:e}function Ru(){var e=k.A;return k.A=Kl,e}function zu(){nu=4,Ql||(R&4194048)!==R&&fo.current!==null||($l=!0),!(ru&134217727)&&!(iu&134217727)||Yl===null||ju(Yl,R,ou,!1)}function Bu(e,t,n){var r=Jl;Jl|=2;var i=Lu(),a=Ru();(Yl!==e||R!==t)&&(mu=null,Pu(e,t)),t=!1;var o=nu;a:do try{if(Xl!==0&&L!==null){var s=L,c=Zl;switch(Xl){case 8:Nu(),o=6;break a;case 3:case 2:case 9:case 6:fo.current===null&&(t=!0);var l=Xl;if(Xl=0,Zl=null,Ku(e,s,c,l),n&&$l){o=0;break a}break;default:l=Xl,Xl=0,Zl=null,Ku(e,s,c,l)}}Vu(),o=nu;break}catch(t){Fu(e,t)}while(1);return t&&e.shellSuspendCounter++,na=ta=null,Jl=r,k.H=i,k.A=a,L===null&&(Yl=null,R=0,li()),o}function Vu(){for(;L!==null;)Wu(L)}function Hu(e,t){var n=Jl;Jl|=2;var r=Lu(),i=Ru();Yl!==e||R!==t?(mu=null,pu=Pe()+500,Pu(e,t)):$l=tt(e,t);a:do try{if(Xl!==0&&L!==null){t=L;var o=Zl;b:switch(Xl){case 1:Xl=0,Zl=null,Ku(e,t,o,1);break;case 2:case 9:if(Pa(o)){Xl=0,Zl=null,Gu(t);break}t=function(){Xl!==2&&Xl!==9||Yl!==e||(Xl=7),gd(e)},o.then(t,t);break a;case 3:Xl=7;break a;case 4:Xl=5;break a;case 7:Pa(o)?(Xl=0,Zl=null,Gu(t)):(Xl=0,Zl=null,Ku(e,t,o,7));break;case 5:var s=null;switch(L.tag){case 26:s=L.memoizedState;case 5:case 27:var c=L;if(s?ip(s):c.stateNode.complete){Xl=0,Zl=null;var l=c.sibling;if(l!==null)L=l;else{var u=c.return;u===null?L=null:(L=u,qu(u))}break b}}Xl=0,Zl=null,Ku(e,t,o,5);break;case 6:Xl=0,Zl=null,Ku(e,t,o,6);break;case 8:Nu(),nu=6;break a;default:throw Error(a(462))}}Uu();break}catch(t){Fu(e,t)}while(1);return na=ta=null,k.H=r,k.A=i,Jl=n,L===null?(Yl=null,R=0,li(),nu):0}function Uu(){for(;L!==null&&!Me();)Wu(L)}function Wu(e){var t=Vc(e.alternate,e,tu);e.memoizedProps=e.pendingProps,t===null?qu(e):L=t}function Gu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Tc(n,t,t.pendingProps,t.type,void 0,R);break;case 11:t=Tc(n,t,t.pendingProps,t.type.render,t.ref,R);break;case 5:Ro(t);default:Yc(n,t),t=L=bi(t,tu),t=Vc(n,t,tu)}e.memoizedProps=e.pendingProps,t===null?qu(e):L=t}function Ku(e,t,n,r){na=ta=null,Ro(t),Ba=null,Va=0;var i=t.return;try{if(dc(e,i,t,n,R)){nu=1,oc(e,Di(n,e.current)),L=null;return}}catch(t){if(i!==null)throw L=i,t;nu=1,oc(e,Di(n,e.current)),L=null;return}t.flags&32768?(A||r===1?e=!0:$l||R&536870912?e=!1:(Ql=e=!0,(r===2||r===9||r===3||r===6)&&(r=fo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ju(t,e)):qu(t)}function qu(e){var t=e;do{if(t.flags&32768){Ju(t,Ql);return}e=t.return;var n=qc(t.alternate,t,tu);if(n!==null){L=n;return}if(t=t.sibling,t!==null){L=t;return}L=t=e}while(t!==null);nu===0&&(nu=5)}function Ju(e,t){do{var n=Jc(e.alternate,e);if(n!==null){n.flags&=32767,L=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){L=e;return}L=e=n}while(e!==null);nu=6,L=null}function Yu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do ed();while(gu!==0);if(Jl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=ci,ot(e,n,o,s,c,l),e===Yl&&(L=Yl=null,R=0),vu=t,_u=e,yu=n,bu=o,xu=i,Su=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ld(Re,function(){return td(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,i=se.p,se.p=2,s=Jl,Jl|=4;try{pl(e,t,n)}finally{Jl=s,se.p=i,k.T=r}}gu=1,Xu(),Zu(),Qu()}}function Xu(){if(gu===1){gu=0;var e=_u,t=vu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=se.p;se.p=2;var i=Jl;Jl|=4;try{El(t,e);var a=$d,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}}xp=!!Qd,$d=Qd=null}finally{Jl=i,se.p=r,k.T=n}}e.current=t,gu=2}}function Zu(){if(gu===2){gu=0;var e=_u,t=vu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=se.p;se.p=2;var i=Jl;Jl|=4;try{ml(e,t.alternate,t)}finally{Jl=i,se.p=r,k.T=n}}gu=3}}function Qu(){if(gu===4||gu===3){gu=0,Ne();var e=_u,t=vu,n=yu,r=Su;t.subtreeFlags&10256||t.flags&10256?gu=5:(gu=0,vu=_u=null,$u(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(hu=null),dt(n),t=t.stateNode,We&&typeof We.onCommitFiberRoot==`function`)try{We.onCommitFiberRoot(Ue,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=se.p,se.p=2,k.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{k.T=t,se.p=i}}yu&3&&ed(),gd(e),i=e.pendingLanes,n&261930&&i&42?e===wu?Cu++:(Cu=0,wu=e):Cu=0,_d(0,!1)}}function $u(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_a(t)))}function ed(){return Xu(),Zu(),Qu(),td()}function td(){if(gu!==5)return!1;var e=_u,t=bu;bu=0;var n=dt(yu),r=k.T,i=se.p;try{se.p=32>n?32:n,k.T=null,n=xu,xu=null;var o=_u,s=yu;if(gu=0,vu=_u=null,yu=0,Jl&6)throw Error(a(331));var c=Jl;if(Jl|=4,Ul(o.current),Fl(o,o.current,s,n),Jl=c,_d(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{se.p=i,k.T=r,$u(e,t)}}function nd(e,t,n){t=Di(n,t),t=cc(e.stateNode,t,2),e=Qa(e,t,2),e!==null&&(at(e,2),gd(e))}function rd(e,t,n){if(e.tag===3)nd(e,e,n);else for(;t!==null;){if(t.tag===3){nd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(hu===null||!hu.has(r))){e=Di(n,e),n=lc(2),r=Qa(t,n,2),r!==null&&(uc(n,r,t,e),at(r,2),gd(r));break}}t=t.return}}function id(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ql;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)||(eu=!0,i.add(n),e=ad.bind(null,e,t,n),t.then(e,e))}function ad(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Yl===e&&(R&n)===n&&(nu===4||nu===3&&(R&62914560)===R&&300>Pe()-du?!(Jl&2)&&Pu(e,0):au|=n,su===R&&(su=0)),gd(e)}function od(e,t){t===0&&(t=rt()),e=fi(e,t),e!==null&&(at(e,t),gd(e))}function sd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),od(e,n)}function cd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),od(e,n)}function ld(e,t){return Ae(e,t)}var ud=null,dd=null,fd=!1,pd=!1,md=!1,hd=0;function gd(e){e!==dd&&e.next===null&&(dd===null?ud=dd=e:dd=dd.next=e),pd=!0,fd||(fd=!0,Cd())}function _d(e,t){if(!md&&pd){md=!0;do for(var n=!1,r=ud;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-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Sd(r,a))}else a=R,a=et(r,r===Yl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,Sd(r,a));r=r.next}while(n);md=!1}}function vd(){yd()}function yd(){pd=fd=!1;var e=0;hd!==0&&of()&&(e=hd);for(var t=Pe(),n=null,r=ud;r!==null;){var i=r.next,a=bd(r,t);a===0?(r.next=null,n===null?ud=i:n.next=i,i===null&&(dd=n)):(n=r,(e!==0||a&3)&&(pd=!0)),r=i}gu!==0&&gu!==5||_d(e,!1),hd!==0&&(hd=0)}function bd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ke(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=nt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Yl,n=R,n=et(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Xl===2||Xl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&je(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&je(r),dt(n)){case 2:case 8:n=Le;break;case 32:n=Re;break;case 268435456:n=Be;break;default:n=Re}return r=xd.bind(null,e),n=Ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&je(r),e.callbackPriority=2,e.callbackNode=null,2}function xd(e,t){if(gu!==0&&gu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ed()&&e.callbackNode!==n)return null;var r=R;return r=et(e,e===Yl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ou(e,r,t),bd(e,Pe()),e.callbackNode!=null&&e.callbackNode===n?xd.bind(null,e):null)}function Sd(e,t){if(ed())return null;Ou(e,t,!0)}function Cd(){uf(function(){Jl&6?Ae(Ie,vd):yd()})}function wd(){if(hd===0){var e=ba;e===0&&(e=Xe,Xe<<=1,!(Xe&261888)&&(Xe=256)),hd=e}return hd}function Td(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:cn(``+e)}function Ed(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 Dd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Td((i[gt]||null).action),o=r.submitter;o&&(t=(t=o[gt]||null)?Td(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new An(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(hd!==0){var e=o?Ed(i,o):new FormData(i);Ps(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Ed(i,o):new FormData(i),Ps(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Od=0;Od<ri.length;Od++){var kd=ri[Od];ii(kd.toLowerCase(),`on`+(kd[0].toUpperCase()+kd.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`),Mt(`onMouseEnter`,[`mouseout`,`mouseover`]),Mt(`onMouseLeave`,[`mouseout`,`mouseover`]),Mt(`onPointerEnter`,[`pointerout`,`pointerover`]),Mt(`onPointerLeave`,[`pointerout`,`pointerover`]),jt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),jt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),jt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),jt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),jt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),jt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ad=`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(` `),jd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ad));function Md(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 z(e,t){var n=t[vt];n===void 0&&(n=t[vt]=new Set);var r=e+`__bubble`;n.has(r)||(Id(t,e,2,!1),n.add(r))}function Nd(e,t,n){var r=0;t&&(r|=4),Id(n,e,r,t)}var Pd=`_reactListening`+Math.random().toString(36).slice(2);function Fd(e){if(!e[Pd]){e[Pd]=!0,kt.forEach(function(t){t!==`selectionchange`&&(jd.has(t)||Nd(t,!1,e),Nd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pd]||(t[Pd]=!0,Nd(`selectionchange`,!1,t))}}function Id(e,t,n,r){switch(Op(t)){case 2:var i=Sp;break;case 8:i=Cp;break;default:i=wp}n=i.bind(null,t,n,e),i=void 0,!yn||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 Ld(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=wt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}gn(function(){var r=a,i=dn(n),o=[];a:{var s=ni.get(e);if(s!==void 0){var l=An,u=e;switch(e){case`keypress`:if(Tn(n)===0)break a;case`keydown`:case`keyup`:l=Jn;break;case`focusin`:u=`focus`,l=zn;break;case`focusout`:u=`blur`,l=zn;break;case`beforeblur`:case`afterblur`:l=zn;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=Ln;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Rn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Xn;break;case Yr:case Xr:case Zr:l=Bn;break;case ti:l=Zn;break;case`scroll`:case`scrollend`:l=Mn;break;case`wheel`:l=Qn;break;case`copy`:case`cut`:case`paste`:l=Vn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Yn;break;case`toggle`:case`beforetoggle`:l=$n}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;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=_n(m,p),g!=null&&d.push(Rd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==un&&(u=n.relatedTarget||n.fromElement)&&(wt(u)||u[_t]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?wt(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Ln,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Yn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:Et(l),h=u==null?s:Et(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,wt(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=Bd,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&&Vd(o,s,l,d,!1),u!==null&&f!==null&&Vd(o,f,u,d,!0)}}a:{if(s=r?Et(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=yr;else if(pr(s))if(br)v=kr;else{v=Dr;var y=Er}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&an(r.elementType)&&(v=yr):v=Or;if(v&&=v(e,r)){mr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Xt(s,`number`,s.value)}switch(y=r?Et(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(o,n,i);break;case`selectionchange`:if(Rr)break;case`keydown`:case`keyup`:Ur(o,n,i)}var b;if(tr)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&&(ir&&n.locale!==`ko`&&(lr||x!==`onCompositionStart`?x===`onCompositionEnd`&&lr&&(b=wn()):(xn=i,Sn=`value`in xn?xn.value:xn.textContent,lr=!0)),y=zd(r,x),0<y.length&&(x=new Hn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=cr(n),b!==null&&(x.data=b)))),(b=rr?ur(e,n):dr(e,n))&&(x=zd(r,`onBeforeInput`),0<x.length&&(y=new Hn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),Dd(o,e,r,n,i)}Md(o,t)})}function Rd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zd(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=_n(e,n),i!=null&&r.unshift(Rd(e,i,a)),i=_n(e,t),i!=null&&r.push(Rd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Bd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vd(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=_n(n,a),l!=null&&o.unshift(Rd(n,l,c))):i||(l=_n(n,a),l!=null&&o.push(Rd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Hd=/\r\n?/g,Ud=/\u0000|\uFFFD/g;function Wd(e){return(typeof e==`string`?e:``+e).replace(Hd,`
|
|
10
|
+
`).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||en(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&en(e,``+r);break;case`className`:Rt(e,`class`,r);break;case`tabIndex`:Rt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Rt(e,n,r);break;case`style`:rn(e,r,o);break;case`data`:if(t!==`object`){Rt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Kd(e,t,`name`,i.name,i,null),Kd(e,t,`formEncType`,i.formEncType,i,null),Kd(e,t,`formMethod`,i.formMethod,i,null),Kd(e,t,`formTarget`,i.formTarget,i,null)):(Kd(e,t,`encType`,i.encType,i,null),Kd(e,t,`method`,i.method,i,null),Kd(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`onScroll`:r!=null&&z(`scroll`,e);break;case`onScrollEnd`:r!=null&&z(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(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=cn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`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`:z(`beforetoggle`,e),z(`toggle`,e),Lt(e,`popover`,r);break;case`xlinkActuate`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Lt(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=on.get(n)||n,Lt(e,n,r))}}function qd(e,t,n,r,i,o){switch(n){case`style`:rn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?en(e,r):(typeof r==`number`||typeof r==`bigint`)&&en(e,``+r);break;case`onScroll`:r!=null&&z(`scroll`,e);break;case`onScrollEnd`:r!=null&&z(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!At.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[gt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Lt(e,n,r)}}}function Jd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:z(`error`,e),z(`load`,e);var r=!1,i=!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`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,o,s,n,null)}}i&&Kd(e,t,`srcSet`,n.srcSet,n,null),r&&Kd(e,t,`src`,n.src,n,null);return;case`input`:z(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=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(a(137,t));break;default:Kd(e,t,r,d,n,null)}}Yt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in z(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Kd(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Zt(e,!!r,n,!0):Zt(e,!!r,t,!1);return;case`textarea`:for(s in z(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Kd(e,t,s,c,n,null)}$t(e,r,i,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:Kd(e,t,l,r,n,null)}return;case`dialog`:z(`beforetoggle`,e),z(`toggle`,e),z(`cancel`,e),z(`close`,e);break;case`iframe`:case`object`:z(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ad.length;r++)z(Ad[r],e);break;case`image`:z(`error`,e),z(`load`,e);break;case`details`:z(`toggle`,e);break;case`embed`:case`source`:case`link`:z(`error`,e),z(`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(a(137,t));default:Kd(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Kd(e,t,c,r,n,null))}function Yd(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 i=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)||Kd(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`:i=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(a(137,t));break;default:m!==f&&Kd(e,t,p,m,r,f)}}Jt(e,s,c,l,u,d,o,i);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)||Kd(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Kd(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Zt(e,!!n,n?[]:``,!1):Zt(e,!!n,t,!0)):Zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Kd(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Kd(e,t,s,i,r,o)}Qt(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:Kd(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:Kd(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)&&Kd(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(a(137,t));break;default:Kd(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&qd(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||qd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Kd(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||Kd(e,t,f,p,r,m)}function Xd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Zd(){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&&Xd(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&&Xd(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 Qd=null,$d=null;function ef(e){return e.nodeType===9?e:e.ownerDocument}function tf(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 nf(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 rf(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 af=null;function of(){var e=window.event;return e&&e.type===`popstate`?e===af?!1:(af=e,!0):(af=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,cf=typeof clearTimeout==`function`?clearTimeout:void 0,lf=typeof Promise==`function`?Promise:void 0,uf=typeof queueMicrotask==`function`?queueMicrotask:lf===void 0?sf:function(e){return lf.resolve(null).then(e).catch(df)};function df(e){setTimeout(function(){throw e})}function ff(e){return e===`head`}function pf(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),qp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Df(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Df(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[St]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Df(e.ownerDocument.body);n=i}while(n);qp(t)}function mf(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 hf(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`:hf(n),Ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function gf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[St])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Sf(e.nextSibling),e===null)break}return null}function _f(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Sf(e.nextSibling),e===null))return null;return e}function vf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Sf(e.nextSibling),e===null))return null;return e}function yf(e){return e.data===`$?`||e.data===`$~`}function bf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function xf(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 Sf(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 Cf=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Sf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Tf(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 Ef(e,t,n){switch(t=ef(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Df(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ct(e)}var Of=new Map,kf=new Set;function Af(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jf=se.d;se.d={f:Mf,r:Nf,D:If,C:Lf,L:Rf,m:zf,X:Vf,S:Bf,M:Hf};function Mf(){var e=jf.f(),t=Mu();return e||t}function Nf(e){var t=Tt(e);t!==null&&t.tag===5&&t.type===`form`?Is(t):jf.r(e)}var Pf=typeof document>`u`?null:document;function Ff(e,t,n){var r=Pf;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),kf.has(i)||(kf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Jd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function If(e){jf.D(e),Ff(`dns-prefetch`,e,null)}function Lf(e,t){jf.C(e,t),Ff(`preconnect`,e,t)}function Rf(e,t,n){jf.L(e,t,n);var r=Pf;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Wf(e);break;case`script`:a=Jf(e)}Of.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Of.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gf(a))||t===`script`&&r.querySelector(Yf(a))||(t=r.createElement(`link`),Jd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function zf(e,t){jf.m(e,t);var n=Pf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jf(e)}if(!Of.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Of.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Yf(a)))return}r=n.createElement(`link`),Jd(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function Bf(e,t,n){jf.S(e,t,n);var r=Pf;if(r&&e){var i=Dt(r).hoistableStyles,a=Wf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Of.get(a))&&Qf(e,n);var c=o=r.createElement(`link`);Ot(c),Jd(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,Zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vf(e,t){jf.X(e,t);var n=Pf;if(n&&e){var r=Dt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),Ot(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t){jf.M(e,t);var n=Pf;if(n&&e){var r=Dt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),Ot(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Uf(e,t,n,r){var i=(i=ge.current)?Af(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Wf(n.href),n=Dt(i).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=Wf(n.href);var o=Dt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Gf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Of.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},Of.set(e,n),o||qf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Jf(n),n=Dt(i).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(a(444,e))}}function Wf(e){return`href="`+qt(e)+`"`}function Gf(e){return`link[rel="stylesheet"][`+e+`]`}function Kf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function qf(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}),Jd(t,`link`,n),Ot(t),e.head.appendChild(t))}function Jf(e){return`[src="`+qt(e)+`"]`}function Yf(e){return`script[async]`+e}function Xf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,Ot(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ot(r),Jd(r,`style`,i),Zf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Wf(n.href);var o=e.querySelector(Gf(i));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Kf(n),(i=Of.get(i))&&Qf(r,i),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Jd(o,`link`,r),t.state.loading|=4,Zf(o,n.precedence,e),t.instance=o;case`script`:return o=Jf(n.src),(i=e.querySelector(Yf(o)))?(t.instance=i,Ot(i),i):(r=n,(i=Of.get(o))&&(r=h({},n),$f(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ot(i),Jd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zf(r,n.precedence,e));return t.instance}function Zf(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 Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $f(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ep=null;function tp(e,t,n){if(ep===null){var r=new Map,i=ep=new Map;i.set(n,r)}else i=ep,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[St]||a[ht]||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 np(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rp(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 ip(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ap(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=Wf(r.href),a=t.querySelector(Gf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=cp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Kf(r),(i=Of.get(i))&&Qf(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Jd(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=cp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var op=0;function sp(e,t){return e.stylesheets&&e.count===0&&up(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&up(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&op===0&&(op=62500*Zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&up(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>op?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function cp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)up(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lp=null;function up(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lp=new Map,t.forEach(dp,e),lp=null,cp.call(e))}function dp(e,t){if(!(t.state.loading&4)){var n=lp.get(e);if(n)var r=n.get(null);else{n=new Map,lp.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=cp.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 fp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function pp(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=it(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=it(0),this.hiddenUpdates=it(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 mp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new pp(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=ga(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ya(a),e}function hp(e){return e?(e=hi,e):hi}function gp(e,t,n,r,i,a){i=hp(i),r.context===null?r.context=i:r.pendingContext=i,r=Za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Qa(e,r,t),n!==null&&(Du(n,e,t),$a(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vp(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function yp(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&Du(t,e,67108864),vp(e,67108864)}}function bp(e){if(e.tag===13||e.tag===31){var t=Tu();t=ut(t);var n=fi(e,t);n!==null&&Du(n,e,t),vp(e,t)}}var xp=!0;function Sp(e,t,n,r){var i=k.T;k.T=null;var a=se.p;try{se.p=2,wp(e,t,n,r)}finally{se.p=a,k.T=i}}function Cp(e,t,n,r){var i=k.T;k.T=null;var a=se.p;try{se.p=8,wp(e,t,n,r)}finally{se.p=a,k.T=i}}function wp(e,t,n,r){if(xp){var i=Tp(r);if(i===null)Ld(e,t,r,Ep,n),Lp(e,r);else if(zp(i,e,t,n,r))r.stopPropagation();else if(Lp(e,r),t&4&&-1<Ip.indexOf(e)){for(;i!==null;){var a=Tt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$e(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ke(o);s.entanglements[1]|=c,o&=~c}gd(a),!(Jl&6)&&(pu=Pe()+500,_d(0,!1))}}break;case 31:case 13:s=fi(a,2),s!==null&&Du(s,a,2),Mu(),vp(a,2)}if(a=Tp(r),a===null&&Ld(e,t,r,Ep,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Tp(e){return e=dn(e),Dp(e)}var Ep=null;function Dp(e){if(Ep=null,e=wt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(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 Ep=e,null}function Op(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(Fe()){case Ie:return 2;case Le:return 8;case Re:case ze:return 32;case Be:return 268435456;default:return 32}default:return 32}}var kp=!1,Ap=null,jp=null,Mp=null,Np=new Map,Pp=new Map,Fp=[],Ip=`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 Lp(e,t){switch(e){case`focusin`:case`focusout`:Ap=null;break;case`dragenter`:case`dragleave`:jp=null;break;case`mouseover`:case`mouseout`:Mp=null;break;case`pointerover`:case`pointerout`:Np.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Pp.delete(t.pointerId)}}function Rp(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=Tt(t),t!==null&&yp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zp(e,t,n,r,i){switch(t){case`focusin`:return Ap=Rp(Ap,e,t,n,r,i),!0;case`dragenter`:return jp=Rp(jp,e,t,n,r,i),!0;case`mouseover`:return Mp=Rp(Mp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Np.set(a,Rp(Np.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Pp.set(a,Rp(Pp.get(a)||null,e,t,n,r,i)),!0}return!1}function Bp(e){var t=wt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,pt(e.priority,function(){bp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,pt(e.priority,function(){bp(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 Vp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);un=r,n.target.dispatchEvent(r),un=null}else return t=Tt(n),t!==null&&yp(t),e.blockedOn=n,!1;t.shift()}return!0}function Hp(e,t,n){Vp(e)&&n.delete(t)}function Up(){kp=!1,Ap!==null&&Vp(Ap)&&(Ap=null),jp!==null&&Vp(jp)&&(jp=null),Mp!==null&&Vp(Mp)&&(Mp=null),Np.forEach(Hp),Pp.forEach(Hp)}function Wp(e,t){e.blockedOn===t&&(e.blockedOn=null,kp||(kp=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Up)))}var Gp=null;function Kp(e){Gp!==e&&(Gp=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Gp===e&&(Gp=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(Dp(r||n)===null)continue;break}var a=Tt(n);a!==null&&(e.splice(t,3),t-=3,Ps(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qp(e){function t(t){return Wp(t,e)}Ap!==null&&Wp(Ap,e),jp!==null&&Wp(jp,e),Mp!==null&&Wp(Mp,e),Np.forEach(t),Pp.forEach(t);for(var n=0;n<Fp.length;n++){var r=Fp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fp.length&&(n=Fp[0],n.blockedOn===null);)Bp(n),n.blockedOn===null&&Fp.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[gt]||null;if(typeof a==`function`)o||Kp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Dp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kp(n)}}}function Jp(){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 Yp(e){this._internalRoot=e}Xp.prototype.render=Yp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;gp(n,Tu(),e,t,null,null)},Xp.prototype.unmount=Yp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gp(e.current,2,null,e,null,null),Mu(),t[_t]=null}};function Xp(e){this._internalRoot=e}Xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fp.length&&t!==0&&t<Fp[n].priority;n++);Fp.splice(n,0,e),n===0&&Bp(e)}};var Zp=r.version;if(Zp!==`19.2.8`)throw Error(a(527,Zp,`19.2.8`));se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Qp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$p.isDisabled&&$p.supportsFiber)try{Ue=$p.inject(Qp),We=$p}catch{}}t.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=rc,s=ic,c=ac;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=mp(e,1,!1,null,null,n,r,null,i,s,c,Jp),e[_t]=t.current,Fd(e),new Yp(t)}})),d=r(((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=u()})),f=t(e(),1),p=d(),m=`modulepreload`,h=function(e){return`/`+e},g={},_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=h(t,n),t=s(t),t in g)return;g[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:m,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},v=e=>{throw TypeError(e)},y=(e,t,n)=>t.has(e)||v(`Cannot `+n),b=(e,t,n)=>(y(e,t,`read from private field`),n?n.call(e):t.get(e)),x=(e,t,n)=>t.has(e)?v(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),S=(e,t,n,r)=>(y(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),C=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,w=/^[\\/]{2}/;function T(e,t){return t+e.replace(/\\/g,`/`)}var E=`popstate`;function ee(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function te(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=oe(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),ie(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:ae(t))}function r(e,t){O(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return k(t,n,r,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ne(){return Math.random().toString(36).substring(2,10)}function re(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ie(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?oe(t):t,state:n,key:t&&t.key||r||ne(),mask:i}}function ae({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function oe(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function k(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ee(e)?e:ie(h.location,e,t);n&&n(r,e),l=u()+1;let d=re(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ee(e)?e:ie(h.location,e,t);n&&n(r,e),l=u();let i=re(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return se(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(E,d),c=e,()=>{i.removeEventListener(E,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function se(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),D(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:ae(t);return i=i.replace(/ $/,`%20`),!n&&w.test(i)&&(i=r+i),new URL(i,r)}var ce,le=class{constructor(e){if(x(this,ce,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(b(this,ce).has(e))return b(this,ce).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){b(this,ce).set(e,t)}};ce=new WeakMap;var ue=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function de(e){return ue.has(e)}var fe=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function pe(e){return fe.has(e)}function me(e){return e.index===!0}function he(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(D(e.index!==!0||!e.children,`Cannot specify children on an index route`),D(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),me(e)){let n={...e,id:s};return r[s]=ge(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=ge(n,t(n)),e.children&&(n.children=he(e.children,t,o,r,i)),n}})}function ge(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function _e(e,t,n=`/`){return ve(e,t,n,!1)}function ve(e,t,n,r,i){let a=Re((typeof t==`string`?oe(t):t).pathname||`/`,n);if(a==null)return null;let o=i??be(e),s=null,c=Le(a);for(let e=0;s==null&&e<o.length;++e)s=Ne(o[e],c,r);return s}function ye(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function be(e){let t=xe(e);return Ce(t),t}function xe(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;D(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Je([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),xe(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:je(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Ie(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Se(e.path))a(e,t,!0,n)}),t}function Se(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Se(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Ce(e){e.sort((e,t)=>e.score===t.score?Me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var we=/^:[\w-]+$/,Te=3,Ee=2,De=1,Oe=10,ke=-2,Ae=e=>e===`*`;function je(e,t){let n=e.split(`/`),r=n.length;return n.some(Ae)&&(r+=ke),t&&(r+=Ee),n.filter(e=>!Ae(e)).reduce((e,t)=>e+(we.test(t)?Te:t===``?De:Oe),r)}function Me(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ne(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Fe(u,l,s.matcher,s.compiledParams):Pe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Je([a,d.pathname]),pathnameBase:Xe(Je([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Je([a,d.pathnameBase]))}return o}function Pe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ie(e.path,e.caseSensitive,e.end);return Fe(e,t,n,r)}function Fe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Ie(e,t=!1,n=!0){O(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Le(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Re(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ze({basename:e,pathname:t}){return t===`/`?e:Je([e,t])}var Be=e=>C.test(e);function Ve(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?oe(e):e,a;return n?(n=qe(n),a=n.startsWith(`/`)?He(n.substring(1),`/`):He(n,t)):a=t,{pathname:a,search:Ze(r),hash:Qe(i)}}function He(e,t){let n=Ye(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ue(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function We(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ge(e){let t=We(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ke(e,t,n,r=!1){let i;typeof e==`string`?i=oe(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),Ue(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),Ue(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),Ue(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ve(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var qe=e=>e.replace(/[\\/]{2,}/g,`/`),Je=e=>qe(e.join(`/`)),Ye=e=>e.replace(/\/+$/,``),Xe=e=>Ye(e).replace(/^\/*/,`/`),Ze=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Qe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,$e=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],et=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function tt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function nt(e){return Je(e.map(e=>e.route.path).filter(Boolean))||`/`}var rt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function it(e,t){let n=e;if(typeof n!=`string`||!C.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(rt)try{let e=new URL(window.location.href),r=w.test(n)?new URL(T(n,e.protocol)):new URL(n),a=Re(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var at=Symbol(`Uninstrumented`);function ot(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=ct(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=ct(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[at]??i,a=ct(n[e],t,(...e)=>ut(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[at]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[at]??e,r=ct(n.middleware,t,(...e)=>ut(e[0]));return r?(r[at]=t,r):e})),r}function st(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[at]??e.navigate,r=ct(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?ae(n):`.`,...dt(e,r??{})}});r&&(r[at]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[at]??e.fetch,r=ct(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...dt(e,i??{})}});r&&(r[at]=t,e.fetch=r)}return e}function ct(e,t,n){return e.length===0?null:async(...r)=>{let i=await lt(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function lt(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=lt(e,t,n,r-1),a=await o,D(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function ut(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:ft(t),params:{...r},pattern:i,context:pt(n)}}function dt(e,t){return{currentUrl:ae(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function ft(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function pt(e){if(ht(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var mt=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function ht(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===mt}var gt=[`POST`,`PUT`,`PATCH`,`DELETE`],_t=new Set(gt),vt=[`GET`,...gt],yt=new Set(vt),bt=new Set([301,302,303,307,308]),xt=new Set([307,308]),St={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ct={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},wt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Tt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Et=`remix-router-transitions`,Dt=Symbol(`ResetLoaderData`),Ot,kt,At,jt,Mt=class{constructor(e){x(this,Ot),x(this,kt),x(this,At),x(this,jt),S(this,Ot,e),S(this,kt,be(e))}get stableRoutes(){return b(this,Ot)}get activeRoutes(){return b(this,At)??b(this,Ot)}get branches(){return b(this,jt)??b(this,kt)}get hasHMRRoutes(){return b(this,At)!=null}setRoutes(e){S(this,Ot,e),S(this,kt,be(e))}setHmrRoutes(e){S(this,At,e),S(this,jt,be(e))}commitHmrRoutes(){b(this,At)&&(S(this,Ot,b(this,At)),S(this,kt,b(this,jt)),S(this,At,void 0),S(this,jt,void 0))}};Ot=new WeakMap,kt=new WeakMap,At=new WeakMap,jt=new WeakMap;function Nt(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;D(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Tt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...ot(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Mt(he(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Xt,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=ve(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Sn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=xn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&mt(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=mt(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>Rt(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=zt(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:St,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,ee=!1,te,ne=!1,re=new Map,ae=null,k=!1,ce=!1,ue=new Set,de=new Map,fe=0,pe=-1,me=new Map,ge=new Set,_e=new Map,be=new Map,xe=new Set,Se=new Map,Ce,we=null;function Te(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(Ce){Ce(),Ce=void 0;return}O(Se.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=ct({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{Ce=e});e.history.go(r*-1),at(i,{state:`blocked`,location:n,proceed(){at(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,wt),Oe({blockers:e})}}),E?.resolve(),E=null;return}return Me(t,n)}),n){Kn(t,re);let e=()=>qn(t,re);t.addEventListener(`pagehide`,e),ae=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||Me(`POP`,w.location,{initialHydration:!0}),C}function Ee(){d&&d(),ae&&ae(),f.clear(),te&&te.abort(),w.fetchers.forEach((e,t)=>Xe(w.fetchers,t)),w.blockers.forEach((e,t)=>it(t))}function De(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function Oe(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(xe.has(t)?n.push(t):r.push(t))}),xe.forEach(e=>{!w.fetchers.has(e)&&!de.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Xe(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function ke(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&Ln(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?vn(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,wt)));let l=k?!1:pt(t,n.matches||w.matches),u=ee===!0||w.navigation.formMethod!=null&&Ln(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),k||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`){let e=re.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:re.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(ne){let e=re.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),re.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}Oe({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:St,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,ee=!1,ne=!1,k=!1,ce=!1,E?.resolve(),E=null,we?.resolve(),we=null}async function Ae(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Jn();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=It(!1,Ft(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?oe(n.mask):{...w.location.mask,...n.mask}});let s=w.location,l=ie(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Ln(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=ct({currentLocation:s,nextLocation:l,historyAction:d});if(m){at(m,{state:`blocked`,location:l,proceed(){at(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),Ae(t,n)},reset(){let e=new Map(w.blockers);e.set(m,wt),Oe({blockers:e})}});return}await Me(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function je(){we||=Jn(),Ge(),Oe({revalidation:`loading`});let e=we.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(Me(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(Me(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:ne===!0}),e)}async function Me(t,n,r){te&&te.abort(),te=null,T=t,k=(r&&r.startUninterruptedRevalidation)===!0,ft(w.location,w.matches),ee=(r&&r.preventScrollReset)===!0,ne=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:ve(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!ce&&Tn(w.location,n)&&!(r&&r.submission&&Ln(r.submission.formMethod))){ke(n,{matches:a},{flushSync:o});return}let l=mt(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=lt(n.pathname);ke(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;te=new AbortController;let d=fn(e.history,n,te.signal,r&&r.submission),f=e.getContext?await e.getContext():new le,p;if(r&&r.pendingError)p=[bn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Ln(r.submission.formMethod)){let i=await Ne(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(An(t)&&tt(t.error)&&t.error.status===404){te=null,ke(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=Vn(n,a,t,r.submission),o=!1,l.active=!1,d=fn(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Pe(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(te=null,ke(n,{matches:h||a,...yn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Ne(t,n,i,l,u,d,f,p,m={}){if(Ge(),Oe({navigation:Hn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ht(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=xn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=bn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=lt(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=zn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Sn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Ue(t,n,nn(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(jn(h)){let n;return n=m&&m.replace!=null?m.replace:dn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await He(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(An(h)){let e=bn(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Pe(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||Vn(n,i,l,p),x=p||m||Bn(b),S=!k&&!g;if(d){if(S){let e=Fe(v);Oe({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ht(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=xn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=bn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=lt(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=Lt(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ce,ue,xe,_e,ge,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(pe=++fe,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=et(e);return ke(n,{matches:i,loaderData:{},errors:v&&An(v[1])?{[v[0]]:v[1].error}:null,...yn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Fe(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=Ie(E)),Oe(e,{flushSync:_})}E.forEach(e=>{Qe(e.key),e.controller&&de.set(e.key,e.controller)});let ee=()=>E.forEach(e=>Qe(e.key));te&&te.signal.addEventListener(`abort`,ee);let{loaderResults:D,fetcherResults:O}=await We(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};te&&te.signal.removeEventListener(`abort`,ee),E.forEach(e=>de.delete(e.key));let ne=Cn(D);if(ne)return await He(t,ne.result,!0,{replace:h}),{shortCircuited:!0};if(ne=Cn(O),ne)return ge.add(ne.key),await He(t,ne.result,!0,{replace:h}),{shortCircuited:!0};let re=new Map(w.fetchers),{loaderData:ie,errors:ae}=_n(w,i,D,v,E,O,re);g&&w.errors&&(ae={...w.errors,...ae});let oe=et(re),se=nt(pe,re),le=oe||se||E.length>0;return{matches:i,loaderData:ie,errors:ae,...le?{workingFetchers:re}:{}}}function Fe(e){if(e&&!An(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Ie(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Un(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Le(t,n,r,i){Qe(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=Ft(w.location,w.matches,c,r,n,i?.relative),u=ve(o,l,c,!1,s.branches),d=mt(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){qe(t,n,Sn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=It(!0,l,i);if(m){qe(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new le,g=(i&&i.preventScrollReset)===!0;if(p&&Ln(p.formMethod)){await ze(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}_e.set(t,{routeId:n,path:f}),await Ve(t,n,f,u,h,d.active,a,g,p)}async function ze(t,n,i,l,u,d,f,p,m,h){Ge(),_e.delete(t),Ke(t,Wn(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=fn(e.history,i,g.signal,m);if(d){let e=await ht(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){qe(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{qe(t,n,Sn(404,{pathname:i}),{flushSync:f});return}}let v=zn(l,i);if(!v.route.action&&!v.route.lazy){qe(t,n,Sn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}de.set(t,g);let y=fe,b=nn(a,o,_,i,l,v,r,u),x=await Ue(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){de.get(t)===g&&de.delete(t);return}if(xe.has(t)){if(jn(S)||An(S)){Ke(t,Gn(void 0));return}}else{if(jn(S))if(de.delete(t),pe>y){Ke(t,Gn(void 0));return}else return ge.add(t),Ke(t,Un(m)),He(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(An(S)){qe(t,n,S.error);return}}let C=w.navigation.location||w.location,E=fn(e.history,C,g.signal),ee=s.activeRoutes,O=w.navigation.state===`idle`?w.matches:ve(ee,w.navigation.location,c,!1,s.branches);D(O,`Didn't find any matches after fetcher action`);let ne=++fe;me.set(t,ne);let{dsMatches:re,revalidatingFetchers:ie}=Lt(E,u,a,o,e.history,w,O,m,C,r,!1,ce,ue,xe,_e,ge,ee,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),ae=Un(m,S.data),oe=new Map(w.fetchers);oe.set(t,ae),ie.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=oe.get(t),r=Un(void 0,n?n.data:void 0);oe.set(t,r),Qe(t),e.controller&&de.set(t,e.controller)}),Oe({fetchers:oe});let k=()=>ie.forEach(e=>Qe(e.key));g.signal.addEventListener(`abort`,k);let{loaderResults:se,fetcherResults:le}=await We(re,ie,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,k),me.delete(t),de.delete(t),ie.forEach(e=>de.delete(e.key));let he=w.fetchers.has(t),ye=e=>{if(!he)return e;let n=new Map(e.fetchers);return n.set(t,Gn(S.data)),{...e,fetchers:n}},be=Cn(se);if(be)return w=ye(w),He(E,be.result,!1,{preventScrollReset:p});if(be=Cn(le),be)return ge.add(be.key),w=ye(w),He(E,be.result,!1,{preventScrollReset:p});let Se=new Map(w.fetchers);he&&Se.set(t,Gn(S.data));let{loaderData:Ce,errors:we}=_n(w,O,se,void 0,ie,le,Se);nt(ne,Se),w.navigation.state===`loading`&&ne>pe?(D(T,`Expected pending action`),te&&te.abort(),ke(w.navigation.location,{matches:O,loaderData:Ce,errors:we,fetchers:Se})):(Oe({errors:we,loaderData:vn(w.loaderData,Ce,O,we),fetchers:Se}),ce=!1)}async function Ve(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Ke(t,Un(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=fn(e.history,i,m.signal);if(l){let e=await ht(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){qe(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{qe(t,n,Sn(404,{pathname:i}),{flushSync:u});return}}let g=zn(s,i);de.set(t,m);let _=fe,v=await Ue(h,i,nn(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(de.get(t)===m&&de.delete(t),!h.signal.aborted){if(xe.has(t)){Ke(t,Gn(void 0));return}if(jn(y))if(pe>_){Ke(t,Gn(void 0));return}else{ge.add(t),await He(h,y,!1,{preventScrollReset:d});return}if(An(y)){qe(t,n,y.error);return}Ke(t,Gn(y.data))}}async function He(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ce=!0);let d=i.response.headers.get(`Location`);D(d,`Expected a Location header on the redirect Response`),d=dn(d,new URL(r.url),c,e.history);let f=ie(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Be(d)){let n=se(t,d,!0);e=n.origin!==t.location.origin||Re(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}te=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=Bn(w.navigation));let _=o||s;xt.has(i.response.status)&&_&&Ln(_.formMethod)?await Me(p,f,{submission:{..._,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?ne:void 0}):await Me(p,f,{overrideNavigation:Vn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?ne:void 0})}async function Ue(e,t,n,r,i){let a,o={};try{a=await rn(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Ln(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(kn(r)){let i=r.result;o[t]={type:`redirect`,response:cn(i,e,t,n,c)}}else o[t]=await sn(r);return o}async function We(e,t,n,r,i){let a=Ue(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Ue(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:Sn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ge(){ce=!0,_e.forEach((e,t)=>{de.has(t)&&ue.add(t),Qe(t)})}function Ke(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),Oe({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function qe(e,t,n,r={}){let i=bn(w.matches,t),a=new Map(w.fetchers);Xe(a,e),Oe({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Je(e){return be.set(e,(be.get(e)||0)+1),xe.has(e)&&xe.delete(e),w.fetchers.get(e)||Ct}function Ye(e,t){Qe(e,t?.reason),Ke(e,Gn(null))}function Xe(e,t){let n=w.fetchers.get(t);de.has(t)&&!(n&&n.state===`loading`&&me.has(t))&&Qe(t),_e.delete(t),me.delete(t),ge.delete(t),xe.delete(t),ue.delete(t),e.delete(t)}function Ze(e){let t=(be.get(e)||0)-1;t<=0?(be.delete(e),xe.add(e)):be.set(e,t),Oe({fetchers:new Map(w.fetchers)})}function Qe(e,t){let n=de.get(e);n&&(n.abort(t),de.delete(e))}function $e(e,t){for(let n of e){let e=t.get(n);D(e,`Expected fetcher: ${n}`);let r=Gn(e.data);t.set(n,r)}}function et(e){let t=[],n=!1;for(let r of ge){let i=e.get(r);D(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ge.delete(r),t.push(r),n=!0)}return $e(t,e),n}function nt(e,t){let n=[];for(let[r,i]of me)if(i<e){let e=t.get(r);D(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Qe(r),me.delete(r),n.push(r))}return $e(n,t),n.length>0}function rt(e,t){let n=w.blockers.get(e)||wt;return Se.get(e)!==t&&Se.set(e,t),n}function it(e){w.blockers.delete(e),Se.delete(e)}function at(e,t){let n=w.blockers.get(e)||wt;D(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),Oe({blockers:r})}function ct({currentLocation:e,nextLocation:t,historyAction:n}){if(Se.size===0)return;Se.size>1&&O(!1,`A router only supports one blocker at a time`);let r=Array.from(Se.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function lt(e){let t=Sn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=xn(n);return{notFoundMatches:r,route:i,error:t}}function ut(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===St){_=!0;let e=pt(w.location,w.matches);e!=null&&Oe({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function dt(e,t){return h&&h(e,t.map(e=>ye(e,w.loaderData)))||e.key}function ft(e,t){if(m&&g){let n=dt(e,t);m[n]=g()}}function pt(e,t){if(m){let n=dt(e,t),r=m[n];if(typeof r==`number`)return r}return null}function mt(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:ve(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:ve(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ht(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Ut(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=ve(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=ve(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&>(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=ve(s.activeRoutes,n,c,!0,u),!f||gt(l,f))return{type:`success`,matches:null};l=f}}function gt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function _t(e){o={},s.setHmrRoutes(he(e,a,void 0,o))}function vt(e,t,n=!1){Ut(e,t,s,o,a,n),s.hasHMRRoutes||Oe({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:Te,subscribe:De,enableScrollRestoration:ut,navigate:Ae,fetch:Le,revalidate:je,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Je,resetFetcher:Ye,deleteFetcher:Ze,dispose:Ee,getBlocker:rt,deleteBlocker:it,patchRoutes:vt,_internalFetchControllers:de,_internalSetRoutes:_t,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){Oe(e)}},e.instrumentations&&(C=st(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Pt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Ft(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Ke(r||`.`,Ge(o),Re(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Rn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=ze({basename:n,pathname:c.pathname})),ae(c)}function It(e,t,n){if(!n||!Pt(n))return{path:t};if(n.formMethod&&!In(n.formMethod))return{path:t,error:Sn(405,{method:n.formMethod})};let r=()=>({path:t,error:Sn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=wn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Ln(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
11
|
+
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Ln(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}D(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=mn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=mn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=hn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=hn(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Ln(c.formMethod))return{path:t,submission:c};let l=oe(t);return e&&l.search&&Rn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:ae(l),submission:c}}function Lt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?An(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&An(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,ee=E&&E>=400,te={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},D=nt(o),O=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!Rt(s))f=!1;else if(u){let{shouldLoad:e}=zt(s,a.loaderData,a.errors);f=e}else Bt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return tn(n,r,e,c,D,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:ee?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?Vt(a.matches[o],i)&&(p=!0):p=!0;let m={...te,defaultShouldRevalidate:p};return tn(n,r,e,c,D,i,l,t,Ht(i,m),m,x)}),ne=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=ve(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;ne.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=zn(b,e.path),C=new AbortController,w=fn(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=nn(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=nn(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:ee?!1:d;let a={...te,defaultShouldRevalidate:i};Ht(S,a)&&(T=nn(n,r,w,e.path,b,S,l,t,a))}T&&ne.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:O,revalidatingFetchers:ne}}function Rt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function zt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Rt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Bt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Vt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Ht(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Ut(e,t,n,r,i,a){let o;if(e){let t=r[e];D(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Wt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=he(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=he([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Wt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Wt(e,t)))??!1:!1}var Gt=new WeakMap,Kt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(D(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Gt.get(i);o||(o={},Gt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=de(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)O(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)O(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},qt=new WeakMap;function Jt(e,t,n,r,i){let a=n[e.id];if(D(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=qt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{D(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=pe(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?O(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?O(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return qt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Kt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Yt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Xt(e){return e.matches.some(e=>e.route.middleware)?Zt(e,()=>Yt(e)):Yt(e)}function Zt(e,t){return Qt(e,t,e=>{if(Fn(e))throw e;return e},Dn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=bn(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Qt(e,t,n,r,i){let{matches:a,...o}=e;return await $t(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function $t(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await $t(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function en(e,t,n,r,i){let a=Kt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Jt(r.route,Ln(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function tn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=en(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Ht(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Ht(a,{...l,defaultShouldRevalidate:e}):Ht(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Ln(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Ln(n.method)||!p)?an({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function nn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?tn(e,t,n,r,nt(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:en(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function rn(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:pn(t,n),pattern:nt(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Zt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function an({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Ln(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:pn(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw Sn(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw Sn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function on(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function sn(e){let{result:t,type:n}=e;if(Nn(t)){let e;try{e=await on(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new et(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Mn(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:En(t),statusCode:tt(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:tt(t)?t.status:void 0}:Mn(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function cn(e,t,n,r,i){let a=e.headers.get(`Location`);if(D(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Be(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Ft(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var ln=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function un(e){try{return ln.includes(new URL(e).protocol)}catch{return!1}}function dn(e,t,n,r){if(Be(e)){let r=e,i=w.test(r)?new URL(T(r,t.protocol)):new URL(r);if(un(i.toString()))throw Error(`Invalid redirect location`);let a=Re(i.pathname,n)!=null;if(i.origin===t.origin&&a)return qe(i.pathname)+i.search+i.hash}try{if(un(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function fn(e,t,n,r){let i=e.createURL(wn(t)).toString(),a={signal:n};if(r&&Ln(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=mn(r.formData):a.body=r.formData}return new Request(i,a)}function pn(e,t){let n=new URL(e.url),r=typeof t==`string`?oe(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function mn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function hn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function gn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&An(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(D(!jn(f),`Cannot handle redirect results in processLoaderData`),An(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=bn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Dt),c||(c=!0,s=tt(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function _n(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=gn(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(D(s,`Did not find corresponding fetcher result`),An(s)){let t=bn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(jn(s))D(!1,`Unhandled fetcher revalidation redirect`);else{let e=Gn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function vn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Dt).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function yn(e){return e?An(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function bn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function xn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Sn(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new et(e||500,o,Error(s),!0)}function Cn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(jn(r))return{key:n,result:r}}}function wn(e){return ae({...typeof e==`string`?oe(e):e,hash:``})}function Tn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function En(e){return new et(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Dn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&On(t))}function On(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function kn(e){return Nn(e.result)&&bt.has(e.result.status)}function An(e){return e.type===`error`}function jn(e){return(e&&e.type)===`redirect`}function Mn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Nn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Pn(e){return bt.has(e)}function Fn(e){return Nn(e)&&Pn(e.status)&&e.headers.has(`Location`)}function In(e){return yt.has(e.toUpperCase())}function Ln(e){return _t.has(e.toUpperCase())}function Rn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function zn(e,t){let n=typeof t==`string`?oe(t).search:t.search;if(e[e.length-1].route.index&&Rn(n||``))return e[e.length-1];let r=We(e);return r[r.length-1]}function Bn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Vn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Hn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Un(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Wn(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Gn(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Kn(e,t){try{let n=e.sessionStorage.getItem(Et);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function qn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Et,JSON.stringify(n))}catch(e){O(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Jn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Yn=f.createContext(null);Yn.displayName=`DataRouter`;var Xn=f.createContext(null);Xn.displayName=`DataRouterState`;var Zn=f.createContext(!1);function Qn(){return f.useContext(Zn)}var $n=f.createContext({isTransitioning:!1});$n.displayName=`ViewTransition`;var er=f.createContext(new Map);er.displayName=`Fetchers`;var tr=f.createContext(null);tr.displayName=`Await`;var nr=f.createContext(null);nr.displayName=`Navigation`;var rr=f.createContext(null);rr.displayName=`Location`;var ir=f.createContext({outlet:null,matches:[],isDataRoute:!1});ir.displayName=`Route`;var ar=f.createContext(null);ar.displayName=`RouteError`;var or=`REACT_ROUTER_ERROR`,sr=`REDIRECT`,cr=`ROUTE_ERROR_RESPONSE`;function lr(e){if(e.startsWith(`${or}:${sr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ur(e){if(e.startsWith(`${or}:${cr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new et(t.status,t.statusText,t.data)}catch{}}function dr(e,{relative:t}={}){D(fr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=f.useContext(nr),{hash:i,pathname:a,search:o}=xr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Je([n,a])),r.createHref({pathname:s,search:o,hash:i})}function fr(){return f.useContext(rr)!=null}function pr(){return D(fr(),`useLocation() may be used only in the context of a <Router> component.`),f.useContext(rr).location}var mr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function hr(e){f.useContext(nr).static||f.useLayoutEffect(e)}function gr(){let{isDataRoute:e}=f.useContext(ir);return e?zr():_r()}function _r(){D(fr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=f.useContext(Yn),{basename:t,navigator:n}=f.useContext(nr),{matches:r}=f.useContext(ir),{pathname:i}=pr(),a=JSON.stringify(Ge(r)),o=f.useRef(!1);return hr(()=>{o.current=!0}),f.useCallback((r,s={})=>{if(O(o.current,mr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Ke(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Je([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var vr=f.createContext(null);function yr(e){let t=f.useContext(ir).outlet;return f.useMemo(()=>t&&f.createElement(vr.Provider,{value:e},t),[t,e])}function br(){let{matches:e}=f.useContext(ir);return e[e.length-1]?.params??{}}function xr(e,{relative:t}={}){let{matches:n}=f.useContext(ir),{pathname:r}=pr(),i=JSON.stringify(Ge(n));return f.useMemo(()=>Ke(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Sr(e,t,n){D(fr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=f.useContext(nr),{matches:i}=f.useContext(ir),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Vr(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
12
|
+
|
|
13
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=pr(),d;if(t){let e=typeof t==`string`?oe(t):t;D(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let p=d.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):_e(e,{pathname:m});O(l||h!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=kr(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Je([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Je([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?f.createElement(rr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},g):g}function Cr(){let e=Rr(),t=tt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=f.createElement(f.Fragment,null,f.createElement(`p`,null,`💿 Hey developer 👋`),f.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,f.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,f.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),f.createElement(f.Fragment,null,f.createElement(`h2`,null,`Unexpected Application Error!`),f.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?f.createElement(`pre`,{style:i},n):null,o)}var wr=f.createElement(Cr,null),Tr=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ur(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:f.createElement(ir.Provider,{value:this.props.routeContext},f.createElement(ar.Provider,{value:e,children:this.props.component}));return this.context?f.createElement(Dr,{error:e},t):t}};Tr.contextType=Zn;var Er=new WeakMap;function Dr({children:e,error:t}){let{basename:n}=f.useContext(nr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=lr(t.digest);if(e){let r=Er.get(t);if(r)throw r;let i=it(e.location,n),a=i.absoluteURL||i.to;if(un(a))throw Error(`Invalid redirect location`);if(rt&&!Er.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Er.set(t,n),n}return f.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Or({routeContext:e,match:t,children:n}){let r=f.useContext(Yn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(ir.Provider,{value:e},n)}function kr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);D(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:nt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,p=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||wr,o&&(s<0&&c===0?(Vr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):s===c&&(d=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?p:d?m:n.route.Component?f.createElement(n.route.Component,null):n.route.element?n.route.element:e,f.createElement(Or,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?f.createElement(Tr,{location:r.location,revalidation:r.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function Ar(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jr(e){let t=f.useContext(Yn);return D(t,Ar(e)),t}function Mr(e){let t=f.useContext(Xn);return D(t,Ar(e)),t}function Nr(e){let t=f.useContext(ir);return D(t,Ar(e)),t}function Pr(e){let t=Nr(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Fr(){return Pr(`useRouteId`)}function Ir(){let e=Mr(`useNavigation`);return f.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Lr(){let{matches:e,loaderData:t}=Mr(`useMatches`);return f.useMemo(()=>e.map(e=>ye(e,t)),[e,t])}function Rr(){let e=f.useContext(ar),t=Mr(`useRouteError`),n=Pr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function zr(){let{router:e}=jr(`useNavigate`),t=Pr(`useNavigate`),n=f.useRef(!1);return hr(()=>{n.current=!0}),f.useCallback(async(r,i={})=>{O(n.current,mr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Br={};function Vr(e,t,n){!t&&!Br[e]&&(Br[e]=!0,O(!1,n))}var Hr={};function Ur(e,t){!e&&!Hr[t]&&(Hr[t]=!0,console.warn(t))}var Wr=f.useOptimistic,Gr=()=>void 0;function Kr(e){return Wr?Wr(e):[e,Gr]}function qr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&O(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:f.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&O(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&O(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Jr=[`HydrateFallback`,`hydrateFallbackElement`],Yr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Xr({router:e,flushSync:t,onError:n,useTransitions:r}){r=Qn()||r;let[i,a]=f.useState(e.state),[o,s]=Kr(i),[c,l]=f.useState(),[u,d]=f.useState({isTransitioning:!1}),[p,m]=f.useState(),[h,g]=f.useState(),[_,v]=f.useState(),y=f.useRef(new Map),b=f.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:_})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:nt(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),Ur(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Ur(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&u?t(()=>a(i)):r===!1?a(i):f.startTransition(()=>{r===!0&&s(e=>Zr(e,i)),a(i)});return}if(t&&u){t(()=>{h&&(p?.resolve(),h.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,r,s,n]);f.useLayoutEffect(()=>e.subscribe(b),[e,b]),f.useEffect(()=>{u.isTransitioning&&!u.flushSync&&m(new Yr)},[u]),f.useEffect(()=>{if(p&&c&&e.window){let t=c,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):f.startTransition(()=>{r===!0&&s(e=>Zr(e,t)),a(t)}),await n});i.finished.finally(()=>{m(void 0),g(void 0),l(void 0),d({isTransitioning:!1})}),g(i)}},[c,p,e.window,r,s]),f.useEffect(()=>{p&&c&&o.location.key===c.location.key&&p.resolve()},[p,h,o.location,c]),f.useEffect(()=>{!u.isTransitioning&&_&&(l(_.state),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[u.isTransitioning,_]);let x=f.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=f.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return f.createElement(f.Fragment,null,f.createElement(Yn.Provider,{value:C},f.createElement(Xn.Provider,{value:o},f.createElement(er.Provider,{value:y.current},f.createElement($n.Provider,{value:u},f.createElement(ti,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},f.createElement(Qr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Zr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Qr=f.memo($r);function $r({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Sr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function ei({to:e,replace:t,state:n,relative:r}){D(fr(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=f.useContext(nr);O(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=f.useContext(ir),{pathname:o}=pr(),s=gr(),c=Ke(e,Ge(a),o,r===`path`),l=JSON.stringify(c);return f.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function ti({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){D(!fr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=f.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=oe(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:p=null,key:m=`default`,mask:h}=n,g=f.useMemo(()=>{let e=Re(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:p,key:m,mask:h},navigationType:r}},[s,l,u,d,p,m,r,h]);return O(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:f.createElement(nr.Provider,{value:c},f.createElement(rr.Provider,{children:t,value:g}))}f.Component;var ni=`get`,ri=`application/x-www-form-urlencoded`;function ii(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ai(e){return ii(e)&&e.tagName.toLowerCase()===`button`}function oi(e){return ii(e)&&e.tagName.toLowerCase()===`form`}function si(e){return ii(e)&&e.tagName.toLowerCase()===`input`}function ci(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function li(e,t){return e.button===0&&(!t||t===`_self`)&&!ci(e)}var ui=null;function di(){if(ui===null)try{new FormData(document.createElement(`form`),0),ui=!1}catch{ui=!0}return ui}var fi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function pi(e){return e!=null&&!fi.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ri}"`),null):e}function mi(e,t){let n,r,i,a,o;if(oi(e)){let o=e.getAttribute(`action`);r=o?Re(o,t):null,n=e.getAttribute(`method`)||ni,i=pi(e.getAttribute(`enctype`))||ri,a=new FormData(e)}else if(ai(e)||si(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Re(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||ni,i=pi(e.getAttribute(`formenctype`))||pi(o.getAttribute(`enctype`))||ri,a=new FormData(o,e),!di()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(ii(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=ni,r=null,i=ri,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var hi={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},gi=/[&><\u2028\u2029]/g;function _i(e){return e.replace(gi,e=>hi[e])}function vi(e,t){if(e===!1||e==null)throw Error(t)}function yi(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Re(i.pathname,t)===`/`?i.pathname=`${Ye(t)}/_root.${r}`:i.pathname=`${Ye(i.pathname)}.${r}`,i}async function bi(e,t){if(e.id in t)return t[e.id];try{let n=await _(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xi(e){return e!=null&&typeof e.page==`string`}function Si(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ci(e,t,n){return Oi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await bi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Si).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function wi(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ti(e,t,{includeHydrateFallback:n}={}){return Ei(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ei(e){return[...new Set(e)]}function Di(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Oi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!xi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Di(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ki(){let e=f.useContext(Yn);return vi(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Ai(){let e=f.useContext(Xn);return vi(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ji=f.createContext(void 0);ji.displayName=`FrameworkContext`;function Mi(){let e=f.useContext(ji);return vi(e,`You must render this element inside a <HydratedRouter> element`),e}function Ni(e,t){let n=f.useContext(ji),[r,i]=f.useState(!1),[a,o]=f.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,p=f.useRef(null);f.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),f.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Pi(s,m),onBlur:Pi(c,h),onMouseEnter:Pi(l,m),onMouseLeave:Pi(u,h),onTouchStart:Pi(d,m)}]:[a,p,{}]:[!1,p,{}]}function Pi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Fi({page:e,...t}){let n=Qn(),{nonce:r}=Mi(),{router:i}=ki(),a=f.useMemo(()=>_e(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?f.createElement(Li,{page:e,matches:a,...t}):f.createElement(Ri,{page:e,matches:a,...t})):null}function Ii(e){let{manifest:t,routeModules:n}=Mi(),[r,i]=f.useState([]);return f.useEffect(()=>{let r=!1;return Ci(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Li({page:e,matches:t,...n}){let r=pr(),{future:i}=Mi(),{basename:a}=ki(),o=f.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=yi(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return f.createElement(f.Fragment,null,o.map(e=>f.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ri({page:e,matches:t,...n}){let r=pr(),{future:i,manifest:a,routeModules:o}=Mi(),{basename:s}=ki(),{loaderData:c,matches:l}=Ai(),u=f.useMemo(()=>wi(e,t,l,a,r,`data`),[e,t,l,a,r]),d=f.useMemo(()=>wi(e,t,l,a,r,`assets`),[e,t,l,a,r]),p=f.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=yi(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),m=f.useMemo(()=>Ti(d,a),[d,a]),h=Ii(d);return f.createElement(f.Fragment,null,p.map(e=>f.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>f.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>f.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function zi(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}f.Component;var Bi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Bi&&(window.__reactRouterVersion=`7.18.2`)}catch{}function Vi(e,t){return Nt({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:te({window:t?.window}),hydrationData:t?.hydrationData||Hi(),routes:e,mapRouteProperties:qr,hydrationRouteProperties:Jr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Hi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Ui(e.errors)}),e}function Ui(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new et(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&$e.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function A({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=f.useState({action:n.action,location:n.location}),o=f.useCallback(e=>{r===!1?a(e):f.startTransition(()=>a(e))},[r]);return f.useLayoutEffect(()=>n.listen(o),[n,o]),f.createElement(ti,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}A.displayName=`unstable_HistoryRouter`;var Wi=f.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=f.useContext(nr),y=typeof l==`string`&&C.test(l),b=it(l,g);l=b.to;let x=dr(l,{relative:r}),S=pr(),w=null;if(o){let e=Ke(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:Je([g,e.pathname])),w=_.createHref(e)}let[T,E,ee]=Ni(n,m),te=Zi(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:p,useTransitions:v});function D(t){e&&e(t),t.defaultPrevented||te(t)}let O=!(b.isExternal||i),ne=f.createElement(`a`,{...m,...ee,href:(O?w:void 0)||b.absoluteURL||x,onClick:O?D:e,ref:zi(h,E),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return T&&!y?f.createElement(f.Fragment,null,ne,f.createElement(Fi,{page:x})):ne});Wi.displayName=`Link`;var Gi=f.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=xr(a,{relative:c.relative}),d=pr(),p=f.useContext(Xn),{navigator:m,basename:h}=f.useContext(nr),g=p!=null&&sa(u)&&o===!0,_=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=Re(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return f.createElement(Wi,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Gi.displayName=`NavLink`;var Ki=f.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=ni,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=f.useContext(nr),_=ea(),v=ta(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&C.test(s);return f.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:p});g&&n!==!1?f.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Ki.displayName=`Form`;function qi({getKey:e,storageKey:t,...n}){let r=f.useContext(ji),{basename:i}=f.useContext(nr),a=pr(),o=Lr();aa({getKey:e,storageKey:t});let s=f.useMemo(()=>{if(!r||!e)return null;let t=ia(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),f.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${_i(JSON.stringify(t||na))}, ${_i(JSON.stringify(s))})`}})}qi.displayName=`ScrollRestoration`;function Ji(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yi(e){let t=f.useContext(Yn);return D(t,Ji(e)),t}function Xi(e){let t=f.useContext(Xn);return D(t,Ji(e)),t}function Zi(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=gr(),d=pr(),p=xr(e,{relative:o});return f.useCallback(m=>{if(li(m,t)){m.preventDefault();let t=n===void 0?ae(d)===ae(p):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?f.startTransition(()=>h()):h()}},[d,u,p,n,r,i,t,e,a,o,s,c,l])}var Qi=0,$i=()=>`__${String(++Qi)}__`;function ea(){let{router:e}=Yi(`useSubmit`),{basename:t}=f.useContext(nr),n=Fr(),r=e.fetch,i=e.navigate;return f.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=mi(e,t);a.navigate===!1?await r(a.fetcherKey||$i(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function ta(e,{relative:t}={}){let{basename:n}=f.useContext(nr),r=f.useContext(ir);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...xr(e||`.`,{relative:t})},o=pr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Je([n,a.pathname])),ae(a)}var na=`react-router-scroll-positions`,ra={};function ia(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Re(e.pathname,n)||e.pathname},t)),i??=e.key,i}function aa({getKey:e,storageKey:t}={}){let{router:n}=Yi(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Xi(`useScrollRestoration`),{basename:a}=f.useContext(nr),o=pr(),s=Lr(),c=Ir();f.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),oa(f.useCallback(()=>{if(c.state===`idle`){let t=ia(o,s,a,e);ra[t]=window.scrollY}try{sessionStorage.setItem(t||na,JSON.stringify(ra))}catch(e){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(f.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||na);e&&(ra=JSON.parse(e))}catch{}},[t]),f.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(ra,()=>window.scrollY,e?(t,n)=>ia(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),f.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{O(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function oa(e,t){let{capture:n}=t||{};f.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function sa(e,{relative:t}={}){let n=f.useContext($n);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Yi(`useViewTransitionState`),i=xr(e,{relative:t});if(!n.isTransitioning)return!1;let a=Re(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Re(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Pe(i.pathname,o)!=null||Pe(i.pathname,a)!=null}var ca=t(l(),1);function la(e){return f.createElement(Xr,{flushSync:ca.flushSync,...e})}var j=e=>typeof e==`string`,ua=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},da=e=>e==null?``:``+e,fa=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},pa=/###/g,ma=e=>e&&e.indexOf(`###`)>-1?e.replace(pa,`.`):e,ha=e=>!e||j(e),ga=(e,t,n)=>{let r=j(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(ha(e))return{};let t=ma(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return ha(e)?{}:{obj:e,k:ma(r[i])}},_a=(e,t,n)=>{let{obj:r,k:i}=ga(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=ga(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=ga(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},va=(e,t,n,r)=>{let{obj:i,k:a}=ga(e,t,Object);i[a]=i[a]||[],i[a].push(n)},ya=(e,t)=>{let{obj:n,k:r}=ga(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ba=(e,t,n)=>{let r=ya(e,n);return r===void 0?ya(t,n):r},xa=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?j(e[r])||e[r]instanceof String||j(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):xa(e[r],t[r],n):e[r]=t[r]);return e},Sa=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Ca={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},wa=e=>j(e)?e.replace(/[&<>"'\/]/g,e=>Ca[e]):e,Ta=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Ea=[` `,`,`,`?`,`!`,`;`],Da=new Ta(20),Oa=(e,t,n)=>{t||=``,n||=``;let r=Ea.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Da.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},ka=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Aa=e=>e?.replace(/_/g,`-`),ja={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},Ma=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||ja,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(j(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},Na=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},Pa=class extends Na{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):j(n)&&i?o.push(...n.split(i)):o.push(n)));let s=ya(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!j(n)?s:ka(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),_a(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(j(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=ya(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?xa(s,n,i):s={...s,...n},_a(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Fa={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Ia=Symbol(`i18next/PATH_KEY`);function La(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Ia?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Ra(e,t){let{[Ia]:n}=e(La()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var za={},Ba=e=>!j(e)&&typeof e!=`boolean`&&typeof e!=`number`,Va=class e extends Na{constructor(e,t={}){super(),fa([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Ma.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Ba(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Oa(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:j(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:j(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Ra(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Ra(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!j(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let ee=Ba(E),te=Object.prototype.toString.apply(E);if(y&&E&&ee&&_.indexOf(te)<0&&!(j(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:Ba(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&j(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=j(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!j(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=j(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Fa.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return j(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Ra(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!j(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(j(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!za[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(za[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!j(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},Ha=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ma.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Aa(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Aa(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(j(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),j(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return j(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):j(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Ua={zero:0,one:1,two:2,few:3,many:4,other:5},Wa={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Ga=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Ma.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Aa(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Wa;if(!e.match(/-|_/))return Wa;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Ua[e]-Ua[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Ka=(e,t,n,r=`.`,i=!0)=>{let a=ba(e,t,n);return!a&&i&&j(n)&&(a=ka(e,n,r),a===void 0&&(a=ka(t,n,r))),a},qa=e=>e.replace(/\$/g,`$$$$`),Ja=class{constructor(e={}){this.logger=Ma.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?wa:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?Sa(i):a||`{{`,this.suffix=o?Sa(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?Sa(d):f||Sa(`$t(`),this.nestingSuffix=p?Sa(p):m||Sa(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Ka(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Ka(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>qa(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?qa(this.escape(e)):qa(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=j(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!j(a)&&!this.useRawValueToEscape&&(a=da(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${Sa(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!j(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!j(i))return i;j(i)||(i=da(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Ya=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Xa=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Aa(r),i),t[o]=s),s(n)}},Za=e=>(t,n,r)=>e(Aa(n),r)(t),Qa=class{constructor(e={}){this.logger=Ma.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Xa:Za;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Xa(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Ya(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},$a=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},eo=class extends Na{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Ma.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{va(n.loaded,[i],a),$a(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();j(e)&&(e=this.languageUtils.toResolveHierarchy(e)),j(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},to=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),j(e[1])&&(t.defaultValue=e[1]),j(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),no=e=>(j(e.ns)&&(e.ns=[e.ns]),j(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),j(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),ro=()=>{},io=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},ao=`__i18next_supportNoticeShown`,oo=()=>!!(typeof globalThis<`u`&&globalThis[ao]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),so=()=>{typeof globalThis<`u`&&(globalThis[ao]=!0)},co=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),lo=class e extends Na{constructor(e={},t){if(super(),this.options=no(e),this.services={},this.logger=Ma,this.modules={external:[]},io(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(j(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=to();this.options={...n,...this.options,...no(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!co(this)&&!oo()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),so());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Ma.init(r(this.modules.logger),this.options):Ma.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Qa;let t=new Ha(this.options);this.store=new Pa(this.options.resources,this.options);let i=this.services;i.logger=Ma,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Ga(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Ja(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new eo(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Va(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=ro,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=ua(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=ro){let n=t,r=j(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=ua();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=ro,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Fa.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=ua();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=j(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(j(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Ra(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Ra(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Ra(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return j(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=ua();return this.options.ns?(j(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=ua();j(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new Ha(to());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=ro){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Pa(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...to().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ja(n)}return a.translator=new Va(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();lo.createInstance,lo.dir,lo.init,lo.loadResources,lo.reloadResources,lo.use,lo.changeLanguage,lo.getFixedT,lo.t,lo.exists,lo.setDefaultNamespace,lo.hasLoadedNamespace,lo.loadNamespaces,lo.loadLanguages;var uo={en:{translation:{"app.failed":`NiceEval View failed to load`,"nav.experiments":`Experiments`,"nav.language":`Language`,"nav.pages":`Report pages`,"insight.title":`NiceEval Insight`,"insight.navigation":`Insight`,"insight.chart.cost":`Cost`,"insight.chart.passRate":`Pass rate`,"insight.chart.score":`Score`,"insight.chart.noData":`No chartable data`,"insight.chart.partial":`partial data`,"insight.chart.openExperiment":`open experiment`,"verdict.passed":`passed`,"verdict.failed":`failed`,"verdict.errored":`errored`,"verdict.skipped":`skipped`,"cell.missing":`no data`,"cell.unscorable":`unscorable`,"cell.noCurrentResult":`no result for current config`,"cell.metricFailed":`failed`,"cell.metricUnavailable":`unavailable`,"cell.metricUnsupported":`unsupported`,"cell.metricMigrationRequired":`migration required`,"cell.measuredTitle":`{{samples}}/{{total}} attempts measured`,"cell.noneMeasurableTitle":`0/{{total}} attempts measurable`,"cell.coverageTitle":`coverage {{samples}}/{{total}}: this metric is null for the remaining attempts`,"cell.coverageDetail":`Result coverage {{samples}}/{{total}}`,"cell.evidence":`{{n}} attempts`,"table.model":`Model`,"cell.mixedExecution":`mixed`,"table.agent":`Agent`,"table.filterPlaceholder":`Filter rows…`,"experimentList.experiment":`Experiment`,"experimentList.avgDuration":`Avg. time`,"experimentList.passRate":`Pass rate`,"experimentList.totalScore":`Total score`,"experimentList.missedScoreItems":`{{n}} missed checks`,"experimentList.tokens":`Tokens`,"experimentList.cost":`Cost`,"experimentList.result":`Result`,"experimentList.status":`Status`,"experimentList.filterPlaceholder":`Filter experiments…`,"report.close":`Close`,"report.details":`Details`,"report.loading":`Loading…`,"report.loadingDetails":`Loading details…`,"report.backToResults":`Back to results`,"report.retry":`Retry`,"report.unableToLoad":`Unable to load this page.`,"report.unableToLoadDetails":`Unable to load details.`,"attempt.title":`Attempt`,"attempt.experiment":`Experiment`,"attempt.eval":`Eval`,"attempt.score":`Score`,"attempt.started":`Started`,"attempt.duration":`Duration`,"attempt.cost":`Cost`,"attempt.assertions":`Assertions`,"attempt.traceDetails":`Trace details`,"attempt.traceItem":`item {{id}}`,"attempt.traceTool":`tool {{id}}`,"attempt.traceCommand":`command {{id}}`,"attempt.executionTimeline":`Execution timeline`,"attempt.usage":`Usage`,"attempt.sources":`Sources`,"attempt.fileChanges":`File changes`,"attempt.artifacts":`Artifacts`,"attempt.loadOnDemand":`Expand or select to load.`,"attempt.artifactsNone":`No artifacts were recorded.`,"attempt.artifactsRetained_one":`{{count}} retained content item`,"attempt.artifactsRetained_other":`{{count}} retained content items`,"attempt.truncated":`(truncated)`,"attempt.verdict.passed":`passed`,"attempt.verdict.failed":`failed`,"attempt.verdict.errored":`errored`,"attempt.verdict.skipped":`skipped`,"attempt.verdict.unknown":`unknown`,"refresh.action":`Refresh`,"refresh.available":`An update with newer sealed results is available.`,"refresh.failed":`Refresh failed. The current result is still available.`,"refresh.working":`Refreshing…`,"refresh.selectionChanged":`The previous selection is no longer available. Showing the nearest available result.`}},"zh-CN":{translation:{"app.failed":`NiceEval 视图载入失败`,"nav.experiments":`实验`,"nav.language":`语言`,"nav.pages":`报告页面`,"insight.title":`NiceEval Insight`,"insight.navigation":`洞察`,"insight.chart.cost":`成本`,"insight.chart.passRate":`通过率`,"insight.chart.score":`得分`,"insight.chart.noData":`暂无可绘制的数据`,"insight.chart.partial":`部分数据`,"insight.chart.openExperiment":`打开实验`,"verdict.passed":`通过`,"verdict.failed":`失败`,"verdict.errored":`错误`,"verdict.skipped":`跳过`,"cell.missing":`无数据`,"cell.unscorable":`测不出`,"cell.noCurrentResult":`当前配置下无结果`,"cell.metricFailed":`读取失败`,"cell.metricUnavailable":`不可用`,"cell.metricUnsupported":`不支持`,"cell.metricMigrationRequired":`需要迁移`,"cell.measuredTitle":`{{samples}}/{{total}} 次 attempt 测得`,"cell.noneMeasurableTitle":`0/{{total}} 次 attempt 可测`,"cell.coverageTitle":`覆盖率 {{samples}}/{{total}}:其余 attempt 测不了这个指标`,"cell.coverageDetail":`结果完整度 {{samples}}/{{total}}`,"cell.evidence":`{{n}} 个 Attempt`,"table.model":`模型`,"cell.mixedExecution":`混合`,"table.agent":`Agent`,"table.filterPlaceholder":`筛选行…`,"experimentList.experiment":`实验`,"experimentList.avgDuration":`平均耗时`,"experimentList.passRate":`通过率`,"experimentList.totalScore":`总分`,"experimentList.missedScoreItems":`{{n}} 项未满足`,"experimentList.tokens":`Tokens`,"experimentList.cost":`成本`,"experimentList.result":`结果`,"experimentList.status":`状态`,"experimentList.filterPlaceholder":`筛选实验…`,"report.close":`关闭`,"report.details":`详情`,"report.loading":`正在加载…`,"report.loadingDetails":`正在加载详情…`,"report.backToResults":`返回结果`,"report.retry":`重试`,"report.unableToLoad":`无法加载此页面。`,"report.unableToLoadDetails":`无法加载详情。`,"attempt.title":`尝试`,"attempt.experiment":`实验`,"attempt.eval":`评测`,"attempt.score":`得分`,"attempt.started":`开始时间`,"attempt.duration":`耗时`,"attempt.cost":`成本`,"attempt.assertions":`断言`,"attempt.traceDetails":`轨迹详情`,"attempt.traceItem":`项目 {{id}}`,"attempt.traceTool":`工具 {{id}}`,"attempt.traceCommand":`命令 {{id}}`,"attempt.executionTimeline":`执行时间轴`,"attempt.usage":`用量`,"attempt.sources":`来源`,"attempt.fileChanges":`文件变更`,"attempt.artifacts":`产物`,"attempt.loadOnDemand":`展开或选择后载入。`,"attempt.artifactsNone":`未记录产物。`,"attempt.artifactsRetained_one":`保留了 {{count}} 项内容`,"attempt.artifactsRetained_other":`保留了 {{count}} 项内容`,"attempt.truncated":`(已截断)`,"attempt.verdict.passed":`通过`,"attempt.verdict.failed":`失败`,"attempt.verdict.errored":`错误`,"attempt.verdict.skipped":`跳过`,"attempt.verdict.unknown":`未知`,"refresh.action":`刷新`,"refresh.available":`有更新的封存结果可用。`,"refresh.failed":`刷新失败,当前结果仍可继续查看。`,"refresh.working":`正在刷新…`,"refresh.selectionChanged":`之前的选择已不存在,现已显示最近的可用结果。`}}},fo=`niceeval:report:locale`;lo.use(i).init({resources:uo,lng:(()=>{try{let e=localStorage.getItem(fo);if(e===`en`||e===`zh-CN`)return e}catch{}return navigator.language.toLowerCase().startsWith(`zh`)?`zh-CN`:`en`})(),fallbackLng:`en`,supportedLngs:[`en`,`zh-CN`],interpolation:{escapeValue:!1},returnNull:!1}),lo.on(`languageChanged`,e=>{document.documentElement.lang=e;try{localStorage.setItem(fo,e)}catch{}}),document.documentElement.lang=lo.resolvedLanguage??`en`;var po=lo,M=a(),mo=f.createContext(void 0),ho=e=>{let t=f.useContext(mo);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},go=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,M.jsx)(mo.Provider,{value:e,children:t})),_o=f.createContext(!1),vo=()=>f.useContext(_o);_o.Provider;function yo(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bo=f.createContext(yo()),N=()=>f.useContext(bo),xo={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},So=new class{#e=xo;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 Co(e){setTimeout(e,0)}var wo=typeof window>`u`||`Deno`in globalThis;function To(){}function Eo(e,t){return typeof e==`function`?e(t):e}function Do(e){return typeof e==`number`&&e>=0&&e!==1/0}function Oo(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ko(e,t){return typeof e==`function`?e(t):e}function Ao(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Mo(o,t.options))return!1}else if(!Po(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 jo(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(No(t.options.mutationKey)!==No(a))return!1}else if(!Po(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Mo(e,t){return(t?.queryKeyHashFn||No)(e)}function No(e){return JSON.stringify(e,(e,t)=>zo(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Po(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Po(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Po(e[r],t[r]))return!1;return!0}return!1}var Fo=Object.prototype.hasOwnProperty;function Io(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ro(e)&&Ro(t);if(!r&&!(zo(e)&&zo(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:Fo.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Io(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Lo(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 Ro(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zo(e){if(!Bo(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Bo(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Bo(e){return Object.prototype.toString.call(e)===`[object Object]`}function Vo(e){return new Promise(t=>{So.setTimeout(t,e)})}function Ho(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Io(e,t)}function Uo(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Wo(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Go=Symbol();function Ko(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Go?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function qo(e,t){return typeof e==`function`?e(...t):!!e}function Jo(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 Yo=Co;function Xo(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Yo,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 Zo=Xo(),Qo=()=>wo,$o=()=>Qo(),es=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(){}},ts=new class extends es{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ns=new class extends es{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function rs(e){return Math.min(1e3*2**e,3e4)}function is(e){return(e??`online`)===`online`?ns.isOnline():!0}var as=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function os(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(To);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new as(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>ts.isFocused()&&(e.networkMode===`always`||ns.isOnline())&&e.canRun(),p=()=>is(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??($o()?0:3),a=e.retryDelay??rs,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),Vo(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var ss=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Do(this.gcTime)&&(this.#e=So.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($o()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(So.clearTimeout(this.#e),this.#e=void 0)}};function cs(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=>{Jo(e,()=>t.signal,()=>n=!0)},u=Ko(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=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?Wo:Uo;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?us:ls,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:ls(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 ls(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 us(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ds=class extends ss{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ms(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ms(this.options);e.data!==void 0&&(this.setState(ps(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ho(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ko(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Go||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ko(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:!Oo(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ko(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?cs(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=os({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof as&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof as){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...fs(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ps(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Zo.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function fs(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:is(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ps(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ms(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var hs=class extends es{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),_s(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vs(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vs(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof ko(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Lo(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ys(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||ko(this.options.enabled,this.#t)!==ko(t.enabled,this.#t)||ko(this.options.staleTime,this.#t)!==ko(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||ko(this.options.enabled,this.#t)!==ko(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Lo(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(To)),t}#h(e){return!$o()&&ko(this.options.enabled,this.#t)!==!1&&Do(e)}#g(){this.#b();let e=ko(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Oo(this.#r.dataUpdatedAt,e)+1;this.#u=So.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=So.setInterval(()=>{(this.options.refetchIntervalInBackground||ts.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(So.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(So.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&_s(e,t),o=i&&ys(e,n,t,r);(a||o)&&(l={...l,...fs(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Ho(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Ho(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:bs(e,t),refetch:this.refetch,isEnabled:ko(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Lo(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Zo.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function gs(e,t){return ko(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&ko(t.retryOnMount,e)===!1)}function _s(e,t){return gs(e,t)||e.state.data!==void 0&&vs(e,t,t.refetchOnMount)}function vs(e,t,n){if(ko(t.enabled,e)!==!1&&ko(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&bs(e,t)}return!1}function ys(e,t,n,r){return(e!==t||ko(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&bs(e,n)}function bs(e,t){return ko(t.enabled,e)!==!1&&e.isStaleByTime(ko(t.staleTime,e))}var xs=class extends ss{#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||Ss(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=os({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Zo.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ss(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Cs=class extends es{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new xs({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=ws(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=ws(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=ws(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=ws(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Zo.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=>jo(t,e))}findAll(e={}){return this.getAll().filter(t=>jo(e,t))}notify(e){Zo.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Zo.batch(()=>Promise.all(e.map(e=>e.continue().catch(To))))}};function ws(e){return e.options.scope?.id}var Ts=class extends es{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Mo(r,t),a=this.get(i);return a||(a=new ds({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(){Zo.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=>Ao(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ao(e,t)):t}notify(e){Zo.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zo.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zo.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Es=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ts,this.#t=e.mutationCache||new Cs,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ts.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ns.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(ko(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=Eo(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Zo.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;Zo.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Zo.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Zo.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(e,t={}){return Zo.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=Zo.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(To)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(To)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(ko(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ko(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(To).catch(To)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(To).catch(To)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ns.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(No(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Po(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(No(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Po(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||=Mo(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===Go&&(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()}},Ds=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?qo(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Os=e=>{f.useEffect(()=>{e.clearReset()},[e])},ks=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||qo(n,[e.error,r])),As=(e,t)=>t.state.data===void 0,js=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ms=(e,t)=>e?.suspense&&t.isPending,Ns=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ps(e,t,n){let r=vo(),i=N(),a=ho(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,js(o),Ds(o,i,s),Os(i);let[l]=f.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(f.useSyncExternalStore(f.useCallback(e=>{let t=d?l.subscribe(Zo.batchCalls(e)):To;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o)},[o,l]),Ms(o,u))throw Ns(o,l,i);if(ks({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Fs(e,t){return Ps(e,hs,t)}function Is(e){return e}var Ls=(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}}},Rs={pipe(){return Ls(this,arguments)}},zs=function(){function e(){}return e.prototype=Rs,e}(),Bs=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)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},Vs=e=>e,Hs=(e=>()=>e)(void 0),Us=Hs;function Ws(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Gs(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),t.set(i,i),i}}var Ks=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},qs=new WeakSet;function Js(e){return typeof e==`string`}function Ys(e){return typeof e==`number`}function Xs(e){return typeof e==`boolean`}function Zs(e){return typeof e==`symbol`}function Qs(e){return Js(e)||Ys(e)||Zs(e)}function $s(e){return typeof e==`function`}function ec(e){return e!==void 0}function tc(e){return e!=null}function nc(e){return!1}function rc(e){return!0}function ic(e){return typeof e==`object`&&!!e||$s(e)}var ac=Bs(2,(e,t)=>ic(e)&&t in e),oc=`~effect/interfaces/Hash`,sc=e=>{switch(typeof e){case`number`:return fc(e);case`bigint`:return P(e.toString(10));case`boolean`:return P(String(e));case`symbol`:return P(String(e));case`string`:return P(e);case`undefined`:return P(`undefined`);case`function`:case`object`:if(e===null)return P(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?P(`Invalid Date`):P(e.toISOString());if(e instanceof RegExp)return P(e.toString());{if(qs.has(e))return cc(e);if(bc.has(e))return bc.get(e);let t=Sc(e,()=>dc(e)?e[oc]():typeof e==`function`?cc(e):e instanceof DataView?gc(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?gc(e):e instanceof Map?_c(e):e instanceof Set?vc(e):mc(e));return bc.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},cc=e=>(yc.has(e)||yc.set(e,fc(Math.floor(Math.random()*(2**53-1)))),yc.get(e)),lc=Bs(2,(e,t)=>e*53^t),uc=e=>e&3221225471|e>>>1&1073741824,dc=e=>ac(e,oc),fc=e=>{if(e!==e)return P(`NaN`);if(e===1/0)return P(`Infinity`);if(e===-1/0)return P(`-Infinity`);let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return uc(t)},P=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return uc(t)},pc=(e,t)=>{let n=12289;for(let r of t)n^=lc(sc(r),sc(e[r]));return uc(n)},mc=e=>pc(e,Ks(e)),hc=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return uc(r)},gc=hc(6151,sc),_c=hc(P(`Map`),([e,t])=>lc(sc(e),sc(t))),vc=hc(P(`Set`),sc),yc=new WeakMap,bc=new WeakMap,xc=new WeakSet;function Sc(e,t){if(xc.has(e))return P(`[Circular]`);xc.add(e);let n=t();return xc.delete(e),n}var Cc=`~effect/interfaces/Equal`;function wc(){return arguments.length===1?e=>Tc(e,arguments[0]):Tc(arguments[0],arguments[1])}function Tc(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||qs.has(e)||qs.has(t)?!1:Ac(e,t,kc):!1}function Ec(e,t,n){let r=Dc.has(e),i=Oc.has(t);if(r&&i)return!0;if(r||i)return!1;Dc.add(e),Oc.add(t);let a=n();return Dc.delete(e),Oc.delete(t),a}var Dc=new WeakSet,Oc=new WeakSet;function kc(e,t){if(sc(e)!==sc(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}else if(e instanceof RegExp)return t instanceof RegExp?e.toString()===t.toString():!1;let n=zc(e),r=zc(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:Ec(e,t,()=>{if(i)return e[Cc](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Mc(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView)return!1;if(n){let n=t;return Nc(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return Nc(e,t)}else if(e instanceof Map)return!(t instanceof Map)||e.size!==t.size?!1:Ic(e,t);else if(e instanceof Set)return!(t instanceof Set)||e.size!==t.size?!1:Rc(e,t);return Pc(e,t)})}function Ac(e,t,n){let r=jc.get(e);if(!r)r=new WeakMap,jc.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=jc.get(t);return a||(a=new WeakMap,jc.set(t,a)),a.set(e,i),i}var jc=new WeakMap;function Mc(e,t){for(let n=0;n<e.length;n++)if(!Tc(e[n],t[n]))return!1;return!0}function Nc(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Pc(e,t){let n=Ks(e),r=Ks(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!Tc(e[i],t[i]))return!1;return!0}function Fc(e,t){return function(n,r){let i=Array.from(r);for(let[r,a]of n){let n=!1;for(let o=0;o<i.length;o++){let[s,c]=i[o];if(e(r,s)&&t(a,c)){i[o]=i[i.length-1],i.pop(),n=!0;break}}if(!n)return!1}return!0}}var Ic=Fc(Tc,Tc);function Lc(e){return function(t,n){let r=Array.from(n);for(let n of t){let t=!1;for(let i=0;i<r.length;i++){let a=r[i];if(e(n,a)){r[i]=r[r.length-1],r.pop(),t=!0;break}}if(!t)return!1}return!0}}var Rc=Lc(Tc),zc=e=>ac(e,Cc),Bc=Symbol.for(`~effect/Redactable`),Vc=e=>ac(e,Bc);function Hc(e){return Vc(e)?Uc(e):e}function Uc(e){return e[Bc](globalThis[`~effect/Fiber/currentFiber`]?.context??Kc)}var Wc=`~effect/Fiber/currentFiber`,Gc=new Map,Kc={"~effect/Context":{},base:Gc,depth:0,mapUnsafe:Gc,pipe(){return Ls(this,arguments)}};function F(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.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(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return qc;r.add(e);let l;if(Bc in e)l=c(Uc(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
14
|
+
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Xc(e);else if(!t?.ignoreToString&&ac(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Zc(e);l=e instanceof Error&&e.cause?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);l=!i||t.length<=1?o(e,`{${t.map(t=>`${Jc(t)}:${c(e[t],n)}`).join(`,`)}}`):o(e,`{\n${t.map(t=>`${a(n+1)}${Jc(t)}: ${c(e[t],n+1)}`).join(`,
|
|
15
|
+
`)}\n${a(n)}}`)}return r.delete(e),l}return String(e)}return c(e,0)}var qc=`[Circular]`;function Jc(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Yc(e){return e.map(e=>`[${Jc(e)}]`).join(``)}function Xc(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Zc(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}var Qc=Symbol.for(`nodejs.util.inspect.custom`),$c=e=>{try{return e=Hc(e),ac(e,`toJSON`)&&$s(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map($c):e}catch{return`[toJSON threw]`}},el=class e{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},tl=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})();function nl(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function rl(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&nl(e,n,t[n])}var il=`~effect/Effect`,al=`~effect/Exit`,ol={_A:Vs,_E:Vs,_R:Vs},sl=`${il}/identifier`,I=`${il}/args`,cl=`${il}/evaluate`,ll=`${il}/successCont`,ul=`${il}/failureCont`,dl=`${il}/ensureCont`,fl=Symbol.for(`effect/Effect/Yield`),pl={pipe(){return Ls(this,arguments)},toJSON(){return{...this}},toString(){return F(this.toJSON(),{ignoreToString:!0,space:2})},[Qc](){return this.toJSON()}},ml={[il]:ol,...pl,[Symbol.iterator](){return new el(this)},toJSON(){return{_id:`Effect`,op:this[sl],...I in this?{args:this[I]}:void 0}}},hl=e=>ac(e,al),gl=`~effect/Cause`,_l=`~effect/Cause/Reason`,vl=e=>ac(e,gl),yl=class{[gl];reasons;constructor(e){this[gl]=gl,this.reasons=e}pipe(){return Ls(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${F(this.reasons)})`}[Qc](){return this.toJSON()}[Cc](e){return vl(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>wc(t,e.reasons[n]))}[oc](){return gc(this.reasons)}},bl=new WeakMap,xl=class{[_l];annotations;_tag;constructor(e,t,n){if(this[_l]=_l,this._tag=e,t!==Sl&&typeof n==`object`&&n&&t.size>0){let e=bl.get(n);e&&(t=new Map([...e,...t])),bl.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return Ls(this,arguments)}toString(){return F(this)}[Qc](){return this.toString()}},Sl=new Map,Cl=class extends xl{error;constructor(e,t=Sl){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${F(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[Cc](e){return kl(e)&&wc(this.error,e.error)&&wc(this.annotations,e.annotations)}[oc](){return lc(P(this._tag))(lc(sc(this.error))(sc(this.annotations)))}},wl=e=>new yl(e),Tl=e=>new yl([new Cl(e)]),El=class extends xl{defect;constructor(e,t=Sl){super(`Die`,t,e),this.defect=e}toString(){return`Die(${F(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[Cc](e){return Al(e)&&wc(this.defect,e.defect)&&wc(this.annotations,e.annotations)}[oc](){return lc(P(this._tag))(lc(sc(this.defect))(sc(this.annotations)))}},Dl=e=>new yl([new El(e)]),Ol=Bs(e=>vl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new yl(e.reasons.map(e=>e.annotate(t,n)))),kl=e=>e._tag===`Fail`,Al=e=>e._tag===`Die`,jl=e=>e._tag===`Interrupt`;function Ml(e){return Vl(`Effect.evaluate: Not implemented`)}var Nl=e=>({...ml,[sl]:e.op,[cl]:e[cl]??Ml,[ll]:e[ll],[ul]:e[ul],[dl]:e[dl]}),Pl=e=>{let t=Nl(e);return function(){let n=Object.create(t);return n[I]=e.single===!1?arguments:arguments[0],n}},Fl=e=>{let t={[al]:al,_tag:e.op,get[e.prop](){return this[I]},...Nl(e),toString(){return`${e.op}(${F(this[I])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[I]}},[Cc](e){return hl(e)&&e._tag===this._tag&&wc(this[I],e[I])},[oc](){return lc(P(e.op),sc(this[I]))}};return function(e){let n=Object.create(t);return n[I]=e,n}},Il=Fl({op:`Success`,prop:`value`,[cl](e){let t=e.getCont(ll);return t?t[ll](this[I],e,this):e.yieldWith(this)}}),Ll={key:`effect/Cause/StackTrace`},Rl={key:`effect/Cause/InterruptorStackTrace`},zl=Fl({op:`Failure`,prop:`cause`,[cl](e){let t=this[I],n=!1;e.currentStackFrame&&(t=Ol(t,{mapUnsafe:new Map([[Ll.key,e.currentStackFrame]])}),n=!0);let r=e.getCont(ul);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(ul);return r?r[ul](t,e,n?void 0:this):e.yieldWith(n?zl(t):this)}}),Bl=e=>zl(Tl(e)),Vl=e=>zl(Dl(e)),Hl=Pl({op:`WithFiber`,[cl](e){return this[I](e)}}),Ul=function(){class e extends globalThis.Error{}let t=Nl({op:`YieldableError`,[cl](){return Bl(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Wl=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends Ul{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(rl(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Gl=e=>{class t extends Wl{_tag=e}return t.prototype.name=e,t};Gl(`NoSuchElementError`);var Kl=e=>Nl({op:e.label,[cl]:e.evaluate}),ql=e=>(t,n)=>t===n||e(t,n),Jl=`~effect/data/Option`,Yl={[Jl]:{_A:e=>e},...pl,[Symbol.iterator](){return new el(this)}},L=Object.defineProperty(Object.assign(Object.create(Yl),{_tag:`Some`,_op:`Some`,[Cc](e){return Zl(e)&&$l(e)&&wc(this.value,e.value)},[oc](){return lc(sc(this._tag))(sc(this.value))},toString(){return`some(${F(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:$c(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),R=sc(`None`),Xl=Object.assign(Object.create(Yl),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[Cc](e){return Zl(e)&&Ql(e)},[oc](){return R},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),Zl=e=>ac(e,Jl),Ql=e=>e._tag===`None`,$l=e=>e._tag===`Some`,eu=Object.create(Xl),tu=e=>{let t=Object.create(L);return t.value=e,t},nu=`~effect/data/Result`,ru={[nu]:{_A:e=>e,_E:e=>e},...pl,[Symbol.iterator](){return new el(this)}},iu=Object.assign(Object.create(ru),{_tag:`Success`,_op:`Success`,[Cc](e){return ou(e)&&cu(e)&&wc(this.success,e.success)},[oc](){return lc(sc(this._tag))(sc(this.success))},toString(){return`success(${F(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:$c(this.success)}}}),au=Object.assign(Object.create(ru),{_tag:`Failure`,_op:`Failure`,[Cc](e){return ou(e)&&su(e)&&wc(this.failure,e.failure)},[oc](){return lc(sc(this._tag))(sc(this.failure))},toString(){return`failure(${F(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:$c(this.failure)}}}),ou=e=>ac(e,nu),su=e=>e._tag===`Failure`,cu=e=>e._tag===`Success`,lu=e=>{let t=Object.create(au);return t.failure=e,t},uu=e=>{let t=Object.create(iu);return t.success=e,t},du=()=>eu,fu=tu,pu=Ql,mu=$l,hu=Bs(2,(e,t)=>pu(e)?du():fu(t(e.value))),gu=Bs(2,(e,t)=>pu(e)?du():t(e.value)?fu(e.value):du()),_u=`~effect/Context/Service`,vu=function(){function e(){}let t=e;Object.setPrototypeOf(t,yu);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[xu]=xu,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&bu.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},yu={[_u]:_u,...Kl({label:`Service`,evaluate(e){return Il(Vu(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Lu(this,e)},use(e){return Hl(t=>e(Vu(t.context,this)))},useSync(e){return Hl(t=>Il(e(Vu(t.context,this))))}},bu=new Set,xu=`~effect/Context/Reference`,Su=`~effect/Context`,Cu=8,wu=8,Tu=(e,t,n,r)=>{let i=Object.create(ju);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Eu=(e,t)=>{t&&(Eu(e,t.parent),e.set(t.key,t.value))},Du=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Eu(t,e.overlay),e._flat=t},Ou=Symbol(),ku=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?Ou:(n.overlay&&++n.baseHits>=wu&&(n.base=Du(n),n.overlay=void 0,n.depth=0),r)},Au=e=>Tu(void 0,e,void 0,0),ju={get mapUnsafe(){return Du(this)},...pl,[Su]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Cc](e){if(!Nu(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!wc(r,n.get(e)))return!1;return!0},[oc](){return fc(this.mapUnsafe.size)}},Mu=(e,t)=>e.cacheRoot===t.cacheRoot,Nu=e=>ac(e,Su),Pu=e=>!!e[xu],Fu=()=>Iu,Iu=Au(new Map),Lu=(e,t)=>Au(new Map([[e.key,t]])),Ru=Bs(3,(e,t,n)=>zu(e,t.key,n)),zu=(e,t,n)=>{let r=e,i=bu.has(t)?void 0:r.cacheRoot;if(r.depth>=Cu){let e=new Map(r.mapUnsafe);return e.set(t,n),Tu(i,e,void 0,0)}return Tu(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Bu=(e,t)=>{let n=ku(e,t);return n===Ou?void 0:n},Vu=Bs(2,(e,t)=>{let n=ku(e,t.key);if(n===Ou){if(Pu(t))return Uu(t);throw Wu(t)}return n}),Hu=`~effect/Context/defaultValue`,Uu=e=>Hu in e?e[Hu]:e[Hu]=e.defaultValue(),Wu=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
16
|
+
`);e.splice(1,3),t.stack=e.join(`
|
|
17
|
+
`)}return t},Gu=vu,Ku=e=>e.length>0,qu=uu,Ju=lu,Yu=su,Xu=cu,Zu=Bs(2,(e,t)=>Yu(e)?Ju(t(e.failure)):e),Qu=globalThis.Array,$u=e=>Qu.isArray(e)?e:Qu.from(e),ed=Bs(2,(e,t)=>[...e,t]),td=Bs(2,(e,t)=>$u(e).concat($u(t)));Qu.isArray;var nd=Ku,rd=Ku,id=(e,t)=>{let n=sc(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let e of r)if(wc(e,t))return!1;return r.push(t),!0},ad=Bs(2,(e,t)=>{let n=$u(e),r=$u(t);return rd(n)?rd(r)?cd(td(n,r)):n:r}),od=()=>[],sd=Bs(2,(e,t)=>e.map(t)),cd=e=>{let t=$u(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let e of t)id(n,e)&&r.push(e);return r},ld=Gu(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new pd}),ud=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},dd=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},fd=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},pd=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?dd:ud)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new md(this.setImmediate)}},md=class{tasks=new fd;running=void 0;setImmediate;constructor(e=ud){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},hd=Gu(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),gd=Gu(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),_d=Gl;_d(`EncodingError`);var vd=[];for(let e=0;e<256;e++)vd.push(e.toString(16).padStart(2,`0`));var yd=`effect/Tracer/ParentSpan`;vu()(yd,{fiberCached:!0});var bd=`effect/Tracer`,xd=`effect/observability/Metric/FiberRuntimeMetricsKey`,Sd=Gu(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:Hs}),Cd=Gu(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),wd=Gu(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Td=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),Ed=()=>Error.stackTraceLimit,Dd=e=>{Td&&(Error.stackTraceLimit=e)},Od=class extends xl{fiberId;constructor(e,t=Sl){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[Cc](e){return jl(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[oc](){return lc(P(`${this._tag}:${this.fiberId}`))(cc(this.annotations))}},kd=e=>new yl([new Od(e)]),Ad=e=>e.reasons.some(jl),jd=Bs(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new yl(ad(e.reasons,t.reasons));return wc(e,n)?e:n}),Md=Bs(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>kl(e)?(n=!0,new Cl(t(e.error),e.annotations)):e);return n?wl(r):e}),z=`~effect/Fiber`,Nd={_A:Vs,_E:Vs},Pd={id:0},Fd=()=>globalThis[Wc],Id=class{constructor(e,t=!0){this[z]=Nd,this.setContext(e),this.id=++Pd.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[z];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(e){return Vu(this.context,e)}addObserver(e){return this._exit?(e(this._exit),Us):(this._observers.push(e),()=>{if(this._exit)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}interruptUnsafe(e,t){if(this._exit)return;let n=kd(e);this.currentStackFrame&&(n=Ol(n,Lu(Ll,this.currentStackFrame))),t&&(n=Ol(n,t)),this._interruptedCause=this._interruptedCause?jd(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Ud(this._interruptedCause)))}pollUnsafe(){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===fl)return;let n=Rd.interruptChildren&&Rd.interruptChildren(this);if(n!==void 0)return this.evaluate(of(n,()=>t));this._exit=t,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let e=0;e<this._observers.length;e++)this._observers[e](t);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=Fu()}runLoop(e){let t=globalThis[Wc];globalThis[Wc]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){if(this._deferredInterrupt&&(this._deferredInterrupt=!1,i=Ud(this._interruptedCause)),this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;let e=i;i=of(qd,()=>e)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[cl](this),i===fl){let e=this._yielded;if(al in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return fl}}}catch(e){return ac(i,cl)?this.runLoop(Vl(e)):Vl(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[Wc]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,Ld;for(;;){let t=this._stack.pop();if(!t)return;let n=t[dl]&&t[dl](this);if(n)return n[e]=n,n;if(t[e])return t}}yieldWith(e){return this._yielded=e,fl}children(){return this._children??=new Set}pipe(){return Ls(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Mu(t,e))return;let n=this.getRef(ld);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=Bu(e,yd),this.currentLogLevel=this.getRef(Cd),this.minimumLogLevel=this.getRef(wd),this.currentStackFrame=this.getRef(Sd),this.maxOpsBeforeYield=this.getRef(hd),this.currentPreventYield=this.getRef(gd),this.runtimeMetrics=Bu(e,xd);let r=Bu(e,bd);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag===`Span`?this.currentSpan:void 0}},Ld={[ll](e,t){return Ud(t._interruptedCause)},[ul](e,t){return Ud(t._interruptedCause)}},Rd={interruptChildren:void 0},zd=e=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(Rl.key,e.currentStackFrame),Au(t)},Bd=e=>$d(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(Hd(r))}return a(),Gd(()=>i?.())}),Vd=e=>Hl(t=>{let n=zd(t),r=od();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return af(Bd(r))}),Hd=Il,Ud=zl,Wd=Bl,Gd=Pl({op:`Sync`,[cl](e){let t=this[I](),n=e.getCont(ll);return n?n[ll](t,e):e.yieldWith(Il(t))}}),Kd=Pl({op:`Suspend`,[cl](e){return this[I]()}}),qd=Pl({op:`Yield`,[cl](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(mf)},this[I]??0),e.yieldWith(()=>{t=!0})}})(0),Jd=e=>Kd(()=>Ud(tl(e))),Yd=e=>Vl(e),Xd=Hd(void 0),Zd=Pl({op:`Async`,single:!1,[cl](e){let t=tl(()=>this[I][0].bind(e.currentScheduler)),n=!1,r=!1,i=this[I][1]?new AbortController:void 0,a=t(t=>{n||(n=!0,r?e.evaluate(t):r=t)},i?.signal);return r===!1?(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(Qd(()=>(n=!0,i?.abort(),a??mf))),fl):r}}),Qd=Pl({op:`AsyncFinalizer`,[dl](e){e.interruptible&&(e.interruptible=!1,e._stack.push(xf))},[ul](e,t){return Ad(e)?of(this[I](),()=>Ud(e)):Ud(e)}}),$d=e=>Zd(e,e.length>=2),ef=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),tf=(e,...t)=>ef(e.length,t.length===0?function(){return nf(()=>e.apply(this,arguments))}:function(){let n=nf(()=>e.apply(this,arguments));for(let e of t)n=e(n);return n}),nf=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return Hd(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}else if(i&&i._tag===`Failure`)return r.value;else{let n=!0;return Kd(()=>n?(n=!1,of(r.value,e=>rf(t,e))):Kd(()=>rf(e())))}}}catch(e){return Yd(e)}},rf=Pl({op:`Iterator`,single:!1,[ll](e,t){let n=this[I][0];for(;;){let r=n.next(e);if(r.done)return Hd(r.value);if(!cf(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[cl](e){return this[ll](this[I][1],e)}}),af=e=>of(e,e=>mf),of=Bs(2,(e,t)=>{let n=Object.create(sf);return n[I]=e,n[ll]=t.length===1?t:e=>t(e),n}),sf=Nl({op:`OnSuccess`,[cl](e){return e._stack.push(this),this[I]}}),cf=e=>al in e,lf=Bs(2,(e,t)=>cf(e)?e._tag===`Success`?t(e.value):e:of(e,t)),uf=Bs(2,(e,t)=>of(e,e=>Hd(tl(()=>t(e))))),df=Bs(2,(e,t)=>cf(e)?hf(e,t):uf(e,t)),ff=e=>e._tag===`Success`,pf=e=>e._tag===`Failure`,mf=Il(void 0),hf=Bs(2,(e,t)=>e._tag===`Success`?Il(t(e.value)):e),gf=Bs(2,(e,t)=>{let n=Object.create(_f);return n[I]=e,n[ul]=t.length===1?t:e=>t(e),n}),_f=Nl({op:`OnFailure`,[cl](e){return e._stack.push(this),this[I]}}),vf=e=>cf(e)?Il(e):yf(e),yf=Pl({op:`Exit`,[cl](e){return e._stack.push(this),this[I]},[ll](e,t,n){return Hd(n??Il(e))},[ul](e,t,n){return Hd(n??zl(e))}}),bf=e=>Hl(t=>t.interruptible?(t.interruptible=!1,t._stack.push(xf),e):e),xf=Pl({op:`SetInterruptible`,[dl](e){if(e.interruptible=this[I],e._interruptedCause&&e.interruptible)return()=>Ud(e._interruptedCause)}})(!0),Sf=e=>{let t=e.onItem,n=e.step,r=(e,i,a,o)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!cf(c))return of(vf(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??Xd);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return(e,i,a)=>{let o=0,s=a?.end??i.length,c=a?.concurrency??1;if(c===1)return r(e,i,0,s);let l=a?.orderedStep===!0,u=!1,d,f,p,m=!1,h,g,_=o,v=l?Array(s):void 0,y=e=>{let t=Vl(e);return h=t,u=!0,m=!0,f&&f.size>0?of(bf(Vd(Array.from(f))),()=>t):t},b=(t,r,a)=>{if(!l)return n(e,t,r,a);if(h)return h;for(v[a]=r;_<s;){let t=v[_];if(t===void 0)return;v[_]=void 0;let r=_++,a=n(e,i[r],t,r);if(a)return a}},x=()=>{let n=!1;for(;!h&&o<s;o++){let r=i[o],a=g??t(e,r,o);if(cf(a)){if(h=b(r,a,o),h)break}else if(d){g=void 0;let e=wf(d,a,!0,!0,`inherit`);if(e._exit){if(h=b(r,e._exit,o),h)break;continue}f.add(e);let t=o;if(e.addObserver(i=>{f.delete(e);try{if(h){if(!m&&i._tag===`Failure`)for(let e of i.cause.reasons)if(e._tag===`Interrupt`)continue;else h._tag===`Failure`?h.cause.reasons.push(e):h=zl(wl([e]))}else{let e=b(r,i,t);e&&(h=e._tag===`Failure`?zl(wl(e.cause.reasons.slice())):e,x())}if(n){let e=x();e&&p(e)}else u&&f.size===0&&p(h??Xd)}catch(e){p(y(e))}}),f.size<c)continue;n=!0,o++;return}else return $d(e=>{d=Fd(),f=new Set,g=a,p=e;let t;try{t=x()}catch(t){return e(y(t))}return t?e(t):Kd(()=>(h=mf,m=!0,f?Vd(f):Xd))})}if(u=!0,h){if(f&&f.size>0){let e=zd(d);f.forEach(t=>t.interruptUnsafe(d.id,e));return}if(p||h._tag===`Failure`)return h}else if(p)if(f)f.size===0&&p(Xd);else return mf};return x()}},Cf=()=>Sf,wf=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new Id(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s.addObserver(()=>a._children.delete(s))),s},Tf=e=>(t,n)=>{let r=new Id(n?.scheduler?Ru(e,ld,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal)if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}return n?.onFiberStart&&n.onFiberStart(r),r},Ef=(e=>{let t=Tf(e);return e=>{if(cf(e))return e;let n=t(e,{scheduler:new pd(`sync`)});return n._dispatcher?.flush(),n._exit??Vl(new Of(n))}})(Fu());Gl(`TimeoutError`),Gl(`IllegalArgumentError`),Gl(`ExceededCapacityError`);var Df=`~effect/Cause/AsyncFiberError`,Of=class extends Gl(`AsyncFiberError`){[Df]=Df;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}};Gl(`UnknownError`);var kf={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};kf.gray,kf.blue,kf.green,kf.yellow,kf.red,kf.bgBrightRed,kf.black;var Af=kl,jf=Md;vu()(`effect/Cause/StackTrace`),vu()(`effect/Cause/InterruptorStackTrace`);var Mf=Il,Nf=zl,Pf=Bl,Ff=mf,If=ff,Lf=pf,Rf=`~effect/BigDecimal`,zf={[Rf]:Rf,[oc](){let e=Kf(this);return lc(sc(e.value),fc(e.scale))},[Cc](e){return Bf(e)&&Xf(this,e)},toString(){return`BigDecimal(${Zf(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[Qc](){return this.toJSON()},pipe(){return Ls(this,arguments)}},Bf=e=>ac(e,Rf),Vf=(e,t)=>{let n=Object.create(zf);return n.value=e,n.scale=t,n},Hf=(e,t)=>{if(e!==Uf&&e%Wf===Uf)throw RangeError(`Value must be normalized`);let n=Vf(e,t);return n.normalized=n,n},Uf=BigInt(0),Wf=BigInt(10),Gf=Hf(Uf,0),Kf=e=>{if(e.normalized===void 0)if(e.value===Uf)e.normalized=Gf;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=Hf(BigInt(t.substring(0,t.length-n)),e.scale-n)}return e.normalized},qf=Bs(2,(e,t)=>t>e.scale?Vf(e.value*Wf**BigInt(t-e.scale),t):t<e.scale?Vf(e.value/Wf**BigInt(e.scale-t),t):e),Jf=e=>e.value<Uf?Vf(-e.value,e.scale):e,Yf=ql((e,t)=>e.scale>t.scale?qf(t,e.scale).value===e.value:e.scale<t.scale?qf(e,t.scale).value===t.value:e.value===t.value),Xf=Bs(2,(e,t)=>Yf(e,t)),Zf=e=>{let t=Kf(e);if(Math.abs(t.scale)>=16)return Qf(t);let n=t.value<Uf,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},Qf=e=>{if($f(e))return`0e+0`;let t=Kf(e),n=`${Jf(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${ep(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},$f=e=>e.value===Uf,ep=e=>e.value<Uf,tp=`~effect/time/DateTime`,np=`~effect/time/DateTime/TimeZone`,rp={[tp]:tp,pipe(){return Ls(this,arguments)},[Qc](){return this.toString()},toJSON(){return ap(this).toJSON()}};({...rp}),{...rp};var ip={[np]:np,[Qc](){return this.toString()}};({...ip}),{...ip};var ap=e=>new Date(e.epochMilliseconds),op=Hd,sp=Wd,cp=Jd,lp=Yd,up=of,dp=vf,fp=gf,pp=Ef;vu()(`effect/Effect/Transaction`);var mp=df,hp=lf,gp=tf;vu()(`effect/DateTime/CurrentTimeZone`);function _p(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function vp(e){return t=>_p(t)?.[e]}var yp=`~structural`,bp=`~sentinels`,xp=`~constructor`,Sp=vp(`brands`),Cp=Ws(e=>{let t=_p(e)?.identifier;return typeof t==`string`?t:e.getExpected(Cp)}),wp=Symbol(),Tp=Mf,Ep=Tp(wp),Dp=Tp(wp),Op=e=>e===wp?du():fu(e),kp=e=>e._tag===`None`?Ep:Tp(e.value),Ap=`~effect/SchemaIssue/Issue`;function jp(e){return ac(e,Ap)&&e[Ap]===Ap}function Mp(e){return Object.hasOwn(e,`input`)}var Np=class{[Ap]=Ap;constructor(e,t){t?.reportInput===!0&&e!==wp&&(this.input=e)}},Pp=class extends Np{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Fp=class extends Np{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Ip=class extends Np{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Lp=class extends Np{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Rp=class extends Np{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},zp=class extends Np{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Bp=class extends Np{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Vp=class extends Np{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},Hp=class extends Np{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Up=class extends Np{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function Wp(e,t,n){if(jp(e))return e;if(typeof e==`string`)return new Vp({message:e},t,n);let r=typeof e.issue==`string`?new Vp({message:e.issue},t,n):e.issue;return new Ip(e.path,r)}function Gp(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new Vp(void 0,t,n):Wp(e,t,n)}function Kp(e,t,n,r){return Array.isArray(t)?rd(t)?t.length===1?Wp(t[0],n,r):new zp(e,sd(t,e=>Wp(e,n,r)),n,r):void 0:Gp(t,n,r)}var qp=e=>{let t=im(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Qp(Cp(e.ast),e);case`InvalidValue`:{let t=Zp(e);if(t!==void 0)return Qp(t,e);let n=Xp(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=Xp(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=Xp(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Jp=e=>im(e.issue)??im(e);function Yp(e){return t=>({issues:$p(t,[],e?.leafHook??qp,e?.checkHook??Jp)})}function Xp(e){return Mp(e)?F(e.input):void 0}function Zp(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Qp(e,t){let n=Xp(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function $p(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return $p(e.issue,t,n,r);let a=Zp(e.issue);return[{path:t,message:a===void 0?Qp(em(e.filter),e):Qp(a,e.issue)}]}case`Encoding`:return $p(e.issue,t,n,r);case`Pointer`:return $p(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>$p(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:im(e)??Qp(Cp(e.ast),e)}]:e.issues.flatMap(e=>$p(e,t,n,r));default:return[{path:t,message:n(e)}]}}function em(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>em(e)).join(` & `)}}function tm(){return e=>rm(e,``)}var nm=tm();function rm(e,t){let n;switch(e._tag){case`Filter`:{let r=Jp(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return rm(e.issue,t);let r=Zp(e.issue);n=r===void 0?Qp(em(e.filter),e):Qp(r,e.issue)}break}case`Encoding`:return rm(e.issue,t);case`Pointer`:return rm(e.issue,t+Yc(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>rm(e,t)).join(`
|
|
18
|
+
`);n=im(e)??Qp(Cp(e.ast),e);break;default:n=qp(e);break}return t?`${n}\n at ${t}`:n}function im(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return im(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function am(e){let t;for(let n of e.reasons){if(!Af(n)||!jp(n.error))return;t??=n.error}return t}function om(e,t){let n=am(e);if(n===void 0)throw Error(t,{cause:e});return n}var sm=class e extends zs{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe(mp(hu(t))))}compose(t){return lm(this)?t:lm(t)?this:new e((e,n)=>this.run(e,n).pipe(hp(e=>t.run(e,n))))}},cm=new sm(op);function lm(e){return e.run===cm.run}function um(){return cm}function dm(e){return fm(hu(e))}function fm(e){return new sm(t=>op(e(t)))}function pm(e){return new sm(t=>{let n=gu(t,ec);return mu(n)?op(n):mp(e,fu)})}function mm(){return dm(globalThis.String)}function hm(){return dm(globalThis.Number)}var gm=`~effect/SchemaTransformation/Transformation`,_m=class e{[gm]=gm;_tag=`Transformation`;decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new e(this.encode,this.decode)}compose(t){return new e(this.decode.compose(t.decode),t.encode.compose(this.encode))}};function vm(e){return ac(e,gm)&&e[gm]===gm}var ym=e=>vm(e)?e:new _m(e.decode,e.encode);function bm(e){return new _m(dm(e.decode),dm(e.encode))}var xm=new _m(um(),um());function Sm(){return xm}var Cm=new _m(hm(),mm());function wm(e){return t=>t._tag===e}var Tm=wm(`Declaration`),Em=wm(`Never`),Dm=wm(`Literal`),Om=wm(`UniqueSymbol`),km=wm(`Arrays`),Am=wm(`Objects`),jm=wm(`Suspend`),Mm=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Nm={},Pm=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},Fm=`~effect/Schema`,Im=class{[Fm]=Fm;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},Lm=class e extends Im{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===wp?Ep:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(t,n,r,i,a){let o=$h(this.typeParameters,t);return o===this.typeParameters&&n===this.checks&&r===this.encodingChecks&&i===this.run&&a===this.encodingRun?this:new e(o,i,this.annotations,n,void 0,this.context,r,a)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},Rm=new class extends Im{_tag=`Null`;getParser(){return gg(this,null)}getExpected(){return`null`}},zm=class extends Im{_tag=`Undefined`;getParser(){return gg(this,void 0)}toCodecJson(){return Hh(this,[Bm])}getExpected(){return`undefined`}},Bm=new Mm(Rm,new _m(dm(()=>void 0),dm(()=>null))),Vm=new zm,Hm=new class extends Im{_tag=`Never`;getParser(){return _g(this,nc)}getExpected(){return`never`}},Um=new class extends Im{_tag=`Unknown`;getParser(){return _g(this,rc)}getExpected(){return`unknown`}},Wm=class extends Im{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${F(e)}`);this.literal=e}getParser(){return gg(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?Gm(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:Gm(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Gm(e){let t=globalThis.String(e.literal);return Hh(e,[new Mm(new Wm(t),new _m(dm(()=>e.literal),dm(()=>t)))])}var Km=new class extends Im{_tag=`String`;getParser(){return _g(this,Js)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Tg(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},qm=class extends Im{_tag=`Number`;getParser(){return _g(this,Ys)}matchKey(e,t){return this._match(bg,e,t)}matchPart(e,t){return this._match(yg,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Tg(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(Jm(this.checks,`effect/schema/isFinite`)||Jm(this.checks,`effect/schema/isInt`))?this:Hh(this,[Lh])}toCodecStringTree(){return this.toCodecJson()===this?Hh(this,[Cg]):Hh(this,[wg])}getExpected(){return`number`}};function Jm(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&Jm(e.checks,t))}var Ym=new qm,Xm=new class extends Im{_tag=`Boolean`;getParser(){return _g(this,Xs)}getExpected(){return`boolean`}},Zm=class e extends Im{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(cg(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(cg(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}return gp(function*(e,c){if(e===wp)return wp;if(!Array.isArray(e))return yield*sp(new Bp(n,e,c));r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)})));let l=e.length,u={ast:n,getParser:s,input:e,len:l,tailThreshold:Math.max(a,l-o),output:new globalThis.Array(l),issues:void 0,options:c},d=Qm(u,e,{concurrency:$m(c?.concurrency)?.concurrency,end:n.rest.length===0?a:Math.max(l,a+o)});if(d&&(yield*d),n.rest.length===0&&l>a)for(let t=a;t<=l-1;t++){let r=new Rp(n,e[t],c),i=new Ip([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*sp(new zp(n,[i],e,c))}return u.issues?yield*sp(new zp(n,u.issues,e,c)):u.output})}_rebuild(t,n,r){let i=$h(this.elements,t),a=$h(this.rest,t);return i===this.elements&&a===this.rest&&n===this.checks&&r===this.encodingChecks?this:new e(this.isMutable,i,a,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}},Qm=Cf()({onItem(e,t,n){let r=n<e.len?t:wp;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag===`Failure`)return eh(e,e.ast,r,n);let i=n===Dp?t:n[I];if(i!==wp)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(cg(t.ast))return;let n=new Ip([r],new Lp(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Pf(new zp(e.ast,[n],e.input,e.options))}}}),$m=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),eh=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=am(r.cause);if(i===void 0)return Nf(jf(r.cause,r=>new zp(t,[new Ip([n],r)],e.input,e.options)));let a=new Ip([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Pf(new zp(t,[a],e.input,e.options))},th=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function nh(e,t,n=Nm){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(vg(fg(t)))}var rh=class{name;type;constructor(e,t){this.name=e,this.type=t}};function ih(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(ih);default:return!1}}function ah(e){return ih(e)&&ih(fg(e))}var oh=class{parameter;type;constructor(e,t){if(!ah(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,cg(t)&&!hg(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},sh=class e extends Im{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=e.map(e=>e.name).filter((e,t,n)=>n.indexOf(e)!==t);if(s.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(s)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(e.name);let i=r.length,a=n.indexSignatures.length,o=i&&a?new Set(r):void 0;if(!i&&!a)return _g(n,tc);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return eh(e,n,t,s)??Ff;let c=s===Dp?a:s[I];if(r!==wp&&c!==wp){if(i&&(o.has(t)||o.has(r)))return Ff;nl(e.out,r,c)}return Ff},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!cf(n))return up(dp(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return eh(e,n,t,i)??Ff;let a=i===Dp?t:i[I],o=e.input[t],s=r.parserValue(o,e.options);return cf(s)?l(e,t,a,o,s):up(dp(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return cf(i)?l(e,t,t,r,i):up(dp(i),n=>l(e,t,t,r,n))},f=a?Cf()({onItem:(e,[t,n])=>u(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0,p=()=>(s||(s=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),c=a?n.indexSignatures.map(n=>({is:n,parserKey:e(vg(n.parameter)),parserValue:t(n.type)})):void 0),s),m=gp(function*(e,t){if(e===wp)return wp;if(!(typeof e==`object`&&e&&!Array.isArray(e)))return yield*sp(new Bp(n,e,t));p();let l=e,m={},h={ast:n,input:l,out:m,issues:void 0,options:t},g=t.errors===`all`,_=t.onExcessProperty===`error`,v=t.onExcessProperty===`preserve`,y;if(!a&&(_||v)){o??=new Set(r),y=Reflect.ownKeys(l);for(let r=0;r<y.length;r++){let i=y[r];if(!o.has(i))if(_){let r=new Rp(n,l[i],t),a=new Ip([i],r);if(g){h.issues?h.issues.push(a):h.issues=[a];continue}else return yield*sp(new zp(n,[a],e,t))}else nl(m,i,l[i])}}let b=$m(t?.concurrency);if(i){let e=lh(h,s,b);e&&(yield*e)}if(a&&!b)for(let e=0;e<a;e++){let n=c[e],r=n.is.parameter===Km?d:u,i=n.is.parameter===Km?Object.keys(l):nh(l,n.is.parameter,t);for(let e=0;e<i.length;e++){let t=r(h,i[e],n);if(!cf(t))yield*t;else if(t._tag===`Failure`)return yield*t}}else if(f){let e=od();for(let n=0;n<a;n++){let r=c[n],i=nh(l,r.is.parameter,t);for(let t=0;t<i.length;t++)e.push([i[t],r])}let n=f(h,e,b);n&&(yield*n)}if(h.issues)return yield*sp(new zp(n,h.issues,e,t));if(t.propertyOrder===`original`){let e=(y??Reflect.ownKeys(l)).concat(r),t={};for(let n of e)Object.hasOwn(m,n)&&nl(t,n,m[n]);return t}return m});if(a)return m;let h=(e,t,n)=>{let r=s[t];return up(dp(n),n=>{let i=ch(e,r,n);if(i)return i;let a=()=>Tp(e.out),o=lh(e,s.slice(t+1));return o?hp(o,a):a()})};return(e,t)=>{if(e===wp)return Ep;if(t.errors===`all`||t.onExcessProperty!==void 0||t.propertyOrder===`original`||t.concurrency!==void 0)return m(e,t);if(!(typeof e==`object`&&e&&!Array.isArray(e)))return sp(new Bp(n,e,t));let r=p(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=Object.hasOwn(i,s),l=c?i[s]:wp,u=n.parser(l,t);if(!cf(u))return h(o,e,u);if(u===Dp){c&&nl(a,s,l);continue}let d=ch(o,n,u);if(d)return d}}catch(e){return lp(e)}return Tp(a)}}_rebuild(t,n,r,i){let a=$h(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new rh(e.name,n)}),o=$h(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new oh(r,i)});return a===this.propertySignatures&&o===this.indexSignatures&&r===this.checks&&i===this.encodingChecks?this:new e(a,o,this.annotations,r,void 0,this.context,i)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function ch(e,t,n){if(n._tag===`Failure`)return eh(e,e.ast,t.name,n);if(n===Dp)return;let r=n[I];if(r!==wp){nl(e.out,t.name,r);return}if(delete e.out[t.name],!cg(t.type)){let n=new Ip([t.name],new Lp(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}else return Pf(new zp(e.ast,[n],e.input,e.options))}}var lh=Cf()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(wp,e.options);let n=e.input[t.name];return nl(e.out,t.name,n),t.parser(n,e.options)},step:ch});function uh(e,t){return e?t?[...e,...t]:e:t}function dh(e,t,n){return new sh(Reflect.ownKeys(e).map(t=>new rh(t,e[t].ast)),[],n,t)}function fh(e){return e.ast}function ph(e,t=void 0){return new Zm(!1,e.map(e=>e.ast),[],void 0,t)}function mh(e,t,n){return new Ch(e.map(fh),t,void 0,n)}var hh=Gs(e=>{for(;;){if(jm(e))return Um;let t=e.encoding;if(!t)return e.recur?.(hh,Vs)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==Vs))return Um;e=t[t.length-1].to}});function gh(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(gh)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function _h(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[bp];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!cg(t)){if(Dm(t))return[{key:e.name,literal:t.literal}];if(Om(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!cg(e)){if(Dm(e))return[{key:t,literal:e.literal}];if(Om(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>_h(hh(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return _h(e.thunk())}}var vh=new WeakMap,yh=Object.freeze([]);function bh(e){let t=vh.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=hh(s);if(Em(c))continue;if(o)if(Dm(c)||Om(c)){a??=new Map;let e=Dm(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1;let l=_h(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=gh(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??yh;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(ic(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??yh;if(n)return e}return yh}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??yh;if(!ic(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Object.hasOwn(t,n),u=l?t[n]:void 0;if(l&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);c=n}}if(c===void 0)for(let[e,[i,a]]of n){let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===c)continue;let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??yh).map(t=>e[t]).filter(xh(t));return vh.set(e,t),t}function xh(e){return t=>{let n=hh(t);return n._tag===`Literal`?n.literal===e:n._tag===`UniqueSymbol`?n.symbol===e:!0}}function Sh(e,t,n=!1){return bh(t)(e,n)}var Ch=class e extends Im{_tag=`Union`;types;mode;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.mode=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===wp)return Ep;let a=Sh(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:cf(t)?wh(n,t.cause,r,i):fp(t,e=>wh(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=$m(i?.concurrency),c=Th(o,a,s?{...s,orderedStep:!0}:void 0);return c?hp(c,e=>o.out===Dp?op(r):o.out?o.out:sp(new Hp(n,o.issues??[],r,i))):o.out?o.out:sp(new Hp(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=$h(this.types,t);return i===this.types&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.mode,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=fg(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(Dm);if(t.length>0)return`${Dh(n.isMutable)}[ ${t.map(t=>e(t)+Oh(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>Dm(e.type));if(t.length>0)return`{ ${t.map(t=>`${Dh(t.type.context?.isMutable)}${Jc(t.name)}${Oh(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function wh(e,t,n,r){let i=am(t);return i?Pf(new Hp(e,[i],n,r)):Nf(t)}var Th=Cf()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=am(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),Pf(new Up(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return Ff}}}),Eh=new Ch([new Wm(`Infinity`),new Wm(`-Infinity`),new Wm(`NaN`)],`anyOf`);function Dh(e){return e?``:`readonly `}function Oh(e){return e?`?`:``}function kh(e){let t=!1,n;return()=>t?n:(n=e(),t=!0,n)}var Ah=class e extends Im{_tag=`Suspend`;thunk;constructor(e,t,n,r,i){if(n)throw Error(`Cannot add checks to Suspend`);super(t,void 0,r,i),this.thunk=kh(e)}getParser(e){let t;return(n,r)=>(t??=e(this.thunk()))(n,r)}recur(t){return new e(()=>t(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected(e){return e(this.thunk())}},jh=class e extends zs{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(t){return new e(this.run,{...this.annotations,...t},this.aborted)}abort(){return new e(this.run,this.annotations,!0)}and(e,t){return new Mh([this,e],t)}},Mh=class e extends zs{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(t){return new e(this.checks,{...this.annotations,...t})}and(t,n){return new e([this,t],n)}};function Nh(e,t,n=!1){return new jh((t,n,r)=>Kp(n,e(t,n,r),t,r),t,n)}function Ph(e,t){return new jh((t,n,r)=>e(t)?void 0:new Vp(void 0,t,r),t,!0)}function Fh(e){return Nh(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}var Ih=Kh(Ym,[Fh()]),Lh=new Mm(new Ch([Ih,Eh],`anyOf`),new _m(hm(),dm(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function Rh(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return Nh(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function zh(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var Bh=new WeakMap;function Vh(e){return Bh.get(e)??e}function Hh(e,t){return e.encoding===t?e:zh(e,e=>{e.encoding.value=t})}function Uh(e,t){if(e.context===t)return e;let n=Vh(e);if(n.context===t)return n;let r=zh(e,e=>{e.context.value=t});return Bh.set(r,n),r}function Wh(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return Gh(e,ed(e.checks.slice(0,-1),n.annotate(t)))}return zh(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function Gh(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:zh(e,e=>{e.checks.value=t})}function Kh(e,t){return Gh(e,uh(e.checks,t))}function qh(e,t){let n=t(e.to);return n===e.to?e:new Mm(n,e.transformation)}function Jh(e,t){let n=e,r=n[n.length-1],i=qh(r,t);return i===r?e:ed(e.slice(0,e.length-1),i)}function Yh(e){return t=>t.encoding?Hh(t,Jh(t.encoding,e)):t}function Xh(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:Hh(r,Jh(r.encoding,n))}return e(r)}return Gs(n)}function Zh(e,t,n){let r=new Mm(e,t);return Hh(n,n.encoding?[...n.encoding,r]:[r])}function Qh(e,t){let n=Sp(e);return Wh(e,{brands:n?[...n,t]:[t]})}function $h(e,t){let n=!1,r=Array(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}function eg(e,t){return Uh(e,e.context?new Pm(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Pm(!1,!1,void 0,t))}var tg=Gs(e=>ng(Uh(e,e.context?e.context.isOptional===!1?new Pm(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Pm(!0,!1)))),ng=Yh(tg),rg=Ws(e=>tg(new Ch([e,Vm],`anyOf`)));function ig(e,t){let n=new Mm(Um,new _m(pm(t),um()));return Uh(e,e.context?new Pm(e.context.isOptional,e.context.isMutable,n,e.context.annotations):new Pm(!1,!1,n))}function ag(e,t,n){return Zh(e,n,t)}function og(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Qs(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function sg(e,t){let{literals:n,parameters:r}=og(e);return new sh(n.map(e=>new rh(e,t)),r.map(e=>new oh(e,t)))}function cg(e){return e.context?.isOptional??!1}function lg(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(lg)}function ug(e){function t(e){return lg(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return nd(n)?n:void 0}var dg=Gs(e=>{if(e.encoding)return dg(Hh(e,void 0));let t=e,n=t.recur?.(dg)??t,r=n.encodingChecks;if(r){let t=n===e?r:km(n)||Am(n)||Tm(n)&&n.typeParameters.length>0?ug(r):void 0;return zh(n,e=>{e.encodingChecks.value=void 0,e.checks.value=uh(n.checks,t)})}return n}),fg=Gs(e=>dg(mg(e)));function pg(e,t){let n=t,r=n.length,i=n[r-1],a=[new Mm(mg(Hh(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Mm(mg(n[e-1].to),n[e].transformation.flip()));let o=mg(i.to);return o.encoding?Hh(o,[...o.encoding,...a]):Hh(o,a)}var mg=Ws(e=>{if(e.encoding)return pg(e,e.encoding);let t=e;return t.flip?.(mg)??t.recur?.(mg)??t});function hg(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(hg);default:return!1}}function gg(e,t){let n=Tp(t);return(r,i)=>r===wp?Ep:r===t?n:sp(new Bp(e,r,i))}function _g(e,t){return(n,r)=>n===wp?Ep:t(n)?Dp:sp(new Bp(e,n,r))}var vg=Xh(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(vg)}}),yg=new globalThis.RegExp(`^${th}$`),bg=new globalThis.RegExp(`^(?:${th}|Infinity|-Infinity|NaN)$`);function xg(e){return Rh(yg,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:yg.source}),...e})}var Sg=Kh(Km,[xg()]),Cg=new Mm(Sg,Cm),wg=new Mm(new Ch([Sg,Eh],`anyOf`),Cm);function Tg(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Tg(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new Pp(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Eg(e){if(!Tm(e))return;let t=e.annotations?.[xp];return $s(t)?t(e.typeParameters):void 0}function Dg(e){let t=Rg(Hg,dg(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function Og(e){let t=Dg(e);return(e,n)=>{let r=pp(t(e,n));return If(r)?fu(r.value):(om(r.cause,`Option adapter can only return none for schema issues`),du())}}function kg(e){let t=Dg(e);return(e,n)=>{let r=pp(t(e,n));if(If(r))return r.value;let i=om(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function Ag(e,t){let n=Lg(e.ast);return t===void 0?n:(e,r)=>n(e,Fg(t,r))}function jg(e,t){return zg(Ag(e,t))}function Mg(e,t){return Bg(Ag(e,t))}function Ng(e,t){let n=Lg(mg(e.ast));return t===void 0?n:(e,r)=>n(e,Fg(t,r))}function Pg(e,t){return zg(Ng(e,t))}var Fg=(e,t)=>t?{...e,...t}:e,Ig=e=>e===wp?sp(new Vp):op(e);function Lg(e){return Rg(Vg,e)}function Rg(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Nm);return a===Dp?op(r):cf(a)?a[I]===wp?Ig(wp):a:hp(a,Ig)}}function zg(e){return(t,n)=>pp(e(t,n))}function Bg(e){let t=zg(e);return(e,n)=>{let r=t(e,n);return If(r)?qu(r.value):Ju(om(r.cause,`Result adapter can only return schema issues`))}}var Vg=Ws(e=>qg(e,Vg)),Hg=Ws(e=>qg(e,Hg,Wg)),Ug=Ws(e=>qg(e,Hg,Wg,e.context?.constructorDefault));function Wg(e){return e.context?.constructorDefault?Ug(e):Hg(e)}function Gg(e,t,n,r){let i;if(cf(e)&&e._tag===`Success`){let a=Op(e===Dp?t:e[I]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(Tp(a),r)}else i=n._tag===`Transformation`?hp(e,e=>n.decode.run(Op(e),r)):n.decode(mp(e,Op),r);return cf(i)&&i._tag===`Success`?kp(i[I]):hp(i,kp)}function Kg(e,t){let n;return(r,i)=>r===wp?Ep:e.isConstructed(r)?Dp:Gg((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function qg(e,t,n,r){let i=n?Eg(e):void 0,a=i?Kg(i,t):e.getParser(t,n),o=e.checks,s=r?e.encoding?[...e.encoding,r]:[r]:e.encoding,c=e.encodingChecks,l=(o?o[o.length-1].annotations:e.annotations)?.parseOptions;if(!s&&!o&&!c)return l?(e,t)=>a(e,Fg(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks)if(cf(r)){if(r._tag===`Success`){let i=r===Dp?t:r[I];if(t!==wp&&i!==wp){let i=Tg(c,t,void 0,e,n);i&&(r=sp(new zp(e,i,t,n)))}}}else r=up(r,r=>{if(t!==wp&&r!==wp){let r=Tg(c,t,void 0,e,n);if(r)return sp(new zp(e,r,t,n))}return op(r)});if(o&&!n.disableChecks)if(cf(r)){if(r._tag===`Success`){let i=r===Dp?t:r[I];if(i===wp)return r;let a=Tg(o,i,void 0,e,n);a&&(r=sp(new zp(e,a,i,n)))}}else r=up(r,t=>{if(t!==wp){let r=Tg(o,t,void 0,e,n);if(r)return sp(new zp(e,r,t,n))}return op(t)});return r};return s?(n,r)=>{l&&(r=Fg(r,l));let i=u??=s.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=s.length-1;e>=0;e--)if(o=Gg(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[I],o=t(a,r)):o=hp(o,e=>{let n=t(e,r);return n===Dp?Tp(e):n})}if(o._tag===`Success`){let e=o[I],t=d(e,r);return t===Dp?o:t}return o=fp(o,t=>cp(()=>jf(t,t=>new Fp(e,t,n,r)))),hp(o,e=>{let t=d(e,r);return t===Dp?Tp(e):t})}:l?(e,t)=>d(e,Fg(t,l)):d}var Jg=`~effect/Schema/Schema`,Yg={[Jg]:Jg,pipe(){return Ls(this,arguments)},annotate(e){return this.rebuild(Wh(this.ast,e))},annotateKey(e){return this.rebuild(eg(this.ast,e))},check(...e){return this.rebuild(Kh(this.ast,e))}};function Xg(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,Yg),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>Xg(e,t),r.makeEffect=Dg(r),r.make=kg(r),r.makeOption=Og(r),r}var Zg=Bs(2,(e,t)=>({...e,...t})),Qg=Bs(2,(e,t)=>e_(e,(e,n)=>[Object.hasOwn(t,e)?t[e]:e,n])),$g=e=>e;function e_(e,t){let n={};for(let r of Reflect.ownKeys(e)){if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;let i=t(r,e[r]);if(i){let[e,t]=i;nl(n,e,t)}}return n}var t_=Jg;function n_(){return(e,t,n)=>d_(new Lm(e.map(fh),e=>t(e.map(e=>d_(e))),n))}function r_(e,t){return n_()([],()=>(t,n,r)=>e(t)?op(t):sp(new Bp(n,t,r)),t)}var i_=`~effect/SchemaError/SchemaError`,a_=class extends _d(`SchemaError`){[i_]=i_;constructor(e){let t=Ed();Dd(0);try{super({issue:e})}finally{Dd(t)}}get message(){return nm(this.issue)}toString(){return`SchemaError(${this.message})`}};function o_(e){return ac(e,i_)&&e[i_]===i_}function s_(e,t){let n=jg(e,t);return(e,t)=>c_(n(e,t))}function c_(e){return If(e)?e:Nf(jf(e.cause,e=>new a_(e)))}function l_(e,t){let n=Mg(e,t);return(e,t)=>Zu(n(e,t),e=>new a_(e))}function u_(e,t){let n=Pg(e,t);return(e,t)=>c_(n(e,t))}var d_=Xg;function f_(e){return ac(e,t_)&&e[t_]===t_}var B=$g(e=>{let t=E_(e);return d_(rg(e.ast),{schema:t})}),V=$g(e=>d_(dg(e.ast),{schema:e})),p_=$g(e=>d_(fg(e.ast),{schema:e}));function H(e){let t=d_(new Wm(e),{literal:e,transform(n){return t.pipe(k_(H(n),{decode:dm(()=>n),encode:dm(()=>e)}))}});return t}var m_=d_(Hm),h_=d_(Rm),g_=d_(Vm),U=d_(Km),W=d_(Ym),G=d_(Xm);function __(e,t){return d_(e,{fields:t,mapFields(e,t){let n=e(this.fields);return __(dh(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function K(e){return __(dh(e,void 0),e)}function v_(e){return $g(t=>t.mapFields(Zg(e)))}var y_=e=>typeof e==`symbol`?e:globalThis.String(e);function b_(e){return function(t){let n={},r=Object.create(null),i=Object.create(null),a=new Set;for(let o of Reflect.ownKeys(t.fields)){let s=p_(t.fields[o]),c=Object.hasOwn(e,o),l=c?e[o]:o,u=y_(l);if(a.has(u))throw new globalThis.Error(`Duplicate encoded keys: ${Jc(l)}`);a.add(u),nl(n,l,s),c&&(r[o]=l,i[l]=o)}return K(n).pipe(k_(t,bm({decode:Qg(i),encode:Qg(r)})))}}function x_(e,t){return d_(sg(e.ast,t.ast),{key:e,value:t})}function S_(e,t){return d_(e,{elements:t,mapElements(e,t){let n=e(this.elements);return S_(ph(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function C_(e){return S_(ph(e),e)}var q=$g(e=>d_(new Zm(!1,[],[e.ast]),{value:e})),w_=$g(e=>d_(new Zm(!1,[e.ast],[e.ast]),{value:e}));function T_(e,t){return d_(e,{members:t,mapMembers(e,t){let n=e(this.members);return T_(mh(n,this.ast.mode,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function J(e,t){return T_(mh(e,t?.mode??`anyOf`,void 0),e)}function Y(e){let t=e.map(H);return d_(mh(t,`anyOf`,void 0),{literals:e,members:t,mapMembers(e){return J(e(this.members))},pick(e){return Y(e)},transform(e){return J(t.map((t,n)=>t.transform(e[n])))}})}var X=$g(e=>J([e,h_])),E_=$g(e=>J([e,g_]));function D_(e){return d_(new Ah(()=>e().ast))}function Z(...e){return t=>t.check(...e)}function O_(e,t){return n=>d_(Kh(n.ast,[Ph(e,t)]),{schema:n})}function Q(e){return t=>d_(Qh(t.ast,e),{schema:t,identifier:e})}function k_(e,t){return n=>d_(ag(n.ast,e.ast,t?ym(t):Sm()),{from:n,to:e})}function A_(e){return t=>d_(ig(t.ast,e),{schema:t})}function j_(e){return H(e).pipe(A_(op(e)))}function M_(e,t){return K({_tag:j_(e),...t})}var $=Nh,N_=d_(Ih);function P_(e,t){return e=Math.max(0,Math.floor(e)),$(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:t})=>t===`array`?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[yp]:!0,arbitrary:{constraint:{minLength:e}},...t})}globalThis.RegExp,globalThis.URL,globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;var F_=globalThis.Symbol.for(`immer-draftable`),I_={};function L_(e,t,n,r,i){let a=B_(n,t,r),o=z_(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===I_?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:I_,value:i}})}static[t_]=t_;get[o](){return o}static[F_]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return Ls(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return new this(e,t)}static makeOption(e,t){return Og(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(Wh(this.ast,e))}static annotateKey(e){return this.rebuild(eg(this.ast,e))}static check(...e){return this.rebuild(Kh(this.ast,e))}static extend(e){return(t,r)=>{let a=V_(t)?t:K(t),o={...n.fields,...a.fields},s=dh(o,n.ast.checks,{identifier:e});return L_(this,e,__(Kh(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(s.prototype,i(t)),s}function R_(e){return new _m(dm(t=>new e(t,{"~payload":{token:I_,value:t}})),um())}function z_(e){return`~effect/Schema/Class/${e}`}function B_(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=z_(t),o=e=>e instanceof i||ac(e,a),s=R_(i);return r=k_(d_(new Lm([e.ast],()=>(e,t,n)=>o(e)?op(e):sp(new Bp(t,e,n)),{identifier:t,[xp]:([e])=>({isConstructed:o,link:new Mm(e,s)}),toCodec:([e])=>new Mm(e.ast,s),toArbitrary:([e])=>()=>({arbitrary:e.arbitrary.map(e=>new i(e)),terminal:e.terminal?.map(e=>new i(e))}),toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[bp]:_h(e.ast),...n})),s)(e)}}function V_(e){return f_(e)}var H_=e=>(t,n)=>L_(Wl,e,V_(t)?t:K(t),n,e=>({name:e})),U_=e=>(t,n,r)=>{let i=V_(n)?n.mapFields(e=>({_tag:j_(t),...e}),{unsafePreserveChecks:!0}):M_(t,n);return H_(e??t)(i,r)},W_=new WeakMap,G_=new WeakMap,K_=new WeakMap;function q_(e,t){let n=r_(t=>Z_(t)&&W_.get(t)?.kind===e,{identifier:e===`text`?`RecordTextContent`:`RecordBytesContent`});return G_.set(n,Object.freeze({kind:e,maximumBytes:t})),G_.set(n.ast,Object.freeze({kind:e,maximumBytes:t})),K_.set(n.ast.run,Object.freeze({kind:e,maximumBytes:t})),n}var J_=q_(`text`,void 0),Y_=q_(`bytes`,void 0),X_=Object.freeze({maximumBytes(e){if(!Number.isSafeInteger(e)||e<0)throw TypeError(`Record content maximumBytes must be a non-negative safe integer`);return t=>{let n=G_.get(t);if(n===void 0)throw TypeError(`Record content maximumBytes requires a package-owned content declaration`);return q_(n.kind,e)}}});function Z_(e){return typeof e==`object`&&!!e&&W_.has(e)}var Q_=Object.freeze({entries:4096,groupDepth:16,displayCodePoints:256,jsonDepth:8,jsonObjectKeys:64,jsonArrayItems:256,stringBytes:8*1024,diagnosticDepth:2,diagnosticNodes:64,diagnosticBytes:64*1024,collectionDiagnosticCandidates:8}),$_=[`less-than`,`at-most`,`greater-than`,`at-least`],ev=`@niceeval/assertions/AssertionEntryId`,tv=64*1024;Object.freeze({errors:`all`,onExcessProperty:`error`});var nv=new TextEncoder,rv=/[\p{Cc}]/u,iv=/^ae_[a-z0-9]{20}$/,av=/^[\x21-\x7e]+$/;function ov(e){return nv.encode(e).byteLength}function sv(e){return Array.from(e).length}function cv(e){return ov(e)<=Q_.stringBytes}function lv(e){return!rv.test(e)&&sv(e)<=Q_.displayCodePoints}function uv(e){return ov(e)<=128&&av.test(e)}function dv(e){return Number.isFinite(e)&&Number.isInteger(e)&&e>=0}function fv(e){return Number.isFinite(e)&&e>=0}function pv(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function mv(e){return Object.keys(e).length<=Q_.jsonObjectKeys}function hv(e){return e.length<=Q_.jsonArrayItems}function gv(e){return iv.test(e)}function _v(e){try{let t=JSON.stringify(e);return typeof t==`string`&&ov(t)<=4194304}catch{return!1}}function vv(e){let t=new Set;for(let n of e.entries){if(t.has(n.entryId))return!1;t.add(n.entryId)}return!0}function yv(e){let t=e.coverage;return t.state===`complete`?e.limitations.length===0:t.state===`partial`?e.limitations.some(e=>e.kind===t.reason):!0}var bv=U.check($(cv,{identifier:`AssertionsBoundedJsonString`,description:`a UTF-8 string no longer than 8 KiB`})),xv=U.check($(lv,{identifier:`AssertionDisplayText`,description:`text without control characters and at most 256 code points`})),Sv=bv.check($(e=>e.length>0&&!rv.test(e),{identifier:`MatcherSourceIdentity`,description:`a non-empty bounded source identity without control characters`})),Cv=U.check($(uv,{identifier:`AssertionCriterionIdentifier`,description:`a non-empty printable ASCII identifier no longer than 128 bytes`})),wv=N_.check($(dv,{identifier:`AssertionNonNegativeInteger`,description:`a finite non-negative integer`})),Tv=N_.check($(e=>Number.isSafeInteger(e)&&e>0,{identifier:`AssertionPositiveInteger`,description:`a positive safe integer`})),Ev=N_.check($(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`AssertionNonNegativeSafeInteger`,description:`a non-negative safe integer`})),Dv=N_.check($(fv,{identifier:`AssertionNonNegativeNumber`,description:`a finite non-negative number`}));function Ov(e){if(e===`0`)return!0;if(!/^[1-9][0-9]*$/.test(e))return!1;let t=Number(e);return Number.isSafeInteger(t)&&t>=0&&t<4294967295}function kv(e,t,n){if(e===null||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(typeof e==`string`)return cv(e);if(typeof e!=`object`||t>=Q_.jsonDepth)return!1;try{if(n.has(e))return!1;if(n.add(e),Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype||!hv(e))return!1;for(let t of Reflect.ownKeys(e)){if(t===`length`)continue;if(typeof t!=`string`||!Ov(t))return!1;let n=Object.getOwnPropertyDescriptor(e,t);if(n===void 0||!n.enumerable||!(`value`in n))return!1}for(let r=0;r<e.length;r+=1)if(!Object.prototype.hasOwnProperty.call(e,r)||!kv(e[r],t+1,n))return!1;return!0}let r=e;if(!pv(r)||!mv(r))return!1;for(let e of Reflect.ownKeys(r)){if(typeof e!=`string`||!cv(e))return!1;let i=Object.getOwnPropertyDescriptor(r,e);if(i===void 0||!i.enumerable||!(`value`in i)||!kv(i.value,t+1,n))return!1}return!0}catch{return!1}finally{n.delete(e)}}function Av(e){return kv(e,0,new WeakSet)}function jv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&kv(e,0,new WeakSet)}var Mv=D_(()=>J([h_,G,N_,bv,q(Mv),x_(bv,Mv)]).check($(Av,{identifier:`AssertionsBoundedJsonValue`,description:`a recursive JSON value within the Assertions limits`}))),Nv=Mv,Pv=x_(bv,Mv).check($(jv,{identifier:`AssertionsBoundedJsonObject`,description:`a recursive JSON object within the Assertions limits`})),Fv=U.check($(gv,{identifier:`AssertionEntryId`,description:`an attachment-local ae_ identifier with 20 lowercase base-36 characters`})).pipe(Q(ev)),Iv=K({key:B(xv),label:B(xv),groupPath:q(xv).check($(e=>e.length<=Q_.groupDepth,{identifier:`AssertionDisplayGroupPath`,description:`a group path no deeper than 16 segments`}))}),Lv=K({kind:H(`builtin`),id:Cv,data:Nv}),Rv=K({name:Cv,schemaId:Cv,data:Nv});J([Lv,Rv]);var zv=J([J([K({kind:H(`builtin`),id:H(`value-match/v1`),data:K({subject:H(`explicit-value`),matcher:J([K({state:H(`declared`),name:bv}),K({state:H(`unavailable`)})])})}),K({kind:H(`builtin`),id:H(`numeric-comparison/v1`),data:K({comparator:Y($_),threshold:N_,subject:J([K({kind:H(`explicit-value`)}),K({kind:H(`scope-metric`),metric:H(`tokens`),scope:Y([`turn`,`session`,`attempt`]),unit:H(`tokens`)}),K({kind:H(`scope-metric`),metric:H(`cost`),scope:Y([`turn`,`session`,`attempt`]),unit:H(`usd`)}),K({kind:H(`collection-cardinality`),collection:H(`tool-calls`),scope:Y([`turn`,`session`,`attempt`])})])})}),K({kind:H(`builtin`),id:H(`scope-status/v1`),data:K({scope:Y([`turn`,`session`,`attempt`]),assertion:Y([`succeeded`,`no-failed-actions`])})}),K({kind:H(`builtin`),id:H(`occurrence/v1`),data:K({scope:Y([`turn`,`session`,`attempt`]),occurrence:Y([`tool`,`skill`,`event`]),assertion:Y([`present`,`absent`,`count`,`order`]),matcher:B(bv),quantifier:B(J([K({kind:H(`absent`)}),K({kind:Y([`at-least`,`exact`]),count:Tv})]))})}),K({kind:H(`builtin`),id:H(`occurrence/v2`),data:K({scope:Y([`turn`,`session`,`attempt`]),occurrence:Y([`tool`,`skill`,`event`]),assertion:Y([`present`,`absent`,`count`,`order`]),matcher:B(bv),quantifier:B(J([K({kind:H(`absent`)}),K({kind:H(`exact`),count:Tv}),K({kind:Y([`at-least`,`less-than`,`at-most`,`greater-than`]),count:Ev})]))})}),K({kind:H(`builtin`),id:H(`judge-measurement/v1`),data:K({recipe:Y([`closed-qa`,`factuality`,`summarizes`]),scale:H(`unit-interval`)})}),J([K({kind:H(`builtin`),id:H(`sandbox-result/v1`),data:K({operation:H(`changed-paths`),paths:q(bv)})}),K({kind:H(`builtin`),id:H(`sandbox-result/v1`),data:K({operation:H(`no-changes`)})}),K({kind:H(`builtin`),id:H(`sandbox-result/v1`),data:K({operation:H(`file-changed`),path:bv,status:B(Y([`added`,`modified`,`deleted`])),before:B(bv),after:B(bv)})}),K({kind:H(`builtin`),id:H(`sandbox-result/v1`),data:K({operation:H(`file-deleted`),path:bv})}),K({kind:H(`builtin`),id:H(`sandbox-result/v1`),data:K({operation:H(`not-in-diff`),pattern:bv,flags:bv,content:Y([`added`,`removed`,`both`])})})]),K({kind:H(`builtin`),id:H(`direct-score/v1`),data:K({source:H(`author`)})})]),Rv]),Bv=J([K({state:H(`complete`)}),K({state:H(`partial`),reason:Y([`sampled`,`truncated`,`redacted`,`provider-limited`])}),K({state:H(`unavailable`),reason:Y([`not-collected`,`source-unavailable`,`producer-failed`])}),K({state:H(`not-applicable`),reason:Y([`optional-material`,`unsupported-subject`])})]),Vv=J([K({kind:H(`redacted`),fieldCount:wv}),K({kind:H(`sampled`),captured:wv,knownTotal:B(wv)}),K({kind:H(`truncated`),omittedBytes:wv}),K({kind:H(`provider-limited`)})]),Hv=K({state:H(`not-scored`)}),Uv=K({state:H(`earned`),points:Dv,earned:Dv}).check($(e=>e.earned<=e.points,{identifier:`AssertionEarnedScore`,description:`an earned score no greater than its points`})),Wv=K({state:H(`unavailable`),points:Dv,reason:Y([`source-unavailable`,`evaluation-errored`,`not-applicable`])});function Gv(e){return e.matched+e.mismatched+e.unavailable!==e.examined||e.knownTotal!==null&&e.examined>e.knownTotal||e.complete&&e.knownTotal===null?!1:!e.exhaustive||e.knownTotal!==null&&e.examined===e.knownTotal}var Kv=K({examined:wv,matched:wv,mismatched:wv,unavailable:wv,knownTotal:X(wv),complete:G,exhaustive:G,decisive:G}).check($(Gv,{identifier:`AssertionCollectionReceipt`,description:`a collection receipt whose counts and completion boundary agree`})),qv=D_(()=>J([K({kind:H(`unavailable`),reason:Y([`not-recorded`,`not-declared`,`source-unavailable`])}),K({kind:H(`value`),value:J([h_,G,N_,bv])}),K({kind:H(`text`),text:bv}),K({kind:H(`list`),items:q(qv)}),K({kind:H(`fields`),fields:q(K({label:bv,value:qv}))})])),Jv=J([K({state:H(`exact`)}),K({state:H(`unavailable`),reason:Y([`historical-not-recorded`,`source-unavailable`,`ambiguous`])})]),Yv=J([K({kind:H(`tool-occurrence`),toolOccurrenceId:Sv,relation:Jv}),K({kind:H(`event`),eventId:Sv,toolOccurrenceId:B(Sv),relation:Jv})]),Xv=q(K({locator:Yv,result:Y([`matched`,`mismatched`,`unavailable`,`not-evaluated`]),difference:B(qv)})).check($(e=>e.length<=8,{identifier:`MatcherRetainedRows`,description:`at most eight representative matcher rows`})),Zv=K({step:Tv,summary:qv}),Qv=K({family:H(`niceeval.agent-turns`),schemaVersion:Tv}),$v=Y([`complete`,`partial`,`unavailable`]),ey=K({scope:H(`turn`),sessionId:Sv,turnId:Sv,scopeId:Sv,throughSessionSequence:wv,source:Qv,collectionAtCut:$v}),ty=K({scope:H(`session`),sessionId:Sv,scopeId:Sv,throughSessionSequence:wv,source:Qv,collectionAtCut:$v}),ny=J([ey,ty,K({scope:H(`attempt`),scopeId:Sv,sessions:q(K({sessionId:Sv,throughSessionSequence:wv})).check($(e=>e.every((t,n)=>n===0||e[n-1].sessionId<t.sessionId),{identifier:`MatcherAttemptVectorCut`,description:`a unique vector cut in canonical session identity order`})),source:Qv,collectionAtCut:$v})]),ry=K({sourceRows:wv,comparisons:wv,unavailableComparisons:wv,definitePrefixLength:wv,possiblePrefixLength:wv,stepReceipts:q(K({step:Tv,comparisons:wv,matched:wv,mismatched:wv,unavailable:wv}).check($(e=>e.matched+e.mismatched+e.unavailable===e.comparisons,{identifier:`MatcherOrderStepReceipt`,description:`an order step receipt whose result counts equal its comparisons`}))),complete:G,exhaustive:G,decisive:G}),iy=K({step:Tv,locator:Yv,sessionId:Sv,sessionSequence:Tv,result:Y([`matched`,`unavailable`])}),ay=K({longestDefinitePrefix:q(iy),longestPossiblePrefix:q(iy),firstBlockingStep:Tv,suffixChecked:Kv,representatives:Xv});function oy(e,t,n,r){if(e.length!==n)return!1;let i=0;for(let[n,a]of e.entries()){if(a.step!==n+1||a.sessionId!==t.sessionId||a.sessionSequence<=i||a.sessionSequence>t.throughSessionSequence||r===`matched`&&a.result!==`matched`||a.result===`matched`&&a.locator.relation.state!==`exact`)return!1;i=a.sessionSequence}return!0}function sy(e){let t=e.querySteps.length,n=e.receipt;if(e.querySteps.some((e,t)=>e.step!==t+1)||n.stepReceipts.length!==t||n.stepReceipts.some((e,t)=>e.step!==t+1)||n.definitePrefixLength>n.possiblePrefixLength||n.possiblePrefixLength>t||n.comparisons!==n.stepReceipts.reduce((e,t)=>e+t.comparisons,0)||n.unavailableComparisons!==n.stepReceipts.reduce((e,t)=>e+t.unavailable,0)||n.complete!==(e.sourceSnapshot.collectionAtCut===`complete`)||n.stepReceipts.some(e=>e.comparisons>n.sourceRows)||n.stepReceipts.some((e,t)=>t>0&&e.comparisons!==n.stepReceipts[0].comparisons)||n.exhaustive&&n.stepReceipts.some(e=>e.comparisons!==n.sourceRows))return!1;switch(e.result.state){case`matched`:return n.definitePrefixLength===t&&n.possiblePrefixLength===t&&n.decisive&&oy(e.result.witnessPath,e.sourceSnapshot,t,`matched`);case`mismatched`:{let r=e.result.failureFrontier;return n.complete&&n.exhaustive&&n.decisive&&n.possiblePrefixLength<t&&r.firstBlockingStep===n.possiblePrefixLength+1&&r.suffixChecked.complete&&r.suffixChecked.exhaustive&&r.suffixChecked.decisive&&r.suffixChecked.knownTotal===r.suffixChecked.examined&&r.suffixChecked.matched===0&&r.suffixChecked.unavailable===0&&oy(r.longestDefinitePrefix,e.sourceSnapshot,n.definitePrefixLength,`matched`)&&oy(r.longestPossiblePrefix,e.sourceSnapshot,n.possiblePrefixLength,`possible`)}case`unavailable`:return e.result.reason.length>0&&!n.decisive}}var cy=K({kind:H(`collection-filter`),sourceSnapshot:ny,query:Zv,receipt:Kv,retainedRows:Xv}).check($(e=>e.query.step===1&&e.receipt.knownTotal!==null&&e.receipt.complete===(e.sourceSnapshot.collectionAtCut===`complete`),{identifier:`MatcherCollectionFilterArtifact`,description:`a collection matcher artifact with one query and a matching source cut`})),ly=J([K({state:H(`matched`),witnessPath:q(iy)}),K({state:H(`mismatched`),failureFrontier:ay}),K({state:H(`unavailable`),reason:Sv})]),uy=K({kind:H(`ordered-sequence`),sourceSnapshot:J([ey,ty]),querySteps:q(Zv).check($(e=>e.length>=2&&e.length<=64,{identifier:`MatcherOrderQuerySteps`,description:`between two and 64 ordered matcher query steps`})),receipt:ry,result:ly,retainedRows:Xv}).check($(sy,{identifier:`MatcherOrderedSequenceArtifact`,description:`an ordered matcher artifact with consistent receipts, paths, and cut`}));function dy(e){try{return ov(JSON.stringify(e))<=tv}catch{return!1}}var fy=J([cy,uy]).check($(dy,{identifier:`MatcherQueryArtifactSize`,description:`a matcher query artifact no larger than 64 KiB`})),py=J([K({kind:H(`boolean`),expected:H(!0)}),K({kind:H(`at-least`),threshold:Dv}),K({kind:H(`record-only`)})]),my=K({requirement:J([K({state:H(`available`),value:Y([`required`,`optional`])}),K({state:H(`unavailable`),reason:H(`not-recorded`)})]),condition:J([K({state:H(`available`),value:py}),K({state:H(`unavailable`),reason:H(`not-recorded`)})])});J([K({state:H(`matched`),gate:Y([`not-gate`,`satisfied`]),score:J([Hv,Uv]),diagnostic:B(Pv),receipt:B(Kv)}),K({state:H(`mismatched`),reason:H(`condition-not-met`),gate:Y([`not-gate`,`failed`]),score:J([Hv,Uv]),diagnostic:B(Pv),receipt:B(Kv)}),K({state:H(`unavailable`),reason:Y([`evidence-unavailable`,`source-unavailable`,`redacted`]),gate:Y([`not-gate`,`unavailable`]),score:J([Hv,Wv]),diagnostic:B(Pv),receipt:B(Kv)}),K({state:H(`errored`),reason:Y([`evaluator-failed`,`producer-interrupted`,`invalid-subject`]),gate:Y([`not-gate`,`unavailable`]),score:J([Hv,Wv]),diagnostic:B(Pv),receipt:B(Kv)}),K({state:H(`not-applicable`),reason:H(`coverage-not-applicable`),gate:Y([`not-gate`,`not-applicable`]),score:J([Hv,Wv]),diagnostic:B(Pv),receipt:B(Kv)})]);function hy(e){let t=q(e),n=q(V(Vv)),r=K({source:e,evidence:t,coverage:V(Bv),limitations:n}).check($(e=>yv(e),{identifier:`AssertionCoverageLimitations`,description:`coverage and limitations with a consistent sealed relationship`})),i=K({observed:V(qv),receipt:B(V(Kv))}),a=J([K({kind:H(`ordinary`),observed:V(qv),receipt:B(V(Kv))}),K({kind:H(`matcher-current`),observed:V(qv),artifact:V(fy),receipt:B(m_)}),K({kind:H(`matcher-legacy`),observed:V(qv),reason:H(`historical-not-recorded`),legacyDiagnostic:B(V(qv)),receipt:B(m_)})]),o=K({result:Y([`matched`,`mismatched`,`unavailable`,`errored`,`not-applicable`]),reason:X(Y([`condition-not-met`,`evidence-unavailable`,`source-unavailable`,`redacted`,`evaluator-failed`,`producer-interrupted`,`invalid-subject`,`coverage-not-applicable`])),gate:Y([`not-gate`,`satisfied`,`failed`,`unavailable`,`not-applicable`])}),s=J([K({state:H(`retained`),value:V(qv)}),K({state:H(`unavailable`),reason:H(`not-recorded`)})]),c=K({entryId:V(Fv),display:V(Iv),criterion:J([K({state:H(`available`),value:V(Pv)}),K({state:H(`unavailable`),reason:H(`not-recorded`)})]),materials:r,evaluation:i,decision:o,policy:V(my),contribution:J([V(Hv),V(Uv),V(Wv)]),explanationRetention:s}),l=K({entryId:V(Fv),display:V(Iv),criterion:J([K({state:H(`available`),value:V(Pv)}),K({state:H(`unavailable`),reason:H(`not-recorded`)})]),materials:r,evaluation:a,decision:o,policy:V(my),contribution:J([V(Hv),V(Uv),V(Wv)]),explanationRetention:s}).check($(e=>e.evaluation.kind===`ordinary`||e.explanationRetention.state===`unavailable`,{identifier:`MatcherExplanationOwnership`,description:`matcher artifacts and legacy diagnostics are not duplicated in explanation retention`})),u=q(c).check($(e=>e.length<=Q_.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`})),d=q(l).check($(e=>e.length<=Q_.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`})),f=K({entries:d}).check($(vv,{identifier:`AssertionsUniqueEntryIds`,description:`unique attachment-local assertion entry IDs`}),$(_v,{identifier:`AssertionsDocumentSize`,description:`a JSON document no larger than 4 MiB`})),p=K({entryId:V(Fv),display:V(Iv),criterion:J([K({state:H(`available`),value:V(zv)}),K({state:H(`unavailable`),reason:H(`not-recorded`)})]),materials:r,evaluation:a,decision:o,policy:V(my),contribution:J([V(Hv),V(Uv),V(Wv)]),explanationRetention:s}),m=K({entries:q(p).check($(e=>e.length<=Q_.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`}))}).check($(vv,{identifier:`AssertionsUniqueEntryIds`,description:`unique attachment-local assertion entry IDs`}),$(_v,{identifier:`AssertionsDocumentSize`,description:`a JSON document no larger than 4 MiB`}));return Object.freeze({material:e,entry:p,entries:d,historicalV2Entries:u,outerDocument:f,document:m})}Object.freeze({code:`assertions-document-invalid`});var gy=/^@1[0-9A-HJKMNP-TV-Z]{12}$/;U.pipe(O_(e=>gy.test(e),{identifier:`AttemptLocator`,description:`a canonical @-prefixed Attempt locator`})),new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);var _y=`@niceeval/record/RecordId`,vy=`@niceeval/record/RunId`,yy=`@niceeval/record/SlotId`,by=`@niceeval/record/AttemptId`,xy=`@niceeval/record/UtcMillis`,Sy=`@niceeval/record/RecordAttachmentName`,Cy=`@niceeval/record/RecordAttachmentSchemaId`,wy=`@niceeval/record/RecordFormatId`,Ty=`@niceeval/record/ExperimentId`,Ey=`@niceeval/record/EvalId`,Dy=`@niceeval/record/ExecutionIdentityDigest`,Oy=`@niceeval/record/Sha256Digest`,ky=`@niceeval/record/SourceItemId`,Ay=`@niceeval/record/FileChangeId`,jy=`@niceeval/record/ArtifactId`,My=`@niceeval/record/RecordBlobKey`,Ny=`@niceeval/record/SourceSegmentId`,Py=`@niceeval/record/CanonicalRunRelativePath`,Fy=`@niceeval/record/CanonicalProjectRelativePath`,Iy=`niceeval.record.attachments`,Ly=/^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,253}[A-Za-z0-9])?$/,Ry=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,zy=`[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?`,By=RegExp(`^(?:${zy}\\.)+${zy}$`),Vy=/^niceeval\.record\.attachments$/,Hy=/^[a-f0-9]{64}$/;function Uy(e){return Ly.test(e)&&!Ry.test(e)}function Wy(e,t){return e===t?0:e<t?-1:1}function Gy(e){return Number.isSafeInteger(e)&&e>=0}function Ky(e){return e.length>0&&e.length<=1024&&!/[\u0000-\u001f\u007f]/.test(e)}function qy(e){return Hy.test(e)}function Jy(e){return Uy(e)}function Yy(e){return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/.test(e)}function Xy(e){return e.length>0&&e.length<=4096&&!e.startsWith(`/`)&&!e.startsWith(`\\`)&&!e.includes(`\\`)&&e.split(`/`).every(Uy)}function Zy(e){return e.length>0&&e.length<=4096&&!e.startsWith(`/`)&&!e.startsWith(`\\`)&&!e.includes(`\\`)&&!/[\u0000-\u001f\u007f]/.test(e)&&e.split(`/`).every(e=>e.length>0&&e!==`.`&&e!==`..`)}function Qy(e){return e.length<=255&&Uy(e)&&By.test(e)}function $y(e){return Qy(e)?{name:e,version:`1`}:void 0}function eb(e){let t=$y(e);return t!==void 0&&Qy(t.name)}function tb(e){return Vy.test(e)}var nb=U.check($(Uy,{identifier:`RecordPortableSegment`,description:`an ASCII portable file-name segment without path separators or reserved device names`})),rb=nb.pipe(Q(_y)),ib=nb.pipe(Q(vy)),ab=nb.pipe(Q(yy)),ob=nb.pipe(Q(by)),sb=U.check($(Ky,{identifier:`RecordDomainIdentity`,description:`a bounded durable identity without control characters`})),cb=sb.pipe(Q(Ty)),lb=sb.pipe(Q(Ey)),ub=U.check($(qy,{identifier:`ExecutionIdentityDigest`,description:`a lowercase hexadecimal SHA-256 execution identity digest`})).pipe(Q(Dy)),db=U.check($(qy,{identifier:`Sha256Digest`,description:`a lowercase hexadecimal SHA-256 digest`})).pipe(Q(Oy)),fb=nb.pipe(Q(ky)),pb=nb.pipe(Q(Ay)),mb=nb.pipe(Q(jy)),hb=U.check($(Jy,{identifier:`RecordBlobKey`,description:`an opaque portable Attachment blob key`})).pipe(Q(My));U.check($(Yy,{identifier:`SourceSegmentId`,description:`a bounded opaque source receipt segment identity`})).pipe(Q(Ny)),U.check($(Xy,{identifier:`CanonicalRunRelativePath`,description:`a slash-separated portable path inside one sealed Run`})).pipe(Q(Py));var gb=U.check($(Zy,{identifier:`CanonicalProjectRelativePath`,description:`a slash-separated project-relative path without dot segments`})).pipe(Q(Fy)),_b=W.check($(Gy,{identifier:`UtcMillis`,description:`a non-negative JSON-safe Unix-epoch millisecond value`})).pipe(Q(xy));U.check($(Qy,{identifier:`RecordAttachmentName`,description:`a lowercase reverse-domain portable Attachment name`})).pipe(Q(Sy)),U.check($(eb,{identifier:`RecordAttachmentSchemaId`,description:`a RecordAttachment name followed by /vN`})).pipe(Q(Cy)),U.check($(tb,{identifier:`RecordFormatId`,description:`the current generic Attachment Record format identity`})).pipe(Q(wy));var vb=Y([Iy]).pipe(Q(wy)),yb=new TextEncoder,bb=Object.freeze({"$niceeval.record.blob-ref":!0});function xb(e,t,n){e.failure===void 0&&(e.failure=Object.freeze({code:t,path:Object.freeze([...n])}))}function Sb(e,t){if(e===t)return 0;let n=yb.encode(e),r=yb.encode(t),i=Math.min(n.byteLength,r.byteLength);for(let e=0;e<i;e+=1){let t=n[e]-r[e];if(t!==0)return t}return n.byteLength-r.byteLength}function Cb(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(t+1>=e.length||n<56320||n>57343)return!1;t+=1}else if(n>=56320&&n<=57343)return!1}return!0}function wb(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Tb(e,t){let n=Object.getOwnPropertyDescriptor(e,t);if(!(n===void 0||!(`value`in n)||n.enumerable!==!0))return Object.freeze({value:n.value})}function Eb(e,t){let n=Object.getOwnPropertyDescriptor(e,t);if(!(n===void 0||!(`value`in n)))return Object.freeze({value:n.value})}function Db(e,t,n,r,i){if(t>r.maximumDepth||(i.nodes+=1,i.nodes>r.maximumNodes))return xb(i,`record-json-limit-exceeded`,n),!1;if(typeof e==`string`){if(!Cb(e))return xb(i,`record-json-invalid`,n),!1;if(yb.encode(e).byteLength>r.maximumStringUtf8Bytes)return xb(i,`record-json-limit-exceeded`,n),!1}return!0}function Ob(e,t,n,r){let i=Reflect.ownKeys(e);if(i.some(e=>typeof e!=`string`))return xb(r,`record-json-invalid`,t);if(i.length>n.maximumObjectKeys)return xb(r,`record-json-limit-exceeded`,t);let a=i;for(let e of a){if(!Cb(e))return xb(r,`record-json-invalid`,[...t,e]);if(e.length===0||yb.encode(e).byteLength>n.maximumKeyUtf8Bytes)return xb(r,`record-json-limit-exceeded`,[...t,e])}return Object.freeze([...a].sort(Sb))}function kb(e){let t=Object.create(null);for(let[n,r]of e)Object.defineProperty(t,n,{configurable:!1,enumerable:!0,value:r,writable:!1});return Object.freeze(t)}function Ab(e,t,n,r,i,a){if(e.length>r.maximumArrayItems)return xb(a,`record-json-limit-exceeded`,n);let o=new Set([`length`]);for(let t=0;t<e.length;t+=1)o.add(String(t));let s=Reflect.ownKeys(e);if(s.length!==o.size||s.some(e=>typeof e!=`string`||!o.has(e)))return xb(a,`record-json-invalid`,n);let c=Eb(e,`length`);if(c===void 0||c.value!==e.length)return xb(a,`record-json-invalid`,n);let l=[];for(let o=0;o<e.length;o+=1){let s=Tb(e,String(o));if(s===void 0)return xb(a,`record-json-invalid`,[...n,String(o)]);let c=Mb(s.value,t+1,[...n,String(o)],r,i,a);if(c===void 0)return;l.push(c)}return Object.freeze(l)}function jb(e,t,n,r,i,a){let o=Ob(e,n,r,a);if(o===void 0)return;let s=[];for(let c of o){let o=Tb(e,c);if(o===void 0)return xb(a,`record-json-invalid`,[...n,c]);let l=Mb(o.value,t+1,[...n,c],r,i,a);if(l===void 0)return;s.push([c,l])}return kb(s)}function Mb(e,t,n,r,i,a){if(Db(e,t,n,r,a)){if(e===null||typeof e==`boolean`||typeof e==`string`)return e;if(typeof e==`number`)return Number.isFinite(e)&&!Object.is(e,-0)?e:xb(a,`record-json-invalid`,n);if(typeof e!=`object`)return xb(a,`record-json-invalid`,n);try{if(i.isBlobRef?.(e))return e;if(a.ancestors.has(e))return xb(a,`record-json-invalid`,n);a.ancestors.add(e);try{return Array.isArray(e)?Ab(e,t,n,r,i,a):wb(e)?jb(e,t,n,r,i,a):xb(a,`record-json-invalid`,n)}finally{a.ancestors.delete(e)}}catch{return xb(a,`record-json-invalid`,n)}}}function Nb(e,t){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return e;if(typeof e!=`object`)return;if(t.isBlobRef?.(e))return bb;if(Array.isArray(e)){let n=[];for(let r of e){let e=Nb(r,t);if(e===void 0)return;n.push(e)}return Object.freeze(n)}if(!wb(e))return;let n=[];for(let r of Object.keys(e).sort(Sb)){let i=Nb(e[r],t);if(i===void 0)return;n.push([r,i])}return kb(n)}function Pb(e){let t=JSON.stringify(e);return t===void 0?void 0:yb.encode(t).byteLength}function Fb(e,t,n={}){let r={nodes:0,ancestors:new WeakSet,failure:void 0},i=Mb(e,0,[],t,n,r);if(i===void 0)return Ju(r.failure??Object.freeze({code:`record-json-invalid`,path:Object.freeze([])}));let a=Nb(i,n),o=a===void 0?void 0:Pb(a);return o===void 0||o>t.maximumJsonBytes?Ju(Object.freeze({code:`record-json-limit-exceeded`,path:Object.freeze([])})):qu(i)}var Ib=Object.freeze({errors:`all`,exact:!0,onExcessProperty:`error`}),Lb=Object.freeze({kind:`schema`,issues:Object.freeze([])});function Rb(e){try{let t=Yp()(e.issue).issues.map(e=>Object.freeze({path:Object.freeze((e.path??[]).map(e=>typeof e==`object`&&e&&`key`in e?e.key:e)),message:e.message}));return Object.freeze({kind:`schema`,issues:Object.freeze(t)})}catch{return Lb}}function zb(e){if(e.cause.reasons.length===1){let[t]=e.cause.reasons;if(t!==void 0&&Af(t)&&o_(t.error))return Rb(t.error)}throw e.cause}function Bb(e){return Object.freeze({kind:`canonical`,failure:e})}function Vb(e){for(let[t,n]of Object.entries(e))if(!Number.isSafeInteger(n)||n<=0)throw TypeError(`Record schema limit ${t} must be a positive safe integer`);return Object.freeze({...e})}function Hb(e){return e===null||typeof e==`boolean`||typeof e==`string`||typeof e==`number`&&Number.isFinite(e)&&!Object.is(e,-0)}function Ub(e,t){if(e.context?.isOptional!==!0)return Kb(e,t);if(e._tag===`Never`)return!0;if(e._tag!==`Union`)return Kb(e,t);let n=!1;for(let r of e.types){if(r._tag===`Undefined`||r._tag===`Never`){n=!0;continue}if(!Kb(r,t))return!1}return n}function Wb(e,t){return e.propertySignatures.every(e=>typeof e.name==`string`&&e.name.length>0&&Ub(e.type,t))&&e.indexSignatures.every(e=>e.parameter._tag===`String`&&Ub(e.type,t))}function Gb(e,t){if(e.encoding===void 0)return!0;if(e._tag!==`Objects`||e.encoding.length!==1)return!1;let n=e.encoding[0];return n.transformation._tag!==`Transformation`||n.to._tag!==`Objects`||e.propertySignatures.length!==n.to.propertySignatures.length||e.indexSignatures.length!==n.to.indexSignatures.length?!1:Wb(n.to,t)}function Kb(e,t){let n=t.states.get(e);if(n===`allowed`||n===`pending`)return!0;if(n===`rejected`)return!1;t.states.set(e,`pending`);let r;try{switch(e._tag){case`Literal`:r=Hb(e.literal);break;case`Null`:case`String`:case`Number`:case`Boolean`:r=!0;break;case`Objects`:r=Wb(e,t);break;case`Arrays`:r=e.elements.every(e=>Kb(e,t))&&e.rest.every(e=>Kb(e,t));break;case`Union`:r=e.types.every(e=>Kb(e,t));break;case`Suspend`:r=Kb(e.thunk(),t);break;case`Declaration`:r=t.declarations.has(e)||t.getAttachmentDeclaration?.(e)!==void 0;break;default:r=!1;break}}catch{r=!1}return r&&=Gb(e,t),!r&&t.failure===void 0&&(t.failure=e._tag),t.states.set(e,r?`allowed`:`rejected`),r}function qb(e){let t=[...e.attachmentDeclarations??[],...e.blobRef===void 0?[]:[{schema:e.blobRef.schema,isValue:e.blobRef.isBlobRef}]];if(t.some(e=>e.schema.ast._tag!==`Declaration`))throw TypeError(`Record Attachment opaque values must be Effect Schema Declarations`);let n={declarations:new Set(t.map(e=>e.schema.ast)),getAttachmentDeclaration:e.getAttachmentDeclaration,states:new WeakMap,failure:void 0};if(!Kb(e.schema.ast,n))throw TypeError(`Record schema may contain only canonical JSON nodes, Schema.encodeKeys transformations, and its minted Attachment BlobRef (rejected ${n.failure??`AST`})`)}function Jb(e,t,n,r=new WeakSet){if(r.has(e))return;r.add(e);let i=t.attachmentDeclarations?.find(t=>t.schema.ast===e)?.metadata,a=t.getAttachmentDeclaration?.(e);if(i!==void 0||a!==void 0){n.push(i??a?.metadata);return}switch(e._tag){case`Objects`:for(let i of e.propertySignatures)Jb(i.type,t,n,r);for(let i of e.indexSignatures)Jb(i.type,t,n,r);break;case`Arrays`:for(let i of e.elements)Jb(i,t,n,r);for(let i of e.rest)Jb(i,t,n,r);break;case`Union`:for(let i of e.types)Jb(i,t,n,r);break;case`Suspend`:Jb(e.thunk(),t,n,r);break}}function Yb(e,t,n=new WeakSet){if(typeof e!=`object`||!e||t?.(e)===!0||n.has(e))return e;n.add(e);for(let r of Object.values(Object.getOwnPropertyDescriptors(e)))`value`in r&&Yb(r.value,t,n);return Object.freeze(e),e}function Xb(e){qb(e);let t=Vb(e.limits),n=[...e.attachmentDeclarations??[],...e.blobRef===void 0?[]:[{schema:e.blobRef.schema,isValue:e.blobRef.isBlobRef}]],r=n.length===0?{}:{isBlobRef:t=>n.some(e=>e.isValue(t))||e.isAttachmentOpaque?.(t)!==void 0},i=s_(e.schema,Ib),a=u_(e.schema,Ib),o=s_(V(e.schema),Ib),s=[];Jb(e.schema.ast,e,s);let c=e=>{let n=Fb(e,t,r);return Yu(n)?Ju(Bb(n.failure)):qu(n.success)},l=(t,r,i)=>{let a=t=>{let r=n.find(e=>e.schema.ast===t);return r===void 0?e.getAttachmentDeclaration?.(t):{metadata:`metadata`in r?r.metadata:void 0}},o=new WeakMap,s=(e,t)=>{let n=a(e);if(n!==void 0){let e=r(t,n.metadata);return e._tag===`matched`?{matched:!0,value:e.value}:{matched:!1,value:t}}if(typeof t!=`object`||!t)return{matched:!1,value:t};let i=o.get(t)?.get(e);if(i!==void 0)return{matched:!1,value:i};switch(e._tag){case`Suspend`:return s(e.thunk(),t);case`Objects`:{let n={...t},r=o.get(t)??new WeakMap;r.set(e,n),o.set(t,r);let i=!1;for(let r of e.propertySignatures){if(typeof r.name!=`string`)continue;let e=Object.getOwnPropertyDescriptor(t,r.name);if(e!==void 0&&`value`in e){let t=s(r.type,e.value);i||=t.matched,n[r.name]=t.value}}return i?{matched:!0,value:n}:{matched:!1,value:t}}case`Arrays`:{if(!Array.isArray(t))return{matched:!1,value:t};let n=[...t],r=o.get(t)??new WeakMap;r.set(e,n),o.set(t,r);let i=!1;for(let r=0;r<e.elements.length;r+=1){let a=s(e.elements[r],t[r]);i||=a.matched,n[r]=a.value}if(e.rest.length>0)for(let r=e.elements.length;r<t.length;r+=1){let a=s(e.rest[0],t[r]);i||=a.matched,n[r]=a.value}return i?{matched:!0,value:n}:{matched:!1,value:t}}case`Union`:for(let n of e.types){let e=s(n,t);if(e.matched)return e}return{matched:!1,value:t};default:return{matched:!1,value:t}}};return s(i===`type`?e.schema.ast:fg(e.schema.ast),t).value};return Object.freeze({schema:e.schema,limits:t,opaqueDeclarationMetadata:Object.freeze(s),decode:e=>{let t=c(e);if(Yu(t))return Ju(t.failure);let n=i(t.success);if(Lf(n))return Ju(zb(n));let a=o(n.value);if(Lf(a))return Ju(zb(a));let s=c(a.value);if(Yu(s))return Ju(s.failure);let l=o(s.success);return Lf(l)?Ju(zb(l)):qu(Yb(l.value,r.isBlobRef))},enumerateOpaque:t=>{let r=[],i=new WeakMap,a=t=>{let r=n.find(e=>e.schema.ast===t);return r===void 0?e.getAttachmentDeclaration?.(t):{metadata:`metadata`in r?r.metadata:void 0,accepts:r.isValue}},o=(e,t)=>{let n=a(e);if(n!==void 0){typeof t==`object`&&t&&n.accepts(t)&&r.push(Object.freeze({value:t,metadata:n.metadata}));return}if(typeof t!=`object`||!t)return;let s=i.get(t)??new WeakSet;if(!s.has(e))switch(s.add(e),i.set(t,s),e._tag){case`Suspend`:o(e.thunk(),t);return;case`Objects`:for(let n of e.propertySignatures){if(typeof n.name!=`string`)continue;let e=Object.getOwnPropertyDescriptor(t,n.name);e!==void 0&&`value`in e&&o(n.type,e.value)}return;case`Arrays`:if(!Array.isArray(t))return;for(let n=0;n<e.elements.length;n+=1)o(e.elements[n],t[n]);if(e.rest.length>0)for(let n=e.elements.length;n<t.length;n+=1)o(e.rest[0],t[n]);return;case`Union`:for(let n of e.types)o(n,t);return}};return o(e.schema.ast,t),Object.freeze(r)},mapOpaque:(e,t)=>l(e,t,`type`),mapOpaqueEncoded:(e,t)=>l(e,t,`encoded`),encode:e=>{let t=c(e);if(Yu(t))return Ju(t.failure);let n=a(t.success);return Lf(n)?Ju(zb(n)):c(n.value)}})}var Zb=w_(K({code:Y(`record-schema-invalid.record-run-time-order-invalid.record-run-context-invalid.record-run-context-size-exceeded.record-run-context-experiment-mismatch.record-run-order-invalid.record-expected-slot-order-invalid.record-expected-slot-duplicate.record-run-duplicate.record-member-slot-order-invalid.record-member-slot-duplicate.record-member-slot-unexpected.record-member-slot-missing.record-member-action-invalid.record-attempt-order-invalid.record-attempt-duplicate.record-attempt-owner-invalid.record-attempt-slot-unexpected.record-attempt-slot-mismatch.record-attempt-eval-mismatch.record-attempt-digest-mismatch.record-attempt-reference-missing.record-origin-member-missing.record-origin-member-duplicate.record-attachment-schema-id-mismatch.record-fixed-family-owner-invalid`.split(`.`)),path:q(U)}));function Qb(e,t=[]){return Object.freeze({code:e,path:Object.freeze([...t])})}function $b(e){let[t,...n]=e;if(t===void 0)return;let r=[t,...n];return Object.freeze(r)}var ex=Y([`record`,`run`,`member`,`attempt`,`attachment-envelope`,`record-core`]),tx=Y([`record-schema-invalid`,`record-invariant-invalid`]);U_()(`RecordCodecError`,{code:tx,document:ex,issues:Zb}),U_()(`RecordCoreInvalid`,{code:H(`record-core-invalid`),issues:Zb}),U_()(`RecordReferenceInvalid`,{code:H(`record-reference-invalid`)}),U_()(`RecordAttachmentEnvelopeInvalid`,{code:H(`record-attachment-envelope-invalid`),issues:Zb});function nx(e){let t=Xb({schema:e.schema,limits:e.limits});return Object.freeze({...t,kind:`core`})}var rx=[`completed`,`errored`,`cancelled`,`interrupted`],ix=[`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`],ax=[`executed`,`carried`,`accepted`],ox=[`not-dispatched`,`interrupted`],sx=`niceeval.record-attachment`,cx=[`run`,`attempt`];function lx(e){return`${e.originRunId}\u0000${e.attemptId}`}var ux=`niceeval.run/v1`,dx=W.pipe(Z($(e=>Number.isSafeInteger(e)&&e>=0))),fx=Y([`active`,`completed`,`interrupted`,`failed`]),px=Y([`early-exit-satisfied`,`budget-exhausted`,`stopped-by-failure`,`interrupted-before-publication`,`dispatch-failed`]),mx=K({state:H(`pending`)}),hx=K({state:H(`published`),action:Y([`executed`,`carried`,`accepted`]),attemptId:U,attemptLocator:U,originRunId:U,originSlotId:U}),gx=K({state:H(`absent`),reason:px}),_x=K({slotId:U,evalId:U,attemptOrdinal:dx,executionIdentityDigest:U,publication:J([mx,hx,gx])}),vx=K({published:dx,expected:dx,missing:dx}),yx=K({runId:U,invocationId:U,experimentId:U,state:fx,startedAt:U,completedAt:B(U),coverage:vx}),bx=yx.pipe(v_({slots:q(_x)}));K({identity:U,revision:dx}),J([K({protocol:H(ux),operation:H(`run.list`),runs:q(yx),continuation:B(U)}),K({protocol:H(ux),operation:H(`run.get`),run:bx})]);var xx=Object.freeze({maximumJsonBytes:256*1024,maximumDepth:8,maximumNodes:4096,maximumObjectKeys:64,maximumArrayItems:256,maximumKeyUtf8Bytes:256,maximumStringUtf8Bytes:8*1024}),Sx=D_(()=>J([h_,G,W,U,q(Sx),x_(U,Sx)])),Cx=x_(U,Sx),wx=nx({schema:K({experimentId:cb,execution:K({agentId:U.pipe(Z(P_(1))),model:X(U),reasoningEffort:X(U),flags:Cx}),labels:x_(U,U)}),limits:xx}),Tx=wx.schema;function Ex(e){let t=$b([e.kind===`canonical`?Qb(e.failure.code===`record-json-limit-exceeded`?`record-run-context-size-exceeded`:`record-run-context-invalid`,e.failure.path):Qb(`record-run-context-invalid`)]);if(t===void 0)throw Error(`Run context failure must contain one issue`);return t}function Dx(e){let t=wx.decode(e);return Yu(t)?Ju(Ex(t.failure)):qu(t.success)}function Ox(e){let t=Dx(e);return Yu(t)?t.failure:Object.freeze([])}function kx(e,t,n){for(let r of n)e.push(Qb(r.code,[...t,...r.path]))}function Ax(e,t){return e===void 0||Wy(e,t)<0}function jx(e){let t=[],n=new Set,r=new Set,i;for(let[a,o]of e.entries()){let e=[`expectedSlots`,String(a),`slotId`];Ax(i,o.slotId)||t.push(Qb(i===o.slotId?`record-expected-slot-duplicate`:`record-expected-slot-order-invalid`,e)),n.has(o.slotId)&&i!==o.slotId&&t.push(Qb(`record-expected-slot-duplicate`,e));let s=`${o.evalId}\u0000${String(o.attemptOrdinal)}`;r.has(s)&&t.push(Qb(`record-expected-slot-duplicate`,[`expectedSlots`,String(a),`attemptOrdinal`])),n.add(o.slotId),r.add(s),i=o.slotId}return Object.freeze(t)}function Mx(e){let t=[];e.completedAt<e.startedAt&&t.push(Qb(`record-run-time-order-invalid`,[`completedAt`])),kx(t,[`context`],Ox(e.context));let n=Dx(e.context);return Xu(n)&&n.success.experimentId!==e.experimentId&&t.push(Qb(`record-run-context-experiment-mismatch`,[`context`,`experimentId`])),kx(t,[],jx(e.expectedSlots)),Object.freeze(t)}function Nx(e){return(e.action===`executed`||e.action===`carried`||e.action===`accepted`)==(e.attempt!==null)?Object.freeze([]):Object.freeze([Qb(`record-member-action-invalid`,[`attempt`])])}function Px(e){return Object.freeze([])}function Fx(e){return[`runs`,String(e)]}function Ix(e,t){return[...Fx(e),`members`,String(t)]}function Lx(e,t){return[...Fx(e),`attempts`,String(t)]}function Rx(e){return lx(e)}function zx(e){return new Map(e.expectedSlots.map(e=>[e.slotId,e]))}function Bx(e,t){return e.slotId===t.slotId&&e.evalId===t.evalId&&e.attemptOrdinal===t.attemptOrdinal&&e.executionIdentityDigest===t.executionIdentityDigest}function Vx(e,t,n){let r=zx(e.run),i=new Set,a;for(let[o,s]of e.members.entries()){let e=Ix(t,o);kx(n,e,Nx(s)),Ax(a,s.slotId)||n.push(Qb(a===s.slotId?`record-member-slot-duplicate`:`record-member-slot-order-invalid`,[...e,`slotId`])),i.has(s.slotId)&&a!==s.slotId&&n.push(Qb(`record-member-slot-duplicate`,[...e,`slotId`])),r.has(s.slotId)||n.push(Qb(`record-member-slot-unexpected`,[...e,`slotId`])),i.add(s.slotId),a=s.slotId}for(let[r,a]of e.run.expectedSlots.entries())i.has(a.slotId)||n.push(Qb(`record-member-slot-missing`,[...Fx(t),`run`,`expectedSlots`,String(r),`slotId`]))}function Hx(e){let t=[],n=new Map,r=new Map,i;for(let[a,o]of e.runs.entries()){let e=o.run.runId,s=Fx(a);Ax(i,e)||t.push(Qb(i===e?`record-run-duplicate`:`record-run-order-invalid`,[...s,`run`,`runId`])),n.has(e)&&i!==e&&t.push(Qb(`record-run-duplicate`,[...s,`run`,`runId`])),n.set(e,a),i=e,kx(t,[...s,`run`],Mx(o.run)),Vx(o,a,t);let c=zx(o.run),l;for(let[n,i]of o.attempts.entries()){let o=Lx(a,n);if(kx(t,o,Px(i)),Ax(l,i.attemptId)||t.push(Qb(l===i.attemptId?`record-attempt-duplicate`:`record-attempt-order-invalid`,[...o,`attemptId`])),l=i.attemptId,i.originRunId!==e){t.push(Qb(`record-attempt-owner-invalid`,[...o,`originRunId`]));continue}let s=c.get(i.slotId);s===void 0?t.push(Qb(`record-attempt-slot-unexpected`,[...o,`slotId`])):(s.evalId!==i.evalId&&t.push(Qb(`record-attempt-eval-mismatch`,[...o,`evalId`])),s.executionIdentityDigest!==i.executionIdentityDigest&&t.push(Qb(`record-attempt-digest-mismatch`,[...o,`executionIdentityDigest`])));let u=Rx({originRunId:e,attemptId:i.attemptId});r.has(u)?t.push(Qb(`record-attempt-duplicate`,[...o,`attemptId`])):r.set(u,{runIndex:a,attemptIndex:n,attempt:i})}}let a=new Map;for(let[n,i]of e.runs.entries())for(let[o,s]of i.members.entries()){if(s.attempt===null)continue;let c=Ix(n,o),l=r.get(Rx(s.attempt));if(l===void 0){t.push(Qb(`record-attempt-reference-missing`,[...c,`attempt`]));continue}if(s.action!==`accepted`){let n=zx(i.run).get(s.slotId),r=zx(e.runs[l.runIndex].run).get(l.attempt.slotId);(n===void 0||r===void 0||!Bx(n,r))&&t.push(Qb(`record-attempt-slot-mismatch`,[...c,`attempt`]))}if(s.action===`executed`){if(s.attempt.originRunId!==i.run.runId){t.push(Qb(`record-member-action-invalid`,[...c,`action`]));continue}let e=Rx(s.attempt);a.set(e,(a.get(e)??0)+1)}else s.attempt.originRunId===i.run.runId&&t.push(Qb(`record-member-action-invalid`,[...c,`action`]))}for(let[e,n]of r.entries()){let r=a.get(e)??0,i=Lx(n.runIndex,n.attemptIndex);r===0?t.push(Qb(`record-origin-member-missing`,i)):r>1&&t.push(Qb(`record-origin-member-duplicate`,i))}return Object.freeze(t)}var Ux=Object.freeze({maximumJsonBytes:1024*1024,maximumDepth:8,maximumNodes:4096,maximumObjectKeys:64,maximumArrayItems:256,maximumKeyUtf8Bytes:256,maximumStringUtf8Bytes:8*1024}),Wx=Object.freeze({...Ux,maximumJsonBytes:8*1024*1024,maximumNodes:32768,maximumArrayItems:4096});function Gx(e){return e.length===0?void 0:e.map(e=>({path:e.path,issue:e.code}))}var Kx=Y(rx),qx=W.pipe(Z($(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`RecordAttemptOrdinal`,description:`a zero-based non-negative JSON-safe attempt ordinal`}))),Jx=nx({schema:K({originRunId:ib,attemptId:ob}),limits:Ux}).schema,Yx=nx({schema:K({slotId:ab,evalId:lb,attemptOrdinal:qx,executionIdentityDigest:ub}),limits:Ux}).schema,Xx=nx({schema:K({format:vb,recordId:rb}),limits:Ux}).schema,Zx=nx({schema:K({runId:ib,experimentId:cb,context:Tx,startedAt:_b,completedAt:_b,expectedSlots:q(Yx)}).pipe(Z($(e=>Gx(Mx(e)),{identifier:`RecordRunDocumentInvariant`,description:`a Run document with valid chronology, context, and expected Slots`}))),limits:Ux}).schema,Qx=nx({schema:J([K({slotId:ab,action:Y(ax),attempt:Jx}),K({slotId:ab,action:Y(ox),attempt:h_,absenceReason:px})]).pipe(Z($(e=>Gx(Nx(e)),{identifier:`RecordMemberDocumentInvariant`,description:`a Member action paired with its required Attempt reference`}))),limits:Ux}).schema,$x=nx({schema:K({attemptId:ob,originRunId:ib,slotId:ab,evalId:lb,executionIdentityDigest:ub,outcome:Kx}).pipe(Z($(e=>Gx(Px(e)),{identifier:`RecordAttemptDocumentInvariant`,description:`an Attempt document satisfying its local invariant`}))),limits:Ux}).schema,eS=nx({schema:K({run:Zx,members:q(Qx),attempts:q($x)}),limits:Wx}).schema;nx({schema:K({record:Xx,runs:q(eS)}).pipe(Z($(e=>Gx(Hx(e)),{identifier:`RecordCoreInvariant`,description:`a complete Record Core with consistent Run, Member, and Attempt documents`}))),limits:Wx}).schema;var tS=Yx,nS=Zx,rS=Qx,iS=$x;l_(J([K({format:H(`niceeval.attempt-publication-closure/v1`),originRun:nS}),K({originRun:nS})]),{errors:`all`,onExcessProperty:`error`}),Y(ix);var aS=W.pipe(Z($(e=>Number.isSafeInteger(e)&&e>=0))),oS=W.pipe(Z($(e=>Number.isSafeInteger(e)&&e>0))),sS=K({sha256:db,byteLength:aS}),cS=K({key:hb,sha256:db,byteLength:aS}),lS=K({owner:Y(cx),family:U.pipe(Z($(Qy)))});function uS(e){let t;for(let n of e.contents){if(t!==void 0&&t>=n.key)return!1;t=n.key}let n;for(let t of e.references){let e=`${t.owner}\u0000${t.family}`;if(n!==void 0&&n>=e)return!1;n=e}return!0}K({format:Y([sx]),ownerKind:Y(cx),family:U.pipe(Z($(Qy))),schemaVersion:oS,payload:sS,contents:q(cS),references:q(lS)}).pipe(Z($(uS)));var dS=Y([`record-attachment-owner-invalid`,`record-attachment-schema-id-mismatch`,`record-attachment-schema-invalid`,`record-attachment-payload-invalid`,`record-attachment-json-invalid`,`record-attachment-blob-refs-invalid`,`record-attachment-blob-ref-illegal`,`record-attachment-blob-ref-missing`,`record-attachment-blob-ref-extra`,`record-attachment-blob-ref-duplicate`,`record-attachment-closure-mismatch`,`record-attachment-snapshot-bytes-invalid`,`record-attachment-blob-budget-exceeded`,`record-attachment-materialized-invalid`,`record-attachment-family-invalid`]),fS=class extends Error{code;cause;constructor(e=`invalid-family-definition`,t){super(e===`migration-chain-invalid`?`Invalid Record Attachment migration chain`:`Invalid Record Attachment family definition`,{cause:t}),this.code=e,this.cause=t,this.name=`RecordAttachmentSpiDefinitionError`}},pS=new WeakMap,mS=new WeakMap,hS=new WeakMap,gS=new WeakMap,_S=new WeakMap;function vS(e){throw new fS(`invalid-family-definition`,e)}Object.freeze({to(e,t){let n=bS(e);n===void 0&&vS();let r=r_(e=>{let r=xS(e)?hS.get(e):void 0;return r!==void 0&&r.definition===n&&(t===void 0||!Yu(l_(t)(r.value)))},{identifier:`RecordAttachmentReference<${n.owner}:${n.family}>`});return gS.set(r,Object.freeze({definition:n,valueSchema:t})),gS.set(r.ast,Object.freeze({definition:n,valueSchema:t})),_S.set(r.ast.run,Object.freeze({definition:n,valueSchema:t})),r}});function yS(e){return typeof e==`object`&&!!e&&pS.has(e)}function bS(e){return yS(e)?e:typeof e==`object`&&e||typeof e==`function`?mS.get(e):void 0}function xS(e){return typeof e==`object`&&!!e&&hS.has(e)}Object.freeze({run:`run`,attempt:`attempt`}),Object.freeze({maximumJsonBytes:16*1024*1024,maximumDepth:32,maximumNodes:2e5,maximumObjectKeys:5e4,maximumArrayItems:1e5,maximumKeyUtf8Bytes:256,maximumStringUtf8Bytes:1024*1024});var SS=W.pipe(Z($(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`RecordNonNegativeSafeInteger`,description:`a non-negative JSON-safe integer`}))),CS=W.pipe(Z($(e=>Number.isSafeInteger(e)&&e>0,{identifier:`RecordPositiveSafeInteger`,description:`a positive JSON-safe integer`})));W.pipe(Z($(e=>Number.isFinite(e)&&e>=0,{identifier:`RecordFiniteNonNegativeNumber`,description:`a finite non-negative JSON number`})));var wS=U.pipe(Z($(e=>new TextEncoder().encode(e).byteLength<=16384&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(e),{identifier:`RecordSafeText`,description:`bounded text without NUL or unsafe control characters`}))),TS=U.pipe(Z($(e=>/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/.test(e),{identifier:`RecordSafeIdentifier`,description:`a bounded ASCII identifier`}))),ES=U.pipe(Z($(e=>e.length>0&&e.length<=255&&/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+(?:;[!#$%&'*+.^_`|~0-9A-Za-z-]+=[!#$%&'*+.^_`|~0-9A-Za-z-]+)*$/.test(e),{identifier:`RecordMediaType`,description:`a bounded MIME media type without free-form parameters`}))),DS=J([K({code:Y([`capture-failed`,`capture-interrupted`]),stage:TS}),K({code:Y([`collection-cap-reached`,`unsupported-input`]),omittedAtLeast:CS})]),OS=C_([]).pipe(Z($(e=>e.length===0,{identifier:`RecordEmptyArray`,description:`an exact empty array`}))),kS=J([K({state:H(`complete`),limitations:OS}),K({state:H(`partial`),limitations:w_(DS)})]),AS=Object.freeze({maximumArtifacts:4e3,maximumContentBytes:64*1024*1024}),jS=K({artifactId:mb,mediaType:V(ES),label:V(wS),byteLength:SS,sha256:db,content:Y_.pipe(X_.maximumBytes(AS.maximumContentBytes))}),MS=K({collection:V(kS),artifacts:q(jS)}).pipe(b_({collection:`collection-data`,artifacts:`artifacts-data`}));Object.freeze({conversation:Object.freeze({maxPayloadBytes:2097152,maxItems:2048,maxTurns:256,maxClosureBytes:0}),commands:Object.freeze({maxPayloadBytes:2097152,maxItems:256,maxClosureBytes:33554432}),usage:Object.freeze({maxPayloadBytes:1048576,maxItems:2048,maxClosureBytes:0}),timing:Object.freeze({maxPayloadBytes:1048576,maxItems:4096,maxClosureBytes:0}),diagnostics:Object.freeze({maxPayloadBytes:524288,maxItems:512,maxClosureBytes:0})});var NS=`@niceeval/o11y/NonNegativeSafeInteger`,PS=`@niceeval/o11y/PositiveSafeInteger`,FS=`@niceeval/o11y/SafeIdentifier`,IS=`@niceeval/o11y/SourceNativeToolName`,LS=`@niceeval/o11y/StableLabel`,RS=`@niceeval/o11y/SafeText`,zS=`@niceeval/o11y/CanonicalDecimal`,BS=`@niceeval/o11y/CurrencyCode`,VS=new TextEncoder,HS=/^[a-z][a-z0-9.-]{0,63}$/,US=/^(?:0|[1-9][0-9]*)(?:\.[0-9]*[1-9])?$/,WS=/^[A-Z]{3}$/,GS=/[\u0000-\u0009\u000B-\u001F]/u;function KS(e){return VS.encode(e).byteLength}function qS(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(n<56320||n>57343)return!1;t+=1}else if(n>=56320&&n<=57343)return!1}return!0}function JS(e){return Number.isSafeInteger(e)&&e>=0}function YS(e){return Number.isSafeInteger(e)&&e>0}function XS(e){return JS(e)?e:void 0}function ZS(e){return YS(e)?e:void 0}function QS(e){return KS(e)<=64&&HS.test(e)}function $S(e){return KS(e)<=64&&HS.test(e)}function eC(e){return e.length>0&&!e.includes(`
|
|
19
|
+
`)&&nC(e,256)}function tC(e){return qS(e)&&!GS.test(e)}function nC(e,t){return Number.isSafeInteger(t)&&t>=0&&tC(e)&&KS(e)<=t}function rC(e){return KS(e)<=64&&US.test(e)}function iC(e){return WS.test(e)}var aC=`@niceeval/o11y/TurnId`,oC=`@niceeval/o11y/ItemId`,sC=`@niceeval/o11y/CallId`,cC=`@niceeval/o11y/EventId`,lC=`@niceeval/o11y/ToolOccurrenceId`,uC=`@niceeval/o11y/SessionScopeId`,dC=`@niceeval/o11y/LegacySourceLocalCallId`,fC=`@niceeval/o11y/CommandId`,pC=`@niceeval/o11y/UsageObservationId`,mC=`@niceeval/o11y/IntervalId`,hC=`@niceeval/o11y/DiagnosticId`;Object.freeze([`turn`,`item`,`call`,`event`,`tool-occurrence`,`session-scope`,`command`,`usage-observation`,`interval`,`diagnostic`]);var gC=`[0123456789abcdefghjkmnpqrstvwxyz]`,_C=Object.freeze({turn:`turn_`,item:`item_`,call:`call_`,event:`event_`,"tool-occurrence":`tool_`,"session-scope":`session_`,command:`command_`,"usage-observation":`usage_`,interval:`interval_`,diagnostic:`diagnostic_`});function vC(e){return RegExp(`^${e}${gC}{26}$`)}var yC=vC(_C.turn),bC=vC(_C.item),xC=vC(_C.call),SC=vC(_C.event),CC=vC(_C[`tool-occurrence`]),wC=vC(_C[`session-scope`]),TC=vC(_C.command),EC=vC(_C[`usage-observation`]),DC=vC(_C.interval),OC=vC(_C.diagnostic);function kC(e){return yC.test(e)}function AC(e){return bC.test(e)}function jC(e){return xC.test(e)}function MC(e){return SC.test(e)}function NC(e){return CC.test(e)}function PC(e){return wC.test(e)}function FC(e){return xC.test(e)}function IC(e){return TC.test(e)}function LC(e){return EC.test(e)}function RC(e){return DC.test(e)}function zC(e){return OC.test(e)}Object.freeze([`niceeval.agent-turns`,`niceeval.sandbox-commands`,`niceeval.runner-activities`,`niceeval.runner-diagnostics`]),Object.freeze([`niceeval.runner-activities`,`niceeval.runner-diagnostics`]);function BC(e){return typeof e==`object`&&!!e}function VC(e,t){let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&`value`in n?n.value:void 0}function HC(e){if(!BC(e))return!1;let t=VC(e,`family`),n=VC(e,`kind`),r=VC(e,`id`);return typeof t==`string`&&typeof n==`string`&&typeof r==`string`}function UC(e){if(!HC(e))return!1;switch(e.kind){case`turn`:return e.family===`niceeval.agent-turns`&&kC(e.id);case`item`:return e.family===`niceeval.agent-turns`&&AC(e.id);case`call`:return e.family===`niceeval.agent-turns`&&jC(e.id);case`event`:return e.family===`niceeval.agent-turns`&&MC(e.id);case`tool-occurrence`:return e.family===`niceeval.agent-turns`&&NC(e.id);case`session-scope`:return e.family===`niceeval.agent-turns`&&PC(e.id);case`command`:return e.family===`niceeval.sandbox-commands`&&IC(e.id);case`usage-observation`:return e.family===`niceeval.agent-turns`&&LC(e.id);case`interval`:return e.family===`niceeval.runner-activities`&&RC(e.id);case`diagnostic`:return e.family===`niceeval.runner-diagnostics`&&zC(e.id);default:return!1}}function WC(e){return HC(e)?e.family===`niceeval.runner-activities`&&e.kind===`interval`&&RC(e.id)||e.family===`niceeval.runner-diagnostics`&&e.kind===`diagnostic`&&zC(e.id):!1}function GC(e,t){return e===t?0:e<t?-1:1}function KC(e,t){let n=GC(e.family,t.family);if(n!==0)return n;let r=GC(e.kind,t.kind);return r===0?GC(e.id,t.id):r}function qC(e,t){if(e.length>16)return!1;let n;for(let t of e){if(!UC(t)||n!==void 0&&KC(n,t)>=0)return!1;n=t}return!0}function JC(e,t){if(e.length>16)return!1;let n;for(let t of e){if(!WC(t)||n!==void 0&&KC(n,t)>=0)return!1;n=t}return!0}var YC=Object.freeze([`conversation-item`,`conversation-text`,`command-manifest`,`command-stdout`,`command-stderr`,`usage-observation`,`timing-interval`,`diagnostic`]),XC=Object.freeze([`adapter`,`command-capture`,`usage-capture`,`timing-capture`,`diagnostic-capture`,`attempt-finalizer`,`run-teardown`]);function ZC(e,t){return e.some(e=>e===t)}function QC(e){return ZC(YC,e)}function $C(e){return ZC(XC,e)}function ew(e){switch(e.code){case`stream-truncated`:case`invalid-utf8-replaced`:case`unsafe-control-stripped`:return e.stream===`stdout`?`command-stdout`:`command-stderr`;default:return e.target}}function tw(e){switch(e.code){case`text-truncated`:return e.target===`conversation-text`?e.itemId:e.target===`command-manifest`?e.commandId:e.diagnosticId;case`stream-truncated`:case`invalid-utf8-replaced`:case`unsafe-control-stripped`:return e.commandId;default:return``}}function nw(e){return e.code===`capture-failed`||e.code===`capture-interrupted`?e.stage:``}function rw(e){return[e.code,ew(e),tw(e),nw(e)].join(`\0`)}function iw(e,t){let n=GC(e.code,t.code);if(n!==0)return n;let r=GC(ew(e),ew(t));if(r!==0)return r;let i=GC(tw(e),tw(t));return i===0?GC(nw(e),nw(t)):i}function aw(e){return e===`stdout`||e===`stderr`}function ow(e){switch(e.code){case`capture-failed`:case`capture-interrupted`:return $C(e.stage)&&QC(e.target);case`collection-cap-reached`:return QC(e.target)&&JS(e.retained)&&YS(e.omittedAtLeast);case`unsupported-input`:return QC(e.target)&&YS(e.omittedAtLeast);case`text-truncated`:return JS(e.retainedBytes)&&YS(e.omittedBytes)&&(e.target===`conversation-text`&&AC(e.itemId)||e.target===`command-manifest`&&IC(e.commandId)||e.target===`diagnostic`&&zC(e.diagnosticId));case`stream-truncated`:return IC(e.commandId)&&aw(e.stream)&&JS(e.retainedBytes)&&YS(e.omittedBytes);case`invalid-utf8-replaced`:return IC(e.commandId)&&aw(e.stream)&&YS(e.replacementCount);case`unsafe-control-stripped`:return IC(e.commandId)&&aw(e.stream)&&YS(e.strippedCount);case`redacted`:return QC(e.target)&&YS(e.replacementCount)}}function sw(e){let t=[];(e.state===`complete`&&e.limitations.length!==0||e.state===`partial`&&e.limitations.length===0)&&t.push(Object.freeze({code:`observability-collection-state-invalid`}));let n,r=new Set;for(let[i,a]of e.limitations.entries()){let e=XS(i);if(e===void 0)throw Error(`Array index must be a safe integer`);if(!ow(a)){t.push(Object.freeze({code:`observability-limitation-invalid`,index:e}));continue}if(n!==void 0&&iw(n,a)>=0){let e=ZS(i);if(e===void 0)throw Error(`Non-first array index must be positive`);t.push(Object.freeze({code:`observability-limitation-order-invalid`,index:e}))}let o=rw(a);if(r.has(o)){let e=ZS(i);if(e===void 0)throw Error(`Duplicate cannot be at index zero`);t.push(Object.freeze({code:`observability-limitation-duplicate`,index:e}))}r.add(o),n=a}return Object.freeze(t)}var cw=`niceeval.query/v1`,lw=K({state:H(`available`),byteLength:W,sha256:U,base64:U}),uw=hy(J([K({kind:H(`unavailable`),reason:H(`not-recorded`)}),K({kind:H(`content`),content:lw,encoding:Y([`json`,`utf-8`,`binary`]),byteLength:W,preview:X(U)})])).entry,dw=K({entryId:Fv,sourceOrder:W,role:Y([`declaration`,`threshold`,`score`,`gate`,`optional`,`stop`]),source:K({sourceItemId:U,sha256:U}),start:K({line:W,column:W}),end:K({line:W,column:W})}),fw=J([qv,py]),pw=Y([`condition-not-met`,`evidence-unavailable`,`source-unavailable`,`redacted`,`evaluator-failed`,`producer-interrupted`,`invalid-subject`,`coverage-not-applicable`,`not-recorded`,`not-declared`]),mw=D_(()=>K({label:U,state:U,expected:X(fw),observed:X(qv),reason:X(pw),anchor:X(qv),children:q(mw)})),hw=Y([`historical-not-recorded`,`source-unavailable`,`ambiguous`]),gw=J([K({state:H(`exact`),turnId:U,eventId:U,anchor:U}),K({state:H(`unavailable`),reason:hw})]),_w=J([K({kind:H(`tool-occurrence`),toolOccurrenceId:U}),K({kind:H(`event`),eventId:U})]),vw=K({kind:Y([`tool`,`event`,`legacy-source-row`]),rowId:U,number:U,phase:Y([`at-evaluation`,`outside-evaluation-snapshot`,`historical`]),summary:U,detail:qv,locator:B(_w),evaluation:K({result:Y([`matched`,`mismatched`,`unavailable`,`not-evaluated`,`not-retained`,`outside-snapshot`,`legacy`]),difference:B(qv)}),conversationTarget:gw}),yw=J([K({state:H(`unavailable`),reason:hw,rows:C_([]),limitations:C_([])}),K({state:Y([`complete`,`partial`]),rows:q(vw),limitations:q(qv)})]),bw=J([K({kind:H(`collection-filter`),summary:qv}),K({kind:H(`ordered-sequence`),summaries:q(qv)})]),xw=K({step:W,summary:qv,state:Y([`matched`,`possible`,`blocked`,`not-reached`]),sourceRow:B(U),conversationTarget:B(gw)}),Sw=J([K({state:H(`legacy`),subject:Y([`tool`,`event`,`source-row`]),query:K({state:H(`unavailable`),reason:H(`historical-not-recorded`)}),source:K({final:yw,atEvaluation:yw}),identityRelation:K({state:H(`unavailable`),reason:H(`historical-not-recorded`)}),overlayRetention:H(`unavailable`),steps:C_([]),legacyDiagnostic:B(qv)}),K({state:H(`current`),subject:Y([`tool`,`event`,`source-row`]),query:bw,receipt:J([Kv,ry]),source:K({final:yw,atEvaluation:yw}),identityRelation:J([K({state:H(`exact`)}),K({state:H(`unavailable`),reason:Y([`source-unavailable`,`ambiguous`])})]),overlayRetention:Y([`complete`,`partial`,`unavailable`]),steps:q(xw)})]),Cw=K({state:H(`unavailable`),reason:H(`not-recorded`)}),ww=K({state:H(`missing`),sourceState:Y([`not-recorded`,`invalid`]),comparator:h_,sourceLedger:h_,receipt:h_,result:h_,targets:C_([]),debugger:h_,sandboxCommandJoin:Cw}),Tw=J([ww,K({state:H(`ordinary`),sourceState:h_,comparator:h_,sourceLedger:X(Kv),receipt:X(Kv),result:h_,targets:C_([]),debugger:h_,sandboxCommandJoin:Cw}),K({state:H(`legacy`),sourceState:H(`unavailable`),comparator:h_,sourceLedger:h_,receipt:h_,result:h_,targets:C_([]),reason:H(`historical-not-recorded`),debugger:Sw,sandboxCommandJoin:Cw}),K({state:H(`available`),sourceState:Y([`complete`,`partial`,`unavailable`]),comparator:X(J([Zv,q(Zv)])),sourceLedger:K({sourceSnapshot:ny,receipt:J([Kv,ry])}),receipt:J([Kv,ry]),result:X(ly),targets:q(K({state:Y([`matched`,`mismatched`,`unavailable`,`not-evaluated`]),anchor:_w,difference:X(qv)})),debugger:Sw,sandboxCommandJoin:Cw})]),Ew=V(J([K({entryId:U,state:Y([`not-recorded`,`invalid`]),issues:B(q(K({code:dS,path:q(U)}))),sourceSites:C_([]),check:mw,matcher:ww}),K({entryId:Fv,display:V(Iv),entry:V(uw),sourceSites:q(dw),check:mw,matcher:Tw})])),Dw=Object.freeze({completed:`completed`,failed:`failed`,cancelled:`cancelled`,interrupted:`interrupted`}),Ow=[Dw.completed,Dw.failed,Dw.cancelled,Dw.interrupted],kw=Object.freeze({attemptSetup:`attempt.setup`,sandboxPrepare:`sandbox.prepare`,agentEnsure:`agent.ensure`,evalRun:`eval.run`,agentSend:`agent.send`,sandboxCommand:`sandbox.command`,assertionEvaluate:`assertion.evaluate`,verdictFold:`verdict.fold`,attemptTeardown:`attempt.teardown`,runSetup:`run.setup`,runDiscovery:`run.discovery`,runPlan:`run.plan`,runDispatch:`run.dispatch`,runTeardown:`run.teardown`,collection:`collection`}),Aw=[kw.attemptSetup,kw.sandboxPrepare,kw.agentEnsure,kw.evalRun,kw.agentSend,kw.sandboxCommand,kw.assertionEvaluate,kw.verdictFold,kw.attemptTeardown];kw.attemptSetup,kw.sandboxPrepare,kw.agentEnsure,kw.evalRun,kw.sandboxCommand,kw.assertionEvaluate,kw.verdictFold,kw.attemptTeardown;var jw=[kw.runSetup,kw.runDiscovery,kw.runPlan,kw.runDispatch,kw.runTeardown],Mw=[kw.collection];[...Aw,...Mw],[...jw,...Mw];var Nw=[kw.attemptSetup,kw.sandboxPrepare,kw.agentEnsure,kw.evalRun,kw.sandboxCommand,kw.attemptTeardown],Pw=Object.freeze({...Dw,unknown:`unknown`}),Fw=[Pw.completed,Pw.failed,Pw.cancelled,Pw.interrupted,Pw.unknown],Iw=Object.freeze({timeout:`timeout`,cancelled:`cancelled`,transportLost:`transport-lost`}),Lw=[Iw.timeout,Iw.cancelled,Iw.transportLost],Rw=Object.freeze({spawnFailed:`spawn-failed`,cancelledBeforeStart:`cancelled-before-start`}),zw=[Rw.spawnFailed,Rw.cancelledBeforeStart];Object.freeze({errors:`all`,onExcessProperty:`error`});var Bw=W.pipe(Z($(JS,{identifier:`ObservabilityNonNegativeSafeInteger`,description:`a JSON-safe non-negative integer`})),Q(NS)),Vw=W.pipe(Z($(YS,{identifier:`ObservabilityPositiveSafeInteger`,description:`a positive JSON-safe integer`})),Q(PS)),Hw=U.pipe(Z($(QS,{identifier:`ObservabilitySafeIdentifier`,description:`a lowercase ASCII identifier no longer than 64 bytes`})),Q(FS));U.pipe(Z($($S,{identifier:`ObservabilityStableLabel`,description:`a provider-neutral lowercase ASCII label no longer than 64 bytes`})),Q(LS));var Uw=U.pipe(Z($(tC,{identifier:`ObservabilitySafeText`,description:`strict UTF-8 text without NUL or C0 controls other than LF`})),Q(RS)),Ww=U.pipe(Z($(eC,{identifier:`ObservabilitySourceNativeToolName`,description:`a non-empty source-native tool name no longer than 256 UTF-8 bytes`})),Q(IS));U.pipe(Z($(rC,{identifier:`ObservabilityCanonicalDecimal`,description:`a non-negative canonical decimal string no longer than 64 bytes`})),Q(zS));var Gw=U.pipe(Z($(iC,{identifier:`ObservabilityCurrencyCode`,description:`an uppercase three-letter currency code`})),Q(BS)),Kw=U.pipe(Z($(kC,{identifier:`ObservabilityTurnId`,description:`a turn_ identifier with 26 lowercase Crockford base-32 characters`})),Q(aC)),qw=U.pipe(Z($(AC,{identifier:`ObservabilityItemId`,description:`an item_ identifier with 26 lowercase Crockford base-32 characters`})),Q(oC)),Jw=U.pipe(Z($(jC,{identifier:`ObservabilityCallId`,description:`a call_ identifier with 26 lowercase Crockford base-32 characters`})),Q(sC)),Yw=U.pipe(Z($(FC,{identifier:`ObservabilityLegacySourceLocalCallId`,description:`a v1 source-local call identifier`})),Q(dC)),Xw=U.pipe(Z($(MC,{identifier:`ObservabilityEventId`,description:`an event_ identifier with 26 lowercase Crockford base-32 characters`})),Q(cC)),Zw=U.pipe(Z($(NC,{identifier:`ObservabilityToolOccurrenceId`,description:`a tool_ identifier with 26 lowercase Crockford base-32 characters`})),Q(lC)),Qw=U.pipe(Z($(PC,{identifier:`ObservabilitySessionScopeId`,description:`a session_ identifier with 26 lowercase Crockford base-32 characters`})),Q(uC)),$w=U.pipe(Z($(IC,{identifier:`ObservabilityCommandId`,description:`a command_ identifier with 26 lowercase Crockford base-32 characters`})),Q(fC)),eT=U.pipe(Z($(LC,{identifier:`ObservabilityUsageObservationId`,description:`a usage_ identifier with 26 lowercase Crockford base-32 characters`})),Q(pC)),tT=U.pipe(Z($(RC,{identifier:`ObservabilityIntervalId`,description:`an interval_ identifier with 26 lowercase Crockford base-32 characters`})),Q(mC)),nT=U.pipe(Z($(zC,{identifier:`ObservabilityDiagnosticId`,description:`a diagnostic_ identifier with 26 lowercase Crockford base-32 characters`})),Q(hC)),rT=Y([`conversation-item`,`conversation-text`,`command-manifest`,`command-stdout`,`command-stderr`,`usage-observation`,`timing-interval`,`diagnostic`]).pipe(Z($(QC,{identifier:`ObservabilityCollectionTarget`,description:`a closed Observability collection target`}))),iT=Y([`adapter`,`command-capture`,`usage-capture`,`timing-capture`,`diagnostic-capture`,`attempt-finalizer`,`run-teardown`]).pipe(Z($($C,{identifier:`ObservabilityCollectionStage`,description:`a closed Observability capture stage`}))),aT=J([K({code:H(`capture-failed`),stage:iT,target:rT}),K({code:H(`capture-interrupted`),stage:iT,target:rT}),K({code:H(`collection-cap-reached`),target:rT,retained:Bw,omittedAtLeast:Vw}),K({code:H(`unsupported-input`),target:rT,omittedAtLeast:Vw}),K({code:H(`text-truncated`),target:H(`conversation-text`),itemId:qw,retainedBytes:Bw,omittedBytes:Vw}),K({code:H(`text-truncated`),target:H(`command-manifest`),commandId:$w,retainedBytes:Bw,omittedBytes:Vw}),K({code:H(`text-truncated`),target:H(`diagnostic`),diagnosticId:nT,retainedBytes:Bw,omittedBytes:Vw}),K({code:H(`stream-truncated`),commandId:$w,stream:Y([`stdout`,`stderr`]),retainedBytes:Bw,omittedBytes:Vw}),K({code:H(`invalid-utf8-replaced`),commandId:$w,stream:Y([`stdout`,`stderr`]),replacementCount:Vw}),K({code:H(`unsafe-control-stripped`),commandId:$w,stream:Y([`stdout`,`stderr`]),strippedCount:Vw}),K({code:H(`redacted`),target:rT,replacementCount:Vw})]).pipe(Z($(ow,{identifier:`ObservabilityLimitation`,description:`a semantically valid closed Observability limitation`})));J([K({state:H(`complete`),limitations:C_([])}),K({state:H(`partial`),limitations:w_(aT)})]).pipe(Z($(e=>sw(e).length===0,{identifier:`ObservabilityCollection`,description:`a complete empty or partial canonically ordered limitation collection`})));var oT=K({family:H(`niceeval.agent-turns`),kind:H(`turn`),id:Kw}),sT=K({family:H(`niceeval.agent-turns`),kind:H(`item`),id:qw}),cT=K({family:H(`niceeval.agent-turns`),kind:H(`call`),id:Jw}),lT=K({family:H(`niceeval.agent-turns`),kind:H(`event`),id:Xw}),uT=K({family:H(`niceeval.agent-turns`),kind:H(`tool-occurrence`),id:Zw}),dT=K({family:H(`niceeval.agent-turns`),kind:H(`session-scope`),id:Qw}),fT=K({family:H(`niceeval.sandbox-commands`),kind:H(`command`),id:$w}),pT=K({family:H(`niceeval.agent-turns`),kind:H(`usage-observation`),id:eT}),mT=K({family:H(`niceeval.runner-activities`),kind:H(`interval`),id:tT}),hT=K({family:H(`niceeval.runner-diagnostics`),kind:H(`diagnostic`),id:nT}),gT=J([oT,sT,cT,lT,uT,dT,fT,pT,mT,hT]),_T=J([mT,hT]);q(gT).pipe(Z($(e=>e.length<=16&&qC(e,`niceeval.agent-turns`)))),q(gT).pipe(Z($(e=>e.length<=16&&qC(e,`niceeval.sandbox-commands`)))),q(gT).pipe(Z($(e=>e.length<=16&&qC(e,`niceeval.agent-turns`)))),q(gT).pipe(Z($(e=>e.length<=16&&qC(e,`niceeval.runner-activities`)))),q(gT).pipe(Z($(e=>e.length<=16&&qC(e,`niceeval.runner-diagnostics`)))),q(_T).pipe(Z($(e=>e.length<=16&&JC(e,`niceeval.runner-activities`)))),q(_T).pipe(Z($(e=>e.length<=16&&JC(e,`niceeval.runner-diagnostics`))));var vT=TS,yT=Y([`adapter`,`session-manager`,`sandbox-wrapper`,`runner-clock`,`runner-diagnostic-sink`,`attempt-finalizer`,`run-teardown`]),bT=Y([`turn`,`turn-item`,`usage-observation`,`turn-context`,`command`,`stdout`,`stderr`,`activity`,`diagnostic`,`diagnostic-cause`,`value-byte`,`content-byte`]),xT=J([K({code:Y([`capture-failed`,`capture-interrupted`]),stage:yT,target:bT}),K({code:Y([`collection-cap-reached`,`unsupported-input`]),target:bT,omittedAtLeast:CS}),K({code:Y([`text-truncated`,`redacted`,`invalid-utf8-replaced`,`unsafe-control-stripped`]),target:bT,replacementOrOmittedCount:CS})]);function ST(e){switch(e.code){case`capture-failed`:case`capture-interrupted`:return[e.code,e.stage,e.target].join(`\0`);case`collection-cap-reached`:case`unsupported-input`:return[e.code,e.target,String(e.omittedAtLeast)].join(`\0`);case`text-truncated`:case`redacted`:case`invalid-utf8-replaced`:case`unsafe-control-stripped`:return[e.code,e.target,String(e.replacementOrOmittedCount)].join(`\0`)}}function CT(e){let t,n=new Set;for(let r of e){let e=ST(r);if(n.has(e)||t!==void 0&&t>=e)return!1;n.add(e),t=e}return!0}var wT=J([K({state:H(`complete`),limitations:OS}),K({state:H(`partial`),limitations:w_(xT).pipe(Z($(CT)))})]);Object.freeze({maximumBlobs:1,maximumBlobBytes:1,maximumTotalBytes:1});var TT={itemId:qw,eventId:Xw,sessionSequence:Vw},ET=J([K({state:H(`exact`),toolOccurrenceId:Zw}),K({state:H(`unavailable`),reason:Y([`orphan-finish`,`ambiguous-operation`])})]),DT=J([K({...TT,kind:H(`message`),role:Y([`user`,`assistant`]),text:Uw}),K({...TT,kind:H(`tool-start`),toolOccurrenceId:Zw,tool:Ww,inputSummary:Uw}),K({...TT,kind:H(`tool-finish`),occurrence:ET,outcome:Y([`completed`,`rejected`,`failed`,`cancelled`]),outputSummary:Uw}),K({...TT,kind:Y([`thinking-summary`,`compaction`,`context-injection`]),summary:Uw}),K({...TT,kind:H(`subagent`),state:Y([`started`,`completed`,`failed`]),label:Hw,summary:Uw}),K({...TT,kind:H(`input-request`),state:Y([`requested`,`answered`,`cancelled`]),promptSummary:Uw,responseSummary:X(Uw)}),K({...TT,kind:Y([`skill-load`,`conversation-error`]),code:Hw,summary:Uw})]),OT={itemId:qw,sequence:CS},kT=J([K({...OT,kind:H(`message`),role:Y([`user`,`assistant`]),text:Uw}),K({...OT,kind:H(`tool-call`),callId:Yw,tool:Ww,inputSummary:Uw}),K({...OT,kind:H(`tool-result`),callId:Yw,outcome:Y([`completed`,`rejected`,`failed`,`cancelled`]),outputSummary:Uw}),K({...OT,kind:Y([`thinking-summary`,`compaction`,`context-injection`]),summary:Uw}),K({...OT,kind:H(`subagent`),state:Y([`started`,`completed`,`failed`]),label:Hw,summary:Uw}),K({...OT,kind:H(`input-request`),state:Y([`requested`,`answered`,`cancelled`]),promptSummary:Uw,responseSummary:X(Uw)}),K({...OT,kind:Y([`skill-load`,`conversation-error`]),code:Hw,summary:Uw})]),AT=J([K({usageObservationId:eT,kind:H(`token-bucket`),provider:Hw,bucket:Y([`input`,`output`,`cache-read`,`cache-write`,`reasoning`,`other`]),tokens:Bw}),K({usageObservationId:eT,kind:H(`request`),provider:Hw,requestKind:Y([`model`,`tool`])}),K({usageObservationId:eT,kind:H(`provider-cost`),provider:Hw,amount:U.pipe(Z($(e=>/^(?:0|[1-9][0-9]*)(?:\.[0-9]*[1-9])?$/u.test(e)))),currency:Gw})]),jT=Y([`complete`,`partial`,`unavailable`]),MT=U.pipe(Z($(e=>e.trim().length>0&&!!nC(e,16384),{identifier:`AgentTurnEvidenceCoverageReason`,description:`non-empty durable coverage reason within the conversation text limit`}))),NT=J([K({status:H(`complete`)}),K({status:Y([`partial`,`unavailable`]),reason:MT})]),PT=K({events:NT,actions:NT,messages:NT,usage:NT,status:NT,data:NT}),FT=J([K({state:H(`recorded`),status:Y([`completed`,`failed`,`waiting`]),evidenceCoverage:K({events:jT,actions:jT,messages:jT,usage:jT,status:jT,data:jT})}),K({state:H(`unavailable`),reason:Y([`send-failed`,`send-interrupted`])})]),IT=J([K({state:H(`recorded`),status:Y([`completed`,`failed`,`waiting`]),evidenceCoverage:PT}),K({state:H(`unavailable`),reason:Y([`send-failed`,`send-interrupted`])})]),LT={segmentId:vT,turnId:Kw,sequence:CS,outcome:Y(Ow),usage:q(AT)},RT=K({...LT,sessionId:Qw,terminal:IT,items:q(DT)}),zT=K({...LT,terminal:IT,items:q(kT)}),BT=K({...LT,sessionId:Qw,terminal:FT,items:q(DT)}),VT=K({...LT,terminal:FT,items:q(kT)});K({collection:wT,segments:q(VT)}).pipe(b_({collection:`collection-data`,segments:`segments-data`})),J([K({state:H(`current`),collection:wT,segments:q(BT)}).pipe(b_({collection:`collection-data`,segments:`segments-data`})),K({state:H(`legacy`),collection:wT,segments:q(VT)}).pipe(b_({collection:`collection-data`,segments:`segments-data`}))]),J([K({state:H(`current`),collection:wT,segments:q(RT)}).pipe(b_({collection:`collection-data`,segments:`segments-data`})),K({state:H(`legacy`),collection:wT,segments:q(zT)}).pipe(b_({collection:`collection-data`,segments:`segments-data`}))]);var HT=Object.freeze({maximumWindows:256,maximumChangesPerWindow:1e4,maximumRetainedChanges:1e4,maximumTextRevisionBytes:1024*1024,maximumContents:2e4,maximumContentBytes:1024*1024,maximumTotalContentBytes:128*1024*1024,maximumPayloadJsonBytes:16*1024*1024,maximumPolicyEntries:256,maximumPolicyEntryUtf8Bytes:4096}),UT=new TextEncoder;function WT(e){return UT.encode(e).byteLength}function GT(e){let t,n=new Set;for(let r of e){if(n.has(r)||t!==void 0&&Wy(t,r)>=0)return!1;n.add(r),t=r}return!0}function KT(e){return GT(e.map(QT))}var qT=U.pipe(Z($(e=>/^(?:turn[1-9][0-9]*|session[1-9][0-9]*\/turn[1-9][0-9]*)$/.test(e),{identifier:`FileChangesWindowId`,description:`a canonical agent send-window id`}))),JT=q(U.pipe(Z($(e=>WT(e)<=HT.maximumPolicyEntryUtf8Bytes,{identifier:`FileChangesPolicyEntry`,description:`a File Changes include or ignore entry within its UTF-8 budget`})))).pipe(Z($(e=>e.length<=HT.maximumPolicyEntries&>(e),{identifier:`FileChangesPolicyEntries`,description:`an ASCII-canonical, deduplicated bounded policy entry sequence`}))),YT=K({kind:H(`agent-send-window-endpoints`),policy:K({defaultPolicy:H(`niceeval.sandbox-ledger/default-excludes/v1`),include:JT,ignore:JT})}),XT=Y([`checkpoint`,`export`,`finalizer-export`,`normalize`]),ZT=J([K({code:Y([`capture-failed`,`capture-interrupted`]),stage:XT,atWindowId:X(qT)}),K({code:H(`collection-cap-reached`),target:Y([`window`,`change`,`content`,`value`,`content-byte`]),omittedAtLeast:CS,atWindowId:X(qT)}),K({code:H(`unsupported-input`),target:H(`endpoint-metadata`),omittedAtLeast:CS})]);function QT(e){switch(e.code){case`capture-failed`:case`capture-interrupted`:return[e.code,e.stage,e.atWindowId??``].join(`\0`);case`collection-cap-reached`:return[e.code,e.target,e.atWindowId??``,String(e.omittedAtLeast)].join(`\0`);case`unsupported-input`:return[e.code,e.target,String(e.omittedAtLeast)].join(`\0`)}}var $T=J([K({state:H(`complete`),limitations:OS}),K({state:H(`partial`),limitations:w_(ZT).pipe(Z($(KT,{identifier:`FileChangesPartialLimitations`,description:`a deterministic deduplicated File Changes limitation sequence`})))})]),eE=J([K({kind:H(`text`),sha256:db,byteLength:SS.pipe(Z($(e=>e<=HT.maximumTextRevisionBytes,{identifier:`FileChangesTextRevisionByteLength`,description:`a retained text revision within the File Changes text budget`}))),content:J([K({state:H(`available`),content:J_.pipe(X_.maximumBytes(HT.maximumContentBytes))}),K({state:H(`omitted`),reason:H(`collection-cap`)})])}),K({kind:H(`elided`),reason:Y([`binary`,`oversized-text`]),byteLength:SS}),K({kind:H(`unavailable`),reason:Y([`unsupported-input`,`capture-failed`,`capture-interrupted`])})]),tE=J([K({state:H(`absent`)}),K({state:H(`present`),revision:eE})]);K({attribution:YT,collection:$T,windows:q(K({windowId:qT,sequence:CS,changes:q(K({changeId:pb,path:gb,kind:Y([`created`,`modified`,`deleted`]),before:tE,after:tE}).pipe(Z($(e=>{switch(e.kind){case`created`:return e.before.state===`absent`&&e.after.state===`present`;case`modified`:return e.before.state===`present`&&e.after.state===`present`;case`deleted`:return e.before.state===`present`&&e.after.state===`absent`}},{identifier:`FileChange`,description:`a coherent created, modified, or deleted endpoint transition`})))).pipe(Z($(e=>e.length<=HT.maximumChangesPerWindow&>(e.map(e=>e.path)),{identifier:`FileChangesWindowChanges`,description:`a bounded ASCII-path-canonical unique window change sequence`})))}))}).pipe(b_({attribution:`attribution-data`,collection:`collection-data`,windows:`windows-data`}));var nE=Y([`available`,`partial`,`unavailable`,`empty`,`unsupported`,`failed`]),rE=U.pipe(Z($(AC))),iE=U.pipe(Z($(NC))),aE=U.pipe(Z($(IC))),oE=J([K({kind:H(`redacted`),fieldCount:W}),K({kind:H(`sampled`),captured:W,knownTotal:B(W)}),K({kind:H(`truncated`),omittedBytes:W}),K({kind:H(`provider-limited`)})]),sE=J([K({code:Y([`assertions-not-recorded`,`assertions-revision-unsupported`,`assertions-current-invalid`]),locator:U}),K({code:Y([`attempt-origin-missing`,`attempt-not-observed`]),runId:U,slotId:U,evalId:U,attemptOrdinal:W}),K({code:H(`score-contribution-unavailable`),locator:U,entryId:U,reason:Y([`source-unavailable`,`evaluation-errored`,`not-applicable`])}),K({code:H(`score-partial`),locator:X(U)})]),cE=K({identity:K({kind:H(`attempt`),locator:U})}),lE=K({state:nE,value:X(W),samples:W,total:W,basis:Y([`slot`,`eval`]),issues:q(sE),refs:q(cE),unit:B(Y([`points`,`USD`,`ms`,`tokens`])),bounds:B(K({min:W,max:W}))}),uE=K({...lE.fields,source:X(Y([`observed`,`estimated`]))}),dE=J([K({identity:K({kind:H(`attempt`),locator:U}),state:Y([`not-recorded`,`unsupported`,`failed`])}),K({identity:K({kind:H(`attempt`),locator:U}),entryId:U,groupPath:q(U),state:Y([`complete`,`partial`,`unavailable`,`not-applicable`]),reason:B(Y([`sampled`,`truncated`,`redacted`,`provider-limited`,`not-collected`,`source-unavailable`,`producer-failed`,`optional-material`,`unsupported-subject`])),limitations:q(oE)})]),fE={evaluationKind:Y([`pass`,`points`,`mixed`]),denominator:K({expected:W,observed:W,classified:W,missing:W}),verdict:K({tally:K({passed:W,failed:W,errored:W,skipped:W}),passRate:lE}),score:lE,costUSD:uE,durationMs:lE,tokens:lE,coverage:q(dE),issues:q(sE)},pE=K({...hx.fields,verdict:X(Y([`passed`,`failed`,`errored`,`skipped`])),score:lE,costUSD:uE,durationMs:lE,tokens:lE}),mE=J([K({state:H(`available`),value:U}),K({state:H(`mixed`)}),K({state:H(`unavailable`)})]),hE=x_(U,mE),gE=K({runId:U,slotId:U,evalId:U,attemptOrdinal:W,labels:hE,publication:J([mx,pE,gx])}),_E=K({experimentId:U,agent:mE,model:mE,labels:hE,groups:q(K({groupPath:q(U),...fE})),...fE}),vE=K({experimentId:U,evalId:U,groupPath:q(U),members:q(gE),...fE}),yE=K({totals:K(fE),experiments:q(_E),cells:q(vE)}),bE=K({experiment:_E,cells:q(vE)}),xE=K({value:nS,members:q(rS),attempts:q(iS)});q(K({runId:ib,state:H(`completed`),experimentId:cb,invocationId:h_,startedAt:_b,completedAt:_b,coverage:K({published:W,expected:W})}));var SE=J([K({state:H(`not-scored`)}),K({state:H(`complete`),earned:W,possible:W}),K({state:H(`unavailable`),earned:W,possible:W,unavailable:W})]),CE=X(Y([`passed`,`failed`,`errored`,`skipped`])),wE=K({runs:q(nS),denominator:K({expected:W,observed:W}),members:q(K({runId:U,slotId:U,evalId:U,attemptOrdinal:W,executionIdentityDigest:U,state:Y([`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`,`missing`]),locator:X(U),outcome:X(Y([`completed`,`errored`,`cancelled`,`interrupted`])),verdict:CE,score:B(SE)}))}),TE=K({channel:Y([`events`,`actions`,`messages`,`usage`,`status`,`data`]),status:Y([`complete`,`partial`,`unavailable`]),reason:B(U)}),EE=J([TE,K({owner:H(`assertion-material`),state:H(`partial`),reason:Y([`sampled`,`truncated`,`redacted`,`provider-limited`]),limitations:q(oE)}),K({owner:H(`assertion-material`),state:H(`unavailable`),reason:Y([`not-collected`,`source-unavailable`,`producer-failed`]),limitations:q(oE)}),K({owner:H(`assertion-material`),state:H(`not-applicable`),reason:Y([`optional-material`,`unsupported-subject`]),limitations:q(oE)})]),DE=K({state:Y([`available`,`not-recorded`,`partial`,`unavailable`])}),OE=K({assertions:DE,trace:DE,sources:DE,diff:DE,artifacts:DE,timing:DE,usage:DE,conversation:DE,commands:DE,diagnostics:DE}),kE=K({state:Y([`available`,`not-recorded`,`invalid`]),entries:q(K({entryId:U,display:K({label:B(U),key:B(U),groupPath:q(U)})}))}),AE=J([K({state:H(`not-recorded`),entryCount:H(0)}),K({state:H(`available`),entryCount:W,sourceSiteCount:W}),K({state:Y([`unsupported`,`failed`,`invalid`]),entryCount:H(0)})]),jE=K({core:iS,locator:U,originRun:nS,targets:q(K({runId:U,member:rS})),evidence:AE,assertions:kE,sections:OE,verdict:CE,score:SE,evidenceCoverage:q(TE),limitations:q(EE)}),ME=J([K({state:H(`available`),text:U}),K({state:H(`omitted`),reason:H(`inspection-result-byte-limit`),byteLength:W,byteLimit:W})]),NE=J([K({state:H(`mapped`),sourceItemId:U,sha256:U}),K({state:H(`unmapped`),reason:Y([`source-snapshot-not-recorded`,`position-unrepresentable`])})]),PE=K({entryId:U,sourceOrder:W,role:Y([`declaration`,`threshold`,`score`,`gate`,`optional`,`stop`]),start:K({line:W,column:W}),end:K({line:W,column:W}),source:NE}),FE=J([K({state:Y([`not-recorded`,`invalid`]),sourceSites:C_([]),hasMoreSourceSites:H(!1),omittedSourceSiteCount:H(0)}),K({state:H(`available`),sourceSites:q(PE),hasMoreSourceSites:G,omittedSourceSiteCount:W})]),IE=K({state:Y([`available`,`not-recorded`,`invalid`]),items:q(K({sourceItemId:U,path:U,byteLength:W,sha256:U,content:ME})),hasMore:G,omittedItemCount:W,assertions:FE}),LE=Y([`complete`,`partial`,`not-recorded`,`invalid`]),RE=J([xT,K({issue:U}),K({source:H(`agent-turns`),turnId:Kw,channel:Y([`conversation`,`events`,`actions`,`messages`,`status`,`data`]),state:Y([`partial`,`unavailable`]),reason:U}),K({source:H(`turn-contexts`),state:Y([`partial`,`not-recorded`,`invalid`]),limitations:q(J([xT,K({issue:U})]))})]),zE=Y(Ow),BE=J([K({state:H(`not-recorded`)}),K({state:H(`unmapped`),reason:Y([`location-not-captured`,`source-snapshot-not-recorded`,`position-unrepresentable`]),sessionIndex:W,turnIndex:W,sourceOrder:X(W)}),K({state:H(`mapped`),sourceItemId:fb,sha256:db,start:K({line:W,column:W}),end:K({line:W,column:W}),sessionIndex:W,turnIndex:W,sourceOrder:W})]),VE=J([K({state:H(`complete`)}),K({state:Y([`partial`,`unavailable`]),reason:U})]),HE=J([K({state:H(`recorded`),status:Y([`completed`,`failed`,`waiting`]),coverage:K({events:VE,actions:VE,messages:VE,status:VE,data:VE})}),K({state:H(`unavailable`),reason:Y([`send-failed`,`send-interrupted`]),coverage:K({state:H(`unavailable`),reason:Y([`send-failed`,`send-interrupted`])})})]),UE=J([xT,K({issue:U})]),WE=K({sourceItemId:fb,sha256:db,start:K({line:W,column:W}),end:K({line:W,column:W})}),GE=K({state:LE,limitations:q(UE),limitationsTruncated:G,omittedLimitationCount:W,items:q(K({diagnosticId:U,sequence:W,turnId:X(U),phase:Y([`attempt.setup`,`sandbox.prepare`,`agent.ensure`,`eval.run`,`agent.send`,`sandbox.command`,`assertion.evaluate`,`verdict.fold`,`attempt.teardown`]),kind:Y([`advisory`,`execution-error`]),code:U,summary:U,summaryTruncated:G,causes:q(K({code:U,summary:U,summaryTruncated:G})),causesTruncated:G,omittedCauseCount:W,redaction:J([K({state:H(`none`)}),K({state:H(`applied`),replacements:W})]),sourceFrame:X(WE)})),hasMore:G,omittedDiagnosticCount:W}),KE={itemId:rE,turnId:U,sequence:W},qE=J([K({...KE,kind:H(`message`),role:Y([`user`,`assistant`]),text:U,textTruncated:G}),K({...KE,kind:H(`tool-call`),tool:U,input:U,inputTruncated:G,toolOccurrenceId:B(iE)}),K({...KE,kind:H(`tool-result`),outcome:Y([`completed`,`rejected`,`failed`,`cancelled`]),output:U,outputTruncated:G,toolOccurrenceId:B(iE)}),K({...KE,kind:Y([`thinking-summary`,`compaction`,`context-injection`]),summary:U,summaryTruncated:G}),K({...KE,kind:H(`subagent`),state:Y([`started`,`completed`,`failed`]),label:U,summary:U,summaryTruncated:G}),K({...KE,kind:H(`input-request`),state:Y([`requested`,`answered`,`cancelled`]),prompt:U,promptTruncated:G,response:X(U),responseTruncated:G}),K({...KE,kind:Y([`skill-load`,`conversation-error`]),code:U,summary:U,summaryTruncated:G})]),JE=J([K({kind:H(`exited`),exitCode:W}),K({kind:H(`terminated`),reason:Y(Lw)}),K({kind:H(`not-started`),reason:Y(zw)})]),YE=K({conversation:K({state:LE,limitations:q(RE),limitationsTruncated:G,omittedLimitationCount:W,turns:q(K({turnId:U,sequence:W,sessionId:B(Qw),outcome:zE,terminal:HE,context:BE})),turnsTruncated:G,omittedTurnCount:W,items:q(qE),itemsTruncated:G,omittedItemCount:W}),commands:K({state:LE,limitations:q(RE),limitationsTruncated:G,omittedLimitationCount:W,items:q(K({commandId:aE,phase:Y(Nw),outcome:JE})),hasMore:G,omittedCommandCount:W}),diagnostics:GE,identityIndex:K({itemIds:q(rE),toolOccurrenceIds:K({ids:q(iE)}),commandIds:q(aE)})}),XE={itemId:rE,turnId:U,turnSequence:W,turnOutcome:zE,sessionId:B(U),eventId:B(U),sequence:B(W)},ZE=J([K({...XE,kind:H(`message`),role:Y([`user`,`assistant`]),text:U}),K({...XE,kind:H(`tool-call`),toolOccurrenceId:B(iE),tool:U,input:U}),K({...XE,kind:H(`tool-result`),toolOccurrenceId:B(iE),outcome:Y([`completed`,`rejected`,`failed`,`cancelled`]),output:U}),K({...XE,kind:Y([`thinking-summary`,`compaction`,`context-injection`]),summary:U}),K({...XE,kind:H(`subagent`),state:Y([`started`,`completed`,`failed`]),label:U,summary:U}),K({...XE,kind:H(`input-request`),state:Y([`requested`,`answered`,`cancelled`]),prompt:U,response:X(U)}),K({...XE,kind:Y([`skill-load`,`conversation-error`]),code:U,summary:U})]),QE=K({turnId:U,sequence:W,outcome:zE}),$E=J([K({kind:H(`shell`),command:U}),K({kind:H(`argv`),executable:U,arguments:q(U)})]),eD=J([K({kind:H(`sandbox-default`)}),K({kind:H(`project-relative`),path:U}),K({kind:H(`redacted`)})]),tD=K({text:U,retainedBytes:W,totalSafeUtf8Bytes:W,sha256:U,truncation:K({state:Y([`not-truncated`,`truncated`]),omittedSafeUtf8Bytes:W})}),nD=J([K({kind:H(`item`),itemId:rE,item:ZE}),K({kind:H(`tool-occurrence`),toolOccurrenceId:iE,call:X(ZE),result:X(ZE),turn:K({call:X(QE),result:X(QE)})}),K({kind:H(`command`),commandId:aE,invocation:$E,workingDirectory:eD,outcome:JE,turnId:X(U),phase:Y([`attempt.setup`,`sandbox.prepare`,`agent.ensure`,`eval.run`,`sandbox.command`,`attempt.teardown`]),sequence:W,stdout:tD,stderr:tD})]),rD=J([xT,K({issue:U})]),iD=J([K({state:H(`complete`)}),K({state:Y([`partial`,`unavailable`]),reason:U})]),aD=J([rD,K({source:H(`agent-turns`),turnId:U,channel:H(`usage`),state:Y([`partial`,`unavailable`]),reason:U})]),[oD,sD,cD]=AT.members,lD=J([K({turnId:Kw,...oD.fields}),K({turnId:Kw,...sD.fields}),K({turnId:Kw,...cD.fields})]),uD=K({state:Y([`available`,`partial`,`unavailable`]),value:X(W),observationCount:W}),dD=K({currency:U,value:U,observationCount:W}),fD=K({inputTokens:uD,outputTokens:uD,requests:uD,providerCosts:K({state:Y([`available`,`partial`,`unavailable`]),values:q(dD),observationCount:W})}),pD=K({state:LE,limitations:q(aD),limitationsTruncated:G,omittedLimitationCount:W,turns:q(K({turnId:U,coverage:iD})),turnsTruncated:G,omittedTurnCount:W,observations:q(lD),totals:fD,hasMore:G,omittedObservationCount:W}),mD=Y([`complete`,`partial`,`not-recorded`,`invalid`,`unavailable`]),hD=K({state:mD,facts:q(TE),limitations:q(EE)}),gD=K({state:mD,summary:X(K({turnCount:W,observationCount:W})),totals:fD,limitations:q(aD),limitationsTruncated:G,omittedLimitationCount:W}),_D=J([K({kind:H(`member-not-observed`),state:Y([`missing`,`not-dispatched`,`interrupted`])}),K({kind:H(`attempt-unresolved`),originRunId:U,attemptId:U}),K({kind:H(`coverage`),detail:EE}),K({kind:H(`usage`),detail:aD})]),vD=K({slot:tS,state:Y([`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`,`missing`]),locator:X(U),relation:X(Y([`origin`,`reference`])),outcome:X(Y([`completed`,`errored`,`cancelled`,`interrupted`])),verdict:CE,score:X(SE),coverage:hD,usage:gD,limitations:q(_D)}),yD=K({slotId:U,locator:X(U),limitation:_D}),bD=K({identity:K({runId:ib,experimentId:cb}),startedAt:_b,completedAt:_b,denominator:K({expected:W,observed:W}),members:q(vD),coverage:K({state:mD,expectedMemberCount:W,observedMemberCount:W,completeMemberCount:W,factCount:W,limitations:q(yD)}),usage:K({state:mD,expectedMemberCount:W,observedMemberCount:W,recordedAttemptCount:W,totals:fD,limitations:q(yD)}),limitations:q(yD)}),xD=K({state:LE,limitations:q(rD),limitationsTruncated:G,omittedLimitationCount:W,activities:q(K({activityId:U,sequence:W,parentActivityId:X(U),turnId:X(U),phase:U,label:U,startOffsetMs:W,durationMs:W,outcome:Y(Fw)})),hasMore:G,omittedActivityCount:W}),SD=J([K({kind:H(`text`),sha256:U,byteLength:W,content:Y([`available`,`omitted`])}),K({kind:H(`elided`),reason:Y([`binary`,`oversized-text`]),byteLength:W}),K({kind:H(`unavailable`),reason:Y([`unsupported-input`,`capture-failed`,`capture-interrupted`])})]),CD=J([K({state:H(`absent`)}),K({state:H(`present`),revision:SD})]),wD=K({windowId:U,sequence:W,changes:q(K({changeId:U,path:U,kind:Y([`created`,`modified`,`deleted`]),before:CD,after:CD}))}),TD=J([K({state:H(`not-recorded`),windows:C_([])}),K({state:H(`invalid`),issues:q(U),windows:C_([])}),K({state:Y([`complete`,`partial`]),limitations:q(ZT),windows:q(wD)})]),ED=U.pipe(O_(e=>gy.test(e),{identifier:`AttemptLocator`,description:`a canonical @-prefixed Attempt locator`})),DD=U.pipe(Z($(AC))),OD=U.pipe(Z($(NC))),kD=U.pipe(Z($(IC))),AD=q(ib),jD=(e,t)=>K({kind:H(e),...t}),MD=K({kind:Y([`project-record`,`external-record`]),sealedCutoffIdentity:U}),ND=K({kind:H(`inspection-sealed-cutoff`),identity:U,runCount:W,runs:q(K({runId:U,logicalSealIdentity:U}))}),PD=K({requestedRunIds:q(U),selectedRunIds:q(U),missingRunIds:q(U)}),FD=K({protocol:H(cw),outcome:H(`success`),source:MD,sealedCutoff:ND,selection:PD,issues:C_([]),evidence:K({refs:q(U)})}),ID=K({protocol:H(cw),outcome:H(`success`),source:MD,sealedCutoff:K({kind:H(`inspection-sealed-cutoff`),identity:U,runCount:W}),selection:K({requestedRunIds:q(U),selectedRunIds:q(U),missingRunIds:q(U),returnedRunCount:W,totalRunCount:W,truncated:G}),issues:C_([]),evidence:K({refs:q(U)})}),LD=J([K({code:H(`selection-run-missing`),side:Y([`left`,`right`]),runId:U}),K({code:H(`comparison-member-set-mismatch`)})]),RD=FD.pipe(v_({issues:q(LD)})),zD=J([K({state:H(`not-recorded`)}),K({state:H(`available`),value:V(MS),collection:K({state:Y([`complete-page`,`bounded-page`]),items:q(V(jS)),hasMore:G}),contents:q(K({logicalHandle:U,byteLength:W,digest:U})),contentsTruncated:G})]),BD=K({runId:U,writerGeneration:U,startedAt:U,logicalSealIdentity:U,slotCount:W,memberCount:W,attemptCount:W,attachmentCount:W,contentCount:W,contentByteLength:W,sealEntryCount:W}),VD=K({key:U,runId:U,slotId:U,evalId:U,attemptOrdinal:W,locator:U}),HD=K({mode:Y([`side-by-side`,`exact`,`paired`]),left:K({runs:q(nS),members:q(VD)}),right:K({runs:q(nS),members:q(VD)}),exactMemberSet:G,pairs:q(K({key:U,left:VD,right:VD}))}),UD=e=>Object.freeze(e),WD=Object.freeze({"overview.get":UD({request:jD(`overview.get`,{runIds:B(AD)}),result:{overview:yE},factKinds:[`core`,`assertions`,`attempt-cost`]}),"experiment.get":UD({request:jD(`experiment.get`,{experimentId:cb}),result:{experiment:bE},factKinds:[`core`,`assertions`,`attempt-cost`]}),"runs.list":UD({request:jD(`runs.list`,{continuation:B(U)}),result:{runs:q(BD),continuation:B(U)},factKinds:[`core`]}),"run.get":UD({request:jD(`run.get`,{runId:ib}),result:{run:xE},factKinds:[`core`]}),"run.summary":UD({request:jD(`run.summary`,{runId:ib}),result:{summary:wE},factKinds:[`core`,`assertions`,`agent-turns`]}),"run.overview":UD({request:jD(`run.overview`,{runId:ib}),result:{runOverview:bD},factKinds:[`core`,`assertions`,`agent-turns`]}),"attempt.get":UD({request:jD(`attempt.get`,{locator:ED}),result:{attempt:jE},factKinds:[`core`,`assertions`]}),"attempt.assertion.detail":UD({request:jD(`attempt.assertion.detail`,{locator:ED,entryId:Fv}),result:{assertion:Ew},factKinds:[`assertions`,`agent-turns`,`sources`]}),"attempt.trace":UD({request:jD(`attempt.trace`,{locator:ED}),result:{trace:YE},factKinds:[`agent-turns`,`turn-contexts`,`sandbox-commands`,`runner-activities`,`runner-diagnostics`]}),"attempt.trace.detail":UD({request:jD(`attempt.trace.detail`,{locator:ED,selector:J([jD(`item`,{itemId:DD}),jD(`tool-occurrence`,{toolOccurrenceId:OD}),jD(`command`,{commandId:kD})])}),result:{detail:nD},factKinds:[`agent-turns`,`sandbox-commands`]}),"attempt.timing":UD({request:jD(`attempt.timing`,{locator:ED}),result:{timing:xD},factKinds:[`runner-activities`]}),"attempt.usage":UD({request:jD(`attempt.usage`,{locator:ED}),result:{usage:pD},factKinds:[`agent-turns`]}),"attempt.diff":UD({request:jD(`attempt.diff`,{locator:ED}),result:{diff:TD},factKinds:[`file-changes`]}),"attempt.sources":UD({request:jD(`attempt.sources`,{locator:ED}),result:{sources:IE},factKinds:[`assertions`,`sources`]}),"attempt.artifacts":UD({request:jD(`attempt.artifacts`,{locator:ED}),result:{artifacts:zD},factKinds:[`artifacts`]}),"runs.compare":UD({request:jD(`runs.compare`,{mode:Y([`side-by-side`,`exact`,`paired`]),leftRunIds:AD,rightRunIds:AD}),result:{comparison:HD},factKinds:[`core`]})}),GD=Y(Object.freeze(Object.keys(WD))),KD=Object.entries(WD),qD=K({protocol:H(cw),operation:J(KD.map(([,e])=>e.request))}),JD=(e,t)=>{let n=v_({operation:H(e),...t.result});return e===`runs.list`?ID.pipe(n):e===`runs.compare`?RD.pipe(n):FD.pipe(n)},YD=J(KD.map(([e,t])=>JD(e,t))),XD=(e,t)=>{let n=v_({outcome:H(`explanation`),operation:H(e),factKinds:C_(t.factKinds.map(e=>H(e)))});return e===`runs.list`?ID.pipe(n):FD.pipe(n)},ZD=J(KD.map(([e,t])=>XD(e,t))),QD=J(KD.map(([e])=>K({id:H(e)}))),$D=J([K({protocol:H(cw),outcome:H(`discovery`),operations:q(QD)}),YD,ZD,K({protocol:H(cw),outcome:H(`failure`),operation:X(GD),failure:K({code:Y([`inspection-request-invalid`,`inspection-selection-missing`,`inspection-source-invalid`,`inspection-record-integrity-failure`,`inspection-operation-failed`,`inspection-result-invalid`]),reason:U,identity:B(K({runId:U})),correction:Y([`fix-request`,`choose-existing-selection`,`fix-record-source`,`retry`,`upgrade-or-report`])})})]);function eO(e){let t=l_($D,{errors:`all`,onExcessProperty:`error`})(e);return Xu(t)?{success:!0,value:e}:{success:!1,reason:String(t.failure)}}function tO(e,t){return e.outcome===`success`&&e.operation===t?{success:!0,value:e}:{success:!1,reason:`expected success ${t}, received ${e.outcome}${`operation`in e?` ${e.operation}`:``}`}}var nO=l_(qD,{onExcessProperty:`error`});function rO(e){let t=nO({protocol:cw,operation:e});return Yu(t)?Ju(Object.freeze({classification:`protocol/query`,code:`inspection-request-invalid`,reason:String(t.failure)})):qu(t.success.operation)}l_(qD,{onExcessProperty:`error`});function iO(e){let t=new Set,n=(e,r)=>{if(e===null||typeof e==`string`||typeof e==`boolean`)return e;if(typeof e==`number`)return Number.isFinite(e)?e:aO(r,`numbers must be finite`);if(Array.isArray(e)){if(t.has(e))return aO(r,`cyclic arrays are not encodable`);t.add(e);let i=[];for(let[t,a]of e.entries()){let e=n(a,[...r,String(t)]);if(oO(e))return e;i.push(e)}return t.delete(e),Object.freeze(i)}if(typeof e!=`object`||!e)return aO(r,`unsupported ${typeof e} value`);if(t.has(e))return aO(r,`cyclic objects are not encodable`);let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)return aO(r,`only plain objects may cross Inspection delivery`);t.add(e);let a={};for(let t of Object.keys(e).sort(cO)){let i=n(Reflect.get(e,t),[...r,t]);if(oO(i))return i;a[t]=i}return t.delete(e),Object.freeze(a)};return n(e,[])}function aO(e,t){return Object.freeze({code:`inspection-result-invalid`,reason:`${e.length===0?`$`:e.join(`.`)}: ${t}`})}function oO(e){return sO(e)&&e.code===`inspection-result-invalid`&&typeof e.reason==`string`}function sO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cO(e,t){return e<t?-1:+(e>t)}function lO(e){let t=iO(e);return dO(t)?Ju(t):qu(`${uO(t)}\n`)}function uO(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(uO).join(`,`)}]`;let t=e;return`{${Object.keys(t).sort(fO).map(e=>`${JSON.stringify(e)}:${uO(t[e])}`).join(`,`)}}`}function dO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Reflect.get(e,`code`)===`inspection-result-invalid`&&typeof Reflect.get(e,`reason`)==`string`}function fO(e,t){return e<t?-1:+(e>t)}function pO(e,t){let n=lO(t);if(Yu(n))throw Error(`Inspection operation query key is invalid: ${n.failure.reason}`);return[`inspection`,e,`${t.kind}:${n.success}`]}function mO(e,t){return Is({queryKey:pO(e.identity,t),queryFn:()=>e.inspectRepository(t)})}var hO=(0,f.createContext)(null);function gO({runtime:e,children:t}){let n=(0,f.useSyncExternalStore)(t=>e.subscribe(t),()=>e.current,()=>e.current);if(n===void 0)throw Error(`No View generation has been committed.`);return(0,M.jsx)(hO.Provider,{value:n.binding,children:(0,M.jsx)(go,{client:n.queryClient,children:t})})}function _O(){let e=(0,f.useContext)(hO);if(e===null)throw Error(`useCurrentGeneration must be used inside InspectionRuntimeProvider.`);return e}function vO(e,t={}){let n=(0,f.useContext)(hO);if(n===null)throw Error(`useInspectionQuery must be used inside InspectionRuntimeProvider.`);let r=(t.enabled??!0)&&e!==null;if(e===null)return Fs({queryKey:[`inspection`,n.identity,`disabled`],queryFn:Go,enabled:!1});let i=mO(n,e);return Fs({queryKey:i.queryKey,queryFn:i.queryFn,enabled:r,...t.select===void 0?{}:{select:t.select}})}var yO=class{generation;#e=!1;constructor(e){this.generation=e}get identity(){return this.generation.identity}inspect(e){return this.#e?Promise.reject(Error(`Generation lease is released.`)):this.generation.queryClient.fetchQuery(mO(this.generation,e))}release(){this.#e||(this.#e=!0,this.generation.releaseLease())}},bO=class{repository;identity;queryClient=new Es({defaultOptions:{queries:{gcTime:5*6e4,retry:1,staleTime:1/0,refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1}}});#e=`preparing`;#t=0;#n=0;#r;binding;constructor(e){this.repository=e,this.identity=e.generationId;let t=this;this.binding=Object.freeze({identity:this.identity,queryClient:this.queryClient,get snapshot(){return t.snapshot},inspectRepository(e){return t.inspectRepository(e)}})}get status(){return this.#e}get snapshot(){if(this.#r===void 0)throw Error(`View generation snapshot is not ready.`);return this.#r}attachSnapshot(e){if(this.#e!==`preparing`||this.#r!==void 0)throw Error(`A View generation snapshot can only be attached once while preparing.`);this.#r=e}acquire(){if(this.#e===`retiring`||this.#e===`closed`)throw Error(`View generation is ${this.#e}.`);return this.#t+=1,new yO(this)}inspectRepository(e){if(this.#e===`retiring`||this.#e===`closed`)return Promise.reject(Error(`View generation is ${this.#e}.`));this.#n+=1;let t;try{t=this.repository.inspect(e)}catch(e){return this.#i(),Promise.reject(e)}return t.finally(()=>this.#i())}publish(){if(this.#e!==`preparing`)throw Error(`Only a preparing generation can be published.`);this.#e=`current`}drain(){this.#e===`retiring`||this.#e===`closed`||(this.#e=`retiring`,this.queryClient.clear(),this.#a())}close(){this.#t=0,this.#o()}releaseLease(){this.#t>0&&--this.#t,this.#a()}#i(){this.#n>0&&--this.#n,this.#a()}#a(){this.#e===`retiring`&&this.#t===0&&this.#n===0&&this.#o()}#o(){this.#e!==`closed`&&(this.#e=`closed`,this.queryClient.clear(),this.repository.close())}},xO=class{#e;#t=new Set;#n=new Set;get current(){return this.#e}acquireCurrent(){let e=this.#e;if(e===void 0)throw Error(`No View generation has been committed.`);return e.acquire()}subscribe(e){return this.#n.add(e),()=>this.#n.delete(e)}prepare(e){let t=new bO(e);try{let e={generation:t,lease:t.acquire()};return this.#t.add(t),e}catch(e){throw t.close(),e}}attachSnapshot(e,t){if(!this.#t.has(e.generation))throw Error(`Only a prepared View generation can receive a snapshot.`);e.generation.attachSnapshot(t)}commit(e){if(!this.#t.delete(e.generation)||e.generation.status!==`preparing`)throw e.lease.release(),e.generation.close(),Error(`Only an open View generation can be committed.`);let t=this.#e;e.generation.snapshot,e.generation.publish(),this.#e=e.generation,e.lease.release();for(let e of this.#n)e();return t}retire(e){e!==void 0&&e!==this.#e&&e.drain()}reject(e){this.#t.delete(e.generation),e.lease.release(),e.generation.close()}close(){let e=this.#e;this.#e=void 0,e?.close();for(let e of this.#t)e.close();this.#t.clear()}dispose(){this.close()}},SO=class extends Error{classification=`route-input`;translationKey=`report.unableToLoad`},CO=class extends Error{classification=`selection`;translationKey=`report.unableToLoad`};function wO(e){let t=rO(e);if(Yu(t))throw new SO(`Invalid Insight route input.`);return t.success}function TO(e=[]){let t=wO({kind:`overview.get`,...e.length===0?{}:{runIds:e}});if(t.kind!==`overview.get`)throw new SO(`Invalid overview operation.`);return t}function EO(e){let t=wO({kind:`run.get`,runId:e}),n=wO({kind:`run.summary`,runId:e});if(t.kind!==`run.get`||n.kind!==`run.summary`)throw new SO(`Invalid run route.`);return[t,n]}function DO(e){let t=wO({kind:`attempt.get`,locator:e}),n=wO({kind:`attempt.trace`,locator:e});if(t.kind!==`attempt.get`||n.kind!==`attempt.trace`)throw new SO(`Invalid attempt route.`);return[t,n]}function OO(e){let t=wO(e);switch(t.kind){case`attempt.assertion.detail`:case`attempt.trace.detail`:case`attempt.timing`:case`attempt.usage`:case`attempt.sources`:case`attempt.diff`:case`attempt.artifacts`:return t;default:throw new SO(`Invalid Attempt detail operation.`)}}function kO(e){return Object.freeze({state:`available`,value:e})}function AO(){return Object.freeze({state:`unavailable`})}function jO(e){return e===`complete`?`available`:e===`partial`?`partial`:e===`not-recorded`?`not-recorded`:`unavailable`}function MO(e,t){let n=e.attempt.originRun.expectedSlots.find(({slotId:t})=>t===e.attempt.core.slotId),r=e.attempt.score,i=r.state===`complete`?r.earned:void 0;return Object.freeze({locator:e.attempt.locator,runId:e.attempt.originRun.runId,experimentId:e.attempt.originRun.experimentId,evalId:e.attempt.core.evalId,summary:Object.freeze({experimentId:e.attempt.originRun.experimentId,identity:Object.freeze({runId:e.attempt.originRun.runId,evalId:e.attempt.core.evalId,attempt:n===void 0?AO():kO(n.attemptOrdinal)}),verdict:e.attempt.verdict??`unknown`,startedAt:new Date(e.attempt.originRun.startedAt).toISOString(),durationMs:AO(),capabilities:Object.freeze({source:e.attempt.sections.sources.state,execution:jO(t.trace.conversation.state),timing:e.attempt.sections.timing.state,diff:e.attempt.sections.diff.state}),...i===void 0?{}:{totalScore:i}}),assertionEntryIds:Object.freeze(e.attempt.assertions.entries.map(({entryId:e})=>e)),traceItemIds:Object.freeze([...t.trace.identityIndex.itemIds]),toolOccurrenceIds:Object.freeze([...t.trace.identityIndex.toolOccurrenceIds.ids]),commandIds:Object.freeze([...t.trace.identityIndex.commandIds])})}function NO(e,t){let[n,r]=DO(t);return Is({queryKey:[`insight-attempt`,e.identity,t],queryFn:async()=>{let[t,i]=await Promise.all([e.queryClient.fetchQuery(mO(e,n)),e.queryClient.fetchQuery(mO(e,r))]);return MO(t,i)}})}function PO(e,t,n,r,i){return Is({queryKey:[`insight-results`,e.identity,r??null,i??null],queryFn:async()=>{let e=t.groups.find(({identity:e})=>e.kind===r&&(e.kind===`named`?e.groupId===i:e.experimentId===i));if(e===void 0&&t.groups.length>0)throw new CO(`Results selection is unavailable.`);let a=e?.members??[];return Object.freeze({overview:n,selectedExperiments:a,selectionTitle:e?.label??`Results`})}})}function FO(e,t,n){return Is({queryKey:[`insight-experiment`,e.identity,n],queryFn:async()=>{if(!t.catalog.experiments.includes(n))throw new CO(`Experiment selection is unavailable.`);let e=[n];return Object.freeze({overview:t,selectedExperiments:Object.freeze(e),selectionTitle:e[0]??`Results`})}})}function IO(e){let t=e.overview.cells.map(e=>Object.freeze({experimentId:e.experimentId,evalId:e.evalId,evaluationKind:e.evaluationKind,passRate:LO(e.verdict.passRate),score:LO(e.score),costUSD:LO(e.costUSD),durationMs:LO(e.durationMs),tokens:LO(e.tokens),tally:Object.freeze({...e.verdict.tally}),members:Object.freeze(e.members.map(e=>Object.freeze({runId:e.runId,attemptOrdinal:e.attemptOrdinal,publication:e.publication.state===`published`?Object.freeze({state:`published`,locator:e.publication.attemptLocator,score:LO(e.publication.score),costUSD:LO(e.publication.costUSD),durationMs:LO(e.publication.durationMs),tokens:LO(e.publication.tokens)}):e.publication})))})),n=e.overview.experiments.map(e=>Object.freeze({experimentId:e.experimentId,evaluationKind:e.evaluationKind,passRate:LO(e.verdict.passRate),score:LO(e.score),costUSD:LO(e.costUSD),durationMs:LO(e.durationMs),tokens:LO(e.tokens),agent:e.agent,model:e.model,groups:Object.freeze(e.groups.map(e=>Object.freeze({groupPath:Object.freeze([...e.groupPath]),evaluationKind:e.evaluationKind,passRate:LO(e.verdict.passRate),score:LO(e.score),costUSD:LO(e.costUSD),durationMs:LO(e.durationMs),tokens:LO(e.tokens)})))})),r=n.map(({experimentId:e})=>e),i=HO(t.flatMap(e=>e.members.map(t=>({runId:t.runId,experimentId:e.experimentId}))),({runId:e})=>e),a=HO(t.flatMap(e=>e.members.flatMap(t=>t.publication.state===`published`?[{locator:t.publication.locator,experimentId:e.experimentId}]:[])),({locator:e})=>e);return Object.freeze({cells:Object.freeze(t),experiments:Object.freeze(n),catalog:Object.freeze({experiments:Object.freeze(r),runExperiments:Object.freeze(i),attemptExperiments:Object.freeze(a)})})}function LO(e){return Object.freeze({value:e.value,state:e.state,samples:e.samples,total:e.total,basis:e.basis,issues:Object.freeze(e.issues),refs:Object.freeze(e.refs.map(e=>Object.freeze({identity:Object.freeze({kind:e.identity.kind,locator:e.identity.locator})}))),...e.unit===void 0?{}:{unit:e.unit},...`source`in e&&(e.source===`observed`||e.source===`estimated`||e.source===null)?{source:e.source}:{},...e.bounds===void 0?{}:{bounds:Object.freeze({...e.bounds})}})}function RO(e,t){let n=new Set(t),r=e.cells.filter(({experimentId:e})=>n.has(e)),i=[...new Set(r.map(({evalId:e})=>e))];return t.flatMap(t=>{let n=e.experiments.find(e=>e.experimentId===t);if(n===void 0)return[];let a=r.filter(e=>e.experimentId===t);if(a.length===0)return[];let o=a.map(zO),s=n.evaluationKind,c=i.filter(e=>!a.some(t=>t.evalId===e));return[Object.freeze({experimentId:t,agent:n.agent,model:n.model,flags:null,evaluationKind:s,score:n.score,costUSD:n.costUSD,durationMs:n.durationMs,tokens:n.tokens,endToEndPassRate:n.passRate,missingEvalIds:Object.freeze(c),groupMetrics:BO(n.groups),evalRows:Object.freeze(o),href:`#/experiment/${encodeURIComponent(t)}`})]})}function zO(e){let t=e.members.flatMap(t=>{if(t.publication.state!==`published`)return[];let n=e.members.length===1?VO(e.tally):null;return[Object.freeze({locator:t.publication.locator,experimentId:e.experimentId,evalId:e.evalId,attemptOrdinal:t.attemptOrdinal,verdict:n,failureSummary:null,evaluationKind:e.evaluationKind===`pass`?`pass`:`points`,score:t.publication.score,costUSD:t.publication.costUSD,durationMs:t.publication.durationMs,tokens:t.publication.tokens,startedAt:null,href:`#/attempt/${t.publication.locator.startsWith(`@`)?t.publication.locator.slice(1):t.publication.locator}`})]});return Object.freeze({evalId:e.evalId,evaluationKind:e.evaluationKind===`pass`?`pass`:`points`,score:e.score,costUSD:e.costUSD,durationMs:e.durationMs,tokens:e.tokens,endToEndPassRate:e.passRate,attempts:Object.freeze(t)})}function BO(e){return new Map(e.map(e=>[e.groupPath.join(`/`),Object.freeze({passRate:e.passRate,score:e.score,costUSD:e.costUSD,durationMs:e.durationMs,tokens:e.tokens})]))}function VO(e){return e.passed===1&&e.failed===0&&e.errored===0&&e.skipped===0?`passed`:e.passed===0&&e.failed===1&&e.errored===0&&e.skipped===0?`failed`:e.passed===0&&e.failed===0&&e.errored===1&&e.skipped===0?`errored`:e.passed===0&&e.failed===0&&e.errored===0&&e.skipped===1?`skipped`:null}function HO(e,t){let n=new Map;for(let r of e)n.set(t(r),r);return Object.freeze([...n.values()])}function UO(e,t){return Object.freeze({runId:e.run.value.runId,experimentId:e.run.value.experimentId,members:Object.freeze(t.summary.members.map((e,t)=>Object.freeze({key:`${e.slotId}:${t}`,slotId:e.slotId,evalId:e.evalId,attemptOrdinal:e.attemptOrdinal,state:e.state,locator:e.locator,outcome:e.outcome,verdict:e.verdict})))})}function WO(e,t){let[n,r]=EO(t);return Is({queryKey:[`insight-run`,e.identity,t],queryFn:async()=>{let[t,i]=await Promise.all([e.queryClient.fetchQuery(mO(e,n)),e.queryClient.fetchQuery(mO(e,r))]);return UO(t,i)}})}function GO({checkForUpdate:e,refresh:t}){let n=_O(),{manifest:r,routeGuard:i}=n.snapshot,a=pr(),o=(0,f.useRef)(void 0);return i!==void 0&&a.pathname===i&&(o.current=n.identity),i!==void 0&&o.current!==n.identity&&a.pathname!==i?(0,M.jsx)(ei,{to:i,replace:!0,state:null}):(0,M.jsx)(KO,{manifest:r,refresh:t,checkForUpdate:e})}function KO({checkForUpdate:e,manifest:t,refresh:r}){let i=_O(),[a,o]=(0,f.useState)(!1),[s,c]=(0,f.useState)(),[l,u]=(0,f.useState)(!1),{i18n:d,t:p}=n(),m=pr(),h=gr(),g=Lr(),_=yr(),v=Fs({queryKey:[`view`,`update-available`,i.identity],queryFn:e,refetchInterval:500,staleTime:0,retry:!1}),y=m.state?.background,b=g.at(-1)?.handle,x=(0,f.useRef)(_);(b?.presentation!==`overlay`||y===void 0)&&(x.current=_);let S=d.resolvedLanguage??`en`;(0,f.useEffect)(()=>{document.title=p(`insight.title`)},[p]);let C=t.experimentSelection?.options??[],w=C.find(({route:e})=>m.pathname===e)??C[0];return(0,M.jsxs)(`div`,{onClickCapture:(0,f.useCallback)(e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target instanceof Element?e.target.closest(`a[href]`):null;if(t===null||t.target&&t.target!==`_self`||t.hasAttribute(`download`))return;let n=new URL(t.href,document.baseURI);if(n.origin!==window.location.origin||!n.hash.startsWith(`#/`))return;let r=n.hash.slice(1);!r.startsWith(`/attempt/`)&&!r.startsWith(`/run/`)&&!r.startsWith(`/experiment/`)||(e.preventDefault(),h(r,{state:{background:y??m}}))},[y,m,h]),children:[(0,M.jsxs)(`header`,{className:`niceeval-view-shell`,children:[(0,M.jsxs)(`a`,{className:`niceeval-view-brand`,href:`https://niceeval.com/?utm_source=insight&utm_medium=brand`,target:`_blank`,rel:`noopener`,children:[(0,M.jsx)(`span`,{className:`niceeval-view-mark`,"aria-hidden":`true`}),(0,M.jsx)(`span`,{children:`NiceEval`})]}),(0,M.jsx)(`nav`,{className:`niceeval-view-nav`,"aria-label":p(`nav.pages`),children:(0,M.jsx)(`a`,{href:`#${t.defaultRoute}`,"aria-current":b?.presentation===`page`?`page`:void 0,children:p(`insight.navigation`)})}),(0,M.jsxs)(`div`,{className:`niceeval-view-controls`,children:[w===void 0?null:(0,M.jsxs)(`label`,{className:`niceeval-view-experiment`,children:[(0,M.jsx)(`span`,{children:p(`nav.experiments`)}),(0,M.jsx)(`select`,{value:w.route,onChange:e=>h(e.target.value),children:C.map(e=>(0,M.jsx)(`option`,{value:e.route,children:e.label},e.route))})]}),(0,M.jsx)(`label`,{className:`niceeval-view-language`,children:(0,M.jsxs)(`select`,{"aria-label":p(`nav.language`),value:S,onChange:e=>void d.changeLanguage(e.target.value),children:[(0,M.jsx)(`option`,{value:`en`,children:`EN`}),(0,M.jsx)(`option`,{value:`zh-CN`,children:`中文`})]})}),(0,M.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>{o(!0),u(!1),c(void 0),r().then(e=>{c(e.noticeKey)}).catch(()=>u(!0)).finally(()=>o(!1))},children:p(a?`refresh.working`:`refresh.action`)}),v.data===!0&&!a?(0,M.jsx)(`span`,{role:`status`,children:p(`refresh.available`)}):null,s===void 0?null:(0,M.jsx)(`span`,{role:`status`,children:p(s)}),l?(0,M.jsx)(`span`,{role:`alert`,children:p(`refresh.failed`)}):null]})]}),(0,M.jsx)(`main`,{className:`niceeval-view-main`,children:y===void 0?_:(0,M.jsxs)(M.Fragment,{children:[x.current,_]})})]})}function qO(e){let t=e.indexOf(`/`);if(t===-1)return Object.freeze({kind:`singleton`,experimentId:e,key:`singleton/${e}`});let n=e.slice(0,t);return Object.freeze({kind:`named`,groupId:n,key:`named/${n}`})}function JO(e,t=[]){let n=new Map;for(let t of[...new Set(e.experiments)].sort($O)){let e=qO(t),r=n.get(e.key)??{identity:e,members:[]};r.members.push(t),n.set(e.key,r)}let r=Object.freeze([...n.values()].sort((e,t)=>$O(e.identity.key,t.identity.key)).map(({identity:e,members:t})=>Object.freeze({identity:e,members:Object.freeze(t),route:YO(e),label:e.key}))),i=t.map(t=>e.runExperiments.find(e=>e.runId===t)?.experimentId).find(e=>e!==void 0),a=i===void 0?r[0]:r.find(({members:e})=>e.includes(i))??r[0],o=a?.route??`/`,s=r.map(e=>QO({pageId:`group:${e.identity.key}`,route:e.route,title:{en:`NiceEval Insight`,"zh-CN":`NiceEval Insight`},navigation:!1,presentation:`page`,target:e.identity.kind===`named`?{kind:`group`,groupKind:`named`,key:e.identity.groupId}:{kind:`group`,groupKind:`singleton`,key:e.identity.experimentId}}));for(let{experimentId:t}of e.experiments.map(e=>({experimentId:e})))s.push(QO({pageId:`experiment:${t}`,route:`/experiment/${encodeURIComponent(t)}`,title:{en:`Experiment`,"zh-CN":`实验`},navigation:!1,presentation:`overlay`,target:{kind:`experiment`,experimentId:t}}));for(let{runId:t}of ZO(e.runExperiments,({runId:e})=>e))s.push(QO({pageId:`run:${t}`,route:`/run/${encodeURIComponent(t)}`,title:{en:`Run`,"zh-CN":`运行`},navigation:!1,presentation:`overlay`,target:{kind:`run`,runId:t}}));for(let{locator:t}of ZO(e.attemptExperiments,({locator:e})=>e))s.push(QO({pageId:`attempt:${t}`,route:`/attempt/${XO(t)}`,title:{en:`Attempt`,"zh-CN":`尝试`},navigation:!1,presentation:`overlay`,target:{kind:`attempt`,locator:t}}));return s.unshift(QO({pageId:`overview`,route:`/`,title:{en:`NiceEval Insight`,"zh-CN":`NiceEval Insight`},navigation:!0,presentation:`page`,target:a===void 0?{kind:`group`,groupKind:`singleton`,key:``}:a.identity.kind===`named`?{kind:`group`,groupKind:`named`,key:a.identity.groupId}:{kind:`group`,groupKind:`singleton`,key:a.identity.experimentId}})),Object.freeze({title:{en:`NiceEval Insight`,"zh-CN":`NiceEval Insight`},defaultRoute:o,experimentSelection:{options:r.map(({route:e,label:t})=>Object.freeze({route:e,label:t}))},pages:Object.freeze(s),groups:r})}function YO(e){return e.kind===`named`?`/group/named/${encodeURIComponent(e.groupId)}`:`/group/singleton/${encodeURIComponent(e.experimentId)}`}function XO(e){return encodeURIComponent(e.startsWith(`@`)?e.slice(1):e)}function ZO(e,t){let n=new Map;for(let r of e)n.set(t(r),r);return[...n.values()]}function QO(e){return Object.freeze(e)}function $O(e,t){return e<t?-1:+(e>t)}var ek=K({generationId:U,sourceCutoffIdentity:U,refreshSupported:G,stale:G});K({generationId:U}),K({generationId:U,request:qD});var tk=K({code:Y([`view-request-invalid`,`view-generation-not-found`,`view-generation-stale`,`view-inspection-failed`]),reason:U,correction:Y([`fix-request`,`refresh-generation`,`retry`])}),nk={errors:`all`,onExcessProperty:`error`},rk=l_(ek,nk),ik=l_(tk,nk),ak=class extends Error{status;code;correction;classification=`view-http`;constructor(e,t,n,r,i){super(r,i),this.status=e,this.code=t,this.correction=n,this.name=`ViewHttpError`}},ok=class{descriptor;generationId;#e=new AbortController;#t=!1;constructor(e){this.descriptor=e,this.generationId=e.generationId}async inspect(e){if(this.#t)throw Error(`HTTP Inspection repository is closed.`);let t=rO(e);if(Yu(t))throw Error(t.failure.reason);let n=await dk(`/_niceeval/inspection`,{method:`POST`,signal:this.#e.signal,headers:{"content-type":`application/json`},body:JSON.stringify({generationId:this.descriptor.generationId,request:{protocol:cw,operation:t.success}})}),r=await fk(n);if(!n.ok)throw pk(n.status,r);let i=eO(r);if(!i.success)throw new ak(n.status,`view-response-invalid`,`retry`,i.reason);let a=tO(i.value,e.kind);if(!a.success)throw new ak(n.status,`view-response-invalid`,`retry`,a.reason);return a.value}close(){this.#t||(this.#t=!0,this.#e.abort())}};async function sk(){return uk(`/_niceeval/generation`,{method:`GET`})}async function ck(){return uk(`/_niceeval/generation/refresh`,{method:`POST`})}async function lk(e){return uk(`/_niceeval/generation/commit`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({generationId:e})})}async function uk(e,t){let n=await dk(e,t),r=await fk(n);if(!n.ok)throw pk(n.status,r);let i=rk(r);if(Yu(i))throw new ak(n.status,`view-response-invalid`,`retry`,String(i.failure));return i.success}function dk(e,t){return fetch(new URL(e,document.baseURI),{...t,cache:`no-store`,credentials:`same-origin`})}async function fk(e){try{return await e.json()}catch(t){throw new ak(e.status,`view-response-invalid`,`retry`,`View HTTP response is not JSON.`,{cause:t})}}function pk(e,t){let n=ik(t);return Yu(n)?new ak(e,`view-response-invalid`,`retry`,`View HTTP request failed (${e}).`):new ak(e,n.success.code,n.success.correction,n.success.reason)}var mk=class extends Error{classification=`generation-prepare`;translationKey=`report.unableToLoad`};async function hk(){let e=new URL(document.baseURI).searchParams.getAll(`run`),t=new xO;window.addEventListener(`pagehide`,()=>t.dispose(),{once:!0});let n=await sk(),r=t.prepare(new ok(n)),i,a;try{a=IO(await r.lease.inspect(TO(e))),i=JO(a.catalog);let n=gk();await xk(r.lease,i,a,n??i.defaultRoute),t.attachSnapshot(r,Sk(i,a)),t.commit(r)}catch(e){throw t.reject(r),new mk(`Unable to prepare initial generation.`,{cause:e})}let o=e=>async()=>{let n=t.acquireCurrent();try{return await e(n)}finally{n.release()}},s=(e,t)=>{let n=e[t];if(!n)throw new SO(`Insight route parameter is missing.`);try{return decodeURIComponent(n)}catch{throw new SO(`Insight route parameter is malformed.`)}},c=0,l=Vi([{path:`/`,element:(0,M.jsx)(gO,{runtime:t,children:(0,M.jsx)(GO,{checkForUpdate:async()=>(await ck()).generationId!==t.current?.identity,refresh:async()=>{let n=c,r=l.state.location.pathname,i=l.state.location.state?.background?.pathname,a=await ck(),o=t.prepare(new ok(a)),s,u,d;try{if(s=IO(await o.lease.inspect(TO(e))),u=JO(s.catalog),d=yk(t.current.snapshot.overview,s,u,r),await xk(o.lease,u,s,d.route),i!==void 0&&await xk(o.lease,u,s,i),c!==n||l.state.location.pathname!==r)throw new mk(`View location changed while refresh was preparing.`);if(t.attachSnapshot(o,Sk(u,s,d.fallback?d.route:void 0)),(await lk(a.generationId)).generationId!==a.generationId)throw new mk(`View Host committed an unexpected generation.`)}catch(e){throw t.reject(o),new mk(`Unable to prepare refreshed generation.`,{cause:e})}let f=t.commit(o);return t.retire(f),Object.freeze({manifest:u,...d.fallback?{fallbackRoute:d.route,noticeKey:`refresh.selectionChanged`}:{}})}})}),errorElement:(0,M.jsx)(_k,{}),children:[{index:!0,element:(0,M.jsx)(ei,{to:i.defaultRoute,replace:!0})},{path:`group/:groupKind/:key`,handle:{presentation:`page`},loader:({params:e})=>o(async t=>{let n=t.generation.binding;return await n.queryClient.fetchQuery(PO(n,n.snapshot.manifest,n.snapshot.overview,s(e,`groupKind`),s(e,`key`))),null})(),lazy:async()=>({Component:(await _(async()=>{let{ResultsRoute:e}=await import(`./ResultsPage-9CSI8dvZ.js`);return{ResultsRoute:e}},__vite__mapDeps([0,1,2,3]))).ResultsRoute})},{path:`experiment/:experimentId`,handle:{presentation:`overlay`},loader:({params:e})=>o(async t=>{let n=t.generation.binding;return await n.queryClient.fetchQuery(FO(n,n.snapshot.overview,s(e,`experimentId`))),null})(),lazy:async()=>({Component:(await _(async()=>{let{ResultsRoute:e}=await import(`./ResultsPage-9CSI8dvZ.js`);return{ResultsRoute:e}},__vite__mapDeps([0,1,2,3]))).ResultsRoute})},{path:`run/:runId`,handle:{presentation:`overlay`},loader:({params:e})=>o(async t=>{let n=t.generation.binding;return await n.queryClient.fetchQuery(WO(n,s(e,`runId`))),null})(),lazy:async()=>({Component:(await _(async()=>{let{RunRoute:e}=await import(`./RunPage-BUF0REv7.js`);return{RunRoute:e}},__vite__mapDeps([4,1,2,5,3]))).RunRoute})},{path:`attempt/:locator`,handle:{presentation:`overlay`},loader:({params:e})=>o(async t=>{let n=t.generation.binding;return await n.queryClient.fetchQuery(NO(n,`@${s(e,`locator`)}`)),null})(),lazy:async()=>({Component:(await _(async()=>{let{AttemptRoute:e}=await import(`./AttemptRoute-DRHVh2JA.js`);return{AttemptRoute:e}},__vite__mapDeps([6,1,2,5]))).AttemptRoute})},{path:`*`,element:(0,M.jsx)(ei,{to:i.defaultRoute,replace:!0})}]}]),u=l.state.location;return l.subscribe(e=>{e.location!==u&&(u=e.location,c+=1)}),l}function gk(){let e=window.location.hash;if(e.startsWith(`#/`))return e.slice(1)}function _k(){let e=Rr(),{t}=n(),r=typeof e==`object`&&e&&`translationKey`in e&&(e.translationKey===`report.unableToLoad`||e.translationKey===`report.unableToLoadDetails`)?e.translationKey:`report.unableToLoad`;return(0,M.jsxs)(`main`,{className:`niceeval-view-main`,role:`alert`,children:[(0,M.jsx)(`h1`,{children:t(`report.unableToLoad`)}),(0,M.jsx)(`p`,{children:t(r)}),(0,M.jsx)(`a`,{href:`#/`,children:t(`report.backToResults`)})]})}async function vk(e,t,n){let r=t.groups[0],i=e.generation.binding;await i.queryClient.fetchQuery(PO(i,t,n,r?.identity.kind,r?.identity.kind===`named`?r.identity.groupId:r?.identity.experimentId))}function yk(e,t,n,r){let i;try{i=r.split(`/`).filter(Boolean).map(decodeURIComponent)}catch{return{route:n.defaultRoute,fallback:!0}}if(i[0]===`attempt`&&i[1]){let a=`@${i[1]}`;if(t.catalog.attemptExperiments.some(e=>e.locator===a))return{route:r,fallback:!1};let o=e.catalog.attemptExperiments.find(e=>e.locator===a)?.experimentId,s=t.catalog.runExperiments.filter(e=>e.experimentId===o).sort((e,t)=>bk(e.runId,t.runId))[0];return s===void 0?{route:n.defaultRoute,fallback:!0}:{route:`/run/${encodeURIComponent(s.runId)}`,fallback:!0}}return i[0]===`run`&&i[1]?t.catalog.runExperiments.some(e=>e.runId===i[1])?{route:r,fallback:!1}:{route:n.defaultRoute,fallback:!0}:i[0]===`experiment`&&i[1]?t.catalog.experiments.includes(i[1])?{route:r,fallback:!1}:{route:n.defaultRoute,fallback:!0}:i[0]===`group`&&n.pages.some(e=>e.route===r)?{route:r,fallback:!1}:{route:n.defaultRoute,fallback:r!==n.defaultRoute}}function bk(e,t){return e<t?-1:+(e>t)}async function xk(e,t,n,r){let i;try{i=r.split(`/`).filter(Boolean).map(decodeURIComponent)}catch{throw new SO(`Insight route is malformed.`)}let a=e.generation.binding;i[0]===`attempt`&&i[1]?await a.queryClient.fetchQuery(NO(a,`@${i[1]}`)):i[0]===`run`&&i[1]?await a.queryClient.fetchQuery(WO(a,i[1])):i[0]===`experiment`&&i[1]?await a.queryClient.fetchQuery(FO(a,n,i[1])):i[0]===`group`?await a.queryClient.fetchQuery(PO(a,t,n,i[1],i[2])):await vk(e,t,n)}function Sk(e,t,n){return Object.freeze({manifest:e,overview:t,...n===void 0?{}:{routeGuard:n}})}var Ck=document.getElementById(`root`);if(Ck===null)throw Error(`NiceEval View root is missing`);var wk=hk();function Tk(){return(0,M.jsx)(la,{router:(0,f.use)(wk)})}function Ek(){let e=window.location.hash.startsWith(`#/attempt/`);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`main`,{className:`niceeval-view-main`,children:e?(0,M.jsx)(`h1`,{children:`NiceEval Insight`}):(0,M.jsx)(`p`,{role:`status`,children:po.t(`report.loading`)})}),e?(0,M.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`niceeval-bootstrap-attempt-title`,className:`niceeval-view-dialog`,children:[(0,M.jsx)(`div`,{className:`niceeval-view-dialog-head`,children:(0,M.jsx)(`h2`,{id:`niceeval-bootstrap-attempt-title`,className:`niceeval-view-dialog-title`,children:po.t(`attempt.title`)})}),(0,M.jsx)(`p`,{role:`status`,children:po.t(`report.loadingDetails`)})]}):null]})}var Dk=class extends f.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){}render(){return this.state.failed?(0,M.jsx)(`main`,{className:`niceeval-view-main`,role:`alert`,children:(0,M.jsx)(`h1`,{children:po.t(`app.failed`)})}):this.props.children}};(0,p.createRoot)(Ck).render((0,M.jsx)(f.StrictMode,{children:(0,M.jsx)(Dk,{children:(0,M.jsx)(f.Suspense,{fallback:(0,M.jsx)(Ek,{}),children:(0,M.jsx)(Tk,{})})})}));export{gr as A,Io as C,ho as D,vo as E,_ as M,l as N,po as O,To as S,N as T,ks as _,NO as a,es as b,mO as c,Ps as d,As as f,Ds as g,Ms as h,PO as i,br as j,pr as k,_O as l,Ns as m,RO as n,DO as o,js as p,FO as r,OO as s,WO as t,vO as u,Os as v,Lo as w,Zo as x,hs as y};
|