niceeval 0.14.2 → 0.14.3-canary.53

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.
Files changed (94) hide show
  1. package/INDEX.md +13 -6
  2. package/dist/agents/sdk-streams.cjs +6 -1
  3. package/dist/agents/sdk-streams.cjs.map +1 -1
  4. package/dist/agents/sdk-streams.d.cts +3 -2
  5. package/dist/agents/sdk-streams.d.mts +3 -2
  6. package/dist/agents/sdk-streams.d.ts +3 -2
  7. package/dist/agents/ui-message-stream.cjs +3 -1
  8. package/dist/agents/ui-message-stream.cjs.map +1 -1
  9. package/dist/experiment/host/cli/debug-protocol.cjs +257 -0
  10. package/dist/experiment/host/cli/debug-protocol.cjs.map +1 -0
  11. package/dist/experiment/host/cli/debug-protocol.d.cts +13 -0
  12. package/dist/experiment/host/cli/debug-protocol.d.mts +13 -0
  13. package/dist/experiment/host/cli/debug-protocol.d.ts +13 -0
  14. package/dist/experiment/host/cli/debug-protocol.js +8 -0
  15. package/dist/experiment/host/cli/debug-protocol.js.map +1 -0
  16. package/dist/experiment/host/cli/session-protocol.cjs +78 -0
  17. package/dist/experiment/host/cli/session-protocol.cjs.map +1 -0
  18. package/dist/experiment/host/cli/session-protocol.d.cts +10 -0
  19. package/dist/experiment/host/cli/session-protocol.d.mts +10 -0
  20. package/dist/experiment/host/cli/session-protocol.d.ts +10 -0
  21. package/dist/experiment/host/cli/session-protocol.js +12 -0
  22. package/dist/experiment/host/cli/session-protocol.js.map +1 -0
  23. package/dist/experiment/host/index.cjs +9 -1
  24. package/dist/experiment/host/index.cjs.map +1 -1
  25. package/dist/experiment/host/index.d.cts +2 -0
  26. package/dist/experiment/host/index.d.mts +2 -0
  27. package/dist/experiment/host/index.d.ts +2 -0
  28. package/dist/experiment/host/index.js +28 -16
  29. package/dist/experiment/host/index.mjs +28 -16
  30. package/dist/run/cli/contribution.cjs +5 -5
  31. package/dist/run/cli/contribution.cjs.map +1 -1
  32. package/dist/run/host/index.cjs +14 -3
  33. package/dist/run/host/index.cjs.map +1 -1
  34. package/dist/run/host/index.d.cts +2 -2
  35. package/dist/run/host/index.d.mts +2 -2
  36. package/dist/run/host/index.d.ts +2 -2
  37. package/dist/run/host/lifecycle-adapter.cjs +12 -12
  38. package/dist/run/host/lifecycle-adapter.cjs.map +1 -1
  39. package/dist/run/host/runtime.cjs +22 -22
  40. package/dist/run/host/runtime.cjs.map +1 -1
  41. package/dist/run/host/runtime.d.cts +11 -2
  42. package/dist/run/host/runtime.d.mts +11 -2
  43. package/dist/run/host/runtime.d.ts +11 -2
  44. package/dist/run/host/runtime.js +2 -2
  45. package/dist/run/host/types.cjs.map +1 -1
  46. package/dist/run/host/types.d.cts +4 -5
  47. package/dist/run/host/types.d.mts +4 -5
  48. package/dist/run/host/types.d.ts +4 -5
  49. package/dist/runner/assert-first-bridge.cjs +78 -3
  50. package/dist/runner/assert-first-bridge.cjs.map +1 -1
  51. package/dist/runner/assert-first-bridge.d.cts +11 -1
  52. package/dist/runner/assert-first-bridge.d.mts +11 -1
  53. package/dist/runner/assert-first-bridge.d.ts +11 -1
  54. package/dist/runner/attempt.cjs +77 -67
  55. package/dist/runner/attempt.cjs.map +1 -1
  56. package/dist/sandbox/backend.cjs.map +1 -1
  57. package/dist/sandbox/backend.d.cts +2 -2
  58. package/dist/sandbox/backend.d.mts +2 -2
  59. package/dist/sandbox/backend.d.ts +2 -2
  60. package/dist/sandbox/index.cjs.map +1 -1
  61. package/dist/sandbox/index.d.cts +1 -0
  62. package/dist/sandbox/index.d.mts +1 -0
  63. package/dist/sandbox/index.d.ts +1 -0
  64. package/dist/sandbox/layer.cjs.map +1 -1
  65. package/dist/sandbox/layer.d.cts +3 -3
  66. package/dist/sandbox/layer.d.mts +3 -3
  67. package/dist/sandbox/layer.d.ts +3 -3
  68. package/dist/sandbox/runtime.cjs.map +1 -1
  69. package/dist/sandbox/types.cjs.map +1 -1
  70. package/dist/sandbox/types.d.cts +2 -0
  71. package/dist/sandbox/types.d.mts +2 -0
  72. package/dist/sandbox/types.d.ts +2 -0
  73. package/dist/show/render.cjs +1 -0
  74. package/dist/show/render.cjs.map +1 -1
  75. package/dist/terminal/blocks.cjs +3 -5
  76. package/dist/terminal/blocks.cjs.map +1 -1
  77. package/dist/view/app-dist/.vite/manifest.json +3 -76
  78. package/dist/view/app-dist/assets/index-C6GQwHEF.js +63 -0
  79. package/dist/view/app-dist/assets/{quality-cost-scatter-B5wDa_F1.js → quality-cost-scatter-CSiMLelf.js} +5 -5
  80. package/dist/view/app-dist/index.html +1 -2
  81. package/dist/view/server.cjs +4 -3
  82. package/dist/view/server.cjs.map +1 -1
  83. package/docs-site/zh/README.md +2 -2
  84. package/docs-site/zh/tutorials/agent-feedback-loop.mdx +8 -5
  85. package/docs-site/zh/tutorials/agent-onboarding.mdx +5 -3
  86. package/package.json +1 -1
  87. package/dist/view/app-dist/assets/AttemptDialog-76dX1VQq.js +0 -41
  88. package/dist/view/app-dist/assets/AttemptRoute-DRHVh2JA.js +0 -4
  89. package/dist/view/app-dist/assets/ResultsPage-9CSI8dvZ.js +0 -2
  90. package/dist/view/app-dist/assets/RunPage-BUF0REv7.js +0 -1
  91. package/dist/view/app-dist/assets/TableContentView-_Sbg5wDr.js +0 -3
  92. package/dist/view/app-dist/assets/index-BGr_6pGY.js +0 -19
  93. package/dist/view/app-dist/assets/jsx-runtime-BnHLaUks.js +0 -1
  94. package/dist/view/app-dist/assets/useSuspenseQuery-D3W8Uy33.js +0 -1
@@ -0,0 +1,63 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),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 u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=ae(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function se(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=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)},k={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=k,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,O)}catch(e){O(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(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&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=ee,D=function(){ne.postMessage(null)}}else D=function(){_(ee,0)};function re(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,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),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}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=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`),D=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?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 te: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?oe(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__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)?af(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=af(t),e=of(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=of(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),hp._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(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+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(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{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`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.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=k.p;return e===0?(e=window.event,e===void 0?32:jp(e.type)):e}function pt(e,t){var n=k.p;try{return k.p=e,t()}finally{k.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=Of(e);e!==null;){if(n=e[ht])return n;e=Of(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(i(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(i(92));if(se(r)){if(1<r.length)throw Error(i(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(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&nn(e,a,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 a=r[gt]||null;if(!a)throw Error(i(90));Jt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&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)&&(Fu(),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(i(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 m(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=m({},kn,{view:0,detail:0}),Mn=On(jn),Nn,Pn,Fn,In=m({},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(m({},In,{dataTransfer:0})),zn=On(m({},jn,{relatedTarget:0})),Bn=On(m({},kn,{animationName:0,elapsedTime:0,pseudoElement:0})),Vn=On(m({},kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Hn=On(m({},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(m({},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(m({},In,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Xn=On(m({},jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qn})),Zn=On(m({},kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Qn=On(m({},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(m({},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=Hd(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){Fd(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=Hd(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<Eu)throw Eu=0,Du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hi={};function gi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _i(e,t,n,r){return new gi(e,t,n,r)}function vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yi(e,t){var n=e.alternate;return n===null?(n=_i(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function bi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function xi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)vi(e)&&(s=1);else if(typeof e==`string`)s=op(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case te:return e=_i(31,n,t,a),e.elementType=te,e.lanes=o,e;case y:return Si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=_i(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=_i(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=_i(19,n,t,a),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 D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=_i(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Si(e,t,n,r){return e=_i(7,e,r,t),e.lanes=n,e}function Ci(e,t,n){return e=_i(6,e,null,t),e.lanes=n,e}function wi(e){var t=_i(18,null,null,0);return t.stateNode=e,t}function Ti(e,t,n){return t=_i(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ei=new WeakMap;function Di(e,t){if(typeof e==`object`&&e){var n=Ei.get(e);return n===void 0?(t={value:e,source:t,stack: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,Wi=!1,Gi=null,Ki=!1,qi=Error(i(519));function Ji(e){throw ea(Di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),qi}function Yi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ht]=e,t[gt]=r,n){case`dialog`:I(`cancel`,t),I(`close`,t);break;case`iframe`:case`object`:case`embed`:I(`load`,t);break;case`video`:case`audio`:for(n=0;n<Nd.length;n++)I(Nd[n],t);break;case`source`:I(`error`,t);break;case`img`:case`image`:case`link`:I(`error`,t),I(`load`,t);break;case`details`:I(`toggle`,t);break;case`input`:I(`invalid`,t),Yt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:I(`invalid`,t);break;case`textarea`:I(`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||Jd(t.textContent,n)?(r.popover!=null&&(I(`beforetoggle`,t),I(`toggle`,t)),r.onScroll!=null&&I(`scroll`,t),r.onScrollEnd!=null&&I(`scrollend`,t),r.onClick!=null&&(t.onclick=ln),t=!0):t=!1,t||Ji(e,!0)}function Xi(e){for(Hi=e.return;Hi;)switch(Hi.tag){case 5:case 31:case 13:Ki=!1;return;case 27:case 3:Ki=!0;return;default:Hi=Hi.return}}function Zi(e){if(e!==Hi)return!1;if(!Wi)return Xi(e),Wi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||sf(e.type,e.memoizedProps)),n=!n),n&&Ui&&Ji(e),Xi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ui=Df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ui=Df(e)}else t===27?(t=Ui,hf(e.type)?(e=Ef,Ef=null,Ui=e):Ui=t):Ui=Hi?Tf(e.stateNode.nextSibling):null;return!0}function Qi(){Ui=Hi=null,Wi=!1}function $i(){var e=Gi;return e!==null&&(fu===null?fu=e:fu.push.apply(fu,e),Gi=null),e}function ea(e){Gi===null?Gi=[e]:Gi.push(e)}var ta=de(null),na=null,ra=null;function ia(e,t,n){pe(ta,t._currentValue),t._currentValue=n}function aa(e){e._currentValue=ta.current,fe(ta)}function oa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function sa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),oa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),oa(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ca(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;jr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===_e.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[hp]:e.push(hp))}a=a.return}e!==null&&sa(t,e,n,r),t.flags|=262144}function la(e){for(e=e.firstContext;e!==null;){if(!jr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ua(e){na=e,ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function da(e){return pa(na,e)}function fa(e,t){return na===null&&ua(e),pa(e,t)}function pa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ra===null){if(e===null)throw Error(i(308));ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ra=ra.next=t;return n}var ma=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ha=t.unstable_scheduleCallback,ga=t.unstable_NormalPriority,A={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _a(){return{controller:new ma,data:new Map,refCount:0}}function va(e){e.refCount--,e.refCount===0&&ha(ga,function(){e.controller.abort()})}var ya=null,ba=0,xa=0,Sa=null;function Ca(e,t){if(ya===null){var n=ya=[];ba=0,xa=Dd(),Sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ba++,t.then(wa,wa),t}function wa(){if(--ba===0&&ya!==null){Sa!==null&&(Sa.status=`fulfilled`);var e=ya;ya=null,xa=0,Sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ta(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ea=O.S;O.S=function(e,t){hu=Pe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ca(e,t),Ea!==null&&Ea(e,t)};var Da=de(null);function Oa(){var e=Da.current;return e===null?Ql.pooledCache:e}function ka(e,t){t===null?pe(Da,Da.current):pe(Da,t.pool)}function Aa(){var e=Oa();return e===null?null:{parent:A._currentValue,pool:e}}var ja=Error(i(460)),Ma=Error(i(474)),Na=Error(i(542)),Pa={then:function(){}};function Fa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ia(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,Ba(e),e;default:if(typeof t.status==`string`)t.then(ln,ln);else{if(e=Ql,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ba(e),e}throw Ra=t,ja}}function La(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ra=e,ja):e}}var Ra=null;function za(){if(Ra===null)throw Error(i(459));var e=Ra;return Ra=null,e}function Ba(e){if(e===ja||e===Na)throw Error(i(483))}var Va=null,Ha=0;function Ua(e){var t=Ha;return Ha+=1,Va===null&&(Va=[]),Ia(Va,e,t)}function Wa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ga(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ka(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=yi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ci(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&La(i)===t.type)?(t=a(t,n.props),Wa(t,n),t.return=e,t):(t=xi(n.type,n.key,n.props,null,e.mode,r),Wa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ti(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Si(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=xi(t.type,t.key,t.props,null,e.mode,n),Wa(n,t),n.return=e,n;case v:return t=Ti(t,e.mode,n),t.return=e,t;case D:return t=La(t),f(e,t,n)}if(se(t)||ie(t))return t=Si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ua(t),n);if(t.$$typeof===C)return f(e,fa(e,t),n);Ga(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 D:return n=La(n),p(e,t,n,r)}if(se(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ua(n),r);if(n.$$typeof===C)return p(e,t,fa(e,n),r);Ga(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 D:return r=La(r),m(e,t,n,r,i)}if(se(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ua(r),i);if(r.$$typeof===C)return m(e,t,n,fa(t,r),i);Ga(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Wi&&Li(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Wi&&Li(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Wi&&Li(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Wi&&Li(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Wi&&Li(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Wi&&Li(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&La(l)===r.type){n(e,r.sibling),c=a(r,o.props),Wa(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),Wa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=Ti(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=La(o),b(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ie(o)){if(l=ie(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ua(o),c);if(o.$$typeof===C)return b(e,r,fa(e,o),c);Ga(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ha=0;var i=b(e,t,n,r);return Va=null,i}catch(t){if(t===ja||t===Na)throw t;var a=_i(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var qa=Ka(!0),Ja=Ka(!1),Ya=!1;function Xa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Za(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 Qa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function $a(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,N&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 eo(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 to(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 no=!1;function ro(){if(no){var e=Sa;if(e!==null)throw e}}function io(e,t,n,r){no=!1;var i=e.updateQueue;Ya=!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?(F&f)===f:(r&f)===f){f!==0&&f===xa&&(no=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ya=!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),ou|=o,e.lanes=o,e.memoizedState=d}}function ao(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function oo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ao(n[e],t)}var so=de(null),co=de(0);function lo(e,t){e=iu,pe(co,e),pe(so,t),iu=e|t.baseLanes}function uo(){pe(co,iu),pe(so,so.current)}function fo(){iu=co.current,fe(so),fe(co)}var po=de(null),mo=null;function ho(e){var t=e.alternate;pe(bo,bo.current&1),pe(po,e),mo===null&&(t===null||so.current!==null||t.memoizedState!==null)&&(mo=e)}function go(e){pe(bo,bo.current),pe(po,e),mo===null&&(mo=e)}function _o(e){e.tag===22?(pe(bo,bo.current),pe(po,e),mo===null&&(mo=e)):vo(e)}function vo(){pe(bo,bo.current),pe(po,po.current)}function yo(e){fe(po),mo===e&&(mo=null),fe(bo)}var bo=de(0);function xo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Sf(n)||Cf(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 So=0,j=null,Co=null,wo=null,To=!1,Eo=!1,Do=!1,Oo=0,ko=0,Ao=null,jo=0;function Mo(){throw Error(i(321))}function No(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 Po(e,t,n,r,i,a){return So=a,j=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Xs:Zs,Do=!1,a=n(r,i),Do=!1,Eo&&(a=Io(t,n,r,i)),Fo(e),a}function Fo(e){O.H=Ys;var t=Co!==null&&Co.next!==null;if(So=0,wo=Co=j=null,To=!1,ko=0,Ao=null,t)throw Error(i(300));e===null||mc||(e=e.dependencies,e!==null&&la(e)&&(mc=!0))}function Io(e,t,n,r){j=e;var a=0;do{if(Eo&&(Ao=null),ko=0,Eo=!1,25<=a)throw Error(i(301));if(a+=1,wo=Co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=Qs,o=t(n,r)}while(Eo);return o}function Lo(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?Wo(t):t,e=e.useState()[0],(Co===null?null:Co.memoizedState)!==e&&(j.flags|=1024),t}function Ro(){var e=Oo!==0;return Oo=0,e}function zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Bo(e){if(To){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}To=!1}So=0,wo=Co=j=null,Eo=!1,ko=Oo=0,Ao=null}function Vo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wo===null?j.memoizedState=wo=e:wo=wo.next=e,wo}function Ho(){if(Co===null){var e=j.alternate;e=e===null?null:e.memoizedState}else e=Co.next;var t=wo===null?j.memoizedState:wo.next;if(t!==null)wo=t,Co=e;else{if(e===null)throw j.alternate===null?Error(i(467)):Error(i(310));Co=e,e={memoizedState:Co.memoizedState,baseState:Co.baseState,baseQueue:Co.baseQueue,queue:Co.queue,next:null},wo===null?j.memoizedState=wo=e:wo=wo.next=e}return wo}function Uo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(e){var t=ko;return ko+=1,Ao===null&&(Ao=[]),e=Ia(Ao,e,t),t=j,(wo===null?t.memoizedState:wo.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Xs:Zs),e}function Go(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Wo(e);if(e.$$typeof===C)return da(e)}throw Error(i(438,String(e)))}function Ko(e){var t=null,n=j.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=j.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=Uo(),j.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]=ne;return t.index++,n}function qo(e,t){return typeof t==`function`?t(e):t}function Jo(e){return M(Ho(),Co,e)}function M(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(So&f)===f:(F&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===xa&&(d=!0);else if((So&p)===p){u=u.next,p===xa&&(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,j.lanes|=p,ou|=p;f=u.action,Do&&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,j.lanes|=f,ou|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!jr(o,e.memoizedState)&&(mc=!0,d&&(n=Sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Yo(e){var t=Ho(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);jr(o,t.memoizedState)||(mc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Xo(e,t,n){var r=j,a=Ho(),o=Wi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!jr((Co||a).memoizedState,n);if(s&&(a.memoizedState=n,mc=!0),a=a.queue,xs($o.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||wo!==null&&wo.memoizedState.tag&1){if(r.flags|=2048,gs(9,{destroy:void 0},Qo.bind(null,r,a,n,t),null),Ql===null)throw Error(i(349));o||So&127||Zo(r,t,n)}return n}function Zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=j.updateQueue,t===null?(t=Uo(),j.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Qo(e,t,n,r){t.value=n,t.getSnapshot=r,es(t)&&ts(e)}function $o(e,t,n){return n(function(){es(t)&&ts(e)})}function es(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jr(e,n)}catch{return!0}}function ts(e){var t=fi(e,2);t!==null&&Au(t,e,2)}function ns(e){var t=Vo();if(typeof e==`function`){var n=e;if(e=n(),Do){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:e},t}function rs(e,t,n,r){return e.baseState=n,M(e,Co,typeof r==`function`?r:qo)}function is(e,t,n,r,a){if(Ks(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,as(t,o)):(o.next=n.next,t.pending=n.next=o)}}function as(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),os(e,t,s)}catch(n){cs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),os(e,t,a)}catch(n){cs(e,t,n)}}function os(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ss(e,t,n)},function(n){return cs(e,t,n)}):ss(e,t,n)}function ss(e,t,n){t.status=`fulfilled`,t.value=n,ls(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,as(e,n)))}function cs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ls(t),t=t.next;while(t!==r)}e.action=null}function ls(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function us(e,t){return t}function ds(e,t){if(Wi){var n=Ql.formState;if(n!==null){a:{var r=j;if(Wi){if(Ui){b:{for(var i=Ui,a=Ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=Tf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ui=Tf(i.nextSibling),r=i.data===`F!`;break a}}Ji(r)}r=!1}r&&(t=n[0])}}return n=Vo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:t},n.queue=r,n=Us.bind(null,j,r),r.dispatch=n,r=ns(!1),a=Gs.bind(null,j,!1,r.queue),r=Vo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=is.bind(null,j,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function fs(e){return ps(Ho(),Co,e)}function ps(e,t,n){if(t=M(e,t,us)[0],e=Jo(qo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Wo(t)}catch(e){throw e===ja?Na:e}else r=t;t=Ho();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(j.flags|=2048,gs(9,{destroy:void 0},ms.bind(null,i,n),null)),[r,a,e]}function ms(e,t){e.action=t}function hs(e){var t=Ho(),n=Co;if(n!==null)return ps(t,n,e);Ho(),t=t.memoizedState,n=Ho();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function gs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=j.updateQueue,t===null&&(t=Uo(),j.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 _s(){return Ho().memoizedState}function vs(e,t,n,r){var i=Vo();j.flags|=e,i.memoizedState=gs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ys(e,t,n,r){var i=Ho();r=r===void 0?null:r;var a=i.memoizedState.inst;Co!==null&&r!==null&&No(r,Co.memoizedState.deps)?i.memoizedState=gs(t,a,n,r):(j.flags|=e,i.memoizedState=gs(1|t,a,n,r))}function bs(e,t){vs(8390656,8,e,t)}function xs(e,t){ys(2048,8,e,t)}function Ss(e){j.flags|=4;var t=j.updateQueue;if(t===null)t=Uo(),j.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Cs(e){var t=Ho().memoizedState;return Ss({ref:t,nextImpl:e}),function(){if(N&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ws(e,t){return ys(4,2,e,t)}function Ts(e,t){return ys(4,4,e,t)}function Es(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 Ds(e,t,n){n=n==null?null:n.concat([e]),ys(4,4,Es.bind(null,t,e),n)}function Os(){}function ks(e,t){var n=Ho();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&No(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function As(e,t){var n=Ho();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&No(t,r[1]))return r[0];if(r=e(),Do){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r}function js(e,t,n){return n===void 0||So&1073741824&&!(F&261930)?e.memoizedState=t:(e.memoizedState=n,e=ku(),j.lanes|=e,ou|=e,n)}function Ms(e,t,n,r){return jr(n,t)?n:so.current===null?!(So&42)||So&1073741824&&!(F&261930)?(mc=!0,e.memoizedState=n):(e=ku(),j.lanes|=e,ou|=e,t):(e=js(e,n,r),jr(e,t)||(mc=!0),e)}function Ns(e,t,n,r,i){var a=k.p;k.p=a!==0&&8>a?a:8;var o=O.T,s={};O.T=s,Gs(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ws(e,t,Ta(c,r),Ou(e)):Ws(e,t,r,Ou(e))}catch(n){Ws(e,t,{then:function(){},status:`rejected`,reason:n},Ou())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function Ps(){}function Fs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Is(e).queue;Ns(e,a,t,ce,n===null?Ps:function(){return Ls(e),n(r)})}function Is(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:qo,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ls(e){var t=Is(e);t.next===null&&(t=e.alternate.memoizedState),Ws(e,t.next.queue,{},Ou())}function Rs(){return da(hp)}function zs(){return Ho().memoizedState}function Bs(){return Ho().memoizedState}function Vs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ou();e=Qa(n);var r=$a(t,e,n);r!==null&&(Au(r,t,n),eo(r,t,n)),t={cache:_a()},e.payload=t;return}t=t.return}}function Hs(e,t,n){var r=Ou();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ks(e)?qs(t,n):(n=di(e,t,n,r),n!==null&&(Au(n,e,r),Js(n,t,r)))}function Us(e,t,n){Ws(e,t,n,Ou())}function Ws(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ks(e))qs(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),Ql===null&&li(),!1}catch{}if(n=di(e,t,i,r),n!==null)return Au(n,e,r),Js(n,t,r),!0}return!1}function Gs(e,t,n,r){if(r={lane:2,revertLane:Dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ks(e)){if(t)throw Error(i(479))}else t=di(e,n,r,2),t!==null&&Au(t,e,2)}function Ks(e){var t=e.alternate;return e===j||t!==null&&t===j}function qs(e,t){Eo=To=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var Ys={readContext:da,use:Go,useCallback:Mo,useContext:Mo,useEffect:Mo,useImperativeHandle:Mo,useLayoutEffect:Mo,useInsertionEffect:Mo,useMemo:Mo,useReducer:Mo,useRef:Mo,useState:Mo,useDebugValue:Mo,useDeferredValue:Mo,useTransition:Mo,useSyncExternalStore:Mo,useId:Mo,useHostTransitionStatus:Mo,useFormState:Mo,useActionState:Mo,useOptimistic:Mo,useMemoCache:Mo,useCacheRefresh:Mo};Ys.useEffectEvent=Mo;var Xs={readContext:da,use:Go,useCallback:function(e,t){return Vo().memoizedState=[e,t===void 0?null:t],e},useContext:da,useEffect:bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),vs(4194308,4,Es.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vs(4194308,4,e,t)},useInsertionEffect:function(e,t){vs(4,2,e,t)},useMemo:function(e,t){var n=Vo();t=t===void 0?null:t;var r=e();if(Do){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Vo();if(n!==void 0){var i=n(t);if(Do){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=Hs.bind(null,j,e),[r.memoizedState,e]},useRef:function(e){var t=Vo();return e={current:e},t.memoizedState=e},useState:function(e){e=ns(e);var t=e.queue,n=Us.bind(null,j,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Os,useDeferredValue:function(e,t){return js(Vo(),e,t)},useTransition:function(){var e=ns(!1);return e=Ns.bind(null,j,e.queue,!0,!1),Vo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=j,a=Vo();if(Wi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ql===null)throw Error(i(349));F&127||Zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,bs($o.bind(null,r,o,e),[e]),r.flags|=2048,gs(9,{destroy:void 0},Qo.bind(null,r,o,n,t),null),n},useId:function(){var e=Vo(),t=Ql.identifierPrefix;if(Wi){var n=Ii,r=Fi;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Oo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Rs,useFormState:ds,useActionState:ds,useOptimistic:function(e){var t=Vo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Gs.bind(null,j,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ko,useCacheRefresh:function(){return Vo().memoizedState=Vs.bind(null,j)},useEffectEvent:function(e){var t=Vo(),n={impl:e};return t.memoizedState=n,function(){if(N&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Zs={readContext:da,use:Go,useCallback:ks,useContext:da,useEffect:xs,useImperativeHandle:Ds,useInsertionEffect:ws,useLayoutEffect:Ts,useMemo:As,useReducer:Jo,useRef:_s,useState:function(){return Jo(qo)},useDebugValue:Os,useDeferredValue:function(e,t){return Ms(Ho(),Co.memoizedState,e,t)},useTransition:function(){var e=Jo(qo)[0],t=Ho().memoizedState;return[typeof e==`boolean`?e:Wo(e),t]},useSyncExternalStore:Xo,useId:zs,useHostTransitionStatus:Rs,useFormState:fs,useActionState:fs,useOptimistic:function(e,t){return rs(Ho(),Co,e,t)},useMemoCache:Ko,useCacheRefresh:Bs};Zs.useEffectEvent=Cs;var Qs={readContext:da,use:Go,useCallback:ks,useContext:da,useEffect:xs,useImperativeHandle:Ds,useInsertionEffect:ws,useLayoutEffect:Ts,useMemo:As,useReducer:Yo,useRef:_s,useState:function(){return Yo(qo)},useDebugValue:Os,useDeferredValue:function(e,t){var n=Ho();return Co===null?js(n,e,t):Ms(n,Co.memoizedState,e,t)},useTransition:function(){var e=Yo(qo)[0],t=Ho().memoizedState;return[typeof e==`boolean`?e:Wo(e),t]},useSyncExternalStore:Xo,useId:zs,useHostTransitionStatus:Rs,useFormState:hs,useActionState:hs,useOptimistic:function(e,t){var n=Ho();return Co===null?(n.baseState=e,[e,n.queue.dispatch]):rs(n,Co,e,t)},useMemoCache:Ko,useCacheRefresh:Bs};Qs.useEffectEvent=Cs;function $s(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ec={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ou(),i=Qa(r);i.payload=t,n!=null&&(i.callback=n),t=$a(e,i,r),t!==null&&(Au(t,e,r),eo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ou(),i=Qa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=$a(e,i,r),t!==null&&(Au(t,e,r),eo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ou(),r=Qa(n);r.tag=2,t!=null&&(r.callback=t),t=$a(e,r,n),t!==null&&(Au(t,e,n),eo(t,e,n))}};function tc(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 nc(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&&ec.enqueueReplaceState(t,t.state,null)}function rc(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=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function ic(e){ai(e)}function ac(e){console.error(e)}function oc(e){ai(e)}function sc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function cc(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 lc(e,t,n){return n=Qa(n),n.tag=3,n.payload={element:null},n.callback=function(){sc(e,t)},n}function uc(e){return e=Qa(e),e.tag=3,e}function dc(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(){cc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){cc(t,n,r),typeof i!=`function`&&(vu===null?vu=new Set([this]):vu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function fc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ca(t,n,a,!0),n=po.current,n!==null){switch(n.tag){case 31:case 13:return mo===null?Hu():n.alternate===null&&au===0&&(au=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Pa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),sd(e,r,a)),!1;case 22:return n.flags|=65536,r===Pa?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)),sd(e,r,a)),!1}throw Error(i(435,n.tag))}return sd(e,r,a),Hu(),!1}if(Wi)return t=po.current,t===null?(r!==qi&&(t=Error(i(423),{cause:r}),ea(Di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Di(r,n),a=lc(e.stateNode,r,a),to(e,a),au!==4&&(au=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==qi&&(e=Error(i(422),{cause:r}),ea(Di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Di(o,n),du===null?du=[o]:du.push(o),au!==4&&(au=2),t===null)return!0;r=Di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=lc(n.stateNode,r,e),to(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`&&(vu===null||!vu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=uc(a),dc(a,e,n,r),to(n,a),!1}n=n.return}while(n!==null);return!1}var pc=Error(i(461)),mc=!1;function hc(e,t,n,r){t.child=e===null?Ja(t,null,n,r):qa(t,e.child,n,r)}function gc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ua(t),r=Po(e,t,n,o,a,i),s=Ro(),e!==null&&!mc?(zo(e,t,i),Bc(e,t,i)):(Wi&&s&&zi(t),t.flags|=1,hc(e,t,r,i),t.child)}function _c(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,vc(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,!Vc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Mr:n,n(o,r)&&e.ref===t.ref)return Bc(e,t,i)}return t.flags|=1,e=yi(a,r),e.ref=t.ref,e.return=t,t.child=e}function vc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mr(a,r)&&e.ref===t.ref)if(mc=!1,t.pendingProps=r=a,Vc(e,i))e.flags&131072&&(mc=!0);else return t.lanes=e.lanes,Bc(e,t,i)}return Ec(e,t,n,r,i)}function yc(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 xc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ka(t,a===null?null:a.cachePool),a===null?uo():lo(t,a),_o(t);else return r=t.lanes=536870912,xc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ka(t,null),uo(),vo(t)):(ka(t,a.cachePool),lo(t,a),vo(t),t.memoizedState=null);return hc(e,t,i,n),t.child}function bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function xc(e,t,n,r,i){var a=Oa();return a=a===null?null:{parent:A._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ka(t,null),uo(),_o(t),e!==null&&ca(e,t,r,!0),t.childLanes=i,null}function Sc(e,t){return t=Fc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Cc(e,t,n){return qa(t,e.child,null,n),e=Sc(t,t.pendingProps),e.flags|=2,yo(t),t.memoizedState=null,e}function wc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Wi){if(r.mode===`hidden`)return e=Sc(t,r),t.lanes=536870912,bc(null,e);if(go(t),(e=Ui)?(e=xf(e,Ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,Ui=null)):e=null,e===null)throw Ji(t);return t.lanes=536870912,null}return Sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(go(t),a)if(t.flags&256)t.flags&=-257,t=Cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(mc||ca(e,t,n,!1),a=(n&e.childLanes)!==0,mc||a){if(r=Ql,r!==null&&(s=lt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,fi(e,s),Au(r,e,s),pc;Hu(),t=Cc(e,t,n)}else e=o.treeContext,Ui=Tf(s.nextSibling),Hi=t,Wi=!0,Gi=null,Ki=!1,e!==null&&Vi(t,e),t=Sc(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 Tc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ec(e,t,n,r,i){return ua(t),n=Po(e,t,n,r,void 0,i),r=Ro(),e!==null&&!mc?(zo(e,t,i),Bc(e,t,i)):(Wi&&r&&zi(t),t.flags|=1,hc(e,t,n,i),t.child)}function Dc(e,t,n,r,i,a){return ua(t),t.updateQueue=null,n=Io(t,r,n,i),Fo(e),r=Ro(),e!==null&&!mc?(zo(e,t,a),Bc(e,t,a)):(Wi&&r&&zi(t),t.flags|=1,hc(e,t,n,a),t.child)}function Oc(e,t,n,r,i){if(ua(t),t.stateNode===null){var a=hi,o=n.contextType;typeof o==`object`&&o&&(a=da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=ec,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Xa(t),o=n.contextType,a.context=typeof o==`object`&&o?da(o):hi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&($s(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&&ec.enqueueReplaceState(a,a.state,null),io(t,r,a,i),ro(),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=rc(n,s);a.props=c;var l=a.context,u=n.contextType;o=hi,typeof u==`object`&&u&&(o=da(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&nc(t,a,r,o),Ya=!1;var f=t.memoizedState;a.state=f,io(t,r,a,i),ro(),l=t.memoizedState,s||f!==l||Ya?(typeof d==`function`&&($s(t,n,d,r),l=t.memoizedState),(c=Ya||tc(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,Za(e,t),o=t.memoizedProps,u=rc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=hi,typeof l==`object`&&l&&(c=da(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&nc(t,a,r,c),Ya=!1,f=t.memoizedState,a.state=f,io(t,r,a,i),ro();var p=t.memoizedState;o!==d||f!==p||Ya||e!==null&&e.dependencies!==null&&la(e.dependencies)?(typeof s==`function`&&($s(t,n,s,r),p=t.memoizedState),(u=Ya||tc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&la(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Tc(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=qa(t,e.child,null,i),t.child=qa(t,null,n,i)):hc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Bc(e,t,i),e}function kc(e,t,n,r){return Qi(),t.flags|=256,hc(e,t,n,r),t.child}var Ac={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jc(e){return{baseLanes:e,cachePool:Aa()}}function Mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=lu),e}function Nc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(bo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Wi){if(a?ho(t):vo(t),(e=Ui)?(e=xf(e,Ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,Ui=null)):e=null,e===null)throw Ji(t);return Cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(vo(t),a=t.mode,c=Fc({mode:`hidden`,children:c},a),r=Si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=jc(n),r.childLanes=Mc(e,s,n),t.memoizedState=Ac,bc(null,r)):(ho(t),Pc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ho(t),t.flags&=-257,t=Ic(e,t,n)):t.memoizedState===null?(vo(t),c=r.fallback,a=t.mode,r=Fc({mode:`visible`,children:r.children},a),c=Si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,qa(t,e.child,null,n),r=t.child,r.memoizedState=jc(n),r.childLanes=Mc(e,s,n),t.memoizedState=Ac,t=bc(null,r)):(vo(t),t.child=e.child,t.flags|=128,t=null);else if(ho(t),Cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,ea({value:r,source:null,stack:null}),t=Ic(e,t,n)}else if(mc||ca(e,t,n,!1),s=(n&e.childLanes)!==0,mc||s){if(s=Ql,s!==null&&(r=lt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,fi(e,r),Au(s,e,r),pc;Sf(c)||Hu(),t=Ic(e,t,n)}else Sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ui=Tf(c.nextSibling),Hi=t,Wi=!0,Gi=null,Ki=!1,e!==null&&Vi(t,e),t=Pc(t,r.children),t.flags|=4096);return t}return a?(vo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=yi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=Si(c,a,n,null),c.flags|=2):c=yi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,bc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=jc(n):(a=c.cachePool,a===null?a=Aa():(l=A._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Mc(e,s,n),t.memoizedState=Ac,bc(e.child,r)):(ho(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 Pc(e,t){return t=Fc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Fc(e,t){return e=_i(22,e,null,t),e.lanes=0,e}function Ic(e,t,n){return qa(t,e.child,null,n),e=Pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),oa(e.return,t,n)}function Rc(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 zc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=bo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,pe(bo,o),hc(e,t,r,n),r=Wi?ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lc(e,n,t);else if(e.tag===19)Lc(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&&xo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Rc(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&&xo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Rc(t,!0,n,null,a,r);break;case`together`:Rc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Bc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ou|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ca(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=yi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Vc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&la(e))):!0}function Hc(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),ia(t,A,e.memoizedState.cache),Qi();break;case 27:case 5:be(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:ia(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,go(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ho(t),e=Bc(e,t,n),e===null?null:e.sibling):Nc(e,t,n):(ho(t),t.flags|=128,null);ho(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return zc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),pe(bo,bo.current),r)break;return null;case 22:return t.lanes=0,yc(e,t,n,t.pendingProps);case 24:ia(t,A,e.memoizedState.cache)}return Bc(e,t,n)}function Uc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)mc=!0;else{if(!Vc(e,n)&&!(t.flags&128))return mc=!1,Hc(e,t,n);mc=!!(e.flags&131072)}else mc=!1,Wi&&t.flags&1048576&&Ri(t,ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=La(t.elementType),t.type=e,typeof e==`function`)vi(e)?(r=rc(e,r),t.tag=1,t=Oc(null,t,e,r,n)):(t.tag=0,t=Ec(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=gc(null,t,e,r,n);break a}else if(a===ee){t.tag=14,t=_c(null,t,e,r,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return Ec(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=rc(r,t.pendingProps),Oc(e,t,r,a,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Za(e,t),io(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ia(t,A,r),r!==o.cache&&sa(t,[A],n,!0),ro(),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=kc(e,t,r,n);break a}else if(r!==a){a=Di(Error(i(424)),t),ea(a),t=kc(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=Tf(e.firstChild),Hi=t,Wi=!0,Gi=null,Ki=!0,n=Ja(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Qi(),r===a){t=Bc(e,t,n);break a}hc(e,t,r,n)}t=t.child}return t;case 26:return Tc(e,t),e===null?(n=Kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Wi||(n=t.type,e=t.pendingProps,r=rf(ge.current).createElement(n),r[ht]=t,r[gt]=e,Zd(r,n,e),Ot(r),t.stateNode=r):t.memoizedState=Kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&Wi&&(r=t.stateNode=kf(t.type,t.pendingProps,ge.current),Hi=t,Ki=!0,a=Ui,hf(t.type)?(Ef=a,Ui=Tf(r.firstChild)):Ui=a),hc(e,t,t.pendingProps.children,n),Tc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Wi&&((a=r=Ui)&&(r=yf(r,t.type,t.pendingProps,Ki),r===null?a=!1:(t.stateNode=r,Hi=t,Ui=Tf(r.firstChild),Ki=!1,a=!0)),a||Ji(t)),be(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,sf(a,o)?r=null:s!==null&&sf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Po(e,t,Lo,null,null,n),hp._currentValue=a),Tc(e,t),hc(e,t,r,n),t.child;case 6:return e===null&&Wi&&((e=n=Ui)&&(n=bf(n,t.pendingProps,Ki),n===null?e=!1:(t.stateNode=n,Hi=t,Ui=null,e=!0)),e||Ji(t)),null;case 13:return Nc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qa(t,null,r,n):hc(e,t,r,n),t.child;case 11:return gc(e,t,t.type,t.pendingProps,n);case 7:return hc(e,t,t.pendingProps,n),t.child;case 8:return hc(e,t,t.pendingProps.children,n),t.child;case 12:return hc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ia(t,t.type,r.value),hc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ua(t),a=da(a),r=r(a),t.flags|=1,hc(e,t,r,n),t.child;case 14:return _c(e,t,t.type,t.pendingProps,n);case 15:return vc(e,t,t.type,t.pendingProps,n);case 19:return zc(e,t,n);case 31:return wc(e,t,n);case 22:return yc(e,t,n,t.pendingProps);case 24:return ua(t),r=da(A),e===null?(a=Oa(),a===null&&(a=Ql,o=_a(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Xa(t),ia(t,A,a)):((e.lanes&n)!==0&&(Za(e,t),io(t,null,null,n),ro()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ia(t,A,r),r!==a.cache&&sa(t,[A],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ia(t,A,r))),hc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Wc(e){e.flags|=4}function Gc(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(zu())e.flags|=8192;else throw Ra=Pa,Ma}else e.flags&=-16777217}function Kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!sp(t))if(zu())e.flags|=8192;else throw Ra=Pa,Ma}function qc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:rt(),e.lanes|=t,uu|=t)}function Jc(e,t){if(!Wi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Yc(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 Xc(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 Yc(t),null;case 1:return Yc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),aa(A),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Zi(t)?Wc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$i())),Yc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Wc(t),o===null?(Yc(t),Gc(t,a,null,r,n)):(Yc(t),Kc(t,o))):o?o===e.memoizedState?(Yc(t),t.flags&=-16777217):(Wc(t),Yc(t),Kc(t,o)):(e=e.memoizedProps,e!==r&&Wc(t),Yc(t),Gc(t,a,e,r,n)),null;case 27:if(xe(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Wc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Yc(t),null}e=me.current,Zi(t)?Yi(t,e):(e=kf(a,r,n),t.stateNode=e,Wc(t))}return Yc(t),null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Wc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Yc(t),null}if(o=me.current,Zi(t))Yi(t,o);else{var s=rf(ge.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[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(Zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Wc(t)}}return Yc(t),Gc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Wc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,Zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Hi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Jd(e.nodeValue,n)),e||Ji(t,!0)}else e=rf(e).createTextNode(r),e[ht]=t,t.stateNode=e}return Yc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ht]=t}else Qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Yc(t),e=!1}else n=$i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(yo(t),t):(yo(t),null);if(t.flags&128)throw Error(i(558))}return Yc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ht]=t}else Qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Yc(t),a=!1}else a=$i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(yo(t),t):(yo(t),null)}return yo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),qc(t,t.updateQueue),Yc(t),null);case 4:return ye(),e===null&&Rd(t.stateNode.containerInfo),Yc(t),null;case 10:return aa(t.type),Yc(t),null;case 19:if(fe(bo),r=t.memoizedState,r===null)return Yc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Jc(r,!1);else{if(au!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=xo(e),o!==null){for(t.flags|=128,Jc(r,!1),e=o.updateQueue,t.updateQueue=e,qc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bi(n,e),n=n.sibling;return pe(bo,bo.current&1|2),Wi&&Li(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>gu&&(t.flags|=128,a=!0,Jc(r,!1),t.lanes=4194304)}else{if(!a)if(e=xo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,qc(t,e),Jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Wi)return Yc(t),null}else 2*Pe()-r.renderingStartTime>gu&&n!==536870912&&(t.flags|=128,a=!0,Jc(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?(Yc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,n=bo.current,pe(bo,a?n&1|2:n&1),Wi&&Li(t,r.treeForkCount),e);case 22:case 23:return yo(t),fo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Yc(t),t.subtreeFlags&6&&(t.flags|=8192)):Yc(t),n=t.updateQueue,n!==null&&qc(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(Da),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),aa(A),Yc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Zc(e,t){switch(Bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(A),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(yo(t),t.alternate===null)throw Error(i(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(bo),null;case 4:return ye(),null;case 10:return aa(t.type),null;case 22:case 23:return yo(t),fo(),e!==null&&fe(Da),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return aa(A),null;case 25:return null;default:return null}}function Qc(e,t){switch(Bi(t),t.tag){case 3:aa(A),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&yo(t);break;case 13:yo(t);break;case 19:fe(bo);break;case 10:aa(t.type);break;case 22:case 23:yo(t),fo(),e!==null&&fe(Da);break;case 24:aa(A)}}function $c(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){od(t,t.return,e)}}function el(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){od(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){od(t,t.return,e)}}function tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{oo(t,n)}catch(t){od(e,e.return,t)}}}function nl(e,t,n){n.props=rc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){od(e,t,n)}}function rl(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){od(e,t,n)}}function il(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){od(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){od(e,t,n)}else n.current=null}function al(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){od(e,e.return,t)}}function ol(e,t,n){try{var r=e.stateNode;Qd(r,e.type,n,t),r[gt]=t}catch(t){od(e,e.return,t)}}function sl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&hf(e.type)||e.tag===4}function cl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||sl(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&&hf(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 ll(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&&hf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(ll(e,t,n),e=e.sibling;e!==null;)ll(e,t,n),e=e.sibling}function ul(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&&hf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ul(e,t,n),e=e.sibling;e!==null;)ul(e,t,n),e=e.sibling}function dl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Zd(t,r,n),t[ht]=e,t[gt]=n}catch(t){od(e,e.return,t)}}var fl=!1,pl=!1,ml=!1,hl=typeof WeakSet==`function`?WeakSet:Set,gl=null;function _l(e,t){if(e=e.containerInfo,tf=wp,e=Ir(e),Lr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(nf={focusedElem:e,selectionRange:n},wp=!1,gl=t;gl!==null;)if(t=gl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,gl=e;else for(;gl!==null;){switch(t=gl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=rc(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){od(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)vf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:vf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,gl=e;break}gl=t.return}}function vl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Nl(e,n),r&4&&$c(5,n);break;case 1:if(Nl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){od(n,n.return,e)}else{var i=rc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){od(n,n.return,e)}}r&64&&tl(n),r&512&&rl(n,n.return);break;case 3:if(Nl(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{oo(e,t)}catch(e){od(n,n.return,e)}}break;case 27:t===null&&r&4&&dl(n);case 26:case 5:Nl(e,n),t===null&&r&4&&al(n),r&512&&rl(n,n.return);break;case 12:Nl(e,n);break;case 31:Nl(e,n),r&4&&wl(e,n);break;case 13:Nl(e,n),r&4&&Tl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ud.bind(null,n),wf(e,n))));break;case 22:if(r=n.memoizedState!==null||fl,!r){t=t!==null&&t.memoizedState!==null||pl,i=fl;var a=pl;fl=r,(pl=t)&&!a?Fl(e,n,(n.subtreeFlags&8772)!=0):Nl(e,n),fl=i,pl=a}break;case 30:break;default:Nl(e,n)}}function yl(e){var t=e.alternate;t!==null&&(e.alternate=null,yl(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 bl=null,xl=!1;function Sl(e,t,n){for(n=n.child;n!==null;)Cl(e,t,n),n=n.sibling}function Cl(e,t,n){if(We&&typeof We.onCommitFiberUnmount==`function`)try{We.onCommitFiberUnmount(Ue,n)}catch{}switch(n.tag){case 26:pl||il(n,t),Sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:pl||il(n,t);var r=bl,i=xl;hf(n.type)&&(bl=n.stateNode,xl=!1),Sl(e,t,n),Af(n.stateNode),bl=r,xl=i;break;case 5:pl||il(n,t);case 6:if(r=bl,i=xl,bl=null,Sl(e,t,n),bl=r,xl=i,bl!==null)if(xl)try{(bl.nodeType===9?bl.body:bl.nodeName===`HTML`?bl.ownerDocument.body:bl).removeChild(n.stateNode)}catch(e){od(n,t,e)}else try{bl.removeChild(n.stateNode)}catch(e){od(n,t,e)}break;case 18:bl!==null&&(xl?(e=bl,gf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Xp(e)):gf(bl,n.stateNode));break;case 4:r=bl,i=xl,bl=n.stateNode.containerInfo,xl=!0,Sl(e,t,n),bl=r,xl=i;break;case 0:case 11:case 14:case 15:el(2,n,t),pl||el(4,n,t),Sl(e,t,n);break;case 1:pl||(il(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&nl(n,t,r)),Sl(e,t,n);break;case 21:Sl(e,t,n);break;case 22:pl=(r=pl)||n.memoizedState!==null,Sl(e,t,n),pl=r;break;default:Sl(e,t,n)}}function wl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xp(e)}catch(e){od(t,t.return,e)}}}function Tl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xp(e)}catch(e){od(t,t.return,e)}}function El(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hl),t;default:throw Error(i(435,e.tag))}}function Dl(e,t){var n=El(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=dd.bind(null,e,t);t.then(r,r)}})}function Ol(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(hf(c.type)){bl=c.stateNode,xl=!1;break a}break;case 5:bl=c.stateNode,xl=!1;break a;case 3:case 4:bl=c.stateNode.containerInfo,xl=!0;break a}c=c.return}if(bl===null)throw Error(i(160));Cl(o,s,a),bl=null,xl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Al(t,e),t=t.sibling}var kl=null;function Al(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ol(t,e),jl(e),r&4&&(el(3,e,e.return),$c(3,e),el(5,e,e.return));break;case 1:Ol(t,e),jl(e),r&512&&(pl||n===null||il(n,n.return)),r&64&&fl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=kl;if(Ol(t,e),jl(e),r&512&&(pl||n===null||il(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[St]||o[ht]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Zd(o,r,n),o[ht]=e,Ot(o),r=o;break a;case`link`:var s=ip(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=ip(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ht]=e,Ot(o),r=o}e.stateNode=r}else ap(a,e.type,e.stateNode);else e.stateNode=$f(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&ol(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?ap(a,e.type,e.stateNode):$f(a,r,e.memoizedProps))}break;case 27:Ol(t,e),jl(e),r&512&&(pl||n===null||il(n,n.return)),n!==null&&r&4&&ol(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ol(t,e),jl(e),r&512&&(pl||n===null||il(n,n.return)),e.flags&32){a=e.stateNode;try{en(a,``)}catch(t){od(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,ol(e,a,n===null?a:n.memoizedProps)),r&1024&&(ml=!0);break;case 6:if(Ol(t,e),jl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){od(e,e.return,t)}}break;case 3:if(rp=null,a=kl,kl=Nf(t.containerInfo),Ol(t,e),kl=a,jl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Xp(t.containerInfo)}catch(t){od(e,e.return,t)}ml&&(ml=!1,Ml(e));break;case 4:r=kl,kl=Nf(e.stateNode.containerInfo),Ol(t,e),jl(e),kl=r;break;case 12:Ol(t,e),jl(e);break;case 31:Ol(t,e),jl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Dl(e,r)));break;case 13:Ol(t,e),jl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(mu=Pe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Dl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=fl,d=pl;if(fl=u||a,pl=d||l,Ol(t,e),pl=d,fl=u,jl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||fl||pl||Pl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){od(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){od(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?_f(m,!0):_f(l.stateNode,!1)}catch(e){od(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,Dl(e,n))));break;case 19:Ol(t,e),jl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Dl(e,r)));break;case 30:break;case 21:break;default:Ol(t,e),jl(e)}}function jl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(sl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;ul(e,cl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(en(o,``),n.flags&=-33),ul(e,cl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;ll(e,cl(e),s);break;default:throw Error(i(161))}}catch(t){od(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Nl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vl(e,t.alternate,t),t=t.sibling}function Pl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:el(4,t,t.return),Pl(t);break;case 1:il(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&nl(t,t.return,n),Pl(t);break;case 27:Af(t.stateNode);case 26:case 5:il(t,t.return),Pl(t);break;case 22:t.memoizedState===null&&Pl(t);break;case 30:Pl(t);break;default:Pl(t)}e=e.sibling}}function Fl(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:Fl(i,a,n),$c(4,a);break;case 1:if(Fl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){od(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++)ao(c[i],s)}catch(e){od(r,r.return,e)}}n&&o&64&&tl(a),rl(a,a.return);break;case 27:dl(a);case 26:case 5:Fl(i,a,n),n&&r===null&&o&4&&al(a),rl(a,a.return);break;case 12:Fl(i,a,n);break;case 31:Fl(i,a,n),n&&o&4&&wl(i,a);break;case 13:Fl(i,a,n),n&&o&4&&Tl(i,a);break;case 22:a.memoizedState===null&&Fl(i,a,n),rl(a,a.return);break;case 30:break;default:Fl(i,a,n)}t=t.sibling}}function Il(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&&va(n))}function Ll(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&va(e))}function Rl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zl(e,t,n,r),t=t.sibling}function zl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Rl(e,t,n,r),i&2048&&$c(9,t);break;case 1:Rl(e,t,n,r);break;case 3:Rl(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&&va(e)));break;case 12:if(i&2048){Rl(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){od(t,t.return,e)}}else Rl(e,t,n,r);break;case 31:Rl(e,t,n,r);break;case 13:Rl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Rl(e,t,n,r):(a._visibility|=2,Bl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Rl(e,t,n,r):Vl(e,t),i&2048&&Il(o,t);break;case 24:Rl(e,t,n,r),i&2048&&Ll(t.alternate,t);break;default:Rl(e,t,n,r)}}function Bl(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:Bl(a,o,s,c,i),$c(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Bl(a,o,s,c,i)):u._visibility&2?Bl(a,o,s,c,i):Vl(a,o),i&&l&2048&&Il(o.alternate,o);break;case 24:Bl(a,o,s,c,i),i&&l&2048&&Ll(o.alternate,o);break;default:Bl(a,o,s,c,i)}t=t.sibling}}function Vl(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:Vl(n,r),i&2048&&Il(r.alternate,r);break;case 24:Vl(n,r),i&2048&&Ll(r.alternate,r);break;default:Vl(n,r)}t=t.sibling}}var Hl=8192;function Ul(e,t,n){if(e.subtreeFlags&Hl)for(e=e.child;e!==null;)Wl(e,t,n),e=e.sibling}function Wl(e,t,n){switch(e.tag){case 26:Ul(e,t,n),e.flags&Hl&&e.memoizedState!==null&&cp(n,kl,e.memoizedState,e.memoizedProps);break;case 5:Ul(e,t,n);break;case 3:case 4:var r=kl;kl=Nf(e.stateNode.containerInfo),Ul(e,t,n),kl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Hl,Hl=16777216,Ul(e,t,n),Hl=r):Ul(e,t,n));break;default:Ul(e,t,n)}}function Gl(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 Kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gl=r,Yl(r,e)}Gl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ql(e),e=e.sibling}function ql(e){switch(e.tag){case 0:case 11:case 15:Kl(e),e.flags&2048&&el(9,e,e.return);break;case 3:Kl(e);break;case 12:Kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Jl(e)):Kl(e);break;default:Kl(e)}}function Jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gl=r,Yl(r,e)}Gl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:el(8,t,t.return),Jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Jl(t));break;default:Jl(t)}e=e.sibling}}function Yl(e,t){for(;gl!==null;){var n=gl;switch(n.tag){case 0:case 11:case 15:el(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:va(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,gl=r;else a:for(n=e;gl!==null;){r=gl;var i=r.sibling,a=r.return;if(yl(r),r===n){gl=null;break a}if(i!==null){i.return=a,gl=i;break a}gl=a}}}var Xl={getCacheForType:function(e){var t=da(A),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return da(A).controller.signal}},Zl=typeof WeakMap==`function`?WeakMap:Map,N=0,Ql=null,P=null,F=0,$l=0,eu=null,tu=!1,nu=!1,ru=!1,iu=0,au=0,ou=0,su=0,cu=0,lu=0,uu=0,du=null,fu=null,pu=!1,mu=0,hu=0,gu=1/0,_u=null,vu=null,yu=0,bu=null,xu=null,Su=0,Cu=0,wu=null,Tu=null,Eu=0,Du=null;function Ou(){return N&2&&F!==0?F&-F:O.T===null?ft():Dd()}function ku(){if(lu===0)if(!(F&536870912)||Wi){var e=Ze;Ze<<=1,!(Ze&3932160)&&(Ze=262144),lu=e}else lu=536870912;return e=po.current,e!==null&&(e.flags|=32),lu}function Au(e,t,n){(e===Ql&&($l===2||$l===9)||e.cancelPendingCommit!==null)&&(Lu(e,0),Pu(e,F,lu,!1)),at(e,n),(!(N&2)||e!==Ql)&&(e===Ql&&(!(N&2)&&(su|=n),au===4&&Pu(e,F,lu,!1)),yd(e))}function ju(e,t,n){if(N&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||tt(e,t),a=r?Gu(e,t):Uu(e,t,!0),o=r;do{if(a===0){nu&&!r&&Pu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Nu(n)){a=Uu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=du;var l=c.current.memoizedState.isDehydrated;if(l&&(Lu(c,s).flags|=256),s=Uu(c,s,!1),s!==2){if(ru&&!l){c.errorRecoveryDisabledLanes|=o,su|=o,a=4;break a}o=fu,fu=a,o!==null&&(fu===null?fu=o:fu.push.apply(fu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Lu(e,0),Pu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Pu(r,t,lu,!tu);break a;case 2:fu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=mu+300-Pe(),10<a)){if(Pu(r,t,lu,!tu),et(r,0,!0)!==0)break a;Su=t,r.timeoutHandle=uf(Mu.bind(null,r,n,fu,_u,pu,t,lu,su,uu,tu,o,`Throttled`,-0,0),a);break a}Mu(r,n,fu,_u,pu,t,lu,su,uu,tu,o,null,-0,0)}}break}while(1);yd(e)}function Mu(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},Wl(t,a,d);var m=(a&62914560)===a?mu-Pe():(a&4194048)===a?hu-Pe():0;if(m=up(d,m),m!==null){Su=a,e.cancelPendingCommit=m(Qu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Pu(e,a,o,!l);return}}Qu(e,t,a,n,r,i,o,s,c)}function Nu(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 Pu(e,t,n,r){t&=~cu,t&=~su,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 Fu(){return N&6?!0:(bd(0,!1),!1)}function Iu(){if(P!==null){if($l===0)var e=P.return;else e=P,ra=na=null,Bo(e),Va=null,Ha=0,e=P;for(;e!==null;)Qc(e.alternate,e),e=e.return;P=null}}function Lu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,df(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Su=0,Iu(),Ql=e,P=n=yi(e.current,null),F=t,$l=0,eu=null,tu=!1,nu=tt(e,t),ru=!1,uu=lu=cu=su=ou=au=0,fu=du=null,pu=!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 iu=t,li(),n}function Ru(e,t){j=null,O.H=Ys,t===ja||t===Na?(t=za(),$l=3):t===Ma?(t=za(),$l=4):$l=t===pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,eu=t,P===null&&(au=1,sc(e,Di(t,e.current)))}function zu(){var e=po.current;return e===null?!0:(F&4194048)===F?mo===null:(F&62914560)===F||F&536870912?e===mo:!1}function Bu(){var e=O.H;return O.H=Ys,e===null?Ys:e}function Vu(){var e=O.A;return O.A=Xl,e}function Hu(){au=4,tu||(F&4194048)!==F&&po.current!==null||(nu=!0),!(ou&134217727)&&!(su&134217727)||Ql===null||Pu(Ql,F,lu,!1)}function Uu(e,t,n){var r=N;N|=2;var i=Bu(),a=Vu();(Ql!==e||F!==t)&&(_u=null,Lu(e,t)),t=!1;var o=au;a:do try{if($l!==0&&P!==null){var s=P,c=eu;switch($l){case 8:Iu(),o=6;break a;case 3:case 2:case 9:case 6:po.current===null&&(t=!0);var l=$l;if($l=0,eu=null,Yu(e,s,c,l),n&&nu){o=0;break a}break;default:l=$l,$l=0,eu=null,Yu(e,s,c,l)}}Wu(),o=au;break}catch(t){Ru(e,t)}while(1);return t&&e.shellSuspendCounter++,ra=na=null,N=r,O.H=i,O.A=a,P===null&&(Ql=null,F=0,li()),o}function Wu(){for(;P!==null;)qu(P)}function Gu(e,t){var n=N;N|=2;var r=Bu(),a=Vu();Ql!==e||F!==t?(_u=null,gu=Pe()+500,Lu(e,t)):nu=tt(e,t);a:do try{if($l!==0&&P!==null){t=P;var o=eu;b:switch($l){case 1:$l=0,eu=null,Yu(e,t,o,1);break;case 2:case 9:if(Fa(o)){$l=0,eu=null,Ju(t);break}t=function(){$l!==2&&$l!==9||Ql!==e||($l=7),yd(e)},o.then(t,t);break a;case 3:$l=7;break a;case 4:$l=5;break a;case 7:Fa(o)?($l=0,eu=null,Ju(t)):($l=0,eu=null,Yu(e,t,o,7));break;case 5:var s=null;switch(P.tag){case 26:s=P.memoizedState;case 5:case 27:var c=P;if(s?sp(s):c.stateNode.complete){$l=0,eu=null;var l=c.sibling;if(l!==null)P=l;else{var u=c.return;u===null?P=null:(P=u,Xu(u))}break b}}$l=0,eu=null,Yu(e,t,o,5);break;case 6:$l=0,eu=null,Yu(e,t,o,6);break;case 8:Iu(),au=6;break a;default:throw Error(i(462))}}Ku();break}catch(t){Ru(e,t)}while(1);return ra=na=null,O.H=r,O.A=a,N=n,P===null?(Ql=null,F=0,li(),au):0}function Ku(){for(;P!==null&&!Me();)qu(P)}function qu(e){var t=Uc(e.alternate,e,iu);e.memoizedProps=e.pendingProps,t===null?Xu(e):P=t}function Ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Dc(n,t,t.pendingProps,t.type,void 0,F);break;case 11:t=Dc(n,t,t.pendingProps,t.type.render,t.ref,F);break;case 5:Bo(t);default:Qc(n,t),t=P=bi(t,iu),t=Uc(n,t,iu)}e.memoizedProps=e.pendingProps,t===null?Xu(e):P=t}function Yu(e,t,n,r){ra=na=null,Bo(t),Va=null,Ha=0;var i=t.return;try{if(fc(e,i,t,n,F)){au=1,sc(e,Di(n,e.current)),P=null;return}}catch(t){if(i!==null)throw P=i,t;au=1,sc(e,Di(n,e.current)),P=null;return}t.flags&32768?(Wi||r===1?e=!0:nu||F&536870912?e=!1:(tu=e=!0,(r===2||r===9||r===3||r===6)&&(r=po.current,r!==null&&r.tag===13&&(r.flags|=16384))),Zu(t,e)):Xu(t)}function Xu(e){var t=e;do{if(t.flags&32768){Zu(t,tu);return}e=t.return;var n=Xc(t.alternate,t,iu);if(n!==null){P=n;return}if(t=t.sibling,t!==null){P=t;return}P=t=e}while(t!==null);au===0&&(au=5)}function Zu(e,t){do{var n=Zc(e.alternate,e);if(n!==null){n.flags&=32767,P=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){P=e;return}P=e=n}while(e!==null);au=6,P=null}function Qu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do rd();while(yu!==0);if(N&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ci,ot(e,n,o,s,c,l),e===Ql&&(P=Ql=null,F=0),xu=t,bu=e,Su=n,Cu=o,wu=a,Tu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,fd(Re,function(){return id(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=O.T,O.T=null,a=k.p,k.p=2,s=N,N|=4;try{_l(e,t,n)}finally{N=s,k.p=a,O.T=r}}yu=1,$u(),ed(),td()}}function $u(){if(yu===1){yu=0;var e=bu,t=xu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=N;N|=4;try{Al(t,e);var a=nf,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}}wp=!!tf,nf=tf=null}finally{N=i,k.p=r,O.T=n}}e.current=t,yu=2}}function ed(){if(yu===2){yu=0;var e=bu,t=xu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=N;N|=4;try{vl(e,t.alternate,t)}finally{N=i,k.p=r,O.T=n}}yu=3}}function td(){if(yu===4||yu===3){yu=0,Ne();var e=bu,t=xu,n=Su,r=Tu;t.subtreeFlags&10256||t.flags&10256?yu=5:(yu=0,xu=bu=null,nd(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(vu=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=O.T,i=k.p,k.p=2,O.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{O.T=t,k.p=i}}Su&3&&rd(),yd(e),i=e.pendingLanes,n&261930&&i&42?e===Du?Eu++:(Eu=0,Du=e):Eu=0,bd(0,!1)}}function nd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,va(t)))}function rd(){return $u(),ed(),td(),id()}function id(){if(yu!==5)return!1;var e=bu,t=Cu;Cu=0;var n=dt(Su),r=O.T,a=k.p;try{k.p=32>n?32:n,O.T=null,n=wu,wu=null;var o=bu,s=Su;if(yu=0,xu=bu=null,Su=0,N&6)throw Error(i(331));var c=N;if(N|=4,ql(o.current),zl(o,o.current,s,n),N=c,bd(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{k.p=a,O.T=r,nd(e,t)}}function ad(e,t,n){t=Di(n,t),t=lc(e.stateNode,t,2),e=$a(e,t,2),e!==null&&(at(e,2),yd(e))}function od(e,t,n){if(e.tag===3)ad(e,e,n);else for(;t!==null;){if(t.tag===3){ad(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vu===null||!vu.has(r))){e=Di(n,e),n=uc(2),r=$a(t,n,2),r!==null&&(dc(n,r,t,e),at(r,2),yd(r));break}}t=t.return}}function sd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Zl;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)||(ru=!0,i.add(n),e=cd.bind(null,e,t,n),t.then(e,e))}function cd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ql===e&&(F&n)===n&&(au===4||au===3&&(F&62914560)===F&&300>Pe()-mu?!(N&2)&&Lu(e,0):cu|=n,uu===F&&(uu=0)),yd(e)}function ld(e,t){t===0&&(t=rt()),e=fi(e,t),e!==null&&(at(e,t),yd(e))}function ud(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ld(e,n)}function dd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ld(e,n)}function fd(e,t){return Ae(e,t)}var pd=null,md=null,hd=!1,gd=!1,_d=!1,vd=0;function yd(e){e!==md&&e.next===null&&(md===null?pd=md=e:md=md.next=e),gd=!0,hd||(hd=!0,Ed())}function bd(e,t){if(!_d&&gd){_d=!0;do for(var n=!1,r=pd;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,Td(r,a))}else a=F,a=et(r,r===Ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,Td(r,a));r=r.next}while(n);_d=!1}}function xd(){Sd()}function Sd(){gd=hd=!1;var e=0;vd!==0&&lf()&&(e=vd);for(var t=Pe(),n=null,r=pd;r!==null;){var i=r.next,a=Cd(r,t);a===0?(r.next=null,n===null?pd=i:n.next=i,i===null&&(md=n)):(n=r,(e!==0||a&3)&&(gd=!0)),r=i}yu!==0&&yu!==5||bd(e,!1),vd!==0&&(vd=0)}function Cd(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=Ql,n=F,n=et(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&($l===2||$l===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=wd.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 wd(e,t){if(yu!==0&&yu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(rd()&&e.callbackNode!==n)return null;var r=F;return r=et(e,e===Ql?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(ju(e,r,t),Cd(e,Pe()),e.callbackNode!=null&&e.callbackNode===n?wd.bind(null,e):null)}function Td(e,t){if(rd())return null;ju(e,t,!0)}function Ed(){pf(function(){N&6?Ae(Ie,xd):Sd()})}function Dd(){if(vd===0){var e=xa;e===0&&(e=Xe,Xe<<=1,!(Xe&261888)&&(Xe=256)),vd=e}return vd}function Od(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:cn(``+e)}function kd(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 Ad(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Od((i[gt]||null).action),o=r.submitter;o&&(t=(t=o[gt]||null)?Od(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(vd!==0){var e=o?kd(i,o):new FormData(i);Fs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?kd(i,o):new FormData(i),Fs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var jd=0;jd<ri.length;jd++){var Md=ri[jd];ii(Md.toLowerCase(),`on`+(Md[0].toUpperCase()+Md.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 Nd=`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(` `),Pd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Nd));function Fd(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 I(e,t){var n=t[vt];n===void 0&&(n=t[vt]=new Set);var r=e+`__bubble`;n.has(r)||(zd(t,e,2,!1),n.add(r))}function Id(e,t,n){var r=0;t&&(r|=4),zd(n,e,r,t)}var Ld=`_reactListening`+Math.random().toString(36).slice(2);function Rd(e){if(!e[Ld]){e[Ld]=!0,kt.forEach(function(t){t!==`selectionchange`&&(Pd.has(t)||Id(t,!1,e),Id(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ld]||(t[Ld]=!0,Id(`selectionchange`,!1,t))}}function zd(e,t,n,r){switch(jp(t)){case 2:var i=Tp;break;case 8:i=Ep;break;default:i=Dp}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 Bd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=wt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}gn(function(){var r=a,i=dn(n),s=[];a:{var c=ni.get(e);if(c!==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?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=_n(m,p),g!=null&&d.push(Vd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==un&&(u=n.relatedTarget||n.fromElement)&&(wt(u)||u[_t]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?wt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Ln,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Yn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Et(l),h=u==null?c:Et(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.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=Ud,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&&Wd(s,c,l,d,!1),u!==null&&f!==null&&Wd(s,f,u,d,!0)}}a:{if(c=r?Et(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=yr;else if(pr(c))if(br)v=kr;else{v=Dr;var y=Er}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&an(r.elementType)&&(v=yr):v=Or;if(v&&=v(e,r)){mr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Xt(c,`number`,c.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(s,n,i);break;case`selectionchange`:if(Rr)break;case`keydown`:case`keyup`:Ur(s,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=Hd(r,x),0<y.length&&(x=new Hn(x,e,null,n,i),s.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=Hd(r,`onBeforeInput`),0<x.length&&(y=new Hn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Ad(s,e,r,n,i)}Fd(s,t)})}function Vd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hd(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(Vd(e,i,a)),i=_n(e,t),i!=null&&r.push(Vd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ud(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Wd(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(Vd(n,l,c))):i||(l=_n(n,a),l!=null&&o.push(Vd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Gd=/\r\n?/g,Kd=/\u0000|\uFFFD/g;function qd(e){return(typeof e==`string`?e:``+e).replace(Gd,`
9
+ `).replace(Kd,``)}function Jd(e,t){return t=qd(t),qd(e)===t}function Yd(e,t,n,r,a,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`&&Yd(e,t,`name`,a.name,a,null),Yd(e,t,`formEncType`,a.formEncType,a,null),Yd(e,t,`formMethod`,a.formMethod,a,null),Yd(e,t,`formTarget`,a.formTarget,a,null)):(Yd(e,t,`encType`,a.encType,a,null),Yd(e,t,`method`,a.method,a,null),Yd(e,t,`target`,a.target,a,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&&I(`scroll`,e);break;case`onScrollEnd`:r!=null&&I(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=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`:I(`beforetoggle`,e),I(`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 Xd(e,t,n,r,a,o){switch(n){case`style`:rn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?en(e,r):(typeof r==`number`||typeof r==`bigint`)&&en(e,``+r);break;case`onScroll`:r!=null&&I(`scroll`,e);break;case`onScrollEnd`:r!=null&&I(`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`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[gt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Lt(e,n,r)}}}function Zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:I(`error`,e),I(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Yd(e,t,o,s,n,null)}}a&&Yd(e,t,`srcSet`,n.srcSet,n,null),r&&Yd(e,t,`src`,n.src,n,null);return;case`input`:I(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Yd(e,t,r,d,n,null)}}Yt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in I(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Yd(e,t,a,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 I(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Yd(e,t,s,c,n,null)}$t(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Yd(e,t,l,r,n,null)}return;case`dialog`:I(`beforetoggle`,e),I(`toggle`,e),I(`cancel`,e),I(`close`,e);break;case`iframe`:case`object`:I(`load`,e);break;case`video`:case`audio`:for(r=0;r<Nd.length;r++)I(Nd[r],e);break;case`image`:I(`error`,e),I(`load`,e);break;case`details`:I(`toggle`,e);break;case`embed`:case`source`:case`link`:I(`error`,e),I(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Yd(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Xd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Yd(e,t,c,r,n,null))}function Qd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Yd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Yd(e,t,p,m,r,f)}}Jt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Yd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Yd(e,t,a,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(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Yd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Yd(e,t,s,a,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:Yd(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:Yd(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)&&Yd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Yd(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Xd(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||Xd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Yd(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||Yd(e,t,f,p,r,m)}function $d(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function ef(){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&&$d(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&&$d(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 tf=null,nf=null;function rf(e){return e.nodeType===9?e:e.ownerDocument}function af(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 of(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 sf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var cf=null;function lf(){var e=window.event;return e&&e.type===`popstate`?e===cf?!1:(cf=e,!0):(cf=null,!1)}var uf=typeof setTimeout==`function`?setTimeout:void 0,df=typeof clearTimeout==`function`?clearTimeout:void 0,ff=typeof Promise==`function`?Promise:void 0,pf=typeof queueMicrotask==`function`?queueMicrotask:ff===void 0?uf:function(e){return ff.resolve(null).then(e).catch(mf)};function mf(e){setTimeout(function(){throw e})}function hf(e){return e===`head`}function gf(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),Xp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Af(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Af(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`&&Af(e.ownerDocument.body);n=i}while(n);Xp(t)}function _f(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 vf(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`:vf(n),Ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function yf(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=Tf(e.nextSibling),e===null)break}return null}function bf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Tf(e.nextSibling),e===null))return null;return e}function xf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Tf(e.nextSibling),e===null))return null;return e}function Sf(e){return e.data===`$?`||e.data===`$~`}function Cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function wf(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 Tf(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 Ef=null;function Df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Tf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Of(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 kf(e,t,n){switch(t=rf(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Af(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ct(e)}var jf=new Map,Mf=new Set;function Nf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pf=k.d;k.d={f:Ff,r:If,D:zf,C:Bf,L:Vf,m:Hf,X:Wf,S:Uf,M:Gf};function Ff(){var e=Pf.f(),t=Fu();return e||t}function If(e){var t=Tt(e);t!==null&&t.tag===5&&t.type===`form`?Ls(t):Pf.r(e)}var Lf=typeof document>`u`?null:document;function Rf(e,t,n){var r=Lf;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Mf.has(i)||(Mf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Zd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function zf(e){Pf.D(e),Rf(`dns-prefetch`,e,null)}function Bf(e,t){Pf.C(e,t),Rf(`preconnect`,e,t)}function Vf(e,t,n){Pf.L(e,t,n);var r=Lf;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=qf(e);break;case`script`:a=Zf(e)}jf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),jf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Jf(a))||t===`script`&&r.querySelector(Qf(a))||(t=r.createElement(`link`),Zd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Hf(e,t){Pf.m(e,t);var n=Lf;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=Zf(e)}if(!jf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),jf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Qf(a)))return}r=n.createElement(`link`),Zd(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function Uf(e,t,n){Pf.S(e,t,n);var r=Lf;if(r&&e){var i=Dt(r).hoistableStyles,a=qf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=jf.get(a))&&tp(e,n);var c=o=r.createElement(`link`);Ot(c),Zd(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,ep(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Wf(e,t){Pf.X(e,t);var n=Lf;if(n&&e){var r=Dt(n).hoistableScripts,i=Zf(e),a=r.get(i);a||(a=n.querySelector(Qf(i)),a||(e=m({src:e,async:!0},t),(t=jf.get(i))&&np(e,t),a=n.createElement(`script`),Ot(a),Zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Gf(e,t){Pf.M(e,t);var n=Lf;if(n&&e){var r=Dt(n).hoistableScripts,i=Zf(e),a=r.get(i);a||(a=n.querySelector(Qf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=jf.get(i))&&np(e,t),a=n.createElement(`script`),Ot(a),Zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Kf(e,t,n,r){var a=(a=ge.current)?Nf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=qf(n.href),n=Dt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=qf(n.href);var o=Dt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),jf.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},jf.set(e,n),o||Xf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Zf(n),n=Dt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function qf(e){return`href="`+qt(e)+`"`}function Jf(e){return`link[rel="stylesheet"][`+e+`]`}function Yf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Xf(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}),Zd(t,`link`,n),Ot(t),e.head.appendChild(t))}function Zf(e){return`[src="`+qt(e)+`"]`}function Qf(e){return`script[async]`+e}function $f(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 a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ot(r),Zd(r,`style`,a),ep(r,n.precedence,e),t.instance=r;case`stylesheet`:a=qf(n.href);var o=e.querySelector(Jf(a));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Yf(n),(a=jf.get(a))&&tp(r,a),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}),Zd(o,`link`,r),t.state.loading|=4,ep(o,n.precedence,e),t.instance=o;case`script`:return o=Zf(n.src),(a=e.querySelector(Qf(o)))?(t.instance=a,Ot(a),a):(r=n,(a=jf.get(o))&&(r=m({},n),np(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ot(a),Zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,ep(r,n.precedence,e));return t.instance}function ep(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 tp(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function np(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var rp=null;function ip(e,t,n){if(rp===null){var r=new Map,i=rp=new Map;i.set(n,r)}else i=rp,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 ap(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function op(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 sp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function cp(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=qf(r.href),a=t.querySelector(Jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=dp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Yf(r),(i=jf.get(i))&&tp(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Zd(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=dp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var lp=0;function up(e,t){return e.stylesheets&&e.count===0&&pp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&pp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&lp===0&&(lp=62500*ef());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&pp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function dp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fp=null;function pp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fp=new Map,t.forEach(mp,e),fp=null,dp.call(e))}function mp(e,t){if(!(t.state.loading&4)){var n=fp.get(e);if(n)var r=n.get(null);else{n=new Map,fp.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=dp.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 hp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function gp(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 _p(e,t,n,r,i,a,o,s,c,l,u,d){return e=new gp(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=_a(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Xa(a),e}function vp(e){return e?(e=hi,e):hi}function yp(e,t,n,r,i,a){i=vp(i),r.context===null?r.context=i:r.pendingContext=i,r=Qa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=$a(e,r,t),n!==null&&(Au(n,e,t),eo(n,e,t))}function bp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xp(e,t){bp(e,t),(e=e.alternate)&&bp(e,t)}function Sp(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&Au(t,e,67108864),xp(e,67108864)}}function Cp(e){if(e.tag===13||e.tag===31){var t=Ou();t=ut(t);var n=fi(e,t);n!==null&&Au(n,e,t),xp(e,t)}}var wp=!0;function Tp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=2,Dp(e,t,n,r)}finally{k.p=a,O.T=i}}function Ep(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=8,Dp(e,t,n,r)}finally{k.p=a,O.T=i}}function Dp(e,t,n,r){if(wp){var i=Op(r);if(i===null)Bd(e,t,r,kp,n),Bp(e,r);else if(Hp(i,e,t,n,r))r.stopPropagation();else if(Bp(e,r),t&4&&-1<zp.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}yd(a),!(N&6)&&(gu=Pe()+500,bd(0,!1))}}break;case 31:case 13:s=fi(a,2),s!==null&&Au(s,a,2),Fu(),xp(a,2)}if(a=Op(r),a===null&&Bd(e,t,r,kp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Bd(e,t,r,null,n)}}function Op(e){return e=dn(e),Ap(e)}var kp=null;function Ap(e){if(kp=null,e=wt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return kp=e,null}function jp(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 Mp=!1,Np=null,Pp=null,Fp=null,Ip=new Map,Lp=new Map,Rp=[],zp=`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 Bp(e,t){switch(e){case`focusin`:case`focusout`:Np=null;break;case`dragenter`:case`dragleave`:Pp=null;break;case`mouseover`:case`mouseout`:Fp=null;break;case`pointerover`:case`pointerout`:Ip.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Lp.delete(t.pointerId)}}function Vp(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&&Sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Hp(e,t,n,r,i){switch(t){case`focusin`:return Np=Vp(Np,e,t,n,r,i),!0;case`dragenter`:return Pp=Vp(Pp,e,t,n,r,i),!0;case`mouseover`:return Fp=Vp(Fp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ip.set(a,Vp(Ip.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Lp.set(a,Vp(Lp.get(a)||null,e,t,n,r,i)),!0}return!1}function Up(e){var t=wt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,pt(e.priority,function(){Cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,pt(e.priority,function(){Cp(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 Wp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Op(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&&Sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Gp(e,t,n){Wp(e)&&n.delete(t)}function Kp(){Mp=!1,Np!==null&&Wp(Np)&&(Np=null),Pp!==null&&Wp(Pp)&&(Pp=null),Fp!==null&&Wp(Fp)&&(Fp=null),Ip.forEach(Gp),Lp.forEach(Gp)}function qp(e,n){e.blockedOn===n&&(e.blockedOn=null,Mp||(Mp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Kp)))}var Jp=null;function Yp(e){Jp!==e&&(Jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jp===e&&(Jp=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(Ap(r||n)===null)continue;break}var a=Tt(n);a!==null&&(e.splice(t,3),t-=3,Fs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Xp(e){function t(t){return qp(t,e)}Np!==null&&qp(Np,e),Pp!==null&&qp(Pp,e),Fp!==null&&qp(Fp,e),Ip.forEach(t),Lp.forEach(t);for(var n=0;n<Rp.length;n++){var r=Rp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rp.length&&(n=Rp[0],n.blockedOn===null);)Up(n),n.blockedOn===null&&Rp.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||Yp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Ap(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Yp(n)}}}function Zp(){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 Qp(e){this._internalRoot=e}$p.prototype.render=Qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;yp(n,Ou(),e,t,null,null)},$p.prototype.unmount=Qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yp(e.current,2,null,e,null,null),Fu(),t[_t]=null}};function $p(e){this._internalRoot=e}$p.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rp.length&&t!==0&&t<Rp[n].priority;n++);Rp.splice(n,0,e),n===0&&Up(e)}};var em=n.version;if(em!==`19.2.8`)throw Error(i(527,em,`19.2.8`));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var tm={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var nm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nm.isDisabled&&nm.supportsFiber)try{Ue=nm.inject(tm),We=nm}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=ic,s=ac,c=oc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=_p(e,1,!1,null,null,n,r,null,o,s,c,Zp),e[_t]=t.current,Rd(e),new Qp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=l(h(),1),b=_(),x=`modulepreload`,S=function(e){return`/`+e},C={},w=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=S(t,n),t=s(t),t in C)return;C[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`:x,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)})},T=e=>{throw TypeError(e)},E=(e,t,n)=>t.has(e)||T(`Cannot `+n),ee=(e,t,n)=>(E(e,t,`read from private field`),n?n.call(e):t.get(e)),D=(e,t,n)=>t.has(e)?T(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),te=(e,t,n,r)=>(E(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ne=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,re=/^[\\/]{2}/;function ie(e,t){return t+e.replace(/\\/g,`/`)}var ae=`popstate`;function oe(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function se(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=fe(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),ue(``,{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:de(t))}function r(e,t){k(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return pe(t,n,r,e)}function O(e,t){if(e===!1||e==null)throw Error(t)}function k(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ce(){return Math.random().toString(36).substring(2,10)}function le(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 ue(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?fe(t):t,state:n,key:t&&t.key||r||ce(),mask:i}}function de({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 fe(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 pe(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=oe(e)?e:ue(h.location,e,t);n&&n(r,e),l=u()+1;let d=le(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=oe(e)?e:ue(h.location,e,t);n&&n(r,e),l=u();let i=le(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 me(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(ae,d),c=e,()=>{i.removeEventListener(ae,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 me(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),O(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:de(t);return i=i.replace(/ $/,`%20`),!n&&re.test(i)&&(i=r+i),new URL(i,r)}var he,ge=class{constructor(e){if(D(this,he,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(ee(this,he).has(e))return ee(this,he).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){ee(this,he).set(e,t)}};he=new WeakMap;var _e=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function ve(e){return _e.has(e)}var ye=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function be(e){return ye.has(e)}function xe(e){return e.index===!0}function Se(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(O(e.index!==!0||!e.children,`Cannot specify children on an index route`),O(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),xe(e)){let n={...e,id:s};return r[s]=Ce(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=Ce(n,t(n)),e.children&&(n.children=Se(e.children,t,o,r,i)),n}})}function Ce(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function we(e,t,n=`/`){return Te(e,t,n,!1)}function Te(e,t,n,r,i){let a=Ge((typeof t==`string`?fe(t):t).pathname||`/`,n);if(a==null)return null;let o=i??De(e),s=null,c=We(a);for(let e=0;s==null&&e<o.length;++e)s=Be(o[e],c,r);return s}function Ee(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 De(e){let t=Oe(e);return Ae(t),t}function Oe(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;O(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=tt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(O(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Oe(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Re(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Ue(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 ke(e.path))a(e,t,!0,n)}),t}function ke(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=ke(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 Ae(e){e.sort((e,t)=>e.score===t.score?ze(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var je=/^:[\w-]+$/,Me=3,Ne=2,Pe=1,Fe=10,Ie=-2,Le=e=>e===`*`;function Re(e,t){let n=e.split(`/`),r=n.length;return n.some(Le)&&(r+=Ie),t&&(r+=Ne),n.filter(e=>!Le(e)).reduce((e,t)=>e+(je.test(t)?Me:t===``?Pe:Fe),r)}function ze(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 Be(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?He(u,l,s.matcher,s.compiledParams):Ve(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ve({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:tt([a,d.pathname]),pathnameBase:rt(tt([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=tt([a,d.pathnameBase]))}return o}function Ve(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ue(e.path,e.caseSensitive,e.end);return He(e,t,n,r)}function He(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 Ue(e,t=!1,n=!0){k(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function We(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return k(!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 Ge(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 Ke({basename:e,pathname:t}){return t===`/`?e:tt([e,t])}var qe=e=>ne.test(e);function Je(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?fe(e):e,a;return n?(n=et(n),a=n.startsWith(`/`)?Ye(n.substring(1),`/`):Ye(n,t)):a=t,{pathname:a,search:it(r),hash:at(i)}}function Ye(e,t){let n=nt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Xe(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 Ze(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Qe(e){let t=Ze(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function $e(e,t,n,r=!1){let i;typeof e==`string`?i=fe(e):(i={...e},O(!i.pathname||!i.pathname.includes(`?`),Xe(`?`,`pathname`,`search`,i)),O(!i.pathname||!i.pathname.includes(`#`),Xe(`#`,`pathname`,`hash`,i)),O(!i.search||!i.search.includes(`#`),Xe(`#`,`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=Je(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var et=e=>e.replace(/[\\/]{2,}/g,`/`),tt=e=>et(e.join(`/`)),nt=e=>e.replace(/\/+$/,``),rt=e=>nt(e).replace(/^\/*/,`/`),it=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,at=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ot=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},st=(e,t)=>{let n=ot(e,t);return n.headers.set(`X-Remix-Replace`,`true`),n},ct=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],lt=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 ut(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function dt(e){return tt(e.map(e=>e.route.path).filter(Boolean))||`/`}var ft=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function pt(e,t){let n=e;if(typeof n!=`string`||!ne.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ft)try{let e=new URL(window.location.href),r=re.test(n)?new URL(ie(n,e.protocol)):new URL(n),a=Ge(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{k(!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 mt=Symbol(`Uninstrumented`);function ht(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=_t(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=_t(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[mt]??i,a=_t(n[e],t,(...e)=>yt(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[mt]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[mt]??e,r=_t(n.middleware,t,(...e)=>yt(e[0]));return r?(r[mt]=t,r):e})),r}function gt(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[mt]??e.navigate,r=_t(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?de(n):`.`,...bt(e,r??{})}});r&&(r[mt]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[mt]??e.fetch,r=_t(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...bt(e,i??{})}});r&&(r[mt]=t,e.fetch=r)}return e}function _t(e,t,n){return e.length===0?null:async(...r)=>{let i=await vt(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function vt(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=vt(e,t,n,r-1),a=await o,O(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 yt(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:xt(t),params:{...r},pattern:i,context:St(n)}}function bt(e,t){return{currentUrl:de(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 xt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function St(e){if(wt(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Ct=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function wt(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`)===Ct}var Tt=[`POST`,`PUT`,`PATCH`,`DELETE`],Et=new Set(Tt),Dt=[`GET`,...Tt],Ot=new Set(Dt),kt=new Set([301,302,303,307,308]),At=new Set([307,308]),jt={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},Mt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Nt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Pt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ft=`remix-router-transitions`,It=Symbol(`ResetLoaderData`),Lt,Rt,zt,Bt,Vt=class{constructor(e){D(this,Lt),D(this,Rt),D(this,zt),D(this,Bt),te(this,Lt,e),te(this,Rt,De(e))}get stableRoutes(){return ee(this,Lt)}get activeRoutes(){return ee(this,zt)??ee(this,Lt)}get branches(){return ee(this,Bt)??ee(this,Rt)}get hasHMRRoutes(){return ee(this,zt)!=null}setRoutes(e){te(this,Lt,e),te(this,Rt,De(e))}setHmrRoutes(e){te(this,zt,e),te(this,Bt,De(e))}commitHmrRoutes(){ee(this,zt)&&(te(this,Lt,ee(this,zt)),te(this,Rt,ee(this,Bt)),te(this,zt,void 0),te(this,Bt,void 0))}};Lt=new WeakMap,Rt=new WeakMap,zt=new WeakMap,Bt=new WeakMap;function Ht(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;O(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Pt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...ht(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Vt(Se(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||on,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=Te(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=jn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=An(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&ft(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=ft(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=>qt(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=Jt(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:jt,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,D,te=!1,ne=new Map,re=null,ie=!1,ae=!1,oe=new Set,se=new Map,ce=0,le=-1,de=new Map,pe=new Set,he=new Map,_e=new Map,ve=new Set,ye=new Map,be,xe=null;function Ce(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(be){be(),be=void 0;return}k(ye.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=at({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{be=e});e.history.go(r*-1),it(i,{state:`blocked`,location:n,proceed(){it(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,Nt),Oe({blockers:e})}}),E?.resolve(),E=null;return}return Me(t,n)}),n){tr(t,ne);let e=()=>nr(t,ne);t.addEventListener(`pagehide`,e),re=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||Me(`POP`,w.location,{initialHydration:!0}),C}function we(){d&&d(),re&&re(),f.clear(),D&&D.abort(),w.fetchers.forEach((e,t)=>Xe(w.fetchers,t)),w.blockers.forEach((e,t)=>rt(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`&&(ve.has(t)?n.push(t):r.push(t))}),ve.forEach(e=>{!w.fetchers.has(e)&&!se.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&&Kn(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?Dn(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,Nt)));let l=ie?!1:dt(t,n.matches||w.matches),u=ee===!0||w.navigation.formMethod!=null&&Kn(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ie||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=ne.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:ne.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(te){let e=ne.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ne.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:jt,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,ee=!1,te=!1,ie=!1,ae=!1,E?.resolve(),E=null,xe?.resolve(),xe=null}async function Ae(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=rr();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=Gt(!1,Wt(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?fe(n.mask):{...w.location.mask,...n.mask}});let s=w.location,l=ue(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&&Kn(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=at({currentLocation:s,nextLocation:l,historyAction:d});if(m){it(m,{state:`blocked`,location:l,proceed(){it(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),Ae(t,n)},reset(){let e=new Map(w.blockers);e.set(m,Nt),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(){xe||=rr(),Ue(),Oe({revalidation:`loading`});let e=xe.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:te===!0}),e)}async function Me(t,n,r){D&&D.abort(),D=null,T=t,ie=(r&&r.startUninterruptedRevalidation)===!0,lt(w.location,w.matches),ee=(r&&r.preventScrollReset)===!0,te=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:Te(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!ae&&Pn(w.location,n)&&!(r&&r.submission&&Kn(r.submission.formMethod))){ke(n,{matches:a},{flushSync:o});return}let l=ft(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=ot(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;D=new AbortController;let d=xn(e.history,n,D.signal,r&&r.submission),f=e.getContext?await e.getContext():new ge,p;if(r&&r.pendingError)p=[kn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Kn(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(zn(t)&&ut(t.error)&&t.error.status===404){D=null,ke(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=Xn(n,a,t,r.submission),o=!1,l.active=!1,d=xn(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||(D=null,ke(n,{matches:h||a,...On(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Ne(t,n,i,l,u,d,f,p,m={}){if(Ue(),Oe({navigation:Zn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await pt(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}=An(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=kn(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}=ot(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Jn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:jn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Ve(t,n,fn(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(Bn(h)){let n;return n=m&&m.replace!=null?m.replace:bn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await Be(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(zn(h)){let e=kn(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||Xn(n,i,l,p),x=p||m||Yn(b),S=!ie&&!g;if(d){if(S){let e=Fe(v);Oe({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await pt(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}=An(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=kn(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}=ot(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=Kt(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ae,oe,ve,he,pe,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(le=++ce,!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&&zn(v[1])?{[v[0]]:v[1].error}:null,...On(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&&se.set(e.key,e.controller)});let ee=()=>E.forEach(e=>Qe(e.key));D&&D.signal.addEventListener(`abort`,ee);let{loaderResults:te,fetcherResults:ne}=await He(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener(`abort`,ee),E.forEach(e=>se.delete(e.key));let re=Mn(te);if(re)return await Be(t,re.result,!0,{replace:h}),{shortCircuited:!0};if(re=Mn(ne),re)return pe.add(re.key),await Be(t,re.result,!0,{replace:h}),{shortCircuited:!0};let O=new Map(w.fetchers),{loaderData:k,errors:ue}=En(w,i,te,v,E,ne,O);g&&w.errors&&(ue={...w.errors,...ue});let de=et(O),fe=tt(le,O),me=de||fe||E.length>0;return{matches:i,loaderData:k,errors:ue,...me?{workingFetchers:O}:{}}}function Fe(e){if(e&&!zn(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=Qn(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=Wt(w.location,w.matches,c,r,n,i?.relative),u=Te(o,l,c,!1,s.branches),d=ft(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Ke(t,n,jn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=Gt(!0,l,i);if(m){Ke(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new ge,g=(i&&i.preventScrollReset)===!0;if(p&&Kn(p.formMethod)){await Re(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}he.set(t,{routeId:n,path:f}),await ze(t,n,f,u,h,d.active,a,g,p)}async function Re(t,n,i,l,u,d,f,p,m,h){Ue(),he.delete(t),We(t,$n(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=xn(e.history,i,g.signal,m);if(d){let e=await pt(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ke(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{Ke(t,n,jn(404,{pathname:i}),{flushSync:f});return}}let v=Jn(l,i);if(!v.route.action&&!v.route.lazy){Ke(t,n,jn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}se.set(t,g);let y=ce,b=fn(a,o,_,i,l,v,r,u),x=await Ve(_,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){se.get(t)===g&&se.delete(t);return}if(ve.has(t)){if(Bn(S)||zn(S)){We(t,er(void 0));return}}else{if(Bn(S))if(se.delete(t),le>y){We(t,er(void 0));return}else return pe.add(t),We(t,Qn(m)),Be(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(zn(S)){Ke(t,n,S.error);return}}let C=w.navigation.location||w.location,E=xn(e.history,C,g.signal),ee=s.activeRoutes,te=w.navigation.state===`idle`?w.matches:Te(ee,w.navigation.location,c,!1,s.branches);O(te,`Didn't find any matches after fetcher action`);let ne=++ce;de.set(t,ne);let{dsMatches:re,revalidatingFetchers:ie}=Kt(E,u,a,o,e.history,w,te,m,C,r,!1,ae,oe,ve,he,pe,ee,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),k=Qn(m,S.data),ue=new Map(w.fetchers);ue.set(t,k),ie.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=ue.get(t),r=Qn(void 0,n?n.data:void 0);ue.set(t,r),Qe(t),e.controller&&se.set(t,e.controller)}),Oe({fetchers:ue});let fe=()=>ie.forEach(e=>Qe(e.key));g.signal.addEventListener(`abort`,fe);let{loaderResults:me,fetcherResults:ge}=await He(re,ie,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,fe),de.delete(t),se.delete(t),ie.forEach(e=>se.delete(e.key));let _e=w.fetchers.has(t),ye=e=>{if(!_e)return e;let n=new Map(e.fetchers);return n.set(t,er(S.data)),{...e,fetchers:n}},be=Mn(me);if(be)return w=ye(w),Be(E,be.result,!1,{preventScrollReset:p});if(be=Mn(ge),be)return pe.add(be.key),w=ye(w),Be(E,be.result,!1,{preventScrollReset:p});let xe=new Map(w.fetchers);_e&&xe.set(t,er(S.data));let{loaderData:Se,errors:Ce}=En(w,te,me,void 0,ie,ge,xe);tt(ne,xe),w.navigation.state===`loading`&&ne>le?(O(T,`Expected pending action`),D&&D.abort(),ke(w.navigation.location,{matches:te,loaderData:Se,errors:Ce,fetchers:xe})):(Oe({errors:Ce,loaderData:Dn(w.loaderData,Se,te,Ce),fetchers:xe}),ae=!1)}async function ze(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);We(t,Qn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=xn(e.history,i,m.signal);if(l){let e=await pt(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ke(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{Ke(t,n,jn(404,{pathname:i}),{flushSync:u});return}}let g=Jn(s,i);se.set(t,m);let _=ce,v=await Ve(h,i,fn(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(se.get(t)===m&&se.delete(t),!h.signal.aborted){if(ve.has(t)){We(t,er(void 0));return}if(Bn(y))if(le>_){We(t,er(void 0));return}else{pe.add(t),await Be(h,y,!1,{preventScrollReset:d});return}if(zn(y)){Ke(t,n,y.error);return}We(t,er(y.data))}}async function Be(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ae=!0);let d=i.response.headers.get(`Location`);O(d,`Expected a Location header on the redirect Response`),d=bn(d,new URL(r.url),c,e.history);let f=ue(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(qe(d)){let n=me(t,d,!0);e=n.origin!==t.location.origin||Ge(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}D=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=Yn(w.navigation));let _=o||s;At.has(i.response.status)&&_&&Kn(_.formMethod)?await Me(p,f,{submission:{..._,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?te:void 0}):await Me(p,f,{overrideNavigation:Xn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?te:void 0})}async function Ve(e,t,n,r,i){let a,o={};try{a=await pn(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(!Kn(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(Rn(r)){let i=r.result;o[t]={type:`redirect`,response:_n(i,e,t,n,c)}}else o[t]=await gn(r);return o}async function He(e,t,n,r,i){let a=Ve(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Ve(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:jn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ue(){ae=!0,he.forEach((e,t)=>{se.has(t)&&oe.add(t),Qe(t)})}function We(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),Oe({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ke(e,t,n,r={}){let i=kn(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 _e.set(e,(_e.get(e)||0)+1),ve.has(e)&&ve.delete(e),w.fetchers.get(e)||Mt}function Ye(e,t){Qe(e,t?.reason),We(e,er(null))}function Xe(e,t){let n=w.fetchers.get(t);se.has(t)&&!(n&&n.state===`loading`&&de.has(t))&&Qe(t),he.delete(t),de.delete(t),pe.delete(t),ve.delete(t),oe.delete(t),e.delete(t)}function Ze(e){let t=(_e.get(e)||0)-1;t<=0?(_e.delete(e),ve.add(e)):_e.set(e,t),Oe({fetchers:new Map(w.fetchers)})}function Qe(e,t){let n=se.get(e);n&&(n.abort(t),se.delete(e))}function $e(e,t){for(let n of e){let e=t.get(n);O(e,`Expected fetcher: ${n}`);let r=er(e.data);t.set(n,r)}}function et(e){let t=[],n=!1;for(let r of pe){let i=e.get(r);O(i,`Expected fetcher: ${r}`),i.state===`loading`&&(pe.delete(r),t.push(r),n=!0)}return $e(t,e),n}function tt(e,t){let n=[];for(let[r,i]of de)if(i<e){let e=t.get(r);O(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Qe(r),de.delete(r),n.push(r))}return $e(n,t),n.length>0}function nt(e,t){let n=w.blockers.get(e)||Nt;return ye.get(e)!==t&&ye.set(e,t),n}function rt(e){w.blockers.delete(e),ye.delete(e)}function it(e,t){let n=w.blockers.get(e)||Nt;O(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 at({currentLocation:e,nextLocation:t,historyAction:n}){if(ye.size===0)return;ye.size>1&&k(!1,`A router only supports one blocker at a time`);let r=Array.from(ye.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 ot(e){let t=jn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=An(n);return{notFoundMatches:r,route:i,error:t}}function st(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===jt){_=!0;let e=dt(w.location,w.matches);e!=null&&Oe({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function ct(e,t){return h&&h(e,t.map(e=>Ee(e,w.loaderData)))||e.key}function lt(e,t){if(m&&g){let n=ct(e,t);m[n]=g()}}function dt(e,t){if(m){let n=ct(e,t),r=m[n];if(typeof r==`number`)return r}return null}function ft(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:Te(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Te(n,r,c,!0,e)}}return{active:!1,matches:null}}async function pt(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||Qt(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=Te(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=Te(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&mt(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=Te(s.activeRoutes,n,c,!0,u),!f||mt(l,f))return{type:`success`,matches:null};l=f}}function mt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function _t(e){o={},s.setHmrRoutes(Se(e,a,void 0,o))}function vt(e,t,n=!1){Qt(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:Ce,subscribe:De,enableScrollRestoration:st,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:we,getBlocker:nt,deleteBlocker:rt,patchRoutes:vt,_internalFetchControllers:se,_internalSetRoutes:_t,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){Oe(e)}},e.instrumentations&&(C=gt(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Ut(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Wt(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=$e(r||`.`,Qe(o),Ge(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=qn(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=Ke({basename:n,pathname:c.pathname})),de(c)}function Gt(e,t,n){if(!n||!Ut(n))return{path:t};if(n.formMethod&&!Gn(n.formMethod))return{path:t,error:jn(405,{method:n.formMethod})};let r=()=>({path:t,error:jn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Nn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Kn(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}
10
+ `,``):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(!Kn(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()}}}O(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Cn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Cn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=wn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=wn(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(Kn(c.formMethod))return{path:t,submission:c};let l=fe(t);return e&&l.search&&qn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:de(l),submission:c}}function Kt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?zn(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&&zn(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,D={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},te=dt(o),ne=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(!qt(s))f=!1;else if(u){let{shouldLoad:e}=Jt(s,a.loaderData,a.errors);f=e}else Yt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return dn(n,r,e,c,te,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?Xt(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return dn(n,r,e,c,te,i,l,t,Zt(i,m),m,x)}),re=[];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=Te(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;re.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=Jn(b,e.path),C=new AbortController,w=xn(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=fn(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=fn(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:ee?!1:d;let a={...D,defaultShouldRevalidate:i};Zt(S,a)&&(T=fn(n,r,w,e.path,b,S,l,t,a))}T&&re.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:ne,revalidatingFetchers:re}}function qt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Jt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!qt(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 Yt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Xt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Zt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Qt(e,t,n,r,i,a){let o;if(e){let t=r[e];O(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=>$t(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Se(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]=Se([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 $t(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=>$t(e,t)))??!1:!1}var en=new WeakMap,tn=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(O(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=en.get(i);o||(o={},en.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=ve(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)k(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)k(!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},nn=new WeakMap;function rn(e,t,n,r,i){let a=n[e.id];if(O(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=nn.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{O(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=be(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?k(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?k(!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 nn.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=tn({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 an(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 on(e){return e.matches.some(e=>e.route.middleware)?sn(e,()=>an(e)):an(e)}function sn(e,t){return cn(e,t,e=>{if(Wn(e))throw e;return e},In,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=kn(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 cn(e,t,n,r,i){let{matches:a,...o}=e;return await ln(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function ln(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 ln(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 un(e,t,n,r,i){let a=tn({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=rn(r.route,Kn(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function dn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=un(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Zt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Zt(a,{...l,defaultShouldRevalidate:e}):Zt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Kn(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Kn(n.method)||!p)?mn({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 fn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?dn(e,t,n,r,dt(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:un(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function pn(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:Sn(t,n),pattern:dt(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 sn(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 mn({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Kn(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:Sn(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 jn(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 jn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function hn(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 gn(e){let{result:t,type:n}=e;if(Hn(t)){let e;try{e=await hn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new lt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Vn(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:Fn(t),statusCode:ut(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:ut(t)?t.status:void 0}:Vn(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 _n(e,t,n,r,i){let a=e.headers.get(`Location`);if(O(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!qe(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Wt(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var vn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function yn(e){try{return vn.includes(new URL(e).protocol)}catch{return!1}}function bn(e,t,n,r){if(qe(e)){let r=e,i=re.test(r)?new URL(ie(r,t.protocol)):new URL(r);if(yn(i.toString()))throw Error(`Invalid redirect location`);let a=Ge(i.pathname,n)!=null;if(i.origin===t.origin&&a)return et(i.pathname)+i.search+i.hash}try{if(yn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function xn(e,t,n,r){let i=e.createURL(Nn(t)).toString(),a={signal:n};if(r&&Kn(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=Cn(r.formData):a.body=r.formData}return new Request(i,a)}function Sn(e,t){let n=new URL(e.url),r=typeof t==`string`?fe(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 Cn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function wn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Tn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&zn(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(O(!Bn(f),`Cannot handle redirect results in processLoaderData`),zn(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=kn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=It),c||(c=!0,s=ut(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 En(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Tn(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(O(s,`Did not find corresponding fetcher result`),zn(s)){let t=kn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Bn(s))O(!1,`Unhandled fetcher revalidation redirect`);else{let e=er(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Dn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==It).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 On(e){return e?zn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function kn(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 An(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 jn(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 lt(e||500,o,Error(s),!0)}function Mn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Bn(r))return{key:n,result:r}}}function Nn(e){return de({...typeof e==`string`?fe(e):e,hash:``})}function Pn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function Fn(e){return new lt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function In(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Ln(t))}function Ln(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Rn(e){return Hn(e.result)&&kt.has(e.result.status)}function zn(e){return e.type===`error`}function Bn(e){return(e&&e.type)===`redirect`}function Vn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Hn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Un(e){return kt.has(e)}function Wn(e){return Hn(e)&&Un(e.status)&&e.headers.has(`Location`)}function Gn(e){return Ot.has(e.toUpperCase())}function Kn(e){return Et.has(e.toUpperCase())}function qn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Jn(e,t){let n=typeof t==`string`?fe(t).search:t.search;if(e[e.length-1].route.index&&qn(n||``))return e[e.length-1];let r=Ze(e);return r[r.length-1]}function Yn(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 Xn(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 Zn(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 Qn(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 $n(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 er(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 tr(e,t){try{let n=e.sessionStorage.getItem(Ft);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 nr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Ft,JSON.stringify(n))}catch(e){k(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function rr(){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 ir=v.createContext(null);ir.displayName=`DataRouter`;var ar=v.createContext(null);ar.displayName=`DataRouterState`;var or=v.createContext(!1);function sr(){return v.useContext(or)}var cr=v.createContext({isTransitioning:!1});cr.displayName=`ViewTransition`;var lr=v.createContext(new Map);lr.displayName=`Fetchers`;var ur=v.createContext(null);ur.displayName=`Await`;var dr=v.createContext(null);dr.displayName=`Navigation`;var fr=v.createContext(null);fr.displayName=`Location`;var pr=v.createContext({outlet:null,matches:[],isDataRoute:!1});pr.displayName=`Route`;var mr=v.createContext(null);mr.displayName=`RouteError`;var hr=`REACT_ROUTER_ERROR`,gr=`REDIRECT`,_r=`ROUTE_ERROR_RESPONSE`;function vr(e){if(e.startsWith(`${hr}:${gr}:{`))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 yr(e){if(e.startsWith(`${hr}:${_r}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new lt(t.status,t.statusText,t.data)}catch{}}function br(e,{relative:t}={}){O(xr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(dr),{hash:i,pathname:a,search:o}=Dr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:tt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function xr(){return v.useContext(fr)!=null}function Sr(){return O(xr(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(fr).location}var Cr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function wr(e){v.useContext(dr).static||v.useLayoutEffect(e)}function Tr(){let{isDataRoute:e}=v.useContext(pr);return e?qr():Er()}function Er(){O(xr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(ir),{basename:t,navigator:n}=v.useContext(dr),{matches:r}=v.useContext(pr),{pathname:i}=Sr(),a=JSON.stringify(Qe(r)),o=v.useRef(!1);return wr(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(k(o.current,Cr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=$e(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:tt([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function Dr(e,{relative:t}={}){let{matches:n}=v.useContext(pr),{pathname:r}=Sr(),i=JSON.stringify(Qe(n));return v.useMemo(()=>$e(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Or(e,t,n){O(xr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(dr),{matches:i}=v.useContext(pr),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||``;Yr(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.
11
+
12
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Sr(),d;if(t){let e=typeof t==`string`?fe(t):t;O(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):we(e,{pathname:p});k(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),k(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Fr(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:tt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:tt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?v.createElement(fr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function kr(){let e=Wr(),t=ut(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=v.createElement(v.Fragment,null,v.createElement(`p`,null,`💿 Hey developer 👋`),v.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,v.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,v.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:i},n):null,o)}var Ar=v.createElement(kr,null),jr=class extends v.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=yr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(pr.Provider,{value:this.props.routeContext},v.createElement(mr.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(Nr,{error:e},t):t}};jr.contextType=or;var Mr=new WeakMap;function Nr({children:e,error:t}){let{basename:n}=v.useContext(dr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=vr(t.digest);if(e){let r=Mr.get(t);if(r)throw r;let i=pt(e.location,n),a=i.absoluteURL||i.to;if(yn(a))throw Error(`Invalid redirect location`);if(ft&&!Mr.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 Mr.set(t,n),n}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Pr({routeContext:e,match:t,children:n}){let r=v.useContext(ir);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(pr.Provider,{value:e},n)}function Fr(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);O(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:dt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Ar,o&&(s<0&&c===0?(Yr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(Pr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(jr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Ir(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lr(e){let t=v.useContext(ir);return O(t,Ir(e)),t}function Rr(e){let t=v.useContext(ar);return O(t,Ir(e)),t}function zr(e){let t=v.useContext(pr);return O(t,Ir(e)),t}function Br(e){let t=zr(e),n=t.matches[t.matches.length-1];return O(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Vr(){return Br(`useRouteId`)}function Hr(){let e=Rr(`useNavigation`);return v.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Ur(){let{matches:e,loaderData:t}=Rr(`useMatches`);return v.useMemo(()=>e.map(e=>Ee(e,t)),[e,t])}function Wr(){let e=v.useContext(mr),t=Rr(`useRouteError`),n=Br(`useRouteError`);return e===void 0?t.errors?.[n]:e}var Gr=0;function Kr(e){let{router:t,basename:n}=Lr(`useBlocker`),r=Rr(`useBlocker`),[i,a]=v.useState(``),o=v.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:Ge(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:Ge(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return v.useEffect(()=>{let e=String(++Gr);return a(e),()=>t.deleteBlocker(e)},[t]),v.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):Nt}function qr(){let{router:e}=Lr(`useNavigate`),t=Br(`useNavigate`),n=v.useRef(!1);return wr(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{k(n.current,Cr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Jr={};function Yr(e,t,n){!t&&!Jr[e]&&(Jr[e]=!0,k(!1,n))}var Xr={};function Zr(e,t){!e&&!Xr[t]&&(Xr[t]=!0,console.warn(t))}var Qr=v.useOptimistic,$r=()=>void 0;function ei(e){return Qr?Qr(e):[e,$r]}function ti(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&k(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&k(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&k(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var ni=[`HydrateFallback`,`hydrateFallbackElement`],ri=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 ii({router:e,flushSync:t,onError:n,useTransitions:r}){r=sr()||r;let[i,a]=v.useState(e.state),[o,s]=ei(i),[c,l]=v.useState(),[u,d]=v.useState({isTransitioning:!1}),[f,p]=v.useState(),[m,h]=v.useState(),[g,_]=v.useState(),y=v.useRef(new Map),b=v.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:dt(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),Zr(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(Zr(g==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."),!g||!b){t&&u?t(()=>a(i)):r===!1?a(i):v.startTransition(()=>{r===!0&&s(e=>ai(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);v.useLayoutEffect(()=>e.subscribe(b),[e,b]),v.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new ri)},[u]),v.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):v.startTransition(()=>{r===!0&&s(e=>ai(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),v.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),v.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let x=v.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=v.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return v.createElement(v.Fragment,null,v.createElement(ir.Provider,{value:C},v.createElement(ar.Provider,{value:o},v.createElement(lr.Provider,{value:y.current},v.createElement(cr.Provider,{value:u},v.createElement(ci,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},v.createElement(oi,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function ai(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 oi=v.memo(si);function si({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Or(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function ci({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){O(!xr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=fe(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=Ge(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return k(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:v.createElement(dr.Provider,{value:c},v.createElement(fr.Provider,{children:t,value:h}))}v.Component;var li=`get`,ui=`application/x-www-form-urlencoded`;function di(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function fi(e){return di(e)&&e.tagName.toLowerCase()===`button`}function pi(e){return di(e)&&e.tagName.toLowerCase()===`form`}function mi(e){return di(e)&&e.tagName.toLowerCase()===`input`}function hi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function gi(e,t){return e.button===0&&(!t||t===`_self`)&&!hi(e)}var _i=null;function vi(){if(_i===null)try{new FormData(document.createElement(`form`),0),_i=!1}catch{_i=!0}return _i}var yi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function bi(e){return e!=null&&!yi.has(e)?(k(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ui}"`),null):e}function xi(e,t){let n,r,i,a,o;if(pi(e)){let o=e.getAttribute(`action`);r=o?Ge(o,t):null,n=e.getAttribute(`method`)||li,i=bi(e.getAttribute(`enctype`))||ui,a=new FormData(e)}else if(fi(e)||mi(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?Ge(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||li,i=bi(e.getAttribute(`formenctype`))||bi(o.getAttribute(`enctype`))||ui,a=new FormData(o,e),!vi()){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(di(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=li,r=null,i=ui,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 Si={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ci=/[&><\u2028\u2029]/g;function wi(e){return e.replace(Ci,e=>Si[e])}function Ti(e,t){if(e===!1||e==null)throw Error(t)}function Ei(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&&Ge(i.pathname,t)===`/`?i.pathname=`${nt(t)}/_root.${r}`:i.pathname=`${nt(i.pathname)}.${r}`,i}async function Di(e,t){if(e.id in t)return t[e.id];try{let n=await w(()=>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 Oi(e){return e!=null&&typeof e.page==`string`}function ki(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 Ai(e,t,n){return Fi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Di(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ki).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function ji(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 Mi(e,t,{includeHydrateFallback:n}={}){return Ni(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 Ni(e){return[...new Set(e)]}function Pi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Fi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Oi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Pi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ii(){let e=v.useContext(ir);return Ti(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Li(){let e=v.useContext(ar);return Ti(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ri=v.createContext(void 0);Ri.displayName=`FrameworkContext`;function zi(){let e=v.useContext(Ri);return Ti(e,`You must render this element inside a <HydratedRouter> element`),e}function Bi(e,t){let n=v.useContext(Ri),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Vi(s,p),onBlur:Vi(c,m),onMouseEnter:Vi(l,p),onMouseLeave:Vi(u,m),onTouchStart:Vi(d,p)}]:[a,f,{}]:[!1,f,{}]}function Vi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Hi({page:e,...t}){let n=sr(),{nonce:r}=zi(),{router:i}=Ii(),a=v.useMemo(()=>we(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?v.createElement(Wi,{page:e,matches:a,...t}):v.createElement(Gi,{page:e,matches:a,...t})):null}function Ui(e){let{manifest:t,routeModules:n}=zi(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return Ai(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Wi({page:e,matches:t,...n}){let r=Sr(),{future:i}=zi(),{basename:a}=Ii(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ei(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 v.createElement(v.Fragment,null,o.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Gi({page:e,matches:t,...n}){let r=Sr(),{future:i,manifest:a,routeModules:o}=zi(),{basename:s}=Ii(),{loaderData:c,matches:l}=Li(),u=v.useMemo(()=>ji(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>ji(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=v.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=Ei(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>Mi(d,a),[d,a]),m=Ui(d);return v.createElement(v.Fragment,null,f.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ki(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var qi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{qi&&(window.__reactRouterVersion=`7.18.2`)}catch{}function Ji(e,t){return Ht({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:se({window:t?.window}),hydrationData:t?.hydrationData||Yi(),routes:e,mapRouteProperties:ti,hydrationRouteProperties:ni,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Yi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Xi(e.errors)}),e}function Xi(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 lt(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&ct.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 Zi({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=v.useState({action:n.action,location:n.location}),o=v.useCallback(e=>{r===!1?a(e):v.startTransition(()=>a(e))},[r]);return v.useLayoutEffect(()=>n.listen(o),[n,o]),v.createElement(ci,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Zi.displayName=`unstable_HistoryRouter`;var Qi=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=v.useContext(dr),y=typeof l==`string`&&ne.test(l),b=pt(l,h);l=b.to;let x=br(l,{relative:r}),S=Sr(),C=null;if(o){let e=$e(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:tt([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=Bi(n,p),ee=aa(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||ee(t)}let te=!(b.isExternal||i),re=v.createElement(`a`,{...p,...E,href:(te?C:void 0)||b.absoluteURL||x,onClick:te?D:e,ref:Ki(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?v.createElement(v.Fragment,null,re,v.createElement(Hi,{page:x})):re});Qi.displayName=`Link`;var $i=v.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=Dr(a,{relative:c.relative}),d=Sr(),f=v.useContext(ar),{navigator:p,basename:m}=v.useContext(dr),h=f!=null&&ha(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=Ge(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(Qi,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});$i.displayName=`NavLink`;var ea=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=li,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(dr),g=ca(),_=la(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&ne.test(s);return v.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?v.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});ea.displayName=`Form`;function ta({getKey:e,storageKey:t,...n}){let r=v.useContext(Ri),{basename:i}=v.useContext(dr),a=Sr(),o=Ur();pa({getKey:e,storageKey:t});let s=v.useMemo(()=>{if(!r||!e)return null;let t=fa(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),v.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${wi(JSON.stringify(t||ua))}, ${wi(JSON.stringify(s))})`}})}ta.displayName=`ScrollRestoration`;function na(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ra(e){let t=v.useContext(ir);return O(t,na(e)),t}function ia(e){let t=v.useContext(ar);return O(t,na(e)),t}function aa(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Tr(),d=Sr(),f=Dr(e,{relative:o});return v.useCallback(p=>{if(gi(p,t)){p.preventDefault();let t=n===void 0?de(d)===de(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var oa=0,sa=()=>`__${String(++oa)}__`;function ca(){let{router:e}=ra(`useSubmit`),{basename:t}=v.useContext(dr),n=Vr(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=xi(e,t);a.navigate===!1?await r(a.fetcherKey||sa(),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 la(e,{relative:t}={}){let{basename:n}=v.useContext(dr),r=v.useContext(pr);O(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Dr(e||`.`,{relative:t})},o=Sr();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:tt([n,a.pathname])),de(a)}var ua=`react-router-scroll-positions`,da={};function fa(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Ge(e.pathname,n)||e.pathname},t)),i??=e.key,i}function pa({getKey:e,storageKey:t}={}){let{router:n}=ra(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=ia(`useScrollRestoration`),{basename:a}=v.useContext(dr),o=Sr(),s=Ur(),c=Hr();v.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),ma(v.useCallback(()=>{if(c.state===`idle`){let t=fa(o,s,a,e);da[t]=window.scrollY}try{sessionStorage.setItem(t||ua,JSON.stringify(da))}catch(e){k(!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`&&(v.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||ua);e&&(da=JSON.parse(e))}catch{}},[t]),v.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(da,()=>window.scrollY,e?(t,n)=>fa(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),v.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{k(!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 ma(e,t){let{capture:n}=t||{};v.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ha(e,{relative:t}={}){let n=v.useContext(cr);O(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ra(`useViewTransitionState`),i=Dr(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ge(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ge(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ve(i.pathname,o)!=null||Ve(i.pathname,a)!=null}function ga(e){return v.createElement(ii,{flushSync:y.flushSync,...e})}var A=e=>typeof e==`string`,_a=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},va=e=>e==null?``:``+e,ya=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},ba=/###/g,xa=e=>e&&e.indexOf(`###`)>-1?e.replace(ba,`.`):e,Sa=e=>!e||A(e),Ca=(e,t,n)=>{let r=A(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Sa(e))return{};let t=xa(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Sa(e)?{}:{obj:e,k:xa(r[i])}},wa=(e,t,n)=>{let{obj:r,k:i}=Ca(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=Ca(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Ca(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Ta=(e,t,n,r)=>{let{obj:i,k:a}=Ca(e,t,Object);i[a]=i[a]||[],i[a].push(n)},Ea=(e,t)=>{let{obj:n,k:r}=Ca(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Da=(e,t,n)=>{let r=Ea(e,n);return r===void 0?Ea(t,n):r},Oa=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?A(e[r])||e[r]instanceof String||A(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Oa(e[r],t[r],n):e[r]=t[r]);return e},ka=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Aa={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},ja=e=>A(e)?e.replace(/[&<>"'\/]/g,e=>Aa[e]):e,Ma=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}},Na=[` `,`,`,`?`,`!`,`;`],Pa=new Ma(20),Fa=(e,t,n)=>{t||=``,n||=``;let r=Na.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Pa.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},Ia=(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},La=e=>e?.replace(/_/g,`-`),Ra={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)}},za=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Ra,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:(A(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)}},Ba=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])})}},Va=class extends Ba{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):A(n)&&i?o.push(...n.split(i)):o.push(n)));let s=Ea(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!A(n)?s:Ia(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),wa(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)(A(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=Ea(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Oa(s,n,i):s={...s,...n},wa(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}},Ha={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}},Ua=Symbol(`i18next/PATH_KEY`);function Wa(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Ua?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Ga(e,t){let{[Ua]:n}=e(Wa()),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 Ka={},qa=e=>!A(e)&&typeof e!=`boolean`&&typeof e!=`number`,Ja=class e extends Ba{constructor(e,t={}){super(),ya([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=za.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=qa(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&&!Fa(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:A(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:A(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=Ga(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Ga(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&&!A(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=qa(E),D=Object.prototype.toString.apply(E);if(y&&E&&ee&&_.indexOf(D)<0&&!(A(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:qa(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&&A(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=A(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&&!A(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=A(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Ha.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 A(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Ga(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&&!A(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(A(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,!Ka[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(Ka[`${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&&!A(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}},Ya=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=za.create(`languageUtils`)}getScriptPartFromCode(e){if(e=La(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=La(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(A(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)),A(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 A(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))):A(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Xa={zero:0,one:1,two:2,few:3,many:4,other:5},Za={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Qa=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=za.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=La(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!`),Za;if(!e.match(/-|_/))return Za;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)=>Xa[e]-Xa[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))}},$a=(e,t,n,r=`.`,i=!0)=>{let a=Da(e,t,n);return!a&&i&&A(n)&&(a=Ia(e,n,r),a===void 0&&(a=Ia(t,n,r))),a},eo=e=>e.replace(/\$/g,`$$$$`),to=class{constructor(e={}){this.logger=za.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?ja:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?ka(i):a||`{{`,this.suffix=o?ka(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?ka(d):f||ka(`$t(`),this.nestingSuffix=p?ka(p):m||ka(`)`),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=$a(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($a(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=>eo(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?eo(this.escape(e)):eo(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=A(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!A(a)&&!this.useRawValueToEscape&&(a=va(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(`${ka(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&&!A(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&&!A(i))return i;A(i)||(i=va(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}},no=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}},ro=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(La(r),i),t[o]=s),s(n)}},io=e=>(t,n,r)=>e(La(n),r)(t),ao=class{constructor(e={}){this.logger=za.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?ro:io;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()]=ro(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}=no(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)}},oo=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},so=class extends Ba{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=za.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=>{Ta(n.loaded,[i],a),oo(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();A(e)&&(e=this.languageUtils.toResolveHierarchy(e)),A(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)}}},co=()=>({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]),A(e[1])&&(t.defaultValue=e[1]),A(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}),lo=e=>(A(e.ns)&&(e.ns=[e.ns]),A(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),A(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),uo=()=>{},fo=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},po=`__i18next_supportNoticeShown`,mo=()=>!!(typeof globalThis<`u`&&globalThis[po]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),ho=()=>{typeof globalThis<`u`&&(globalThis[po]=!0)},go=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)),_o=class e extends Ba{constructor(e={},t){if(super(),this.options=lo(e),this.services={},this.logger=za,this.modules={external:[]},fo(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&&(A(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=co();this.options={...n,...this.options,...lo(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&&!go(this)&&!mo()&&(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 💙`),ho());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?za.init(r(this.modules.logger),this.options):za.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:ao;let t=new Ya(this.options);this.store=new Va(this.options.resources,this.options);let i=this.services;i.logger=za,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Qa(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 to(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new so(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 Ja(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||=uo,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=_a(),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=uo){let n=t,r=A(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=_a();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||=uo,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`&&Ha.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=_a();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=A(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(A(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=Ga(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Ga(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Ga(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return A(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=_a();return this.options.ns?(A(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=_a();A(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 Ya(co());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=uo){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 Va(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={...co().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new to(n)}return a.translator=new Ja(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();_o.createInstance,_o.dir,_o.init,_o.loadResources,_o.reloadResources,_o.use,_o.changeLanguage,_o.getFixedT,_o.t,_o.exists,_o.setDefaultNamespace,_o.hasLoadedNamespace,_o.loadNamespaces,_o.loadLanguages;var vo=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),yo=o(((e,t)=>{t.exports=vo()})),bo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,xo={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},So=e=>xo[e],j={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(bo,So),transDefaultProps:void 0},Co=(e={})=>{j={...j,...e}},wo=()=>j,To,Eo=e=>{To=e},Do=()=>To,Oo={type:`3rdParty`,init(e){Co(e.options.react),Eo(e)}},ko=(0,v.createContext)(),Ao=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},jo=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);Ro(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},Mo={},No=(e,t,n,r)=>{Ro(n)&&Mo[n]||(Ro(n)&&(Mo[n]=new Date),jo(e,t,n,r))},Po=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},Fo=(e,t,n)=>{e.loadNamespaces(t,Po(e,n))},Io=(e,t,n,r)=>{if(Ro(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Fo(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Po(e,r))},Lo=(e,t,n={})=>!t.languages||!t.languages.length?(No(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),Ro=e=>typeof e==`string`,zo=e=>typeof e==`object`&&!!e,Bo=yo(),Vo={t:(e,t)=>{if(Ro(t))return t;if(zo(t)&&Ro(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},Ho=()=>()=>{},Uo=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,v.useContext)(ko)||{},a=n||r||Do();a&&!a.reportNamespaces&&(a.reportNamespaces=new Ao),a||No(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=(0,v.useMemo)(()=>({...wo(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=Ro(l)?[l]:l||[`translation`],d=(0,v.useMemo)(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=(0,v.useRef)(0),p=(0,v.useCallback)(e=>{if(!a)return Ho;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=(0,v.useRef)(),h=(0,v.useCallback)(()=>{if(!a)return Vo;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>Lo(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=(0,v.useState)(0),{t:y,ready:b}=(0,Bo.useSyncExternalStore)(p,h,h);(0,v.useEffect)(()=>{if(a&&!b&&!s){let e=()=>_(e=>e+1);t.lng?Io(a,t.lng,d,e):Fo(a,d,e)}},[a,t.lng,d,b,s,g]);let x=a||{},S=(0,v.useRef)(null),C=(0,v.useRef)(),w=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},T=(0,v.useMemo)(()=>{let e=x,t=e?.language,n=e;e&&(S.current&&S.current.__original===e&&C.current===t?n=S.current:(n=w(e),S.current=n,C.current=t));let r=!b&&!s?(...e)=>(No(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),y(...e)):y,i=[r,n,b];return i.t=r,i.i18n=n,i.ready=b,i},[y,x,b,x.resolvedLanguage,x.language,x.languages]);if(a&&s&&!b)throw new Promise(e=>{let n=()=>e();t.lng?Io(a,t.lng,d,n):Fo(a,d,n)});return T},Wo={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.reload":`Reload`,"refresh.reloadRequired":`Reload NiceEval View`,"refresh.reloadRequiredDetail":`The refresh result could not be confirmed. Reload before continuing to review results.`,"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.reload":`重新加载`,"refresh.reloadRequired":`重新加载 NiceEval 视图`,"refresh.reloadRequiredDetail":`无法确认刷新结果。请先重新加载,再继续审阅结果。`,"refresh.working":`正在刷新…`,"refresh.selectionChanged":`之前的选择已不存在,现已显示最近的可用结果。`}}},Go=`niceeval:report:locale`;_o.use(Oo).init({resources:Wo,lng:(()=>{try{let e=localStorage.getItem(Go);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}),_o.on(`languageChanged`,e=>{document.documentElement.lang=e;try{localStorage.setItem(Go,e)}catch{}}),document.documentElement.lang=_o.resolvedLanguage??`en`;var Ko=_o,qo=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Jo=o(((e,t)=>{t.exports=qo()})),M=Jo(),Yo=v.createContext(void 0),Xo=e=>{let t=v.useContext(Yo);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Zo=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,M.jsx)(Yo.Provider,{value:e,children:t})),Qo=v.createContext(!1),$o=()=>v.useContext(Qo);Qo.Provider;function es(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ts=v.createContext(es()),ns=()=>v.useContext(ts),rs={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},is=new class{#e=rs;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 as(e){setTimeout(e,0)}var os=typeof window>`u`||`Deno`in globalThis;function ss(){}function cs(e,t){return typeof e==`function`?e(t):e}function ls(e){return typeof e==`number`&&e>=0&&e!==1/0}function us(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ds(e,t){return typeof e==`function`?e(t):e}function fs(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ms(o,t.options))return!1}else if(!gs(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 ps(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(hs(t.options.mutationKey)!==hs(a))return!1}else if(!gs(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ms(e,t){return(t?.queryKeyHashFn||hs)(e)}function hs(e){return JSON.stringify(e,(e,t)=>xs(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function gs(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(!gs(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!gs(e[r],t[r]))return!1;return!0}return!1}var _s=Object.prototype.hasOwnProperty;function vs(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=bs(e)&&bs(t);if(!r&&!(xs(e)&&xs(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:_s.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=vs(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ys(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 bs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xs(e){if(!Ss(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ss(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ss(e){return Object.prototype.toString.call(e)===`[object Object]`}function Cs(e){return new Promise(t=>{is.setTimeout(t,e)})}function ws(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:vs(e,t)}function Ts(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Es(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ds=Symbol();function Os(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ds?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ks(e,t){return typeof e==`function`?e(...t):!!e}function As(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 js=as;function Ms(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=js,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 Ns=Ms(),Ps=()=>os,Fs=()=>Ps(),Is=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(){}},Ls=new class extends Is{#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`}},Rs=new class extends Is{#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 zs(e){return Math.min(1e3*2**e,3e4)}function Bs(e){return(e??`online`)===`online`?Rs.isOnline():!0}var Vs=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Hs(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(ss);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Vs(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ls.isFocused()&&(e.networkMode===`always`||Rs.isOnline())&&e.canRun(),p=()=>Bs(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??(Fs()?0:3),a=e.retryDelay??zs,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),Cs(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 Us=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ls(this.gcTime)&&(this.#e=is.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fs()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(is.clearTimeout(this.#e),this.#e=void 0)}};function Ws(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=>{As(e,()=>t.signal,()=>n=!0)},u=Os(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?Es:Ts;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ks:Gs,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:Gs(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 Gs(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 Ks(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var qs=class extends Us{#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=Xs(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=Xs(this.options);e.data!==void 0&&(this.setState(Ys(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ws(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(ss).catch(ss):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=>ds(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ds||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ds(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:!us(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=Os(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`?Ws(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=Hs({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Vs&&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 Vs){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,...Js(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ys(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),Ns.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Js(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bs(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ys(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Xs(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 Zs=class extends Is{#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 ec(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ec(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 ds(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&&!ys(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&tc(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||ds(this.options.enabled,this.#t)!==ds(t.enabled,this.#t)||ds(this.options.staleTime,this.#t)!==ds(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||ds(this.options.enabled,this.#t)!==ds(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 ys(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(ss)),t}#h(e){return!Fs()&&ds(this.options.enabled,this.#t)!==!1&&ls(e)}#g(){this.#b();let e=ds(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=us(this.#r.dataUpdatedAt,e)+1;this.#u=is.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=is.setInterval(()=>{(this.options.refetchIntervalInBackground||Ls.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(is.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(is.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&&tc(e,n,t,r);(a||o)&&(l={...l,...Js(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=ws(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=ws(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:nc(e,t),refetch:this.refetch,isEnabled:ds(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),ys(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)})})();Ns.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 Qs(e,t){return ds(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&ds(t.retryOnMount,e)===!1)}function $s(e,t){return Qs(e,t)||e.state.data!==void 0&&ec(e,t,t.refetchOnMount)}function ec(e,t,n){if(ds(t.enabled,e)!==!1&&ds(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&nc(e,t)}return!1}function tc(e,t,n,r){return(e!==t||ds(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&nc(e,n)}function nc(e,t){return ds(t.enabled,e)!==!1&&e.isStaleByTime(ds(t.staleTime,e))}function rc(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var ic=class extends Is{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,Ns.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!ys(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(rc(e,n).forEach(e=>{e.destroy()}),rc(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=vs(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Zs(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&Ns.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},ac=class extends Us{#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||oc(),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=Hs({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),Ns.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function oc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var sc=class extends Is{#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 ac({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=cc(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=cc(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=cc(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=cc(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Ns.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=>ps(t,e))}findAll(e={}){return this.getAll().filter(t=>ps(e,t))}notify(e){Ns.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Ns.batch(()=>Promise.all(e.map(e=>e.continue().catch(ss))))}};function cc(e){return e.options.scope?.id}var lc=class extends Is{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??ms(r,t),a=this.get(i);return a||(a=new qs({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(){Ns.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=>fs(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>fs(e,t)):t}notify(e){Ns.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ns.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ns.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},uc=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new lc,this.#t=e.mutationCache||new sc,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ls.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Rs.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(ds(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=cs(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ns.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;Ns.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Ns.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=Ns.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(ss).catch(ss)}invalidateQueries(e,t={}){return Ns.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=Ns.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(ss)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(ss)}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(ds(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(ds(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ss).catch(ss)}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(ss).catch(ss)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Rs.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(hs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{gs(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(hs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{gs(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||=ms(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===Ds&&(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()}},dc=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ks(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},fc=e=>{v.useEffect(()=>{e.clearReset()},[e])},pc=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ks(n,[e.error,r])),mc=(e,t)=>t.state.data===void 0,hc=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))}},gc=(e,t)=>e?.suspense&&t.isPending,_c=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vc({queries:e,...t},n){let r=Xo(n),i=$o(),a=ns(),o=t.subscribed!==!1,s=v.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{hc(e),dc(e,a,r.getQueryCache().get(e.queryHash))}),fc(a);let[c]=v.useState(()=>new ic(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;v.useSyncExternalStore(v.useCallback(e=>f?c.subscribe(Ns.batchCalls(e)):ss,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),v.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>gc(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&gc(n,e)?_c(n,new Zs(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&pc({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function yc(e,t,n){let r=$o(),i=ns(),a=Xo(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,hc(o),dc(o,i,s),fc(i);let[l]=v.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(v.useSyncExternalStore(v.useCallback(e=>{let t=d?l.subscribe(Ns.batchCalls(e)):ss;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o)},[o,l]),gc(o,u))throw _c(o,l,i);if(pc({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function bc(e,t){return yc(e,Zs,t)}function xc(e,t){return yc({...e,enabled:!0,suspense:!0,throwOnError:mc,placeholderData:void 0},Zs,t)}function Sc(e){return e}var Cc=(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}}},wc={pipe(){return Cc(this,arguments)}},Tc=function(){function e(){}return e.prototype=wc,e}(),Ec=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)}}}},Dc=e=>e,Oc=(e=>()=>e)(void 0),kc=Oc;function Ac(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 jc(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 Mc=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},Nc=new WeakSet;function Pc(e){return typeof e==`string`}function Fc(e){return typeof e==`number`}function Ic(e){return typeof e==`boolean`}function Lc(e){return typeof e==`symbol`}function Rc(e){return Pc(e)||Fc(e)||Lc(e)}function zc(e){return typeof e==`function`}function Bc(e){return e!==void 0}function Vc(e){return e!=null}function Hc(e){return!1}function Uc(e){return!0}function Wc(e){return typeof e==`object`&&!!e||zc(e)}var Gc=Ec(2,(e,t)=>Wc(e)&&t in e),Kc=`~effect/interfaces/Hash`,qc=e=>{switch(typeof e){case`number`:return Qc(e);case`bigint`:return $c(e.toString(10));case`boolean`:return $c(String(e));case`symbol`:return $c(String(e));case`string`:return $c(e);case`undefined`:return $c(`undefined`);case`function`:case`object`:if(e===null)return $c(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?$c(`Invalid Date`):$c(e.toISOString());if(e instanceof RegExp)return $c(e.toString());{if(Nc.has(e))return Jc(e);if(sl.has(e))return sl.get(e);let t=ll(e,()=>Zc(e)?e[Kc]():typeof e==`function`?Jc(e):e instanceof DataView?rl(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?rl(e):e instanceof Map?il(e):e instanceof Set?al(e):tl(e));return sl.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Jc=e=>(ol.has(e)||ol.set(e,Qc(Math.floor(Math.random()*(2**53-1)))),ol.get(e)),Yc=Ec(2,(e,t)=>e*53^t),Xc=e=>e&3221225471|e>>>1&1073741824,Zc=e=>Gc(e,Kc),Qc=e=>{if(e!==e)return $c(`NaN`);if(e===1/0)return $c(`Infinity`);if(e===-1/0)return $c(`-Infinity`);let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Xc(t)},$c=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Xc(t)},el=(e,t)=>{let n=12289;for(let r of t)n^=Yc(qc(r),qc(e[r]));return Xc(n)},tl=e=>el(e,Mc(e)),nl=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Xc(r)},rl=nl(6151,qc),il=nl($c(`Map`),([e,t])=>Yc(qc(e),qc(t))),al=nl($c(`Set`),qc),ol=new WeakMap,sl=new WeakMap,cl=new WeakSet;function ll(e,t){if(cl.has(e))return $c(`[Circular]`);cl.add(e);let n=t();return cl.delete(e),n}var ul=`~effect/interfaces/Equal`;function dl(){return arguments.length===1?e=>fl(e,arguments[0]):fl(arguments[0],arguments[1])}function fl(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`||Nc.has(e)||Nc.has(t)?!1:_l(e,t,gl):!1}function pl(e,t,n){let r=ml.has(e),i=hl.has(t);if(r&&i)return!0;if(r||i)return!1;ml.add(e),hl.add(t);let a=n();return ml.delete(e),hl.delete(t),a}var ml=new WeakSet,hl=new WeakSet;function gl(e,t){if(qc(e)!==qc(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=El(e),r=El(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:pl(e,t,()=>{if(i)return e[ul](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:yl(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 bl(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return bl(e,t)}else if(e instanceof Map)return!(t instanceof Map)||e.size!==t.size?!1:Cl(e,t);else if(e instanceof Set)return!(t instanceof Set)||e.size!==t.size?!1:Tl(e,t);return xl(e,t)})}function _l(e,t,n){let r=vl.get(e);if(!r)r=new WeakMap,vl.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=vl.get(t);return a||(a=new WeakMap,vl.set(t,a)),a.set(e,i),i}var vl=new WeakMap;function yl(e,t){for(let n=0;n<e.length;n++)if(!fl(e[n],t[n]))return!1;return!0}function bl(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 xl(e,t){let n=Mc(e),r=Mc(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!fl(e[i],t[i]))return!1;return!0}function Sl(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 Cl=Sl(fl,fl);function wl(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 Tl=wl(fl),El=e=>Gc(e,ul),Dl=Symbol.for(`~effect/Redactable`),Ol=e=>Gc(e,Dl);function kl(e){return Ol(e)?Al(e):e}function Al(e){return e[Dl](globalThis[`~effect/Fiber/currentFiber`]?.context??Nl)}var jl=`~effect/Fiber/currentFiber`,Ml=new Map,Nl={"~effect/Context":{},base:Ml,depth:0,mapUnsafe:Ml,pipe(){return Cc(this,arguments)}};function Pl(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 Fl;r.add(e);let l;if(Dl in e)l=c(Al(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(`,
13
+ `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Rl(e);else if(!t?.ignoreToString&&Gc(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=zl(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=>`${Il(t)}:${c(e[t],n)}`).join(`,`)}}`):o(e,`{\n${t.map(t=>`${a(n+1)}${Il(t)}: ${c(e[t],n+1)}`).join(`,
14
+ `)}\n${a(n)}}`)}return r.delete(e),l}return String(e)}return c(e,0)}var Fl=`[Circular]`;function Il(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Ll(e){return e.map(e=>`[${Il(e)}]`).join(``)}function Rl(e){try{return e.toISOString()}catch{return`Invalid Date`}}function zl(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}var Bl=Symbol.for(`nodejs.util.inspect.custom`),Vl=e=>{try{return e=kl(e),Gc(e,`toJSON`)&&zc(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(Vl):e}catch{return`[toJSON threw]`}},Hl=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)}},Ul=(()=>{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 Wl(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Gl(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Wl(e,n,t[n])}var Kl=`~effect/Effect`,ql=`~effect/Exit`,Jl={_A:Dc,_E:Dc,_R:Dc},Yl=`${Kl}/identifier`,Xl=`${Kl}/args`,Zl=`${Kl}/evaluate`,N=`${Kl}/successCont`,Ql=`${Kl}/failureCont`,P=`${Kl}/ensureCont`,F=Symbol.for(`effect/Effect/Yield`),$l={pipe(){return Cc(this,arguments)},toJSON(){return{...this}},toString(){return Pl(this.toJSON(),{ignoreToString:!0,space:2})},[Bl](){return this.toJSON()}},eu={[Kl]:Jl,...$l,[Symbol.iterator](){return new Hl(this)},toJSON(){return{_id:`Effect`,op:this[Yl],...Xl in this?{args:this[Xl]}:void 0}}},tu=e=>Gc(e,ql),nu=`~effect/Cause`,ru=`~effect/Cause/Reason`,iu=e=>Gc(e,nu),au=class{[nu];reasons;constructor(e){this[nu]=nu,this.reasons=e}pipe(){return Cc(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${Pl(this.reasons)})`}[Bl](){return this.toJSON()}[ul](e){return iu(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>dl(t,e.reasons[n]))}[Kc](){return rl(this.reasons)}},ou=new WeakMap,su=class{[ru];annotations;_tag;constructor(e,t,n){if(this[ru]=ru,this._tag=e,t!==cu&&typeof n==`object`&&n&&t.size>0){let e=ou.get(n);e&&(t=new Map([...e,...t])),ou.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 Cc(this,arguments)}toString(){return Pl(this)}[Bl](){return this.toString()}},cu=new Map,lu=class extends su{error;constructor(e,t=cu){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${Pl(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[ul](e){return hu(e)&&dl(this.error,e.error)&&dl(this.annotations,e.annotations)}[Kc](){return Yc($c(this._tag))(Yc(qc(this.error))(qc(this.annotations)))}},uu=e=>new au(e),du=e=>new au([new lu(e)]),fu=class extends su{defect;constructor(e,t=cu){super(`Die`,t,e),this.defect=e}toString(){return`Die(${Pl(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[ul](e){return gu(e)&&dl(this.defect,e.defect)&&dl(this.annotations,e.annotations)}[Kc](){return Yc($c(this._tag))(Yc(qc(this.defect))(qc(this.annotations)))}},pu=e=>new au([new fu(e)]),mu=Ec(e=>iu(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new au(e.reasons.map(e=>e.annotate(t,n)))),hu=e=>e._tag===`Fail`,gu=e=>e._tag===`Die`,_u=e=>e._tag===`Interrupt`;function vu(e){return Du(`Effect.evaluate: Not implemented`)}var yu=e=>({...eu,[Yl]:e.op,[Zl]:e[Zl]??vu,[N]:e[N],[Ql]:e[Ql],[P]:e[P]}),bu=e=>{let t=yu(e);return function(){let n=Object.create(t);return n[Xl]=e.single===!1?arguments:arguments[0],n}},xu=e=>{let t={[ql]:ql,_tag:e.op,get[e.prop](){return this[Xl]},...yu(e),toString(){return`${e.op}(${Pl(this[Xl])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[Xl]}},[ul](e){return tu(e)&&e._tag===this._tag&&dl(this[Xl],e[Xl])},[Kc](){return Yc($c(e.op),qc(this[Xl]))}};return function(e){let n=Object.create(t);return n[Xl]=e,n}},Su=xu({op:`Success`,prop:`value`,[Zl](e){let t=e.getCont(N);return t?t[N](this[Xl],e,this):e.yieldWith(this)}}),Cu={key:`effect/Cause/StackTrace`},wu={key:`effect/Cause/InterruptorStackTrace`},Tu=xu({op:`Failure`,prop:`cause`,[Zl](e){let t=this[Xl],n=!1;e.currentStackFrame&&(t=mu(t,{mapUnsafe:new Map([[Cu.key,e.currentStackFrame]])}),n=!0);let r=e.getCont(Ql);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(Ql);return r?r[Ql](t,e,n?void 0:this):e.yieldWith(n?Tu(t):this)}}),Eu=e=>Tu(du(e)),Du=e=>Tu(pu(e)),Ou=bu({op:`WithFiber`,[Zl](e){return this[Xl](e)}}),ku=function(){class e extends globalThis.Error{}let t=yu({op:`YieldableError`,[Zl](){return Eu(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Au=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends ku{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Gl(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),ju=e=>{class t extends Au{_tag=e}return t.prototype.name=e,t};ju(`NoSuchElementError`);var Mu=e=>yu({op:e.label,[Zl]:e.evaluate}),Nu=e=>(t,n)=>t===n||e(t,n),Pu=`~effect/data/Option`,Fu={[Pu]:{_A:e=>e},...$l,[Symbol.iterator](){return new Hl(this)}},Iu=Object.defineProperty(Object.assign(Object.create(Fu),{_tag:`Some`,_op:`Some`,[ul](e){return zu(e)&&Vu(e)&&dl(this.value,e.value)},[Kc](){return Yc(qc(this._tag))(qc(this.value))},toString(){return`some(${Pl(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:Vl(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),Lu=qc(`None`),Ru=Object.assign(Object.create(Fu),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[ul](e){return zu(e)&&Bu(e)},[Kc](){return Lu},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),zu=e=>Gc(e,Pu),Bu=e=>e._tag===`None`,Vu=e=>e._tag===`Some`,Hu=Object.create(Ru),Uu=e=>{let t=Object.create(Iu);return t.value=e,t},Wu=`~effect/data/Result`,Gu={[Wu]:{_A:e=>e,_E:e=>e},...$l,[Symbol.iterator](){return new Hl(this)}},Ku=Object.assign(Object.create(Gu),{_tag:`Success`,_op:`Success`,[ul](e){return Ju(e)&&Xu(e)&&dl(this.success,e.success)},[Kc](){return Yc(qc(this._tag))(qc(this.success))},toString(){return`success(${Pl(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:Vl(this.success)}}}),qu=Object.assign(Object.create(Gu),{_tag:`Failure`,_op:`Failure`,[ul](e){return Ju(e)&&Yu(e)&&dl(this.failure,e.failure)},[Kc](){return Yc(qc(this._tag))(qc(this.failure))},toString(){return`failure(${Pl(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:Vl(this.failure)}}}),Ju=e=>Gc(e,Wu),Yu=e=>e._tag===`Failure`,Xu=e=>e._tag===`Success`,Zu=e=>{let t=Object.create(qu);return t.failure=e,t},Qu=e=>{let t=Object.create(Ku);return t.success=e,t},$u=()=>Hu,ed=Uu,td=Bu,nd=Vu,rd=Ec(2,(e,t)=>td(e)?$u():ed(t(e.value))),id=Ec(2,(e,t)=>td(e)?$u():t(e.value)?ed(e.value):$u()),ad=`~effect/Context/Service`,od=function(){function e(){}let t=e;Object.setPrototypeOf(t,sd);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[ld]=ld,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&cd.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},sd={[ad]:ad,...Mu({label:`Service`,evaluate(e){return Su(kd(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Td(this,e)},use(e){return Ou(t=>e(kd(t.context,this)))},useSync(e){return Ou(t=>Su(e(kd(t.context,this))))}},cd=new Set,ld=`~effect/Context/Reference`,ud=`~effect/Context`,dd=8,fd=8,pd=(e,t,n,r)=>{let i=Object.create(yd);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},md=(e,t)=>{t&&(md(e,t.parent),e.set(t.key,t.value))},hd=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return md(t,e.overlay),e._flat=t},gd=Symbol(),_d=(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)?gd:(n.overlay&&++n.baseHits>=fd&&(n.base=hd(n),n.overlay=void 0,n.depth=0),r)},vd=e=>pd(void 0,e,void 0,0),yd={get mapUnsafe(){return hd(this)},...$l,[ud]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ul](e){if(!xd(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)||!dl(r,n.get(e)))return!1;return!0},[Kc](){return Qc(this.mapUnsafe.size)}},bd=(e,t)=>e.cacheRoot===t.cacheRoot,xd=e=>Gc(e,ud),Sd=e=>!!e[ld],Cd=()=>wd,wd=vd(new Map),Td=(e,t)=>vd(new Map([[e.key,t]])),Ed=Ec(3,(e,t,n)=>Dd(e,t.key,n)),Dd=(e,t,n)=>{let r=e,i=cd.has(t)?void 0:r.cacheRoot;if(r.depth>=dd){let e=new Map(r.mapUnsafe);return e.set(t,n),pd(i,e,void 0,0)}return pd(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Od=(e,t)=>{let n=_d(e,t);return n===gd?void 0:n},kd=Ec(2,(e,t)=>{let n=_d(e,t.key);if(n===gd){if(Sd(t))return jd(t);throw Md(t)}return n}),Ad=`~effect/Context/defaultValue`,jd=e=>Ad in e?e[Ad]:e[Ad]=e.defaultValue(),Md=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
15
+ `);e.splice(1,3),t.stack=e.join(`
16
+ `)}return t},Nd=od,Pd=e=>e.length>0,Fd=Qu,I=Zu,Id=Yu,Ld=Xu,Rd=Ec(2,(e,t)=>Id(e)?I(t(e.failure)):e),zd=globalThis.Array,Bd=e=>zd.isArray(e)?e:zd.from(e),Vd=Ec(2,(e,t)=>[...e,t]),Hd=Ec(2,(e,t)=>Bd(e).concat(Bd(t)));zd.isArray;var Ud=Pd,Wd=Pd,Gd=(e,t)=>{let n=qc(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let e of r)if(dl(e,t))return!1;return r.push(t),!0},Kd=Ec(2,(e,t)=>{let n=Bd(e),r=Bd(t);return Wd(n)?Wd(r)?Yd(Hd(n,r)):n:r}),qd=()=>[],Jd=Ec(2,(e,t)=>e.map(t)),Yd=e=>{let t=Bd(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let e of t)Gd(n,e)&&r.push(e);return r},Xd=Nd(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new ef}),Zd=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Qd=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},$d=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}},ef=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Qd:Zd)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new tf(this.setImmediate)}},tf=class{tasks=new $d;running=void 0;setImmediate;constructor(e=Zd){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()}},nf=Nd(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),rf=Nd(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),af=ju;af(`EncodingError`);var of=[];for(let e=0;e<256;e++)of.push(e.toString(16).padStart(2,`0`));var sf=`effect/Tracer/ParentSpan`;od()(sf,{fiberCached:!0});var cf=`effect/Tracer`,lf=`effect/observability/Metric/FiberRuntimeMetricsKey`,uf=Nd(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:Oc}),df=Nd(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),ff=Nd(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),pf=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),mf=()=>Error.stackTraceLimit,hf=e=>{pf&&(Error.stackTraceLimit=e)},gf=class extends su{fiberId;constructor(e,t=cu){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[ul](e){return _u(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[Kc](){return Yc($c(`${this._tag}:${this.fiberId}`))(Jc(this.annotations))}},_f=e=>new au([new gf(e)]),vf=e=>e.reasons.some(_u),yf=Ec(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new au(Kd(e.reasons,t.reasons));return dl(e,n)?e:n}),bf=Ec(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>hu(e)?(n=!0,new lu(t(e.error),e.annotations)):e);return n?uu(r):e}),xf=`~effect/Fiber`,Sf={_A:Dc,_E:Dc},Cf={id:0},wf=()=>globalThis[jl],Tf=class{constructor(e,t=!0){this[xf]=Sf,this.setContext(e),this.id=++Cf.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)}[xf];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 kd(this.context,e)}addObserver(e){return this._exit?(e(this._exit),kc):(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=_f(e);this.currentStackFrame&&(n=mu(n,Td(Cu,this.currentStackFrame))),t&&(n=mu(n,t)),this._interruptedCause=this._interruptedCause?yf(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Mf(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===F)return;let n=Df.interruptChildren&&Df.interruptChildren(this);if(n!==void 0)return this.evaluate(Jf(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=Cd()}runLoop(e){let t=globalThis[jl];globalThis[jl]=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=Mf(this._interruptedCause)),this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;let e=i;i=Jf(If,()=>e)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Zl](this),i===F){let e=this._yielded;if(ql in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return F}}}catch(e){return Gc(i,Zl)?this.runLoop(Du(e)):Du(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[jl]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,Ef;for(;;){let t=this._stack.pop();if(!t)return;let n=t[P]&&t[P](this);if(n)return n[e]=n,n;if(t[e])return t}}yieldWith(e){return this._yielded=e,F}children(){return this._children??=new Set}pipe(){return Cc(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&bd(t,e))return;let n=this.getRef(Xd);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=Od(e,sf),this.currentLogLevel=this.getRef(df),this.minimumLogLevel=this.getRef(ff),this.currentStackFrame=this.getRef(uf),this.maxOpsBeforeYield=this.getRef(nf),this.currentPreventYield=this.getRef(rf),this.runtimeMetrics=Od(e,lf);let r=Od(e,cf);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag===`Span`?this.currentSpan:void 0}},Ef={[N](e,t){return Mf(t._interruptedCause)},[Ql](e,t){return Mf(t._interruptedCause)}},Df={interruptChildren:void 0},Of=e=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(wu.key,e.currentStackFrame),vd(t)},kf=e=>Hf(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(jf(r))}return a(),Pf(()=>i?.())}),Af=e=>Ou(t=>{let n=Of(t),r=qd();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return qf(kf(r))}),jf=Su,Mf=Tu,Nf=Eu,Pf=bu({op:`Sync`,[Zl](e){let t=this[Xl](),n=e.getCont(N);return n?n[N](t,e):e.yieldWith(Su(t))}}),Ff=bu({op:`Suspend`,[Zl](e){return this[Xl]()}}),If=bu({op:`Yield`,[Zl](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(np)},this[Xl]??0),e.yieldWith(()=>{t=!0})}})(0),Lf=e=>Ff(()=>Mf(Ul(e))),Rf=e=>Du(e),zf=jf(void 0),Bf=bu({op:`Async`,single:!1,[Zl](e){let t=Ul(()=>this[Xl][0].bind(e.currentScheduler)),n=!1,r=!1,i=this[Xl][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(Vf(()=>(n=!0,i?.abort(),a??np))),F):r}}),Vf=bu({op:`AsyncFinalizer`,[P](e){e.interruptible&&(e.interruptible=!1,e._stack.push(lp))},[Ql](e,t){return vf(e)?Jf(this[Xl](),()=>Mf(e)):Mf(e)}}),Hf=e=>Bf(e,e.length>=2),Uf=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Wf=(e,...t)=>Uf(e.length,t.length===0?function(){return Gf(()=>e.apply(this,arguments))}:function(){let n=Gf(()=>e.apply(this,arguments));for(let e of t)n=e(n);return n}),Gf=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return jf(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 Ff(()=>n?(n=!1,Jf(r.value,e=>Kf(t,e))):Ff(()=>Kf(e())))}}}catch(e){return Rf(e)}},Kf=bu({op:`Iterator`,single:!1,[N](e,t){let n=this[Xl][0];for(;;){let r=n.next(e);if(r.done)return jf(r.value);if(!Xf(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[Zl](e){return this[N](this[Xl][1],e)}}),qf=e=>Jf(e,e=>np),Jf=Ec(2,(e,t)=>{let n=Object.create(Yf);return n[Xl]=e,n[N]=t.length===1?t:e=>t(e),n}),Yf=yu({op:`OnSuccess`,[Zl](e){return e._stack.push(this),this[Xl]}}),Xf=e=>ql in e,Zf=Ec(2,(e,t)=>Xf(e)?e._tag===`Success`?t(e.value):e:Jf(e,t)),Qf=Ec(2,(e,t)=>Jf(e,e=>jf(Ul(()=>t(e))))),$f=Ec(2,(e,t)=>Xf(e)?rp(e,t):Qf(e,t)),ep=e=>e._tag===`Success`,tp=e=>e._tag===`Failure`,np=Su(void 0),rp=Ec(2,(e,t)=>e._tag===`Success`?Su(t(e.value)):e),ip=Ec(2,(e,t)=>{let n=Object.create(ap);return n[Xl]=e,n[Ql]=t.length===1?t:e=>t(e),n}),ap=yu({op:`OnFailure`,[Zl](e){return e._stack.push(this),this[Xl]}}),op=e=>Xf(e)?Su(e):sp(e),sp=bu({op:`Exit`,[Zl](e){return e._stack.push(this),this[Xl]},[N](e,t,n){return jf(n??Su(e))},[Ql](e,t,n){return jf(n??Tu(e))}}),cp=e=>Ou(t=>t.interruptible?(t.interruptible=!1,t._stack.push(lp),e):e),lp=bu({op:`SetInterruptible`,[P](e){if(e.interruptible=this[Xl],e._interruptedCause&&e.interruptible)return()=>Mf(e._interruptedCause)}})(!0),up=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(!Xf(c))return Jf(op(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??zf);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=Du(e);return h=t,u=!0,m=!0,f&&f.size>0?Jf(cp(Af(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(Xf(a)){if(h=b(r,a,o),h)break}else if(d){g=void 0;let e=fp(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=Tu(uu([e]))}else{let e=b(r,i,t);e&&(h=e._tag===`Failure`?Tu(uu(e.cause.reasons.slice())):e,x())}if(n){let e=x();e&&p(e)}else u&&f.size===0&&p(h??zf)}catch(e){p(y(e))}}),f.size<c)continue;n=!0,o++;return}else return Hf(e=>{d=wf(),f=new Set,g=a,p=e;let t;try{t=x()}catch(t){return e(y(t))}return t?e(t):Ff(()=>(h=np,m=!0,f?Af(f):zf))})}if(u=!0,h){if(f&&f.size>0){let e=Of(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(zf);else return np};return x()}},dp=()=>up,fp=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new Tf(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},pp=e=>(t,n)=>{let r=new Tf(n?.scheduler?Ed(e,Xd,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},mp=(e=>{let t=pp(e);return e=>{if(Xf(e))return e;let n=t(e,{scheduler:new ef(`sync`)});return n._dispatcher?.flush(),n._exit??Du(new gp(n))}})(Cd());ju(`TimeoutError`),ju(`IllegalArgumentError`),ju(`ExceededCapacityError`);var hp=`~effect/Cause/AsyncFiberError`,gp=class extends ju(`AsyncFiberError`){[hp]=hp;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}};ju(`UnknownError`);var _p={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};_p.gray,_p.blue,_p.green,_p.yellow,_p.red,_p.bgBrightRed,_p.black;var vp=hu,yp=bf;od()(`effect/Cause/StackTrace`),od()(`effect/Cause/InterruptorStackTrace`);var bp=Su,xp=Tu,Sp=Eu,Cp=np,wp=ep,Tp=tp,Ep=`~effect/BigDecimal`,Dp={[Ep]:Ep,[Kc](){let e=Pp(this);return Yc(qc(e.value),Qc(e.scale))},[ul](e){return Op(e)&&Rp(this,e)},toString(){return`BigDecimal(${zp(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[Bl](){return this.toJSON()},pipe(){return Cc(this,arguments)}},Op=e=>Gc(e,Ep),kp=(e,t)=>{let n=Object.create(Dp);return n.value=e,n.scale=t,n},Ap=(e,t)=>{if(e!==jp&&e%Mp===jp)throw RangeError(`Value must be normalized`);let n=kp(e,t);return n.normalized=n,n},jp=BigInt(0),Mp=BigInt(10),Np=Ap(jp,0),Pp=e=>{if(e.normalized===void 0)if(e.value===jp)e.normalized=Np;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=Ap(BigInt(t.substring(0,t.length-n)),e.scale-n)}return e.normalized},Fp=Ec(2,(e,t)=>t>e.scale?kp(e.value*Mp**BigInt(t-e.scale),t):t<e.scale?kp(e.value/Mp**BigInt(e.scale-t),t):e),Ip=e=>e.value<jp?kp(-e.value,e.scale):e,Lp=Nu((e,t)=>e.scale>t.scale?Fp(t,e.scale).value===e.value:e.scale<t.scale?Fp(e,t.scale).value===t.value:e.value===t.value),Rp=Ec(2,(e,t)=>Lp(e,t)),zp=e=>{let t=Pp(e);if(Math.abs(t.scale)>=16)return Bp(t);let n=t.value<jp,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},Bp=e=>{if(Vp(e))return`0e+0`;let t=Pp(e),n=`${Ip(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${Hp(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},Vp=e=>e.value===jp,Hp=e=>e.value<jp,Up=`~effect/time/DateTime`,Wp=`~effect/time/DateTime/TimeZone`,Gp={[Up]:Up,pipe(){return Cc(this,arguments)},[Bl](){return this.toString()},toJSON(){return qp(this).toJSON()}};({...Gp}),{...Gp};var Kp={[Wp]:Wp,[Bl](){return this.toString()}};({...Kp}),{...Kp};var qp=e=>new Date(e.epochMilliseconds),Jp=jf,Yp=Nf,Xp=Lf,Zp=Rf,Qp=Jf,$p=op,em=ip,tm=mp;od()(`effect/Effect/Transaction`);var nm=$f,rm=Zf,im=Wf;od()(`effect/DateTime/CurrentTimeZone`);function am(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function om(e){return t=>am(t)?.[e]}var sm=`~structural`,cm=`~sentinels`,lm=`~constructor`,um=om(`brands`),dm=Ac(e=>{let t=am(e)?.identifier;return typeof t==`string`?t:e.getExpected(dm)}),fm=Symbol(),pm=bp,mm=pm(fm),hm=pm(fm),gm=e=>e===fm?$u():ed(e),_m=e=>e._tag===`None`?mm:pm(e.value),vm=`~effect/SchemaIssue/Issue`;function ym(e){return Gc(e,vm)&&e[vm]===vm}function bm(e){return Object.hasOwn(e,`input`)}var xm=class{[vm]=vm;constructor(e,t){t?.reportInput===!0&&e!==fm&&(this.input=e)}},Sm=class extends xm{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Cm=class extends xm{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},wm=class extends xm{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Tm=class extends xm{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Em=class extends xm{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Dm=class extends xm{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Om=class extends xm{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},km=class extends xm{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},Am=class extends xm{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},jm=class extends xm{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function Mm(e,t,n){if(ym(e))return e;if(typeof e==`string`)return new km({message:e},t,n);let r=typeof e.issue==`string`?new km({message:e.issue},t,n):e.issue;return new wm(e.path,r)}function Nm(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new km(void 0,t,n):Mm(e,t,n)}function Pm(e,t,n,r){return Array.isArray(t)?Wd(t)?t.length===1?Mm(t[0],n,r):new Dm(e,Jd(t,e=>Mm(e,n,r)),n,r):void 0:Nm(t,n,r)}var Fm=e=>{let t=Km(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Bm(dm(e.ast),e);case`InvalidValue`:{let t=zm(e);if(t!==void 0)return Bm(t,e);let n=Rm(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=Rm(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=Rm(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Im=e=>Km(e.issue)??Km(e);function Lm(e){return t=>({issues:Vm(t,[],e?.leafHook??Fm,e?.checkHook??Im)})}function Rm(e){return bm(e)?Pl(e.input):void 0}function zm(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Bm(e,t){let n=Rm(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function Vm(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 Vm(e.issue,t,n,r);let a=zm(e.issue);return[{path:t,message:a===void 0?Bm(Hm(e.filter),e):Bm(a,e.issue)}]}case`Encoding`:return Vm(e.issue,t,n,r);case`Pointer`:return Vm(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>Vm(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:Km(e)??Bm(dm(e.ast),e)}]:e.issues.flatMap(e=>Vm(e,t,n,r));default:return[{path:t,message:n(e)}]}}function Hm(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=>Hm(e)).join(` & `)}}function Um(){return e=>Gm(e,``)}var Wm=Um();function Gm(e,t){let n;switch(e._tag){case`Filter`:{let r=Im(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return Gm(e.issue,t);let r=zm(e.issue);n=r===void 0?Bm(Hm(e.filter),e):Bm(r,e.issue)}break}case`Encoding`:return Gm(e.issue,t);case`Pointer`:return Gm(e.issue,t+Ll(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>Gm(e,t)).join(`
17
+ `);n=Km(e)??Bm(dm(e.ast),e);break;default:n=Fm(e);break}return t?`${n}\n at ${t}`:n}function Km(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return Km(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 qm(e){let t;for(let n of e.reasons){if(!vp(n)||!ym(n.error))return;t??=n.error}return t}function Jm(e,t){let n=qm(e);if(n===void 0)throw Error(t,{cause:e});return n}var Ym=class e extends Tc{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe(nm(rd(t))))}compose(t){return Zm(this)?t:Zm(t)?this:new e((e,n)=>this.run(e,n).pipe(rm(e=>t.run(e,n))))}},Xm=new Ym(Jp);function Zm(e){return e.run===Xm.run}function Qm(){return Xm}function $m(e){return eh(rd(e))}function eh(e){return new Ym(t=>Jp(e(t)))}function th(e){return new Ym(t=>{let n=id(t,Bc);return nd(n)?Jp(n):nm(e,ed)})}function nh(){return $m(globalThis.String)}function rh(){return $m(globalThis.Number)}var ih=`~effect/SchemaTransformation/Transformation`,ah=class e{[ih]=ih;_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 oh(e){return Gc(e,ih)&&e[ih]===ih}var sh=e=>oh(e)?e:new ah(e.decode,e.encode);function ch(e){return new ah($m(e.decode),$m(e.encode))}var lh=new ah(Qm(),Qm());function uh(){return lh}var dh=new ah(rh(),nh());function fh(e){return t=>t._tag===e}var ph=fh(`Declaration`),mh=fh(`Never`),hh=fh(`Literal`),gh=fh(`UniqueSymbol`),_h=fh(`Arrays`),vh=fh(`Objects`),yh=fh(`Suspend`),bh=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},xh={},Sh=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}},Ch=`~effect/Schema`,wh=class{[Ch]=Ch;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}>`}},Th=class e extends wh{_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===fm?mm:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(t,n,r,i,a){let o=Vg(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>`}},Eh=new class extends wh{_tag=`Null`;getParser(){return i_(this,null)}getExpected(){return`null`}},Dh=class extends wh{_tag=`Undefined`;getParser(){return i_(this,void 0)}toCodecJson(){return Ag(this,[Oh])}getExpected(){return`undefined`}},Oh=new bh(Eh,new ah($m(()=>void 0),$m(()=>null))),kh=new Dh,Ah=new class extends wh{_tag=`Never`;getParser(){return a_(this,Hc)}getExpected(){return`never`}},jh=new class extends wh{_tag=`Unknown`;getParser(){return a_(this,Uc)}getExpected(){return`unknown`}},Mh=class extends wh{_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 ${Pl(e)}`);this.literal=e}getParser(){return i_(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?Nh(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:Nh(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Nh(e){let t=globalThis.String(e.literal);return Ag(e,[new bh(new Mh(t),new ah($m(()=>e.literal),$m(()=>t)))])}var Ph=new class extends wh{_tag=`String`;getParser(){return a_(this,Pc)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&p_(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},Fh=class extends wh{_tag=`Number`;getParser(){return a_(this,Fc)}matchKey(e,t){return this._match(c_,e,t)}matchPart(e,t){return this._match(s_,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:p_(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(Ih(this.checks,`effect/schema/isFinite`)||Ih(this.checks,`effect/schema/isInt`))?this:Ag(this,[Tg])}toCodecStringTree(){return this.toCodecJson()===this?Ag(this,[d_]):Ag(this,[f_])}getExpected(){return`number`}};function Ih(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&Ih(e.checks,t))}var Lh=new Fh,Rh=new class extends wh{_tag=`Boolean`;getParser(){return a_(this,Ic)}getExpected(){return`boolean`}},zh=class e extends wh{_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(Xg(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(Xg(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 im(function*(e,c){if(e===fm)return fm;if(!Array.isArray(e))return yield*Yp(new Om(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=Bh(u,e,{concurrency:Vh(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 Em(n,e[t],c),i=new wm([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*Yp(new Dm(n,[i],e,c))}return u.issues?yield*Yp(new Dm(n,u.issues,e,c)):u.output})}_rebuild(t,n,r){let i=Vg(this.elements,t),a=Vg(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`}},Bh=dp()({onItem(e,t,n){let r=n<e.len?t:fm;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag===`Failure`)return Hh(e,e.ast,r,n);let i=n===hm?t:n[Xl];if(i!==fm)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Xg(t.ast))return;let n=new wm([r],new Tm(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Sp(new Dm(e.ast,[n],e.input,e.options))}}}),Vh=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),Hh=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=qm(r.cause);if(i===void 0)return xp(yp(r.cause,r=>new Dm(t,[new wm([n],r)],e.input,e.options)));let a=new wm([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Sp(new Dm(t,[a],e.input,e.options))},Uh=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function Wh(e,t,n=xh){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(o_(e_(t)))}var Gh=class{name;type;constructor(e,t){this.name=e,this.type=t}};function Kh(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(Kh);default:return!1}}function qh(e){return Kh(e)&&Kh(e_(e))}var Jh=class{parameter;type;constructor(e,t){if(!qh(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Xg(t)&&!r_(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Yh=class e extends wh{_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 a_(n,Vc);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return Hh(e,n,t,s)??Cp;let c=s===hm?a:s[Xl];if(r!==fm&&c!==fm){if(i&&(o.has(t)||o.has(r)))return Cp;Wl(e.out,r,c)}return Cp},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!Xf(n))return Qp($p(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return Hh(e,n,t,i)??Cp;let a=i===hm?t:i[Xl],o=e.input[t],s=r.parserValue(o,e.options);return Xf(s)?l(e,t,a,o,s):Qp($p(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return Xf(i)?l(e,t,t,r,i):Qp($p(i),n=>l(e,t,t,r,n))},f=a?dp()({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(o_(n.parameter)),parserValue:t(n.type)})):void 0),s),m=im(function*(e,t){if(e===fm)return fm;if(!(typeof e==`object`&&e&&!Array.isArray(e)))return yield*Yp(new Om(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 Em(n,l[i],t),a=new wm([i],r);if(g){h.issues?h.issues.push(a):h.issues=[a];continue}else return yield*Yp(new Dm(n,[a],e,t))}else Wl(m,i,l[i])}}let b=Vh(t?.concurrency);if(i){let e=Zh(h,s,b);e&&(yield*e)}if(a&&!b)for(let e=0;e<a;e++){let n=c[e],r=n.is.parameter===Ph?d:u,i=n.is.parameter===Ph?Object.keys(l):Wh(l,n.is.parameter,t);for(let e=0;e<i.length;e++){let t=r(h,i[e],n);if(!Xf(t))yield*t;else if(t._tag===`Failure`)return yield*t}}else if(f){let e=qd();for(let n=0;n<a;n++){let r=c[n],i=Wh(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*Yp(new Dm(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)&&Wl(t,n,m[n]);return t}return m});if(a)return m;let h=(e,t,n)=>{let r=s[t];return Qp($p(n),n=>{let i=Xh(e,r,n);if(i)return i;let a=()=>pm(e.out),o=Zh(e,s.slice(t+1));return o?rm(o,a):a()})};return(e,t)=>{if(e===fm)return mm;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 Yp(new Om(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]:fm,u=n.parser(l,t);if(!Xf(u))return h(o,e,u);if(u===hm){c&&Wl(a,s,l);continue}let d=Xh(o,n,u);if(d)return d}}catch(e){return Zp(e)}return pm(a)}}_rebuild(t,n,r,i){let a=Vg(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new Gh(e.name,n)}),o=Vg(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new Jh(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 Xh(e,t,n){if(n._tag===`Failure`)return Hh(e,e.ast,t.name,n);if(n===hm)return;let r=n[Xl];if(r!==fm){Wl(e.out,t.name,r);return}if(delete e.out[t.name],!Xg(t.type)){let n=new wm([t.name],new Tm(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}else return Sp(new Dm(e.ast,[n],e.input,e.options))}}var Zh=dp()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(fm,e.options);let n=e.input[t.name];return Wl(e.out,t.name,n),t.parser(n,e.options)},step:Xh});function Qh(e,t){return e?t?[...e,...t]:e:t}function $h(e,t,n){return new Yh(Reflect.ownKeys(e).map(t=>new Gh(t,e[t].ast)),[],n,t)}function eg(e){return e.ast}function tg(e,t=void 0){return new zh(!1,e.map(e=>e.ast),[],void 0,t)}function ng(e,t,n){return new dg(e.map(eg),t,void 0,n)}var rg=jc(e=>{for(;;){if(yh(e))return jh;let t=e.encoding;if(!t)return e.recur?.(rg,Dc)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==Dc))return jh;e=t[t.length-1].to}});function ig(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(ig)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function ag(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[cm];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Xg(t)){if(hh(t))return[{key:e.name,literal:t.literal}];if(gh(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Xg(e)){if(hh(e))return[{key:t,literal:e.literal}];if(gh(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>ag(rg(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return ag(e.thunk())}}var og=new WeakMap,sg=Object.freeze([]);function cg(e){let t=og.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=rg(s);if(mh(c))continue;if(o)if(hh(c)||gh(c)){a??=new Map;let e=hh(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1;let l=ag(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=ig(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??sg;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(Wc(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??sg;if(n)return e}return sg}}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]??sg;if(!Wc(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]??sg).map(t=>e[t]).filter(lg(t));return og.set(e,t),t}function lg(e){return t=>{let n=rg(t);return n._tag===`Literal`?n.literal===e:n._tag===`UniqueSymbol`?n.symbol===e:!0}}function ug(e,t,n=!1){return cg(t)(e,n)}var dg=class e extends wh{_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===fm)return mm;let a=ug(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:Xf(t)?fg(n,t.cause,r,i):em(t,e=>fg(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=Vh(i?.concurrency),c=pg(o,a,s?{...s,orderedStep:!0}:void 0);return c?rm(c,e=>o.out===hm?Jp(r):o.out?o.out:Yp(new Am(n,o.issues??[],r,i))):o.out?o.out:Yp(new Am(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=Vg(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=e_(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(hh);if(t.length>0)return`${hg(n.isMutable)}[ ${t.map(t=>e(t)+gg(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>hh(e.type));if(t.length>0)return`{ ${t.map(t=>`${hg(t.type.context?.isMutable)}${Il(t.name)}${gg(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function fg(e,t,n,r){let i=qm(t);return i?Sp(new Am(e,[i],n,r)):xp(t)}var pg=dp()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=qm(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),Sp(new jm(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return Cp}}}),mg=new dg([new Mh(`Infinity`),new Mh(`-Infinity`),new Mh(`NaN`)],`anyOf`);function hg(e){return e?``:`readonly `}function gg(e){return e?`?`:``}function _g(e){let t=!1,n;return()=>t?n:(n=e(),t=!0,n)}var vg=class e extends wh{_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=_g(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())}},yg=class e extends Tc{_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 bg([this,e],t)}},bg=class e extends Tc{_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 xg(e,t,n=!1){return new yg((t,n,r)=>Pm(n,e(t,n,r),t,r),t,n)}function Sg(e,t){return new yg((t,n,r)=>e(t)?void 0:new km(void 0,t,r),t,!0)}function Cg(e){return xg(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 wg=Pg(Lh,[Cg()]),Tg=new bh(new dg([wg,mg],`anyOf`),new ah(rh(),$m(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function Eg(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return xg(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 Dg(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var Og=new WeakMap;function kg(e){return Og.get(e)??e}function Ag(e,t){return e.encoding===t?e:Dg(e,e=>{e.encoding.value=t})}function jg(e,t){if(e.context===t)return e;let n=kg(e);if(n.context===t)return n;let r=Dg(e,e=>{e.context.value=t});return Og.set(r,n),r}function Mg(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return Ng(e,Vd(e.checks.slice(0,-1),n.annotate(t)))}return Dg(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function Ng(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:Dg(e,e=>{e.checks.value=t})}function Pg(e,t){return Ng(e,Qh(e.checks,t))}function Fg(e,t){let n=t(e.to);return n===e.to?e:new bh(n,e.transformation)}function Ig(e,t){let n=e,r=n[n.length-1],i=Fg(r,t);return i===r?e:Vd(e.slice(0,e.length-1),i)}function Lg(e){return t=>t.encoding?Ag(t,Ig(t.encoding,e)):t}function Rg(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:Ag(r,Ig(r.encoding,n))}return e(r)}return jc(n)}function zg(e,t,n){let r=new bh(e,t);return Ag(n,n.encoding?[...n.encoding,r]:[r])}function Bg(e,t){let n=um(e);return Mg(e,{brands:n?[...n,t]:[t]})}function Vg(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 Hg(e,t){return jg(e,e.context?new Sh(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Sh(!1,!1,void 0,t))}var Ug=jc(e=>Wg(jg(e,e.context?e.context.isOptional===!1?new Sh(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Sh(!0,!1)))),Wg=Lg(Ug),Gg=Ac(e=>Ug(new dg([e,kh],`anyOf`)));function Kg(e,t){let n=new bh(jh,new ah(th(t),Qm()));return jg(e,e.context?new Sh(e.context.isOptional,e.context.isMutable,n,e.context.annotations):new Sh(!1,!1,n))}function qg(e,t,n){return zg(e,n,t)}function Jg(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Rc(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 Yg(e,t){let{literals:n,parameters:r}=Jg(e);return new Yh(n.map(e=>new Gh(e,t)),r.map(e=>new Jh(e,t)))}function Xg(e){return e.context?.isOptional??!1}function Zg(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Zg)}function Qg(e){function t(e){return Zg(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Ud(n)?n:void 0}var $g=jc(e=>{if(e.encoding)return $g(Ag(e,void 0));let t=e,n=t.recur?.($g)??t,r=n.encodingChecks;if(r){let t=n===e?r:_h(n)||vh(n)||ph(n)&&n.typeParameters.length>0?Qg(r):void 0;return Dg(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Qh(n.checks,t)})}return n}),e_=jc(e=>$g(n_(e)));function t_(e,t){let n=t,r=n.length,i=n[r-1],a=[new bh(n_(Ag(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new bh(n_(n[e-1].to),n[e].transformation.flip()));let o=n_(i.to);return o.encoding?Ag(o,[...o.encoding,...a]):Ag(o,a)}var n_=Ac(e=>{if(e.encoding)return t_(e,e.encoding);let t=e;return t.flip?.(n_)??t.recur?.(n_)??t});function r_(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(r_);default:return!1}}function i_(e,t){let n=pm(t);return(r,i)=>r===fm?mm:r===t?n:Yp(new Om(e,r,i))}function a_(e,t){return(n,r)=>n===fm?mm:t(n)?hm:Yp(new Om(e,n,r))}var o_=Rg(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(o_)}}),s_=new globalThis.RegExp(`^${Uh}$`),c_=new globalThis.RegExp(`^(?:${Uh}|Infinity|-Infinity|NaN)$`);function l_(e){return Eg(s_,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:s_.source}),...e})}var u_=Pg(Ph,[l_()]),d_=new bh(u_,dh),f_=new bh(new dg([u_,mg],`anyOf`),dh);function p_(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=p_(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 Sm(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function m_(e){if(!ph(e))return;let t=e.annotations?.[lm];return zc(t)?t(e.typeParameters):void 0}function h_(e){let t=E_(A_,$g(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function g_(e){let t=h_(e);return(e,n)=>{let r=tm(t(e,n));return wp(r)?ed(r.value):(Jm(r.cause,`Option adapter can only return none for schema issues`),$u())}}function __(e){let t=h_(e);return(e,n)=>{let r=tm(t(e,n));if(wp(r))return r.value;let i=Jm(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function v_(e,t){let n=T_(e.ast);return t===void 0?n:(e,r)=>n(e,C_(t,r))}function y_(e,t){return D_(v_(e,t))}function b_(e,t){return O_(v_(e,t))}function x_(e,t){let n=T_(n_(e.ast));return t===void 0?n:(e,r)=>n(e,C_(t,r))}function S_(e,t){return D_(x_(e,t))}var C_=(e,t)=>t?{...e,...t}:e,w_=e=>e===fm?Yp(new km):Jp(e);function T_(e){return E_(k_,e)}function E_(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??xh);return a===hm?Jp(r):Xf(a)?a[Xl]===fm?w_(fm):a:rm(a,w_)}}function D_(e){return(t,n)=>tm(e(t,n))}function O_(e){let t=D_(e);return(e,n)=>{let r=t(e,n);return wp(r)?Fd(r.value):I(Jm(r.cause,`Result adapter can only return schema issues`))}}var k_=Ac(e=>F_(e,k_)),A_=Ac(e=>F_(e,A_,M_)),j_=Ac(e=>F_(e,A_,M_,e.context?.constructorDefault));function M_(e){return e.context?.constructorDefault?j_(e):A_(e)}function N_(e,t,n,r){let i;if(Xf(e)&&e._tag===`Success`){let a=gm(e===hm?t:e[Xl]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(pm(a),r)}else i=n._tag===`Transformation`?rm(e,e=>n.decode.run(gm(e),r)):n.decode(nm(e,gm),r);return Xf(i)&&i._tag===`Success`?_m(i[Xl]):rm(i,_m)}function P_(e,t){let n;return(r,i)=>r===fm?mm:e.isConstructed(r)?hm:N_((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function F_(e,t,n,r){let i=n?m_(e):void 0,a=i?P_(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,C_(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks)if(Xf(r)){if(r._tag===`Success`){let i=r===hm?t:r[Xl];if(t!==fm&&i!==fm){let i=p_(c,t,void 0,e,n);i&&(r=Yp(new Dm(e,i,t,n)))}}}else r=Qp(r,r=>{if(t!==fm&&r!==fm){let r=p_(c,t,void 0,e,n);if(r)return Yp(new Dm(e,r,t,n))}return Jp(r)});if(o&&!n.disableChecks)if(Xf(r)){if(r._tag===`Success`){let i=r===hm?t:r[Xl];if(i===fm)return r;let a=p_(o,i,void 0,e,n);a&&(r=Yp(new Dm(e,a,i,n)))}}else r=Qp(r,t=>{if(t!==fm){let r=p_(o,t,void 0,e,n);if(r)return Yp(new Dm(e,r,t,n))}return Jp(t)});return r};return s?(n,r)=>{l&&(r=C_(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=N_(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[Xl],o=t(a,r)):o=rm(o,e=>{let n=t(e,r);return n===hm?pm(e):n})}if(o._tag===`Success`){let e=o[Xl],t=d(e,r);return t===hm?o:t}return o=em(o,t=>Xp(()=>yp(t,t=>new Cm(e,t,n,r)))),rm(o,e=>{let t=d(e,r);return t===hm?pm(e):t})}:l?(e,t)=>d(e,C_(t,l)):d}var I_=`~effect/Schema/Schema`,L_={[I_]:I_,pipe(){return Cc(this,arguments)},annotate(e){return this.rebuild(Mg(this.ast,e))},annotateKey(e){return this.rebuild(Hg(this.ast,e))},check(...e){return this.rebuild(Pg(this.ast,e))}};function R_(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,L_),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>R_(e,t),r.makeEffect=h_(r),r.make=__(r),r.makeOption=g_(r),r}var z_=Ec(2,(e,t)=>({...e,...t})),B_=Ec(2,(e,t)=>H_(e,(e,n)=>[Object.hasOwn(t,e)?t[e]:e,n])),V_=e=>e;function H_(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;Wl(n,e,t)}}return n}var U_=I_;function W_(){return(e,t,n)=>$_(new Th(e.map(eg),e=>t(e.map(e=>$_(e))),n))}function G_(e,t){return W_()([],()=>(t,n,r)=>e(t)?Jp(t):Yp(new Om(n,t,r)),t)}var K_=`~effect/SchemaError/SchemaError`,q_=class extends af(`SchemaError`){[K_]=K_;constructor(e){let t=mf();hf(0);try{super({issue:e})}finally{hf(t)}}get message(){return Wm(this.issue)}toString(){return`SchemaError(${this.message})`}};function J_(e){return Gc(e,K_)&&e[K_]===K_}function Y_(e,t){let n=y_(e,t);return(e,t)=>X_(n(e,t))}function X_(e){return wp(e)?e:xp(yp(e.cause,e=>new q_(e)))}function Z_(e,t){let n=b_(e,t);return(e,t)=>Rd(n(e,t),e=>new q_(e))}function Q_(e,t){let n=S_(e,t);return(e,t)=>X_(n(e,t))}var $_=R_;function ev(e){return Gc(e,U_)&&e[U_]===U_}var L=V_(e=>{let t=mv(e);return $_(Gg(e.ast),{schema:t})}),R=V_(e=>$_($g(e.ast),{schema:e})),tv=V_(e=>$_(e_(e.ast),{schema:e}));function z(e){let t=$_(new Mh(e),{literal:e,transform(n){return t.pipe(vv(z(n),{decode:$m(()=>n),encode:$m(()=>e)}))}});return t}var nv=$_(Ah),rv=$_(Eh),iv=$_(kh),B=$_(Ph),V=$_(Lh),H=$_(Rh);function av(e,t){return $_(e,{fields:t,mapFields(e,t){let n=e(this.fields);return av($h(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function U(e){return av($h(e,void 0),e)}function ov(e){return V_(t=>t.mapFields(z_(e)))}var sv=e=>typeof e==`symbol`?e:globalThis.String(e);function cv(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=tv(t.fields[o]),c=Object.hasOwn(e,o),l=c?e[o]:o,u=sv(l);if(a.has(u))throw new globalThis.Error(`Duplicate encoded keys: ${Il(l)}`);a.add(u),Wl(n,l,s),c&&(r[o]=l,i[l]=o)}return U(n).pipe(vv(t,ch({decode:B_(i),encode:B_(r)})))}}function lv(e,t){return $_(Yg(e.ast,t.ast),{key:e,value:t})}function uv(e,t){return $_(e,{elements:t,mapElements(e,t){let n=e(this.elements);return uv(tg(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function dv(e){return uv(tg(e),e)}var W=V_(e=>$_(new zh(!1,[],[e.ast]),{value:e})),fv=V_(e=>$_(new zh(!1,[e.ast],[e.ast]),{value:e}));function pv(e,t){return $_(e,{members:t,mapMembers(e,t){let n=e(this.members);return pv(ng(n,this.ast.mode,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function G(e,t){return pv(ng(e,t?.mode??`anyOf`,void 0),e)}function K(e){let t=e.map(z);return $_(ng(t,`anyOf`,void 0),{literals:e,members:t,mapMembers(e){return G(e(this.members))},pick(e){return K(e)},transform(e){return G(t.map((t,n)=>t.transform(e[n])))}})}var q=V_(e=>G([e,rv])),mv=V_(e=>G([e,iv]));function hv(e){return $_(new vg(()=>e().ast))}function J(...e){return t=>t.check(...e)}function gv(e,t){return n=>$_(Pg(n.ast,[Sg(e,t)]),{schema:n})}function _v(e){return t=>$_(Bg(t.ast,e),{schema:t,identifier:e})}function vv(e,t){return n=>$_(qg(n.ast,e.ast,t?sh(t):uh()),{from:n,to:e})}function yv(e){return t=>$_(Kg(t.ast,e),{schema:t})}function bv(e){return z(e).pipe(yv(Jp(e)))}function xv(e,t){return U({_tag:bv(e),...t})}var Y=xg,Sv=$_(wg);function Cv(e,t){return e=Math.max(0,Math.floor(e)),Y(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})`}),[sm]:!0,arbitrary:{constraint:{minLength:e}},...t})}globalThis.RegExp,globalThis.URL,globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;var wv=globalThis.Symbol.for(`immer-draftable`),Tv={};function Ev(e,t,n,r,i){let a=kv(n,t,r),o=Ov(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===Tv?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:Tv,value:i}})}static[U_]=U_;get[o](){return o}static[wv]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return Cc(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return new this(e,t)}static makeOption(e,t){return g_(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(Mg(this.ast,e))}static annotateKey(e){return this.rebuild(Hg(this.ast,e))}static check(...e){return this.rebuild(Pg(this.ast,e))}static extend(e){return(t,r)=>{let a=Av(t)?t:U(t),o={...n.fields,...a.fields},s=$h(o,n.ast.checks,{identifier:e});return Ev(this,e,av(Pg(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 Dv(e){return new ah($m(t=>new e(t,{"~payload":{token:Tv,value:t}})),Qm())}function Ov(e){return`~effect/Schema/Class/${e}`}function kv(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=Ov(t),o=e=>e instanceof i||Gc(e,a),s=Dv(i);return r=vv($_(new Th([e.ast],()=>(e,t,n)=>o(e)?Jp(e):Yp(new Om(t,e,n)),{identifier:t,[lm]:([e])=>({isConstructed:o,link:new bh(e,s)}),toCodec:([e])=>new bh(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)})`,[cm]:ag(e.ast),...n})),s)(e)}}function Av(e){return ev(e)}var jv=e=>(t,n)=>Ev(Au,e,Av(t)?t:U(t),n,e=>({name:e})),Mv=e=>(t,n,r)=>{let i=Av(n)?n.mapFields(e=>({_tag:bv(t),...e}),{unsafePreserveChecks:!0}):xv(t,n);return jv(e??t)(i,r)},Nv=new WeakMap,Pv=new WeakMap,Fv=new WeakMap;function Iv(e,t){let n=G_(t=>Bv(t)&&Nv.get(t)?.kind===e,{identifier:e===`text`?`RecordTextContent`:`RecordBytesContent`});return Pv.set(n,Object.freeze({kind:e,maximumBytes:t})),Pv.set(n.ast,Object.freeze({kind:e,maximumBytes:t})),Fv.set(n.ast.run,Object.freeze({kind:e,maximumBytes:t})),n}var Lv=Iv(`text`,void 0),Rv=Iv(`bytes`,void 0),zv=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=Pv.get(t);if(n===void 0)throw TypeError(`Record content maximumBytes requires a package-owned content declaration`);return Iv(n.kind,e)}}});function Bv(e){return typeof e==`object`&&!!e&&Nv.has(e)}var Vv=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}),Hv=[`less-than`,`at-most`,`greater-than`,`at-least`],Uv=`@niceeval/assertions/AssertionEntryId`,Wv=64*1024;Object.freeze({errors:`all`,onExcessProperty:`error`});var Gv=new TextEncoder,Kv=/[\p{Cc}]/u,qv=/^ae_[a-z0-9]{20}$/,Jv=/^[\x21-\x7e]+$/;function Yv(e){return Gv.encode(e).byteLength}function Xv(e){return Array.from(e).length}function Zv(e){return Yv(e)<=Vv.stringBytes}function Qv(e){return!Kv.test(e)&&Xv(e)<=Vv.displayCodePoints}function $v(e){return Yv(e)<=128&&Jv.test(e)}function ey(e){return Number.isFinite(e)&&Number.isInteger(e)&&e>=0}function ty(e){return Number.isFinite(e)&&e>=0}function ny(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ry(e){return Object.keys(e).length<=Vv.jsonObjectKeys}function iy(e){return e.length<=Vv.jsonArrayItems}function ay(e){return qv.test(e)}function oy(e){try{let t=JSON.stringify(e);return typeof t==`string`&&Yv(t)<=4194304}catch{return!1}}function sy(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 cy(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 ly=B.check(Y(Zv,{identifier:`AssertionsBoundedJsonString`,description:`a UTF-8 string no longer than 8 KiB`})),uy=B.check(Y(Qv,{identifier:`AssertionDisplayText`,description:`text without control characters and at most 256 code points`})),dy=ly.check(Y(e=>e.length>0&&!Kv.test(e),{identifier:`MatcherSourceIdentity`,description:`a non-empty bounded source identity without control characters`})),fy=B.check(Y($v,{identifier:`AssertionCriterionIdentifier`,description:`a non-empty printable ASCII identifier no longer than 128 bytes`})),py=Sv.check(Y(ey,{identifier:`AssertionNonNegativeInteger`,description:`a finite non-negative integer`})),my=Sv.check(Y(e=>Number.isSafeInteger(e)&&e>0,{identifier:`AssertionPositiveInteger`,description:`a positive safe integer`})),hy=Sv.check(Y(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`AssertionNonNegativeSafeInteger`,description:`a non-negative safe integer`})),gy=Sv.check(Y(ty,{identifier:`AssertionNonNegativeNumber`,description:`a finite non-negative number`}));function _y(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 vy(e,t,n){if(e===null||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(typeof e==`string`)return Zv(e);if(typeof e!=`object`||t>=Vv.jsonDepth)return!1;try{if(n.has(e))return!1;if(n.add(e),Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype||!iy(e))return!1;for(let t of Reflect.ownKeys(e)){if(t===`length`)continue;if(typeof t!=`string`||!_y(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)||!vy(e[r],t+1,n))return!1;return!0}let r=e;if(!ny(r)||!ry(r))return!1;for(let e of Reflect.ownKeys(r)){if(typeof e!=`string`||!Zv(e))return!1;let i=Object.getOwnPropertyDescriptor(r,e);if(i===void 0||!i.enumerable||!(`value`in i)||!vy(i.value,t+1,n))return!1}return!0}catch{return!1}finally{n.delete(e)}}function yy(e){return vy(e,0,new WeakSet)}function by(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&vy(e,0,new WeakSet)}var xy=hv(()=>G([rv,H,Sv,ly,W(xy),lv(ly,xy)]).check(Y(yy,{identifier:`AssertionsBoundedJsonValue`,description:`a recursive JSON value within the Assertions limits`}))),Sy=xy,Cy=lv(ly,xy).check(Y(by,{identifier:`AssertionsBoundedJsonObject`,description:`a recursive JSON object within the Assertions limits`})),wy=B.check(Y(ay,{identifier:`AssertionEntryId`,description:`an attachment-local ae_ identifier with 20 lowercase base-36 characters`})).pipe(_v(Uv)),Ty=U({key:L(uy),label:L(uy),groupPath:W(uy).check(Y(e=>e.length<=Vv.groupDepth,{identifier:`AssertionDisplayGroupPath`,description:`a group path no deeper than 16 segments`}))}),Ey=U({kind:z(`builtin`),id:fy,data:Sy}),Dy=U({name:fy,schemaId:fy,data:Sy});G([Ey,Dy]);var Oy=G([G([U({kind:z(`builtin`),id:z(`value-match/v1`),data:U({subject:z(`explicit-value`),matcher:G([U({state:z(`declared`),name:ly}),U({state:z(`unavailable`)})])})}),U({kind:z(`builtin`),id:z(`numeric-comparison/v1`),data:U({comparator:K(Hv),threshold:Sv,subject:G([U({kind:z(`explicit-value`)}),U({kind:z(`scope-metric`),metric:z(`tokens`),scope:K([`turn`,`session`,`attempt`]),unit:z(`tokens`)}),U({kind:z(`scope-metric`),metric:z(`cost`),scope:K([`turn`,`session`,`attempt`]),unit:z(`usd`)}),U({kind:z(`collection-cardinality`),collection:z(`tool-calls`),scope:K([`turn`,`session`,`attempt`])})])})}),U({kind:z(`builtin`),id:z(`scope-status/v1`),data:U({scope:K([`turn`,`session`,`attempt`]),assertion:K([`succeeded`,`no-failed-actions`])})}),U({kind:z(`builtin`),id:z(`occurrence/v1`),data:U({scope:K([`turn`,`session`,`attempt`]),occurrence:K([`tool`,`skill`,`event`]),assertion:K([`present`,`absent`,`count`,`order`]),matcher:L(ly),quantifier:L(G([U({kind:z(`absent`)}),U({kind:K([`at-least`,`exact`]),count:my})]))})}),U({kind:z(`builtin`),id:z(`occurrence/v2`),data:U({scope:K([`turn`,`session`,`attempt`]),occurrence:K([`tool`,`skill`,`event`]),assertion:K([`present`,`absent`,`count`,`order`]),matcher:L(ly),quantifier:L(G([U({kind:z(`absent`)}),U({kind:z(`exact`),count:my}),U({kind:K([`at-least`,`less-than`,`at-most`,`greater-than`]),count:hy})]))})}),U({kind:z(`builtin`),id:z(`judge-measurement/v1`),data:U({recipe:K([`closed-qa`,`factuality`,`summarizes`]),scale:z(`unit-interval`)})}),G([U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`changed-paths`),paths:W(ly)})}),U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`no-changes`)})}),U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`file-changed`),path:ly,status:L(K([`added`,`modified`,`deleted`])),before:L(ly),after:L(ly)})}),U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`file-deleted`),path:ly})}),U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`not-in-diff`),pattern:ly,flags:ly,content:K([`added`,`removed`,`both`])})})]),U({kind:z(`builtin`),id:z(`direct-score/v1`),data:U({source:z(`author`)})})]),Dy]),ky=G([U({state:z(`complete`)}),U({state:z(`partial`),reason:K([`sampled`,`truncated`,`redacted`,`provider-limited`])}),U({state:z(`unavailable`),reason:K([`not-collected`,`source-unavailable`,`producer-failed`])}),U({state:z(`not-applicable`),reason:K([`optional-material`,`unsupported-subject`])})]),Ay=G([U({kind:z(`redacted`),fieldCount:py}),U({kind:z(`sampled`),captured:py,knownTotal:L(py)}),U({kind:z(`truncated`),omittedBytes:py}),U({kind:z(`provider-limited`)})]),jy=U({state:z(`not-scored`)}),My=U({state:z(`earned`),points:gy,earned:gy}).check(Y(e=>e.earned<=e.points,{identifier:`AssertionEarnedScore`,description:`an earned score no greater than its points`})),Ny=U({state:z(`unavailable`),points:gy,reason:K([`source-unavailable`,`evaluation-errored`,`not-applicable`])});function Py(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 Fy=U({examined:py,matched:py,mismatched:py,unavailable:py,knownTotal:q(py),complete:H,exhaustive:H,decisive:H}).check(Y(Py,{identifier:`AssertionCollectionReceipt`,description:`a collection receipt whose counts and completion boundary agree`})),Iy=hv(()=>G([U({kind:z(`unavailable`),reason:K([`not-recorded`,`not-declared`,`source-unavailable`])}),U({kind:z(`value`),value:G([rv,H,Sv,ly])}),U({kind:z(`text`),text:ly}),U({kind:z(`list`),items:W(Iy)}),U({kind:z(`fields`),fields:W(U({label:ly,value:Iy}))})])),Ly=G([U({state:z(`exact`)}),U({state:z(`unavailable`),reason:K([`historical-not-recorded`,`source-unavailable`,`ambiguous`])})]),Ry=G([U({kind:z(`tool-occurrence`),toolOccurrenceId:dy,relation:Ly}),U({kind:z(`event`),eventId:dy,toolOccurrenceId:L(dy),relation:Ly})]),zy=W(U({locator:Ry,result:K([`matched`,`mismatched`,`unavailable`,`not-evaluated`]),difference:L(Iy)})).check(Y(e=>e.length<=8,{identifier:`MatcherRetainedRows`,description:`at most eight representative matcher rows`})),By=U({step:my,summary:Iy}),Vy=U({family:z(`niceeval.agent-turns`),schemaVersion:my}),Hy=K([`complete`,`partial`,`unavailable`]),Uy=U({scope:z(`turn`),sessionId:dy,turnId:dy,scopeId:dy,throughSessionSequence:py,source:Vy,collectionAtCut:Hy}),Wy=U({scope:z(`session`),sessionId:dy,scopeId:dy,throughSessionSequence:py,source:Vy,collectionAtCut:Hy}),Gy=G([Uy,Wy,U({scope:z(`attempt`),scopeId:dy,sessions:W(U({sessionId:dy,throughSessionSequence:py})).check(Y(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:Vy,collectionAtCut:Hy})]),Ky=U({sourceRows:py,comparisons:py,unavailableComparisons:py,definitePrefixLength:py,possiblePrefixLength:py,stepReceipts:W(U({step:my,comparisons:py,matched:py,mismatched:py,unavailable:py}).check(Y(e=>e.matched+e.mismatched+e.unavailable===e.comparisons,{identifier:`MatcherOrderStepReceipt`,description:`an order step receipt whose result counts equal its comparisons`}))),complete:H,exhaustive:H,decisive:H}),qy=U({step:my,locator:Ry,sessionId:dy,sessionSequence:my,result:K([`matched`,`unavailable`])}),Jy=U({longestDefinitePrefix:W(qy),longestPossiblePrefix:W(qy),firstBlockingStep:my,suffixChecked:Fy,representatives:zy});function Yy(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 Xy(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&&Yy(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&&Yy(r.longestDefinitePrefix,e.sourceSnapshot,n.definitePrefixLength,`matched`)&&Yy(r.longestPossiblePrefix,e.sourceSnapshot,n.possiblePrefixLength,`possible`)}case`unavailable`:return e.result.reason.length>0&&!n.decisive}}var Zy=U({kind:z(`collection-filter`),sourceSnapshot:Gy,query:By,receipt:Fy,retainedRows:zy}).check(Y(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`})),Qy=G([U({state:z(`matched`),witnessPath:W(qy)}),U({state:z(`mismatched`),failureFrontier:Jy}),U({state:z(`unavailable`),reason:dy})]),$y=U({kind:z(`ordered-sequence`),sourceSnapshot:G([Uy,Wy]),querySteps:W(By).check(Y(e=>e.length>=2&&e.length<=64,{identifier:`MatcherOrderQuerySteps`,description:`between two and 64 ordered matcher query steps`})),receipt:Ky,result:Qy,retainedRows:zy}).check(Y(Xy,{identifier:`MatcherOrderedSequenceArtifact`,description:`an ordered matcher artifact with consistent receipts, paths, and cut`}));function eb(e){try{return Yv(JSON.stringify(e))<=Wv}catch{return!1}}var tb=G([Zy,$y]).check(Y(eb,{identifier:`MatcherQueryArtifactSize`,description:`a matcher query artifact no larger than 64 KiB`})),nb=G([U({kind:z(`boolean`),expected:z(!0)}),U({kind:z(`at-least`),threshold:gy}),U({kind:z(`record-only`)})]),rb=U({requirement:G([U({state:z(`available`),value:K([`required`,`optional`])}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),condition:G([U({state:z(`available`),value:nb}),U({state:z(`unavailable`),reason:z(`not-recorded`)})])});G([U({state:z(`matched`),gate:K([`not-gate`,`satisfied`]),score:G([jy,My]),diagnostic:L(Cy),receipt:L(Fy)}),U({state:z(`mismatched`),reason:z(`condition-not-met`),gate:K([`not-gate`,`failed`]),score:G([jy,My]),diagnostic:L(Cy),receipt:L(Fy)}),U({state:z(`unavailable`),reason:K([`evidence-unavailable`,`source-unavailable`,`redacted`]),gate:K([`not-gate`,`unavailable`]),score:G([jy,Ny]),diagnostic:L(Cy),receipt:L(Fy)}),U({state:z(`errored`),reason:K([`evaluator-failed`,`producer-interrupted`,`invalid-subject`]),gate:K([`not-gate`,`unavailable`]),score:G([jy,Ny]),diagnostic:L(Cy),receipt:L(Fy)}),U({state:z(`not-applicable`),reason:z(`coverage-not-applicable`),gate:K([`not-gate`,`not-applicable`]),score:G([jy,Ny]),diagnostic:L(Cy),receipt:L(Fy)})]);function ib(e){let t=W(e),n=W(R(Ay)),r=U({source:e,evidence:t,coverage:R(ky),limitations:n}).check(Y(e=>cy(e),{identifier:`AssertionCoverageLimitations`,description:`coverage and limitations with a consistent sealed relationship`})),i=U({observed:R(Iy),receipt:L(R(Fy))}),a=G([U({kind:z(`ordinary`),observed:R(Iy),receipt:L(R(Fy))}),U({kind:z(`matcher-current`),observed:R(Iy),artifact:R(tb),receipt:L(nv)}),U({kind:z(`matcher-legacy`),observed:R(Iy),reason:z(`historical-not-recorded`),legacyDiagnostic:L(R(Iy)),receipt:L(nv)})]),o=U({result:K([`matched`,`mismatched`,`unavailable`,`errored`,`not-applicable`]),reason:q(K([`condition-not-met`,`evidence-unavailable`,`source-unavailable`,`redacted`,`evaluator-failed`,`producer-interrupted`,`invalid-subject`,`coverage-not-applicable`])),gate:K([`not-gate`,`satisfied`,`failed`,`unavailable`,`not-applicable`])}),s=G([U({state:z(`retained`),value:R(Iy)}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),c=U({entryId:R(wy),display:R(Ty),criterion:G([U({state:z(`available`),value:R(Cy)}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),materials:r,evaluation:i,decision:o,policy:R(rb),contribution:G([R(jy),R(My),R(Ny)]),explanationRetention:s}),l=U({entryId:R(wy),display:R(Ty),criterion:G([U({state:z(`available`),value:R(Cy)}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),materials:r,evaluation:a,decision:o,policy:R(rb),contribution:G([R(jy),R(My),R(Ny)]),explanationRetention:s}).check(Y(e=>e.evaluation.kind===`ordinary`||e.explanationRetention.state===`unavailable`,{identifier:`MatcherExplanationOwnership`,description:`matcher artifacts and legacy diagnostics are not duplicated in explanation retention`})),u=W(c).check(Y(e=>e.length<=Vv.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`})),d=W(l).check(Y(e=>e.length<=Vv.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`})),f=U({entries:d}).check(Y(sy,{identifier:`AssertionsUniqueEntryIds`,description:`unique attachment-local assertion entry IDs`}),Y(oy,{identifier:`AssertionsDocumentSize`,description:`a JSON document no larger than 4 MiB`})),p=U({entryId:R(wy),display:R(Ty),criterion:G([U({state:z(`available`),value:R(Oy)}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),materials:r,evaluation:a,decision:o,policy:R(rb),contribution:G([R(jy),R(My),R(Ny)]),explanationRetention:s}),m=U({entries:W(p).check(Y(e=>e.length<=Vv.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`}))}).check(Y(sy,{identifier:`AssertionsUniqueEntryIds`,description:`unique attachment-local assertion entry IDs`}),Y(oy,{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 ab=/^@1[0-9A-HJKMNP-TV-Z]{12}$/;B.pipe(gv(e=>ab.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 ob=`@niceeval/record/RecordId`,sb=`@niceeval/record/RunId`,cb=`@niceeval/record/SlotId`,lb=`@niceeval/record/AttemptId`,ub=`@niceeval/record/UtcMillis`,db=`@niceeval/record/RecordAttachmentName`,fb=`@niceeval/record/RecordAttachmentSchemaId`,pb=`@niceeval/record/RecordFormatId`,mb=`@niceeval/record/ExperimentId`,hb=`@niceeval/record/EvalId`,gb=`@niceeval/record/ExecutionIdentityDigest`,_b=`@niceeval/record/Sha256Digest`,vb=`@niceeval/record/SourceItemId`,yb=`@niceeval/record/FileChangeId`,bb=`@niceeval/record/ArtifactId`,xb=`@niceeval/record/RecordBlobKey`,Sb=`@niceeval/record/SourceSegmentId`,Cb=`@niceeval/record/CanonicalRunRelativePath`,wb=`@niceeval/record/CanonicalProjectRelativePath`,Tb=`niceeval.record.attachments`,Eb=/^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,253}[A-Za-z0-9])?$/,Db=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,Ob=`[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?`,kb=RegExp(`^(?:${Ob}\\.)+${Ob}$`),Ab=/^niceeval\.record\.attachments$/,jb=/^[a-f0-9]{64}$/;function Mb(e){return Eb.test(e)&&!Db.test(e)}function Nb(e,t){return e===t?0:e<t?-1:1}function Pb(e){return Number.isSafeInteger(e)&&e>=0}function Fb(e){return e.length>0&&e.length<=1024&&!/[\u0000-\u001f\u007f]/.test(e)}function Ib(e){return jb.test(e)}function Lb(e){return Mb(e)}function Rb(e){return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/.test(e)}function zb(e){return e.length>0&&e.length<=4096&&!e.startsWith(`/`)&&!e.startsWith(`\\`)&&!e.includes(`\\`)&&e.split(`/`).every(Mb)}function Bb(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 Vb(e){return e.length<=255&&Mb(e)&&kb.test(e)}function Hb(e){return Vb(e)?{name:e,version:`1`}:void 0}function Ub(e){let t=Hb(e);return t!==void 0&&Vb(t.name)}function Wb(e){return Ab.test(e)}var Gb=B.check(Y(Mb,{identifier:`RecordPortableSegment`,description:`an ASCII portable file-name segment without path separators or reserved device names`})),Kb=Gb.pipe(_v(ob)),qb=Gb.pipe(_v(sb)),Jb=Gb.pipe(_v(cb)),Yb=Gb.pipe(_v(lb)),Xb=B.check(Y(Fb,{identifier:`RecordDomainIdentity`,description:`a bounded durable identity without control characters`})),Zb=Xb.pipe(_v(mb)),Qb=Xb.pipe(_v(hb)),$b=B.check(Y(Ib,{identifier:`ExecutionIdentityDigest`,description:`a lowercase hexadecimal SHA-256 execution identity digest`})).pipe(_v(gb)),ex=B.check(Y(Ib,{identifier:`Sha256Digest`,description:`a lowercase hexadecimal SHA-256 digest`})).pipe(_v(_b)),tx=Gb.pipe(_v(vb)),nx=Gb.pipe(_v(yb)),rx=Gb.pipe(_v(bb)),ix=B.check(Y(Lb,{identifier:`RecordBlobKey`,description:`an opaque portable Attachment blob key`})).pipe(_v(xb));B.check(Y(Rb,{identifier:`SourceSegmentId`,description:`a bounded opaque source receipt segment identity`})).pipe(_v(Sb)),B.check(Y(zb,{identifier:`CanonicalRunRelativePath`,description:`a slash-separated portable path inside one sealed Run`})).pipe(_v(Cb));var ax=B.check(Y(Bb,{identifier:`CanonicalProjectRelativePath`,description:`a slash-separated project-relative path without dot segments`})).pipe(_v(wb)),ox=V.check(Y(Pb,{identifier:`UtcMillis`,description:`a non-negative JSON-safe Unix-epoch millisecond value`})).pipe(_v(ub));B.check(Y(Vb,{identifier:`RecordAttachmentName`,description:`a lowercase reverse-domain portable Attachment name`})).pipe(_v(db)),B.check(Y(Ub,{identifier:`RecordAttachmentSchemaId`,description:`a RecordAttachment name followed by /vN`})).pipe(_v(fb)),B.check(Y(Wb,{identifier:`RecordFormatId`,description:`the current generic Attachment Record format identity`})).pipe(_v(pb));var sx=K([Tb]).pipe(_v(pb)),cx=new TextEncoder,lx=Object.freeze({"$niceeval.record.blob-ref":!0});function ux(e,t,n){e.failure===void 0&&(e.failure=Object.freeze({code:t,path:Object.freeze([...n])}))}function dx(e,t){if(e===t)return 0;let n=cx.encode(e),r=cx.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 fx(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 px(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function mx(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 hx(e,t){let n=Object.getOwnPropertyDescriptor(e,t);if(!(n===void 0||!(`value`in n)))return Object.freeze({value:n.value})}function gx(e,t,n,r,i){if(t>r.maximumDepth||(i.nodes+=1,i.nodes>r.maximumNodes))return ux(i,`record-json-limit-exceeded`,n),!1;if(typeof e==`string`){if(!fx(e))return ux(i,`record-json-invalid`,n),!1;if(cx.encode(e).byteLength>r.maximumStringUtf8Bytes)return ux(i,`record-json-limit-exceeded`,n),!1}return!0}function _x(e,t,n,r){let i=Reflect.ownKeys(e);if(i.some(e=>typeof e!=`string`))return ux(r,`record-json-invalid`,t);if(i.length>n.maximumObjectKeys)return ux(r,`record-json-limit-exceeded`,t);let a=i;for(let e of a){if(!fx(e))return ux(r,`record-json-invalid`,[...t,e]);if(e.length===0||cx.encode(e).byteLength>n.maximumKeyUtf8Bytes)return ux(r,`record-json-limit-exceeded`,[...t,e])}return Object.freeze([...a].sort(dx))}function vx(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 yx(e,t,n,r,i,a){if(e.length>r.maximumArrayItems)return ux(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 ux(a,`record-json-invalid`,n);let c=hx(e,`length`);if(c===void 0||c.value!==e.length)return ux(a,`record-json-invalid`,n);let l=[];for(let o=0;o<e.length;o+=1){let s=mx(e,String(o));if(s===void 0)return ux(a,`record-json-invalid`,[...n,String(o)]);let c=xx(s.value,t+1,[...n,String(o)],r,i,a);if(c===void 0)return;l.push(c)}return Object.freeze(l)}function bx(e,t,n,r,i,a){let o=_x(e,n,r,a);if(o===void 0)return;let s=[];for(let c of o){let o=mx(e,c);if(o===void 0)return ux(a,`record-json-invalid`,[...n,c]);let l=xx(o.value,t+1,[...n,c],r,i,a);if(l===void 0)return;s.push([c,l])}return vx(s)}function xx(e,t,n,r,i,a){if(gx(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:ux(a,`record-json-invalid`,n);if(typeof e!=`object`)return ux(a,`record-json-invalid`,n);try{if(i.isBlobRef?.(e))return e;if(a.ancestors.has(e))return ux(a,`record-json-invalid`,n);a.ancestors.add(e);try{return Array.isArray(e)?yx(e,t,n,r,i,a):px(e)?bx(e,t,n,r,i,a):ux(a,`record-json-invalid`,n)}finally{a.ancestors.delete(e)}}catch{return ux(a,`record-json-invalid`,n)}}}function Sx(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 lx;if(Array.isArray(e)){let n=[];for(let r of e){let e=Sx(r,t);if(e===void 0)return;n.push(e)}return Object.freeze(n)}if(!px(e))return;let n=[];for(let r of Object.keys(e).sort(dx)){let i=Sx(e[r],t);if(i===void 0)return;n.push([r,i])}return vx(n)}function Cx(e){let t=JSON.stringify(e);return t===void 0?void 0:cx.encode(t).byteLength}function wx(e,t,n={}){let r={nodes:0,ancestors:new WeakSet,failure:void 0},i=xx(e,0,[],t,n,r);if(i===void 0)return I(r.failure??Object.freeze({code:`record-json-invalid`,path:Object.freeze([])}));let a=Sx(i,n),o=a===void 0?void 0:Cx(a);return o===void 0||o>t.maximumJsonBytes?I(Object.freeze({code:`record-json-limit-exceeded`,path:Object.freeze([])})):Fd(i)}var Tx=Object.freeze({errors:`all`,exact:!0,onExcessProperty:`error`}),Ex=Object.freeze({kind:`schema`,issues:Object.freeze([])});function Dx(e){try{let t=Lm()(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 Ex}}function Ox(e){if(e.cause.reasons.length===1){let[t]=e.cause.reasons;if(t!==void 0&&vp(t)&&J_(t.error))return Dx(t.error)}throw e.cause}function kx(e){return Object.freeze({kind:`canonical`,failure:e})}function Ax(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 jx(e){return e===null||typeof e==`boolean`||typeof e==`string`||typeof e==`number`&&Number.isFinite(e)&&!Object.is(e,-0)}function Mx(e,t){if(e.context?.isOptional!==!0)return Fx(e,t);if(e._tag===`Never`)return!0;if(e._tag!==`Union`)return Fx(e,t);let n=!1;for(let r of e.types){if(r._tag===`Undefined`||r._tag===`Never`){n=!0;continue}if(!Fx(r,t))return!1}return n}function Nx(e,t){return e.propertySignatures.every(e=>typeof e.name==`string`&&e.name.length>0&&Mx(e.type,t))&&e.indexSignatures.every(e=>e.parameter._tag===`String`&&Mx(e.type,t))}function Px(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:Nx(n.to,t)}function Fx(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=jx(e.literal);break;case`Null`:case`String`:case`Number`:case`Boolean`:r=!0;break;case`Objects`:r=Nx(e,t);break;case`Arrays`:r=e.elements.every(e=>Fx(e,t))&&e.rest.every(e=>Fx(e,t));break;case`Union`:r=e.types.every(e=>Fx(e,t));break;case`Suspend`:r=Fx(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&&=Px(e,t),!r&&t.failure===void 0&&(t.failure=e._tag),t.states.set(e,r?`allowed`:`rejected`),r}function Ix(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(!Fx(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 Lx(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)Lx(i.type,t,n,r);for(let i of e.indexSignatures)Lx(i.type,t,n,r);break;case`Arrays`:for(let i of e.elements)Lx(i,t,n,r);for(let i of e.rest)Lx(i,t,n,r);break;case`Union`:for(let i of e.types)Lx(i,t,n,r);break;case`Suspend`:Lx(e.thunk(),t,n,r);break}}function Rx(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&&Rx(r.value,t,n);return Object.freeze(e),e}function zx(e){Ix(e);let t=Ax(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=Y_(e.schema,Tx),a=Q_(e.schema,Tx),o=Y_(R(e.schema),Tx),s=[];Lx(e.schema.ast,e,s);let c=e=>{let n=wx(e,t,r);return Id(n)?I(kx(n.failure)):Fd(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:e_(e.schema.ast),t).value};return Object.freeze({schema:e.schema,limits:t,opaqueDeclarationMetadata:Object.freeze(s),decode:e=>{let t=c(e);if(Id(t))return I(t.failure);let n=i(t.success);if(Tp(n))return I(Ox(n));let a=o(n.value);if(Tp(a))return I(Ox(a));let s=c(a.value);if(Id(s))return I(s.failure);let l=o(s.success);return Tp(l)?I(Ox(l)):Fd(Rx(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(Id(t))return I(t.failure);let n=a(t.success);return Tp(n)?I(Ox(n)):c(n.value)}})}var Bx=fv(U({code:K(`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:W(B)}));function Vx(e,t=[]){return Object.freeze({code:e,path:Object.freeze([...t])})}function Hx(e){let[t,...n]=e;if(t===void 0)return;let r=[t,...n];return Object.freeze(r)}var Ux=K([`record`,`run`,`member`,`attempt`,`attachment-envelope`,`record-core`]),Wx=K([`record-schema-invalid`,`record-invariant-invalid`]);Mv()(`RecordCodecError`,{code:Wx,document:Ux,issues:Bx}),Mv()(`RecordCoreInvalid`,{code:z(`record-core-invalid`),issues:Bx}),Mv()(`RecordReferenceInvalid`,{code:z(`record-reference-invalid`)}),Mv()(`RecordAttachmentEnvelopeInvalid`,{code:z(`record-attachment-envelope-invalid`),issues:Bx});function Gx(e){let t=zx({schema:e.schema,limits:e.limits});return Object.freeze({...t,kind:`core`})}var Kx=[`completed`,`errored`,`cancelled`,`interrupted`],qx=[`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`],Jx=[`executed`,`carried`,`accepted`],Yx=[`not-dispatched`,`interrupted`],Xx=`niceeval.record-attachment`,Zx=[`run`,`attempt`];function Qx(e){return`${e.originRunId}\u0000${e.attemptId}`}var $x=`niceeval.run/v1`,eS=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0))),tS=K([`active`,`completed`,`interrupted`,`failed`]),nS=K([`early-exit-satisfied`,`budget-exhausted`,`stopped-by-failure`,`interrupted-before-publication`,`dispatch-failed`]),rS=U({state:z(`pending`)}),iS=U({state:z(`published`),action:K([`executed`,`carried`,`accepted`]),attemptId:B,attemptLocator:B,originRunId:B,originSlotId:B}),aS=U({state:z(`absent`),reason:nS}),oS=U({slotId:B,evalId:B,attemptOrdinal:eS,executionIdentityDigest:B,publication:G([rS,iS,aS])}),sS=U({published:eS,expected:eS,missing:eS}),cS=U({runId:B,invocationId:B,experimentId:B,state:tS,startedAt:B,completedAt:L(B),coverage:sS}),lS=cS.pipe(ov({slots:W(oS)}));U({identity:B,revision:eS}),G([U({protocol:z($x),operation:z(`run.list`),runs:W(cS),continuation:L(B)}),U({protocol:z($x),operation:z(`run.get`),run:lS})]);var uS=Object.freeze({maximumJsonBytes:256*1024,maximumDepth:8,maximumNodes:4096,maximumObjectKeys:64,maximumArrayItems:256,maximumKeyUtf8Bytes:256,maximumStringUtf8Bytes:8*1024}),dS=hv(()=>G([rv,H,V,B,W(dS),lv(B,dS)])),fS=lv(B,dS),pS=Gx({schema:U({experimentId:Zb,execution:U({agentId:B.pipe(J(Cv(1))),model:q(B),reasoningEffort:q(B),flags:fS}),labels:lv(B,B)}),limits:uS}),mS=pS.schema;function hS(e){let t=Hx([e.kind===`canonical`?Vx(e.failure.code===`record-json-limit-exceeded`?`record-run-context-size-exceeded`:`record-run-context-invalid`,e.failure.path):Vx(`record-run-context-invalid`)]);if(t===void 0)throw Error(`Run context failure must contain one issue`);return t}function gS(e){let t=pS.decode(e);return Id(t)?I(hS(t.failure)):Fd(t.success)}function _S(e){let t=gS(e);return Id(t)?t.failure:Object.freeze([])}function vS(e,t,n){for(let r of n)e.push(Vx(r.code,[...t,...r.path]))}function yS(e,t){return e===void 0||Nb(e,t)<0}function bS(e){let t=[],n=new Set,r=new Set,i;for(let[a,o]of e.entries()){let e=[`expectedSlots`,String(a),`slotId`];yS(i,o.slotId)||t.push(Vx(i===o.slotId?`record-expected-slot-duplicate`:`record-expected-slot-order-invalid`,e)),n.has(o.slotId)&&i!==o.slotId&&t.push(Vx(`record-expected-slot-duplicate`,e));let s=`${o.evalId}\u0000${String(o.attemptOrdinal)}`;r.has(s)&&t.push(Vx(`record-expected-slot-duplicate`,[`expectedSlots`,String(a),`attemptOrdinal`])),n.add(o.slotId),r.add(s),i=o.slotId}return Object.freeze(t)}function xS(e){let t=[];e.completedAt<e.startedAt&&t.push(Vx(`record-run-time-order-invalid`,[`completedAt`])),vS(t,[`context`],_S(e.context));let n=gS(e.context);return Ld(n)&&n.success.experimentId!==e.experimentId&&t.push(Vx(`record-run-context-experiment-mismatch`,[`context`,`experimentId`])),vS(t,[],bS(e.expectedSlots)),Object.freeze(t)}function SS(e){return(e.action===`executed`||e.action===`carried`||e.action===`accepted`)==(e.attempt!==null)?Object.freeze([]):Object.freeze([Vx(`record-member-action-invalid`,[`attempt`])])}function CS(e){return Object.freeze([])}function wS(e){return[`runs`,String(e)]}function TS(e,t){return[...wS(e),`members`,String(t)]}function ES(e,t){return[...wS(e),`attempts`,String(t)]}function DS(e){return Qx(e)}function OS(e){return new Map(e.expectedSlots.map(e=>[e.slotId,e]))}function kS(e,t){return e.slotId===t.slotId&&e.evalId===t.evalId&&e.attemptOrdinal===t.attemptOrdinal&&e.executionIdentityDigest===t.executionIdentityDigest}function AS(e,t,n){let r=OS(e.run),i=new Set,a;for(let[o,s]of e.members.entries()){let e=TS(t,o);vS(n,e,SS(s)),yS(a,s.slotId)||n.push(Vx(a===s.slotId?`record-member-slot-duplicate`:`record-member-slot-order-invalid`,[...e,`slotId`])),i.has(s.slotId)&&a!==s.slotId&&n.push(Vx(`record-member-slot-duplicate`,[...e,`slotId`])),r.has(s.slotId)||n.push(Vx(`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(Vx(`record-member-slot-missing`,[...wS(t),`run`,`expectedSlots`,String(r),`slotId`]))}function jS(e){let t=[],n=new Map,r=new Map,i;for(let[a,o]of e.runs.entries()){let e=o.run.runId,s=wS(a);yS(i,e)||t.push(Vx(i===e?`record-run-duplicate`:`record-run-order-invalid`,[...s,`run`,`runId`])),n.has(e)&&i!==e&&t.push(Vx(`record-run-duplicate`,[...s,`run`,`runId`])),n.set(e,a),i=e,vS(t,[...s,`run`],xS(o.run)),AS(o,a,t);let c=OS(o.run),l;for(let[n,i]of o.attempts.entries()){let o=ES(a,n);if(vS(t,o,CS(i)),yS(l,i.attemptId)||t.push(Vx(l===i.attemptId?`record-attempt-duplicate`:`record-attempt-order-invalid`,[...o,`attemptId`])),l=i.attemptId,i.originRunId!==e){t.push(Vx(`record-attempt-owner-invalid`,[...o,`originRunId`]));continue}let s=c.get(i.slotId);s===void 0?t.push(Vx(`record-attempt-slot-unexpected`,[...o,`slotId`])):(s.evalId!==i.evalId&&t.push(Vx(`record-attempt-eval-mismatch`,[...o,`evalId`])),s.executionIdentityDigest!==i.executionIdentityDigest&&t.push(Vx(`record-attempt-digest-mismatch`,[...o,`executionIdentityDigest`])));let u=DS({originRunId:e,attemptId:i.attemptId});r.has(u)?t.push(Vx(`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=TS(n,o),l=r.get(DS(s.attempt));if(l===void 0){t.push(Vx(`record-attempt-reference-missing`,[...c,`attempt`]));continue}if(s.action!==`accepted`){let n=OS(i.run).get(s.slotId),r=OS(e.runs[l.runIndex].run).get(l.attempt.slotId);(n===void 0||r===void 0||!kS(n,r))&&t.push(Vx(`record-attempt-slot-mismatch`,[...c,`attempt`]))}if(s.action===`executed`){if(s.attempt.originRunId!==i.run.runId){t.push(Vx(`record-member-action-invalid`,[...c,`action`]));continue}let e=DS(s.attempt);a.set(e,(a.get(e)??0)+1)}else s.attempt.originRunId===i.run.runId&&t.push(Vx(`record-member-action-invalid`,[...c,`action`]))}for(let[e,n]of r.entries()){let r=a.get(e)??0,i=ES(n.runIndex,n.attemptIndex);r===0?t.push(Vx(`record-origin-member-missing`,i)):r>1&&t.push(Vx(`record-origin-member-duplicate`,i))}return Object.freeze(t)}var MS=Object.freeze({maximumJsonBytes:1024*1024,maximumDepth:8,maximumNodes:4096,maximumObjectKeys:64,maximumArrayItems:256,maximumKeyUtf8Bytes:256,maximumStringUtf8Bytes:8*1024}),NS=Object.freeze({...MS,maximumJsonBytes:8*1024*1024,maximumNodes:32768,maximumArrayItems:4096});function PS(e){return e.length===0?void 0:e.map(e=>({path:e.path,issue:e.code}))}var FS=K(Kx),IS=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`RecordAttemptOrdinal`,description:`a zero-based non-negative JSON-safe attempt ordinal`}))),LS=Gx({schema:U({originRunId:qb,attemptId:Yb}),limits:MS}).schema,RS=Gx({schema:U({slotId:Jb,evalId:Qb,attemptOrdinal:IS,executionIdentityDigest:$b}),limits:MS}).schema,zS=Gx({schema:U({format:sx,recordId:Kb}),limits:MS}).schema,BS=Gx({schema:U({runId:qb,experimentId:Zb,context:mS,startedAt:ox,completedAt:ox,expectedSlots:W(RS)}).pipe(J(Y(e=>PS(xS(e)),{identifier:`RecordRunDocumentInvariant`,description:`a Run document with valid chronology, context, and expected Slots`}))),limits:MS}).schema,VS=Gx({schema:G([U({slotId:Jb,action:K(Jx),attempt:LS}),U({slotId:Jb,action:K(Yx),attempt:rv,absenceReason:nS})]).pipe(J(Y(e=>PS(SS(e)),{identifier:`RecordMemberDocumentInvariant`,description:`a Member action paired with its required Attempt reference`}))),limits:MS}).schema,HS=Gx({schema:U({attemptId:Yb,originRunId:qb,slotId:Jb,evalId:Qb,executionIdentityDigest:$b,outcome:FS}).pipe(J(Y(e=>PS(CS(e)),{identifier:`RecordAttemptDocumentInvariant`,description:`an Attempt document satisfying its local invariant`}))),limits:MS}).schema,US=Gx({schema:U({run:BS,members:W(VS),attempts:W(HS)}),limits:NS}).schema;Gx({schema:U({record:zS,runs:W(US)}).pipe(J(Y(e=>PS(jS(e)),{identifier:`RecordCoreInvariant`,description:`a complete Record Core with consistent Run, Member, and Attempt documents`}))),limits:NS}).schema;var WS=RS,GS=BS,KS=VS,qS=HS;Z_(G([U({format:z(`niceeval.attempt-publication-closure/v1`),originRun:GS}),U({originRun:GS})]),{errors:`all`,onExcessProperty:`error`}),K(qx);var JS=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0))),YS=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>0))),XS=U({sha256:ex,byteLength:JS}),ZS=U({key:ix,sha256:ex,byteLength:JS}),QS=U({owner:K(Zx),family:B.pipe(J(Y(Vb)))});function $S(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}U({format:K([Xx]),ownerKind:K(Zx),family:B.pipe(J(Y(Vb))),schemaVersion:YS,payload:XS,contents:W(ZS),references:W(QS)}).pipe(J(Y($S)));var eC=K([`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`]),tC=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`}},nC=new WeakMap,rC=new WeakMap,iC=new WeakMap,aC=new WeakMap,oC=new WeakMap;function sC(e){throw new tC(`invalid-family-definition`,e)}Object.freeze({to(e,t){let n=lC(e);n===void 0&&sC();let r=G_(e=>{let r=uC(e)?iC.get(e):void 0;return r!==void 0&&r.definition===n&&(t===void 0||!Id(Z_(t)(r.value)))},{identifier:`RecordAttachmentReference<${n.owner}:${n.family}>`});return aC.set(r,Object.freeze({definition:n,valueSchema:t})),aC.set(r.ast,Object.freeze({definition:n,valueSchema:t})),oC.set(r.ast.run,Object.freeze({definition:n,valueSchema:t})),r}});function cC(e){return typeof e==`object`&&!!e&&nC.has(e)}function lC(e){return cC(e)?e:typeof e==`object`&&e||typeof e==`function`?rC.get(e):void 0}function uC(e){return typeof e==`object`&&!!e&&iC.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 dC=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`RecordNonNegativeSafeInteger`,description:`a non-negative JSON-safe integer`}))),fC=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>0,{identifier:`RecordPositiveSafeInteger`,description:`a positive JSON-safe integer`})));V.pipe(J(Y(e=>Number.isFinite(e)&&e>=0,{identifier:`RecordFiniteNonNegativeNumber`,description:`a finite non-negative JSON number`})));var pC=B.pipe(J(Y(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`}))),mC=B.pipe(J(Y(e=>/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/.test(e),{identifier:`RecordSafeIdentifier`,description:`a bounded ASCII identifier`}))),hC=B.pipe(J(Y(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`}))),gC=G([U({code:K([`capture-failed`,`capture-interrupted`]),stage:mC}),U({code:K([`collection-cap-reached`,`unsupported-input`]),omittedAtLeast:fC})]),_C=dv([]).pipe(J(Y(e=>e.length===0,{identifier:`RecordEmptyArray`,description:`an exact empty array`}))),vC=G([U({state:z(`complete`),limitations:_C}),U({state:z(`partial`),limitations:fv(gC)})]),yC=Object.freeze({maximumArtifacts:4e3,maximumContentBytes:64*1024*1024}),bC=U({artifactId:rx,mediaType:R(hC),label:R(pC),byteLength:dC,sha256:ex,content:Rv.pipe(zv.maximumBytes(yC.maximumContentBytes))}),xC=U({collection:R(vC),artifacts:W(bC)}).pipe(cv({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 SC=`@niceeval/o11y/NonNegativeSafeInteger`,CC=`@niceeval/o11y/PositiveSafeInteger`,wC=`@niceeval/o11y/SafeIdentifier`,TC=`@niceeval/o11y/SourceNativeToolName`,EC=`@niceeval/o11y/StableLabel`,DC=`@niceeval/o11y/SafeText`,OC=`@niceeval/o11y/CanonicalDecimal`,kC=`@niceeval/o11y/CurrencyCode`,AC=new TextEncoder,jC=/^[a-z][a-z0-9.-]{0,63}$/,MC=/^(?:0|[1-9][0-9]*)(?:\.[0-9]*[1-9])?$/,NC=/^[A-Z]{3}$/,PC=/[\u0000-\u0009\u000B-\u001F]/u;function FC(e){return AC.encode(e).byteLength}function IC(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 LC(e){return Number.isSafeInteger(e)&&e>=0}function RC(e){return Number.isSafeInteger(e)&&e>0}function zC(e){return LC(e)?e:void 0}function BC(e){return RC(e)?e:void 0}function VC(e){return FC(e)<=64&&jC.test(e)}function HC(e){return FC(e)<=64&&jC.test(e)}function UC(e){return e.length>0&&!e.includes(`
18
+ `)&&GC(e,256)}function WC(e){return IC(e)&&!PC.test(e)}function GC(e,t){return Number.isSafeInteger(t)&&t>=0&&WC(e)&&FC(e)<=t}function KC(e){return FC(e)<=64&&MC.test(e)}function qC(e){return NC.test(e)}var JC=`@niceeval/o11y/TurnId`,YC=`@niceeval/o11y/ItemId`,XC=`@niceeval/o11y/CallId`,ZC=`@niceeval/o11y/EventId`,QC=`@niceeval/o11y/ToolOccurrenceId`,$C=`@niceeval/o11y/SessionScopeId`,ew=`@niceeval/o11y/LegacySourceLocalCallId`,tw=`@niceeval/o11y/CommandId`,nw=`@niceeval/o11y/UsageObservationId`,rw=`@niceeval/o11y/IntervalId`,iw=`@niceeval/o11y/DiagnosticId`;Object.freeze([`turn`,`item`,`call`,`event`,`tool-occurrence`,`session-scope`,`command`,`usage-observation`,`interval`,`diagnostic`]);var aw=`[0123456789abcdefghjkmnpqrstvwxyz]`,ow=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 sw(e){return RegExp(`^${e}${aw}{26}$`)}var cw=sw(ow.turn),lw=sw(ow.item),uw=sw(ow.call),dw=sw(ow.event),fw=sw(ow[`tool-occurrence`]),pw=sw(ow[`session-scope`]),mw=sw(ow.command),hw=sw(ow[`usage-observation`]),gw=sw(ow.interval),_w=sw(ow.diagnostic);function vw(e){return cw.test(e)}function yw(e){return lw.test(e)}function bw(e){return uw.test(e)}function xw(e){return dw.test(e)}function Sw(e){return fw.test(e)}function Cw(e){return pw.test(e)}function ww(e){return uw.test(e)}function Tw(e){return mw.test(e)}function Ew(e){return hw.test(e)}function Dw(e){return gw.test(e)}function Ow(e){return _w.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 kw(e){return typeof e==`object`&&!!e}function Aw(e,t){let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&`value`in n?n.value:void 0}function jw(e){if(!kw(e))return!1;let t=Aw(e,`family`),n=Aw(e,`kind`),r=Aw(e,`id`);return typeof t==`string`&&typeof n==`string`&&typeof r==`string`}function Mw(e){if(!jw(e))return!1;switch(e.kind){case`turn`:return e.family===`niceeval.agent-turns`&&vw(e.id);case`item`:return e.family===`niceeval.agent-turns`&&yw(e.id);case`call`:return e.family===`niceeval.agent-turns`&&bw(e.id);case`event`:return e.family===`niceeval.agent-turns`&&xw(e.id);case`tool-occurrence`:return e.family===`niceeval.agent-turns`&&Sw(e.id);case`session-scope`:return e.family===`niceeval.agent-turns`&&Cw(e.id);case`command`:return e.family===`niceeval.sandbox-commands`&&Tw(e.id);case`usage-observation`:return e.family===`niceeval.agent-turns`&&Ew(e.id);case`interval`:return e.family===`niceeval.runner-activities`&&Dw(e.id);case`diagnostic`:return e.family===`niceeval.runner-diagnostics`&&Ow(e.id);default:return!1}}function Nw(e){return jw(e)?e.family===`niceeval.runner-activities`&&e.kind===`interval`&&Dw(e.id)||e.family===`niceeval.runner-diagnostics`&&e.kind===`diagnostic`&&Ow(e.id):!1}function Pw(e,t){return e===t?0:e<t?-1:1}function Fw(e,t){let n=Pw(e.family,t.family);if(n!==0)return n;let r=Pw(e.kind,t.kind);return r===0?Pw(e.id,t.id):r}function Iw(e,t){if(e.length>16)return!1;let n;for(let t of e){if(!Mw(t)||n!==void 0&&Fw(n,t)>=0)return!1;n=t}return!0}function Lw(e,t){if(e.length>16)return!1;let n;for(let t of e){if(!Nw(t)||n!==void 0&&Fw(n,t)>=0)return!1;n=t}return!0}var Rw=Object.freeze([`conversation-item`,`conversation-text`,`command-manifest`,`command-stdout`,`command-stderr`,`usage-observation`,`timing-interval`,`diagnostic`]),zw=Object.freeze([`adapter`,`command-capture`,`usage-capture`,`timing-capture`,`diagnostic-capture`,`attempt-finalizer`,`run-teardown`]);function Bw(e,t){return e.some(e=>e===t)}function Vw(e){return Bw(Rw,e)}function Hw(e){return Bw(zw,e)}function Uw(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 Ww(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 Gw(e){return e.code===`capture-failed`||e.code===`capture-interrupted`?e.stage:``}function Kw(e){return[e.code,Uw(e),Ww(e),Gw(e)].join(`\0`)}function qw(e,t){let n=Pw(e.code,t.code);if(n!==0)return n;let r=Pw(Uw(e),Uw(t));if(r!==0)return r;let i=Pw(Ww(e),Ww(t));return i===0?Pw(Gw(e),Gw(t)):i}function Jw(e){return e===`stdout`||e===`stderr`}function Yw(e){switch(e.code){case`capture-failed`:case`capture-interrupted`:return Hw(e.stage)&&Vw(e.target);case`collection-cap-reached`:return Vw(e.target)&&LC(e.retained)&&RC(e.omittedAtLeast);case`unsupported-input`:return Vw(e.target)&&RC(e.omittedAtLeast);case`text-truncated`:return LC(e.retainedBytes)&&RC(e.omittedBytes)&&(e.target===`conversation-text`&&yw(e.itemId)||e.target===`command-manifest`&&Tw(e.commandId)||e.target===`diagnostic`&&Ow(e.diagnosticId));case`stream-truncated`:return Tw(e.commandId)&&Jw(e.stream)&&LC(e.retainedBytes)&&RC(e.omittedBytes);case`invalid-utf8-replaced`:return Tw(e.commandId)&&Jw(e.stream)&&RC(e.replacementCount);case`unsafe-control-stripped`:return Tw(e.commandId)&&Jw(e.stream)&&RC(e.strippedCount);case`redacted`:return Vw(e.target)&&RC(e.replacementCount)}}function Xw(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=zC(i);if(e===void 0)throw Error(`Array index must be a safe integer`);if(!Yw(a)){t.push(Object.freeze({code:`observability-limitation-invalid`,index:e}));continue}if(n!==void 0&&qw(n,a)>=0){let e=BC(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=Kw(a);if(r.has(o)){let e=BC(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 Zw=`niceeval.query/v1`,Qw=U({state:z(`available`),byteLength:V,sha256:B,base64:B}),$w=ib(G([U({kind:z(`unavailable`),reason:z(`not-recorded`)}),U({kind:z(`content`),content:Qw,encoding:K([`json`,`utf-8`,`binary`]),byteLength:V,preview:q(B)})])).entry,eT=U({entryId:wy,sourceOrder:V,role:K([`declaration`,`threshold`,`score`,`gate`,`optional`,`stop`]),source:U({sourceItemId:B,sha256:B}),start:U({line:V,column:V}),end:U({line:V,column:V})}),tT=G([Iy,nb]),nT=K([`condition-not-met`,`evidence-unavailable`,`source-unavailable`,`redacted`,`evaluator-failed`,`producer-interrupted`,`invalid-subject`,`coverage-not-applicable`,`not-recorded`,`not-declared`]),rT=hv(()=>U({label:B,state:B,expected:q(tT),observed:q(Iy),reason:q(nT),anchor:q(Iy),children:W(rT)})),iT=K([`historical-not-recorded`,`source-unavailable`,`ambiguous`]),aT=G([U({state:z(`exact`),turnId:B,eventId:B,anchor:B}),U({state:z(`unavailable`),reason:iT})]),oT=G([U({kind:z(`tool-occurrence`),toolOccurrenceId:B}),U({kind:z(`event`),eventId:B})]),sT=U({kind:K([`tool`,`event`,`legacy-source-row`]),rowId:B,number:B,phase:K([`at-evaluation`,`outside-evaluation-snapshot`,`historical`]),summary:B,detail:Iy,locator:L(oT),evaluation:U({result:K([`matched`,`mismatched`,`unavailable`,`not-evaluated`,`not-retained`,`outside-snapshot`,`legacy`]),difference:L(Iy)}),conversationTarget:aT}),cT=G([U({state:z(`unavailable`),reason:iT,rows:dv([]),limitations:dv([])}),U({state:K([`complete`,`partial`]),rows:W(sT),limitations:W(Iy)})]),lT=G([U({kind:z(`collection-filter`),summary:Iy}),U({kind:z(`ordered-sequence`),summaries:W(Iy)})]),uT=U({step:V,summary:Iy,state:K([`matched`,`possible`,`blocked`,`not-reached`]),sourceRow:L(B),conversationTarget:L(aT)}),dT=G([U({state:z(`legacy`),subject:K([`tool`,`event`,`source-row`]),query:U({state:z(`unavailable`),reason:z(`historical-not-recorded`)}),source:U({final:cT,atEvaluation:cT}),identityRelation:U({state:z(`unavailable`),reason:z(`historical-not-recorded`)}),overlayRetention:z(`unavailable`),steps:dv([]),legacyDiagnostic:L(Iy)}),U({state:z(`current`),subject:K([`tool`,`event`,`source-row`]),query:lT,receipt:G([Fy,Ky]),source:U({final:cT,atEvaluation:cT}),identityRelation:G([U({state:z(`exact`)}),U({state:z(`unavailable`),reason:K([`source-unavailable`,`ambiguous`])})]),overlayRetention:K([`complete`,`partial`,`unavailable`]),steps:W(uT)})]),fT=U({state:z(`unavailable`),reason:z(`not-recorded`)}),pT=U({state:z(`missing`),sourceState:K([`not-recorded`,`invalid`]),comparator:rv,sourceLedger:rv,receipt:rv,result:rv,targets:dv([]),debugger:rv,sandboxCommandJoin:fT}),mT=G([pT,U({state:z(`ordinary`),sourceState:rv,comparator:rv,sourceLedger:q(Fy),receipt:q(Fy),result:rv,targets:dv([]),debugger:rv,sandboxCommandJoin:fT}),U({state:z(`legacy`),sourceState:z(`unavailable`),comparator:rv,sourceLedger:rv,receipt:rv,result:rv,targets:dv([]),reason:z(`historical-not-recorded`),debugger:dT,sandboxCommandJoin:fT}),U({state:z(`available`),sourceState:K([`complete`,`partial`,`unavailable`]),comparator:q(G([By,W(By)])),sourceLedger:U({sourceSnapshot:Gy,receipt:G([Fy,Ky])}),receipt:G([Fy,Ky]),result:q(Qy),targets:W(U({state:K([`matched`,`mismatched`,`unavailable`,`not-evaluated`]),anchor:oT,difference:q(Iy)})),debugger:dT,sandboxCommandJoin:fT})]),hT=R(G([U({entryId:B,state:K([`not-recorded`,`invalid`]),issues:L(W(U({code:eC,path:W(B)}))),sourceSites:dv([]),check:rT,matcher:pT}),U({entryId:wy,display:R(Ty),entry:R($w),sourceSites:W(eT),check:rT,matcher:mT})])),gT=Object.freeze({completed:`completed`,failed:`failed`,cancelled:`cancelled`,interrupted:`interrupted`}),_T=[gT.completed,gT.failed,gT.cancelled,gT.interrupted],vT=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`}),yT=[vT.attemptSetup,vT.sandboxPrepare,vT.agentEnsure,vT.evalRun,vT.agentSend,vT.sandboxCommand,vT.assertionEvaluate,vT.verdictFold,vT.attemptTeardown];vT.attemptSetup,vT.sandboxPrepare,vT.agentEnsure,vT.evalRun,vT.sandboxCommand,vT.assertionEvaluate,vT.verdictFold,vT.attemptTeardown;var bT=[vT.runSetup,vT.runDiscovery,vT.runPlan,vT.runDispatch,vT.runTeardown],xT=[vT.collection];[...yT,...xT],[...bT,...xT];var ST=[vT.attemptSetup,vT.sandboxPrepare,vT.agentEnsure,vT.evalRun,vT.sandboxCommand,vT.attemptTeardown],CT=Object.freeze({...gT,unknown:`unknown`}),wT=[CT.completed,CT.failed,CT.cancelled,CT.interrupted,CT.unknown],TT=Object.freeze({timeout:`timeout`,cancelled:`cancelled`,transportLost:`transport-lost`}),ET=[TT.timeout,TT.cancelled,TT.transportLost],DT=Object.freeze({spawnFailed:`spawn-failed`,cancelledBeforeStart:`cancelled-before-start`}),OT=[DT.spawnFailed,DT.cancelledBeforeStart];Object.freeze({errors:`all`,onExcessProperty:`error`});var kT=V.pipe(J(Y(LC,{identifier:`ObservabilityNonNegativeSafeInteger`,description:`a JSON-safe non-negative integer`})),_v(SC)),AT=V.pipe(J(Y(RC,{identifier:`ObservabilityPositiveSafeInteger`,description:`a positive JSON-safe integer`})),_v(CC)),jT=B.pipe(J(Y(VC,{identifier:`ObservabilitySafeIdentifier`,description:`a lowercase ASCII identifier no longer than 64 bytes`})),_v(wC));B.pipe(J(Y(HC,{identifier:`ObservabilityStableLabel`,description:`a provider-neutral lowercase ASCII label no longer than 64 bytes`})),_v(EC));var MT=B.pipe(J(Y(WC,{identifier:`ObservabilitySafeText`,description:`strict UTF-8 text without NUL or C0 controls other than LF`})),_v(DC)),NT=B.pipe(J(Y(UC,{identifier:`ObservabilitySourceNativeToolName`,description:`a non-empty source-native tool name no longer than 256 UTF-8 bytes`})),_v(TC));B.pipe(J(Y(KC,{identifier:`ObservabilityCanonicalDecimal`,description:`a non-negative canonical decimal string no longer than 64 bytes`})),_v(OC));var PT=B.pipe(J(Y(qC,{identifier:`ObservabilityCurrencyCode`,description:`an uppercase three-letter currency code`})),_v(kC)),FT=B.pipe(J(Y(vw,{identifier:`ObservabilityTurnId`,description:`a turn_ identifier with 26 lowercase Crockford base-32 characters`})),_v(JC)),IT=B.pipe(J(Y(yw,{identifier:`ObservabilityItemId`,description:`an item_ identifier with 26 lowercase Crockford base-32 characters`})),_v(YC)),LT=B.pipe(J(Y(bw,{identifier:`ObservabilityCallId`,description:`a call_ identifier with 26 lowercase Crockford base-32 characters`})),_v(XC)),RT=B.pipe(J(Y(ww,{identifier:`ObservabilityLegacySourceLocalCallId`,description:`a v1 source-local call identifier`})),_v(ew)),zT=B.pipe(J(Y(xw,{identifier:`ObservabilityEventId`,description:`an event_ identifier with 26 lowercase Crockford base-32 characters`})),_v(ZC)),BT=B.pipe(J(Y(Sw,{identifier:`ObservabilityToolOccurrenceId`,description:`a tool_ identifier with 26 lowercase Crockford base-32 characters`})),_v(QC)),VT=B.pipe(J(Y(Cw,{identifier:`ObservabilitySessionScopeId`,description:`a session_ identifier with 26 lowercase Crockford base-32 characters`})),_v($C)),HT=B.pipe(J(Y(Tw,{identifier:`ObservabilityCommandId`,description:`a command_ identifier with 26 lowercase Crockford base-32 characters`})),_v(tw)),UT=B.pipe(J(Y(Ew,{identifier:`ObservabilityUsageObservationId`,description:`a usage_ identifier with 26 lowercase Crockford base-32 characters`})),_v(nw)),WT=B.pipe(J(Y(Dw,{identifier:`ObservabilityIntervalId`,description:`an interval_ identifier with 26 lowercase Crockford base-32 characters`})),_v(rw)),GT=B.pipe(J(Y(Ow,{identifier:`ObservabilityDiagnosticId`,description:`a diagnostic_ identifier with 26 lowercase Crockford base-32 characters`})),_v(iw)),KT=K([`conversation-item`,`conversation-text`,`command-manifest`,`command-stdout`,`command-stderr`,`usage-observation`,`timing-interval`,`diagnostic`]).pipe(J(Y(Vw,{identifier:`ObservabilityCollectionTarget`,description:`a closed Observability collection target`}))),qT=K([`adapter`,`command-capture`,`usage-capture`,`timing-capture`,`diagnostic-capture`,`attempt-finalizer`,`run-teardown`]).pipe(J(Y(Hw,{identifier:`ObservabilityCollectionStage`,description:`a closed Observability capture stage`}))),JT=G([U({code:z(`capture-failed`),stage:qT,target:KT}),U({code:z(`capture-interrupted`),stage:qT,target:KT}),U({code:z(`collection-cap-reached`),target:KT,retained:kT,omittedAtLeast:AT}),U({code:z(`unsupported-input`),target:KT,omittedAtLeast:AT}),U({code:z(`text-truncated`),target:z(`conversation-text`),itemId:IT,retainedBytes:kT,omittedBytes:AT}),U({code:z(`text-truncated`),target:z(`command-manifest`),commandId:HT,retainedBytes:kT,omittedBytes:AT}),U({code:z(`text-truncated`),target:z(`diagnostic`),diagnosticId:GT,retainedBytes:kT,omittedBytes:AT}),U({code:z(`stream-truncated`),commandId:HT,stream:K([`stdout`,`stderr`]),retainedBytes:kT,omittedBytes:AT}),U({code:z(`invalid-utf8-replaced`),commandId:HT,stream:K([`stdout`,`stderr`]),replacementCount:AT}),U({code:z(`unsafe-control-stripped`),commandId:HT,stream:K([`stdout`,`stderr`]),strippedCount:AT}),U({code:z(`redacted`),target:KT,replacementCount:AT})]).pipe(J(Y(Yw,{identifier:`ObservabilityLimitation`,description:`a semantically valid closed Observability limitation`})));G([U({state:z(`complete`),limitations:dv([])}),U({state:z(`partial`),limitations:fv(JT)})]).pipe(J(Y(e=>Xw(e).length===0,{identifier:`ObservabilityCollection`,description:`a complete empty or partial canonically ordered limitation collection`})));var YT=U({family:z(`niceeval.agent-turns`),kind:z(`turn`),id:FT}),XT=U({family:z(`niceeval.agent-turns`),kind:z(`item`),id:IT}),ZT=U({family:z(`niceeval.agent-turns`),kind:z(`call`),id:LT}),QT=U({family:z(`niceeval.agent-turns`),kind:z(`event`),id:zT}),$T=U({family:z(`niceeval.agent-turns`),kind:z(`tool-occurrence`),id:BT}),eE=U({family:z(`niceeval.agent-turns`),kind:z(`session-scope`),id:VT}),tE=U({family:z(`niceeval.sandbox-commands`),kind:z(`command`),id:HT}),nE=U({family:z(`niceeval.agent-turns`),kind:z(`usage-observation`),id:UT}),rE=U({family:z(`niceeval.runner-activities`),kind:z(`interval`),id:WT}),iE=U({family:z(`niceeval.runner-diagnostics`),kind:z(`diagnostic`),id:GT}),aE=G([YT,XT,ZT,QT,$T,eE,tE,nE,rE,iE]),oE=G([rE,iE]);W(aE).pipe(J(Y(e=>e.length<=16&&Iw(e,`niceeval.agent-turns`)))),W(aE).pipe(J(Y(e=>e.length<=16&&Iw(e,`niceeval.sandbox-commands`)))),W(aE).pipe(J(Y(e=>e.length<=16&&Iw(e,`niceeval.agent-turns`)))),W(aE).pipe(J(Y(e=>e.length<=16&&Iw(e,`niceeval.runner-activities`)))),W(aE).pipe(J(Y(e=>e.length<=16&&Iw(e,`niceeval.runner-diagnostics`)))),W(oE).pipe(J(Y(e=>e.length<=16&&Lw(e,`niceeval.runner-activities`)))),W(oE).pipe(J(Y(e=>e.length<=16&&Lw(e,`niceeval.runner-diagnostics`))));var sE=mC,cE=K([`adapter`,`session-manager`,`sandbox-wrapper`,`runner-clock`,`runner-diagnostic-sink`,`attempt-finalizer`,`run-teardown`]),lE=K([`turn`,`turn-item`,`usage-observation`,`turn-context`,`command`,`stdout`,`stderr`,`activity`,`diagnostic`,`diagnostic-cause`,`value-byte`,`content-byte`]),uE=G([U({code:K([`capture-failed`,`capture-interrupted`]),stage:cE,target:lE}),U({code:K([`collection-cap-reached`,`unsupported-input`]),target:lE,omittedAtLeast:fC}),U({code:K([`text-truncated`,`redacted`,`invalid-utf8-replaced`,`unsafe-control-stripped`]),target:lE,replacementOrOmittedCount:fC})]);function dE(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 fE(e){let t,n=new Set;for(let r of e){let e=dE(r);if(n.has(e)||t!==void 0&&t>=e)return!1;n.add(e),t=e}return!0}var pE=G([U({state:z(`complete`),limitations:_C}),U({state:z(`partial`),limitations:fv(uE).pipe(J(Y(fE)))})]);Object.freeze({maximumBlobs:1,maximumBlobBytes:1,maximumTotalBytes:1});var mE={itemId:IT,eventId:zT,sessionSequence:AT},hE=G([U({state:z(`exact`),toolOccurrenceId:BT}),U({state:z(`unavailable`),reason:K([`orphan-finish`,`ambiguous-operation`])})]),gE=G([U({...mE,kind:z(`message`),role:K([`user`,`assistant`]),text:MT}),U({...mE,kind:z(`tool-start`),toolOccurrenceId:BT,tool:NT,inputSummary:MT}),U({...mE,kind:z(`tool-finish`),occurrence:hE,outcome:K([`completed`,`rejected`,`failed`,`cancelled`]),outputSummary:MT}),U({...mE,kind:K([`thinking-summary`,`compaction`,`context-injection`]),summary:MT}),U({...mE,kind:z(`subagent`),state:K([`started`,`completed`,`failed`]),label:jT,summary:MT}),U({...mE,kind:z(`input-request`),state:K([`requested`,`answered`,`cancelled`]),promptSummary:MT,responseSummary:q(MT)}),U({...mE,kind:K([`skill-load`,`conversation-error`]),code:jT,summary:MT})]),_E={itemId:IT,sequence:fC},vE=G([U({..._E,kind:z(`message`),role:K([`user`,`assistant`]),text:MT}),U({..._E,kind:z(`tool-call`),callId:RT,tool:NT,inputSummary:MT}),U({..._E,kind:z(`tool-result`),callId:RT,outcome:K([`completed`,`rejected`,`failed`,`cancelled`]),outputSummary:MT}),U({..._E,kind:K([`thinking-summary`,`compaction`,`context-injection`]),summary:MT}),U({..._E,kind:z(`subagent`),state:K([`started`,`completed`,`failed`]),label:jT,summary:MT}),U({..._E,kind:z(`input-request`),state:K([`requested`,`answered`,`cancelled`]),promptSummary:MT,responseSummary:q(MT)}),U({..._E,kind:K([`skill-load`,`conversation-error`]),code:jT,summary:MT})]),yE=G([U({usageObservationId:UT,kind:z(`token-bucket`),provider:jT,bucket:K([`input`,`output`,`cache-read`,`cache-write`,`reasoning`,`other`]),tokens:kT}),U({usageObservationId:UT,kind:z(`request`),provider:jT,requestKind:K([`model`,`tool`])}),U({usageObservationId:UT,kind:z(`provider-cost`),provider:jT,amount:B.pipe(J(Y(e=>/^(?:0|[1-9][0-9]*)(?:\.[0-9]*[1-9])?$/u.test(e)))),currency:PT})]),bE=K([`complete`,`partial`,`unavailable`]),xE=B.pipe(J(Y(e=>e.trim().length>0&&!!GC(e,16384),{identifier:`AgentTurnEvidenceCoverageReason`,description:`non-empty durable coverage reason within the conversation text limit`}))),SE=G([U({status:z(`complete`)}),U({status:K([`partial`,`unavailable`]),reason:xE})]),CE=U({events:SE,actions:SE,messages:SE,usage:SE,status:SE,data:SE}),wE=G([U({state:z(`recorded`),status:K([`completed`,`failed`,`waiting`]),evidenceCoverage:U({events:bE,actions:bE,messages:bE,usage:bE,status:bE,data:bE})}),U({state:z(`unavailable`),reason:K([`send-failed`,`send-interrupted`])})]),TE=G([U({state:z(`recorded`),status:K([`completed`,`failed`,`waiting`]),evidenceCoverage:CE}),U({state:z(`unavailable`),reason:K([`send-failed`,`send-interrupted`])})]),EE={segmentId:sE,turnId:FT,sequence:fC,outcome:K(_T),usage:W(yE)},DE=U({...EE,sessionId:VT,terminal:TE,items:W(gE)}),OE=U({...EE,terminal:TE,items:W(vE)}),kE=U({...EE,sessionId:VT,terminal:wE,items:W(gE)}),AE=U({...EE,terminal:wE,items:W(vE)});U({collection:pE,segments:W(AE)}).pipe(cv({collection:`collection-data`,segments:`segments-data`})),G([U({state:z(`current`),collection:pE,segments:W(kE)}).pipe(cv({collection:`collection-data`,segments:`segments-data`})),U({state:z(`legacy`),collection:pE,segments:W(AE)}).pipe(cv({collection:`collection-data`,segments:`segments-data`}))]),G([U({state:z(`current`),collection:pE,segments:W(DE)}).pipe(cv({collection:`collection-data`,segments:`segments-data`})),U({state:z(`legacy`),collection:pE,segments:W(OE)}).pipe(cv({collection:`collection-data`,segments:`segments-data`}))]);var jE=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}),ME=new TextEncoder;function NE(e){return ME.encode(e).byteLength}function PE(e){let t,n=new Set;for(let r of e){if(n.has(r)||t!==void 0&&Nb(t,r)>=0)return!1;n.add(r),t=r}return!0}function FE(e){return PE(e.map(VE))}var IE=B.pipe(J(Y(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`}))),LE=W(B.pipe(J(Y(e=>NE(e)<=jE.maximumPolicyEntryUtf8Bytes,{identifier:`FileChangesPolicyEntry`,description:`a File Changes include or ignore entry within its UTF-8 budget`})))).pipe(J(Y(e=>e.length<=jE.maximumPolicyEntries&&PE(e),{identifier:`FileChangesPolicyEntries`,description:`an ASCII-canonical, deduplicated bounded policy entry sequence`}))),RE=U({kind:z(`agent-send-window-endpoints`),policy:U({defaultPolicy:z(`niceeval.sandbox-ledger/default-excludes/v1`),include:LE,ignore:LE})}),zE=K([`checkpoint`,`export`,`finalizer-export`,`normalize`]),BE=G([U({code:K([`capture-failed`,`capture-interrupted`]),stage:zE,atWindowId:q(IE)}),U({code:z(`collection-cap-reached`),target:K([`window`,`change`,`content`,`value`,`content-byte`]),omittedAtLeast:fC,atWindowId:q(IE)}),U({code:z(`unsupported-input`),target:z(`endpoint-metadata`),omittedAtLeast:fC})]);function VE(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 HE=G([U({state:z(`complete`),limitations:_C}),U({state:z(`partial`),limitations:fv(BE).pipe(J(Y(FE,{identifier:`FileChangesPartialLimitations`,description:`a deterministic deduplicated File Changes limitation sequence`})))})]),UE=G([U({kind:z(`text`),sha256:ex,byteLength:dC.pipe(J(Y(e=>e<=jE.maximumTextRevisionBytes,{identifier:`FileChangesTextRevisionByteLength`,description:`a retained text revision within the File Changes text budget`}))),content:G([U({state:z(`available`),content:Lv.pipe(zv.maximumBytes(jE.maximumContentBytes))}),U({state:z(`omitted`),reason:z(`collection-cap`)})])}),U({kind:z(`elided`),reason:K([`binary`,`oversized-text`]),byteLength:dC}),U({kind:z(`unavailable`),reason:K([`unsupported-input`,`capture-failed`,`capture-interrupted`])})]),WE=G([U({state:z(`absent`)}),U({state:z(`present`),revision:UE})]);U({attribution:RE,collection:HE,windows:W(U({windowId:IE,sequence:fC,changes:W(U({changeId:nx,path:ax,kind:K([`created`,`modified`,`deleted`]),before:WE,after:WE}).pipe(J(Y(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(J(Y(e=>e.length<=jE.maximumChangesPerWindow&&PE(e.map(e=>e.path)),{identifier:`FileChangesWindowChanges`,description:`a bounded ASCII-path-canonical unique window change sequence`})))}))}).pipe(cv({attribution:`attribution-data`,collection:`collection-data`,windows:`windows-data`}));var GE=K([`available`,`partial`,`unavailable`,`empty`,`unsupported`,`failed`]),KE=B.pipe(J(Y(yw))),qE=B.pipe(J(Y(Sw))),JE=B.pipe(J(Y(Tw))),YE=G([U({kind:z(`redacted`),fieldCount:V}),U({kind:z(`sampled`),captured:V,knownTotal:L(V)}),U({kind:z(`truncated`),omittedBytes:V}),U({kind:z(`provider-limited`)})]),XE=G([U({code:K([`assertions-not-recorded`,`assertions-revision-unsupported`,`assertions-current-invalid`]),locator:B}),U({code:K([`attempt-origin-missing`,`attempt-not-observed`]),runId:B,slotId:B,evalId:B,attemptOrdinal:V}),U({code:z(`score-contribution-unavailable`),locator:B,entryId:B,reason:K([`source-unavailable`,`evaluation-errored`,`not-applicable`])}),U({code:z(`score-partial`),locator:q(B)})]),ZE=U({identity:U({kind:z(`attempt`),locator:B})}),QE=U({state:GE,value:q(V),samples:V,total:V,basis:K([`slot`,`eval`]),issues:W(XE),refs:W(ZE),unit:L(K([`points`,`USD`,`ms`,`tokens`])),bounds:L(U({min:V,max:V}))}),$E=U({...QE.fields,source:q(K([`observed`,`estimated`]))}),eD=G([U({identity:U({kind:z(`attempt`),locator:B}),state:K([`not-recorded`,`unsupported`,`failed`])}),U({identity:U({kind:z(`attempt`),locator:B}),entryId:B,groupPath:W(B),state:K([`complete`,`partial`,`unavailable`,`not-applicable`]),reason:L(K([`sampled`,`truncated`,`redacted`,`provider-limited`,`not-collected`,`source-unavailable`,`producer-failed`,`optional-material`,`unsupported-subject`])),limitations:W(YE)})]),tD={evaluationKind:K([`pass`,`points`,`mixed`]),denominator:U({expected:V,observed:V,classified:V,missing:V}),verdict:U({tally:U({passed:V,failed:V,errored:V,skipped:V}),passRate:QE}),score:QE,costUSD:$E,durationMs:QE,tokens:QE,coverage:W(eD),issues:W(XE)},nD=U({...iS.fields,verdict:q(K([`passed`,`failed`,`errored`,`skipped`])),score:QE,costUSD:$E,durationMs:QE,tokens:QE}),rD=G([U({state:z(`available`),value:B}),U({state:z(`mixed`)}),U({state:z(`unavailable`)})]),iD=lv(B,rD),aD=U({runId:B,slotId:B,evalId:B,attemptOrdinal:V,labels:iD,publication:G([rS,nD,aS])}),oD=U({experimentId:B,agent:rD,model:rD,labels:iD,groups:W(U({groupPath:W(B),...tD})),...tD}),sD=U({experimentId:B,evalId:B,groupPath:W(B),members:W(aD),...tD}),cD=U({totals:U(tD),experiments:W(oD),cells:W(sD)}),lD=U({experiment:oD,cells:W(sD)}),uD=U({value:GS,members:W(KS),attempts:W(qS)});W(U({runId:qb,state:z(`completed`),experimentId:Zb,invocationId:rv,startedAt:ox,completedAt:ox,coverage:U({published:V,expected:V})}));var dD=G([U({state:z(`not-scored`)}),U({state:z(`complete`),earned:V,possible:V}),U({state:z(`unavailable`),earned:V,possible:V,unavailable:V})]),fD=q(K([`passed`,`failed`,`errored`,`skipped`])),pD=U({runs:W(GS),denominator:U({expected:V,observed:V}),members:W(U({runId:B,slotId:B,evalId:B,attemptOrdinal:V,executionIdentityDigest:B,state:K([`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`,`missing`]),locator:q(B),outcome:q(K([`completed`,`errored`,`cancelled`,`interrupted`])),verdict:fD,score:L(dD)}))}),mD=U({channel:K([`events`,`actions`,`messages`,`usage`,`status`,`data`]),status:K([`complete`,`partial`,`unavailable`]),reason:L(B)}),hD=G([mD,U({owner:z(`assertion-material`),state:z(`partial`),reason:K([`sampled`,`truncated`,`redacted`,`provider-limited`]),limitations:W(YE)}),U({owner:z(`assertion-material`),state:z(`unavailable`),reason:K([`not-collected`,`source-unavailable`,`producer-failed`]),limitations:W(YE)}),U({owner:z(`assertion-material`),state:z(`not-applicable`),reason:K([`optional-material`,`unsupported-subject`]),limitations:W(YE)})]),gD=U({state:K([`available`,`not-recorded`,`partial`,`unavailable`])}),_D=U({assertions:gD,trace:gD,sources:gD,diff:gD,artifacts:gD,timing:gD,usage:gD,conversation:gD,commands:gD,diagnostics:gD}),vD=U({state:K([`available`,`not-recorded`,`invalid`]),entries:W(U({entryId:B,display:U({label:L(B),key:L(B),groupPath:W(B)})}))}),yD=G([U({state:z(`not-recorded`),entryCount:z(0)}),U({state:z(`available`),entryCount:V,sourceSiteCount:V}),U({state:K([`unsupported`,`failed`,`invalid`]),entryCount:z(0)})]),bD=U({core:qS,locator:B,originRun:GS,targets:W(U({runId:B,member:KS})),evidence:yD,assertions:vD,sections:_D,verdict:fD,score:dD,evidenceCoverage:W(mD),limitations:W(hD)}),xD=G([U({state:z(`available`),text:B}),U({state:z(`omitted`),reason:z(`inspection-result-byte-limit`),byteLength:V,byteLimit:V})]),SD=G([U({state:z(`mapped`),sourceItemId:B,sha256:B}),U({state:z(`unmapped`),reason:K([`source-snapshot-not-recorded`,`position-unrepresentable`])})]),CD=U({entryId:B,sourceOrder:V,role:K([`declaration`,`threshold`,`score`,`gate`,`optional`,`stop`]),start:U({line:V,column:V}),end:U({line:V,column:V}),source:SD}),wD=G([U({state:K([`not-recorded`,`invalid`]),sourceSites:dv([]),hasMoreSourceSites:z(!1),omittedSourceSiteCount:z(0)}),U({state:z(`available`),sourceSites:W(CD),hasMoreSourceSites:H,omittedSourceSiteCount:V})]),TD=U({state:K([`available`,`not-recorded`,`invalid`]),items:W(U({sourceItemId:B,path:B,byteLength:V,sha256:B,content:xD})),hasMore:H,omittedItemCount:V,assertions:wD}),ED=K([`complete`,`partial`,`not-recorded`,`invalid`]),DD=G([uE,U({issue:B}),U({source:z(`agent-turns`),turnId:FT,channel:K([`conversation`,`events`,`actions`,`messages`,`status`,`data`]),state:K([`partial`,`unavailable`]),reason:B}),U({source:z(`turn-contexts`),state:K([`partial`,`not-recorded`,`invalid`]),limitations:W(G([uE,U({issue:B})]))})]),OD=K(_T),kD=G([U({state:z(`not-recorded`)}),U({state:z(`unmapped`),reason:K([`location-not-captured`,`source-snapshot-not-recorded`,`position-unrepresentable`]),sessionIndex:V,turnIndex:V,sourceOrder:q(V)}),U({state:z(`mapped`),sourceItemId:tx,sha256:ex,start:U({line:V,column:V}),end:U({line:V,column:V}),sessionIndex:V,turnIndex:V,sourceOrder:V})]),AD=G([U({state:z(`complete`)}),U({state:K([`partial`,`unavailable`]),reason:B})]),jD=G([U({state:z(`recorded`),status:K([`completed`,`failed`,`waiting`]),coverage:U({events:AD,actions:AD,messages:AD,status:AD,data:AD})}),U({state:z(`unavailable`),reason:K([`send-failed`,`send-interrupted`]),coverage:U({state:z(`unavailable`),reason:K([`send-failed`,`send-interrupted`])})})]),MD=G([uE,U({issue:B})]),ND=U({sourceItemId:tx,sha256:ex,start:U({line:V,column:V}),end:U({line:V,column:V})}),PD=U({state:ED,limitations:W(MD),limitationsTruncated:H,omittedLimitationCount:V,items:W(U({diagnosticId:B,sequence:V,turnId:q(B),phase:K([`attempt.setup`,`sandbox.prepare`,`agent.ensure`,`eval.run`,`agent.send`,`sandbox.command`,`assertion.evaluate`,`verdict.fold`,`attempt.teardown`]),kind:K([`advisory`,`execution-error`]),code:B,summary:B,summaryTruncated:H,causes:W(U({code:B,summary:B,summaryTruncated:H})),causesTruncated:H,omittedCauseCount:V,redaction:G([U({state:z(`none`)}),U({state:z(`applied`),replacements:V})]),sourceFrame:q(ND)})),hasMore:H,omittedDiagnosticCount:V}),FD={itemId:KE,turnId:B,sequence:V},ID=G([U({...FD,kind:z(`message`),role:K([`user`,`assistant`]),text:B,textTruncated:H}),U({...FD,kind:z(`tool-call`),tool:B,input:B,inputTruncated:H,toolOccurrenceId:L(qE)}),U({...FD,kind:z(`tool-result`),outcome:K([`completed`,`rejected`,`failed`,`cancelled`]),output:B,outputTruncated:H,toolOccurrenceId:L(qE)}),U({...FD,kind:K([`thinking-summary`,`compaction`,`context-injection`]),summary:B,summaryTruncated:H}),U({...FD,kind:z(`subagent`),state:K([`started`,`completed`,`failed`]),label:B,summary:B,summaryTruncated:H}),U({...FD,kind:z(`input-request`),state:K([`requested`,`answered`,`cancelled`]),prompt:B,promptTruncated:H,response:q(B),responseTruncated:H}),U({...FD,kind:K([`skill-load`,`conversation-error`]),code:B,summary:B,summaryTruncated:H})]),LD=G([U({kind:z(`exited`),exitCode:V}),U({kind:z(`terminated`),reason:K(ET)}),U({kind:z(`not-started`),reason:K(OT)})]),RD=U({conversation:U({state:ED,limitations:W(DD),limitationsTruncated:H,omittedLimitationCount:V,turns:W(U({turnId:B,sequence:V,sessionId:L(VT),outcome:OD,terminal:jD,context:kD})),turnsTruncated:H,omittedTurnCount:V,items:W(ID),itemsTruncated:H,omittedItemCount:V}),commands:U({state:ED,limitations:W(DD),limitationsTruncated:H,omittedLimitationCount:V,items:W(U({commandId:JE,phase:K(ST),outcome:LD})),hasMore:H,omittedCommandCount:V}),diagnostics:PD,identityIndex:U({itemIds:W(KE),toolOccurrenceIds:U({ids:W(qE)}),commandIds:W(JE)})}),zD={itemId:KE,turnId:B,turnSequence:V,turnOutcome:OD,sessionId:L(B),eventId:L(B),sequence:L(V)},BD=G([U({...zD,kind:z(`message`),role:K([`user`,`assistant`]),text:B}),U({...zD,kind:z(`tool-call`),toolOccurrenceId:L(qE),tool:B,input:B}),U({...zD,kind:z(`tool-result`),toolOccurrenceId:L(qE),outcome:K([`completed`,`rejected`,`failed`,`cancelled`]),output:B}),U({...zD,kind:K([`thinking-summary`,`compaction`,`context-injection`]),summary:B}),U({...zD,kind:z(`subagent`),state:K([`started`,`completed`,`failed`]),label:B,summary:B}),U({...zD,kind:z(`input-request`),state:K([`requested`,`answered`,`cancelled`]),prompt:B,response:q(B)}),U({...zD,kind:K([`skill-load`,`conversation-error`]),code:B,summary:B})]),VD=U({turnId:B,sequence:V,outcome:OD}),HD=G([U({kind:z(`shell`),command:B}),U({kind:z(`argv`),executable:B,arguments:W(B)})]),UD=G([U({kind:z(`sandbox-default`)}),U({kind:z(`project-relative`),path:B}),U({kind:z(`redacted`)})]),WD=U({text:B,retainedBytes:V,totalSafeUtf8Bytes:V,sha256:B,truncation:U({state:K([`not-truncated`,`truncated`]),omittedSafeUtf8Bytes:V})}),GD=G([U({kind:z(`item`),itemId:KE,item:BD}),U({kind:z(`tool-occurrence`),toolOccurrenceId:qE,call:q(BD),result:q(BD),turn:U({call:q(VD),result:q(VD)})}),U({kind:z(`command`),commandId:JE,invocation:HD,workingDirectory:UD,outcome:LD,turnId:q(B),phase:K([`attempt.setup`,`sandbox.prepare`,`agent.ensure`,`eval.run`,`sandbox.command`,`attempt.teardown`]),sequence:V,stdout:WD,stderr:WD})]),KD=G([uE,U({issue:B})]),qD=G([U({state:z(`complete`)}),U({state:K([`partial`,`unavailable`]),reason:B})]),JD=G([KD,U({source:z(`agent-turns`),turnId:B,channel:z(`usage`),state:K([`partial`,`unavailable`]),reason:B})]),[YD,XD,ZD]=yE.members,QD=G([U({turnId:FT,...YD.fields}),U({turnId:FT,...XD.fields}),U({turnId:FT,...ZD.fields})]),$D=U({state:K([`available`,`partial`,`unavailable`]),value:q(V),observationCount:V}),eO=U({currency:B,value:B,observationCount:V}),tO=U({inputTokens:$D,outputTokens:$D,requests:$D,providerCosts:U({state:K([`available`,`partial`,`unavailable`]),values:W(eO),observationCount:V})}),nO=U({state:ED,limitations:W(JD),limitationsTruncated:H,omittedLimitationCount:V,turns:W(U({turnId:B,coverage:qD})),turnsTruncated:H,omittedTurnCount:V,observations:W(QD),totals:tO,hasMore:H,omittedObservationCount:V}),rO=K([`complete`,`partial`,`not-recorded`,`invalid`,`unavailable`]),iO=U({state:rO,facts:W(mD),limitations:W(hD)}),aO=U({state:rO,summary:q(U({turnCount:V,observationCount:V})),totals:tO,limitations:W(JD),limitationsTruncated:H,omittedLimitationCount:V}),oO=G([U({kind:z(`member-not-observed`),state:K([`missing`,`not-dispatched`,`interrupted`])}),U({kind:z(`attempt-unresolved`),originRunId:B,attemptId:B}),U({kind:z(`coverage`),detail:hD}),U({kind:z(`usage`),detail:JD})]),sO=U({slot:WS,state:K([`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`,`missing`]),locator:q(B),relation:q(K([`origin`,`reference`])),outcome:q(K([`completed`,`errored`,`cancelled`,`interrupted`])),verdict:fD,score:q(dD),coverage:iO,usage:aO,limitations:W(oO)}),cO=U({slotId:B,locator:q(B),limitation:oO}),lO=U({identity:U({runId:qb,experimentId:Zb}),startedAt:ox,completedAt:ox,denominator:U({expected:V,observed:V}),members:W(sO),coverage:U({state:rO,expectedMemberCount:V,observedMemberCount:V,completeMemberCount:V,factCount:V,limitations:W(cO)}),usage:U({state:rO,expectedMemberCount:V,observedMemberCount:V,recordedAttemptCount:V,totals:tO,limitations:W(cO)}),limitations:W(cO)}),uO=U({state:ED,limitations:W(KD),limitationsTruncated:H,omittedLimitationCount:V,activities:W(U({activityId:B,sequence:V,parentActivityId:q(B),turnId:q(B),phase:B,label:B,startOffsetMs:V,durationMs:V,outcome:K(wT)})),hasMore:H,omittedActivityCount:V}),dO=G([U({kind:z(`text`),sha256:B,byteLength:V,content:K([`available`,`omitted`])}),U({kind:z(`elided`),reason:K([`binary`,`oversized-text`]),byteLength:V}),U({kind:z(`unavailable`),reason:K([`unsupported-input`,`capture-failed`,`capture-interrupted`])})]),fO=G([U({state:z(`absent`)}),U({state:z(`present`),revision:dO})]),pO=U({windowId:B,sequence:V,changes:W(U({changeId:B,path:B,kind:K([`created`,`modified`,`deleted`]),before:fO,after:fO}))}),mO=G([U({state:z(`not-recorded`),windows:dv([])}),U({state:z(`invalid`),issues:W(B),windows:dv([])}),U({state:K([`complete`,`partial`]),limitations:W(BE),windows:W(pO)})]),hO=B.pipe(gv(e=>ab.test(e),{identifier:`AttemptLocator`,description:`a canonical @-prefixed Attempt locator`})),gO=B.pipe(J(Y(yw))),_O=B.pipe(J(Y(Sw))),vO=B.pipe(J(Y(Tw))),yO=W(qb),bO=(e,t)=>U({kind:z(e),...t}),xO=U({kind:K([`project-record`,`external-record`]),sealedCutoffIdentity:B}),SO=U({kind:z(`inspection-sealed-cutoff`),identity:B,runCount:V,runs:W(U({runId:B,logicalSealIdentity:B}))}),CO=U({requestedRunIds:W(B),selectedRunIds:W(B),missingRunIds:W(B)}),wO=U({protocol:z(Zw),outcome:z(`success`),source:xO,sealedCutoff:SO,selection:CO,issues:dv([]),evidence:U({refs:W(B)})}),TO=U({protocol:z(Zw),outcome:z(`success`),source:xO,sealedCutoff:U({kind:z(`inspection-sealed-cutoff`),identity:B,runCount:V}),selection:U({requestedRunIds:W(B),selectedRunIds:W(B),missingRunIds:W(B),returnedRunCount:V,totalRunCount:V,truncated:H}),issues:dv([]),evidence:U({refs:W(B)})}),EO=G([U({code:z(`selection-run-missing`),side:K([`left`,`right`]),runId:B}),U({code:z(`comparison-member-set-mismatch`)})]),DO=wO.pipe(ov({issues:W(EO)})),OO=G([U({state:z(`not-recorded`)}),U({state:z(`available`),value:R(xC),collection:U({state:K([`complete-page`,`bounded-page`]),items:W(R(bC)),hasMore:H}),contents:W(U({logicalHandle:B,byteLength:V,digest:B})),contentsTruncated:H})]),kO=U({runId:B,writerGeneration:B,startedAt:B,logicalSealIdentity:B,slotCount:V,memberCount:V,attemptCount:V,attachmentCount:V,contentCount:V,contentByteLength:V,sealEntryCount:V}),AO=U({key:B,runId:B,slotId:B,evalId:B,attemptOrdinal:V,locator:B}),jO=U({mode:K([`side-by-side`,`exact`,`paired`]),left:U({runs:W(GS),members:W(AO)}),right:U({runs:W(GS),members:W(AO)}),exactMemberSet:H,pairs:W(U({key:B,left:AO,right:AO}))}),MO=e=>Object.freeze(e),NO=Object.freeze({"overview.get":MO({request:bO(`overview.get`,{runIds:L(yO)}),result:{overview:cD},factKinds:[`core`,`assertions`,`attempt-cost`]}),"experiment.get":MO({request:bO(`experiment.get`,{experimentId:Zb}),result:{experiment:lD},factKinds:[`core`,`assertions`,`attempt-cost`]}),"runs.list":MO({request:bO(`runs.list`,{continuation:L(B)}),result:{runs:W(kO),continuation:L(B)},factKinds:[`core`]}),"run.get":MO({request:bO(`run.get`,{runId:qb}),result:{run:uD},factKinds:[`core`]}),"run.summary":MO({request:bO(`run.summary`,{runId:qb}),result:{summary:pD},factKinds:[`core`,`assertions`,`agent-turns`]}),"run.overview":MO({request:bO(`run.overview`,{runId:qb}),result:{runOverview:lO},factKinds:[`core`,`assertions`,`agent-turns`]}),"attempt.get":MO({request:bO(`attempt.get`,{locator:hO}),result:{attempt:bD},factKinds:[`core`,`assertions`]}),"attempt.assertion.detail":MO({request:bO(`attempt.assertion.detail`,{locator:hO,entryId:wy}),result:{assertion:hT},factKinds:[`assertions`,`agent-turns`,`sources`]}),"attempt.trace":MO({request:bO(`attempt.trace`,{locator:hO}),result:{trace:RD},factKinds:[`agent-turns`,`turn-contexts`,`sandbox-commands`,`runner-activities`,`runner-diagnostics`]}),"attempt.trace.detail":MO({request:bO(`attempt.trace.detail`,{locator:hO,selector:G([bO(`item`,{itemId:gO}),bO(`tool-occurrence`,{toolOccurrenceId:_O}),bO(`command`,{commandId:vO})])}),result:{detail:GD},factKinds:[`agent-turns`,`sandbox-commands`]}),"attempt.timing":MO({request:bO(`attempt.timing`,{locator:hO}),result:{timing:uO},factKinds:[`runner-activities`]}),"attempt.usage":MO({request:bO(`attempt.usage`,{locator:hO}),result:{usage:nO},factKinds:[`agent-turns`]}),"attempt.diff":MO({request:bO(`attempt.diff`,{locator:hO}),result:{diff:mO},factKinds:[`file-changes`]}),"attempt.sources":MO({request:bO(`attempt.sources`,{locator:hO}),result:{sources:TD},factKinds:[`assertions`,`sources`]}),"attempt.artifacts":MO({request:bO(`attempt.artifacts`,{locator:hO}),result:{artifacts:OO},factKinds:[`artifacts`]}),"runs.compare":MO({request:bO(`runs.compare`,{mode:K([`side-by-side`,`exact`,`paired`]),leftRunIds:yO,rightRunIds:yO}),result:{comparison:jO},factKinds:[`core`]})}),PO=K(Object.freeze(Object.keys(NO))),FO=Object.entries(NO),IO=U({protocol:z(Zw),operation:G(FO.map(([,e])=>e.request))}),LO=(e,t)=>{let n=ov({operation:z(e),...t.result});return e===`runs.list`?TO.pipe(n):e===`runs.compare`?DO.pipe(n):wO.pipe(n)},RO=G(FO.map(([e,t])=>LO(e,t))),zO=(e,t)=>{let n=ov({outcome:z(`explanation`),operation:z(e),factKinds:dv(t.factKinds.map(e=>z(e)))});return e===`runs.list`?TO.pipe(n):wO.pipe(n)},BO=G(FO.map(([e,t])=>zO(e,t))),VO=G(FO.map(([e])=>U({id:z(e)}))),HO=G([U({protocol:z(Zw),outcome:z(`discovery`),operations:W(VO)}),RO,BO,U({protocol:z(Zw),outcome:z(`failure`),operation:q(PO),failure:U({code:K([`inspection-request-invalid`,`inspection-selection-missing`,`inspection-source-invalid`,`inspection-record-integrity-failure`,`inspection-operation-failed`,`inspection-result-invalid`]),reason:B,identity:L(U({runId:B})),correction:K([`fix-request`,`choose-existing-selection`,`fix-record-source`,`retry`,`upgrade-or-report`])})})]);function UO(e){let t=Z_(HO,{errors:`all`,onExcessProperty:`error`})(e);return Ld(t)?{success:!0,value:e}:{success:!1,reason:String(t.failure)}}function WO(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 GO=Z_(IO,{onExcessProperty:`error`});function KO(e){let t=GO({protocol:Zw,operation:e});return Id(t)?I(Object.freeze({classification:`protocol/query`,code:`inspection-request-invalid`,reason:String(t.failure)})):Fd(t.success.operation)}Z_(IO,{onExcessProperty:`error`});function qO(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:JO(r,`numbers must be finite`);if(Array.isArray(e)){if(t.has(e))return JO(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(YO(e))return e;i.push(e)}return t.delete(e),Object.freeze(i)}if(typeof e!=`object`||!e)return JO(r,`unsupported ${typeof e} value`);if(t.has(e))return JO(r,`cyclic objects are not encodable`);let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)return JO(r,`only plain objects may cross Inspection delivery`);t.add(e);let a={};for(let t of Object.keys(e).sort(ZO)){let i=n(Reflect.get(e,t),[...r,t]);if(YO(i))return i;a[t]=i}return t.delete(e),Object.freeze(a)};return n(e,[])}function JO(e,t){return Object.freeze({code:`inspection-result-invalid`,reason:`${e.length===0?`$`:e.join(`.`)}: ${t}`})}function YO(e){return XO(e)&&e.code===`inspection-result-invalid`&&typeof e.reason==`string`}function XO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ZO(e,t){return e<t?-1:+(e>t)}function QO(e){let t=qO(e);return ek(t)?I(t):Fd(`${$O(t)}\n`)}function $O(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map($O).join(`,`)}]`;let t=e;return`{${Object.keys(t).sort(tk).map(e=>`${JSON.stringify(e)}:${$O(t[e])}`).join(`,`)}}`}function ek(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Reflect.get(e,`code`)===`inspection-result-invalid`&&typeof Reflect.get(e,`reason`)==`string`}function tk(e,t){return e<t?-1:+(e>t)}function nk(e,t){let n=QO(t);if(Id(n))throw Error(`Inspection operation query key is invalid: ${n.failure.reason}`);return[`inspection`,e,`${t.kind}:${n.success}`]}function rk(e,t){return Sc({queryKey:nk(e.identity,t),queryFn:()=>e.inspectRepository(t)})}var ik=(0,v.createContext)(null);function ak({runtime:e,children:t}){let n=(0,v.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)(ik.Provider,{value:n.binding,children:(0,M.jsx)(Zo,{client:e.queryClient,children:t})})}function ok(){let e=(0,v.useContext)(ik);if(e===null)throw Error(`useCurrentGeneration must be used inside InspectionRuntimeProvider.`);return e}function sk(e,t={}){let n=(0,v.useContext)(ik);if(n===null)throw Error(`useInspectionQuery must be used inside InspectionRuntimeProvider.`);let r=(t.enabled??!0)&&e!==null;if(e===null)return bc({queryKey:[`inspection`,n.identity,`disabled`],queryFn:Ds,enabled:!1});let i=rk(n,e);return bc({queryKey:i.queryKey,queryFn:i.queryFn,enabled:r,...t.select===void 0?{}:{select:t.select}})}var ck=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(rk(this.generation,e))}release(){this.#e||(this.#e=!0,this.generation.releaseLease())}},lk=class{repository;queryClient;onClosed;identity;#e=`preparing`;#t=0;#n=0;#r;binding;constructor(e,t,n){this.repository=e,this.queryClient=t,this.onClosed=n,this.identity=e.generationId;let r=this;this.binding=Object.freeze({identity:this.identity,queryClient:this.queryClient,get snapshot(){return r.snapshot},inspectRepository(e){return r.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 ck(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.#s(),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.#s(),this.repository.close(),this.onClosed())}#s(){this.queryClient.removeQueries({type:`inactive`,predicate:e=>e.queryKey[1]===this.identity})}},uk=class{#e;#t=new Set;#n=new Map;#r=new Set;#i=!1;queryClient=new uc({defaultOptions:{queries:{gcTime:5*6e4,retry:1,staleTime:1/0,refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1}}});get current(){return this.#e}acquireCurrent(){this.#a();let e=this.#e;if(e===void 0)throw Error(`No View generation has been committed.`);return e.acquire()}subscribe(e){return this.#a(),this.#r.add(e),()=>this.#r.delete(e)}prepare(e){if(this.#i)throw e.close(),Error(`View runtime is disposed.`);let t=this.#n.get(e.generationId);if(t!==void 0)throw t.repository!==e&&e.close(),Error(`View generation ${e.generationId} already has an owner.`);let n;n=new lk(e,this.queryClient,()=>{this.#n.get(n.identity)===n&&this.#n.delete(n.identity)});try{let e={generation:n,lease:n.acquire()};return this.#n.set(n.identity,n),this.#t.add(n),e}catch(e){throw n.close(),e}}attachSnapshot(e,t){if(this.#a(),!this.#t.has(e.generation)||this.#n.get(e.generation.identity)!==e.generation)throw Error(`Only a prepared View generation can receive a snapshot.`);e.generation.attachSnapshot(t)}commit(e){if(this.#a(),!this.#t.has(e.generation)||this.#n.get(e.generation.identity)!==e.generation||e.generation.status!==`preparing`)throw Error(`Only an open View generation can be committed.`);e.generation.snapshot,this.#t.delete(e.generation);let t=this.#e;e.generation.publish(),this.#e=e.generation,e.lease.release();for(let e of this.#r)e();return t}retire(e){e!==void 0&&e!==this.#e&&this.#n.get(e.identity)===e&&e.drain()}reject(e){!this.#t.has(e.generation)||this.#n.get(e.generation.identity)!==e.generation||e.generation.status!==`preparing`||(this.#t.delete(e.generation),e.lease.release(),e.generation.close())}dispose(){if(!this.#i){this.#i=!0,this.#r.clear(),this.#e=void 0,this.#t.clear();for(let e of[...this.#n.values()])e.close();this.#n.clear(),this.queryClient.clear()}}#a(){if(this.#i)throw Error(`View runtime is disposed.`)}},dk=class extends Error{classification=`route-input`;translationKey=`report.unableToLoad`},fk=class extends Error{classification=`selection`;translationKey=`report.unableToLoad`};function pk(e){let t=KO(e);if(Id(t))throw new dk(`Invalid Insight route input.`);return t.success}function mk(e=[]){let t=pk({kind:`overview.get`,...e.length===0?{}:{runIds:e}});if(t.kind!==`overview.get`)throw new dk(`Invalid overview operation.`);return t}function hk(e){let t=pk({kind:`run.get`,runId:e}),n=pk({kind:`run.summary`,runId:e});if(t.kind!==`run.get`||n.kind!==`run.summary`)throw new dk(`Invalid run route.`);return[t,n]}function gk(e){let t=pk({kind:`attempt.get`,locator:e}),n=pk({kind:`attempt.trace`,locator:e});if(t.kind!==`attempt.get`||n.kind!==`attempt.trace`)throw new dk(`Invalid attempt route.`);return[t,n]}function _k(e){let t=pk(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 dk(`Invalid Attempt detail operation.`)}}function vk(e){return Object.freeze({state:`available`,value:e})}function yk(){return Object.freeze({state:`unavailable`})}function bk(e){return e===`complete`?`available`:e===`partial`?`partial`:e===`not-recorded`?`not-recorded`:`unavailable`}function xk(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?yk():vk(n.attemptOrdinal)}),verdict:e.attempt.verdict??`unknown`,startedAt:new Date(e.attempt.originRun.startedAt).toISOString(),durationMs:yk(),capabilities:Object.freeze({source:e.attempt.sections.sources.state,execution:bk(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 Sk(e,t){let[n,r]=gk(t);return Sc({queryKey:[`insight-attempt`,e.identity,t],queryFn:async()=>{let[t,i]=await Promise.all([e.queryClient.fetchQuery(rk(e,n)),e.queryClient.fetchQuery(rk(e,r))]);return xk(t,i)}})}function Ck(e,t,n,r,i){return Sc({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 fk(`Results selection is unavailable.`);let a=e?.members??[];return Object.freeze({overview:n,selectedExperiments:a,selectionTitle:e?.label??`Results`})}})}function wk(e,t,n){return Sc({queryKey:[`insight-experiment`,e.identity,n],queryFn:async()=>{if(!t.catalog.experiments.includes(n))throw new fk(`Experiment selection is unavailable.`);let e=[n];return Object.freeze({overview:t,selectedExperiments:Object.freeze(e),selectionTitle:e[0]??`Results`})}})}function Tk(e){let t=e.overview.cells.map(e=>Object.freeze({experimentId:e.experimentId,evalId:e.evalId,evaluationKind:e.evaluationKind,passRate:Ek(e.verdict.passRate),score:Ek(e.score),costUSD:Ek(e.costUSD),durationMs:Ek(e.durationMs),tokens:Ek(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:Ek(e.publication.score),costUSD:Ek(e.publication.costUSD),durationMs:Ek(e.publication.durationMs),tokens:Ek(e.publication.tokens)}):e.publication})))})),n=e.overview.experiments.map(e=>Object.freeze({experimentId:e.experimentId,evaluationKind:e.evaluationKind,passRate:Ek(e.verdict.passRate),score:Ek(e.score),costUSD:Ek(e.costUSD),durationMs:Ek(e.durationMs),tokens:Ek(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:Ek(e.verdict.passRate),score:Ek(e.score),costUSD:Ek(e.costUSD),durationMs:Ek(e.durationMs),tokens:Ek(e.tokens)})))})),r=n.map(({experimentId:e})=>e),i=jk(t.flatMap(e=>e.members.map(t=>({runId:t.runId,experimentId:e.experimentId}))),({runId:e})=>e),a=jk(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 Ek(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 Dk(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(Ok),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:kk(n.groups),evalRows:Object.freeze(o),href:`#/experiment/${encodeURIComponent(t)}`})]})}function Ok(e){let t=e.members.flatMap(t=>{if(t.publication.state!==`published`)return[];let n=e.members.length===1?Ak(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 kk(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 Ak(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 jk(e,t){let n=new Map;for(let r of e)n.set(t(r),r);return Object.freeze([...n.values()])}function Mk(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 Nk(e,t){let[n,r]=hk(t);return Sc({queryKey:[`insight-run`,e.identity,t],queryFn:async()=>{let[t,i]=await Promise.all([e.queryClient.fetchQuery(rk(e,n)),e.queryClient.fetchQuery(rk(e,r))]);return Mk(t,i)}})}typeof window<`u`&&window.document&&window.document.createElement;function Pk(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Fk(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ik(...e){return t=>{let n=!1,r=e.map(e=>{let r=Fk(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Fk(e[t],null)}}}}function Lk(...e){return v.useCallback(Ik(...e),e)}function Rk(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=v.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>v.createContext(e));return function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,zk(i,...t)]}function zk(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Bk=globalThis?.document?v.useLayoutEffect:()=>{},Vk=v.useId||(()=>void 0),Hk=0;function Uk(e){let[t,n]=v.useState(Vk());return Bk(()=>{e||n(e=>e??String(Hk++))},[e]),e||(t?`radix-${t}`:``)}var Wk=v.useInsertionEffect||Bk;function Gk({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Kk({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=v.useRef(e!==void 0);v.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,v.useCallback(t=>{if(s){let n=qk(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Kk({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return Wk(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function qk(e){return typeof e==`function`}function Jk(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];tA(r)&&typeof aA==`function`&&(r=aA(r._payload)),v.Children.forEach(r,e=>{if($k(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;tA(n)&&typeof aA==`function`&&(n=aA(n._payload)),a=Xk(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?Qk(a):void 0,l=Lk(n,c);if(!a){if(r||r===0)throw Error(o?iA(e):rA(e));return r}let u=Zk(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Yk=Symbol.for(`radix.slottable`),Xk=(e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null};function Zk(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Qk(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $k(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Yk}var eA=Symbol.for(`react.lazy`);function tA(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===eA&&`_payload`in e&&nA(e._payload)}function nA(e){return typeof e==`object`&&!!e&&`then`in e}var rA=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,iA=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,aA=v.use,oA=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Jk(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sA(e,t){e&&y.flushSync(()=>e.dispatchEvent(t))}function cA(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}function lA(e,t=globalThis?.document){let n=cA(e);v.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var uA=`DismissableLayer`,dA=`dismissableLayer.update`,fA=`dismissableLayer.pointerDownOutside`,pA=`dismissableLayer.focusOutside`,mA,hA=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),gA=v.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(hA),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=Lk(t,e=>f(e)),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(_),b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=bA(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!S||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces}),T=xA(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p);return lA(e=>{b===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(mA=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),SA(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=mA))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),SA())},[d,u]),v.useEffect(()=>{let e=()=>m({});return document.addEventListener(dA,e),()=>document.removeEventListener(dA,e)},[]),(0,M.jsx)(oA.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Pk(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Pk(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Pk(e.onPointerDownCapture,w.onPointerDownCapture)})});gA.displayName=uA;var _A=`DismissableLayerBranch`,vA=v.forwardRef((e,t)=>{let n=v.useContext(hA),r=v.useRef(null),i=Lk(t,r);return v.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,M.jsx)(oA.div,{...e,ref:i})});vA.displayName=_A;function yA(){let e=v.useContext(hA),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function bA(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=cA(e),s=v.useRef(!1),c=v.useRef(!1),l=v.useRef(new Map),u=v.useRef(()=>{});return v.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(`click`,u.current);let r=t();e(),r||CA(fA,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,u.current),u.current=s,n.addEventListener(`click`,u.current,{once:!0}))}else n.removeEventListener(`click`,u.current),e();s.current=!1},m=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(`pointerdown`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(`pointerdown`,p),n.removeEventListener(`click`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function xA(e,t=globalThis?.document){let n=cA(e),r=v.useRef(!1);return v.useEffect(()=>{let e=e=>{e.target&&!r.current&&CA(pA,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function SA(){let e=new CustomEvent(dA);document.dispatchEvent(e)}function CA(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?sA(i,a):i.dispatchEvent(a)}var wA=`focusScope.autoFocusOnMount`,TA=`focusScope.autoFocusOnUnmount`,EA={bubbles:!1,cancelable:!0},DA=`FocusScope`,OA=v.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=cA(i),u=cA(a),d=v.useRef(null),f=Lk(t,e=>c(e)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:FA(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||FA(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&FA(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){IA.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(wA,EA);s.addEventListener(wA,l),s.dispatchEvent(t),t.defaultPrevented||(kA(zA(jA(s)),{select:!0}),document.activeElement===e&&FA(s))}return()=>{s.removeEventListener(wA,l),setTimeout(()=>{let t=new CustomEvent(TA,EA);s.addEventListener(TA,u),s.dispatchEvent(t),t.defaultPrevented||FA(e??document.body,{select:!0}),s.removeEventListener(TA,u),IA.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=AA(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&FA(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&FA(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,M.jsx)(oA.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});OA.displayName=DA;function kA(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(FA(r,{select:t}),document.activeElement!==n)return}function AA(e){let t=jA(e);return[MA(t,e),MA(t.reverse(),e)]}function jA(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function MA(e,t){for(let n of e)if(!NA(n,{upTo:t}))return n}function NA(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function PA(e){return e instanceof HTMLInputElement&&`select`in e}function FA(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&PA(e)&&t&&e.select()}}var IA=LA();function LA(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=RA(e,t),e.unshift(t)},remove(t){e=RA(e,t),e[0]?.resume()}}}function RA(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zA(e){return e.filter(e=>e.tagName!==`A`)}var BA=`Portal`,VA=v.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=v.useState(!1);Bk(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?y.createPortal((0,M.jsx)(oA.div,{...r,ref:t}),o):null});VA.displayName=BA;function HA(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}var UA=e=>{let{present:t,children:n}=e,r=WA(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=KA(r.ref,JA(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null};UA.displayName=`Presence`;function WA(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),[o,s]=HA(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{let e=qA(r.current);a.current=o===`mounted`?e:`none`},[o]),Bk(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=qA(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Bk(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=qA(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=qA(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:v.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function GA(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function KA(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=GA(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():GA(n[e],null)}}},[])}function qA(e){return e?.animationName||`none`}function JA(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YA=0,XA=null;function ZA(){v.useEffect(()=>{XA||={start:QA(),end:QA()};let{start:e,end:t}=XA;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),YA++,()=>{YA===1&&(XA?.start.remove(),XA?.end.remove(),XA=null),YA=Math.max(0,YA-1)}},[])}function QA(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var $A=function(){return $A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$A.apply(this,arguments)};function ej(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function tj(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var nj=`right-scroll-bar-position`,rj=`width-before-scroll-bar`,ij=`with-scroll-bars-hidden`,aj=`--removed-body-scroll-bar-size`;function oj(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function sj(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var cj=typeof window<`u`?v.useLayoutEffect:v.useEffect,lj=new WeakMap;function uj(e,t){var n=sj(t||null,function(t){return e.forEach(function(e){return oj(e,t)})});return cj(function(){var t=lj.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||oj(e,null)}),i.forEach(function(e){r.has(e)||oj(e,a)})}lj.set(n,e)},[e]),n}function dj(e){return e}function fj(e,t){t===void 0&&(t=dj);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function pj(e){e===void 0&&(e={});var t=fj(null);return t.options=$A({async:!0,ssr:!1},e),t}var mj=function(e){var t=e.sideCar,n=ej(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,$A({},n))};mj.isSideCarExport=!0;function hj(e,t){return e.useMedium(t),mj}var gj=pj(),_j=function(){},vj=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:_j,onWheelCapture:_j,onTouchMoveCapture:_j}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=ej(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=uj([n,t]),w=$A($A({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:gj,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),$A($A({},w),{ref:C})):v.createElement(y,$A({},w,{className:c,ref:C}),s))});vj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vj.classNames={fullWidth:rj,zeroRight:nj};var yj,bj=function(){if(yj)return yj;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function xj(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=bj();return t&&e.setAttribute(`nonce`,t),e}function Sj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Cj(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var wj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xj())&&(Sj(t,n),Cj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Tj=function(){var e=wj();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ej=function(){var e=Tj();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Dj={left:0,top:0,right:0,gap:0},Oj=function(e){return parseInt(e||``,10)||0},kj=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Oj(n),Oj(r),Oj(i)]},Aj=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Dj;var t=kj(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jj=Ej(),Mj=`data-scroll-locked`,Nj=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
19
+ .${ij} {
20
+ overflow: hidden ${r};
21
+ padding-right: ${s}px ${r};
22
+ }
23
+ body[${Mj}] {
24
+ overflow: hidden ${r};
25
+ overscroll-behavior: contain;
26
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
27
+ padding-left: ${i}px;
28
+ padding-top: ${a}px;
29
+ padding-right: ${o}px;
30
+ margin-left:0;
31
+ margin-top:0;
32
+ margin-right: ${s}px ${r};
33
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
34
+ }
35
+
36
+ .${nj} {
37
+ right: ${s}px ${r};
38
+ }
39
+
40
+ .${rj} {
41
+ margin-right: ${s}px ${r};
42
+ }
43
+
44
+ .${nj} .${nj} {
45
+ right: 0 ${r};
46
+ }
47
+
48
+ .${rj} .${rj} {
49
+ margin-right: 0 ${r};
50
+ }
51
+
52
+ body[${Mj}] {
53
+ ${aj}: ${s}px;
54
+ }
55
+ `},Pj=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Fj=function(){v.useEffect(function(){return document.body.setAttribute(Mj,(Pj()+1).toString()),function(){var e=Pj()-1;e<=0?document.body.removeAttribute(Mj):document.body.setAttribute(Mj,e.toString())}},[])},Ij=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Fj();var a=v.useMemo(function(){return Aj(i)},[i]);return v.createElement(jj,{styles:Nj(a,!t,i,n?``:`!important`)})},Lj=!1;if(typeof window<`u`)try{var Rj=Object.defineProperty({},"passive",{get:function(){return Lj=!0,!0}});window.addEventListener(`test`,Rj,Rj),window.removeEventListener(`test`,Rj,Rj)}catch{Lj=!1}var zj=Lj?{passive:!1}:!1,Bj=function(e){return e.tagName===`TEXTAREA`},Vj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Bj(e)&&n[t]===`visible`)},Hj=function(e){return Vj(e,`overflowY`)},Uj=function(e){return Vj(e,`overflowX`)},Wj=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),qj(e,r)){var i=Jj(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gj=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Kj=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},qj=function(e,t){return e===`v`?Hj(t):Uj(t)},Jj=function(e,t){return e===`v`?Gj(t):Kj(t)},Yj=function(e,t){return e===`h`&&t===`rtl`?-1:1},Xj=function(e,t,n,r,i){var a=Yj(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Jj(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&qj(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Zj=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qj=function(e){return[e.deltaX,e.deltaY]},$j=function(e){return e&&`current`in e?e.current:e},eM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tM=function(e){return`
56
+ .block-interactivity-${e} {pointer-events: none;}
57
+ .allow-interactivity-${e} {pointer-events: all;}
58
+ `},nM=0,rM=[];function iM(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(nM++)[0],a=v.useState(Ej)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=tj([e.lockRef.current],(e.shards||[]).map($j),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Zj(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Wj(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Wj(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Xj(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!rM.length||rM[rM.length-1]!==a)){var r=`deltaY`in n?Qj(n):Zj(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&eM(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map($j).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:aM(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Zj(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Qj(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Zj(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return rM.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,zj),document.addEventListener(`touchmove`,c,zj),document.addEventListener(`touchstart`,u,zj),function(){rM=rM.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,zj),document.removeEventListener(`touchmove`,c,zj),document.removeEventListener(`touchstart`,u,zj)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:tM(i)}):null,p?v.createElement(Ij,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var oM=hj(gj,iM),sM=v.forwardRef(function(e,t){return v.createElement(vj,$A({},e,{ref:t,sideCar:oM}))});sM.classNames=vj.classNames;var cM=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},lM=new WeakMap,uM=new WeakMap,dM={},fM=0,pM=function(e){return e&&(e.host||pM(e.parentNode))},mM=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=pM(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},hM=function(e,t,n,r){var i=mM(t,Array.isArray(e)?e:[e]);dM[n]||(dM[n]=new WeakMap);var a=dM[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(lM.get(e)||0)+1,l=(a.get(e)||0)+1;lM.set(e,c),a.set(e,l),o.push(e),c===1&&i&&uM.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),fM++,function(){o.forEach(function(e){var t=lM.get(e)-1,i=a.get(e)-1;lM.set(e,t),a.set(e,i),t||(uM.has(e)||e.removeAttribute(r),uM.delete(e)),i||e.removeAttribute(n)}),fM--,fM||(lM=new WeakMap,lM=new WeakMap,uM=new WeakMap,dM={})}},gM=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||cM(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),hM(r,i,n,`aria-hidden`)):function(){return null}},_M=`Dialog`,[vM,yM]=Rk(_M),[bM,xM]=vM(_M),SM=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=Gk({prop:r,defaultProp:i??!1,onChange:a,caller:_M});return(0,M.jsx)(bM,{scope:t,triggerRef:s,contentRef:c,contentId:Uk(),titleId:Uk(),descriptionId:Uk(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};SM.displayName=_M;var CM=`DialogTrigger`,wM=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xM(CM,n),a=Lk(t,i.triggerRef);return(0,M.jsx)(oA.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":WM(i.open),...r,ref:a,onClick:Pk(e.onClick,i.onOpenToggle)})});wM.displayName=CM;var TM=`DialogPortal`,[EM,DM]=vM(TM,{forceMount:void 0}),OM=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=xM(TM,t);return(0,M.jsx)(EM,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,M.jsx)(UA,{present:n||a.open,children:(0,M.jsx)(VA,{asChild:!0,container:i,children:e})}))})};OM.displayName=TM;var kM=`DialogOverlay`,AM=v.forwardRef((e,t)=>{let n=DM(kM,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=xM(kM,e.__scopeDialog);return a.modal?(0,M.jsx)(UA,{present:r||a.open,children:(0,M.jsx)(MM,{...i,ref:t})}):null});AM.displayName=kM;var jM=Jk(`DialogOverlay.RemoveScroll`),MM=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xM(kM,n),a=Lk(t,yA());return(0,M.jsx)(sM,{as:jM,allowPinchZoom:!0,shards:[i.contentRef],children:(0,M.jsx)(oA.div,{"data-state":WM(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),NM=`DialogContent`,PM=v.forwardRef((e,t)=>{let n=DM(NM,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=xM(NM,e.__scopeDialog);return(0,M.jsx)(UA,{present:r||a.open,children:a.modal?(0,M.jsx)(FM,{...i,ref:t}):(0,M.jsx)(IM,{...i,ref:t})})});PM.displayName=NM;var FM=v.forwardRef((e,t)=>{let n=xM(NM,e.__scopeDialog),r=v.useRef(null),i=Lk(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return gM(e)},[]),(0,M.jsx)(LM,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Pk(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Pk(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Pk(e.onFocusOutside,e=>e.preventDefault())})}),IM=v.forwardRef((e,t)=>{let n=xM(NM,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,M.jsx)(LM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),LM=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=xM(NM,n);return ZA(),(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(OA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,M.jsx)(gA,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":WM(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),RM=`DialogTitle`,zM=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xM(RM,n);return(0,M.jsx)(oA.h2,{id:i.titleId,...r,ref:t})});zM.displayName=RM;var BM=`DialogDescription`,VM=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xM(BM,n);return(0,M.jsx)(oA.p,{id:i.descriptionId,...r,ref:t})});VM.displayName=BM;var HM=`DialogClose`,UM=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xM(HM,n);return(0,M.jsx)(oA.button,{type:`button`,...r,ref:t,onClick:Pk(e.onClick,()=>i.onOpenChange(!1))})});UM.displayName=HM;function WM(e){return e?`open`:`closed`}var GM=(0,v.createContext)(!1);function KM({locked:e,children:t}){return(0,M.jsx)(GM.Provider,{value:e,children:t})}function qM(){return(0,v.useContext)(GM)}function JM(){let e=Tr(),[t,n]=(0,v.useState)(`idle`),r=(0,v.useRef)(!0),i=(0,v.useRef)(0),a=(0,v.useRef)(!1),o=(0,v.useRef)(void 0),s=(0,v.useRef)(void 0),c=(0,v.useRef)([]),l=(0,v.useRef)([]),u=t!==`idle`,d=(0,v.useCallback)(({nextLocation:e})=>{let t=o.current;if(!u||t===void 0||!t.active||t.signal.aborted||!r.current)return!1;let n={sequence:++i.current,source:a.current?`fallback`:`user`,location:e};t.latestIntent=n;let s=c.current.filter(e=>e.session===t&&e.intent.sequence<n.sequence);c.current=c.current.filter(e=>e.session!==t||e.intent.sequence>=n.sequence);for(let e of s)e.resolve(void 0);return!0},[u]),f=Kr(d),p=(0,v.useRef)(f);p.current=f;let m=(0,v.useCallback)(e=>{if(!r.current||!e.active)throw Error(`View refresh navigation lock owner is no longer active.`);if(e.signal.aborted)throw e.signal.reason},[]),h=(0,v.useCallback)((e,t)=>{m(e);let n=p.current;return YM(n,t)?Promise.resolve(n):new Promise((n,r)=>{c.current.push({session:e,intent:t,resolve:n,reject:r})})},[m]),g=(0,v.useCallback)(e=>(m(e),p.current.state===`unblocked`?Promise.resolve():new Promise((t,n)=>l.current.push({session:e,resolve:t,reject:n}))),[m]),_=(0,v.useCallback)((e,t)=>{if(!e.active)return;e.active=!1,e.removeAbortListener(),o.current===e&&(o.current=void 0);let n=s.current;n?.session===e&&(s.current=void 0,n.reject(t));let r=c.current.filter(t=>t.session===e);c.current=c.current.filter(t=>t.session!==e);for(let e of r)e.reject(t);let i=l.current.filter(t=>t.session===e);l.current=l.current.filter(t=>t.session!==e);for(let e of i)e.reject(t)},[]),y=(0,v.useCallback)(e=>{if(e.aborted)return Promise.reject(e.reason);if(!r.current||s.current!==void 0||o.current!==void 0||t!==`idle`)return Promise.reject(Error(`A View refresh navigation lock is already active.`));let i,a=()=>_(i,e.reason);return i={signal:e,active:!0,removeAbortListener:()=>e.removeEventListener(`abort`,a)},o.current=i,e.addEventListener(`abort`,a,{once:!0}),n(`locked`),new Promise((e,t)=>{s.current={session:i,resolve:e,reject:t}})},[_,t]),b=(0,v.useRef)(void 0);return b.current===void 0&&(b.current={hasUserIntent:()=>o.current?.latestIntent?.source===`user`,enqueueFallback:async t=>{let n=o.current;if(n===void 0)throw Error(`View refresh navigation lock is not active.`);if(m(n),n.latestIntent?.source!==`user`){a.current=!0;try{await e(t,{replace:!0,state:null})}finally{a.current=!1}if(n.latestIntent===void 0)throw Error(`View refresh fallback navigation was not blocked.`);m(n)}},release:async()=>{let e=o.current;if(e===void 0)throw Error(`View refresh navigation lock is not active.`);return e.release===void 0&&(e.release=(async()=>{m(e);let t;for(;e.latestIntent!==void 0;){let n=e.latestIntent,r=await h(e,n);if(m(e),e.latestIntent?.sequence!==n.sequence)continue;let i=p.current;if(!(r===void 0||!YM(i,n)||i!==r)){t=n.source,i.proceed();break}}return m(e),await g(e),m(e),n(`idle`),e.active=!1,e.removeAbortListener(),o.current===e&&(o.current=void 0),t})()),e.release},recover:()=>{let e=o.current;if(e===void 0)throw Error(`View refresh navigation lock is not active.`);m(e),n(`recovery`)}}),(0,v.useEffect)(()=>{if(t!==`locked`||s.current===void 0)return;let e=s.current;m(e.session),s.current=void 0,e.resolve(b.current)},[t,m,d]),(0,v.useEffect)(()=>{if(f.state!==`blocked`)return;let e=c.current.filter(e=>YM(f,e.intent));c.current=c.current.filter(e=>!YM(f,e.intent));for(let t of e)try{m(t.session),t.resolve(f)}catch(e){t.reject(e)}},[f,m]),(0,v.useEffect)(()=>{if(f.state!==`unblocked`)return;let e=l.current.splice(0);for(let t of e)try{m(t.session),t.resolve()}catch(e){t.reject(e)}},[f,m]),(0,v.useEffect)(()=>(r.current=!0,()=>{r.current=!1;let e=o.current;e!==void 0&&_(e,Error(`View refresh navigation lock owner was unmounted.`))}),[_]),{acquire:y,interactionLocked:u,recoveryRequired:t===`recovery`}}function YM(e,t){return e.state===`blocked`&&e.location===t.location&&XM(e.location,t.location)}function XM(e,t){return e.key===t.key&&e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}function ZM({title:e,children:t,onClose:n}){let{t:r}=Uo(),i=qM();return(0,M.jsx)(SM,{open:!0,onOpenChange:e=>{e||n()},children:(0,M.jsxs)(OM,{children:[(0,M.jsx)(AM,{className:`niceeval-view-dialog-overlay`,inert:i?!0:void 0}),(0,M.jsxs)(PM,{className:`niceeval-view-dialog`,inert:i?!0:void 0,onEscapeKeyDown:e=>{i&&e.preventDefault()},onPointerDownOutside:e=>{i&&e.preventDefault()},children:[(0,M.jsxs)(`div`,{className:`niceeval-view-dialog-head`,children:[(0,M.jsx)(zM,{className:`niceeval-view-dialog-title`,children:e}),(0,M.jsx)(UM,{disabled:i,className:`niceeval-view-dialog-close`,"aria-label":r(`report.close`),children:`×`})]}),(0,M.jsx)(`div`,{className:`niceeval-view-dialog-body niceeval-view-report-slot`,children:t})]})]})})}function QM(e,t){return typeof e==`string`?e:e[t]??e.en??Object.values(e).find(e=>typeof e==`string`)??``}function $M(...e){return e.filter(Boolean).join(` `)}function eN(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function tN(e){return typeof e==`string`?!0:eN(e)&&Object.values(e).every(e=>typeof e==`string`)}function nN(e,t,n,r){return Error(`<${e}> received invalid ${n} from ${t}: ${r}.`)}function rN(e){return e.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,``)}function iN(e){let t=/^turn[-_ ]?(\d+)$/i.exec(e);return t===null?e:`Turn ${t[1]}`}function aN(e){if(e<1e3)return`${Math.round(e)}ms`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function oN(e,t=`en`){return new Intl.NumberFormat(t===`zh-CN`?`zh-CN`:`en-US`,{maximumFractionDigits:12,maximumSignificantDigits:12}).format(e)}function sN(e,t=`en`){return`${oN(e,t)} ${e===1?`pt`:`pts`}`}function cN(e,t){let n=new Date(e);return Number.isNaN(n.valueOf())?e:n.toLocaleString(t===`zh-CN`?`zh-CN`:`en-US`)}function lN(e){let t=Math.abs(e);if(t!==0&&t<1e-9)return`$${e.toExponential(4)}`;let n=t===0||t>=1?6:Math.min(12,Math.max(2,Math.ceil(-Math.log10(t))+5));return`$${e.toFixed(n).replace(/(?:\.0+|(?:(\.[0-9]*?)0+))$/,`$1`)}`}var uN={error:3,warning:2,info:1};function dN(e){return e.length===0||pN(e)===0}function fN(e){let t=[];for(let n of e){let e=n.groups;if(n.items.length===0&&e?.length===1){t.push(e[0]);continue}t.push(n)}return t}function pN(e){let t=0,n=e=>{for(let r of e)t+=r.items.length,r.groups&&n(r.groups)};return n(e),t}function mN(e){let t=`info`,n=e=>{for(let r of e){for(let e of r.items)uN[e.level]>uN[t]&&(t=e.level);r.groups&&n(r.groups)}};return n(e),t}function hN(e){return[...new Set(e.map(e=>e.command).filter(e=>e!==void 0))]}function gN(e){let t=hN(e.items);return t.length>1?null:t.length===1?t[0]:e.command??null}function _N(e,t){return t===`zh-CN`?e===`error`?`错误`:e===`warning`?`警告`:`提示`:e===`error`?`errors`:e===`warning`?`warnings`:`notices`}function vN(e,t){let n=fN(e),r=pN(e),i=_N(mN(e),t);if(n.length===1){let e=QM(n[0].title,t);return t===`zh-CN`?`${e} · ${r} 条${i}`:`${e} · ${r} ${i}`}return t===`zh-CN`?`${n.length} 组 · ${r} 条${i}`:`${n.length} groups · ${r} ${i}`}function yN(e,t){return e===`zh-CN`?`${t} 条明细`:t===1?`1 detail`:`${t} details`}function bN(e,t){let n=QM(e.message,t),r=e.count??1;return r<=1?n:`${n} ×${r}`}function xN({text:e,className:t,children:n}){let[r,i]=(0,v.useState)(!1),a=async()=>{try{if(navigator.clipboard===void 0)throw Error(`Clipboard API unavailable`);await navigator.clipboard.writeText(e),i(!0),window.setTimeout(()=>i(!1),1500)}catch{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();let n=document.execCommand(`copy`);t.remove(),n&&(i(!0),window.setTimeout(()=>i(!1),1500))}};return(0,M.jsxs)(`button`,{type:`button`,className:t,onClick:()=>void a(),children:[n,r?` ✓`:``]})}function SN(...e){return e.filter(Boolean).join(` `)}function CN(e,t){return eN(e)?e.level!==`error`&&e.level!==`warning`&&e.level!==`info`?`"${t}.level" must be error | warning | info`:tN(e.message)?null:`"${t}.message" must be a LocalizedText`:`"${t}" must be an object`}function wN(e,t){if(!eN(e))return`"${t}" must be an object`;if(!tN(e.title))return`"${t}.title" must be a LocalizedText`;if(!Array.isArray(e.items))return`"${t}.items" must be an array`;for(let n=0;n<e.items.length;n++){let r=CN(e.items[n],`${t}.items[${n}]`);if(r!==null)return r}return null}function TN(e){if(!Array.isArray(e))throw nN(`Callouts`,`toSampleNotices`,`CalloutGroup[]`,`"items" must be an array`);for(let t=0;t<e.length;t++){let n=wN(e[t],`items[${t}]`);if(n!==null)throw nN(`Callouts`,`toSampleNotices`,`CalloutGroup[]`,n)}return e}function EN({command:e}){return(0,M.jsx)(xN,{className:`niceeval-callout-command`,text:e,children:(0,M.jsx)(`code`,{children:e})})}function DN({group:e,locale:t,detailsOpen:n}){let r=gN(e),i=e.groups;return(0,M.jsxs)(`li`,{className:`niceeval-callout-group`,children:[(0,M.jsxs)(`div`,{className:SN(`niceeval-callout-head`,`niceeval-callout-head--${mN([e])}`),children:[(0,M.jsx)(`span`,{className:`niceeval-callout-title`,children:QM(e.title,t)}),e.badges?.map((e,n)=>(0,M.jsx)(`span`,{className:`niceeval-callout-badge`,children:QM(e,t)},n)),r===null?null:(0,M.jsx)(EN,{command:r})]}),e.items.length>0?(0,M.jsxs)(`details`,{className:`niceeval-callout-details`,open:n||void 0,children:[(0,M.jsx)(`summary`,{children:yN(t,e.items.length)}),(0,M.jsx)(`ul`,{className:`niceeval-callout-items`,children:e.items.map((e,n)=>(0,M.jsxs)(`li`,{className:SN(`niceeval-callout-item`,`niceeval-callout-item--${e.level}`),children:[(0,M.jsx)(`span`,{className:`niceeval-callout-message`,children:bN(e,t)}),r===null&&e.command!==void 0?(0,M.jsx)(EN,{command:e.command}):null]},n))})]}):null,i&&i.length>0?(0,M.jsx)(`ul`,{className:`niceeval-callout-nested`,children:fN(i).map((e,r)=>(0,M.jsx)(DN,{group:e,locale:t,detailsOpen:n},r))}):null]})}function ON(e,t,n){if(dN(e))return null;let r=fN(e),i=pN(e)<=3,a=mN(e);return(0,M.jsx)(`div`,{className:SN(`niceeval-report`,`niceeval-callouts`,n),children:(0,M.jsxs)(`details`,{className:`niceeval-callouts-root`,children:[(0,M.jsx)(`summary`,{className:SN(`niceeval-callouts-summary`,`niceeval-callouts-summary--${a}`),children:vN(e,t)}),(0,M.jsx)(`ul`,{className:`niceeval-callout-groups`,children:r.map((e,n)=>(0,M.jsx)(DN,{group:e,locale:t,detailsOpen:i},n))})]})})}function kN({items:e,locale:t,className:n}){return ON(TN(e??[]),t,n)}function AN(...e){return e.filter(Boolean).join(` `)}function jN(e,t,n){return e===`zh-CN`?n:t}function MN(e){try{return JSON.parse(e)}catch{return}}function NN(e){return eN(e)?e:void 0}function PN(e,t){for(let n of t){let t=e[n];if(typeof t==`string`)return t}}function FN(e,t){for(let n of t){let t=e[n];if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)return t}}function IN(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e)))}function LN({children:e,tone:t}){return(0,M.jsx)(`pre`,{className:AN(`niceeval-tool-evidence-code`,t===`error`&&`niceeval-tool-evidence-code--error`),children:e})}function RN({label:e,children:t}){return(0,M.jsxs)(`section`,{className:`niceeval-tool-evidence-section`,children:[(0,M.jsx)(`h5`,{children:e}),t]})}function zN(e,t){let n=PN(e,[`command`,`cmd`,`script`]);if(n===void 0)return;let r=PN(e,[`cwd`,`workdir`]),i=IN(e,new Set([`command`,`cmd`,`script`,`cwd`,`workdir`]));return(0,M.jsxs)(`div`,{className:`niceeval-tool-evidence`,"data-tool-evidence-kind":`command`,children:[r===void 0?null:(0,M.jsxs)(`div`,{className:`niceeval-tool-evidence-context`,children:[(0,M.jsx)(`span`,{children:jN(t,`Working directory`,`工作目录`)}),(0,M.jsx)(`code`,{children:r})]}),(0,M.jsx)(RN,{label:jN(t,`Command`,`命令`),children:(0,M.jsx)(LN,{children:n})}),Object.keys(i).length===0?null:(0,M.jsx)(RN,{label:jN(t,`Additional input`,`其他输入`),children:(0,M.jsx)(LN,{children:JSON.stringify(i,null,2)})})]})}function BN(e,t){let n=PN(e,[`output`,`stdout`]),r=PN(e,[`stderr`]),i=FN(e,[`exit_code`,`exitCode`]),a=FN(e,[`signal`]);if(n===void 0&&r===void 0&&i===void 0&&a===void 0)return;let o=IN(e,new Set([`output`,`stdout`,`stderr`,`exit_code`,`exitCode`,`signal`]));return(0,M.jsxs)(`div`,{className:`niceeval-tool-evidence`,"data-tool-evidence-kind":`terminal`,children:[(0,M.jsxs)(`div`,{className:`niceeval-tool-evidence-context`,children:[i===void 0?null:(0,M.jsxs)(`span`,{children:[jN(t,`Exit`,`退出码`),` `,(0,M.jsx)(`strong`,{"data-failed":Number(i)!==0||void 0,children:String(i)})]}),a===void 0?null:(0,M.jsxs)(`span`,{children:[jN(t,`Signal`,`信号`),` `,(0,M.jsx)(`strong`,{children:String(a)})]})]}),n===void 0?null:(0,M.jsx)(RN,{label:jN(t,`Output`,`输出`),children:(0,M.jsx)(LN,{children:n||jN(t,`No output`,`无输出`)})}),r===void 0||r===``?null:(0,M.jsx)(RN,{label:`stderr`,children:(0,M.jsx)(LN,{tone:`error`,children:r})}),Object.keys(o).length===0?null:(0,M.jsx)(RN,{label:jN(t,`Additional result`,`其他结果`),children:(0,M.jsx)(LN,{children:JSON.stringify(o,null,2)})})]})}function VN(e,t){let n=e.phase===`finished`?e.outputSummary??``:e.inputSummary,r=MN(n),i=NN(r),a=i===void 0?void 0:e.phase===`started`?zN(i,t):BN(i,t);if(a!==void 0)return a;let o=r===void 0?n:typeof r==`string`?r:JSON.stringify(r,null,2);return(0,M.jsx)(`div`,{className:`niceeval-tool-evidence`,"data-tool-evidence-kind":r===void 0?`text`:`json`,children:(0,M.jsx)(RN,{label:r===void 0?jN(t,`Text`,`文本`):`JSON`,children:(0,M.jsx)(LN,{tone:e.outcome===`failed`||e.outcome===`rejected`?`error`:void 0,children:o})})})}function HN({content:e,locale:t}){return VN(e,t)}function UN(...e){return e.filter(Boolean).join(` `)}function WN(e,t){return e.kind===`tool-evidence`?(0,M.jsx)(HN,{content:e.content,locale:t}):e.kind===`text`?(0,M.jsx)(`div`,{className:UN(`niceeval-report`,`niceeval-text`,e.className),children:e.text}):e.items.map((e,n)=>(0,M.jsx)(v.Fragment,{children:WN(e,t)},n))}function GN(e,t,n=140){let r=rN(QM(e,t)).replace(/\s+/g,` `).trim();return r.length>n?`${r.slice(0,n)}…`:r}function KN(e){let t=e.classification===`succeeded`?`COMMAND`:e.classification===`failed`?`FAILED COMMAND`:`NON-ZERO COMMAND · observed`,n=e.exitCode===void 0?typeof e.outcome==`string`?e.outcome:JSON.stringify(e.outcome):`exit ${e.exitCode}`;return`${t} · ${e.phase} · ${n}${e.durationMs===void 0?``:` · ${e.durationMs}ms`}`}function qN({command:e}){return(0,M.jsxs)(`article`,{className:UN(`niceeval-command-evidence-card`,`niceeval-command-evidence--${e.classification}`),children:[(0,M.jsx)(`header`,{className:`niceeval-conversation-turn-head`,children:(0,M.jsx)(`span`,{className:`niceeval-conversation-turn-label`,children:KN(e)})}),(0,M.jsx)(`div`,{className:`niceeval-command-evidence-display`,children:e.display}),e.stdout?(0,M.jsxs)(`details`,{className:`niceeval-conversation-entry niceeval-conversation-entry--expandable`,children:[(0,M.jsx)(`summary`,{className:`niceeval-conversation-entry-summary`,children:`stdout`}),(0,M.jsx)(`pre`,{className:`niceeval-conversation-io`,children:e.stdout})]}):null,e.stderr?(0,M.jsxs)(`details`,{className:`niceeval-conversation-entry niceeval-conversation-entry--expandable`,open:!0,children:[(0,M.jsx)(`summary`,{className:`niceeval-conversation-entry-summary`,children:`stderr`}),(0,M.jsx)(`pre`,{className:`niceeval-conversation-io`,children:e.stderr})]}):null]})}function JN(e){if(e==null)return null;if(!eN(e)||!Array.isArray(e.commands))throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands" must be an array`);for(let[t,n]of e.commands.entries()){if(!eN(n))throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}]" must be an object`);if(typeof n.commandId!=`string`)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].commandId" must be a string`);if(typeof n.phase!=`string`)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].phase" must be a string`);if(typeof n.display!=`string`)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].display" must be a string`);if(n.exitCode!==void 0&&typeof n.exitCode!=`number`)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].exitCode" must be a number`);if(n.outcome===void 0)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].outcome" must be present`);if(n.classification!==`succeeded`&&n.classification!==`observed`&&n.classification!==`failed`)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].classification" must be succeeded | observed | failed`);if(n.durationMs!==void 0&&typeof n.durationMs!=`number`)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].durationMs" must be a number`);if(n.stdout!==void 0&&typeof n.stdout!=`string`)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].stdout" must be a string`);if(n.stderr!==void 0&&typeof n.stderr!=`string`)throw nN(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].stderr" must be a string`)}return e}function YN({data:e,className:t,locale:n}){let r=JN(e);return r===null||r.commands.length===0?null:(0,M.jsx)(`section`,{className:UN(`niceeval-report`,`niceeval-command-evidence`,t),children:(0,M.jsxs)(`details`,{className:`niceeval-command-evidence-region`,children:[(0,M.jsx)(`summary`,{className:`niceeval-command-evidence-summary`,children:QM({en:`Commands · ${r.commands.length}`,"zh-CN":`命令证据 · ${r.commands.length}`},n)}),(0,M.jsx)(`div`,{className:`niceeval-command-evidence-cards`,children:r.commands.map(e=>(0,M.jsx)(qN,{command:e},e.commandId))})]})})}function XN(e){return e===`added`?`A`:e===`deleted`?`D`:`M`}function ZN(e){return e===`binary`?`binary`:`oversized text`}function QN(e){return[...e].sort((e,t)=>e.path.localeCompare(t.path))}var $N=new TextEncoder;function eP(e){let t=0;for(let n of e.windows)n.patch!==void 0&&(t+=$N.encode(n.patch).length);return t}function tP(e){let t=new Set,n=0;for(let r of QN(e)){if(r.elided)continue;let e=eP(r);e===0||e>65536||n+e>524288||(n+=e,t.add(r.path))}return t}function nP(e,t){return{name:e,path:t,dirs:new Map,files:[]}}function rP(e){let t=nP(``,``);for(let n of QN(e)){let e=n.path.split(`/`),r=t;for(let t=0;t<e.length-1;t++){let n=e[t],i=r.path===``?n:`${r.path}/${n}`,a=r.dirs.get(n);a===void 0&&(a=nP(n,i),r.dirs.set(n,a)),r=a}r.files.push(n)}return iP(t)}function iP(e){let t=e;for(;t.files.length===0&&t.dirs.size===1&&t.path!==``;){let e=[...t.dirs.values()][0];t={name:`${t.name}/${e.name}`,path:e.path,dirs:e.dirs,files:e.files}}let n=[...t.dirs.values()].map(iP).sort((e,t)=>e.path.localeCompare(t.path)),r=t.files,i=r.length,a=0,o=0;for(let e of r)a+=e.added,o+=e.removed;for(let e of n)i+=e.fileCount,a+=e.added,o+=e.removed;return{name:t.name,path:t.path,dirs:n,files:r,fileCount:i,added:a,removed:o}}function aP(e,t){if(!eN(e))return`"${t}" must be a DiffFile object`;if(typeof e.path!=`string`)return`"${t}.path" must be a string`;if(e.change!==`added`&&e.change!==`modified`&&e.change!==`deleted`)return`"${t}.change" must be added | modified | deleted`;if(typeof e.added!=`number`)return`"${t}.added" must be a number`;if(typeof e.removed!=`number`)return`"${t}.removed" must be a number`;if(!Array.isArray(e.windows))return`"${t}.windows" must be an array of DiffFileWindow`;for(let n=0;n<e.windows.length;n++){let r=e.windows[n];if(!eN(r)||typeof r.window!=`string`)return`"${t}.windows[${n}].window" must be a string`;if(r.patch!==void 0&&typeof r.patch!=`string`)return`"${t}.windows[${n}].patch" must be a string`}return null}function oP(e){if(e==null)return null;if(!Array.isArray(e))throw nN(`DiffView`,`diffViewFiles`,`DiffContent`,`"files" must be an array or null`);for(let t=0;t<e.length;t++){let n=aP(e[t],`files[${t}]`);if(n!==null)throw nN(`DiffView`,`diffViewFiles`,`DiffContent`,n)}return e}function sP(e){let t=[],n=1,r=1;for(let i of e.split(`
59
+ `)){if(i.startsWith(`@@`)){t.push({kind:`meta`,oldNo:null,newNo:null,text:i});let e=i.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);e&&(n=Number(e[1]),r=Number(e[2]));continue}if(i.startsWith(`+++`)||i.startsWith(`---`)){t.push({kind:`meta`,oldNo:null,newNo:null,text:i});continue}if(i.startsWith(`+`)){t.push({kind:`add`,oldNo:null,newNo:r,text:i.slice(1)}),r+=1;continue}if(i.startsWith(`-`)){t.push({kind:`remove`,oldNo:n,newNo:null,text:i.slice(1)}),n+=1;continue}let e=i.startsWith(` `)?i.slice(1):i;t.push({kind:`context`,oldNo:n,newNo:r,text:e}),n+=1,r+=1}return t}function cP({patch:e}){return(0,M.jsx)(`pre`,{className:`niceeval-diff-patch`,children:sP(e).map((e,t)=>(0,M.jsxs)(`div`,{className:$M(`niceeval-diff-patch-line`,e.kind===`add`&&`niceeval-diff-patch-line--add`,e.kind===`remove`&&`niceeval-diff-patch-line--remove`,e.kind===`meta`&&`niceeval-diff-patch-line--meta`),children:[(0,M.jsx)(`span`,{className:`niceeval-diff-patch-ln niceeval-diff-patch-ln-old`,children:e.oldNo===null?``:e.oldNo}),(0,M.jsx)(`span`,{className:`niceeval-diff-patch-ln niceeval-diff-patch-ln-new`,children:e.newNo===null?``:e.newNo}),(0,M.jsx)(`span`,{className:`niceeval-diff-patch-text`,children:e.text})]},t))})}function lP({windows:e}){let t=e.filter(e=>e.patch!==void 0&&e.patch.length>0);return t.length===0?(0,M.jsx)(`p`,{className:`niceeval-diff-patch-missing`,children:`Patch unavailable for this file.`}):(0,M.jsx)(M.Fragment,{children:t.map(e=>(0,M.jsxs)(`section`,{className:`niceeval-diff-window`,children:[(0,M.jsxs)(`h4`,{className:`niceeval-diff-window-title`,children:[`window `,iN(e.window)]}),(0,M.jsx)(cP,{patch:e.patch})]},e.window))})}function uP(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function dP({added:e,removed:t}){return(0,M.jsxs)(`span`,{className:`niceeval-diff-lines`,children:[(0,M.jsxs)(`span`,{className:`niceeval-diff-lines-added`,children:[`+`,e]}),` / `,(0,M.jsxs)(`span`,{className:`niceeval-diff-lines-removed`,children:[`-`,t]})]})}function fP({file:e}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`niceeval-diff-change`,"data-change":e.change,children:XN(e.change)}),(0,M.jsx)(`span`,{className:`niceeval-diff-path`,children:uP(e.path)}),e.elided?(0,M.jsxs)(`span`,{className:`niceeval-diff-bytes`,children:[ZN(e.elided.reason),` `,e.elided.beforeBytes??0,` → `,e.elided.afterBytes??0,` bytes`]}):(0,M.jsx)(dP,{added:e.added,removed:e.removed})]})}function pP({file:e,inlined:t,drillCommand:n}){let r=$M(`niceeval-diff-file`,`niceeval-diff-${e.change}`);if(!t){let t=e.elided;return(0,M.jsxs)(`li`,{className:r,"data-inlined":`false`,children:[(0,M.jsx)(`div`,{className:`niceeval-diff-file-summary`,children:(0,M.jsx)(fP,{file:e})}),(0,M.jsxs)(`p`,{className:`niceeval-diff-patch-omitted`,children:[t?`${ZN(t.reason)} file · content elided from the diff export`:`patch over inline budget`,t===void 0&&n!==void 0?(0,M.jsxs)(M.Fragment,{children:[` · `,(0,M.jsx)(`code`,{children:`${n}=${e.path}`})]}):null]})]})}return(0,M.jsx)(`li`,{className:r,"data-inlined":`true`,children:(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{className:`niceeval-diff-file-summary`,children:(0,M.jsx)(fP,{file:e})}),(0,M.jsx)(lP,{windows:e.windows})]})})}function mP({node:e,inlined:t,drillCommand:n}){return(0,M.jsxs)(`ul`,{className:`niceeval-diff-tree`,children:[e.dirs.map(e=>(0,M.jsx)(`li`,{className:`niceeval-diff-dir`,children:(0,M.jsxs)(`details`,{open:!0,children:[(0,M.jsxs)(`summary`,{className:`niceeval-diff-dir-summary`,children:[(0,M.jsxs)(`span`,{className:`niceeval-diff-dir-name`,children:[e.name,`/`]}),(0,M.jsxs)(`span`,{className:`niceeval-diff-dir-count`,children:[e.fileCount,` `,e.fileCount===1?`file`:`files`]}),(0,M.jsx)(dP,{added:e.added,removed:e.removed})]}),(0,M.jsx)(mP,{node:e,inlined:t,drillCommand:n})]})},e.path)),e.files.map(e=>(0,M.jsx)(pP,{file:e,inlined:t.has(e.path),drillCommand:n},e.path))]})}function hP({files:e,className:t,drillCommand:n}){let r=oP(e);return r===null||r.length===0?null:(0,M.jsx)(`div`,{className:$M(`niceeval-report`,`niceeval-diff-view`,t),children:(0,M.jsx)(mP,{node:rP(r),inlined:tP(r),drillCommand:n})})}function X(e,t,n){return e===`zh-CN`?n:t}function gP(e,t){switch(e){case`requirement`:return X(t,`Requirement`,`目标`);case`observed`:return X(t,`Observed`,`结果`);case`examined`:return X(t,`Examined`,`检查范围`);case`coverage`:return X(t,`Source`,`记录完整度`)}}function _P(e,t){switch(e){case`matched`:return X(t,`Match`,`命中`);case`mismatched`:return X(t,`No match`,`未命中`);case`unavailable`:return X(t,`Unknown`,`无法判断`);case`not-evaluated`:return X(t,`Not evaluated`,`未参与判断`);case`not-retained`:return X(t,`Checked`,`已检查`);case`outside-snapshot`:return X(t,`After evaluation`,`评估后出现`);case`legacy`:return X(t,`Recorded`,`已记录`)}}function vP(e,t){switch(e){case`tool`:return X(t,`Tool call`,`工具调用`);case`event`:return X(t,`Event`,`事件`);case`legacy-source-row`:return X(t,`Record`,`记录`)}}function yP(e,t){return e===void 0?null:e===`matched`?X(t,`match`,`命中`):e===`mismatched`?X(t,`different`,`不匹配`):X(t,`unknown`,`无法判断`)}function bP({fields:e,locale:t}){return e.length===0?null:(0,M.jsx)(`dl`,{className:`niceeval-filter-row-fields`,children:e.map((e,n)=>{let r=yP(e.state,t);return(0,M.jsxs)(`div`,{"data-field-state":e.state,children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(`pre`,{children:e.value})}),r===null?null:(0,M.jsx)(`span`,{children:r})]},`${e.label}:${n}`)})})}function xP({anchor:e,locale:t}){return(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-filter-row-target`,onClick:()=>{let t=document.getElementById(`conversation-${e}`)??document.getElementById(`trace-${e}`),n=t?.closest(`details`);n instanceof HTMLDetailsElement&&(n.open=!0),t?.scrollIntoView({behavior:`smooth`,block:`center`}),t instanceof HTMLElement&&t.focus()},children:[X(t,`View in conversation`,`在会话中查看`),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`↗`})]})}function SP({row:e,locale:t}){let n=`${vP(e.kind,t)} ${e.number}`,r=e.fields.length>0||(e.difference?.length??0)>0||e.note!==void 0||e.conversationTarget!==void 0,i=(0,M.jsxs)(`span`,{className:`niceeval-filter-row-summary`,children:[(0,M.jsx)(`span`,{className:`niceeval-filter-row-number`,children:n}),(0,M.jsx)(`strong`,{children:e.summary}),(0,M.jsx)(`span`,{className:`niceeval-filter-row-state`,"data-state":e.state,children:_P(e.state,t)})]});return r?(0,M.jsxs)(`details`,{className:`niceeval-filter-row`,"data-state":e.state,children:[(0,M.jsx)(`summary`,{children:i}),(0,M.jsxs)(`div`,{className:`niceeval-filter-row-detail`,children:[e.note===void 0?null:(0,M.jsx)(`p`,{className:`niceeval-filter-row-note`,children:e.note}),e.difference===void 0||e.difference.length===0?null:(0,M.jsxs)(`section`,{children:[(0,M.jsx)(`h6`,{children:X(t,`Filter comparison`,`Filter 对比`)}),(0,M.jsx)(bP,{fields:e.difference,locale:t})]}),e.fields.length===0?null:(0,M.jsxs)(`section`,{children:[(0,M.jsx)(`h6`,{children:X(t,`Recorded detail`,`调用详情`)}),(0,M.jsx)(bP,{fields:e.fields,locale:t})]}),e.conversationTarget===void 0?null:(0,M.jsx)(xP,{anchor:e.conversationTarget.anchor,locale:t})]})]}):(0,M.jsx)(`div`,{className:`niceeval-filter-row`,"data-state":e.state,children:i})}function CP(e,t){switch(e){case`matched`:return X(t,`Matched`,`已匹配`);case`possible`:return X(t,`Possible`,`可能匹配`);case`blocked`:return X(t,`Blocked here`,`阻塞于此`);case`not-reached`:return X(t,`Not reached`,`尚未到达`)}}function wP({steps:e,locale:t}){return e.length===0?null:(0,M.jsxs)(`section`,{className:`niceeval-filter-steps`,children:[(0,M.jsx)(`h5`,{children:X(t,`Sequence path`,`顺序匹配路径`)}),(0,M.jsx)(`ol`,{children:e.map(e=>(0,M.jsxs)(`li`,{"data-state":e.state,children:[(0,M.jsx)(`span`,{className:`niceeval-filter-step-index`,children:e.step}),(0,M.jsx)(`code`,{children:e.summary}),e.sourceRow===void 0?null:(0,M.jsx)(`span`,{children:e.sourceRow}),(0,M.jsx)(`span`,{className:`niceeval-filter-step-state`,children:CP(e.state,t)}),e.conversationTarget===void 0?null:(0,M.jsx)(xP,{anchor:e.conversationTarget.anchor,locale:t})]},e.step))})]})}function TP(e,t){return e===`tool`?X(t,`tool calls`,`工具调用`):e===`event`?X(t,`events`,`事件`):X(t,`records`,`记录`)}function EP(e,t){switch(e){case`historical-not-recorded`:return X(t,`This historical Record did not retain this Matcher query or its row-by-row relation. Rerun it to inspect match reasons and paths.`,`此历史 Record 未保存本次 Matcher 查询与逐行关联,重跑后可查看命中原因/匹配路径。`);case`source-unavailable`:return X(t,`The source records were not retained.`,`没有保存可用的来源记录。`);case`ambiguous-relation`:return X(t,`The stored identities cannot prove a unique assertion-to-row relation.`,`已保存的身份无法证明断言与记录之间唯一对应。`);case`source-partial`:return X(t,`The source records may be incomplete; missing rows are not treated as mismatches.`,`来源记录可能不完整;缺失记录不会被当作未命中。`);case`overlay-partial`:return X(t,`Only bounded representative comparisons were retained; other examined rows are marked as checked.`,`只保留了有界的代表性对比;其余参与评估的记录标记为“已检查”。`)}}function DP(e,t){return e.queryKind===`ordered-sequence`?X(t,`Event order`,`事件顺序`):e.subject===`tool`?X(t,`Tool call filter`,`工具调用筛选`):X(t,`Event filter`,`事件筛选`)}function OP(e){return typeof e==`object`&&e&&!Array.isArray(e)&&`kind`in e&&typeof e.kind==`string`?e.kind:void 0}function kP(e){let t=e.comparator;return typeof t==`object`&&t&&!Array.isArray(t)&&`display`in t&&typeof t.display==`string`?t.display:t==null?e.querySummary:JSON.stringify(t)}function AP(e,t,n){let r=e.atEvaluation.rows.length;return n===`zh-CN`?e.state===`legacy`?`查看已记录的 ${r} 条${t}`:`查看评估时的 ${r} 条${t}`:e.state===`legacy`?`View ${r} recorded ${t}`:`View the ${r} ${t} at evaluation`}function jP({content:e,locale:t}){let n=TP(e.subject,t),r=e.state===`legacy`;return(0,M.jsxs)(`section`,{className:`niceeval-filter-debugger`,"aria-label":DP(e,t),"data-state":e.state,"data-source-state":e.atEvaluation.state,"data-comparator":OP(e.comparator),children:[r?null:(0,M.jsxs)(`header`,{className:`niceeval-filter-debugger-head`,children:[(0,M.jsx)(`span`,{children:DP(e,t)}),(0,M.jsx)(`code`,{children:kP(e)}),e.retainedTarget?.state===`available`?(0,M.jsx)(xP,{anchor:e.retainedTarget.anchor,locale:t}):null]}),e.facts.length===0?null:(0,M.jsx)(`dl`,{className:`niceeval-filter-facts`,children:e.facts.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:gP(e.kind,t)}),(0,M.jsx)(`dd`,{children:QM(e.value,t)})]},e.kind))}),(0,M.jsx)(wP,{steps:e.steps??[],locale:t}),e.relationNotice===void 0?null:(0,M.jsx)(`p`,{className:`niceeval-filter-notice`,children:EP(e.relationNotice,t)}),e.retainedTarget?.state===`unavailable`?(0,M.jsx)(`p`,{className:`niceeval-filter-notice`,children:e.retainedTarget.reason}):null,e.commandMatch?.state===`unavailable`?(0,M.jsx)(`p`,{className:`niceeval-filter-notice`,children:e.commandMatch.reason}):null,(e.atEvaluation.notices??[]).map(e=>(0,M.jsx)(`p`,{className:`niceeval-filter-notice`,children:EP(e,t)},e)),(0,M.jsxs)(`details`,{className:`niceeval-filter-ledger`,children:[(0,M.jsxs)(`summary`,{children:[(0,M.jsx)(`span`,{children:AP(e,n,t)}),r&&e.atEvaluation.state===`partial`?(0,M.jsx)(`small`,{children:X(t,`Records may be incomplete`,`记录可能不完整`)}):null]}),(0,M.jsxs)(`div`,{className:`niceeval-filter-ledger-content`,children:[(0,M.jsx)(`p`,{children:r?X(t,`Open a row to inspect its recorded detail.`,`展开任一行可查看已记录详情。`):X(t,`Open a row to inspect its captured detail and filter comparison.`,`展开任一行可查看已记录详情和 Filter 对比。`)}),e.atEvaluation.rows.length===0?null:(0,M.jsx)(`div`,{className:`niceeval-filter-rows`,children:e.atEvaluation.rows.map(e=>(0,M.jsx)(SP,{row:e,locale:t},e.key))}),e.atEvaluation.rows.length===0&&(r||e.atEvaluation.state!==`unavailable`)?(0,M.jsx)(`p`,{className:`niceeval-filter-empty`,children:e.atEvaluation.state===`unavailable`?X(t,`Source rows were not recorded.`,`没有记录可用的来源行。`):X(t,`No ${n} were in this evaluation snapshot.`,`这个评估快照里没有${n}。`)}):null]})]}),e.afterEvaluation.length===0?null:(0,M.jsxs)(`details`,{className:`niceeval-filter-later`,children:[(0,M.jsxs)(`summary`,{children:[X(t,`Context recorded after evaluation`,`评估后记录的上下文`),(0,M.jsx)(`span`,{children:e.afterEvaluation.length})]}),(0,M.jsx)(`p`,{children:X(t,`These rows are visible for context and did not affect the sealed result.`,`这些行只用于查看上下文,不影响已经封口的判断结果。`)}),(0,M.jsx)(`div`,{className:`niceeval-filter-rows`,children:e.afterEvaluation.map(e=>(0,M.jsx)(SP,{row:e,locale:t},e.key))})]})]})}var MP=240,NP=120;function Z(e,t,n){return e===`zh-CN`?n:t}function PP(e){return typeof e==`string`?JSON.stringify(e):String(e)}function FP(e){return Array.from(e)}function IP(e,t){let n=FP(e),r=n.slice(0,NP).join(``),i=Z(t,n.length===1?`character`:`characters`,`字符`);return`${n.length} ${i} · ${JSON.stringify(r)}…`}function Q(e,t){return e?.kind===`fields`?e.fields.find(e=>e.label===t)?.value:void 0}function LP(e){return e?.kind===`value`&&typeof e.value==`string`?e.value:void 0}function RP(e){if(e?.kind===`text`)return e.text;if(e?.kind===`unavailable`)return e.reason;if(e?.kind===`value`)return typeof e.value==`string`?e.value:String(e.value)}function zP(e){return e?.kind===`value`&&typeof e.value==`number`?e.value:void 0}function BP(e){let t=Q(e,`data`);if(UP(e)===`numeric-comparison/v1`){let e=LP(Q(t,`comparator`)),n=zP(Q(t,`threshold`));if(e!==void 0&&n!==void 0){let t=e===`less-than`?`lessThan`:e===`at-most`?`atMost`:e===`greater-than`?`greaterThan`:e===`at-least`?`atLeast`:void 0;if(t!==void 0)return`${t}(${n})`}}let n=LP(Q(Q(t,`matcher`),`name`));if(n!==void 0)return n;if(UP(e)!==`occurrence/v1`&&UP(e)!==`occurrence/v2`||LP(Q(t,`occurrence`))!==`tool`)return;let r=LP(Q(t,`matcher`));if(r===void 0)return;let i=LP(Q(t,`assertion`));if(i===`order`)return r;let a=Q(t,`quantifier`),o=LP(Q(a,`kind`)),s=zP(Q(a,`count`));if(i===`absent`||o===`absent`)return`notCalledTool(${r})`;if(o===`at-least`&&s===1)return`calledTool(${r})`;let c=o===`at-least`?`atLeast`:o===`less-than`?`lessThan`:o===`at-most`?`atMost`:o===`greater-than`?`greaterThan`:o===`exact`?`exactly`:void 0;return c!==void 0&&s!==void 0?`${r}.${c}(${s})`:`calledTool(${r})`}function VP(e){let t=LP(e);return t===`matched`||t===`mismatched`||t===`unavailable`?t:void 0}function HP(e){if(e?.kind!==`fields`)return null;let t=Q(e,`children`),n=t?.kind===`list`?t.items.flatMap((e,t)=>{let n=VP(Q(e,`state`));return n===void 0?[]:[{index:zP(Q(e,`index`))??t,label:LP(Q(e,`label`))??`matcher ${t+1}`,state:n,diagnostic:HP(Q(e,`diagnostic`))}]}):[];return{code:LP(Q(e,`code`)),expected:Q(e,`expected`),received:Q(e,`received`),reason:LP(Q(e,`reason`)),locator:LP(Q(Q(e,`locator`),`id`)),children:n}}function UP(e){return LP(Q(e,`id`))}function WP(e){return(UP(e)===`occurrence/v1`||UP(e)===`occurrence/v2`)&&LP(Q(Q(e,`data`),`occurrence`))===`tool`}function GP(e){return e===`less-than`||e===`at-most`||e===`greater-than`||e===`at-least`?e:void 0}function KP(e){return e===`exact`||e===`lower-bound`||e===`unavailable`?e:void 0}function qP(e,t){if(UP(e)!==`numeric-comparison/v1`)return;let n=Q(e,`data`),r=GP(LP(Q(n,`comparator`))),i=zP(Q(n,`threshold`)),a=Q(n,`subject`),o=LP(Q(a,`kind`)),s=Q(t,`input`),c=KP(LP(Q(s,`state`)));if(r===void 0||i===void 0||c===void 0||o!==`explicit-value`&&o!==`scope-metric`&&o!==`collection-cardinality`)return;let l=LP(Q(a,`metric`)),u=LP(Q(a,`scope`)),d=LP(Q(a,`unit`));return{comparator:r,threshold:i,subject:{kind:o,...l===`tokens`||l===`cost`?{metric:l}:{},...u===`turn`||u===`session`||u===`attempt`?{scope:u}:{},...d===`tokens`||d===`usd`?{unit:d}:{}},material:{state:c,...zP(Q(s,`value`))===void 0?{}:{value:zP(Q(s,`value`))},...LP(Q(s,`reason`))===void 0?{}:{reason:LP(Q(s,`reason`))},...Q(s,`derivation`)===void 0?{}:{derivation:Q(s,`derivation`)}}}}function JP(e){if(LP(Q(e,`kind`))!==`pricing-estimate`)return;let t=LP(Q(e,`model`)),n=Q(e,`priceSource`),r=LP(Q(n,`kind`)),i=LP(Q(n,`selector`)),a=zP(Q(e,`amountUSD`)),o=Q(e,`charges`);if(!(t===void 0||i===void 0||a===void 0||r!==`configured-override`&&r!==`builtin`||o?.kind!==`list`))return{model:t,sourceKind:r,sourceSelector:i,charges:o.items.flatMap(e=>{let t=LP(Q(e,`bucket`)),n=zP(Q(e,`tokens`)),r=zP(Q(e,`rateUSDPerMTok`)),i=zP(Q(e,`amountUSD`));return t!==`input`&&t!==`output`&&t!==`cache-read`&&t!==`cache-write`||n===void 0||r===void 0||i===void 0?[]:[{bucket:t,tokens:n,rateUSDPerMTok:r,amountUSD:i}]}),amountUSD:a}}function YP(e){let t=LP(Q(e,`kind`));if(t===`at-least`){let t=zP(Q(e,`threshold`));return t===void 0?void 0:{kind:`text`,text:`≥ ${t}`}}return t===void 0?e:void 0}function XP(e){return Q(e,`value`)??e}function ZP({value:e,locale:t,quoted:n}){return(0,M.jsxs)(`details`,{className:`niceeval-assertion-evidence-long-value`,children:[(0,M.jsx)(`summary`,{children:IP(e,t)}),(0,M.jsx)(`pre`,{className:`niceeval-assertion-evidence-code`,children:n?JSON.stringify(e):e})]})}function QP({value:e,locale:t}){switch(e.kind){case`text`:return FP(e.text).length>MP?(0,M.jsx)(ZP,{value:e.text,locale:t,quoted:!1}):(0,M.jsx)(`p`,{children:e.text});case`value`:return typeof e.value==`string`&&FP(e.value).length>MP?(0,M.jsx)(ZP,{value:e.value,locale:t,quoted:!0}):(0,M.jsx)(`pre`,{className:`niceeval-assertion-evidence-code`,children:PP(e.value)});case`unavailable`:return(0,M.jsxs)(`p`,{className:`niceeval-assertion-evidence-state`,children:[(0,M.jsx)(`code`,{children:`unavailable`}),(0,M.jsx)(`span`,{children:e.reason})]});case`fields`:return(0,M.jsx)(`dl`,{className:`niceeval-assertion-evidence-fields`,children:e.fields.map((e,n)=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(QP,{value:e.value,locale:t})})]},`${e.label}:${n}`))});case`list`:return(0,M.jsxs)(`details`,{className:`niceeval-assertion-evidence-collection`,children:[(0,M.jsx)(`summary`,{children:(0,M.jsx)(`code`,{children:`Array(${e.items.length})`})}),(0,M.jsx)(`ol`,{className:`niceeval-assertion-evidence-list`,children:e.items.map((e,n)=>(0,M.jsx)(`li`,{children:(0,M.jsx)(QP,{value:e,locale:t})},n))})]})}}function $P({heading:e,value:t,locale:n}){return(0,M.jsxs)(`section`,{className:`niceeval-assertion-evidence-section`,children:[(0,M.jsx)(`h5`,{children:e}),(0,M.jsx)(QP,{value:t,locale:n})]})}function eF({rows:e}){return(0,M.jsx)(`dl`,{className:`niceeval-match-facts`,children:e.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:e.value})]},e.label))})}function tF({diagnostic:e,locale:t}){let n=[...e.expected===void 0?[]:[{label:Z(t,`Expected`,`预期`),value:e.expected}],...e.received===void 0?[]:[{label:Z(t,`Observed`,`实际`),value:e.received}],...e.locator===void 0?[]:[{label:Z(t,`Call`,`调用`),value:e.locator}],...e.reason===void 0?[]:[{label:Z(t,`Reason`,`原因`),value:e.reason}]];return n.length===0?null:(0,M.jsx)(`dl`,{className:`niceeval-match-facts`,children:n.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:typeof e.value==`string`?e.value:(0,M.jsx)(QP,{value:e.value,locale:t})})]},e.label))})}function nF({input:e,diagnostic:t,locale:n}){let r=LP(Q(e,`command`)),i=zP(Q(e,`exitCode`)),a=RP(t?.expected),o=[...r===void 0?[]:[{label:Z(n,`Command`,`命令`),value:r}],...i===void 0?[]:[{label:Z(n,`Result`,`结果`),value:Z(n,`Exit code ${i}`,`退出码 ${i}`)}],...a===void 0?[]:[{label:Z(n,`Expected`,`预期`),value:a}]];return(0,M.jsxs)(`section`,{className:`niceeval-assertion-evidence-section`,children:[(0,M.jsx)(`h5`,{children:Z(n,`Command result`,`命令结果`)}),(0,M.jsx)(eF,{rows:o})]})}function rF({observed:e,diagnostic:t,locale:n}){let r=zP(Q(Q(e,`receipt`),`examined`));return(0,M.jsxs)(`div`,{className:`niceeval-match-evidence-grid`,children:[t?.received===void 0?null:(0,M.jsx)($P,{heading:Z(n,`Observed`,`实际结果`),value:t.received,locale:n}),t?.expected===void 0?null:(0,M.jsx)($P,{heading:Z(n,`Expected`,`预期结果`),value:t.expected,locale:n}),r===void 0?null:(0,M.jsxs)(`section`,{className:`niceeval-assertion-evidence-section`,children:[(0,M.jsx)(`h5`,{children:Z(n,`Tool calls`,`工具调用`)}),(0,M.jsx)(eF,{rows:[{label:Z(n,`Examined`,`已检查`),value:Z(n,`${r} tool call${r===1?``:`s`}`,`${r} 次工具调用`)}]})]})]})}function iF(e,t){return new Intl.NumberFormat(t===`zh-CN`?`zh-CN`:`en-US`,{maximumFractionDigits:12,maximumSignificantDigits:12}).format(e)}function aF(e){let t=Math.abs(e);if(t!==0&&t<1e-9)return`$${e.toExponential(4)}`;let n=t===0||t>=1?6:Math.min(12,Math.max(2,Math.ceil(-Math.log10(t))+5));return`$${e.toFixed(n).replace(/(?:\.0+|(?:(\.[0-9]*?)0+))$/,`$1`)}`}function oF(e){return e===`less-than`?`<`:e===`at-most`?`≤`:e===`greater-than`?`>`:`≥`}function sF(e){return e===`less-than`?`≥`:e===`at-most`?`>`:e===`greater-than`?`≤`:`<`}function cF(e,t){return t===`zh-CN`?e===`turn`?`本轮`:e===`session`?`本次会话`:`本次 Attempt`:e===`turn`?`Turn`:e===`session`?`Session`:`Attempt`}function lF(e,t){if(e.subject.kind===`explicit-value`)return Z(t,`Number comparison`,`数值比较`);let n=cF(e.subject.scope,t);return e.subject.kind===`collection-cardinality`?Z(t,`${n} tool calls`,`${n}工具调用`):e.subject.metric===`cost`?Z(t,`${n} estimated cost`,`${n}估算费用`):Z(t,`${n} token usage`,`${n} token 用量`)}function uF(e,t,n){if(e.subject.metric===`cost`)return aF(t);let r=iF(t,n);return e.subject.metric===`tokens`?`${r} tokens`:r}function dF(e,t){let n=uF(e,e.threshold,t);return e.subject.metric===`tokens`||e.subject.metric===`cost`?Z(t,`limit ${n}`,`上限 ${n}`):n}function fF(e,t){switch(e){case`model-not-recorded`:return Z(t,`The model was not recorded, so its price cannot be selected.`,`没有记录模型,无法选择对应价格。`);case`price-source-not-found`:return Z(t,`No configured or built-in price was found for this model.`,`没有找到该模型的配置价格或内置价格。`);case`pricing-input-invalid`:return Z(t,`The recorded pricing input is invalid.`,`记录的计价输入无效。`);case`usage-not-recorded`:return Z(t,`Usage was not recorded.`,`没有记录用量。`);case`usage-input-invalid`:return Z(t,`The recorded token usage is invalid.`,`记录的 token 用量无效。`);case`non-finite-number`:case`numeric-value-non-finite`:return Z(t,`The compared number is not finite.`,`被比较的数值不是有限数。`);default:return Z(t,`The compared value is unavailable.`,`没有可用于比较的数值。`)}}function pF(e,t,n){let r=e.material.value;if(e.material.state===`unavailable`||r===void 0)return fF(e.material.reason,n);let i=uF(e,r,n),a=dF(e,n);if(e.material.state===`lower-bound`&&t===`unavailable`)return e.subject.kind===`collection-cardinality`?Z(n,`At least ${i} tool calls were recorded, but the collection is incomplete, so NiceEval cannot determine whether it is ${oF(e.comparator)} ${a}.`,`目前至少已有 ${i} 次工具调用,但集合不完整,无法判断是否 ${oF(e.comparator)} ${a}。`):Z(n,`At least ${i} was recorded, but usage is incomplete, so NiceEval cannot determine whether it is ${oF(e.comparator)} ${a}.`,`目前至少记录了 ${i},但用量记录不完整,无法判断是否 ${oF(e.comparator)} ${a}。`);let o=t===`mismatched`?sF(e.comparator):oF(e.comparator),s=e.material.state===`lower-bound`?Z(n,`Known minimum`,`已知至少`):e.subject.kind===`collection-cardinality`?Z(n,`Tool calls`,`工具调用`):e.subject.metric===`cost`?Z(n,`Estimated`,`估算`):e.subject.metric===`tokens`?Z(n,`Used`,`已用`):Z(n,`Observed`,`实际`),c=t===`matched`?Z(n,`so it passes.`,`所以通过。`):t===`mismatched`?Z(n,`so it does not pass.`,`所以未通过。`):Z(n,`so the result is unavailable.`,`所以无法判断。`);return`${s} ${i} ${o} ${a}${n===`zh-CN`?`,`:`, `}${c}`}function mF(e,t){return e===`input`?Z(t,`Input`,`输入`):e===`output`?Z(t,`Output`,`输出`):e===`cache-read`?Z(t,`Cache read`,`缓存读取`):Z(t,`Cache write`,`缓存写入`)}function hF({receipt:e,locale:t}){let n=e.sourceKind===`builtin`?Z(t,`Built-in price`,`内置价格`):Z(t,`Configured override`,`配置覆盖价格`);return(0,M.jsxs)(`details`,{className:`niceeval-numeric-pricing`,children:[(0,M.jsxs)(`summary`,{children:[(0,M.jsx)(`span`,{children:Z(t,`View estimate basis`,`查看估算依据`)}),(0,M.jsx)(`code`,{children:e.model}),(0,M.jsxs)(`small`,{children:[n,` · `,e.sourceSelector]})]}),(0,M.jsxs)(`dl`,{children:[e.charges.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:mF(e.bucket,t)}),(0,M.jsxs)(`dd`,{children:[(0,M.jsxs)(`code`,{children:[iF(e.tokens,t),` tokens`]}),(0,M.jsx)(`span`,{children:`×`}),(0,M.jsxs)(`code`,{children:[aF(e.rateUSDPerMTok),`/M`]}),(0,M.jsx)(`span`,{children:`=`}),(0,M.jsx)(`strong`,{children:aF(e.amountUSD)})]})]},e.bucket)),(0,M.jsxs)(`div`,{className:`niceeval-numeric-pricing-total`,children:[(0,M.jsx)(`dt`,{children:Z(t,`Estimated total`,`估算合计`)}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(`strong`,{children:aF(e.amountUSD)})})]})]})]})}function gF({view:e,state:t,locale:n}){let r=e.material.value,i=t===`mismatched`?sF(e.comparator):oF(e.comparator),a=e.subject.metric===`cost`?JP(e.material.derivation):void 0;return(0,M.jsxs)(`section`,{className:`niceeval-numeric-evidence`,"data-state":t,children:[(0,M.jsx)(`span`,{className:`niceeval-numeric-evidence-label`,children:lF(e,n)}),r===void 0?(0,M.jsx)(`p`,{className:`niceeval-numeric-evidence-unavailable`,children:Z(n,`No comparable value`,`没有可比较的数值`)}):e.material.state===`lower-bound`&&t===`unavailable`?(0,M.jsxs)(`p`,{className:`niceeval-numeric-evidence-formula`,children:[(0,M.jsx)(`small`,{children:Z(n,`Known minimum`,`已知至少`)}),(0,M.jsx)(`strong`,{children:uF(e,r,n)}),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,M.jsx)(`small`,{children:dF(e,n)})]}):(0,M.jsxs)(`p`,{className:`niceeval-numeric-evidence-formula`,children:[e.material.state===`lower-bound`?(0,M.jsx)(`small`,{children:Z(n,`Known minimum`,`已知至少`)}):null,(0,M.jsx)(`strong`,{children:uF(e,r,n)}),(0,M.jsx)(`span`,{className:`niceeval-numeric-evidence-operator`,children:i}),(0,M.jsx)(`strong`,{children:dF(e,n)})]}),(0,M.jsx)(`p`,{className:`niceeval-numeric-evidence-conclusion`,children:pF(e,t,n)}),a===void 0?null:(0,M.jsx)(hF,{receipt:a,locale:n})]})}function _F({content:e,input:t,diagnostic:n,locale:r}){let i=n?.expected===void 0?YP(e.expected):n.expected,a=n?.received===void 0?XP(e.observed):n.received;return(0,M.jsxs)(`div`,{className:`niceeval-match-evidence-grid`,children:[(0,M.jsx)($P,{heading:Z(r,`Input`,`输入`),value:t,locale:r}),a===void 0?null:(0,M.jsx)($P,{heading:Z(r,`Observed`,`实际结果`),value:a,locale:r}),i===void 0?null:(0,M.jsx)($P,{heading:Z(r,`Expected`,`预期结果`),value:i,locale:r})]})}function vF({source:e,locale:t}){let n=Q(e,`coverage`),r=LP(Q(n,`state`));if(r===void 0||r===`complete`)return null;let i=LP(Q(n,`reason`)),a=Q(e,`limitations`),o=a?.kind===`list`?a.items.map(e=>zP(Q(e,`omittedBytes`))).find(e=>e!==void 0):void 0,s=[i,o===void 0?void 0:Z(t,`${o} bytes omitted`,`省略 ${o} 字节`)].filter(e=>e!==void 0).join(` · `);return(0,M.jsxs)(`p`,{className:`niceeval-match-coverage`,children:[Z(t,`Input evidence ${r}`,`输入证据${r===`partial`?`不完整`:`不可用`}`),s.length===0?``:` · ${s}`]})}function yF(e,t){return t===`zh-CN`?e===`matched`?`命中`:e===`mismatched`?`未命中`:`无法判断`:e}function bF(e){return e?.code===`tool-count-match`||e?.code===`tool-count-mismatch`||e?.code===`tool-count-exceeded`||e?.code===`tool-count-unavailable`||e?.code===`tool-absence-match`||e?.code===`tool-absence-mismatch`||e?.code===`tool-absence-unavailable`}function xF(e){if(e?.received!==void 0)return RP(e.received);let t=e?.children.find(e=>e.label===`name`);return t?.diagnostic?.received===void 0?t?.state===`matched`?RP(t.diagnostic?.expected):void 0:RP(t.diagnostic.received)}function SF(e,t,n,r){let i=t===`command-candidate`?Z(r,`Command`,`命令`):t===`tool-candidate`?Z(r,`Tool call`,`工具调用`):Z(r,`Candidate`,`候选`),a=xF(n),o=Z(r,`invocation details not recorded`,`调用详情未记录`);return`${i} ${e+1} · ${a??o}`}function CF(e,t){return t===`zh-CN`?e===`name`?`名称`:e===`input`?`输入`:e===`output`?`输出`:e===`command`?`命令`:e===`status`?`状态`:e:e}function wF(e,t){if(e===null||e.children.length>0)return[];let n=RP(e.expected),r=RP(e.received);return[...n===void 0?[]:[{label:Z(t,`Expected`,`预期`),value:n}],...r===void 0?[]:[{label:Z(t,`Observed`,`实际`),value:r}],...e.reason===void 0?[]:[{label:Z(t,`Reason`,`原因`),value:e.reason}]]}function TF({label:e,state:t,diagnostic:n,locale:r,root:i=!1,toolCandidateIndex:a,toolField:o=!1,children:s}){let c=a===void 0?o?CF(e,r):e:SF(a,e,n,r),l=yF(t,r),u=`${c}: ${l}`,d=wF(n,r),f=(0,M.jsxs)(`span`,{className:`niceeval-match-summary niceeval-match-summary--${t}`,children:[(0,M.jsxs)(`span`,{className:`niceeval-match-summary-main`,children:[(0,M.jsx)(`code`,{children:c}),d.length===0?null:(0,M.jsx)(`span`,{className:`niceeval-match-summary-facts`,children:d.map(e=>(0,M.jsxs)(`span`,{className:`niceeval-match-summary-fact`,children:[(0,M.jsx)(`span`,{children:e.label}),(0,M.jsx)(`code`,{children:e.value})]},e.label))})]}),(0,M.jsx)(`span`,{className:`niceeval-match-state`,children:l})]}),p=n?.children??[],m=bF(n),h=p.length>0||n?.locator!==void 0||s!==void 0?(0,M.jsxs)(`div`,{className:`niceeval-match-detail`,children:[p.length>0?(0,M.jsx)(`div`,{className:`niceeval-match-children`,children:p.map((e,t)=>(0,M.jsx)(TF,{label:e.label,state:e.state,diagnostic:e.diagnostic,locale:r,...m?{toolCandidateIndex:e.index}:{},...a===void 0?{}:{toolField:!0}},`${e.label}:${t}`))}):null,i||n===null||n.locator===void 0?null:(0,M.jsx)(tF,{diagnostic:n,locale:r}),s]}):null;return h===null?(0,M.jsx)(`div`,{className:`niceeval-match-node`,"aria-label":u,children:f}):(0,M.jsxs)(`details`,{className:`niceeval-match-node${i?` niceeval-match-node--root`:``}`,children:[(0,M.jsx)(`summary`,{"aria-label":u,children:f}),h]})}function EF(e,t,n,r){let i=HP(e.explanation),a=BP(e.check)??n??Z(t,`Match`,`检查`),o=Q(e.source,`input`)??e.source,s=i?.code,c=qP(e.check,e.source),l=c===void 0?s===`command-succeeded`||s===`command-failed`?(0,M.jsx)(nF,{input:o,diagnostic:i,locale:t}):WP(e.check)?(0,M.jsx)(rF,{observed:e.observed,diagnostic:i,locale:t}):(0,M.jsx)(_F,{content:e,input:o,diagnostic:i,locale:t}):(0,M.jsx)(gF,{view:c,state:r,locale:t});return(0,M.jsx)(`div`,{className:`niceeval-assertion-evidence`,children:(0,M.jsx)(TF,{label:a,state:r,diagnostic:c===void 0?i:null,locale:t,root:!0,children:(0,M.jsxs)(`div`,{className:`niceeval-match-body`,children:[e.matcherDebugger===void 0?l:(0,M.jsxs)(M.Fragment,{children:[l,(0,M.jsx)(jP,{content:e.matcherDebugger,locale:t})]}),(0,M.jsx)(vF,{source:e.source,locale:t}),(0,M.jsxs)(`details`,{className:`niceeval-match-raw`,children:[(0,M.jsx)(`summary`,{children:Z(t,`Raw assertion data`,`原始断言数据`)}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)($P,{heading:Z(t,`Source`,`来源`),value:e.source,locale:t}),(0,M.jsx)($P,{heading:Z(t,`Check`,`检查条件`),value:e.check,locale:t}),(0,M.jsx)($P,{heading:Z(t,`Explanation`,`解释`),value:e.explanation,locale:t})]})]})]})})})}function DF({content:e,label:t,state:n,locale:r}){return EF(e,r,t,n??`unavailable`)}var OF=(0,v.createContext)(null);function kF(){let e=(0,v.useContext)(OF);if(e===null)throw Error(`Trace interaction context is missing`);return e}function AF(...e){return e.filter(Boolean).join(` `)}function $(e,t,n){return e===`zh-CN`?n:t}function jF(e){if(e===void 0)return`Not recorded`;if(e<1e3)return`${Math.round(e)} ms`;let t=Math.round(e/1e3);return t<60?`${t} s`:`${Math.floor(t/60)} m ${t%60} s`}function MF(e){return e.durationMs!==void 0&&Number.isFinite(e.durationMs)?Math.max(0,e.durationMs):void 0}function NF(e){switch(e.toLowerCase()){case`user`:case`input`:case`context`:return`input`;case`tool`:case`subagent`:case`skill`:return`tools`;default:return`model`}}function PF(e){return NF(e)===`tools`}function FF(e){let t=e.filter(e=>e.entry.callPhase===`started`).length;return t===0?e.filter(e=>e.toolLike).length:t}function IF(e,t){return e.callOutcome===`completed`?$(t,`Completed`,`已完成`):e.callOutcome===`failed`?$(t,`Failed`,`失败`):e.callOutcome===`rejected`?$(t,`Rejected`,`已拒绝`):e.callOutcome===`cancelled`?$(t,`Cancelled`,`已取消`):e.failed===!0?$(t,`Failed`,`失败`):e.callPhase===`started`?$(t,`Started`,`已开始`):e.callPhase===`finished`?$(t,`Completed`,`已完成`):$(t,`Captured`,`已捕获`)}function LF(e){return e.toolOccurrence?.state===`exact`?e.toolOccurrence.toolOccurrenceId:e.toolOccurrence===void 0?e.callId:void 0}function RF(e){let t=new Map;for(let[n,r]of e.entries.entries()){let e=LF(r);if(e===void 0||r.callPhase===void 0)continue;let i=t.get(e)??{started:[],finished:[]};i[r.callPhase].push(n),t.set(e,i)}let n=new Map,r=new Set;for(let i of t.values()){if(i.started.length!==1||i.finished.length!==1)continue;let t=i.started[0],a=i.finished[0];if(a<=t)continue;let o=e.entries[t],s=e.entries[a],c=[o.raw,s.raw].filter(e=>e!==void 0).join(`
60
+ `),l=[o.detail,s.detail].filter(e=>e!==void 0);n.set(t,{id:o.id,kind:o.kind,preview:o.preview,...o.anchor===void 0?{}:{anchor:o.anchor},callId:LF(o),...o.toolOccurrence===void 0?{}:{toolOccurrence:o.toolOccurrence},callPhase:`finished`,...s.callOutcome===void 0?{}:{callOutcome:s.callOutcome},...o.failed===!0||s.failed===!0?{failed:!0}:{},...(s.commandMatch??o.commandMatch)===void 0?{}:{commandMatch:s.commandMatch??o.commandMatch},...c===``?{}:{raw:c},...l.length===0?{}:{detail:l.length===1?l[0]:{kind:`stack`,items:l}}}),r.add(a)}return e.entries.flatMap((e,t)=>r.has(t)?[]:[{entry:n.get(t)??e,entryIndex:t}])}function zF(e,t){return e.turns.flatMap((e,n)=>RF(e).map(({entry:r,entryIndex:i})=>{let a=r.raw??QM(r.preview,t);return{id:r.id,turn:e,turnIndex:n,entry:r,entryIndex:i,lane:NF(r.kind),summary:GN(r.preview,t,180),raw:a,toolLike:PF(r.kind)}}))}function BF(e){return e.every(e=>e.entries.length===0||MF(e)!==void 0)}function VF(e,t){let n=new Map;if(t.length===0)return n;let r=BF(e),i=new Map;for(let n of e){let e=t.filter(e=>e.turn.key===n.key);if(e.length===0)continue;let a=MF(n),o=r&&a!==void 0?Math.max(1,a)/e.length:1;for(let t of e)i.set(t.id,o)}let a=t.length*1,o=t.reduce((e,t)=>e+(i.get(t.id)??1),0),s=0,c=0;for(let e of t){let t=i.get(e.id)??1;n.set(e.id,{sequenceLeft:s/a*100,sequenceWidth:1/a*100,durationLeft:c/o*100,durationWidth:t/o*100}),s+=1,c+=t}return n}function HF(e){return e===`input`?7:e===`model`?21:35}function UF(e,t){let n=QM(e.turn.label,t),r=MF(e.turn),i=r===void 0?$(t,`timing not recorded`,`未记录时长`):`${jF(r)} ${$(t,`turn duration`,`轮次时长`)}`;return`${e.entry.kind} · ${n} · ${i}`}function WF({content:e,events:t,locale:n}){let r=e.turns.flatMap(e=>{let t=MF(e);return t===void 0?[]:[t]}),i=r.length===0?$(n,`—`,`—`):jF(r.reduce((e,t)=>e+t,0)),a=FF(t),o=BF(e.turns)&&t.length>0,s=kF();return(0,M.jsxs)(`header`,{className:`niceeval-trace-toolbar`,role:`toolbar`,"aria-label":$(n,`Trajectory controls`,`轨迹控制`),children:[(0,M.jsxs)(`div`,{className:`niceeval-trace-toolbar-main`,children:[(0,M.jsx)(`span`,{className:`niceeval-trace-toolbar-title`,children:$(n,`Session log`,`会话日志`)}),(0,M.jsxs)(`div`,{className:`niceeval-trace-toolbar-actions`,children:[(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-toolbar-button niceeval-trace-toolbar-button--duration`,onClick:()=>s.setDuration(!s.duration),"aria-pressed":s.duration,disabled:!o,title:o?$(n,`Use turn-duration projection`,`按轮次时长投影`):$(n,`Turn timing is incomplete; sequence stays equal-width`,`轮次时长不完整;保持等宽顺序`),children:[(0,M.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,M.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.25`}),(0,M.jsx)(`path`,{d:`M8 4.75V8l2.25 1.5`})]}),(0,M.jsx)(`span`,{children:$(n,`Duration`,`时长`)}),(0,M.jsx)(`b`,{children:i})]}),(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-toolbar-button`,onClick:()=>s.setTurnsCollapsed(!s.turnsCollapsed),"aria-pressed":s.turnsCollapsed,title:$(n,`Collapse turns`,`折叠轮次`),children:[(0,M.jsx)(`span`,{className:`niceeval-trace-toolbar-glyph`,"aria-hidden":`true`,children:`⊟`}),(0,M.jsx)(`span`,{children:$(n,`Turns`,`轮次`)}),(0,M.jsx)(`b`,{children:e.turns.length})]}),(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-toolbar-button`,onClick:()=>s.setCallsCollapsed(!s.callsCollapsed),"aria-pressed":s.callsCollapsed,title:$(n,`Collapse tool calls`,`折叠工具调用`),disabled:a===0,children:[(0,M.jsx)(`span`,{className:`niceeval-trace-toolbar-glyph`,"aria-hidden":`true`,children:`⊟`}),(0,M.jsx)(`span`,{children:$(n,`Calls`,`调用`)}),(0,M.jsx)(`b`,{children:a})]})]})]}),(0,M.jsxs)(`label`,{className:`niceeval-trace-search`,children:[(0,M.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,M.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.25`}),(0,M.jsx)(`path`,{d:`m10.25 10.25 3 3`})]}),(0,M.jsx)(`span`,{className:`niceeval-trace-visually-hidden`,children:$(n,`Search trajectory`,`搜索轨迹`)}),(0,M.jsx)(`input`,{type:`search`,value:s.query,onChange:e=>s.setQuery(e.target.value),placeholder:$(n,`Search`,`搜索`),"aria-label":$(n,`Search trajectory`,`搜索轨迹`)})]})]})}function GF({content:e,events:t,locale:n}){let r=VF(e.turns,t),i=BF(e.turns),a=kF(),o=t.filter((e,n)=>n===0||t[n-1]?.turn.key!==e.turn.key);return(0,M.jsxs)(`section`,{className:`niceeval-trace-timeline`,"aria-label":$(n,`Trajectory timeline`,`轨迹时间线`),"data-timing-complete":i?`true`:void 0,children:[(0,M.jsxs)(`div`,{className:`niceeval-trace-timeline-plot`,children:[(0,M.jsxs)(`div`,{className:`niceeval-trace-timeline-labels`,"aria-hidden":`true`,children:[(0,M.jsx)(`span`,{children:$(n,`Input / User`,`输入 / 用户`)}),(0,M.jsx)(`span`,{children:$(n,`Model / Assistant`,`模型 / 助手`)}),(0,M.jsx)(`span`,{children:$(n,`Tools / Tool`,`工具 / 工具`)})]}),(0,M.jsxs)(`svg`,{className:`niceeval-trace-timeline-track`,viewBox:`0 0 100 50`,preserveAspectRatio:`none`,"aria-hidden":t.length===0?`true`:void 0,children:[t.length===0?(0,M.jsx)(`text`,{className:`niceeval-trace-timeline-empty`,x:`50`,y:`25`,textAnchor:`middle`,dominantBaseline:`middle`,children:$(n,`No captured events`,`没有已捕获事件`)}):null,(e=>(0,M.jsxs)(`g`,{className:`niceeval-trace-timeline-projection niceeval-trace-timeline-projection--${e}`,children:[o.map(t=>{let n=r.get(t.id);if(n===void 0)return null;let i=e===`sequence`?n.sequenceLeft:n.durationLeft;return(0,M.jsx)(`line`,{className:`niceeval-trace-timeline-boundary`,x1:i,x2:i,y1:`0`,y2:`50`,"aria-hidden":`true`},`${e}-boundary-${t.id}`)}),t.map(t=>{let i=r.get(t.id);if(i===void 0)return null;let o=e===`sequence`?i.sequenceLeft:i.durationLeft,s=e===`sequence`?i.sequenceWidth:i.durationWidth,c=UF(t,n),l=t.entry.kind===`assistant`?`assistant: ${t.summary} · ${c}`:c;return(0,M.jsxs)(`g`,{className:`niceeval-trace-timeline-span`,role:`button`,tabIndex:0,onClick:()=>a.setSelected(a.selected===t.id?null:t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&a.setSelected(a.selected===t.id?null:t.id)},"data-lane":t.lane,"data-failed":t.entry.failed?`true`:void 0,"aria-label":l,"aria-pressed":a.selected===t.id,children:[(0,M.jsx)(`title`,{children:l}),(0,M.jsx)(`rect`,{className:`niceeval-trace-timeline-span-geometry`,x:o,y:HF(t.lane),width:s,height:`8`,rx:`1`})]},`${e}-event-${t.id}`)})]}))(a.duration?`duration`:`sequence`)]})]}),(0,M.jsx)(`p`,{className:`niceeval-trace-timeline-note`,children:i?$(n,`Duration projects captured turn durations; without per-event timestamps, events remain evenly sequenced within each turn.`,`时长模式投影已捕获的轮次时长;没有逐事件时间戳时,事件在轮次内保持等宽顺序。`):$(n,`Per-event timing was not captured, so the timeline uses equal-width sequence spans.`,`未捕获逐事件时长,因此时间线使用等宽顺序跨度。`)})]})}function KF({event:e,locale:t}){let n=e.entry.detail===void 0?null:WN(e.entry.detail,t),r=MF(e.turn),i=kF(),[a,o]=(0,v.useState)(`preview`);return(0,M.jsxs)(`details`,{className:`niceeval-trace-evidence`,open:i.selected===e.id,children:[(0,M.jsx)(`summary`,{children:$(t,`Evidence`,`证据`)}),(0,M.jsxs)(`div`,{className:`niceeval-trace-evidence-body`,children:[(0,M.jsxs)(`dl`,{className:`niceeval-trace-evidence-meta`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Source`,`来源`)}),(0,M.jsx)(`dd`,{children:QM(e.turn.label,t)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Status`,`状态`)}),(0,M.jsx)(`dd`,{children:IF(e.entry,t)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Total duration`,`总时长`)}),(0,M.jsx)(`dd`,{children:r===void 0?$(t,`Not recorded`,`未记录`):jF(r)})]}),e.entry.callPhase===void 0?null:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Call phase`,`调用阶段`)}),(0,M.jsx)(`dd`,{children:e.entry.callPhase})]}),e.entry.callId===void 0?null:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Call ID`,`调用 ID`)}),(0,M.jsx)(`dd`,{children:e.entry.callId})]}),e.entry.toolOccurrence?.state===`unavailable`?(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Tool occurrence`,`工具调用身份`)}),(0,M.jsxs)(`dd`,{children:[$(t,`Unavailable`,`不可用`),` · `,e.entry.toolOccurrence.reason]})]}):null,e.entry.commandMatch===void 0?null:e.entry.commandMatch.state===`matched`?(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Command`,`命令`)}),(0,M.jsx)(`dd`,{children:e.entry.commandMatch.commandId})]}):(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Command`,`命令`)}),(0,M.jsxs)(`dd`,{children:[$(t,`Unavailable`,`不可用`),` · `,e.entry.commandMatch.reason]})]})]}),(0,M.jsxs)(`div`,{className:`niceeval-trace-evidence-tabs`,role:`tablist`,"aria-label":$(t,`Record detail tabs`,`记录详情标签`),children:[(0,M.jsx)(`button`,{type:`button`,role:`tab`,onClick:()=>o(`preview`),onKeyDown:XF,"aria-selected":a===`preview`,children:$(t,`Preview`,`预览`)}),(0,M.jsx)(`button`,{type:`button`,role:`tab`,onClick:()=>o(`raw`),onKeyDown:XF,"aria-selected":a===`raw`,children:$(t,`Raw`,`原始`)})]}),(0,M.jsxs)(`section`,{className:`niceeval-trace-evidence-panel`,hidden:a!==`preview`,role:`tabpanel`,"aria-label":$(t,`Preview`,`预览`),children:[(0,M.jsx)(`h4`,{children:$(t,`Preview`,`预览`)}),n===null?(0,M.jsx)(`pre`,{className:`niceeval-trace-evidence-raw`,children:e.raw}):(0,M.jsx)(`div`,{className:`niceeval-trace-evidence-detail`,children:n})]}),(0,M.jsxs)(`section`,{className:`niceeval-trace-evidence-panel`,hidden:a!==`raw`,role:`tabpanel`,"aria-label":$(t,`Raw`,`原始`),children:[(0,M.jsx)(`h4`,{children:$(t,`Raw`,`原始`)}),(0,M.jsx)(`pre`,{className:`niceeval-trace-evidence-raw`,children:e.raw})]})]})]})}function qF({event:e,locale:t}){let n=QM(e.turn.label,t),r=MF(e.turn),i=IF(e.entry,t),a=kF();return(0,M.jsxs)(`article`,{hidden:a.callsCollapsed&&e.toolLike||a.query!==``&&!`${e.entry.kind} ${e.summary} ${e.raw}`.toLocaleLowerCase().includes(a.query.toLocaleLowerCase()),className:AF(`niceeval-trace-event-row`,e.toolLike&&`niceeval-trace-event-row--tool`,e.entry.failed&&`niceeval-trace-event-row--failed`),id:`trace-${e.entry.anchor}`,"data-tool-row":e.toolLike?`true`:void 0,"data-call-outcome":e.entry.callOutcome,children:[(0,M.jsx)(`span`,{className:`niceeval-trace-event-turn-rail`,"aria-hidden":`true`}),(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-event-select`,onClick:()=>a.setSelected(a.selected===e.id?null:e.id),"aria-pressed":a.selected===e.id,"aria-expanded":a.selected===e.id,"aria-label":`${e.entry.kind}: ${e.summary||$(t,`captured event`,`已捕获事件`)}`,children:[(0,M.jsx)(`span`,{className:`niceeval-trace-event-kind`,"data-lane":e.lane,children:e.entry.kind}),(0,M.jsx)(`span`,{className:`niceeval-trace-event-summary`,children:e.summary||`—`}),(0,M.jsx)(`span`,{className:`niceeval-trace-event-meta`,title:r===void 0?$(t,`Turn timing not recorded`,`未记录轮次时长`):`${n} · ${jF(r)}`,children:r===void 0?`—`:jF(r)}),(0,M.jsx)(`span`,{className:`niceeval-trace-event-status`,"data-call-outcome":e.entry.callOutcome,children:i})]}),(0,M.jsx)(KF,{event:e,locale:t})]})}function JF({turn:e,events:t,locale:n}){let r=MF(e),i=FF(t),a=t.some(e=>e.entry.failed===!0),o=kF(),[s,c]=(0,v.useState)(!1),l=o.turnsCollapsed||s;return(0,M.jsxs)(`section`,{className:AF(`niceeval-trace-turn`,e.verdict&&`niceeval-trace-turn--${e.verdict}`,a&&`niceeval-trace-turn--failed-events`),"data-collapsed":l,children:[(0,M.jsx)(`header`,{className:`niceeval-trace-turn-head niceeval-conversation-turn-head`,children:(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-turn-toggle`,onClick:()=>c(!s),"aria-expanded":!l,title:$(n,`Collapse turn`,`折叠轮次`),children:[(0,M.jsx)(`span`,{className:`niceeval-trace-turn-chevron`,"aria-hidden":`true`,children:`⌄`}),(0,M.jsx)(`span`,{className:`niceeval-trace-turn-label`,children:QM(e.label,n)}),(0,M.jsxs)(`span`,{className:`niceeval-trace-turn-facts`,children:[r===void 0?$(n,`timing unavailable`,`时长不可用`):jF(r),(0,M.jsxs)(`span`,{children:[t.length,` `,$(n,`events`,`事件`)]}),i>0?(0,M.jsxs)(`span`,{children:[i,` `,$(n,`calls`,`调用`)]}):null]}),e.verdict?(0,M.jsx)(`span`,{className:`niceeval-trace-turn-verdict`,children:e.verdict}):null]})}),(0,M.jsx)(`div`,{className:`niceeval-trace-turn-events`,hidden:l,children:t.length===0?(0,M.jsx)(`p`,{className:`niceeval-trace-empty-turn`,children:$(n,`No events captured for this turn.`,`此轮没有已捕获事件。`)}):t.map(e=>(0,M.jsx)(qF,{event:e,locale:n},e.id))})]})}function YF({data:e,locale:t,className:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(null);if(e===null||e.turns.length===0)return null;let p=zF(e,t),m={duration:r,setDuration:i,turnsCollapsed:a,setTurnsCollapsed:o,callsCollapsed:s,setCallsCollapsed:c,query:l,setQuery:u,selected:d,setSelected:f};return(0,M.jsx)(OF.Provider,{value:m,children:(0,M.jsxs)(`section`,{className:AF(`niceeval-report`,`niceeval-turn-trace`,n),"data-duration-mode":r?`duration`:`sequence`,onKeyDown:e=>{e.key===`Escape`&&f(null)},children:[(0,M.jsx)(WF,{content:e,events:p,locale:t}),(0,M.jsx)(GF,{content:e,events:p,locale:t}),(0,M.jsx)(`div`,{className:`niceeval-trace-ledger`,children:e.turns.map((e,n)=>(0,M.jsx)(JF,{turn:e,events:p.filter(e=>e.turnIndex===n),locale:t},e.key))})]})})}function XF(e){if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let t=[...e.currentTarget.parentElement?.querySelectorAll(`[role=tab]`)??[]],n=t.indexOf(e.currentTarget);n<0||t.length===0||(e.preventDefault(),t[(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length]?.focus())}var ZF=/(\/\/[^\n]*)|(\/\*[^]*?\*\/)|(`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')|\b(import|from|export|default|const|let|var|async|await|function|return|if|else|for|of|in|new|class|extends|typeof|void|true|false|null|undefined)\b|\b(\d[\d_.]*)\b|([A-Za-z_$][\w$]*)(?=\s*\()/g;function QF(e){let t=[],n=0,r=0,i;for(ZF.lastIndex=0;i=ZF.exec(e);){i.index>n&&t.push(e.slice(n,i.index));let a=i[1]||i[2]?`tok-comment`:i[3]?`tok-str`:i[4]?`tok-kw`:i[5]?`tok-num`:`tok-fn`;t.push((0,M.jsx)(`span`,{className:a,children:i[0]},r++)),n=i.index+i[0].length,i[0].length===0&&ZF.lastIndex++}return n<e.length&&t.push(e.slice(n)),t}function $F(e,t){return e.kind===`assertion`?(0,M.jsx)(DF,{content:e.content,label:e.label,state:e.state,locale:t}):e.kind===`turn-trace`?(0,M.jsx)(YF,{data:e.data,locale:t}):(0,M.jsx)(`div`,{className:$M(`niceeval-report`,`niceeval-text`,e.className),children:e.text})}function eI(e,t){if(!eN(e))return`"${t}" must be an object`;if(typeof e.sourceItemId!=`string`)return`"${t}.sourceItemId" must be a string`;if(typeof e.sha256!=`string`)return`"${t}.sha256" must be a string`;if(typeof e.path!=`string`)return`"${t}.path" must be a string`;if(!Array.isArray(e.lines))return`"${t}.lines" must be an array`;for(let n=0;n<e.lines.length;n++){let r=e.lines[n];if(!eN(r))return`"${t}.lines[${n}]" must be an object`;if(typeof r.number!=`number`)return`"${t}.lines[${n}].number" must be a number`;if(typeof r.text!=`string`)return`"${t}.lines[${n}].text" must be a string`;if(r.interaction!==void 0&&r.interaction!==`send`)return`"${t}.lines[${n}].interaction" must be send`;if(r.turnIds!==void 0&&(!Array.isArray(r.turnIds)||r.turnIds.some(e=>typeof e!=`string`)))return`"${t}.lines[${n}].turnIds" must be an array of strings`;if(r.pill!==void 0&&!tN(r.pill))return`"${t}.lines[${n}].pill" must be a LocalizedText`}return null}function tI(e){if(e==null)return null;if(!eN(e))throw nN(`SourceView`,`sourceViewData`,`SourceContent`,`"data" must be an object or null`);let t=eI(e.spine,`data.spine`);if(t!==null)throw nN(`SourceView`,`sourceViewData`,`SourceContent`,t);if(!Array.isArray(e.detached))throw nN(`SourceView`,`sourceViewData`,`SourceContent`,`"data.detached" must be an array`);for(let t=0;t<e.detached.length;t++){let n=eI(e.detached[t],`data.detached[${t}]`);if(n!==null)throw nN(`SourceView`,`sourceViewData`,`SourceContent`,n)}return e}function nI(e){return e.aborted?`gate-fail`:e.tone}function rI(e){if(e)return`niceeval-source-line--${e}`}var iI={send:(0,M.jsx)(`path`,{d:`M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z`}),passed:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),"gate-fail":(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`path`,{d:`m15 9-6 6`}),(0,M.jsx)(`path`,{d:`m9 9 6 6`})]}),"soft-fail":(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}),(0,M.jsx)(`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`})]}),unavailable:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),(0,M.jsx)(`path`,{d:`M12 17h.01`})]})},aI={send:`send`,passed:`passed`,"gate-fail":`failed`,"soft-fail":`mismatched`,unavailable:`unavailable`};function oI({line:e}){let t=e.interaction===`send`?`send`:nI(e);return t===void 0?(0,M.jsx)(`span`,{className:`niceeval-source-gutter`,children:e.number}):(0,M.jsx)(`span`,{className:`niceeval-source-gutter niceeval-source-gutter-mark`,role:`img`,"aria-label":aI[t],title:aI[t],children:(0,M.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:iI[t]})})}function sI({line:e,locale:t}){return(0,M.jsxs)(`span`,{className:`niceeval-source-line-summary`,children:[(0,M.jsx)(oI,{line:e}),(0,M.jsx)(`span`,{className:`niceeval-source-code`,children:QF(e.text)}),(0,M.jsxs)(`span`,{className:`niceeval-source-meta`,children:[e.pill===void 0?null:(0,M.jsx)(`span`,{className:`niceeval-source-pill`,children:QM(e.pill,t)}),e.aborted?(0,M.jsx)(`span`,{className:`niceeval-source-abort-mark`,"aria-hidden":`true`,children:`⤓`}):null]})]})}function cI({calls:e,locale:t,renderChild:n}){return(0,M.jsx)(`div`,{className:`niceeval-source-calls`,children:e.map((e,r)=>(0,M.jsxs)(`details`,{className:$M(`niceeval-source-call`,e.tone&&`niceeval-source-call--${e.tone}`),open:e.open,children:[(0,M.jsx)(`summary`,{children:QM(e.summary,t)}),e.target.kind===`opaque`?(0,M.jsxs)(`div`,{className:`niceeval-source-opaque`,children:[(0,M.jsx)(`div`,{className:`niceeval-source-opaque-label`,children:QM(e.target.label,t)}),e.target.calls?(0,M.jsx)(cI,{calls:e.target.calls,locale:t,renderChild:n}):null]}):(0,M.jsx)(lI,{block:e.target.block,locale:t,renderChild:n,nested:!0})]},r))})}function lI({block:e,locale:t,renderChild:n,nested:r=!1}){let i=e.lines.find(e=>e.tone===`gate-fail`||e.tone===`soft-fail`||e.tone===`unavailable`)?.number,a=!1;return(0,M.jsxs)(`div`,{className:$M(`niceeval-source-block`,r&&`niceeval-source-block--nested`),children:[(0,M.jsx)(`div`,{className:`niceeval-source-block-path`,children:e.path}),(0,M.jsx)(`div`,{className:`niceeval-source-lines`,children:e.lines.map(e=>{let r=a;e.aborted&&(a=!0);let o=e.details!==void 0&&e.details.length>0||e.calls!==void 0&&e.calls.length>0,s=$M(`niceeval-source-line`,e.interaction===`send`&&`niceeval-source-line--send`,rI(nI(e)),r&&`niceeval-source-line-unreached`);return o?(0,M.jsxs)(`details`,{className:s,open:e.interaction!==`send`&&e.number===i,children:[(0,M.jsx)(`summary`,{children:(0,M.jsx)(sI,{line:e,locale:t})}),(0,M.jsxs)(`div`,{className:`niceeval-source-line-detail`,children:[e.details?.map((e,t)=>(0,M.jsx)(`div`,{children:n(e)},t)),e.calls?(0,M.jsx)(cI,{calls:e.calls,locale:t,renderChild:n}):null]})]},e.number):(0,M.jsx)(`div`,{className:s,children:(0,M.jsx)(sI,{line:e,locale:t})},e.number)})})]})}function uI({data:e,locale:t,className:n}){let r=tI(e??null);if(r===null)return null;let i=e=>$F(e,t);return(0,M.jsxs)(`div`,{className:$M(`niceeval-report`,`niceeval-source-view`,n),children:[(0,M.jsx)(lI,{block:r.spine,locale:t,renderChild:i}),r.detached.map(e=>(0,M.jsx)(lI,{block:e,locale:t,renderChild:i},e.path)),r.unmapped&&r.unmapped.length>0?(0,M.jsx)(`div`,{className:`niceeval-source-unmapped`,children:r.unmapped.map((e,t)=>(0,M.jsx)(`div`,{children:i(e)},t))}):null]})}var dI=`—`;function fI(e){return e===null?dI:aN(e)}function pI(e,t,n){let r=Math.max(n,1),i=Math.min(r,Math.max(0,e));return{x:i,width:Math.min(r-i,Math.max(t,r/1e3))}}function mI(e){return e.reduce((e,t)=>e+1+mI(t.children??[]),0)}function hI(e,t=[]){for(let n of e){let e=n.children??[];e.length===0?t.push(n):hI(e,t)}return t}var gI=5;function _I(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(t,31)+e.charCodeAt(n)>>>0;return t%gI}function vI(e){return e.reduce((e,t)=>e+ +!!t.failed+vI(t.children??[]),0)}var yI=.01,bI=3,xI=2;function SI(e,t){return!!e.failed||!!e.open||e.durationMs===null||e.durationMs>=t*yI}function CI(e){return!e.failed&&!e.open&&e.durationMs!==null}function wI(e,t){if(t===null||t<=0)return e.map(e=>({kind:`node`,node:e}));let n=[];for(let r of e){if(SI(r,t)){n.push({kind:`node`,node:r});continue}let e=n[n.length-1];e!==void 0&&e.kind===`fold`?e.nodes.push(r):n.push({kind:`fold`,nodes:[r]})}return n.map(e=>e.kind===`fold`&&e.nodes.length<xI?{kind:`node`,node:e.nodes[0]}:e)}function TI(e,t){let n=[],r=[],i=null,a=()=>{if(r.length>=bI)n.push({kind:`repeat`,nodes:r});else for(let e of r)n.push({kind:`node`,node:e});r=[],i=null};for(let o of e){if(o.kind===`node`&&CI(o.node)){let e=`${o.node.kind}\u0000${QM(o.node.label,t)}`;e!==i&&a(),i=e,r.push(o.node);continue}a(),n.push(o)}return a(),n}function EI(e,t,n){return TI(wI(e,t),n)}function DI(e){let t=new Map;for(let n of e)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].map(([e,t])=>`${e} ×${t}`).join(` · `)}function OI(e,t){return`${QM(e[0].label,t)} ×${e.length}`}function kI(e,t){let n=e.reduce((e,t)=>e+(t.durationMs??0),0);return t===`zh-CN`?`合计 ${aN(n)}`:`total ${aN(n)}`}function AI(e,t,n){return e===`zh-CN`?t===`nodes`?`${n} 个节点`:`${n} 个失败节点`:`${n} ${t===`nodes`?`node`:`failed node`}${n===1?``:`s`}`}function jI({nodes:e,locale:t,rowDurationMs:n,className:r=`niceeval-waterfall-nodes`}){return(0,M.jsx)(`ul`,{className:r,children:EI(e,n,t).map(e=>e.kind===`node`?(0,M.jsx)(MI,{node:e.node,locale:t,rowDurationMs:n},e.node.key):(0,M.jsx)(`li`,{children:(0,M.jsxs)(`details`,{className:`niceeval-waterfall-fold`,children:[(0,M.jsxs)(`summary`,{className:`niceeval-waterfall-node niceeval-waterfall-fold-summary`,children:[(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-name`,children:e.kind===`fold`?DI(e.nodes):OI(e.nodes,t)}),(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-dur`,children:kI(e.nodes,t)})]}),(0,M.jsx)(`ul`,{className:`niceeval-waterfall-node-children`,children:e.nodes.map(e=>(0,M.jsx)(MI,{node:e,locale:t,rowDurationMs:n},e.key))})]})},`${e.kind}:${e.nodes[0].key}`))})}function MI({node:e,locale:t,rowDurationMs:n}){let r=QM(e.label,t),i=e.children??[],a=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-kind`,children:e.kind}),(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-name`,title:r,children:r}),e.failed?(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-failed`,children:`✗`}):null,(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-dur`,children:fI(e.durationMs)})]});return i.length===0?(0,M.jsx)(`li`,{className:$M(`niceeval-waterfall-node`,e.failed&&`niceeval-waterfall-node--failed`),children:a}):(0,M.jsx)(`li`,{children:(0,M.jsxs)(`details`,{open:!!e.failed||!!e.open,children:[(0,M.jsx)(`summary`,{className:$M(`niceeval-waterfall-node`,e.failed&&`niceeval-waterfall-node--failed`),children:a}),(0,M.jsx)(jI,{nodes:i,locale:t,rowDurationMs:n,className:`niceeval-waterfall-node-children`})]})})}function NI(e,t,n,r){return(0,M.jsxs)(`section`,{className:$M(`niceeval-report`,`niceeval-waterfall`,r),children:[n===void 0?null:(0,M.jsx)(`div`,{className:`niceeval-waterfall-title`,children:QM(n,t)}),(0,M.jsx)(`ul`,{className:`niceeval-waterfall-list`,children:e.map(e=>{let n=mI(e.nodes),r=vI(e.nodes),i=hI(e.nodes),a=QM(e.label,t),o=e.locator!==void 0&&a===String(e.locator);return(0,M.jsxs)(`li`,{className:`niceeval-waterfall-row`,children:[(0,M.jsxs)(`div`,{className:`niceeval-waterfall-head`,children:[e.locator===void 0?null:e.href===void 0?(0,M.jsx)(`span`,{className:`niceeval-locator`,children:e.locator}):(0,M.jsx)(`a`,{className:`niceeval-locator`,href:e.href,children:e.locator}),o?null:(0,M.jsx)(`span`,{className:`niceeval-waterfall-label`,children:a}),(0,M.jsx)(`span`,{className:`niceeval-waterfall-duration`,children:fI(e.durationMs)}),(0,M.jsx)(`span`,{className:`niceeval-waterfall-count`,children:AI(t,`nodes`,n)}),r>0?(0,M.jsxs)(`span`,{className:`niceeval-waterfall-failed`,children:[`✗ `,AI(t,`failed`,r)]}):null]}),e.durationMs!==null&&i.some(e=>e.durationMs!==null)?(0,M.jsx)(`svg`,{className:`niceeval-waterfall-track`,viewBox:`0 0 ${Math.max(e.durationMs,1)} 1`,preserveAspectRatio:`none`,children:i.map(n=>{if(n.durationMs===null)return null;let r=pI(n.startOffsetMs,n.durationMs,e.durationMs);return(0,M.jsx)(`rect`,{className:$M(`niceeval-waterfall-bar`,`niceeval-span-kind-${_I(n.kind)}`,n.failed&&`niceeval-span-failed`),x:r.x,y:.15,width:r.width,height:.7,children:(0,M.jsx)(`title`,{children:`${QM(n.label,t)} · ${aN(n.durationMs)}${n.failed?` · ✗`:``}`})},n.key)})}):null,e.nodes.length>0?(0,M.jsx)(jI,{nodes:e.nodes,locale:t,rowDurationMs:e.durationMs}):null]},e.key)})})]})}function PI({nodes:e,locale:t,title:n,className:r}){let i=e??null;return i===null||i.length===0?null:NI(i,t,n,r)}function FI({children:e,className:t}){return(0,M.jsx)(`div`,{className:$M(`niceeval-report`,`niceeval-col`,t),children:v.Children.toArray(e)})}function II({children:e,className:t}){let n=v.Children.toArray(e);return(0,M.jsx)(`div`,{className:`niceeval-report niceeval-grid-fit`,children:(0,M.jsx)(`div`,{className:$M(`niceeval-report`,`niceeval-grid`,t),"data-cells":n.length,children:n.map((e,t)=>(0,M.jsx)(`div`,{className:`niceeval-grid-cell`,children:e},t))})})}function LI({cell:e}){return e===void 0||e.kind===`notApplicable`?`—`:e.kind===`verdict`?(0,M.jsx)(`span`,{className:$M(`niceeval-verdict-pill`,`niceeval-verdict-${e.verdict}`),children:e.verdict}):e.text}function RI({data:e,locale:t,className:n}){return e===null||e.rows.length===0||e.columns.length===0?null:(0,M.jsxs)(`table`,{className:$M(`niceeval-report`,`niceeval-table`,n),children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e.columns.map(e=>(0,M.jsx)(`th`,{scope:`col`,children:QM(e.header,t)},e.key))})}),(0,M.jsx)(`tbody`,{children:e.rows.map(t=>(0,M.jsx)(`tr`,{children:e.columns.map(e=>(0,M.jsx)(`td`,{children:(0,M.jsx)(LI,{cell:t.cells[e.key]})},e.key))},t.key))})]})}function zI(e){return qI(e.map(e=>JL(e,`assertion`))).slice}function BI(e,t,n){return DL(JL(e,`trace`),t,n)}function VI(e,t,n){return jL(JL(e,`trace`),t,n)}function HI(e){return ML(JL(e,`trace`))}function UI(e,t){return kL(JL(e,`timing`),t).slice}function WI(e,t){return AL(JL(t,`trace`),JL(e,`usage`))}function GI(e,t,n){return NL(JL(e,`sources`),JL(t,`trace`),n).slice}function KI(e){return PL(JL(e,`diff`))}function qI(e){let t=e.flatMap(e=>{try{return[JI(e)]}catch{return[]}}),n=t.filter(e=>e.display.outcome!==`passed`||e.score!==void 0),r=t.filter(e=>e.display.outcome===`passed`&&e.score===void 0),i=new Map;for(let e of r){let t=e.display.groupPath.join(` > `)||`Passed checks`,n=i.get(t)??[];n.push(e),i.set(t,n)}let a=t.flatMap(({score:e})=>e===void 0?[]:[e]),o=Object.freeze({attention:Object.freeze(n),passedGroups:Object.freeze([...i].map(([e,t])=>Object.freeze({group:e,items:Object.freeze(t)}))),evaluationKind:a.length===0?`pass`:`points`});return Object.freeze({data:o,slice:Object.freeze({state:`available`,data:o})})}function JI(e){let t=JL(e,`entry`),n=JL(e,`display`),r=JL(t,`decision`),i=JL(t,`evaluation`),a=XL(t.contribution)??XL(r.contribution),o=JL(t,`criterion`),s=JL(t,`materials`),c=XL(XL(t.policy)?.condition),l=LL(r.result),u=ZL(e,`sourceSites`).flatMap(e=>{let t=XL(e),n=XL(t?.source),r=XL(t?.start),i=XL(t?.end);return t===void 0||n===void 0||r===void 0||i===void 0||typeof t.entryId!=`string`||typeof t.sourceOrder!=`number`||typeof t.role!=`string`||typeof n.sourceItemId!=`string`||typeof n.sha256!=`string`||typeof r.line!=`number`||typeof r.column!=`number`||typeof i.line!=`number`||typeof i.column!=`number`?[]:[Object.freeze({entryId:t.entryId,sourceOrder:t.sourceOrder,role:t.role,source:n,start:Object.freeze({line:r.line,column:r.column}),end:Object.freeze({line:i.line,column:i.column})})]}),d=u.map(e=>{let t=YL(e.source,`assertion.sourceSites[].source`);return Object.freeze({...e,target:Object.freeze({state:`exact`,sourceItemId:QL(t,`sourceItemId`),sha256:QL(t,`sha256`)})})}),f=YI(JL(e,`check`)),p=JL(e,`matcher`),m=EL(p),h=sL(p.debugger),g=XI(o),_=QI(i,m),v=ZI(c),y=eL(t,f),b=$I(s),x=Object.freeze({entryId:QL(e,`entryId`),display:Object.freeze({...typeof n.key==`string`?{key:n.key}:{},...typeof n.label==`string`?{label:n.label}:{},groupPath:Object.freeze($L(n.groupPath))}),entry:t,sourceSites:Object.freeze(u),check:f,matcher:m}),S=typeof n.label==`string`?n.label:typeof n.key==`string`?n.key:x.entryId,C=IL(a),w=r.gate,T=l===`matched`?`passed`:l===`mismatched`||l===`errored`?`failed`:`unavailable`;return Object.freeze({entryId:x.entryId,closed:x,display:Object.freeze({name:S,severity:w===`failed`||w===`unavailable`?`gate`:C===void 0?`recorded`:`scored`,outcome:T,groupPath:x.display.groupPath,detail:typeof r.reason==`string`?r.reason:``}),sourceSites:Object.freeze(d),check:g,decision:Object.freeze({result:l,observed:_,expected:v,diagnosticTree:y,...typeof r.reason==`string`?{reason:r.reason}:{}}),evidence:Object.freeze({source:b,check:g,observed:_,expected:v,explanation:y,...h===void 0?{}:{matcherDebugger:h}}),...C===void 0?{}:{score:C},retained:Object.freeze({matcher:m})})}function YI(e){return Object.freeze({label:QL(e,`label`),state:QL(e,`state`),expected:iR(e.expected),observed:iR(e.observed),reason:nR(e.reason),anchor:iR(e.anchor),children:Object.freeze(ZL(e,`children`).map((e,t)=>YI(YL(e,`check.children[${t}]`))))})}function XI(e){return e.state===`available`?HL(e.value):Object.freeze({kind:`unavailable`,reason:`not-recorded`})}function ZI(e){return e?.state===`available`?HL(e.value):Object.freeze({kind:`unavailable`,reason:`not-recorded`})}function QI(e,t){let n=VL(e.observed),r=e.kind===`ordinary`?e.receipt:e.kind===`matcher-current`&&!Array.isArray(t.comparator)?t.receipt:void 0;return BL([...n.kind===`fields`?n.fields:[{label:`value`,value:n}],...r==null?[]:[{label:`receipt`,value:HL(r)}]])}function $I(e){let t=aL(JL(e,`source`)),n=ZL(e,`evidence`).map((e,t)=>aL(YL(e,`materials.evidence[${t}]`))),r=ZL(e,`limitations`).map(HL);return BL([{label:`input`,value:t},...n.length===0?[]:[{label:`evidence`,value:Object.freeze({kind:`list`,items:Object.freeze(n)})}],{label:`coverage`,value:HL(e.coverage)},...r.length===0?[]:[{label:`limitations`,value:Object.freeze({kind:`list`,items:Object.freeze(r)})}]])}function eL(e,t){let n=JL(e,`explanationRetention`);if(n.state===`retained`){let e=nL(VL(n.value));if(e.kind!==`fields`)return rL(t);let r=new Set(e.fields.map(e=>e.label));return BL([...e.fields,...!r.has(`expected`)&&t.expected!==null?[{label:`expected`,value:tL(t.expected)}]:[],...!r.has(`received`)&&t.observed!==null?[{label:`received`,value:tL(t.observed)}]:[],...!r.has(`reason`)&&t.reason!==null?[{label:`reason`,value:zL(t.reason)}]:[]])}return rL(t)}function tL(e){let t=XL(e);return t!==void 0&&(t.kind===`unavailable`||t.kind===`value`||t.kind===`text`||t.kind===`list`||t.kind===`fields`)?VL(e):HL(e)}function nL(e){if(e.kind===`list`)return Object.freeze({kind:`list`,items:Object.freeze(e.items.map(nL))});if(e.kind!==`fields`)return e;let t=new Set(e.fields.map(e=>e.label));return BL(e.fields.map(e=>({label:e.label===`observed`&&!t.has(`received`)?`received`:e.label===`message`&&!t.has(`reason`)?`reason`:e.label,value:nL(e.value)})))}function rL(e){let t=XL(e.anchor),n=typeof t?.id==`string`?t.id:typeof t?.toolOccurrenceId==`string`?t.toolOccurrenceId:typeof t?.eventId==`string`?t.eventId:void 0;return BL([{label:`code`,value:zL(e.label)},...e.expected===null?[]:[{label:`expected`,value:tL(e.expected)}],...e.observed===null?[]:[{label:`received`,value:tL(e.observed)}],...e.reason===null?[]:[{label:`reason`,value:zL(e.reason)}],...n===void 0?[]:[{label:`locator`,value:BL([{label:`id`,value:zL(n)}])}],{label:`children`,value:Object.freeze({kind:`list`,items:Object.freeze(e.children.map((e,t)=>BL([{label:`index`,value:zL(t)},{label:`label`,value:zL(e.label)},{label:`state`,value:zL(iL(e.state))},{label:`diagnostic`,value:rL(e)}])))})}])}function iL(e){return e===`matched`||e===`mismatched`?e:`unavailable`}function aL(e){if(e.kind===`snapshot`)return HL(e.value);if(e.kind===`unavailable`)return Object.freeze({kind:`unavailable`,reason:`not-recorded`});if(e.kind!==`content`)throw Error(`Assertion material kind is invalid`);let t=JL(e,`content`);if(t.state!==`available`||typeof t.base64!=`string`)throw Error(`Assertion material content is unavailable`);let n=oL(t.base64);return e.encoding===`json`?HL(JSON.parse(n)):e.encoding===`utf-8`?Object.freeze({kind:`text`,text:n}):HL({encoding:e.encoding,byteLength:e.byteLength,preview:e.preview})}function oL(e){let t=globalThis.atob(e),n=Uint8Array.from(t,e=>e.charCodeAt(0));return new TextDecoder(`utf-8`,{fatal:!0}).decode(n)}function sL(e){if(e==null)return;let t=YL(e,`matcher.debugger`),n=vL(t.state),r=yL(t.subject),i=JL(t,`source`),a=cL(JL(i,`final`));if(n===`legacy`)return Object.freeze({state:n,queryKind:`unavailable`,subject:r,querySummary:`Matcher query was not retained`,facts:Object.freeze([]),atEvaluation:Object.freeze({state:a.state,rows:Object.freeze(a.rows.map(e=>e.content))}),afterEvaluation:Object.freeze([]),relationNotice:`historical-not-recorded`});let o=JL(t,`query`),s=bL(o.kind),c=Object.freeze(s===`collection-filter`?[VL(o.summary)]:ZL(o,`summaries`).map(VL)),l=s===`collection-filter`?fL(c[0]):c.map(pL).join(` → `),u=JL(t,`receipt`),d=cL(JL(i,`atEvaluation`)),f=_L(JL(t,`identityRelation`)),p=[...d.state===`partial`?[`source-partial`]:[],...t.overlayRetention===`partial`?[`overlay-partial`]:[],...d.state===`unavailable`?[`source-unavailable`]:[]].filter(e=>e!==f);return Object.freeze({state:n,queryKind:s,subject:r,querySummary:l,receipt:iR(u),sourceLedger:iR(i),facts:Object.freeze([Object.freeze({kind:`observed`,value:hL(s,c.length,u)}),Object.freeze({kind:`examined`,value:gL(s,u)})]),steps:Object.freeze(ZL(t,`steps`).map(uL)),atEvaluation:Object.freeze({state:d.state,rows:Object.freeze(d.rows.map(e=>e.content)),...p.length===0?{}:{notices:Object.freeze(p)}}),afterEvaluation:Object.freeze(a.rows.filter(e=>e.phase===`outside-evaluation-snapshot`).map(e=>e.content)),...f===void 0?{}:{relationNotice:f}})}function cL(e){return Object.freeze({state:xL(e.state),rows:Object.freeze(ZL(e,`rows`).map((e,t)=>lL(YL(e,`matcher.debugger.source.rows[${t}]`))))})}function lL(e){let t=JL(e,`evaluation`),n=CL(t.result),r=t.difference===void 0?void 0:dL(VL(t.difference)),i=XL(e.conversationTarget);return Object.freeze({phase:wL(e.phase),content:Object.freeze({key:QL(e,`rowId`),number:QL(e,`number`),kind:SL(e.kind),summary:QL(e,`summary`),state:n,fields:dL(VL(e.detail)),...r===void 0?{}:{difference:r},...i?.state===`exact`&&typeof i.anchor==`string`?{conversationTarget:Object.freeze({anchor:i.anchor})}:{}})})}function uL(e,t){let n=YL(e,`matcher.debugger.steps[${t}]`),r=XL(n.conversationTarget);return Object.freeze({step:tR(n,`step`),summary:UL(VL(n.summary)),state:TL(n.state),...typeof n.sourceRow==`string`?{sourceRow:n.sourceRow}:{},...r?.state===`exact`&&typeof r.anchor==`string`?{conversationTarget:Object.freeze({anchor:r.anchor})}:{}})}function dL(e){return e.kind===`fields`?Object.freeze(e.fields.map(e=>Object.freeze({label:e.label,value:UL(e.value)}))):e.kind===`list`?Object.freeze(e.items.map((e,t)=>Object.freeze({label:String(t+1),value:UL(e)}))):Object.freeze([Object.freeze({label:`value`,value:UL(e)})])}function fL(e){let t=mL(e,`matcher`),n=mL(e,`quantifier`),r=n===void 0?void 0:mL(n,`kind`),i=n===void 0?void 0:mL(n,`count`),a=t===void 0?void 0:UL(t);return a===void 0||a.length===0||r?.kind!==`value`||typeof r.value!=`string`?UL(e):r.value===`absent`?`none × ${a}`:i?.kind!==`value`||typeof i.value!=`number`?UL(e):r.value===`exact`?`exactly ${i.value} × ${a}`:r.value===`at-least`?`at least ${i.value} × ${a}`:r.value===`less-than`?`less than ${i.value} × ${a}`:r.value===`at-most`?`at most ${i.value} × ${a}`:r.value===`greater-than`?`greater than ${i.value} × ${a}`:UL(e)}function pL(e){let t=mL(e,`matcher`);if(t===void 0)return UL(e);let n=UL(t);return n.length===0?UL(e):n}function mL(e,t){return e.kind===`fields`?e.fields.find(e=>e.label===t)?.value:void 0}function hL(e,t,n){return e===`collection-filter`&&typeof n.matched==`number`&&typeof n.mismatched==`number`&&typeof n.unavailable==`number`?Object.freeze({en:`${n.matched} matched · ${n.mismatched} not matched · ${n.unavailable} unknown`,"zh-CN":`${n.matched} 条命中 · ${n.mismatched} 条未命中 · ${n.unavailable} 条无法判断`}):e===`ordered-sequence`&&typeof n.definitePrefixLength==`number`&&typeof n.possiblePrefixLength==`number`?Object.freeze({en:`${n.definitePrefixLength}/${t} definite · ${n.possiblePrefixLength}/${t} possible`,"zh-CN":`${n.definitePrefixLength}/${t} 步确定 · ${n.possiblePrefixLength}/${t} 步可能`}):Object.freeze({en:`unavailable`,"zh-CN":`不可用`})}function gL(e,t){if(e===`collection-filter`&&typeof t.examined==`number`){let e=typeof t.knownTotal==`number`?t.knownTotal:`?`;return Object.freeze({en:`${t.examined}/${e} rows`,"zh-CN":`${t.examined}/${e} 条记录`})}return e===`ordered-sequence`&&typeof t.sourceRows==`number`&&typeof t.comparisons==`number`?Object.freeze({en:`${t.sourceRows} rows · ${t.comparisons} comparisons`,"zh-CN":`${t.sourceRows} 条记录 · ${t.comparisons} 次比较`}):Object.freeze({en:`unavailable`,"zh-CN":`不可用`})}function _L(e){if(e.state!==`exact`)return e.reason===`ambiguous`?`ambiguous-relation`:`source-unavailable`}function vL(e){if(e===`current`||e===`legacy`)return e;throw Error(`matcher.debugger.state is invalid`)}function yL(e){if(e===`tool`||e===`event`||e===`source-row`)return e;throw Error(`matcher.debugger.subject is invalid`)}function bL(e){if(e===`collection-filter`||e===`ordered-sequence`)return e;throw Error(`matcher.debugger.query.kind is invalid`)}function xL(e){if(e===`complete`||e===`partial`||e===`unavailable`)return e;throw Error(`matcher.debugger source state is invalid`)}function SL(e){if(e===`tool`||e===`event`||e===`legacy-source-row`)return e;throw Error(`matcher.debugger row kind is invalid`)}function CL(e){if(e===`matched`||e===`mismatched`||e===`unavailable`||e===`not-evaluated`||e===`not-retained`||e===`outside-snapshot`||e===`legacy`)return e;throw Error(`matcher.debugger row state is invalid`)}function wL(e){if(e===`at-evaluation`||e===`outside-evaluation-snapshot`||e===`historical`)return e;throw Error(`matcher.debugger row phase is invalid`)}function TL(e){if(e===`matched`||e===`possible`||e===`blocked`||e===`not-reached`)return e;throw Error(`matcher.debugger step state is invalid`)}function EL(e){let t=ZL(e,`targets`).flatMap(e=>{let t=XL(e),n=XL(t?.anchor);if(t===void 0||n===void 0||typeof t.state!=`string`)return[];let r;return n.kind===`tool-occurrence`&&typeof n.toolOccurrenceId==`string`?r={kind:`tool-occurrence`,toolOccurrenceId:n.toolOccurrenceId}:n.kind===`event`&&typeof n.eventId==`string`&&(r={kind:`event`,eventId:n.eventId}),r===void 0?[]:[Object.freeze({state:t.state,anchor:Object.freeze(r),difference:iR(t.difference),conversationAnchor:RL(r)})]}),n=XL(e.sandboxCommandJoin),r=n?.state===`matched`&&typeof n.commandId==`string`?{state:`matched`,commandId:n.commandId}:{state:`unavailable`,reason:typeof n?.reason==`string`?n.reason:`not-recorded`},i=e.state===`ordinary`||e.state===`legacy`||e.state===`available`||e.state===`missing`?e.state:`missing`;return Object.freeze({state:i,sourceState:typeof e.sourceState==`string`?e.sourceState:null,comparator:iR(e.comparator),sourceLedger:iR(e.sourceLedger),receipt:iR(e.receipt),result:iR(e.result),targets:Object.freeze(t),sandboxCommandJoin:r,commandMatch:r,...typeof e.reason==`string`?{reason:e.reason}:{}})}function DL(e,t,n){let r=JL(e,`conversation`),i=ZL(r,`items`).map((e,t)=>YL(e,`trace.conversation.items[${t}]`)),a=new Map;for(let e of t){if(e.operation!==`attempt.trace.detail`)continue;let t=JL(e,`detail`);if(t.kind===`item`){let e=XL(t.item);e!==void 0&&typeof t.itemId==`string`&&a.set(t.itemId,e)}}let o=ZL(r,`turns`).map((e,t)=>{let n=YL(e,`trace.conversation.turns[${t}]`),r=QL(n,`turnId`),o=i.filter(e=>e.turnId===r).map(e=>OL(a.get(QL(e,`itemId`))??e));return Object.freeze({key:r,label:`Turn ${tR(n,`sequence`)}`,verdict:qL(n.outcome),entries:Object.freeze(o)})}),s=Object.freeze({turns:Object.freeze(o),locator:n});return FL(r.state,s,`Closed observability`)}function OL(e){let t=QL(e,`itemId`),n=QL(e,`kind`),r=XL(e.occurrence),i=typeof e.toolOccurrenceId==`string`?e.toolOccurrenceId:r?.state===`exact`&&typeof r.toolOccurrenceId==`string`?r.toolOccurrenceId:void 0,a=typeof e.eventId==`string`?e.eventId:void 0,o=WL(e,n),s=typeof e.role==`string`?e.role:void 0,c=n===`message`?s===`user`?`user`:s===`assistant`?`assistant`:`message`:n===`tool-call`||n===`tool-result`?`tool`:n,l=typeof e.tool==`string`?e.tool:`tool`,u=typeof e.input==`string`?e.input:``,d=typeof e.output==`string`?e.output:void 0,f=n===`tool-call`?`started`:n===`tool-result`?`finished`:void 0,p=KL(e.outcome),m=i===void 0?a===void 0?void 0:RL({kind:`event`,eventId:a}):RL({kind:`tool-occurrence`,toolOccurrenceId:i}),h=f===void 0?{kind:`text`,text:o}:{kind:`tool-evidence`,content:{phase:f,tool:l,...i===void 0?{}:{callId:i},...r===void 0?{}:i===void 0?{toolOccurrence:{state:`unavailable`,reason:String(r.reason??`not-recorded`)}}:{toolOccurrence:{state:`exact`,toolOccurrenceId:i}},inputSummary:u,...d===void 0?{}:{outputSummary:d},...p===void 0?{}:{outcome:p}}};return Object.freeze({id:t,...a===void 0?{}:{eventId:a},...typeof e.sequence==`number`?{sequence:e.sequence}:{},kind:c,preview:o,...m===void 0?{}:{anchor:m},detail:h,raw:JSON.stringify(e),...p===`failed`||p===`rejected`?{failed:!0}:{},...f===void 0?{}:{callPhase:f},...i===void 0?{}:{callId:i},...r===void 0?{}:i===void 0?{toolOccurrence:{state:`unavailable`,reason:String(r.reason??`not-recorded`)}}:{toolOccurrence:{state:`exact`,toolOccurrenceId:i}},...p===void 0?{}:{callOutcome:p},commandMatch:{state:`unavailable`,reason:`not-recorded`}})}function kL(e,t){let n=ZL(e,`activities`).map((e,t)=>YL(e,`timing.activities[${t}]`)),r=new Map;for(let e of n){let t=typeof e.parentActivityId==`string`?e.parentActivityId:null,n=r.get(t)??[];n.push(e),r.set(t,n)}let i=e=>{let t=QL(e,`activityId`),n=(r.get(t)??[]).map(i);return Object.freeze({key:t,label:QL(e,`label`),kind:QL(e,`phase`),startOffsetMs:eR(e,`startOffsetMs`),durationMs:rR(e.durationMs),...e.outcome===`failed`?{failed:!0}:{},...n.length===0?{}:{children:Object.freeze(n)}})},a=(r.get(null)??[]).map(i),o=n.reduce((e,t)=>{let n=eR(t,`startOffsetMs`),r=rR(t.durationMs);return r===null?e:Math.max(e??0,n+r)},null),s=n.length===0?Object.freeze([]):Object.freeze([{key:t,label:t,durationMs:o,nodes:Object.freeze(a),locator:t}]);return Object.freeze({data:s,slice:FL(e.state,s,`Execution timeline`)})}function AL(e,t){let n=[];for(let e of ZL(t,`observations`)){let t=XL(e);if(!(t===void 0||typeof t.kind!=`string`||typeof t.turnId!=`string`)){if(t.kind===`token-bucket`&&typeof t.usageObservationId==`string`&&typeof t.provider==`string`&&typeof t.bucket==`string`&&typeof t.tokens==`number`){n.push({kind:`token-bucket`,usageObservationId:t.usageObservationId,turnId:t.turnId,provider:t.provider,bucket:t.bucket,tokens:t.tokens});continue}if(t.kind===`request`&&typeof t.usageObservationId==`string`&&typeof t.provider==`string`&&typeof t.requestKind==`string`){n.push({kind:`request`,usageObservationId:t.usageObservationId,turnId:t.turnId,provider:t.provider,requestKind:t.requestKind});continue}t.kind===`provider-cost`&&typeof t.usageObservationId==`string`&&typeof t.provider==`string`&&typeof t.amount==`string`&&typeof t.currency==`string`&&n.push({kind:`provider-cost`,usageObservationId:t.usageObservationId,turnId:t.turnId,provider:t.provider,amount:t.amount,currency:t.currency})}}let r=JL(e,`conversation`),i=Object.freeze({turns:ZL(r,`turns`).length,toolCalls:ZL(r,`items`).filter(e=>XL(e)?.kind===`tool-call`).length,observations:Object.freeze(n)});return FL(t.state,i,`Usage`)}function jL(e,t,n){let r=JL(e,`commands`),i=new Map;for(let e of t){if(e.operation!==`attempt.trace.detail`)continue;let t=JL(e,`detail`);t.kind===`command`&&typeof t.commandId==`string`&&i.set(t.commandId,t)}let a=ZL(r,`items`).map((e,t)=>{let n=YL(e,`trace.commands.items[${t}]`),a=QL(n,`commandId`),o=i.get(a)??n,s=JL(o,`invocation`),c=JL(o,`outcome`),l=XL(o.stdout),u=XL(o.stderr),d=XL(l?.truncation),f=XL(u?.truncation),p=c.kind===`exited`&&typeof c.exitCode==`number`?c.exitCode:void 0;return Object.freeze({commandId:a,timingNodeId:a,phase:QL(o,`phase`),display:GL(s),...p===void 0?{}:{exitCode:p},invocation:s,...typeof o.workingDirectory==`string`?{workingDirectory:o.workingDirectory}:{},outcome:c,classification:p===0?`succeeded`:p===void 0?`observed`:`failed`,...typeof l?.text==`string`&&l.text.length>0?{stdout:l.text}:{},...typeof u?.text==`string`&&u.text.length>0?{stderr:u.text}:{},collectionState:r.state===`partial`?`partial`:`complete`,...l===void 0?{}:{stdoutState:l.textTruncated===!0||d?.state===`truncated`?`truncated`:`complete`,...typeof l.retainedBytes==`number`?{stdoutRetainedBytes:l.retainedBytes}:{},...typeof l.totalSafeUtf8Bytes==`number`?{stdoutTotalBytes:l.totalSafeUtf8Bytes}:{}},...u===void 0?{}:{stderrState:u.textTruncated===!0||f?.state===`truncated`?`truncated`:`complete`,...typeof u.retainedBytes==`number`?{stderrRetainedBytes:u.retainedBytes}:{},...typeof u.totalSafeUtf8Bytes==`number`?{stderrTotalBytes:u.totalSafeUtf8Bytes}:{}}})});return FL(r.state,Object.freeze({commands:Object.freeze(a),locator:n}),`Commands`)}function ML(e){let t=XL(e.diagnostics);if(t===void 0)return Object.freeze({state:`unavailable`,limitations:Object.freeze([{code:`diagnostics-projection-unavailable`,summary:`Diagnostics are not exposed by the fixed execution projection.`}])});let n=ZL(t,`items`).map((e,t)=>{let n=YL(e,`trace.diagnostics.items[${t}]`),r=XL(n.redaction),i=QL(n,`kind`),a=r?.state===`applied`&&typeof r.replacements==`number`?{state:`applied`,replacements:r.replacements}:{state:`none`};return Object.freeze({diagnosticId:QL(n,`diagnosticId`),code:QL(n,`code`),kind:i,phase:QL(n,`phase`),summary:QL(n,`summary`),level:i===`execution-error`?`error`:`warning`,causes:Object.freeze(ZL(n,`causes`).flatMap(e=>{let t=XL(e);return typeof t?.code==`string`&&typeof t.summary==`string`?[{code:t.code,summary:t.summary}]:[]})),redaction:a,...n.sourceFrame===null||n.sourceFrame===void 0?{}:{sourceFrame:iR(n.sourceFrame)}})}),r=new Map;for(let e of n){let t=r.get(e.phase)??[];t.push(e),r.set(e.phase,t)}let i=Object.freeze({groups:Object.freeze([...r].map(([e,t])=>Object.freeze({phase:e,items:Object.freeze(t)})))});return FL(t.state,i,`Diagnostics`)}function NL(e,t,n){let r=ZL(JL(t,`conversation`),`turns`),i=ZL(e,`items`).flatMap((e,t)=>{let n=XL(e),i=XL(n?.content);if(n===void 0||i?.state!==`available`||typeof n.sourceItemId!=`string`||typeof n.path!=`string`||typeof n.sha256!=`string`||typeof i.text!=`string`)return[];let a=r.flatMap(e=>{let t=XL(e),r=XL(t?.context);return r?.state===`mapped`&&r.sourceItemId===n.sourceItemId&&r.sha256===n.sha256&&typeof t?.turnId==`string`?[{turnId:t.turnId,start:XL(r.start),end:XL(r.end)}]:[]}),o=i.text.split(`
61
+ `).map((e,t)=>{let n=t+1,r=a.flatMap(e=>typeof e.start?.line==`number`&&typeof e.end?.line==`number`&&n>=e.start.line&&n<=e.end.line?[e.turnId]:[]);return Object.freeze({number:n,text:e,...r.length===0?{}:{tone:`send`,turnIds:Object.freeze(r)}})});return[Object.freeze({sourceItemId:n.sourceItemId,sha256:n.sha256,path:n.path,lines:Object.freeze(o)})]});if(i.length===0)return Object.freeze({data:null,slice:FL(e.state,null,`Source navigation`)});let a=Object.freeze({spine:i[0],detached:Object.freeze(i.slice(1)),locator:n}),o=FL(e.state,a,`Source navigation`);return Object.freeze({data:a,slice:o})}function PL(e){return e.state===`not-recorded`||Object.keys(e).length===0?Object.freeze({state:`not-recorded`,limitations:Object.freeze([{code:`file-changes-not-recorded`,summary:`File changes collection was not recorded for this Attempt.`}])}):Object.freeze({state:`unavailable`,limitations:Object.freeze([{code:`file-changes-content-unavailable`,summary:`File changes collection has no display-safe patch projection.`}])})}function FL(e,t,n){if(e===`available`||e===`complete`)return Object.freeze({state:`available`,data:t});let r=Object.freeze([{code:String(e??`unavailable`),summary:`${n}: ${String(e??`unavailable`)}.`}]);return Object.freeze(e===`partial`?{state:`partial`,data:t,limitations:r}:e===`not-recorded`?{state:`not-recorded`,limitations:r}:{state:`unavailable`,limitations:r})}function IL(e){if(!(e===void 0||e.state===`not-scored`||typeof e.points!=`number`))return e.state===`earned`&&typeof e.earned==`number`?Object.freeze({state:`earned`,points:e.points,earned:e.earned}):Object.freeze({state:`unavailable`,points:e.points})}function LL(e){return e===`matched`||e===`mismatched`||e===`unavailable`||e===`errored`||e===`not-applicable`?e:`unavailable`}function RL(e){return e.kind===`tool-occurrence`?`tool:${e.toolOccurrenceId}`:`event:${e.eventId}`}function zL(e){return Object.freeze({kind:`value`,value:e})}function BL(e){return Object.freeze({kind:`fields`,fields:Object.freeze(e.map(e=>Object.freeze(e)))})}function VL(e){let t=YL(e,`assertion fact`);if(t.kind===`unavailable`&&typeof t.reason==`string`)return Object.freeze({kind:`unavailable`,reason:t.reason});if(t.kind===`value`&&(t.value===null||typeof t.value==`string`||typeof t.value==`boolean`||typeof t.value==`number`&&Number.isFinite(t.value)))return zL(t.value);if(t.kind===`text`&&typeof t.text==`string`)return Object.freeze({kind:`text`,text:t.text});if(t.kind===`list`)return Object.freeze({kind:`list`,items:Object.freeze(ZL(t,`items`).map(VL))});if(t.kind===`fields`)return BL(ZL(t,`fields`).map((e,t)=>{let n=YL(e,`assertion fact.fields[${t}]`);return Object.freeze({label:QL(n,`label`),value:VL(n.value)})}));throw Error(`Assertion fact has an invalid closed shape`)}function HL(e){if(e===null||typeof e==`string`||typeof e==`boolean`)return zL(e);if(typeof e==`number`)return Number.isFinite(e)?zL(e):Object.freeze({kind:`unavailable`,reason:`source-unavailable`});if(Array.isArray(e))return Object.freeze({kind:`list`,items:Object.freeze(e.map(HL))});let t=XL(e);return t===void 0?Object.freeze({kind:`unavailable`,reason:`source-unavailable`}):BL(Object.entries(t).map(([e,t])=>({label:e,value:HL(t)})))}function UL(e){switch(e.kind){case`unavailable`:return e.reason;case`value`:return typeof e.value==`string`?e.value:String(e.value);case`text`:return e.text;case`list`:return e.items.map(UL).join(`, `);case`fields`:return e.fields.map(e=>`${e.label}: ${UL(e.value)}`).join(` · `)}}function WL(e,t){return t===`message`&&typeof e.text==`string`?e.text:t===`tool-call`?`${typeof e.tool==`string`?e.tool:`tool`} ${typeof e.input==`string`?e.input:``}`.trim():t===`tool-result`&&typeof e.output==`string`?e.output:typeof e.summary==`string`?e.summary:t===`input-request`&&typeof e.prompt==`string`?typeof e.response==`string`?`${e.prompt}\n${e.response}`:e.prompt:JSON.stringify(e)}function GL(e){return e.kind===`shell`&&typeof e.command==`string`?e.command:e.kind===`argv`&&typeof e.executable==`string`?[e.executable,...$L(e.arguments)].join(` `):JSON.stringify(e)}function KL(e){return e===`completed`||e===`rejected`||e===`failed`||e===`cancelled`?e:void 0}function qL(e){if(e===`completed`)return`passed`;if(e===`failed`)return`failed`;if(e===`cancelled`)return`skipped`;if(e===`interrupted`)return`errored`}function JL(e,t){return YL(Reflect.get(e,t),t)}function YL(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`${t} must be an object.`);return e}function XL(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function ZL(e,t){let n=e[t];if(!Array.isArray(n))throw Error(`${t} must be an array.`);return n}function QL(e,t){let n=e[t];if(typeof n!=`string`)throw Error(`${t} must be a string.`);return n}function $L(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function eR(e,t){let n=e[t];if(typeof n!=`number`||!Number.isFinite(n))throw Error(`${t} must be a number.`);return n}function tR(e,t){let n=e[t];if(typeof n!=`number`||!Number.isSafeInteger(n))throw Error(`${t} must be an integer.`);return n}function nR(e){return typeof e==`string`?e:null}function rR(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function iR(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e))return e;if(Array.isArray(e))return Object.freeze(e.map(iR));let t=XL(e);return t===void 0?null:Object.freeze(Object.fromEntries(Object.entries(t).map(([e,t])=>[e,iR(t)])))}function aR(e){let t=e.display,n=e.score,r=n?.state===`earned`?n.earned??0:void 0,i=n===void 0?``:` · weight ${n.points} ${n.points===1?`pt`:`pts`} · earned ${r===void 0?`unavailable`:`${r} ${r===1?`pt`:`pts`}`}`;return[{kind:`text`,className:`niceeval-source-assertion ${e.decision.result===`matched`?`niceeval-tone-good`:e.decision.result===`mismatched`&&t.severity===`gate`?`niceeval-tone-bad`:e.decision.result===`mismatched`?`niceeval-tone-warn`:`niceeval-tone-na`}`,text:`${t.name} · ${t.severity} ${t.outcome}${i}`},{kind:`assertion`,entryId:e.entryId,content:e.evidence,label:t.name,state:e.decision.result===`matched`?`matched`:e.decision.result===`mismatched`?`mismatched`:`unavailable`}]}function oR(e){return e===null||e.attention.length===0&&e.passedGroups.length===0?null:{columns:[{key:`name`,header:{en:`Name`,"zh-CN":`名称`}},{key:`severity`,header:{en:`Severity`,"zh-CN":`级别`}},{key:`outcome`,header:{en:`Outcome`,"zh-CN":`结果`}},{key:`detail`,header:{en:`Detail`,"zh-CN":`详情`}}],rows:e.attention.map(e=>({key:e.entryId,cells:{name:{kind:`text`,text:e.display.name},severity:{kind:`text`,text:e.display.severity},outcome:{kind:`verdict`,verdict:e.display.outcome===`unavailable`?`skipped`:e.display.outcome},detail:e.display.detail.length>0?{kind:`text`,text:e.display.detail}:{kind:`notApplicable`}}}))}}function sR(e){if(e.some(e=>e.decision.result===`mismatched`&&e.display.severity===`gate`))return`gate-fail`;if(e.some(e=>e.decision.result===`mismatched`))return`soft-fail`;if(e.some(e=>e.decision.result===`unavailable`||e.decision.result===`errored`||e.decision.result===`not-applicable`))return`unavailable`;if(e.some(e=>e.decision.result===`matched`))return`passed`}function cR(e,t){let n={send:0,passed:1,unavailable:2,"soft-fail":3,"gate-fail":4};return t===void 0?e:e===void 0||n[t]>n[e]?t:e}function lR(e,t){if(e===null||t===null)return e;let n=[...t.attention,...t.passedGroups.flatMap(e=>e.items)],r=[e.spine,...e.detached],i=new Set(r.map(e=>`${e.sourceItemId}\u0000${e.sha256}`)),a=new Set,o=e=>({...e,lines:e.lines.map(t=>{let r=n.flatMap(n=>n.sourceSites.filter(n=>n.target.state===`exact`&&n.target.sourceItemId===e.sourceItemId&&n.target.sha256===e.sha256&&t.number>=n.start.line&&t.number<=n.end.line).map(e=>({entry:n,site:e})));for(let{entry:e}of r)a.add(e.entryId);let i=r.filter(({site:e})=>e.role!==`score`).map(({entry:e})=>e),o=r.filter(({site:e})=>e.role!==`score`&&e.start.line===t.number).map(({entry:e})=>e),s=new Set((t.details??[]).flatMap(e=>e.kind===`assertion`?[e.entryId]:[])),c=[...t.details??[],...o.filter(e=>!s.has(e.entryId)).flatMap(aR)],l=r.filter(({site:e,entry:t})=>e.role===`score`&&t.score!==void 0),u=l.reduce((e,{entry:t})=>e+(t.score?.state===`earned`?t.score.earned??0:0),0),d=l.length===0?t.pill:`${u} ${u===1?`pt`:`pts`}`,f=cR(t.tone,sR(i));return{...t,...f===void 0?{}:{tone:f},...d===void 0?{}:{pill:d},...c.length===0?{}:{details:c}}})}),s=o(e.spine),c=e.detached.map(o);for(let e of n)e.sourceSites.some(e=>e.target.state===`exact`&&i.has(`${e.target.sourceItemId}\u0000${e.target.sha256}`))||a.delete(e.entryId);let l=[...e.unmapped??[],...n.filter(e=>!a.has(e.entryId)).flatMap(aR)];return{...e,spine:s,detached:c,...l.length===0?{}:{unmapped:l}}}var uR=[{title:{en:`Execution evidence unavailable`,"zh-CN":`执行证据不可用`},items:[{level:`warning`,message:{en:`The events artifact is missing or was not published.`,"zh-CN":`事件证据缺失或未发布。`}}]}];function dR(e){return e===null?[]:e.groups.map(e=>({title:e.phase,items:e.items.map(e=>({level:e.level,message:`${e.code}: ${e.summary}`}))}))}function fR(e){return e.map(e=>({level:`warning`,message:`${e.code}: ${e.summary}`}))}function pR(e,t){if(t.state===`available`)return[];let n=fR(t.limitations);return[{title:e,items:n.length>0?n:[{level:`warning`,message:`Evidence state: ${t.state}.`}]}]}function mR(e){return e.state===`available`||e.state===`partial`?e.data:null}function hR(e,t){let n=t?.turns??[],r=new Map(n.map(e=>[e.key,e])),i=new Set,a=e=>{let n=(e.turnIds??[]).flatMap(e=>{let t=r.get(e);return t===void 0?[]:(i.add(e),[t])}),a=e.details===void 0&&n.length===0?void 0:[...e.details??[],...n.length===0?[]:[{kind:`turn-trace`,data:{turns:n,locator:t?.locator}}]];return{...e,...a===void 0?{}:{details:a}}},o=e=>({...e,lines:e.lines.map(a)}),s=e===null?null:{...e,spine:o(e.spine),detached:e.detached.map(o)},c=n.filter(e=>!i.has(e.key));return{source:s,conversation:t===null||c.length===0?null:{...t,turns:c}}}function gR({label:e,value:t}){return(0,M.jsxs)(`div`,{className:`niceeval-kpi`,children:[(0,M.jsx)(`span`,{className:`niceeval-kpi-label`,children:e}),(0,M.jsx)(`span`,{className:`niceeval-kpi-value`,children:t})]})}function _R({locator:e,data:t,locale:n}){let{t:r}=Uo();return(0,M.jsxs)(`div`,{className:`niceeval-attempt-summary`,children:[(0,M.jsxs)(`div`,{className:`niceeval-attempt-summary-head`,children:[(0,M.jsx)(`span`,{className:`niceeval-verdict-pill niceeval-verdict-${t.verdict}`,children:r(`attempt.verdict.${t.verdict}`)}),(0,M.jsx)(`span`,{className:`niceeval-attempt-summary-locator`,children:e})]}),(0,M.jsxs)(`div`,{className:`niceeval-grid niceeval-attempt-summary-kpis`,children:[(0,M.jsx)(gR,{label:r(`attempt.experiment`),value:t.experimentId}),(0,M.jsx)(gR,{label:r(`attempt.eval`),value:t.identity.evalId}),(0,M.jsx)(gR,{label:r(`attempt.title`),value:t.identity.attempt.state===`available`?String(t.identity.attempt.value+1):`—`}),t.totalScore===void 0?null:(0,M.jsx)(gR,{label:r(`attempt.score`),value:sN(t.totalScore,n)}),t.startedAt===void 0?null:(0,M.jsx)(gR,{label:r(`attempt.started`),value:cN(t.startedAt,n)}),(0,M.jsx)(gR,{label:r(`attempt.duration`),value:t.durationMs.state===`available`?aN(t.durationMs.value):`—`}),t.observedCostUSD===void 0?null:(0,M.jsx)(gR,{label:r(`attempt.cost`),value:lN(t.observedCostUSD)})]})]})}function vR(e,t){let n=_k(t);if(n.kind!==e)throw Error(`Expected ${e} operation.`);return n}function yR({data:e}){if(e===null)return null;let t=[];e.turns!==void 0&&t.push([`turns`,String(e.turns)]),e.toolCalls!==void 0&&t.push([`tool calls`,String(e.toolCalls)]);for(let n of e.observations)n.kind===`token-bucket`?t.push([`${n.provider} ${n.bucket}`,n.tokens.toLocaleString()]):n.kind===`request`?t.push([`${n.provider} ${n.requestKind}`,`1`]):t.push([`${n.provider} cost`,`${n.amount} ${n.currency}`]);return e.observedCostUSD!==void 0&&t.push([`observed cost`,`$${e.observedCostUSD.toFixed(4)}`]),t.length===0?null:(0,M.jsx)(II,{className:`niceeval-usage-table`,children:t.map(([e,t],n)=>(0,M.jsx)(gR,{label:e,value:t},`${e}:${n}`))})}function bR({model:e,locale:t,className:n}){let{t:r}=Uo(),i=ok(),a=e.assertionEntryIds.map(t=>vR(`attempt.assertion.detail`,{kind:`attempt.assertion.detail`,locator:e.locator,entryId:t})),o=[...e.traceItemIds.map(t=>vR(`attempt.trace.detail`,{kind:`attempt.trace.detail`,locator:e.locator,selector:{kind:`item`,itemId:t}})),...e.toolOccurrenceIds.map(t=>vR(`attempt.trace.detail`,{kind:`attempt.trace.detail`,locator:e.locator,selector:{kind:`tool-occurrence`,toolOccurrenceId:t}})),...e.commandIds.map(t=>vR(`attempt.trace.detail`,{kind:`attempt.trace.detail`,locator:e.locator,selector:{kind:`command`,commandId:t}}))],s=vc({queries:a.map(e=>rk(i,e))}),c=vc({queries:o.map(e=>rk(i,e))}),l=sk(gk(e.locator)[1]),u=sk(vR(`attempt.timing`,{kind:`attempt.timing`,locator:e.locator}),{select:t=>UI(t,e.locator)}),d=sk(vR(`attempt.usage`,{kind:`attempt.usage`,locator:e.locator})),f=sk(vR(`attempt.sources`,{kind:`attempt.sources`,locator:e.locator})),p=sk(vR(`attempt.diff`,{kind:`attempt.diff`,locator:e.locator}),{select:KI}),m=[...s,...c,l,u,d,f,p];if(m.some(e=>e.isPending))return(0,M.jsx)(`p`,{role:`status`,children:r(`report.loadingDetails`)});if(m.some(e=>e.isError))return(0,M.jsxs)(`div`,{role:`alert`,children:[(0,M.jsx)(`p`,{children:r(`report.unableToLoadDetails`)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>{for(let e of m)e.isError&&e.refetch()},children:r(`report.retry`)})]});let h=s.map(e=>e.data),g=c.map(e=>e.data),_=l.data,v=zI(h),y=BI(_,g,e.locator),b=VI(_,g,e.locator),x=HI(_),S=hR(lR(mR(GI(f.data,_,e.locator)),mR(v)),mR(y)),C=[...dR(mR(x)),...pR(`Assertions`,v),...pR(`Source`,GI(f.data,_,e.locator)),...pR(`Execution timeline`,u.data),...pR(`Usage`,WI(d.data,_)),...pR(`Conversation`,y),...pR(`Commands`,b),...pR(`Diagnostics`,x),...pR(`File changes`,p.data)];return(0,M.jsxs)(FI,{className:$M(`niceeval-report`,n),children:[(0,M.jsx)(_R,{locator:e.locator,data:e.summary,locale:t}),(0,M.jsx)(kN,{items:C,locale:t}),S.source===null?(0,M.jsx)(RI,{data:oR(mR(v)),locale:t}):(0,M.jsx)(uI,{data:S.source,locale:t}),(0,M.jsx)(PI,{nodes:mR(u.data),title:{en:`Execution timeline`,"zh-CN":`执行时间轴`},locale:t}),(0,M.jsx)(yR,{data:mR(WI(d.data,_))}),S.conversation===null?mR(y)===null?(0,M.jsx)(kN,{items:uR,locale:t}):null:(0,M.jsx)(YF,{data:S.conversation,locale:t}),(0,M.jsx)(YN,{data:mR(b),locale:t}),(0,M.jsx)(hP,{files:mR(p.data),locale:t})]})}function xR({locator:e,onClose:t}){let{data:n}=xc(Sk(ok(),e)),{i18n:r,t:i}=Uo(),a=r.resolvedLanguage===`zh-CN`?`zh-CN`:`en`;return(0,M.jsx)(ZM,{title:i(`attempt.title`),onClose:t,children:(0,M.jsx)(bR,{model:n,locale:a})})}function SR(e,t){if(typeof e==`string`)return e;let n=e[t];if(n!==void 0&&n!==``)return n;let r=e.en;if(r!==void 0&&r!==``)return r;for(let t of Object.keys(e).sort()){let n=e[t];if(n!==void 0&&n!==``)return n}throw Error(`LocalizedText object has no non-empty value. Provide at least one locale entry, e.g. { en: "…" }.`)}function CR(e,t,n){return Ko.getFixedT(e)(t,n)}function wR(e){return Object.freeze({en:CR(`en`,e),"zh-CN":CR(`zh-CN`,e)})}function TR(e,t,n){return CR(e,t,{n})}function ER(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}function DR(e){return e>=1e9?`${ER(e/1e9)}B`:e>=1e6?`${ER(e/1e6)}M`:e>=1e3?`${ER(e/1e3)}k`:Number.isInteger(e)?String(e):ER(e)}function OR(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${ER(e/1e3)}s`;let t=Math.round(e/1e3);return`${Math.floor(t/60)}m ${t%60}s`}function kR(e){return e>=1e3?DR(e):e>=.01||e===0?e.toFixed(2):e.toFixed(4)}function AR(e,t){let n=e<0?`-`:``,r=Math.abs(e);if(t===`%`)return`${n}${ER(Math.round(r*1e3)/10)}%`;if(t===`ms`)return n+OR(r);if(t===`$`)return`${n}$${kR(r)}`;let i=DR(r);return t?`${n}${i} ${t}`:`${n}${i}`}function jR(e,t){switch(typeof e==`string`?e:e&&`kind`in e?e.kind:void 0){case`percent`:case`ratio`:return`%`;case`usd`:case`currency`:case`currency-usd`:return`$`;case`duration`:case`duration-ms`:case`milliseconds`:return`ms`;case`number`:case`count`:case`integer`:return;default:return t}}function MR(e,t,n,r=`en`){return e===null?FR(`noSamples`,r):n&&typeof n==`object`&&n.kind===`custom`&&`format`in n&&typeof n.format==`function`?n.format(e,r):AR(e,jR(n,t))}function NR(e,t=`en`){switch(e){case`available`:case`partial`:case`empty`:return FR(`noSamples`,t);case`failed`:return CR(t,`cell.metricFailed`);case`unavailable`:return CR(t,`cell.metricUnavailable`);case`unsupported`:return CR(t,`cell.metricUnsupported`);case`migration-required`:return CR(t,`cell.metricMigrationRequired`)}}var PR={noSamples:`cell.missing`,unscorable:`cell.unscorable`,noCurrentResult:`cell.noCurrentResult`,mixedExecution:`cell.mixedExecution`};function FR(e,t=`en`){let n=PR[e];return n?CR(t,n):e}function IR(e){return(e<0?`-`:``)+ER(Math.round(Math.abs(e)*10)/10)}function LR(e){switch(e){case`passed`:return`✓`;case`failed`:return`✗`;case`errored`:return`!`;case`skipped`:return`–`}}function RR(e){let t=e.projection;if(typeof t!=`object`||!t)return;let n=t;if(!(n.state!==`available`&&n.state!==`partial`&&n.state!==`unavailable`&&n.state!==`migration-required`)){if(n.combined===null)return{state:n.state,combined:null};if(!(typeof n.combined!=`object`||typeof n.combined.amount!=`string`))return{state:n.state,combined:{amount:n.combined.amount}}}}function zR(e,t,n=!1){let r=RR(e.metric),i=r?.combined!==null&&r?.combined!==void 0?`$${r.combined.amount}`:e.metric.value===null?NR(e.metric.state,t):`${e.metric.source===`estimated`?`~`:``}${MR(e.metric.value,e.metric.unit,e.metric.format,t)}`;return e.showCoverage===!1?i:n&&e.metric.value!==null&&e.metric.samples<e.metric.total?`${i}\n ${CR(t,`cell.coverageDetail`,{samples:e.metric.samples,total:e.metric.total})}`:`${i} · ${e.metric.state}`}function BR(e,t){if(e==null)return`—`;switch(e.kind){case`stack`:{let n=t??`en`,r=e.cells.map((e,r)=>r===0&&e.kind===`metric`?zR(e,n,!0):BR(e,t)).filter(e=>e!==`—`);if(r.length===0)return`—`;let i=[],a=[];for(let e of r){let[t,...n]=e.split(`
62
+ `);t&&i.push(t),a.push(...n.map(e=>e.trimStart()).filter(Boolean))}let o=a.length>0?`\n${a.map(e=>` ${e}`).join(`
63
+ `)}`:``;return`${i.join(` · `)}${o}`}case`notApplicable`:return`—`;case`missing`:{let n=t??`en`,r=FR(e.code,n);return e.detail?`${r} · ${e.detail}`:r}case`text`:return e.detail?`${e.text}\n ${e.detail}`:e.text;case`locator`:return`${e.verdict===void 0?``:`${LR(e.verdict)} `}${e.locator}`;case`summary`:{let t=e.more&&e.more>0?` +${e.more} more`:``;return`${e.text}${t}`}case`score`:{let n=IR(e.earned),r=e.possible===void 0?n:`${n} / ${IR(e.possible)}`;return e.missedScoreItems===void 0?r:`${r} · ${TR(t??`en`,`experimentList.missedScoreItems`,e.missedScoreItems)}`}case`verdict`:{let n=t??`en`;return e.counts?[`passed`,`failed`,`errored`,`skipped`].filter(t=>e.counts[t]>0).map(t=>`${e.counts[t]} ${CR(n,`verdict.${t}`)}`).join(` · `)||`—`:e.verdict===void 0?`—`:e.bare?LR(e.verdict):`${LR(e.verdict)} ${CR(n,`verdict.${e.verdict}`)}`}case`metric`:return zR(e,t??`en`)}}function VR(...e){return e.filter(Boolean).join(` `)}var HR=`—`;function UR(e){return`#/attempt/${e.startsWith(`@`)?e.slice(1):e}`}function WR(e){return GR(e.columns.map(e=>({key:e.key,header:e.header??e.key,align:e.better?`right`:`left`,better:e.better})),e)}function GR(e,t){if(e.length===0)throw Error(`Table needs at least one column.`);let n=new Set;for(let t of e){if(n.has(t.key))throw Error(`Table column key "${t.key}" is declared twice.`);n.add(t.key)}return qR(t.rows),KR(t.rows,n),{columns:e,content:t}}function KR(e,t){for(let n of e){for(let e of Object.keys(n.cells))if(!t.has(e))throw Error(`Table row "${n.key}" has a cell for "${e}", which is not a declared column.`);for(let e of t)if(!(e in n.cells))throw Error(`Table row "${n.key}" has no cell for column "${e}".`);n.subRows?.length&&KR(n.subRows,t)}}function qR(e){let t=new Set;for(let n of e){if(t.has(n.key))throw Error(`Table row key "${n.key}" is declared twice at the same level.`);t.add(n.key),n.subRows?.length&&qR(n.subRows)}}function JR(e){return e.refs.flatMap(e=>e.identity.kind===`attempt`?[e.identity.locator]:[])}function YR({cell:e,href:t,locale:n,showCoverage:r=!0,coverageDetail:i=!1}){let a=n??`en`,o=RR(e);if(o!==void 0)return(0,M.jsx)(`span`,{className:`niceeval-cell`,children:(0,M.jsx)(`span`,{className:`niceeval-value`,children:o.combined===null?NR(e.state,a):`$${o.combined.amount}`})});let s=e.value===null?NR(e.state,a):`${e.source===`estimated`?`~`:``}${MR(e.value,e.unit,e.format,a)}`;if(e.value===null)return(0,M.jsx)(`span`,{className:`niceeval-cell niceeval-cell-missing`,children:(0,M.jsx)(`span`,{className:`niceeval-missing`,title:CR(a,`cell.noneMeasurableTitle`,{total:e.total}),children:s})});let c=JR(e),l=r&&e.samples<e.total;return(0,M.jsxs)(`span`,{className:VR(`niceeval-cell`,l&&i&&`niceeval-cell-text`),children:[(0,M.jsx)(`span`,{className:`niceeval-value`,title:CR(a,`cell.measuredTitle`,{samples:e.samples,total:e.total}),children:s}),l&&(i?(0,M.jsx)(`small`,{className:`niceeval-cell-detail`,title:CR(a,`cell.coverageTitle`,{samples:e.samples,total:e.total}),children:CR(a,`cell.coverageDetail`,{samples:e.samples,total:e.total})}):(0,M.jsxs)(`sup`,{className:`niceeval-coverage`,title:CR(a,`cell.coverageTitle`,{samples:e.samples,total:e.total}),children:[e.samples,`/`,e.total]})),t&&c.length===1&&t(c[0])!==void 0&&(0,M.jsx)(`span`,{className:`niceeval-refs`,children:(0,M.jsx)(`a`,{className:`niceeval-ref`,href:t(c[0]),children:`#1`})}),t&&c.length>1&&(0,M.jsxs)(`details`,{className:`niceeval-refs`,children:[(0,M.jsx)(`summary`,{className:`niceeval-refs-summary`,children:TR(a,`cell.evidence`,c.length)}),(0,M.jsx)(`span`,{className:`niceeval-refs-list`,children:c.map((e,n)=>t(e)===void 0?(0,M.jsxs)(`span`,{className:`niceeval-ref-text`,children:[`#`,n+1]},e):(0,M.jsxs)(`a`,{className:`niceeval-ref`,href:t(e),children:[`#`,n+1]},e))})]})]})}function XR(e,t,n=!1){if(!e)return(0,M.jsx)(`span`,{className:`niceeval-missing`,children:HR});switch(e.kind){case`stack`:return(0,M.jsx)(`span`,{className:`niceeval-cell-stack`,children:e.cells.map((e,n)=>(0,M.jsx)(`span`,{className:`niceeval-cell-stack-item`,children:XR(e,t,n===0)},n))});case`notApplicable`:return(0,M.jsx)(`span`,{className:`niceeval-missing`,children:HR});case`missing`:return(0,M.jsxs)(`span`,{className:`niceeval-missing`,children:[(0,M.jsx)(`span`,{className:`niceeval-missing-reason`,children:FR(e.code,t.locale)}),e.detail?(0,M.jsx)(`small`,{className:`niceeval-cell-detail`,children:e.detail}):null]});case`text`:return(0,M.jsxs)(`span`,{className:`niceeval-cell-text`,children:[(0,M.jsx)(`span`,{children:e.text}),e.detail?(0,M.jsx)(`small`,{className:`niceeval-cell-detail`,children:e.detail}):null]});case`locator`:{let n=e.verdict,r=VR(`niceeval-locator`,n!==void 0&&`niceeval-verdict-${n}`),i=n===void 0?null:(0,M.jsx)(`span`,{className:`niceeval-locator-mark`,"aria-hidden":`true`,children:LR(n)}),a=t.href(e.locator);return a===void 0?(0,M.jsxs)(`span`,{className:r,children:[i,e.locator]}):(0,M.jsxs)(`a`,{className:r,href:a,children:[i,e.locator]})}case`summary`:case`score`:return BR(e,t.locale);case`verdict`:{if(e.counts){let n=[`passed`,`failed`,`errored`,`skipped`].filter(t=>e.counts[t]>0);return(0,M.jsxs)(`span`,{className:`niceeval-verdict-tally`,children:[n.map(n=>(0,M.jsxs)(`span`,{className:`niceeval-verdict-${n}`,children:[e.counts[n],` `,CR(t.locale,`verdict.${n}`)]},n)),n.length===0?(0,M.jsx)(`span`,{className:`niceeval-missing`,children:HR}):null]})}let n=e.verdict??`skipped`;return(0,M.jsxs)(`span`,{className:VR(`niceeval-verdict`,`niceeval-verdict-${n}`),children:[LR(n),e.bare?null:(0,M.jsxs)(M.Fragment,{children:[` `,CR(t.locale,`verdict.${n}`)]})]})}case`metric`:return(0,M.jsx)(YR,{cell:e.metric,href:t.showMeasureRefs===!1?void 0:t.href,locale:t.locale,showCoverage:e.showCoverage!==!1,coverageDetail:n})}}function ZR(e){return e?e.kind===`stack`?ZR(e.cells[0]):e.kind===`metric`?e.metric.value??``:e.kind===`score`?e.earned:e.kind===`text`?e.text:e.kind===`locator`?e.locator:e.kind===`verdict`&&e.counts?e.counts.passed:BR(e):``}function QR(e,t,n,r=0){return e.map(e=>{let i=t.map(t=>(0,M.jsx)(`span`,{className:VR(`niceeval-table-hierarchy-cell`,t.align===`right`&&`niceeval-align-right`),"data-sort-value":ZR(e.cells[t.key]),children:XR(e.cells[t.key],n)},t.key)),a=VR(`niceeval-table-hierarchy-row`,e.variant===`placeholder`&&`niceeval-row-placeholder`,e.variant===`group`&&`niceeval-row-group`);return e.subRows?.length?(0,M.jsxs)(`details`,{className:VR(a,`niceeval-table-hierarchy-group`),"data-depth":r||void 0,children:[(0,M.jsx)(`summary`,{className:`niceeval-table-hierarchy-summary`,children:i}),(0,M.jsx)(`div`,{className:`niceeval-table-hierarchy-children`,children:QR(e.subRows,t,n,r+1)})]},e.key):(0,M.jsx)(`div`,{className:a,"data-depth":r||void 0,children:i},e.key)})}function $R(e,t,n){return e.map(e=>(0,M.jsx)(`tr`,{className:VR(e.variant===`placeholder`&&`niceeval-row-placeholder`,e.variant===`group`&&`niceeval-row-group`),children:t.map(t=>(0,M.jsx)(`td`,{className:t.align===`right`?`niceeval-align-right`:void 0,children:XR(e.cells[t.key],n)},t.key))},e.key))}function ez(e){let t=e.locale??`en`,{columns:n,content:r}=WR(e.data),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(e.sort===void 0?null:{key:e.sort,direction:`asc`}),c=(0,v.useMemo)(()=>{let e=i.trim().toLocaleLowerCase(),n=r=>{let i=r.subRows?.map(n).filter(e=>e!==null);return e===``||Object.values(r.cells).some(n=>BR(n,t).toLocaleLowerCase().includes(e))||(i?.length??0)>0?{...r,...i===void 0?{}:{subRows:i}}:null},a=r.rows.map(n).filter(e=>e!==null);if(o===null)return a;let s=o.direction===`asc`?1:-1;return[...a].sort((e,n)=>BR(e.cells[o.key],t).localeCompare(BR(n.cells[o.key],t),t,{numeric:!0})*s)},[r.rows,t,i,o]),l=e.hrefForLocator??UR,u=r.rows.some(e=>(e.subRows?.length??0)>0),d=(0,M.jsxs)(`table`,{className:VR(`niceeval-report`,`niceeval-table`,u&&`niceeval-table--hierarchical`,e.className),"data-column-count":u?n.length:void 0,children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:n.map(e=>(0,M.jsx)(`th`,{scope:`col`,className:VR(e.align===`right`&&`niceeval-align-right`,o?.key===e.key?o.direction===`asc`?`niceeval-sort-asc`:`niceeval-sort-desc`:void 0),onClick:e.better===void 0?void 0:()=>s(t=>({key:e.key,direction:t?.key===e.key&&t.direction===`asc`?`desc`:`asc`})),tabIndex:e.better===void 0?void 0:0,onKeyDown:e.better===void 0?void 0:e=>{(e.key===`Enter`||e.key===` `)&&e.currentTarget.click()},children:SR(e.header,t)},e.key))})}),u?(0,M.jsx)(`tbody`,{children:(0,M.jsx)(`tr`,{children:(0,M.jsx)(`td`,{colSpan:n.length,className:`niceeval-table-hierarchy-body`,children:QR(c,n,{href:l,locale:t,showMeasureRefs:!1})})})}):(0,M.jsx)(`tbody`,{children:$R(c,n,{href:l,locale:t})})]});return e.searchable===!0?(0,M.jsxs)(`div`,{className:`niceeval-report niceeval-table-wrap`,children:[(0,M.jsx)(`input`,{className:`niceeval-filter`,type:`search`,value:i,onChange:e=>a(e.target.value),placeholder:CR(t,n[0].key===`entity`?`experimentList.filterPlaceholder`:`table.filterPlaceholder`)}),d]}):d}function tz(e,t){if(!t)return e;let n=`${t}/`;return e.startsWith(n)?e.slice(n.length):e}function nz(e,t){return e?`${e}/${t}`:t}function rz(e){return iz(e,``)}function iz(e,t){if(e.length===0)return[];let n=[],r=new Map;for(let i of e){let e=tz(i,t).split(`/`).filter(Boolean);if(e.length<=1){n.push(i);continue}let a=e[0],o=r.get(a);o?o.push(i):r.set(a,[i])}if(r.size===0||r.size===1&&n.length===0||[...r.values()].every(e=>e.length===1)){if(r.size===1&&n.length===0){let n=[...r.keys()][0];return iz(e,nz(t,n))}return[...n].sort((e,t)=>e.localeCompare(t)).map(e=>({kind:`leaf`,evalId:e}))}let i=[...r.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,n])=>({kind:`group`,segment:e,prefix:nz(t,e),children:iz(n,nz(t,e))})),a=[...n].sort((e,t)=>e.localeCompare(t)).map(e=>({kind:`leaf`,evalId:e}));return[...i,...a]}function az(e){return e.some(e=>e.evaluationKind!==`pass`)?e.some(e=>e.evaluationKind!==`points`)?`mixed`:`points`:`pass`}function oz(e){let t=az(e);return[...e].sort(sz(e=>t===`pass`?e.endToEndPassRate?.value??null:e.score?.value??null))}function sz(e){return(t,n)=>{let r=e(t),i=e(n);return r===null&&i===null?t.experimentId.localeCompare(n.experimentId):r===null?1:i===null?-1:i-r||t.experimentId.localeCompare(n.experimentId)}}var cz=`noCurrentResult`,lz=`noSamples`,uz={entity:wR(`experimentList.experiment`),model:wR(`table.model`),agent:wR(`table.agent`),durationMs:wR(`experimentList.avgDuration`),passRate:wR(`experimentList.passRate`),totalScore:wR(`experimentList.totalScore`),tokens:wR(`experimentList.tokens`),costUSD:wR(`experimentList.cost`),record:wR(`experimentList.result`),verdict:wR(`experimentList.status`),result:wR(`experimentList.result`)};function dz(e,t){let n={};for(let r of t)n[r.key]=e[r.key]??{kind:`notApplicable`};return n}function fz(e,t=e.state!==`available`){return{kind:`metric`,metric:e,showCoverage:t}}function pz(...e){let t=e.filter(e=>e.kind!==`notApplicable`);return t.length===0?{kind:`notApplicable`}:t.length===1?t[0]:{kind:`stack`,cells:t}}function mz(e){let t={passed:0,failed:0,errored:0,skipped:0};for(let n of e)n.verdict!==null&&(t[n.verdict]+=1);return t}function hz(e){return{kind:`verdict`,counts:mz(e)}}function gz(e){let t=mz(e);return t.failed+t.errored+t.skipped===0?{kind:`notApplicable`}:{kind:`verdict`,counts:{...t,passed:0}}}function _z(e){let t=e.length===1?e[0]?.verdict:null;return t==null?hz(e):vz(t)}function vz(e){return e===null?{kind:`notApplicable`}:{kind:`verdict`,verdict:e}}function yz(e){return{kind:`locator`,locator:e.locator,...e.verdict===null?{}:{verdict:e.verdict}}}function bz(e,t){return t?{kind:`text`,text:e,detail:t}:{kind:`text`,text:e}}function xz(e){return e.failureSummary===null?{kind:`text`,text:`—`}:{kind:`summary`,text:e.failureSummary}}function Sz(e){return{entity:yz(e),verdict:vz(e.verdict),result:xz(e),...e.durationMs===void 0?{}:{durationMs:fz(e.durationMs)},...e.tokens===void 0?{}:{tokens:fz(e.tokens)},...e.score===void 0?{}:{totalScore:fz(e.score)},...e.costUSD===void 0?{}:{costUSD:fz(e.costUSD)}}}var Cz=[{key:`entity`,header:uz.entity},{key:`model`,header:uz.model},{key:`agent`,header:uz.agent},{key:`durationMs`,better:`lower`,header:uz.durationMs}],wz=[{key:`tokens`,better:`lower`,header:uz.tokens},{key:`summary`,better:`higher`,header:uz.result}];function Tz(){return[...Cz,...wz]}var Ez={key:`costUSD`,better:`lower`,header:uz.costUSD};uz.entity,uz.verdict,uz.result,uz.durationMs;function Dz(e,t){if(!t)return e;let n=e.findIndex(e=>e.key===`summary`);return n<0?[...e,Ez]:[...e.slice(0,n),Ez,...e.slice(n)]}function Oz(e,t){return bz(`${e} (${t})`)}function kz(e,t){return t>e?`${e}/${t} evals`:`${e} evals`}function Az(e,t){let n=e?.[t];return n===void 0?{kind:`notApplicable`}:fz(n)}function jz(e,t,n,r){let i={entity:bz(n),summary:{kind:`missing`,code:cz,detail:`niceeval exp ${e}`}};return{key:`${e}:${t}:missing`,variant:`placeholder`,cells:dz(i,r)}}function Mz(e,t){return{key:e.locator,cells:dz(Sz(e),t)}}function Nz(e,t,n){let r={entity:bz(t),...e.durationMs===void 0?{}:{durationMs:fz(e.durationMs)},summary:e.evaluationKind===`pass`?e.attempts.length===1?_z(e.attempts):pz(e.endToEndPassRate===void 0?{kind:`notApplicable`}:fz(e.endToEndPassRate),hz(e.attempts)):pz(e.score===void 0?{kind:`notApplicable`}:fz(e.score),gz(e.attempts)),...e.costUSD===void 0?{}:{costUSD:fz(e.costUSD)}};return{key:e.evalId,cells:dz(r,n.columns),subRows:e.attempts.map(e=>Mz(e,n.columns))}}function Pz(e,t){let n=tz(e.evalId,t.labelPrefix),r=t.item.evalRows.find(t=>t.evalId===e.evalId);return r===void 0?jz(t.item.experimentId,e.evalId,n,t.columns):Nz(r,n,t)}function Fz(e,t){let n=new Set,r=e=>{for(let t of e)t.kind===`leaf`?n.add(t.evalId):r(t.children)};return r([e]),t.filter(e=>n.has(e.evalId)).flatMap(e=>e.attempts)}function Iz(e,t,n){let r=new Set,i=e=>{for(let t of e)t.kind===`leaf`?r.add(t.evalId):i(t.children)};i([e]);let a=t.evalRows.filter(e=>r.has(e.evalId)),o=r.size,s=a.length,c=t.groupMetrics.get(e.prefix),l=Fz(e,t.evalRows),u=s===0?{kind:`missing`,code:lz}:hz(l),d=a.every(e=>e.evaluationKind===`pass`),f=d?Az(c,`passRate`):Az(c,`score`),p={entity:Oz(e.segment,kz(s,o)),durationMs:Az(c,`durationMs`),tokens:Az(c,`tokens`),...c?.costUSD===void 0?{}:{costUSD:fz(c.costUSD)},summary:pz(f,d?u:gz(l))};return{key:`group:${e.prefix}`,variant:`group`,cells:dz(p,n.columns),subRows:Lz(e.children,{...n,labelPrefix:e.prefix})}}function Lz(e,t){let n=e.filter(e=>e.kind===`group`).slice().sort((e,n)=>{let r=Rz(e,t.item),i=Rz(n,t.item);return r===null&&i===null?e.segment.localeCompare(n.segment):r===null?1:i===null?-1:i-r||e.segment.localeCompare(n.segment)}),r=e.filter(e=>e.kind===`leaf`);return[...n.map(e=>Iz(e,t.item,t)),...r.map(e=>Pz(e,t))]}function Rz(e,t){let n=`${e.prefix}/`,r=t.evalRows.some(e=>e.evalId.startsWith(n)&&e.evaluationKind!==`pass`),i=t.groupMetrics.get(e.prefix);return(r?i?.score:i?.passRate)?.value??null}function zz(e,t){let n=new Set(e.evalRows.map(e=>e.evalId)),r=rz([...new Set([...n,...e.missingEvalIds])]),i=e.evalRows.flatMap(e=>e.attempts),a=e.evaluationKind===`pass`?e.endToEndPassRate===void 0?{kind:`notApplicable`}:fz(e.endToEndPassRate,!1):e.score===void 0?{kind:`notApplicable`}:fz(e.score),o=e.evalRows.length,s=o+e.missingEvalIds.length,c={entity:Oz(e.experimentId,`${o}/${s}`),model:Bz(e.model),agent:Bz(e.agent),...e.durationMs===void 0?{}:{durationMs:fz(e.durationMs,!1)},...e.tokens===void 0?{}:{tokens:fz(e.tokens,!1)},...e.costUSD===void 0?{}:{costUSD:fz(e.costUSD,!1)},summary:pz(a,e.evaluationKind===`pass`?hz(i):gz(i))};return{key:e.experimentId,cells:dz(c,t.columns),subRows:r.length>0?Lz(r,t):[]}}function Bz(e){return e.state===`available`?bz(e.value):e.state===`mixed`?{kind:`missing`,code:`mixedExecution`}:{kind:`notApplicable`}}function Vz(e){let t=Dz(Tz(),e.some(e=>e.costUSD!==void 0));return{columns:t,rows:e.map(e=>zz(e,{columns:t,item:e,labelPrefix:``}))}}var Hz=(0,v.lazy)(()=>w(()=>import(`./quality-cost-scatter-CSiMLelf.js`),[]));function Uz({data:e,locale:t}){let{t:n}=Uo(),r=oz(e.experiments),i=az(r)===`pass`?`pass`:`points`;return(0,M.jsxs)(`section`,{className:`niceeval-report niceeval-section`,children:[(0,M.jsx)(`h2`,{className:`niceeval-section-title`,children:SR(e.selectionTitle,t)}),(0,M.jsx)(`div`,{className:`niceeval-quality-cost-comparison`,children:(0,M.jsx)(v.Suspense,{fallback:(0,M.jsx)(`p`,{role:`status`,children:n(`report.loading`)}),children:(0,M.jsx)(Hz,{items:r,kind:i,locale:t})})}),(0,M.jsx)(ez,{data:Vz(r),sort:`summary`,searchable:!0,locale:t})]})}function Wz({model:e,locale:t}){let{t:n}=Uo();return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`header`,{className:`niceeval-report niceeval-hero`,children:(0,M.jsx)(`h1`,{className:`niceeval-hero-title`,children:n(`insight.title`)})}),(0,M.jsx)(`div`,{className:`niceeval-view-report-slot`,children:(0,M.jsx)(Uz,{data:{selectionTitle:e.selectionTitle,experiments:Dk(e.overview,e.selectedExperiments)},locale:t})})]})}function Gz({target:e}){return e.kind===`group`?(0,M.jsx)(Kz,{groupKind:e.groupKind,groupKey:e.key}):(0,M.jsx)(qz,{experimentId:e.experimentId})}function Kz({groupKind:e,groupKey:t}){let n=ok(),r=n.snapshot,{data:i}=xc(Ck(n,r.manifest,r.overview,e,t));return(0,M.jsx)(Jz,{model:i})}function qz({experimentId:e}){let t=ok(),n=t.snapshot,{data:r}=xc(wk(t,n.overview,e));return(0,M.jsx)(Jz,{model:r})}function Jz({model:e}){let{i18n:t}=Uo();return(0,M.jsx)(Wz,{model:e,locale:t.resolvedLanguage??`en`})}function Yz({model:e,locale:t}){let n=e.members.map(t=>{let n={experiment:{kind:`text`,text:e.experimentId},eval:{kind:`text`,text:t.evalId},attempt:{kind:`text`,text:String(t.attemptOrdinal+1)},membership:{kind:`text`,text:t.state},outcome:Zz(t.outcome),verdict:t.verdict===null?{kind:`notApplicable`}:{kind:`verdict`,verdict:t.verdict},locator:t.locator===null?{kind:`notApplicable`}:{kind:`locator`,locator:t.locator,...t.verdict===null?{}:{verdict:t.verdict}},selectedRun:{kind:`text`,text:e.runId},slot:{kind:`text`,text:t.slotId}};return Object.freeze({key:t.key,cells:Object.freeze(n)})}),r=Object.freeze({columns:Object.freeze([{key:`experiment`,header:{en:`Experiment`,"zh-CN":`实验`}},{key:`eval`,header:{en:`Eval`,"zh-CN":`评估`}},{key:`attempt`,header:{en:`Attempt`,"zh-CN":`尝试`}},{key:`membership`,header:{en:`Membership`,"zh-CN":`成员关系`}},{key:`outcome`,header:{en:`Outcome`,"zh-CN":`执行结果`}},{key:`verdict`,header:{en:`Verdict`,"zh-CN":`判定`}},{key:`locator`,header:{en:`Attempt locator`,"zh-CN":`Attempt 定位符`}},{key:`selectedRun`,header:{en:`Selected run`,"zh-CN":`所选 Run`}},{key:`slot`,header:{en:`Slot`,"zh-CN":`槽位`}}]),rows:Object.freeze(n)});return(0,M.jsxs)(`section`,{className:`niceeval-report niceeval-section`,children:[(0,M.jsx)(`h2`,{className:`niceeval-section-title`,children:t===`zh-CN`?`Run 成员 · ${e.runId}`:`Run membership · ${e.runId}`}),(0,M.jsx)(ez,{data:r,searchable:!0,locale:t})]})}function Xz({runId:e,presentation:t,onClose:n}){let{data:r}=xc(Nk(ok(),e)),{i18n:i}=Uo(),a=i.resolvedLanguage===`zh-CN`?`zh-CN`:`en`,o=(0,M.jsx)(Yz,{model:r,locale:a});if(t===`page`)return o;if(n===void 0)throw Error(`Run dialog close target is missing.`);return(0,M.jsx)(ZM,{title:a===`zh-CN`?`运行`:`Run`,onClose:n,children:o})}function Zz(e){return typeof e==`string`&&e.length>0?{kind:`text`,text:e}:{kind:`notApplicable`}}function Qz(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 $z(e,t=[]){let n=new Map;for(let t of[...new Set(e.experiments)].sort(fB)){let e=Qz(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)=>fB(e.identity.key,t.identity.key)).map(({identity:e,members:t})=>Object.freeze({identity:e,members:Object.freeze(t),route:eB(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=>dB({pageId:`group:${e.identity.key}`,route:e.route,title:{en:`NiceEval Insight`,"zh-CN":`NiceEval Insight`},navigation:!1,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(dB({pageId:`experiment:${t}`,route:`/experiment/${encodeURIComponent(t)}`,title:{en:`Experiment`,"zh-CN":`实验`},navigation:!1,target:{kind:`experiment`,experimentId:t}}));for(let{runId:t}of uB(e.runExperiments,({runId:e})=>e))s.push(dB({pageId:`run:${t}`,route:`/run/${encodeURIComponent(t)}`,title:{en:`Run`,"zh-CN":`运行`},navigation:!1,target:{kind:`run`,runId:t}}));for(let{locator:t}of uB(e.attemptExperiments,({locator:e})=>e))s.push(dB({pageId:`attempt:${t}`,route:`/attempt/${tB(t)}`,title:{en:`Attempt`,"zh-CN":`尝试`},navigation:!1,target:{kind:`attempt`,locator:t}}));return s.unshift(dB({pageId:`overview`,route:`/`,title:{en:`NiceEval Insight`,"zh-CN":`NiceEval Insight`},navigation:!0,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 eB(e){return e.kind===`named`?`/group/named/${encodeURIComponent(e.groupId)}`:`/group/singleton/${encodeURIComponent(e.experimentId)}`}function tB(e){return encodeURIComponent(e.startsWith(`@`)?e.slice(1):e)}function nB(e,t){if(t===`/`)return e.pages.find(e=>e.route===t)?.target;if(!t.startsWith(`/`))return;let n=t.slice(1).replace(/\/$/u,``).split(`/`);try{return iB(n.map(rB))}catch{return}}function rB(e){return decodeURIComponent(e).replace(/%2F/gu,`/`)}function iB(e){if(e.length===3&&e[0]===`group`&&(e[1]===`named`||e[1]===`singleton`)&&e[2])return{kind:`group`,groupKind:e[1],key:e[2]};if(!(e.length!==2||!e[1])){if(e[0]===`experiment`)return{kind:`experiment`,experimentId:e[1]};if(e[0]===`run`)return{kind:`run`,runId:e[1]};if(e[0]===`attempt`)return{kind:`attempt`,locator:`@${e[1]}`}}}function aB(e,t){let n=t.pathname,r=nB(e,n);if(r===void 0)throw Error(`Insight route target is malformed.`);let i=cB(t,r,`page`);if(r.kind===`group`||r.kind===`experiment`)return{background:i};let a=lB(t.state),o=a?.background===void 0?void 0:sB(e,a.background);if(r.kind===`run`&&o===void 0)return{background:i};if(o!==void 0)return{background:o,foreground:{...cB(t,r,`dialog`),close:{kind:`history`}}};let s=Object.freeze({pathname:e.defaultRoute}),c=nB(e,s.pathname);if(c===void 0)throw Error(`Insight default route target is missing.`);return{background:cB(s,c,`page`),foreground:{...cB(t,r,`dialog`),close:{kind:`replace`,route:e.defaultRoute}}}}function oB(e){return`${e.target.kind}:${e.location.pathname}:${e.location.search??``}`}function sB(e,t){let n=nB(e,t.pathname);if(!(n===void 0||n.kind===`attempt`))return cB(t,n,`page`)}function cB(e,t,n){return Object.freeze({location:Object.freeze({pathname:e.pathname,...e.search===void 0?{}:{search:e.search}}),target:t,presentation:n})}function lB(e){if(typeof e!=`object`||!e||!(`background`in e))return;let t=e.background;if(typeof t!=`object`||!t||!(`pathname`in t)||typeof t.pathname!=`string`)return;let n=`search`in t&&typeof t.search==`string`?t.search:void 0;return{background:{pathname:t.pathname,...n===void 0?{}:{search:n}}}}function uB(e,t){let n=new Map;for(let r of e)n.set(t(r),r);return[...n.values()]}function dB(e){return Object.freeze(e)}function fB(e,t){return e<t?-1:+(e>t)}function pB({checkForUpdate:e,refresh:t}){let{manifest:n,presentation:r}=ok().snapshot,{acquire:i,interactionLocked:a,recoveryRequired:o}=JM(),{t:s}=Uo();return o?(0,M.jsxs)(`main`,{className:`niceeval-view-main`,role:`alert`,children:[(0,M.jsx)(`h1`,{children:s(`refresh.reloadRequired`)}),(0,M.jsx)(`p`,{children:s(`refresh.reloadRequiredDetail`)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),children:s(`refresh.reload`)})]}):(0,M.jsx)(KM,{locked:a,children:(0,M.jsx)(mB,{manifest:n,presentation:r,refresh:()=>t(i),checkForUpdate:e,interactionLocked:a})})}function mB({checkForUpdate:e,interactionLocked:t,manifest:n,presentation:r,refresh:i}){let a=ok(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(!1),{i18n:f,t:p}=Uo(),m=Sr(),h=Tr(),g=bc({queryKey:[`view`,a.identity,`update-available`],queryFn:e,refetchInterval:500,staleTime:0,retry:!1}),_=(0,v.useRef)(void 0);r===void 0?_.current=void 0:(_.current?.generationIdentity!==a.identity||_.current.originLocationKey!==r.originLocationKey)&&(_.current={generationIdentity:a.identity,originLocationKey:r.originLocationKey,consumed:!1}),_.current!==void 0&&m.key!==_.current.originLocationKey&&(_.current.consumed=!0);let y=r!==void 0&&_.current?.consumed===!1?r.plan:aB(n,m),b=f.resolvedLanguage??`en`;(0,v.useEffect)(()=>{document.title=p(`insight.title`)},[p]);let x=n.experimentSelection?.options??[],S=x.find(({route:e})=>m.pathname===e)??x[0],C=(0,v.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 r=new URL(t.href,document.baseURI);if(r.origin!==window.location.origin||!r.hash.startsWith(`#/`))return;let i=r.hash.slice(1),a=nB(n,i);a!==void 0&&(e.preventDefault(),a.kind===`run`||a.kind===`attempt`?h(i,{state:{background:y.background.location}}):h(i,{state:null}))},[n,h,y.background.location]),w=(0,v.useCallback)(e=>{e.kind===`history`?h(-1):h(e.route,{replace:!0,state:null})},[h]),T=y.foreground;return(0,M.jsxs)(`div`,{onClickCapture:C,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:`#${n.defaultRoute}`,"aria-current":y.foreground===void 0?`page`:void 0,"aria-disabled":t||void 0,children:p(`insight.navigation`)})}),(0,M.jsxs)(`div`,{className:`niceeval-view-controls`,children:[S===void 0?null:(0,M.jsxs)(`label`,{className:`niceeval-view-experiment`,children:[(0,M.jsx)(`span`,{children:p(`nav.experiments`)}),(0,M.jsx)(`select`,{disabled:t,value:S.route,onChange:e=>h(e.target.value),children:x.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`,{disabled:t,"aria-label":p(`nav.language`),value:b,onChange:e=>void f.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:o||t,onClick:()=>{s(!0),d(!1),l(void 0),i().then(e=>{l(e.noticeKey)}).catch(()=>d(!0)).finally(()=>s(!1))},children:p(o?`refresh.working`:`refresh.action`)}),g.data===!0&&!o?(0,M.jsx)(`span`,{role:`status`,children:p(`refresh.available`)}):null,c===void 0?null:(0,M.jsx)(`span`,{role:`status`,children:p(c)}),u?(0,M.jsx)(`span`,{role:`alert`,children:p(`refresh.failed`)}):null]})]}),(0,M.jsxs)(`main`,{className:`niceeval-view-main`,inert:t?!0:void 0,children:[(0,M.jsx)(hB,{surface:y.background},`background:${oB(y.background)}`),T===void 0?null:(0,M.jsx)(hB,{surface:T,onClose:()=>w(T.close)},`foreground:${oB(T)}`)]})]})}function hB({surface:e,onClose:t}){let{target:n,presentation:r}=e;if(n.kind===`group`||n.kind===`experiment`)return(0,M.jsx)(Gz,{target:n});if(n.kind===`run`)return(0,M.jsx)(Xz,{runId:n.runId,presentation:r,onClose:t});if(t===void 0)throw Error(`Attempt dialog close target is missing.`);return(0,M.jsx)(xR,{locator:n.locator,onClose:t})}var gB=U({generationId:B,sourceCutoffIdentity:B,refreshSupported:H,stale:H});U({generationId:B}),U({generationId:B,request:IO});var _B=U({code:K([`view-request-invalid`,`view-generation-not-found`,`view-generation-stale`,`view-inspection-failed`]),reason:B,correction:K([`fix-request`,`refresh-generation`,`retry`])}),vB={errors:`all`,onExcessProperty:`error`},yB=Z_(gB,vB),bB=Z_(_B,vB),xB=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`}},SB=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=KO(e);if(Id(t))throw Error(t.failure.reason);let n=await DB(`/_niceeval/inspection`,{method:`POST`,signal:this.#e.signal,headers:{"content-type":`application/json`},body:JSON.stringify({generationId:this.descriptor.generationId,request:{protocol:Zw,operation:t.success}})}),r=await OB(n);if(!n.ok)throw kB(n.status,r);let i=UO(r);if(!i.success)throw new xB(n.status,`view-response-invalid`,`retry`,i.reason);let a=WO(i.value,e.kind);if(!a.success)throw new xB(n.status,`view-response-invalid`,`retry`,a.reason);return a.value}close(){this.#t||(this.#t=!0,this.#e.abort())}};async function CB(){return EB(`/_niceeval/generation`,{method:`GET`})}async function wB(){return EB(`/_niceeval/generation/refresh`,{method:`POST`})}async function TB(e){return EB(`/_niceeval/generation/commit`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({generationId:e})})}async function EB(e,t){let n=await DB(e,t),r=await OB(n);if(!n.ok)throw kB(n.status,r);let i=yB(r);if(Id(i))throw new xB(n.status,`view-response-invalid`,`retry`,String(i.failure));return i.success}function DB(e,t){return fetch(new URL(e,document.baseURI),{...t,cache:`no-store`,credentials:`same-origin`})}async function OB(e){try{return await e.json()}catch(t){throw new xB(e.status,`view-response-invalid`,`retry`,`View HTTP response is not JSON.`,{cause:t})}}function kB(e,t){let n=bB(t);return Id(n)?new xB(e,`view-response-invalid`,`retry`,`View HTTP request failed (${e}).`):new xB(e,n.success.code,n.success.correction,n.success.reason)}var AB=class extends Error{classification=`generation-prepare`;translationKey=`report.unableToLoad`};async function jB(e){let t=new URL(document.baseURI).searchParams.getAll(`run`),n=new uk,r=new AbortController,i;window.addEventListener(`pagehide`,()=>{r.abort(Error(`NiceEval View page was hidden.`)),e(),i?.(),n.dispose()},{once:!0});let a=await CB(),o=n.prepare(new SB(a)),s,c;try{c=Tk(await o.lease.inspect(mk(t))),s=$z(c.catalog);let e=LB(s.defaultRoute),r=nB(s,e.pathname)===void 0?{pathname:s.defaultRoute}:e;await BB(o.lease,s,c,aB(s,r)),n.attachSnapshot(o,WB(s,c)),n.commit(o)}catch(e){throw n.reject(o),new AB(`Unable to prepare initial generation.`,{cause:e})}let l=e=>async()=>{let t=n.acquireCurrent();try{return await e(t)}finally{t.release()}},u=(e,t)=>{let n=e[t];if(!n)throw new dk(`Insight route parameter is missing.`);return n},d=e=>({params:t})=>l(async n=>{let r=iB(e(t));if(r===void 0)throw new dk(`Insight route parameter is malformed.`);let i=n.generation.binding;return await VB(n,i.snapshot.manifest,i.snapshot.overview,r),null})(),f=()=>n.current?.snapshot.manifest.defaultRoute??s.defaultRoute,p=0,m=Ji([{path:`/`,element:(0,M.jsx)(ak,{runtime:n,children:(0,M.jsx)(pB,{checkForUpdate:async()=>{NB(r.signal);let e=await wB();return NB(r.signal),e.generationId!==n.current?.identity},refresh:async e=>{let i=p,a=m.state.location.pathname,o=m.state.location.key,s=m.state.location.state,c=n.current.identity,l=await wB();if(NB(r.signal),l.generationId===c)return FB(n);let u=n.prepare(new SB(l)),d=!0,f,h=!1,g=!1;try{let _=Tk(await u.lease.inspect(mk(t))),v=$z(_.catalog),y=HB(n.current.snapshot.overview,_,v,a),b=aB(v,{pathname:y.route,state:y.fallback?null:s});if(await BB(u.lease,v,_,b),NB(r.signal),!PB(m,p,i,a,o))throw n.reject(u),d=!1,new AB(`View location changed while refresh was preparing.`);if(f=await e(r.signal),h=!0,NB(r.signal),!PB(m,p,i,a,o))throw n.reject(u),d=!1,await f.release(),h=!1,new AB(`View location changed while refresh was preparing.`);n.attachSnapshot(u,WB(v,_,y.fallback?{originLocationKey:o,plan:b}:void 0));let x=await IB(l.generationId,c,r.signal);if(NB(r.signal),x===`rejected`)throw new AB(`View Host rejected the prepared generation.`);if(x===`uncertain`)return n.reject(u),d=!1,f.recover(),h=!1,FB(n);g=!0,y.fallback&&!f.hasUserIntent()&&(await f.enqueueFallback(y.route),NB(r.signal));let S=n.commit(u);d=!1,n.retire(S);let C=await f.release();h=!1;let w=y.fallback&&C!==`user`;return Object.freeze({manifest:v,...w?{fallbackRoute:y.route,noticeKey:`refresh.selectionChanged`}:{}})}catch(e){if(r.signal.aborted)throw r.signal.reason;if(g&&h)return d&&u.generation.status===`preparing`&&n.reject(u),f.recover(),FB(n);throw d&&n.reject(u),h&&await f.release(),e instanceof AB?e:new AB(`Unable to prepare refreshed generation.`,{cause:e})}}})}),errorElement:(0,M.jsx)(zB,{}),children:[{index:!0,loader:()=>{let e=f();return e===`/`?null:st(e)}},{path:`group/:groupKind/:key`,element:null,loader:d(e=>[`group`,u(e,`groupKind`),u(e,`key`)])},{path:`experiment/:experimentId`,element:null,loader:d(e=>[`experiment`,u(e,`experimentId`)])},{path:`run/:runId`,element:null,loader:d(e=>[`run`,u(e,`runId`)])},{path:`attempt/:locator`,element:null,loader:d(e=>[`attempt`,u(e,`locator`)])},{path:`*`,loader:()=>st(f())}]}]);i=()=>m.dispose(),await MB(m);let h=m.state.location;return m.subscribe(e=>{e.location!==h&&(h=e.location,p+=1)}),m}function MB(e){return e.state.initialized?Promise.resolve():new Promise(t=>{let n=e.subscribe(e=>{e.initialized&&(n(),t())});e.state.initialized&&(n(),t())})}function NB(e){if(e.aborted)throw e.reason}function PB(e,t,n,r,i){return t===n&&e.state.location.pathname===r&&e.state.location.key===i&&e.state.navigation.state===`idle`}function FB(e){return Object.freeze({manifest:e.current.snapshot.manifest})}async function IB(e,t,n){let r;try{let t=await TB(e);if(NB(n),t.generationId===e)return`committed`;r=new AB(`View Host committed an unexpected generation.`)}catch(e){NB(n),r=e}let i;try{i=await CB(),NB(n)}catch{return NB(n),`uncertain`}return i.generationId===e?`committed`:r instanceof xB&&r.code===`view-generation-stale`&&i.generationId===t?`rejected`:`uncertain`}function LB(e){let t=window.location.hash,n=t.startsWith(`#/`)?t.slice(1):e,r=n.indexOf(`?`);return{pathname:r<0?n:n.slice(0,r),...r<0?{}:{search:n.slice(r)},state:RB()}}function RB(){let e=window.history.state;return typeof e==`object`&&e&&`usr`in e?e.usr:void 0}function zB(){let e=Wr(),{t}=Uo(),n=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(n)}),(0,M.jsx)(`a`,{href:`#/`,children:t(`report.backToResults`)})]})}async function BB(e,t,n,r){await VB(e,t,n,r.background.target),r.foreground!==void 0&&await VB(e,t,n,r.foreground.target)}async function VB(e,t,n,r){let i=e.generation.binding;r.kind===`attempt`?await i.queryClient.fetchQuery(Sk(i,r.locator)):r.kind===`run`?await i.queryClient.fetchQuery(Nk(i,r.runId)):r.kind===`experiment`?await i.queryClient.fetchQuery(wk(i,n,r.experimentId)):await i.queryClient.fetchQuery(Ck(i,t,n,r.groupKind,r.key))}function HB(e,t,n,r){let i=nB(n,r);if(i===void 0)return{route:n.defaultRoute,fallback:!0};if(i.kind===`attempt`){if(t.catalog.attemptExperiments.some(e=>e.locator===i.locator))return{route:r,fallback:!1};let a=e.catalog.attemptExperiments.find(e=>e.locator===i.locator)?.experimentId;if(a===void 0)return{route:r,fallback:!1};let o=t.catalog.runExperiments.filter(e=>e.experimentId===a).sort((e,t)=>UB(e.runId,t.runId))[0];return o===void 0?{route:n.defaultRoute,fallback:!0}:{route:`/run/${encodeURIComponent(o.runId)}`,fallback:!0}}return i.kind===`run`?e.catalog.runExperiments.some(e=>e.runId===i.runId)?t.catalog.runExperiments.some(e=>e.runId===i.runId)?{route:r,fallback:!1}:{route:n.defaultRoute,fallback:!0}:{route:r,fallback:!1}:i.kind===`experiment`&&e.catalog.experiments.includes(i.experimentId)?t.catalog.experiments.includes(i.experimentId)?{route:r,fallback:!1}:{route:n.defaultRoute,fallback:!0}:{route:r,fallback:!1}}function UB(e,t){return e<t?-1:+(e>t)}function WB(e,t,n){return Object.freeze({manifest:e,overview:t,...n===void 0?{}:{presentation:n}})}var GB=document.getElementById(`root`);if(GB===null)throw Error(`NiceEval View root is missing`);var KB=(0,b.createRoot)(GB),qB=jB(()=>KB.unmount());function JB(){return(0,M.jsx)(ga,{router:(0,v.use)(qB)})}function YB(){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:Ko.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:Ko.t(`attempt.title`)})}),(0,M.jsx)(`p`,{role:`status`,children:Ko.t(`report.loadingDetails`)})]}):null]})}var XB=class extends v.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:Ko.t(`app.failed`)})}):this.props.children}};KB.render((0,M.jsx)(v.StrictMode,{children:(0,M.jsx)(XB,{children:(0,M.jsx)(v.Suspense,{fallback:(0,M.jsx)(YB,{}),children:(0,M.jsx)(JB,{})})})}));export{d as a,l as c,h as i,Uo as n,o,yo as r,s,Jo as t};